(this.webpackJsonptaysirfinance_frontend=this.webpackJsonptaysirfinance_frontend||[]).push([[0],{1019:function(e,t){},1021:function(e,t){},1022:function(e,t){},1027:function(e,t){},1029:function(e,t){},1035:function(e,t){},1037:function(e,t){},1056:function(e,t){},1068:function(e,t){},1071:function(e,t){},1089:function(e,t,n){},1209:function(e,t,n){},1210:function(e,t,n){},1211:function(e,t,n){e.exports={container:"style_container__zZVh0",picker:"style_picker__1jaEv",header:"style_header__5KYdn",select:"style_select__aSWV_",image_item:"style_image_item__3KfHP",imgs_container:"style_imgs_container__ATsNa"}},1218:function(e,t,n){"use strict";n.r(t);var a,c=n(2),r=n(71),i=n.n(r),o=n(3),s=n(5),l=n(135),u=n(204),d=n.n(u),j=n(53),b=n.n(j),O=n(273),f=n.n(O),h=n(176),p=n.n(h),m=(n(737),n(738)),x=n.n(m),g=(n(739),n(740)),_=n.n(g),v=n(74),y=n.n(v),C=n(57),I=n(262),E=n(66),S=n(44),D=n(9),N=n(1239),P=n(1255),k=n(1240),A=n(1243),M=n(789),T=n(1256),w=n(1252),B=(n(1241),n(863),n(6)),R=(n(864),Object(D.b)({key:"agencyAtoms",default:[]})),U=n(16),L=Object(D.b)({key:"agencyAtom",default:new function e(){Object(U.a)(this,e)}}),F=Object(D.b)({key:"AgentsAtom",default:[]}),K=new D.b({key:"Airlines",default:[]}),z=Object(D.b)({key:"isLogged",default:!1}),W=new D.b({default:{},key:"ConfigState"}),Y=Object(D.b)({key:"CurrencyAtom",default:[]}),G=n(30),V=(a={error:"Une erreur inattendue s'est produite.",errorHeader:"Op\xe9ration \xe9chou\xe9e",supplier:"Fournisseur",currency:"Devise",service:"service",designation:"D\xe9signation",cost:"Co\xfbt",unitCost:"Co\xfbt unitaire",unitCosts:"Frais unitaires",costs:"Frais",TND:"TND",trip:"Voyage Organis\xe9",umrah:"Omra",luggage:"Bagages",handLuggage:"Bagages \xe0 main",name:"Nom",description:"Description",flightDuration:"Dur\xe9e du vol",class:"Class",totalPrice:"Prix Total",date:"Date",returnDate:"Date de retour",commission:"Commission",commissionB2B:"Commission B2B",departureDate:"Date de d\xe9part",price:"Prix",meal:"Repas",number:"Nombre",flightNumber:"Num\xe9ro de vol",countryDeparture:"Pays de d\xe9part",airport:"A\xe9roport",startingName:"Nom de d\xe9part",countryArrival:"Pays d'arriv\xe9e",arrivalName:"Nom d'arriv\xe9e",arrivalDate:"Date d'arriv\xe9e",day:"Jour",hotel:"H\xf4tel",descriptionPackageDefault:"Vivez une exp\xe9rience spirituelle inoubliable avec notre package Umrah 'Voyage Spirituel de Luxe'. Ce package a \xe9t\xe9 con\xe7u pour vous offrir un confort optimal et une exp\xe9rience enrichissante lors de votre p\xe8lerinage.R\xe9servez d\xe8s maintenant !Ne manquez pas cette opportunit\xe9 de vivre votre Umrah dans le confort et la s\xe9r\xe9nit\xe9. Contactez-nous pour plus d'informations et pour r\xe9server votre place.",firstDestination:"Premi\xe8re Destination",destination:"Destination",departureName:"Nom de d\xe9part"},Object(G.a)(a,"arrivalName","Nom d'arriv\xe9e"),Object(G.a)(a,"longitude","Longitude"),Object(G.a)(a,"latitude","Latitude"),Object(G.a)(a,"categories","Categories"),Object(G.a)(a,"chooseCategories","Choisir des categories"),a),H=function e(){Object(U.a)(this,e),this.id=0,this.name="",this.b2Bcommission=400,this.commission=400,this.nbr_places=0,this.nbr_for_free_place=24,this.isDefault=!1,this.baseCost=0,this.imageUrls=[],this.price=0,this.caracteristique=new q,this.description=V.descriptionPackageDefault,this.idDossAlfresco="",this.prices=[new Z],this.differentFees=[],this.destinations=[],this.disponibilities=[new $],this.packageUmrahCosts=[],this.images=[],this.idsDelete=[],this.extrats=[],this.programId=0,this.isDisplayed=!1,this.categoryIds=[]},q=function e(){Object(U.a)(this,e),this.hasVol=!1,this.hasTransfert=!1,this.hasHotels=!1,this.hasVisa=!1,this.hasMeal=!1,this.hasZemzem=!1,this.transfAirportHotel=!1,this.tranfInterUmrah=!1},Z=function e(){Object(U.a)(this,e),this.id=0,this.packageUmrahId=0,this.typeTraveler="",this.baseCost=0,this.hotelMadinahName="",this.hotelMakkahName="",this.arrangementMadinahDesignation="",this.arrangementMakkahDesignation="",this.price=0,this.isHidden=!1},J=function e(t,n,a){Object(U.a)(this,e),this.id=0,this.packageUmrahId=0,this.providerId=t||0,this.designation="",this.cost=0,this.exchange=a||1,this.currencyId=n||0,this.service=null},X=function e(){Object(U.a)(this,e),this.id=0,this.packageUmrahId=0,this.designation="",this.cost=0},Q=function e(){Object(U.a)(this,e),this.id=0,this.name="",this.order=0,this.nbrDay=1,this.packageUmrahId=0,this.hotelsUmrah=[new te],this.excursionDestIds=[],this.isFirst=!1},$=function e(){Object(U.a)(this,e),this.id=0,this.date="",this.returnDate="",this.onStock=0,this.cost=0,this.commission=400,this.b2BCommission=400,this.airlineId=null,this.transfert=new re,this.flights=[]},ee=function e(t,n){Object(U.a)(this,e),this.id=0,this.name="",this.departDate="",this.arrivalDate="",this.description="",this.departureAirportId=0,this.arrivalAirportId=0,this.airlineId=null|n,this.class="",this.flightNumber="",this.flightDuration="",this.handBaggages=0,this.baggages=0,this.type=t,this.nbrHandBaggages=0,this.nbrBaggages=0},te=function e(t){Object(U.a)(this,e),this.id=0,this.duration=1,this.checkin=new Date,this.exchange=0,this.currencyId=0,this.providerId=0,this.isMakkah=!1,this.name=t||"",this.packageUmrahId=0,this.hotelListId=0,this.destinationId=0,this.arrangements=[],this.packageMealTypes=[],this.caracteristique=new ce},ne=function e(){Object(U.a)(this,e),this.id=0,this.cost=0,this.designation="",this.hotelUmrahId=0,this.unitCost=0,this.typeTraveler=""},ae=function e(){Object(U.a)(this,e),this.id=0,this.hotelId=0,this.totalPrice=0,this.cost=0,this.typeMeal=null},ce=function e(){Object(U.a)(this,e),this.hasWifi=!1,this.hasBreakfast=!1,this.hasLunch=!1,this.hasDinner=!1,this.hasPosition=!1,this.hasVol=!1,this.hasTransfert=!1,this.hasBus=!1,this.hasRoomService=!1,this.hasKettle=!1},re=function e(){Object(U.a)(this,e),this.id=0,this.name="",this.description="",this.packageUmrahId=0,this.caracteristiqueId=0,this.caracteristiques=new ie,this.transfertLists=[new oe]},ie=function e(){Object(U.a)(this,e),this.hasVol=!1,this.hasTransfert=!1,this.hasWifi=!1,this.hasBreakfast=!1,this.hasBus=!1},oe=function e(){Object(U.a)(this,e),this.id=0,this.name="",this.date="",this.departName="",this.departType="",this.arrivalName="",this.arrivalType="",this.modeTransports=[new se],this.paysArrivalId="",this.paysDepartureId=""},se=function e(){Object(U.a)(this,e),this.id=0,this.name="Bus",this.price=0},le=new D.b({default:new H,key:"DefaultTemplateUmrah"}),ue=Object(D.b)({key:"ExchangeAtom",default:[]}),de=Object(D.b)({key:"groupsAtoms",default:[]}),je=n(131),be=n(7),Oe=new D.b({default:{login:"",password:""},key:"ConfigState"}),fe=n(80),he=n(76),pe=n(42),me=n(1);function xe(){var e=Object(D.c)(Oe),t=Object(s.a)(e,2),n=t[0],a=t[1];Object(c.useEffect)((function(){}),[]);return Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom d'utilisateur Nusuk : "}),Object(me.jsx)(fe.a,{value:n.login,onChange:function(e){return a((function(t){return Object(o.a)(Object(o.a)({},t),{},{login:e})}))}})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Mot de passe de Nusuk: "}),Object(me.jsx)(fe.a,{value:n.password,onChange:function(e){return a((function(t){return Object(o.a)(Object(o.a)({},t),{},{password:e})}))}})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Email : "}),Object(me.jsx)(fe.a,{type:"email",value:n.email,onChange:function(e){return a((function(t){return Object(o.a)(Object(o.a)({},t),{},{email:e})}))}})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"T\xe9l\xe9phone : "}),Object(me.jsx)(fe.a,{type:"phone",value:n.phone,onChange:function(e){return a((function(t){return Object(o.a)(Object(o.a)({},t),{},{phone:e})}))}})]}),Object(me.jsx)(he.a,{appearance:"primary",onClick:function(){n.id?B.a.createAPIEndpoint(pe.a.Config).update(n.id,n).then((function(e){return alert("bien modifi\xe9")})):B.a.createAPIEndpoint(pe.a.Config).create(Object(o.a)({},n)).then((function(e){return alert("bien enregistr\xe9")}))},children:"Enregistrer"})]})}var ge=n(13),_e=n.n(ge),ve=n(26),ye=n(23),Ce=n(24),Ie=n(22),Ee=n(19);function Se(e){var t=e.noHead,n=void 0!==t&&t,a=Object(c.useState)([]),r=Object(s.a)(a,2),i=r[0],l=r[1],u=Object(c.useState)(0),d=Object(s.a)(u,2),j=d[0],b=d[1],O=Object(c.useState)({page:1,take:20,clientId:0,date:null}),f=Object(s.a)(O,2),h=f[0],p=f[1],m=Object(D.c)(ye.a),x=Object(s.a)(m,2),g=(x[0],x[1]),_=function(){g((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Ledger,Object(o.a)(Object(o.a)({},h),{},{date:h.date?_e()(h.date).format("DD MMM YYYY"):null}),"/GetAccountFollwoUp").customGet().then((function(e){l(e.data.data),g((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),b(e.data.totalCount)})).catch((function(e){}))};return Object(c.useEffect)((function(){_()}),[h.page,h.take]),Object(me.jsxs)("div",{children:[!n&&Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsx)(Ie.a,{search:function(){return _()}}),Object(me.jsx)(Ce.a,{nameExcel:"FollowUp",noAdd:!0})]}),Object(me.jsx)(Ee.a,{noAdvancedActions:!0,columns:De,rows:i}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:j,limitOptions:[10,20,50,100],limit:h.take,activePage:h.page,onChangePage:function(e){window.scrollTo(0,0),p((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){p((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var De=[{value:"account",name:"Client",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",color:"#4667d1",fontSize:"16px",textTransform:"upperCase",fontWeight:"500"},children:e.name})}},{name:"Mois Avant Pr\xe9c\xe9dent",value:"beforePreviousBalance",render:function(e){return Object(me.jsx)("b",{style:{color:e>=0?"green":"#e33",fontSize:"18px"},children:e?e.toFixed(3)+" ":0})}},{value:"previousBalance",name:"Mois Pr\xe9c\xe9dent",render:function(e){return Object(me.jsx)("b",{style:{color:e>=0?"green":"#e33",fontSize:"18px"},children:e?e.toFixed(3)+" ":0})}},{value:"actualBalance",name:"Ce Mois",render:function(e){return Object(me.jsx)("b",{style:{color:e>=0?"green":"#e33",fontSize:"18px"},children:e?e.toFixed(3)+" ":0})}}],Ne=n(1245),Pe=n(1246),ke=n(1242),Ae=n(1222),Me=n(1253),Te=n(36);function we(e){var t=Object(D.e)(z),n=Object(c.useState)({username:"",password:""}),a=Object(s.a)(n,2),r=a[0],i=a[1],l=Object(c.useState)(""),u=Object(s.a)(l,2),d=u[0],j=u[1];return Object(me.jsxs)("div",{children:[" ",Object(me.jsx)("h1",{style:{color:"rgb(61,117,224)",textAlign:"center",marginBottom:"20px"},children:"Taysir Finance"}),Object(me.jsx)(w.a,{children:Object(me.jsx)(Ne.a,{justify:"center",children:Object(me.jsx)(Ne.a.Item,{colspan:12,children:Object(me.jsx)(Pe.a,{style:{background:"#fff"},header:Object(me.jsx)("h3",{children:"Connexion"}),bordered:!0,children:Object(me.jsxs)(ke.a,{fluid:!0,children:[Object(me.jsxs)(ke.a.Group,{children:[Object(me.jsx)(ke.a.ControlLabel,{children:"Nom d'utilisateur ou email:"}),Object(me.jsx)(ke.a.Control,{name:"username",onChange:function(e){i((function(t){return Object(o.a)(Object(o.a)({},t),{},{username:e})}))}})]}),Object(me.jsxs)(ke.a.Group,{children:[Object(me.jsx)(ke.a.ControlLabel,{children:"Mot de passe :"}),Object(me.jsx)(ke.a.Control,{name:"password",type:"password",onChange:function(e){i((function(t){return Object(o.a)(Object(o.a)({},t),{},{password:e})}))},autoComplete:"off"})]}),d&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:d}),Object(me.jsx)("br",{}),Object(me.jsx)(ke.a.Group,{children:Object(me.jsxs)(Me.a,{children:[Object(me.jsx)(he.a,{appearance:"primary",onClick:function(){r.username&&r.password&&function(){var e={Authorization:"Bearer "+(localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).token:"")};return{login:function(e){return Te.c.post("Auth/Login",e)},register_admin:function(e){return Te.c.post("Auth/",e)},update_profile:function(t){return Te.c.post("Auth/update-profile",t,{headers:e})},reset_password:function(t){return Te.c.post("Auth/resetPassword",t,{headers:e})}}}().login(r).then((function(e){e.data.success?(localStorage.setItem("auth",JSON.stringify(e.data)),t(!0),j("")):j(e.data.message)})).catch((function(e){return j(e.Message)}))},children:"Connexion"}),Object(me.jsx)(he.a,{appearance:"link",children:"Mot de pass oubli\xe9?"})]})})]})})})})})]})}var Be=n(767),Re=n(179),Ue=n(15),Le=n.n(Ue),Fe=n(14),Ke=n(31),ze=n(39),We=n(40),Ye=n(37),Ge=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";Object(U.a)(this,e),this.name=t,this.address=a,this.taxCode=n,this.phones=c,this.code=r,this.emails=i,this.city=o}return Object(Ye.a)(e,[{key:"getPhones",value:function(){return this.phones.split(",")}},{key:"getEmails",value:function(){return this.emails.split(",")}},{key:"setPhones",value:function(e){this.phones=e.join(",")}},{key:"setEmails",value:function(e){console.log(e),console.log(e.join(",")),this.emails=e.join(",")}}]),e}(),Ve=function(e){Object(ze.a)(n,e);var t=Object(We.a)(n);function n(){var e,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(U.a)(this,n),(e=t.call(this)).voCommission=0,e.umrahCommission=0,e.clientType=a,e.isCCA=c,e}return n}(Ge),He=function(e){Object(ze.a)(n,e);var t=Object(We.a)(n);function n(){var e,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(U.a)(this,n),(e=t.call(this)).currencies="",e.serviceTypes=a,e}return Object(Ye.a)(n,[{key:"getCurrencies",value:function(e){this.currencies=e.length?e.reduce((function(e,t){return e+";"+t})):""}}]),n}(Ge),qe=n(10),Ze=n(107),Je=n(98),Xe=n(62),Qe=n(73),$e=n(29),et=n.n($e);var tt=function(e){var t=e._setmodel,n=e.model,a=e.clients,r=e.fetchClients,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(!1),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Xe.a),I=Object(s.a)(C,2),E=I[0],S=I[1],D=Object(c.useState)(""),N=Object(s.a)(D,2),P=N[0],k=N[1],A=Object(c.useState)([]),M=Object(s.a)(A,2),T=M[0],w=M[1],R=Object(c.useState)(!1),U=Object(s.a)(R,2),L=(U[0],U[1]),F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;B.a.createAPIEndpoint(B.a.ENDPOINTS.Check,{q:e,clientId:t||n.clientId},"/autocomplete").customGet().then((function(e){return d(e.data.map((function(e){return{value:e.id,label:e.name}})))}))},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data.map((function(e){return{value:e.id,label:e.name}})))}))};return Object(c.useEffect)((function(){F(),K(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}()}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Client:"}),Object(me.jsx)(Ze.a,{onSearch:function(e){return r(e)},data:[{label:"Tout",value:0}].concat(a.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:n.clientId,onSelect:function(e){F("",e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:n.amount,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{amount:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Type De Paiment : "}),Object(me.jsx)(Ze.a,{data:Fe.s,block:!0,noSearch:!0,value:n.type,onSelect:function(e){t((function(t){var n=Object(o.a)({},t);return 1!=e&&delete n.checkId,2!=e&&delete n.checkoutId,4!=e&&delete n.bankId,Object(o.a)(Object(o.a)({},n),{},{type:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date:"}),Object(me.jsx)(fe.a,{type:"date",value:n.date,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(me.jsx)(fe.a,{value:n.refReglement,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{refReglement:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(me.jsx)("label",{children:"Notes:"}),Object(me.jsx)(fe.a,{value:n.notes,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{notes:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:1==n.type?"Ch\xe9que":4==n.type?"Banque":"Caisse"}),Object(me.jsxs)("div",{style:{display:"inline-block",width:1==n.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(me.jsx)(Ze.a,{renderMenuItem:function(e){return Object(me.jsxs)(me.Fragment,{children:[e.split(" ")[0],Object(me.jsx)("span",{style:{paddingLeft:"8px",color:"#aaa",fontSize:"12px"},children:e.split(" ")[1]})]})},block:!0,data:1==n.type?u:4==n.type?O:m,noSearch:!0,value:n[1==n.type?"checkId":4==n.type?"bankId":"checkoutId"],onSearch:function(e){return F(e)},onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},1==n.type?"checkId":4==n.type?"bankId":"checkoutId",e))}))}})]}),1==n.type&&Object(me.jsx)(Je.a,{size:"sm",onClick:function(){return y(!0)},icon:Object(me.jsx)(et.a,{})})]}),4==n.type&&Object(me.jsxs)(be.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(me.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(me.jsx)(fe.a,{value:n.EmissionBank,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{EmissionBank:e})}))}})]}),v&&1==n.type&&Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsx)(Qe.a,{_delete:function(e){var t=T.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(T[t].name).then((function(e){w((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var n=Object(qe.a)(E.attachments);n.splice(t),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:n})}))})).catch((function(e){}))},upload:function(e,t,n){L(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){L(!1);var a=e.findIndex((function(e){return e.fileKey==n}));w((function(t){var n=Object(qe.a)(e);return n[a].status="finished",n}));var c=Object(qe.a)(E.attachments);c.push(t.data[0].fileName),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:c})}))})).catch((function(t){L(!1);var a=e.findIndex((function(e){return e.fileKey==n}));w((function(t){var n=Object(qe.a)(e);return n[a].status="error",n}))}))},error:P,model:E,banks:O,fetchBanks:K,_setmodel:S}),Object(me.jsx)(he.a,{onClick:function(){var e=Object(Ke.a)(E,[{number:"Num\xe9ro"},{amount:"Montant"},{date:"Date de D\xe9p\xf4t"}]);e?k(e):B.a.createAPIEndpoint(B.a.ENDPOINTS.Check).create(Object(o.a)(Object(o.a)({},E),{},{amount:parseFloat(E.amount),attachments:E.attachments&&E.attachments.join(),clientId:n.clientId})).then((function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{checkId:e.data.id})})),F(E.number),S(new Xe.a),k(""),y(!1),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){k(e.response.data),console.log(e.response.data)}))},appearance:"primary",children:"Enregistrer"})]})]})},nt=n(171),at=n.n(nt),ct=function e(){Object(U.a)(this,e),this.hotelName="",this.arrangement="",this.ticketNumber="",this.totalPrice=0,this.totalRefund=0,this.commission=0,this.fare=0,this.commissionPercent=0,this.regulated_value=0,this.note="",this.dateVol=null,this.date=new Date,this.clientId=0,this.packageId=0,this.extrats=[],this.customer=new rt},rt=function e(){Object(U.a)(this,e),this.name="",this.passportNumber="",this.birthDate=new Date,this.gender=1,this.ageType=1,this.phoneNumber="",this.passportExpiryDate=new Date,this.mrz="",this.sex=1,this.birthCountry="216",this.nationality="216",this.passportDeliveryCountry="216",this.addressCountry="216",this.title=1,this.firstName="",this.lastName="",this.fatherName="",this.motherName="",this.arabicName="",this.arabicLastName="",this.arabicFatherName="",this.arabicGrandFatherName="",this.job="nothing",this.customerType=1},it=function e(){Object(U.a)(this,e),this.date=new Date,this.customer=new rt,this.totalPrice=0,this.totalRefund=0,this.commission=0,this.fare=0,this.commissionPercent=0,this.note="",this.service=8},ot=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;Object(U.a)(this,e),this.amount=0,this.type=1,this.date=null,this.notes="",this.refReglement="",this.isPaid=!1,this.checkId=null,this.bankId=null,this.checkoutId=null,this.EmissionBank="",this.paymentEventType=1,this.paymentEventType=n,this.type=t},st=n(25);function lt(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)({q:"",page:1,take:20}),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(""),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new ot(1,2)),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(ye.a),P=Object(s.a)(N,2),k=(P[0],P[1]),A=function(){S(new ot(1,2)),y("")},M=function(){k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment,m,"/getClientsGuarantees").customGet().then((function(e){r(e.data.data),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){M()}),[m.page,m.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return M()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){x((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{nameExcel:"payments",size:"md",save:function(){var e=Object(Ke.a)(E,[{clientId:"Client"},{amount:"Montant"}]);e?y(e):(k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),E.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).update(E.id,Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount)})).then((function(e){M(),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),A(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).create(Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount)})).then((function(e){M(),A(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:A,AddComponent:Object(me.jsx)(tt,{clients:O,fetchClients:function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))},error:v,model:E,_setmodel:S})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).fetchById(e).then((function(e){S(e.data),e.data.client&&f([e.data.client])}))}(e),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).delete(e).then((function(e){M(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return y(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:ut,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:m.take,activePage:m.page,onChangePage:function(e){window.scrollTo(0,0),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var ut=[{value:"id",name:"Identifiant",render:function(e){return Object(me.jsx)("h5",{children:e})}},{value:"account",name:"Client",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():"-"})}},{value:"amount",name:"Montant",render:function(e){return Object(me.jsx)("b",{children:Object(st.a)(e)})}},{value:"date",name:"Date de D\xe9p\xf4t",render:function(e){return Object(me.jsx)("h6",{style:{fontSize:"12px"},children:_e()(e).format("DD MMM YYYY")})}},{value:"type",name:"Type",render:function(e){return Object(me.jsx)(Re.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:Fe.s.find((function(t){return t.value==e})).label})}},{value:"check",name:"N\xb0 Ch\xe9que",render:function(e){return Object(me.jsx)("b",{children:e||"-"})}},{value:"checkout",name:"Caisse",render:function(e){return Object(me.jsx)("b",{children:e||"-"})}},{name:"Virement",value:"depositBank",value2:"emissionBank",render:function(e,t){return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("b",{children:t?Object(me.jsxs)(me.Fragment,{children:[" ",t," ",Object(me.jsx)(at.a,{})]}):"-"})," ",Object(me.jsx)("b",{children:e||"-"})]})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}}],dt=n(152),jt=n(1244),bt=n(381),Ot=n(777),ft=n.n(Ot),ht=n(50),pt=n(68);function mt(e){var t=e.id,n=Object(c.useState)([]),a=Object(s.a)(n,2),r=a[0],i=a[1],l=Object(c.useState)(0),u=Object(s.a)(l,2),d=(u[0],u[1]),j=Object(c.useState)(0),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(0),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)([]),_=Object(s.a)(g,2),v=(_[0],_[1],Object(c.useRef)()),y=Object(D.c)(ye.a),C=Object(s.a)(y,2),E=(C[0],C[1]),S=Object(c.useState)({page:1,take:100,date:null,dateTo:null,dateFrom:null}),N=Object(s.a)(S,2),P=N[0],k=N[1],A=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Ledger,Object(o.a)(Object(o.a)({},P),{},{clientId:t}),"/getLedgerClientDetails").customGet().then((function(e){console.log(e.data);var t=[];t=t.concat(e.data),i(t);var n=e.data.map((function(e){return e.debit})).reduce((function(e,t){return e+t}));f(n);var a=e.data.map((function(e){return e.credit})).reduce((function(e,t){return e+t}));x(a),d(e.data.length)})).catch((function(e){}))};return Object(c.useEffect)((function(){A()}),[t]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return A()},children:[Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(me.jsx)("label",{children:"Dates: "}),Object(me.jsx)(Ze.a,{data:Fe.q,block:!0,noSearch:!0,value:P.dateType,onSelect:function(e){var t=new Date(_e()(Date.now()).format("yyyy-MM-DD"));console.log(t),k((function(n){return Object(o.a)(Object(o.a)({},n),{},{dateType:e,date:7==e||1==e?t:2==e?_e()(_e()(Date.now()).add(-1,"d")).format("yyyy-MM-DD"):null,dateFrom:6==e?t:3==e?_e()().startOf("month").format("yyyy-MM-DD"):4==e?_e()(Date.now()).subtract(1,"months").startOf("month").format("yyyy-MM-DD"):5==e?_e()().startOf("year").format("yyyy-MM-DD"):null,dateTo:6==e?new Date(_e()(_e()(Date.now()).add(1,"d")).format("yyyy-MM-DD")):3==e?t:4==e?_e()(Date.now()).subtract(1,"months").endOf("month").format("yyyy-MM-DD"):null})}))}})]}),7==P.dateType&&Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(me.jsx)("label",{children:"Date: "}),Object(me.jsx)(fe.a,{type:"date",value:P.date,onChange:function(e){k((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]}),6==P.dateType&&Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(me.jsx)("label",{children:"Plage du temps: "}),Object(me.jsx)(jt.a,{block:!0,value:[P.dateFrom,P.dateTo],onChange:function(e){k((function(t){return Object(o.a)(Object(o.a)({},t),{},{dateFrom:e[0],dateTo:e[1]})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-5",children:[Object(me.jsx)("label",{children:"Service : "}),Object(me.jsx)(Ze.a,{data:Fe.u,block:!0,noSearch:!0,value:P.service,onSelect:function(e){k((function(t){return Object(o.a)(Object(o.a)({},t),{},{service:e})}))}})]})]}),Object(me.jsx)("hr",{}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsxs)(he.a,{onClick:function(){var e=new bt.default;e.autoTable({styles:{lineWidth:0},body:[[{content:"",styles:{minCellHeight:100}}]],startY:20,didDrawCell:function(t){0===t.row.index&&"body"===t.row.section&&e.autoTable({startY:t.cell.y+2,margin:{left:t.cell.x+2},tableWidth:48,styles:{maxCellHeight:4,lineWidth:0},body:[{des:"test"},{des:"address 4000 sousse "}]})}});var t=new Image;t.src="/logo.png",e.addImage(t,"png",10,10,28,8),e.setFontSize(20),e.setTextColor("rgb(76, 103, 194)"),e.text("Kounouz Travel",10,28),e.autoTable({startY:30,body:[{des:"lel"}]}),ft()(e,{startY:50,head:[["Date","D\xe9bit","Crebit","Description","Solde Progressif"]],body:r.map((function(e){return Object.values(e)}))}),e.save("table.pdf")},style:{color:"#fff",background:"rgb(90,44,62)",padding:"8px 30px",margin:"5px"},id:"print",children:[Object(me.jsx)(I.a,{})," Imprimer"]})}),Object(me.jsx)(be.a,{className:"p-10",s:6,m:6,l:6,xl:6,children:Object(me.jsx)(ht.a,{text:"Total D\xe9bit",color:"0,169,141",amount:O})}),Object(me.jsx)(be.a,{className:"p-10",s:6,m:6,l:6,xl:6,children:Object(me.jsx)(ht.a,{text:"Total Cr\xe9dit",amount:m,color:"229,57,53"})}),Object(me.jsx)("div",{ref:v,style:{maxWidth:"1000px"},id:"printedt____",children:Object(me.jsx)(Ee.a,{noAdvancedActions:!0,columns:xt,rows:r})})]})}var xt=[{value:"date",value2:"event",name:"Date",render:function(e,t){return Object(me.jsx)("div",{style:{maxWidth:"150px",padding:"2px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",color:"#4667d1",fontSize:"12px",textTransform:"upperCase",fontWeight:"500"},children:_e()(e).format("yyyy-MM-DD")})}},{value:"description",name:"Description",render:function(e){return Object(me.jsx)("b",{style:{letterSpacing:"1px",color:"#111",fontSize:"12px"},children:e})}},{value:"debit",name:"D\xe9bit",render:function(e){return Object(me.jsx)("b",{style:{fontSize:"16px"},children:e?Object(st.a)(e):0})}},{value:"credit",name:"Cr\xe9dit ",render:function(e){return Object(me.jsx)("b",{style:{fontSize:"16px"},children:e?Object(st.a)(e):0})}},{value:"progressiveBalance",name:"Solde Progressif ",render:function(e){return Object(me.jsx)("b",{style:{fontSize:"16px"},children:e?Object(st.a)(e):0})}}],gt=n(169),_t=n.n(gt);function vt(){var e=Object(c.useState)([]),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(0),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(D.c)(ye.a),h=Object(s.a)(f,2),p=(h[0],h[1]),m=Object(c.useState)(null),x=Object(s.a)(m,2),g=x[0],_=x[1],v=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return O(e.data)}))},y=Object(c.useState)({page:1,take:20,clientId:0,date:null}),C=Object(s.a)(y,2),I=C[0],E=C[1],S=[{value:"account",name:"Client",render:function(e){return Object(me.jsx)("b",{style:{color:"#4667d1",fontSize:"16px",textTransform:"upperCase",cursor:"pointer",fontWeight:"500"},children:e.name})}},{name:"d\xe9tails",value:"account",render:function(e){return Object(me.jsxs)("button",{onClick:function(){return _(e.id)},style:{color:"rgba(67,55,160,1)",padding:"6px 10px",fontSize:"12px",background:"rgba(67,55,160,0.1)",borderRadius:"4px",cursor:"pointer"},children:[Object(me.jsx)(_t.a,{})," "," "]})}},{value:"totalDebit",name:"D\xe9bit Total",render:function(e){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}},{value:"totalCredit",name:"Cr\xe9dit Total",render:function(e){return Object(me.jsxs)("b",{style:{color:"#5a2c3e",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}},{value:"totalGarantee",name:"Garantie",render:function(e){return Object(me.jsxs)("b",{style:{color:"#2c92bf",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}},{value:"totalDebit",value2:"totalCredit",name:"Solde",render:function(e,t){return Object(me.jsxs)("b",{style:{color:t-e<0?"#e33":"#53af50",fontSize:"18px"},children:[(t-e==0?0:Object(st.a)(t-e))+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}}],N=function(){p((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Ledger,Object(o.a)(Object(o.a)({},I),{},{date:I.date?_e()(I.date).format("DD MMM YYYY"):null}),"/getLedgerClient").customGet().then((function(e){a(e.data.data),p((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),u(e.data.totalCount)})).catch((function(e){}))};return Object(c.useEffect)((function(){v()}),[]),Object(c.useEffect)((function(){N()}),[I.page,I.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return N()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return v(e)},data:[{label:"Tout",value:0}].concat(b.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:I.clientId,onSelect:function(e){E((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]})}),Object(me.jsx)(Ce.a,{nameExcel:"GL",noAdd:!0}),Object(me.jsx)(Ee.a,{noAdvancedActions:!0,columns:S,rows:n}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:l,limitOptions:[10,20,50,100],limit:I.take,activePage:I.page,onChangePage:function(e){window.scrollTo(0,0),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){E((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})}),Object(me.jsxs)(dt.a,{size:"lg",overflow:!0,open:g,onClose:function(){return _(null)},children:[Object(me.jsx)(dt.a.Header,{children:Object(me.jsx)(dt.a.Title,{children:"D\xe9tails Transactions"})}),Object(me.jsx)(dt.a.Body,{children:g&&Object(me.jsx)(mt,{id:g})}),Object(me.jsx)(dt.a.Footer,{children:Object(me.jsx)(he.a,{onClick:function(){return _(null)},appearance:"subtle",children:"fermer"})})]})]})}var yt=n(207);var Ct=function(e){var t=e.loading,n=void 0!==t&&t,a=e.amount,c=void 0===a?0:a,r=e.currency,i=void 0===r?"TND":r,o=e.title,s=void 0===o?"Test":o,l=e.increase,u=void 0===l?100:l,d=e.data,j=void 0===d?[{x:0,y:8},{x:1,y:5},{x:2,y:4},{x:3,y:9},{x:4,y:1},{x:5,y:7},{x:6,y:6},{x:7,y:3},{x:8,y:2},{x:9,y:0}]:d,b=e.color,O=void 0===b?"rgb(93,120,255)":b;return Object(me.jsx)("div",{style:{wordWrap:"break-word",border:"1px solid rgba(0, 0, 0, 0.125)",background:"#fff",padding:"10px",boxShadow:" 0 0 10px rgb(28 39 60 / 6%)"},children:n?Object(me.jsx)("div",{}):Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("h6",{style:{textTransform:"uppercase"},children:s}),Object(me.jsxs)("div",{style:{height:"70px",overflow:"hidden",position:"relative",left:"-30px"},children:[" ",Object(me.jsx)(yt.d,{height:100,width:130,color:O,children:Object(me.jsx)(yt.c,{data:j})})]}),Object(me.jsxs)("div",{children:[Object(me.jsx)("span",{style:{fontSize:"15px",fontWeight:"lighter"},children:i})," ",Object(me.jsx)("b",{style:{fontSize:"25px",fontWeight:"bolder"},children:c})]}),Object(me.jsxs)("div",{children:[Object(me.jsxs)("b",{style:{color:u>0?"rgb(84,177,7)":"rgb(221,59,75)"},children:[u," %"]})," ",Object(me.jsx)("i",{children:u>0?"plus \xe9lev\xe9 que le mois pr\xe9c\xe9dent":"inf\xe9rieur par rapport au mois pr\xe9c\xe9dent"})]})]})})};function It(e){var t=e.amount1,n=void 0===t?"850.000":t,a=e.amount2,c=void 0===a?"200.000":a,r=e.ration,i=void 0===r?(200/580).tofixed(2):r,o=e.title,s=void 0===o?"Rapport Vente-Recouvrement":o,l=e.color,u=void 0===l?"rgb(84,177,7)":l;return Object(me.jsxs)("div",{style:{wordWrap:"break-word",border:"1px solid rgba(0, 0, 0, 0.125)",background:"#fff",padding:"10px",boxShadow:" 0 0 10px rgb(28 39 60 / 6%)"},children:[Object(me.jsx)("h4",{style:{textTransform:"uppercase"},children:s}),Object(me.jsx)("div",{style:{backgroundColor:"#eee",height:"10px",borderRadius:"5px",margin:"50px 0 10px 0"},children:Object(me.jsx)("div",{style:{backgroundColor:u,height:"10px",borderRadius:"5px",width:100*i+"%"}})}),Object(me.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Object(me.jsxs)("span",{children:[" ",c]}),Object(me.jsx)("b",{style:{color:u},children:100*i+"%"}),Object(me.jsxs)("span",{children:[" ",n]})]})]})}function Et(e){var t=e.data,n=void 0===t?[{angle:10,radius:10},{angle:10,radius:5},{angle:20,radius:9},{angle:9,radius:8.5},{angle:2,radius:5},{angle:1,radius:7},{angle:2,radius:5},{angle:5,radius:10},{angle:2,radius:8.3},{angle:3,radius:10}]:t;return Object(me.jsxs)("div",{style:{wordWrap:"break-word",border:"1px solid rgba(0, 0, 0, 0.125)",background:"#fff",padding:"10px",boxShadow:" 0 0 10px rgb(28 39 60 / 6%)"},children:[Object(me.jsx)(yt.a,{orientation:"horizontal",height:100,colorRange:St,items:Fe.u.map((function(e){return e.label}))}),Object(me.jsx)(yt.b,{innerRadius:20,padAngle:.03,colorRange:St,data:n,width:300,height:300})]})}var St=["#6588cd","#66b046","#a361c7","#ad953f","#c75a87","#55a47b","#cb6141"];var Dt=function(){return Object(me.jsxs)("div",{children:[Object(me.jsx)(be.a,{m:6,l:3,xl:3,className:"p-10",children:Object(me.jsx)(Ct,{amount:Object(st.a)(999.5),title:"Vente Totale",increase:.18})}),Object(me.jsx)(be.a,{m:6,l:3,xl:3,className:"p-10",children:Object(me.jsx)(Ct,{amount:Object(st.a)(81111.5),title:"Achat Total",increase:-.18,color:"rgb(84,177,7)"})}),Object(me.jsx)(be.a,{m:6,l:3,xl:3,className:"p-10",children:Object(me.jsx)(Ct,{amount:Object(st.a)(999.5),title:"D\xe9pense Totale",color:"rgb(236,182,28)"})}),Object(me.jsx)(be.a,{m:6,l:3,xl:3,className:"p-10",children:Object(me.jsx)(Ct,{amount:"850.000",color:"rgb(84,177,7)"})}),Object(me.jsx)(be.a,{l:6,xl:6,className:"p-10",children:Object(me.jsx)(It,{amount1:Object(st.a)(850),amount2:Object(st.a)(200),ration:Object(st.a)(Number(200/580)),title:"Rapport Vente-Recouvrement",color:"rgb(84,177,7)"})}),Object(me.jsx)(be.a,{l:6,xl:6,className:"p-10",children:Object(me.jsx)(It,{amount1:Object(st.a)(9990),amount2:Object(st.a)(6e3),ration:Object(st.a)(Number(6e3/9990)),title:"Rapport Achat-Paiement",color:"red"})}),Object(me.jsx)(be.a,{l:5,xl:5,className:"p-10",children:Object(me.jsx)(Et,{})}),Object(me.jsx)(be.a,{l:7,xl:7,className:"p-10",children:Object(me.jsxs)("div",{style:{wordWrap:"break-word",border:"1px solid rgba(0, 0, 0, 0.125)",background:"#fff",padding:"10px",boxShadow:" 0 0 10px rgb(28 39 60 / 6%)"},children:[Object(me.jsx)("h6",{children:"SUIVIE CLIENTS"}),Object(me.jsx)("br",{}),Object(me.jsx)(Se,{noHead:!0})]})})]})},Nt=n(1247),Pt=n(203),kt=n(1220),At=Object(D.b)({key:"saleSate",default:new it}),Mt=(Object(D.b)({key:"services",default:[]}),n(128)),Tt=n(43),wt=n.n(Tt),Bt=n(77),Rt=n.n(Bt),Ut=function e(){Object(U.a)(this,e),this.ProviderId=0,this.tags=[],this.attachments=[],this.currencyId="",this.package=new Lt,this.note="",this.payments=[]},Lt=function e(){Object(U.a)(this,e),this.packageItems=[]},Ft=function e(){Object(U.a)(this,e),this.service=0,this.unitCost=0,this.totalCost=0,this.commission=0,this.unitFee=0,this.qty=1,this.note=""},Kt=function e(){Object(U.a)(this,e),this.amount=0,this.type=1,this.date=null,this.notes="",this.refReglement="",this.checkId=0,this.bankId=0,this.checkoutId=0,this.EmissionBank="",this.paymentEventType=3},zt=Object(D.b)({key:"purchaseSate",default:new Ut}),Wt=function e(){Object(U.a)(this,e),this.attachments=[],this.currencyId="",this.note="",this.payments=[]},Yt=function e(){Object(U.a)(this,e),this.amount=0,this.type=1,this.date=null,this.notes="",this.refReglement="",this.checkId=0,this.bankId=0,this.checkoutId=0,this.EmissionBank="",this.paymentEventType=2},Gt=Object(D.b)({key:"expenseSate",default:new Wt}),Vt={verticalAlign:"top"};var Ht=function(e){var t=e.error,n=Object(c.useState)(0),a=Object(s.a)(n,2),r=a[0],i=a[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(Nt.a,{current:r,style:Vt,children:[Object(me.jsx)(Nt.a.Item,{title:"Infos G\xe9nerales",onClick:function(){return i(0)}}),Object(me.jsx)(Nt.a.Item,{onClick:function(){return i(1)},title:"Paiement"}),Object(me.jsx)(Nt.a.Item,{title:"Attachments",onClick:function(){return i(2)}})]}),Object(me.jsx)("div",{style:{padding:"40px 10px"},children:r?1==r?Object(me.jsx)(Jt,{}):Object(me.jsx)(Xt,{}):Object(me.jsx)(qt,{})}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{})]})},qt=function(){var e=Object(D.c)(Gt),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(D.d)(Y);return Object(c.useEffect)((function(){r&&r.length&&!n.currencyId&&a((function(e){return Object(o.a)(Object(o.a)({},n),{},{currencyId:r[0].id})}))}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Date de D\xe9pense: "}),Object(me.jsx)(fe.a,{type:"date",value:n.date,onChange:function(e){console.log(e),a((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}}),Object(me.jsx)("label",{children:"D\xe9signation: "}),Object(me.jsx)(fe.a,{value:n.note,onChange:function(e){console.log(e),a((function(t){return Object(o.a)(Object(o.a)({},t),{},{note:e})}))}}),Object(me.jsx)("label",{children:"Devise: "}),Object(me.jsx)(Ze.a,{data:r.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:n.currencyId,onSelect:function(e){a((function(t){return Object(o.a)(Object(o.a)({},t),{},{currencyId:e})}))}})]})},Zt=[{value:"amount",name:"Montant",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"type",name:"Type",render:function(e){return Object(me.jsx)(Re.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:Fe.s.find((function(t){return t.value==e}))&&Fe.s.find((function(t){return t.value==e})).label})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}}],Jt=function(){var e=Object(c.useState)([]),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(D.c)(Gt),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)([]),j=Object(s.a)(d,2),O=j[0],f=j[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(!1),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Xe.a),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(c.useState)(""),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(c.useState)([]),T=Object(s.a)(M,2),w=T[0],R=T[1],U=Object(c.useState)(!1),L=Object(s.a)(U,2),F=(L[0],L[1]),K=Object(c.useState)(new Yt),z=Object(s.a)(K,2),W=z[0],Y=z[1],V=function(){Y(new Kt)},H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data.map((function(e){return{value:e.id,label:e.name}})))}))};return Object(c.useEffect)((function(){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Check,{q:e},"/autocomplete").customGet().then((function(e){return a(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}(),H(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}()}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.02)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:W.amount,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{amount:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Type De Paiment : "}),Object(me.jsx)(Ze.a,{data:Fe.s,block:!0,noSearch:!0,value:W.type,onSelect:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{type:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Date:"}),Object(me.jsx)(fe.a,{type:"date",value:l.date,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(me.jsx)(fe.a,{value:W.refReglement,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{refReglement:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(me.jsx)("label",{children:"Notes:"}),Object(me.jsx)(fe.a,{value:W.notes,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{notes:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:1==W.type?"Ch\xe9que":4==W.type?"Banque":"Caisse"}),Object(me.jsxs)("div",{style:{display:"inline-block",width:1==W.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(me.jsx)(Ze.a,{block:!0,data:1==W.type?n:4==W.type?O:m,noSearch:!0,value:W[1==W.type?"checkId":4==W.type?"bankId":"checkoutId"],onSelect:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},1==W.type?"checkId":4==W.type?"bankId":"checkoutId",e))}))}})]}),1==W.type&&Object(me.jsx)(Je.a,{size:"sm",onClick:function(){return y(!0)},icon:Object(me.jsx)(et.a,{})})]}),4==W.type&&Object(me.jsxs)(be.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(me.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(me.jsx)(fe.a,{value:W.EmissionBank,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{EmissionBank:e})}))}})]}),v&&1==W.type&&Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsx)(Qe.a,{_delete:function(e){var t=w.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(w[t].name).then((function(e){R((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var n=Object(qe.a)(E.attachments);n.splice(t),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:n})}))})).catch((function(e){}))},upload:function(e,t,n){F(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){F(!1);var a=e.findIndex((function(e){return e.fileKey==n}));R((function(t){var n=Object(qe.a)(e);return n[a].status="finished",n}));var c=Object(qe.a)(E.attachments);c.push(t.data[0].fileName),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:c})}))})).catch((function(t){F(!1);var a=e.findIndex((function(e){return e.fileKey==n}));R((function(t){var n=Object(qe.a)(e);return n[a].status="error",n}))}))},error:k,model:E,banks:O,fetchBanks:H,_setmodel:S}),Object(me.jsx)(he.a,{onClick:function(){var e=Object(Ke.a)(E,[{number:"Num\xe9ro"},{status:"Status"},{amount:"Montant"},{depositDate:"Date de D\xe9p\xf4t"}]);e?A(e):(a((function(e){return[{value:-1,label:E.number+"("+(O.find((function(e){return e.value==E.depositBankId}))?O.find((function(e){return e.value==E.depositBankId})).label:"")+")"}].concat(Object(qe.a)(e))})),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{check:Object(o.a)(Object(o.a)({},E),{},{amount:parseFloat(E.amount),attachments:E.attachments&&E.attachments.join(),clientId:l.clientId}),checkId:-1})})),S(new Xe.a),A(""),y(!1))},appearance:"primary",children:"Enregistrer"})]}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsx)(Me.a,{children:Object(me.jsx)(Je.a,{onClick:function(){u((function(e){console.log(e);var t=Object(o.a)({},e);if("object"!=typeof t.payments&&(t.payments=[]),"number"==typeof W.index){var n=Object(qe.a)(t.payments);n[W.index]=W,t.payments=Object(qe.a)(n)}else{var a=Object(qe.a)(t.payments);a.push(W),t.payments=Object(qe.a)(a)}return t})),V()},appearance:"primary",color:"blue",icon:Object(me.jsx)(b.a,{}),children:"Ajouter"})})})]}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)(Ee.a,{editAction:function(e){Y(Object(o.a)(Object(o.a)({},l.payments[e]),{},{index:e}))},deleteAction:function(e){u((function(t){var n=Object(o.a)({},t),a=Object(qe.a)(n.payments);return a.splice(e,1),n.payments=Object(qe.a)(a),n})),V()},actionKey:"index",noAdvancedActions:!0,columns:Zt,rows:l.payments?l.payments.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{index:t})})):[]})]})},Xt=function(){var e=Object(D.c)(At),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)(!1),j=Object(s.a)(d,2),b=j[0],O=j[1];return Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsx)(kt.a,{loading:b,autoUpload:!1,fileList:l,action:"#",draggable:!0,onRemove:function(e){return function(e){var t=l.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(n.attachments[t].name).then((function(e){u((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var c=Object(qe.a)(n.attachments);c.splice(t),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:c})}))})).catch((function(e){}))}(e.fileKey)},onChange:function(e){console.log(e);var t=e.filter((function(e){return"finished"!=e.status})).reverse()[0];t&&function(e,t,c){O(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){O(!1);var r=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var n=Object(qe.a)(e);return n[r].status="finished",n}));var i=Object(qe.a)(n.attachments);i.push({name:t.data[0].fileName}),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:i})}))})).catch((function(t){O(!1);var n=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var a=Object(qe.a)(e);return a[n].status="error",a}))}))}(e,t.blobFile,t.fileKey)},children:Object(me.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(me.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(me.jsx)(Rt.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),b&&Object(me.jsx)(me.Fragment,{})]})};function Qt(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(0),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({page:1,take:20,status:0,date:null}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(""),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(Gt),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(D.c)(ye.a),T=Object(s.a)(M,2),w=(T[0],T[1]),R=function(){A(new Wt),S("")},U=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return d(e.data)}))},L=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))},F=function(){w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Expense,Object(o.a)(Object(o.a)({},v),{},{date:v.date?_e()(v.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),x(e.data.totalCount)})).catch((function(e){S(e.Message),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){U(),L()}),[]),Object(c.useEffect)((function(){F()}),[v.page,v.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return F()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Status du Paiement: "}),Object(me.jsx)(Ze.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(Fe.j),block:!0,noSearch:!0,value:v.status,onSelect:function(e){y((function(t){return Object(o.a)(Object(o.a)({},t),{},{status:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date du d\xe9pense: "}),Object(me.jsx)(fe.a,{type:"date",value:v.date,onChange:function(e){y((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{nameExcel:"Expense",size:"lg",save:function(){console.log(k),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)(Object(o.a)({},k),{},{payments:Object(qe.a)(k.payments.map((function(e){return Object(o.a)(Object(o.a)({},e),{},{amount:parseFloat(e.amount),date:e.date?e.date:new Date,providerId:k.providerId})}))),attachments:k.attachments?k.attachments.map((function(e){return e.name})).join():""});k.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Expense).update(e.id,e).then((function(e){F(),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),R(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){S(e.Message),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Expense).create(e).then((function(e){F(),R(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){S(e.Message),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Ht,{checkouts:O,fetchCheckouts:L,error:E,banks:u,fetchBanks:U})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){S(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Expense).fetchById(e).then((function(e){A(Object(o.a)(Object(o.a)({},e.data),{},{depositDate:new Date(e.data.depositDate)}))})).catch((function(e){console.log(e)}))}(e),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Expense).delete(e).then((function(e){F(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return S(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:$t,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:m,limitOptions:[10,20,50,100],limit:v.take,activePage:v.page,onChangePage:function(e){return y((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),y((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var $t=[{value:"note",name:"D\xe9signation",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}},{value:"totatlAmount",value2:"currency",name:"Montant Total",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})}},{value:"date",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}}],en=n(790),tn=function e(){Object(U.a)(this,e),this.prices=[],this.clients=[],this.note=""},nn=function e(){Object(U.a)(this,e),this.clients=[],this.note=""},an=new D.b({key:"ForcastAtom",default:new tn,reset:!0}),cn=new D.b({key:"ForcastVoAtom",default:new nn,reset:!0});var rn=function(e){var t=e.error,n=e.clients,a=e.fetchClients,r=e.vols,i=void 0===r?[]:r,l=e.packs,u=void 0===l?[]:l,d=Object(c.useState)(0),j=Object(s.a)(d,2),b=(j[0],j[1],Object(D.c)(an)),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)([]),m=Object(s.a)(p,2),x=m[0],g=m[1],_=Object(c.useState)({nbr:1}),v=Object(s.a)(_,2),y=v[0],I=v[1],E=Object(c.useState)(null),S=Object(s.a)(E,2),N=S[0],P=S[1],k=function(e){e=e.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{h:e.hotelMakkahName+" - "+e.hotelMadinahName,index:t})}));var t=new Set(e.map((function(e){return e.h})));console.log(t);var n={};t.forEach((function(t){n[t]=e.filter((function(e){return e.h==t}))})),P(n)};return Object(c.useEffect)((function(){var e=u.find((function(e){return e.id==f.packageUmrahId}));e&&(k(e.prices.filter((function(e){return!e.isHidden}))),g(e))}),[f.packageUmrahId]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{style:{padding:"40px 10px"},children:[Object(me.jsx)("label",{children:"Vols : "}),Object(me.jsx)(Ze.a,{data:i.map((function(e,t){return{label:Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",background:t%2?"rgb(70,103,209,0.2)":"",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ( ",Object(me.jsx)("i",{style:{color:"#999"},children:u&&u.find((function(t){return t.id==e.packageUmrahId}))&&u.find((function(t){return t.id==e.packageUmrahId})).name})," )"]})]}),Object(me.jsx)("b",{className:"p-5",children:Object(me.jsx)("span",{style:{background:"#121238",color:"#fff",width:"30px",height:"30px",textAlign:"center",lineHeight:"30px",display:"inline-block"},children:e.onStock})})]}),value:e.id}})),block:!0,noSearch:!0,value:f.disponibilityId,onSelect:function(e){var t=u.find((function(t){return t.disponibilities.find((function(t){return t.id==e}))}));k(u.find((function(t){return t.disponibilities.find((function(t){return t.id==e}))})).prices.filter((function(e){return!e.isHidden}))),h((function(n){return Object(o.a)(Object(o.a)({},n),{},{disponibilityId:e,packageUmrahId:t.id})}))}}),x&&Object(me.jsxs)("table",{children:[Object(me.jsx)("thead",{children:Object(me.jsxs)("tr",{children:[Object(me.jsx)("th",{children:"-"}),Object(me.jsx)("th",{children:"Designation"}),Object(me.jsx)("th",{children:"Commission"}),Object(me.jsx)("th",{children:"QUAD"}),Object(me.jsx)("th",{children:"TRIPLE"}),Object(me.jsx)("th",{children:"DOUBLE"})]})}),Object(me.jsx)("tbody",{children:x.hotels&&x.hotels.length&&N&&Object.keys(N).map((function(e,t){return Object(me.jsxs)("tr",{style:{background:t%2?"rgb(244,81,108,0)":"rgb(70,103,209,0.2)",borderBottom:"3px solid #eee"},children:[Object(me.jsx)("td",{children:Object(me.jsx)(en.a,{onChange:function(t){var n=Object(qe.a)(f.prices);n=f.prices&&f.prices.find((function(t){return t.priceUmrahId==N[e][0].id}))?n.filter((function(t){return!N[e].find((function(e){return e.id==t.priceUmrahId}))})):n.concat(N[e].map((function(e){return{priceUmrahId:e.id}}))),console.log(n),h((function(e){return Object(o.a)(Object(o.a)({},e),{},{prices:n})}))},checked:null!=f.prices.find((function(t){return N[e][0].id==t.priceUmrahId}))})}),Object(me.jsx)("td",{children:Object(me.jsx)("h6",{children:e})}),Object(me.jsx)("td",{children:Object(st.a)(x.b2Bcommission)}),Object(me.jsx)("td",{children:N[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("QUAD")}))?Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("b",{children:[" ",Object(st.a)(N[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("QUAD")})).price)]})," "]}):0}),Object(me.jsx)("td",{children:N[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE")}))?Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("b",{children:[Object(st.a)(N[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE")})).price)," "]})}):0}),Object(me.jsx)("td",{children:N[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE")}))?Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("b",{children:[" ",Object(st.a)(N[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE")})).price)," "]})}):0})]})}))})]}),Object(me.jsx)("hr",{}),Object(me.jsxs)(be.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(me.jsx)("label",{children:"Date D'option: "}),Object(me.jsx)("input",{style:{display:"block",width:"100%"},type:"date",value:"string"==typeof f.optionDate?f.optionDate.substring(0,10):f.optionDate,onChange:function(e){var t=e.target.value;h((function(e){return Object(o.a)(Object(o.a)({},e),{},{optionDate:t})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(me.jsx)("label",{children:"Nombre De Pr\xe9vision: "}),Object(me.jsx)(fe.a,{type:"number",value:f.virtualStock,onChange:function(e){return h((function(t){return Object(o.a)(Object(o.a)({},t),{},{virtualStock:parseInt(e)})}))}})]}),Object(me.jsx)("hr",{}),Object(me.jsxs)(be.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return a(e)},data:[{label:"Tout",value:0}].concat(n.filter((function(e){return!f.clients.some((function(t){return t.clientId==e.id}))})).map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:f.clientId,onSelect:function(e){I({clientId:e,client:n.find((function(t){return t.id==e})),nbr:1})}})]}),Object(me.jsxs)(be.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(me.jsx)("label",{children:"Nombre: "}),Object(me.jsx)(fe.a,{type:"number",value:y.nbr,onChange:function(e){return I((function(t){return Object(o.a)(Object(o.a)({},t),{},{nbr:parseInt(e)})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",s:2,m:2,xl:1.5,l:1.2,children:[Object(me.jsx)("label",{children:"."}),Object(me.jsx)(he.a,{color:"violet",appearance:"primary",block:!0,onClick:function(){y.clientId&&h((function(e){return Object(o.a)(Object(o.a)({},e),{},{clients:[].concat(Object(qe.a)(e.clients),[y])})})),I({nbr:1,clientId:0})},children:"Ajout +"})]}),Object(me.jsxs)("table",{children:[Object(me.jsx)("thead",{children:Object(me.jsxs)("tr",{children:[Object(me.jsx)("th",{children:"Client"})," ",Object(me.jsx)("th",{children:"Nombre"}),Object(me.jsx)("th",{})]})}),Object(me.jsxs)("tbody",{children:[f.clients&&f.clients.map((function(e,t){return Object(me.jsxs)("tr",{children:[Object(me.jsx)("td",{children:e.client&&e.client.name})," ",Object(me.jsx)("td",{children:Object(me.jsx)(fe.a,{value:e.nbr,onChange:function(n){return h((function(a){var c=Object(qe.a)(a.clients);return c[t]=Object(o.a)(Object(o.a)({},e),{},{nbr:parseInt(n)}),Object(o.a)(Object(o.a)({},a),{},{clients:c})}))}})}),Object(me.jsx)("td",{children:Object(me.jsxs)("button",{onClick:function(){return h((function(t){return Object(o.a)(Object(o.a)({},t),{},{clients:t.clients.filter((function(t){return t.clientId!=e.clientId}))})}))},children:[" ",Object(me.jsx)(C.d,{})]})})]})})),Object(me.jsxs)("tr",{children:[Object(me.jsx)("td",{children:Object(me.jsx)("b",{children:"Total"})})," ",Object(me.jsx)("td",{children:f.clients.reduce((function(e,t){return e+t.nbr}),0)})]})]})]})]}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("style",{jsx:!0,children:"\n table {\n margin-top: 25px;\n }\n thead {\n background: #232350;\n color: #fff;\n height: 35px;\n }\n td {\n padding: 5px;\n }\n th {\n padding: 3px 6px;\n }\n "})]})},on=["ecb61c","b743ae","99c262","2590b5","ffd06d","a90e43","87a910","ff8200","008f96","7986cb","2590b5","ffd06d"],sn=function(e){console.log(e);var t=e.map((function(e){return e.items.map((function(e){return e.client}))})).reduce((function(e,t){return e.concat(t)}),[]);t=t.filter((function(e,n){var a=JSON.stringify(e);return n===t.findIndex((function(e){return JSON.stringify(e)===a}))})),console.log(t);var n=[{title:"-",width:{wpx:70}},{title:"Vol",width:{wpx:120}},{title:"Pr\xe9vision",width:{wpx:120}},{title:"Airline",width:{wpx:50}}];if(t.map((function(e,t){return n=n.concat([{title:e?e.name.toUpperCase().replace("KOUNOUZ","").trim():"",width:{wpx:100},style:{fill:{fgColor:{rgb:t%2?"ffffff":on[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}},{title:"-",style:{fill:{fgColor:{rgb:t%2?"ffffff":on[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}])})),e&&e.length)return[{columns:n,data:e.map((function(e,n){var a=[{value:e.disponibility?e.disponibility.onStock-e.items.reduce((function(e,t){return e+t.nbr}),0):"-",style:{fill:{fgColor:{rgb:e.disponibility.onStock-e.items.reduce((function(e,t){return e+t.nbr}),0)>0?"66ff66":e.disponibility.onStock-e.items.reduce((function(e,t){return e+t.nbr}),0)==0?"ffffff":"ff6666"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.disponibility?_e()(e.disponibility.date).format("DD MMM yyyy"):"-",style:{fill:{fgColor:{rgb:n%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.disponibility?e.disponibility.onStock:"-",style:{fill:{fgColor:{rgb:n%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.disponibility.airline?e.disponibility.airline.logo.replace("https://images.kiwi.com/airlines/64/","").replace(".png",""):"",style:{fill:{fgColor:{rgb:n%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}}];return t.map((function(t,n){a=a.concat([{value:e.items.find((function(e){return t&&e.clientId==t.id}))?e.items.find((function(e){return t&&e.clientId==t.id})).nbr:0,width:{wpx:100},style:{fill:{fgColor:{rgb:n%2?"ffffff":on[n%9]}},font:{sz:"12"},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.items.find((function(e){return e.clientId==t.id}))?e.items.find((function(e){return e.clientId==t.id})).designation:"-",style:{fill:{fgColor:{rgb:n%2?"ffffff":on[n%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}])})),a}))}]};function ln(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=(l[0],l[1]),d=Object(c.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(c.useState)([]),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(c.useState)(0),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)({page:1,take:20,providerId:0,status:0,date:null}),C=Object(s.a)(y,2),I=C[0],E=C[1],S=Object(c.useState)(""),N=Object(s.a)(S,2),P=N[0],k=N[1],A=Object(D.c)(an),M=Object(s.a)(A,2),T=M[0],w=M[1],R=Object(c.useState)([]),U=Object(s.a)(R,2),L=U[0],F=U[1],K=Object(c.useState)([]),z=Object(s.a)(K,2),W=z[0],Y=z[1],G=Object(D.c)(ye.a),V=Object(s.a)(G,2),H=(V[0],V[1]),q=function(){w(new tn),k("")},Z=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?u(e.data):O(e.data)}))},J=function(){H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Forcast,Object(o.a)(Object(o.a)({},I),{},{date:I.date?_e()(I.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),function(e){e.map((function(e){return e.disponibility}));var t=e.map((function(e){var t=[];return e.clients.forEach((function(n){var a=e.prices.map((function(t){return{disponibilityId:e.disponibilityId,disponibility:e.disponibility,client:n.client,clientId:n.clientId,nbr:n.nbr,designation:t.priceUmrah.hotelMadinahName+" - "+t.priceUmrah.hotelMakkahName}}));a=a.filter((function(e,t){var n=JSON.stringify(e);return t===a.findIndex((function(e){return JSON.stringify(e)===n}))}));var c=Object(o.a)({},a[0]);a.forEach((function(e){c.designation=c.designation+" / "+e.designation})),t.push(c)})),t}));t=t.reduce((function(e,t){return e.concat(t)}),[]);var n=new Set(t.map((function(e){return e.disponibilityId}))),a=[];n.forEach((function(e){a.push({disponibilityId:e,disponibility:t.filter((function(t){return t.disponibilityId==e}))[0].disponibility,items:t.filter((function(t){return t.disponibilityId==e}))})})),console.log(a),m(a)}(e.data.data.filter((function(e){return e.prices.length}))),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),v(e.data.totalCount)})).catch((function(e){k(e.Message),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};Object(c.useEffect)((function(){var e;Z(),("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){F(e.data);var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities.map((function(e){return Object(o.a)({packageUmrahId:t.id},e)})))}),[]);Y(t.filter((function(e){return e.onStock})))}))}),[]),Object(c.useEffect)((function(){J()}),[I.page,I.take]);var X=[{value:"disponibility",name:"Vol",render:function(e){return Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:L&&L.find((function(t){return t.id==e.packageUmrahId}))&&L.find((function(t){return t.id==e.packageUmrahId})).name})," ",")"]})]}),Object(me.jsx)("b",{className:"p-5",children:Object(me.jsx)("span",{style:{background:"#121238",color:"#fff",width:"30px",height:"30px",textAlign:"center",lineHeight:"30px",display:"inline-block"},children:e.onStock})})]})}},{value:"virtualStock",name:"Nombre De Pr\xe9vision",render:function(e){return Object(me.jsx)("b",{style:{color:"#53af50",fontSize:"18px"},children:e})}},{value:"optionDate",name:"Date D'option",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}},{value:"note",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}}];return Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return J()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{data:L?[{label:"Tout",value:0}].concat(L.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,value:I.packageUmrahId,onSelect:function(e){E((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]})}),Object(me.jsx)(Ce.a,{excelData:p&&p.length?sn(p):sn([]),nameExcel:L&&L.find((function(e){return I.packageUmrahId==e.id}))?L.find((function(e){return I.packageUmrahId==e.id})).name:"forcast",size:"lg",save:function(){console.log(T),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},T);e.clients=e.clients.map((function(e){var t=Object(o.a)({},e);return delete t.client,t})),T.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Forcast).update(e.id,e).then((function(e){J(),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),q(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){k(e.Message),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Forcast).create(e).then((function(e){J(),q(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){k(e.Message),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:q,AddComponent:Object(me.jsx)(rn,{vols:W,packs:L,fetchClients:function(e){return Z(e,!1)},clients:b,error:P})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){k(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Forcast).fetchById(e).then((function(e){w(Object(o.a)({},e.data))})).catch((function(e){console.log(e)}))}(e),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Forcast).delete(e).then((function(e){J(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return k(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:X,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:_,limitOptions:[10,20,50,100],limit:I.take,activePage:I.page,onChangePage:function(e){window.scrollTo(0,0),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var un=function(e){var t=e.error,n=e.clients,a=e.fetchClients,r=e.vols,i=void 0===r?[]:r,l=e.packs,u=void 0===l?[]:l,d=Object(c.useState)(0),j=Object(s.a)(d,2),b=(j[0],j[1],Object(D.c)(cn)),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)([]),m=Object(s.a)(p,2),x=(m[0],m[1],Object(c.useState)({nbr:1})),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)(null),I=Object(s.a)(y,2);return I[0],I[1],Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{style:{padding:"40px 10px"},children:[Object(me.jsx)("label",{children:"Vols : "}),Object(me.jsx)(Ze.a,{data:i.map((function(e,t){return{label:Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",background:t%2?"rgb(70,103,209,0.2)":"",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:u&&u.find((function(t){return t.id==e.packageId}))&&u.find((function(t){return t.id==e.packageId})).name})," ",")"]})]}),Object(me.jsx)("b",{className:"p-5",children:Object(me.jsx)("span",{style:{background:"#121238",color:"#fff",width:"30px",height:"30px",textAlign:"center",lineHeight:"30px",display:"inline-block"},children:e.onStock})})]}),value:e.id}})),block:!0,noSearch:!0,value:f.disponibilityId,onSelect:function(e){var t=u.find((function(t){return t.disponibilities.find((function(t){return t.id==e}))}));h((function(n){return Object(o.a)(Object(o.a)({},n),{},{disponibilityId:e,packageId:t.id})}))}}),Object(me.jsx)("hr",{}),Object(me.jsxs)(be.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(me.jsx)("label",{children:"Date D'option: "}),Object(me.jsx)("input",{style:{display:"block",width:"100%"},type:"date",value:"string"==typeof f.optionDate?f.optionDate.substring(0,10):f.optionDate,onChange:function(e){var t=e.target.value;h((function(e){return Object(o.a)(Object(o.a)({},e),{},{optionDate:t})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(me.jsx)("label",{children:"Nombre De Pr\xe9vision: "}),Object(me.jsx)(fe.a,{type:"number",value:f.virtualStock,onChange:function(e){return h((function(t){return Object(o.a)(Object(o.a)({},t),{},{virtualStock:parseInt(e)})}))}})]}),Object(me.jsx)("hr",{}),Object(me.jsxs)(be.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return a(e)},data:[{label:"Tout",value:0}].concat(n.filter((function(e){return!f.clients.some((function(t){return t.clientId==e.id}))})).map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:f.clientId,onSelect:function(e){v({clientId:e,client:n.find((function(t){return t.id==e})),nbr:1})}})]}),Object(me.jsxs)(be.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(me.jsx)("label",{children:"Nombre: "}),Object(me.jsx)(fe.a,{type:"number",value:_.nbr,onChange:function(e){return v((function(t){return Object(o.a)(Object(o.a)({},t),{},{nbr:parseInt(e)})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",s:2,m:2,xl:1.5,l:1.2,children:[Object(me.jsx)("label",{children:"."}),Object(me.jsx)(he.a,{color:"violet",appearance:"primary",block:!0,onClick:function(){_.clientId&&h((function(e){return Object(o.a)(Object(o.a)({},e),{},{clients:[].concat(Object(qe.a)(e.clients),[_])})})),v({nbr:1,clientId:0})},children:"Ajout +"})]}),Object(me.jsxs)("table",{children:[Object(me.jsx)("thead",{children:Object(me.jsxs)("tr",{children:[Object(me.jsx)("th",{children:"Client"})," ",Object(me.jsx)("th",{children:"Nombre"}),Object(me.jsx)("th",{})]})}),Object(me.jsxs)("tbody",{children:[f.clients&&f.clients.map((function(e,t){return Object(me.jsxs)("tr",{children:[Object(me.jsx)("td",{children:e.client&&e.client.name})," ",Object(me.jsx)("td",{children:Object(me.jsx)(fe.a,{value:e.nbr,onChange:function(n){return h((function(a){var c=Object(qe.a)(a.clients);return c[t]=Object(o.a)(Object(o.a)({},e),{},{nbr:parseInt(n)}),Object(o.a)(Object(o.a)({},a),{},{clients:c})}))}})}),Object(me.jsx)("td",{children:Object(me.jsxs)("button",{onClick:function(){return h((function(t){return Object(o.a)(Object(o.a)({},t),{},{clients:t.clients.filter((function(t){return t.clientId!=e.clientId}))})}))},children:[" ",Object(me.jsx)(C.d,{})]})})]})})),Object(me.jsxs)("tr",{children:[Object(me.jsx)("td",{children:Object(me.jsx)("b",{children:"Total"})})," ",Object(me.jsx)("td",{children:f.clients.reduce((function(e,t){return e+t.nbr}),0)})]})]})]})]}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("style",{jsx:!0,children:"\n table {\n margin-top: 25px;\n }\n thead {\n background: #232350;\n color: #fff;\n height: 35px;\n }\n td {\n padding: 5px;\n }\n th {\n padding: 3px 6px;\n }\n "})]})},dn=["ecb61c","b743ae","99c262","2590b5","ffd06d","a90e43","87a910","ff8200","008f96","7986cb","2590b5","ffd06d"],jn=function(e){console.log(e);var t=e.map((function(e){return e.items.map((function(e){return e.client}))})).reduce((function(e,t){return e.concat(t)}),[]);t=t.filter((function(e,n){var a=JSON.stringify(e);return n===t.findIndex((function(e){return JSON.stringify(e)===a}))})),console.log(t);var n=[{title:"-",width:{wpx:70}},{title:"Vol",width:{wpx:120}},{title:"Pr\xe9vision",width:{wpx:120}},{title:"Airline",width:{wpx:50}}];if(t.map((function(e,t){return n=n.concat([{title:e?e.name.toUpperCase().replace("KOUNOUZ","").trim():"",width:{wpx:100},style:{fill:{fgColor:{rgb:t%2?"ffffff":dn[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}},{title:"-",style:{fill:{fgColor:{rgb:t%2?"ffffff":dn[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}])})),e&&e.length)return[{columns:n,data:e.map((function(e,n){var a=[{value:e.disponibility?e.disponibility.onStock-e.items.reduce((function(e,t){return e+t.nbr}),0):"-",style:{fill:{fgColor:{rgb:e.disponibility.onStock-e.items.reduce((function(e,t){return e+t.nbr}),0)>0?"66ff66":e.disponibility.onStock-e.items.reduce((function(e,t){return e+t.nbr}),0)==0?"ffffff":"ff6666"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.disponibility?_e()(e.disponibility.date).format("DD MMM yyyy"):"-",style:{fill:{fgColor:{rgb:n%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.disponibility?e.disponibility.onStock:"-",style:{fill:{fgColor:{rgb:n%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.disponibility.airline?e.disponibility.airline.logo.replace("https://images.kiwi.com/airlines/64/","").replace(".png",""):"",style:{fill:{fgColor:{rgb:n%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}}];return t.map((function(t,n){a=a.concat([{value:e.items.find((function(e){return t&&e.clientId==t.id}))?e.items.find((function(e){return t&&e.clientId==t.id})).nbr:0,width:{wpx:100},style:{fill:{fgColor:{rgb:n%2?"ffffff":dn[n%9]}},font:{sz:"12"},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.items.find((function(e){return e.clientId==t.id}))?e.items.find((function(e){return e.clientId==t.id})).designation:"-",style:{fill:{fgColor:{rgb:n%2?"ffffff":dn[n%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}])})),a}))}]};function bn(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=(l[0],l[1]),d=Object(c.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(c.useState)([]),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(c.useState)(0),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)({page:1,take:20,providerId:0,status:0,date:null}),C=Object(s.a)(y,2),I=C[0],E=C[1],S=Object(c.useState)(""),N=Object(s.a)(S,2),P=N[0],k=N[1],A=Object(D.c)(cn),M=Object(s.a)(A,2),T=M[0],w=M[1],R=Object(c.useState)([]),U=Object(s.a)(R,2),L=U[0],F=U[1],K=Object(c.useState)([]),z=Object(s.a)(K,2),W=z[0],Y=z[1],G=Object(D.c)(ye.a),V=Object(s.a)(G,2),H=(V[0],V[1]),q=function(){w(new nn),k("")},Z=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?u(e.data):O(e.data)}))},J=function(){H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.ForcastVo,Object(o.a)(Object(o.a)({},I),{},{date:I.date?_e()(I.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),function(e){e.map((function(e){return e.disponibility}));var t=e.map((function(e){var t=[];return e.clients.forEach((function(n){var a=e.prices.map((function(t){return{disponibilityId:e.disponibilityId,disponibility:e.disponibility,client:n.client,clientId:n.clientId,nbr:n.nbr,designation:t.priceUmrah.hotelMadinahName+" - "+t.priceUmrah.hotelMakkahName}}));a=a.filter((function(e,t){var n=JSON.stringify(e);return t===a.findIndex((function(e){return JSON.stringify(e)===n}))}));var c=Object(o.a)({},a[0]);a.forEach((function(e){c.designation=c.designation+" / "+e.designation})),t.push(c)})),t}));t=t.reduce((function(e,t){return e.concat(t)}),[]);var n=new Set(t.map((function(e){return e.disponibilityId}))),a=[];n.forEach((function(e){a.push({disponibilityId:e,disponibility:t.filter((function(t){return t.disponibilityId==e}))[0].disponibility,items:t.filter((function(t){return t.disponibilityId==e}))})})),console.log(a),m(a)}(e.data.data.filter((function(e){return e.prices.length}))),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),v(e.data.totalCount)})).catch((function(e){k(e.Message),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};Object(c.useEffect)((function(){var e;Z(),("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Package,{q:e},"").customGet().then((function(e){F(e.data.data),Y(e.data.data.reduce((function(e,t){return e.concat(t.disponibilities)}),[]))}))}),[]),Object(c.useEffect)((function(){J()}),[I.page,I.take]);var X=[{value:"disponibility",name:"Vol",render:function(e){return Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:L&&L.find((function(t){return t.id==e.packageId}))&&L.find((function(t){return t.id==e.packageId})).name})," ",")"]})]}),Object(me.jsx)("b",{className:"p-5",children:Object(me.jsx)("span",{style:{background:"#121238",color:"#fff",width:"30px",height:"30px",textAlign:"center",lineHeight:"30px",display:"inline-block"},children:e.onStock})})]})}},{value:"virtualStock",name:"Nombre De Pr\xe9vision",render:function(e){return Object(me.jsx)("b",{style:{color:"#53af50",fontSize:"18px"},children:e})}},{value:"optionDate",name:"Date D'option",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}},{value:"note",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}}];return Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return J()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Voyage: "}),Object(me.jsx)(Ze.a,{data:L&&L?[{label:"Tout",value:0}].concat(L.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,value:I.packageId,onSelect:function(e){E((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageId:e})}))}})]})}),Object(me.jsx)(Ce.a,{excelData:p&&p.length?jn(p):jn([]),nameExcel:L&&L.find((function(e){return I.packageId==e.id}))?L.find((function(e){return I.packageId==e.id})).name:"forcast",size:"lg",save:function(){console.log(T),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},T);e.clients=e.clients.map((function(e){var t=Object(o.a)({},e);return delete t.client,t})),T.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.ForcastVo).update(e.id,e).then((function(e){J(),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),q(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){k(e.Message),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.ForcastVo).create(e).then((function(e){J(),q(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){k(e.Message),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:q,AddComponent:Object(me.jsx)(un,{vols:W,packs:L,fetchClients:function(e){return Z(e,!1)},clients:b,error:P})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){k(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.ForcastVo).fetchById(e).then((function(e){w(Object(o.a)({},e.data))})).catch((function(e){console.log(e)}))}(e),H((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.ForcastVo).delete(e).then((function(e){J(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return k(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:X,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:_,limitOptions:[10,20,50,100],limit:I.take,activePage:I.page,onChangePage:function(e){window.scrollTo(0,0),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var On=n(38),fn=n.n(On),hn=n(59),pn=n(56),mn=n.n(pn),xn=n(1221),gn=function e(){Object(U.a)(this,e),this.dateArrival=new Date,this.dateDepart=new Date};var _n=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Date d'arriv\xe9 :"}),Object(me.jsx)(fe.a,{type:"date",value:"string"==typeof a.dateArrival?a.dateArrival.substring(0,10):a.dateArrival,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{dateArrival:e})}))}}),Object(me.jsx)("label",{children:"Date de retour :"}),Object(me.jsx)(fe.a,{type:"date",value:"string"==typeof a.departDate?a.departDate.substring(0,10):a.departDate,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{departDate:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})},vn=[{country:"Afghanistan",code:"93",iso:"AF",alpha3:"AFG",country_ar:"\u0623\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646"},{country:"Albania",code:"355",iso:"AL",alpha3:"ALB",country_ar:"\u0623\u0644\u0628\u0627\u0646\u064a\u0627"},{country:"Algeria",code:"213",iso:"DZ",alpha3:"DZA",country_ar:"\u0627\u0644\u062c\u0632\u0627\u0626\u0631"},{country:"Andorra",code:"376",iso:"AD",alpha3:"AND",country_ar:"\u0623\u0646\u062f\u0648\u0631\u0627"},{country:"Angola",code:"244",iso:"AO",alpha3:"AGO",country_ar:"\u0623\u0646\u063a\u0648\u0644\u0627"},{country:"Antigua and Barbuda",code:"1-268",iso:"AG",alpha3:"ATG",country_ar:"\u0623\u0646\u062a\u064a\u063a\u0648\u0627 \u0648\u0628\u0627\u0631\u0628\u0648\u062f\u0627"},{country:"Argentina",code:"54",iso:"AR",alpha3:"ARG",country_ar:"\u0627\u0644\u0623\u0631\u062c\u0646\u062a\u064a\u0646"},{country:"Armenia",code:"374",iso:"AM",alpha3:"ARM",country_ar:"\u0623\u0631\u0645\u064a\u0646\u064a\u0627"},{country:"Australia",code:"61",iso:"AU",alpha3:"AUS",country_ar:"\u0623\u0633\u062a\u0631\u0627\u0644\u064a\u0627"},{country:"Austria",code:"43",iso:"AT",alpha3:"AUT",country_ar:"\u0627\u0644\u0646\u0645\u0633\u0627"},{country:"Azerbaijan",code:"994",iso:"AZ",alpha3:"AZE",country_ar:"\u0623\u0630\u0631\u0628\u064a\u062c\u0627\u0646"},{country:"Bahamas",code:"1-242",iso:"BS",alpha3:"BHS",country_ar:"\u0628\u0627\u0647\u0627\u0645\u0627\u0633"},{country:"Bahrain",code:"973",iso:"BH",alpha3:"BHR",country_ar:"\u0627\u0644\u0628\u062d\u0631\u064a\u0646"},{country:"Bangladesh",code:"880",iso:"BD",alpha3:"BGD",country_ar:"\u0628\u0646\u063a\u0644\u0627\u062f\u064a\u0634"},{country:"Barbados",code:"1-246",iso:"BB",alpha3:"BRB",country_ar:"\u0628\u0627\u0631\u0628\u0627\u062f\u0648\u0633"},{country:"Belarus",code:"375",iso:"BY",alpha3:"BLR",country_ar:"\u0628\u064a\u0644\u0627\u0631\u0648\u0633"},{country:"Belgium",code:"32",iso:"BE",alpha3:"BEL",country_ar:"\u0628\u0644\u062c\u064a\u0643\u0627"},{country:"Belize",code:"501",iso:"BZ",alpha3:"BLZ",country_ar:"\u0628\u0644\u064a\u0632"},{country:"Benin",code:"229",iso:"BJ",alpha3:"BEN",country_ar:"\u0628\u0646\u064a\u0646"},{country:"Bhutan",code:"975",iso:"BT",alpha3:"BTN",country_ar:"\u0628\u0648\u062a\u0627\u0646"},{country:"Bolivia",code:"591",iso:"BO",alpha3:"BOL",country_ar:"\u0628\u0648\u0644\u064a\u0641\u064a\u0627"},{country:"Bosnia and Herzegovina",code:"387",iso:"BA",alpha3:"BIH",country_ar:"\u0627\u0644\u0628\u0648\u0633\u0646\u0629 \u0648\u0627\u0644\u0647\u0631\u0633\u0643"},{country:"Botswana",code:"267",iso:"BW",alpha3:"BWA",country_ar:"\u0628\u0648\u062a\u0633\u0648\u0627\u0646\u0627"},{country:"Brazil",code:"55",iso:"BR",alpha3:"BRA",country_ar:"\u0627\u0644\u0628\u0631\u0627\u0632\u064a\u0644"},{country:"Brunei",code:"673",iso:"BN",alpha3:"BRN",country_ar:"\u0628\u0631\u0648\u0646\u0627\u064a"},{country:"Bulgaria",code:"359",iso:"BG",alpha3:"BGR",country_ar:"\u0628\u0644\u063a\u0627\u0631\u064a\u0627"},{country:"Burkina Faso",code:"226",iso:"BF",alpha3:"BFA",country_ar:"\u0628\u0648\u0631\u0643\u064a\u0646\u0627 \u0641\u0627\u0633\u0648"},{country:"Burundi",code:"257",iso:"BI",alpha3:"BDI",country_ar:"\u0628\u0648\u0631\u0648\u0646\u062f\u064a"},{country:"Cambodia",code:"855",iso:"KH",alpha3:"KHM",country_ar:"\u0643\u0645\u0628\u0648\u062f\u064a\u0627"},{country:"Cameroon",code:"237",iso:"CM",alpha3:"CMR",country_ar:"\u0627\u0644\u0643\u0627\u0645\u064a\u0631\u0648\u0646"},{country:"Canada",code:"1",iso:"CA",alpha3:"CAN",country_ar:"\u0643\u0646\u062f\u0627"},{country:"Cape Verde",code:"238",iso:"CV",alpha3:"CPV",country_ar:"\u0627\u0644\u0631\u0623\u0633 \u0627\u0644\u0623\u062e\u0636\u0631"},{country:"Central African Republic",code:"236",iso:"CF",alpha3:"CAF",country_ar:"\u062c\u0645\u0647\u0648\u0631\u064a\u0629 \u0625\u0641\u0631\u064a\u0642\u064a\u0627 \u0627\u0644\u0648\u0633\u0637\u0649"},{country:"Chad",code:"235",iso:"TD",alpha3:"TCD",country_ar:"\u062a\u0634\u0627\u062f"},{country:"Chile",code:"56",iso:"CL",alpha3:"CHL",country_ar:"\u062a\u0634\u064a\u0644\u064a"},{country:"China",code:"86",iso:"CN",alpha3:"CHN",country_ar:"\u0627\u0644\u0635\u064a\u0646"},{country:"Colombia",code:"57",iso:"CO",alpha3:"COL",country_ar:"\u0643\u0648\u0644\u0648\u0645\u0628\u064a\u0627"},{country:"Comoros",code:"269",iso:"KM",alpha3:"COM",country_ar:"\u062c\u0632\u0631 \u0627\u0644\u0642\u0645\u0631"},{country:"Republic of the Congo",code:"242",iso:"CG",alpha3:"COG",country_ar:"\u062c\u0645\u0647\u0648\u0631\u064a\u0629 \u0627\u0644\u0643\u0648\u0646\u063a\u0648"},{country:"Democratic Republic of the Congo",code:"243",iso:"CD",alpha3:"COD",country_ar:"\u062c\u0645\u0647\u0648\u0631\u064a\u0629 \u0627\u0644\u0643\u0648\u0646\u063a\u0648 \u0627\u0644\u062f\u064a\u0645\u0642\u0631\u0627\u0637\u064a\u0629"},{country:"Costa Rica",code:"506",iso:"CR",alpha3:"CRI",country_ar:"\u0643\u0648\u0633\u062a\u0627\u0631\u064a\u0643\u0627"},{country:"Ivory Coast",code:"225",iso:"CI",alpha3:"CIV",country_ar:"\u0633\u0627\u062d\u0644 \u0627\u0644\u0639\u0627\u062c"},{country:"Croatia",code:"385",iso:"HR",alpha3:"HRV",country_ar:"\u0643\u0631\u0648\u0627\u062a\u064a\u0627"},{country:"Cuba",code:"53",iso:"CU",alpha3:"CUB",country_ar:"\u0643\u0648\u0628\u0627"},{country:"Cyprus",code:"357",iso:"CY",alpha3:"CYP",country_ar:"\u0642\u0628\u0631\u0635"},{country:"Czech Republic",code:"420",iso:"CZ",alpha3:"CZE",country_ar:"\u062c\u0645\u0647\u0648\u0631\u064a\u0629 \u0627\u0644\u062a\u0634\u064a\u0643"},{country:"Denmark",code:"45",iso:"DK",alpha3:"DNK",country_ar:"\u0627\u0644\u062f\u0646\u0645\u0627\u0631\u0643"},{country:"Djibouti",code:"253",iso:"DJ",alpha3:"DJI",country_ar:"\u062c\u064a\u0628\u0648\u062a\u064a"},{country:"Dominica",code:"1-767",iso:"DM",alpha3:"DMA",country_ar:"\u062f\u0648\u0645\u064a\u0646\u064a\u0643\u0627"},{country:"Dominican Republic",code:"1-809, 1-829, 1-849",iso:"DO",alpha3:"DOM",country_ar:"\u062c\u0645\u0647\u0648\u0631\u064a\u0629 \u0627\u0644\u062f\u0648\u0645\u064a\u0646\u064a\u0643\u0627\u0646"},{country:"Ecuador",code:"593",iso:"EC",alpha3:"ECU",country_ar:"\u0627\u0644\u0625\u0643\u0648\u0627\u062f\u0648\u0631"},{country:"Egypt",code:"20",iso:"EG",alpha3:"EGY",country_ar:"\u0645\u0635\u0631"},{country:"El Salvador",code:"503",iso:"SV",alpha3:"SLV",country_ar:"\u0627\u0644\u0633\u0644\u0641\u0627\u062f\u0648\u0631"},{country:"Equatorial Guinea",code:"240",iso:"GQ",alpha3:"GNQ",country_ar:"\u063a\u064a\u0646\u064a\u0627 \u0627\u0644\u0627\u0633\u062a\u0648\u0627\u0626\u064a\u0629"},{country:"Eritrea",code:"291",iso:"ER",alpha3:"ERI",country_ar:"\u0625\u0631\u064a\u062a\u0631\u064a\u0627"},{country:"Estonia",code:"372",iso:"EE",alpha3:"EST",country_ar:"\u0625\u0633\u062a\u0648\u0646\u064a\u0627"},{country:"Ethiopia",code:"251",iso:"ET",alpha3:"ETH",country_ar:"\u0625\u062b\u064a\u0648\u0628\u064a\u0627"},{country:"Fiji",code:"679",iso:"FJ",alpha3:"FJI",country_ar:"\u0641\u064a\u062c\u064a"},{country:"Finland",code:"358",iso:"FI",alpha3:"FIN",country_ar:"\u0641\u0646\u0644\u0646\u062f\u0627"},{country:"France",code:"33",iso:"FR",alpha3:"FRA",country_ar:"\u0641\u0631\u0646\u0633\u0627"},{country:"Gabon",code:"241",iso:"GA",alpha3:"GAB",country_ar:"\u0627\u0644\u063a\u0627\u0628\u0648\u0646"},{country:"Gambia",code:"220",iso:"GM",alpha3:"GMB",country_ar:"\u063a\u0627\u0645\u0628\u064a\u0627"},{country:"Georgia",code:"995",iso:"GE",alpha3:"GEO",country_ar:"\u062c\u0648\u0631\u062c\u064a\u0627"},{country:"Germany",code:"49",iso:"DE",alpha3:"DEU",country_ar:"\u0623\u0644\u0645\u0627\u0646\u064a\u0627"},{country:"Ghana",code:"233",iso:"GH",alpha3:"GHA",country_ar:"\u063a\u0627\u0646\u0627"},{country:"Greece",code:"30",iso:"GR",alpha3:"GRC",country_ar:"\u0627\u0644\u064a\u0648\u0646\u0627\u0646"},{country:"Grenada",code:"1-473",iso:"GD",alpha3:"GRD",country_ar:"\u063a\u0631\u064a\u0646\u0627\u062f\u0627"},{country:"Guatemala",code:"502",iso:"GT",alpha3:"GTM",country_ar:"\u063a\u0648\u0627\u062a\u064a\u0645\u0627\u0644\u0627"},{country:"Guinea",code:"224",iso:"GN",alpha3:"GIN",country_ar:"\u063a\u064a\u0646\u064a\u0627"},{country:"Guinea-Bissau",code:"245",iso:"GW",alpha3:"GNB",country_ar:"\u063a\u064a\u0646\u064a\u0627 \u0628\u064a\u0633\u0627\u0648"},{country:"Guyana",code:"592",iso:"GY",alpha3:"GUY",country_ar:"\u063a\u064a\u0627\u0646\u0627"},{country:"Haiti",code:"509",iso:"HT",alpha3:"HTI",country_ar:"\u0647\u0627\u064a\u062a\u064a"},{country:"Honduras",code:"504",iso:"HN",alpha3:"HND",country_ar:"\u0647\u0646\u062f\u0648\u0631\u0627\u0633"},{country:"Hungary",code:"36",iso:"HU",alpha3:"HUN",country_ar:"\u0627\u0644\u0645\u062c\u0631"},{country:"Iceland",code:"354",iso:"IS",alpha3:"ISL",country_ar:"\u0622\u064a\u0633\u0644\u0646\u062f\u0627"},{country:"India",code:"91",iso:"IN",alpha3:"IND",country_ar:"\u0627\u0644\u0647\u0646\u062f"},{country:"Indonesia",code:"62",iso:"ID",alpha3:"IDN",country_ar:"\u0625\u0646\u062f\u0648\u0646\u064a\u0633\u064a\u0627"},{country:"Iran",code:"98",iso:"IR",alpha3:"IRN",country_ar:"\u0625\u064a\u0631\u0627\u0646"},{country:"Iraq",code:"964",iso:"IQ",alpha3:"IRQ",country_ar:"\u0627\u0644\u0639\u0631\u0627\u0642"},{country:"Ireland",code:"353",iso:"IE",alpha3:"IRL",country_ar:"\u0623\u064a\u0631\u0644\u0646\u062f\u0627"},{country:"Israel",code:"972",iso:"IL",alpha3:"ISR",country_ar:"\u0625\u0633\u0631\u0627\u0626\u064a\u0644"},{country:"Italy",code:"39",iso:"IT",alpha3:"ITA",country_ar:"\u0625\u064a\u0637\u0627\u0644\u064a\u0627"},{country:"Jamaica",code:"1-876",iso:"JM",alpha3:"JAM",country_ar:"\u062c\u0627\u0645\u0627\u064a\u0643\u0627"},{country:"Japan",code:"81",iso:"JP",alpha3:"JPN",country_ar:"\u0627\u0644\u064a\u0627\u0628\u0627\u0646"},{country:"Jordan",code:"962",iso:"JO",alpha3:"JOR",country_ar:"\u0627\u0644\u0623\u0631\u062f\u0646"},{country:"Kazakhstan",code:"7",iso:"KZ",alpha3:"KAZ",country_ar:"\u0643\u0627\u0632\u0627\u062e\u0633\u062a\u0627\u0646"},{country:"Kenya",code:"254",iso:"KE",alpha3:"KEN",country_ar:"\u0643\u064a\u0646\u064a\u0627"},{country:"Kiribati",code:"686",iso:"KI",alpha3:"KIR",country_ar:"\u0643\u064a\u0631\u064a\u0628\u0627\u062a\u064a"},{country:"North Korea",code:"850",iso:"KP",alpha3:"PRK",country_ar:"\u0643\u0648\u0631\u064a\u0627 \u0627\u0644\u0634\u0645\u0627\u0644\u064a\u0629"},{country:"South Korea",code:"82",iso:"KR",alpha3:"KOR",country_ar:"\u0643\u0648\u0631\u064a\u0627 \u0627\u0644\u062c\u0646\u0648\u0628\u064a\u0629"},{country:"Kuwait",code:"965",iso:"KW",alpha3:"KWT",country_ar:"\u0627\u0644\u0643\u0648\u064a\u062a"},{country:"Kyrgyzstan",code:"996",iso:"KG",alpha3:"KGZ",country_ar:"\u0642\u064a\u0631\u063a\u064a\u0632\u0633\u062a\u0627\u0646"},{country:"Laos",code:"856",iso:"LA",alpha3:"LAO",country_ar:"\u0644\u0627\u0648\u0633"},{country:"Latvia",code:"371",iso:"LV",alpha3:"LVA",country_ar:"\u0644\u0627\u062a\u0641\u064a\u0627"},{country:"Lebanon",code:"961",iso:"LB",alpha3:"LBN",country_ar:"\u0644\u0628\u0646\u0627\u0646"},{country:"Lesotho",code:"266",iso:"LS",alpha3:"LSO",country_ar:"\u0644\u064a\u0633\u0648\u062a\u0648"},{country:"Liberia",code:"231",iso:"LR",alpha3:"LBR",country_ar:"\u0644\u064a\u0628\u064a\u0631\u064a\u0627"},{country:"Libya",code:"218",iso:"LY",alpha3:"LBY",country_ar:"\u0644\u064a\u0628\u064a\u0627"},{country:"Liechtenstein",code:"423",iso:"LI",alpha3:"LIE",country_ar:"\u0644\u064a\u062e\u062a\u0646\u0634\u062a\u0627\u064a\u0646"},{country:"Lithuania",code:"370",iso:"LT",alpha3:"LTU",country_ar:"\u0644\u064a\u062a\u0648\u0627\u0646\u064a\u0627"},{country:"Luxembourg",code:"352",iso:"LU",alpha3:"LUX",country_ar:"\u0644\u0648\u0643\u0633\u0645\u0628\u0648\u0631\u063a"},{country:"Macedonia",code:"389",iso:"MK",alpha3:"MKD",country_ar:"\u0645\u0642\u062f\u0648\u0646\u064a\u0627"},{country:"Madagascar",code:"261",iso:"MG",alpha3:"MDG",country_ar:"\u0645\u062f\u063a\u0634\u0642\u0631"},{country:"Malawi",code:"265",iso:"MW",alpha3:"MWI",country_ar:"\u0645\u0627\u0644\u0627\u0648\u064a"},{country:"Malaysia",code:"60",iso:"MY",alpha3:"MYS",country_ar:"\u0645\u0627\u0644\u064a\u0632\u064a\u0627"},{country:"Maldives",code:"960",iso:"MV",alpha3:"MDV",country_ar:"\u062c\u0632\u0631 \u0627\u0644\u0645\u0627\u0644\u062f\u064a\u0641"},{country:"Mali",code:"223",iso:"ML",alpha3:"MLI",country_ar:"\u0645\u0627\u0644\u064a"},{country:"Malta",code:"356",iso:"MT",alpha3:"MLT",country_ar:"\u0645\u0627\u0644\u0637\u0627"},{country:"Marshall Islands",code:"692",iso:"MH",alpha3:"MHL",country_ar:"\u062c\u0632\u0631 \u0645\u0627\u0631\u0634\u0627\u0644"},{country:"Mauritania",code:"222",iso:"MR",alpha3:"MRT",country_ar:"\u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627"},{country:"Mauritius",code:"230",iso:"MU",alpha3:"MUS",country_ar:"\u0645\u0648\u0631\u064a\u0634\u064a\u0648\u0633"},{country:"Mexico",code:"52",iso:"MX",alpha3:"MEX",country_ar:"\u0627\u0644\u0645\u0643\u0633\u064a\u0643"},{country:"Micronesia",code:"691",iso:"FM",alpha3:"FSM",country_ar:"\u0648\u0644\u0627\u064a\u0627\u062a \u0645\u064a\u0643\u0631\u0648\u0646\u064a\u0633\u064a\u0627 \u0627\u0644\u0645\u062a\u062d\u062f\u0629"},{country:"Morocco",code:"212",iso:"MA",alpha3:"MAR",country_ar:"\u0627\u0644\u0645\u063a\u0631\u0628"},{country:"Moldova",code:"373",iso:"MD",alpha3:"MDA",country_ar:"\u0645\u0648\u0644\u062f\u0648\u0641\u0627"},{country:"Monaco",code:"377",iso:"MC",alpha3:"MCO",country_ar:"\u0645\u0648\u0646\u0627\u0643\u0648"},{country:"Mongolia",code:"976",iso:"MN",alpha3:"MNG",country_ar:"\u0645\u0646\u063a\u0648\u0644\u064a\u0627"},{country:"Montenegro",code:"382",iso:"ME",alpha3:"MNE",country_ar:"\u0627\u0644\u062c\u0628\u0644 \u0627\u0644\u0623\u0633\u0648\u062f"},{country:"Mozambique",code:"258",iso:"MZ",alpha3:"MOZ",country_ar:"\u0645\u0648\u0632\u0645\u0628\u064a\u0642"},{country:"Myanmar",code:"95",iso:"MM",alpha3:"MMR",country_ar:"\u0645\u064a\u0627\u0646\u0645\u0627\u0631"},{country:"Namibia",code:"264",iso:"NA",alpha3:"NAM",country_ar:"\u0646\u0627\u0645\u064a\u0628\u064a\u0627"},{country:"Nauru",code:"674",iso:"NR",alpha3:"NRU",country_ar:"\u0646\u0627\u0648\u0631\u0648"},{country:"Nepal",code:"977",iso:"NP",alpha3:"NPL",country_ar:"\u0646\u064a\u0628\u0627\u0644"},{country:"Netherlands",code:"31",iso:"NL",alpha3:"NLD",country_ar:"\u0647\u0648\u0644\u0646\u062f\u0627"},{country:"New Zealand",code:"64",iso:"NZ",alpha3:"NZL",country_ar:"\u0646\u064a\u0648\u0632\u064a\u0644\u0646\u062f\u0627"},{country:"Nicaragua",code:"505",iso:"NI",alpha3:"NIC",country_ar:"\u0646\u064a\u0643\u0627\u0631\u0627\u063a\u0648\u0627"},{country:"Niger",code:"227",iso:"NE",alpha3:"NER",country_ar:"\u0627\u0644\u0646\u064a\u062c\u0631"},{country:"Nigeria",code:"234",iso:"NG",alpha3:"NGA",country_ar:"\u0646\u064a\u062c\u064a\u0631\u064a\u0627"},{country:"Norway",code:"47",iso:"NO",alpha3:"NOR",country_ar:"\u0627\u0644\u0646\u0631\u0648\u064a\u062c"},{country:"Oman",code:"968",iso:"OM",alpha3:"OMN",country_ar:"\u0639\u064f\u0645\u0627\u0646"},{country:"Pakistan",code:"92",iso:"PK",alpha3:"PAK",country_ar:"\u0628\u0627\u0643\u0633\u062a\u0627\u0646"},{country:"Palau",code:"680",iso:"PW",alpha3:"PLW",country_ar:"\u0628\u0627\u0644\u0627\u0648"},{country:"Panama",code:"507",iso:"PA",alpha3:"PAN",country_ar:"\u0628\u0646\u0645\u0627"},{country:"Papua New Guinea",code:"675",iso:"PG",alpha3:"PNG",country_ar:"\u0628\u0627\u0628\u0648\u0627 \u063a\u064a\u0646\u064a\u0627 \u0627\u0644\u062c\u062f\u064a\u062f\u0629"},{country:"Paraguay",code:"595",iso:"PY",alpha3:"PRY",country_ar:"\u0628\u0627\u0631\u0627\u063a\u0648\u0627\u064a"},{country:"Peru",code:"51",iso:"PE",alpha3:"PER",country_ar:"\u0628\u064a\u0631\u0648"},{country:"Philippines",code:"63",iso:"PH",alpha3:"PHL",country_ar:"\u0627\u0644\u0641\u0644\u0628\u064a\u0646"},{country:"Poland",code:"48",iso:"PL",alpha3:"POL",country_ar:"\u0628\u0648\u0644\u0646\u062f\u0627"},{country:"Portugal",code:"351",iso:"PT",alpha3:"PRT",country_ar:"\u0627\u0644\u0628\u0631\u062a\u063a\u0627\u0644"},{country:"Qatar",code:"974",iso:"QA",alpha3:"QAT",country_ar:"\u0642\u0637\u0631"},{country:"Romania",code:"40",iso:"RO",alpha3:"ROU",country_ar:"\u0631\u0648\u0645\u0627\u0646\u064a\u0627"},{country:"Russia",code:"7",iso:"RU",alpha3:"RUS",country_ar:"\u0631\u0648\u0633\u064a\u0627"},{country:"Rwanda",code:"250",iso:"RW",alpha3:"RWA",country_ar:"\u0631\u0648\u0627\u0646\u062f\u0627"},{country:"Saint Kitts and Nevis",code:"1-869",iso:"KN",alpha3:"KNA",country_ar:"\u0633\u0627\u0646\u062a \u0643\u064a\u062a\u0633 \u0648\u0646\u064a\u0641\u064a\u0633"},{country:"Saint Lucia",code:"1-758",iso:"LC",alpha3:"LCA",country_ar:"\u0633\u0627\u0646\u062a \u0644\u0648\u0633\u064a\u0627"},{country:"Saint Vincent and the Grenadines",code:"1-784",iso:"VC",alpha3:"VCT",country_ar:"\u0633\u0627\u0646\u062a \u0641\u064a\u0646\u0633\u0646\u062a \u0648\u0627\u0644\u063a\u0631\u064a\u0646\u0627\u062f\u064a\u0646"},{country:"Samoa",code:"685",iso:"WS",alpha3:"WSM",country_ar:"\u0633\u0627\u0645\u0648\u0627"},{country:"San Marino",code:"378",iso:"SM",alpha3:"SMR",country_ar:"\u0633\u0627\u0646 \u0645\u0627\u0631\u064a\u0646\u0648"},{country:"Sao Tome and Principe",code:"239",iso:"ST",alpha3:"STP",country_ar:"\u0633\u0627\u0648 \u062a\u0648\u0645\u064a \u0648\u0628\u0631\u064a\u0646\u0633\u064a\u0628"},{country:"Saudi Arabia",code:"966",iso:"SA",alpha3:"SAU",country_ar:"\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629"},{country:"Senegal",code:"221",iso:"SN",alpha3:"SEN",country_ar:"\u0627\u0644\u0633\u0646\u063a\u0627\u0644"},{country:"Serbia",code:"381",iso:"RS",alpha3:"SRB",country_ar:"\u0635\u0631\u0628\u064a\u0627"},{country:"Seychelles",code:"248",iso:"SC",alpha3:"SYC",country_ar:"\u0633\u064a\u0634\u0644"},{country:"Sierra Leone",code:"232",iso:"SL",alpha3:"SLE",country_ar:"\u0633\u064a\u0631\u0627\u0644\u064a\u0648\u0646"},{country:"Singapore",code:"65",iso:"SG",alpha3:"SGP",country_ar:"\u0633\u0646\u063a\u0627\u0641\u0648\u0631\u0629"},{country:"Slovakia",code:"421",iso:"SK",alpha3:"SVK",country_ar:"\u0633\u0644\u0648\u0641\u0627\u0643\u064a\u0627"},{country:"Slovenia",code:"386",iso:"SI",alpha3:"SVN",country_ar:"\u0633\u0644\u0648\u0641\u064a\u0646\u064a\u0627"},{country:"Solomon Islands",code:"677",iso:"SB",alpha3:"SLB",country_ar:"\u062c\u0632\u0631 \u0633\u0644\u064a\u0645\u0627\u0646"},{country:"Somalia",code:"252",iso:"SO",alpha3:"SOM",country_ar:"\u0627\u0644\u0635\u0648\u0645\u0627\u0644"},{country:"South Africa",code:"27",iso:"ZA",alpha3:"ZAF",country_ar:"\u062c\u0646\u0648\u0628 \u0625\u0641\u0631\u064a\u0642\u064a\u0627"},{country:"South Sudan",code:"211",iso:"SS",alpha3:"SSD",country_ar:"\u062c\u0646\u0648\u0628 \u0627\u0644\u0633\u0648\u062f\u0627\u0646"},{country:"Spain",code:"34",iso:"ES",alpha3:"ESP",country_ar:"\u0625\u0633\u0628\u0627\u0646\u064a\u0627"},{country:"Sri Lanka",code:"94",iso:"LK",alpha3:"LKA",country_ar:"\u0633\u0631\u064a\u0644\u0627\u0646\u0643\u0627"},{country:"Sudan",code:"249",iso:"SD",alpha3:"SDN",country_ar:"\u0627\u0644\u0633\u0648\u062f\u0627\u0646"},{country:"Suriname",code:"597",iso:"SR",alpha3:"SUR",country_ar:"\u0633\u0648\u0631\u064a\u0646\u0627\u0645"},{country:"Swaziland",code:"268",iso:"SZ",alpha3:"SWZ",country_ar:"\u0625\u0633\u0648\u0627\u062a\u064a\u0646\u064a"},{country:"Sweden",code:"46",iso:"SE",alpha3:"SWE",country_ar:"\u0627\u0644\u0633\u0648\u064a\u062f"},{country:"Switzerland",code:"41",iso:"CH",alpha3:"CHE",country_ar:"\u0633\u0648\u064a\u0633\u0631\u0627"},{country:"Syria",code:"963",iso:"SY",alpha3:"SYR",country_ar:"\u0633\u0648\u0631\u064a\u0627"},{country:"Tajikistan",code:"992",iso:"TJ",alpha3:"TJK",country_ar:"\u0637\u0627\u062c\u064a\u0643\u0633\u062a\u0627\u0646"},{country:"Tanzania",code:"255",iso:"TZ",alpha3:"TZA",country_ar:"\u062a\u0646\u0632\u0627\u0646\u064a\u0627"},{country:"Thailand",code:"66",iso:"TH",alpha3:"THA",country_ar:"\u062a\u0627\u064a\u0644\u0627\u0646\u062f"},{country:"East Timor",code:"670",iso:"TL",alpha3:"TLS",country_ar:"\u062a\u064a\u0645\u0648\u0631 \u0627\u0644\u0634\u0631\u0642\u064a\u0629"},{country:"Togo",code:"228",iso:"TG",alpha3:"TGO",country_ar:"\u062a\u0648\u063a\u0648"},{country:"Tonga",code:"676",iso:"TO",alpha3:"TON",country_ar:"\u062a\u0648\u0646\u063a\u0627"},{country:"Trinidad and Tobago",code:"1-868",iso:"TT",alpha3:"TTO",country_ar:"\u062a\u0631\u064a\u0646\u064a\u062f\u0627\u062f \u0648\u062a\u0648\u0628\u0627\u063a\u0648"},{country:"Tunisia",code:"216",iso:"TN",alpha3:"TUN",country_ar:"\u062a\u0648\u0646\u0633"},{country:"Turkey",code:"90",iso:"TR",alpha3:"TUR",country_ar:"\u062a\u0631\u0643\u064a\u0627"},{country:"Turkmenistan",code:"993",iso:"TM",alpha3:"TKM",country_ar:"\u062a\u0631\u0643\u0645\u0627\u0646\u0633\u062a\u0627\u0646"},{country:"Tuvalu",code:"688",iso:"TV",alpha3:"TUV",country_ar:"\u062a\u0648\u0641\u0627\u0644\u0648"},{country:"Uganda",code:"256",iso:"UG",alpha3:"UGA",country_ar:"\u0623\u0648\u063a\u0646\u062f\u0627"},{country:"Ukraine",code:"380",iso:"UA",alpha3:"UKR",country_ar:"\u0623\u0648\u0643\u0631\u0627\u0646\u064a\u0627"},{country:"United Arab Emirates",code:"971",iso:"AE",alpha3:"ARE",country_ar:"\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062a \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0645\u062a\u062d\u062f\u0629"},{country:"United Kingdom",code:"44",iso:"GB",alpha3:"GBR",country_ar:"\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0645\u062a\u062d\u062f\u0629"},{country:"United States",code:"1",iso:"US",alpha3:"USA",country_ar:"\u0627\u0644\u0648\u0644\u0627\u064a\u0627\u062a \u0627\u0644\u0645\u062a\u062d\u062f\u0629"},{country:"Uruguay",code:"598",iso:"UY",alpha3:"URY",country_ar:"\u0627\u0644\u0623\u0648\u0631\u0648\u063a\u0648\u0627\u064a"},{country:"Uzbekistan",code:"998",iso:"UZ",alpha3:"UZB",country_ar:"\u0623\u0648\u0632\u0628\u0643\u0633\u062a\u0627\u0646"},{country:"Vanuatu",code:"678",iso:"VU",alpha3:"VUT",country_ar:"\u0641\u0627\u0646\u0648\u0627\u062a\u0648"},{country:"Venezuela",code:"58",iso:"VE",alpha3:"VEN",country_ar:"\u0641\u0646\u0632\u0648\u064a\u0644\u0627"},{country:"Vietnam",code:"84",iso:"VN",alpha3:"VNM",country_ar:"\u0641\u064a\u062a\u0646\u0627\u0645"},{country:"Yemen",code:"967",iso:"YE",alpha3:"YEM",country_ar:"\u0627\u0644\u064a\u0645\u0646"},{country:"Zambia",code:"260",iso:"ZM",alpha3:"ZMB",country_ar:"\u0632\u0627\u0645\u0628\u064a\u0627"},{country:"Zimbabwe",code:"263",iso:"ZW",alpha3:"ZWE",country_ar:"\u0632\u064a\u0645\u0628\u0627\u0628\u0648\u064a"}],yn=function(e){var t=e.groupId,n=e.group,a=e.setgroup,r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(c.useState)(!1),h=Object(s.a)(f,2),p=(h[0],h[1]),m=Object(c.useState)(0),x=Object(s.a)(m,2),g=x[0],_=x[1],v=Object(c.useState)(!1),C=Object(s.a)(v,2),I=C[0],E=C[1];Object(c.useEffect)((function(){localStorage.setItem("stop1",!0),O([])}),[]);var S=function(){var e=Object(hn.a)(fn.a.mark((function e(t,n){var a,c,r;return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_(n[t].id),"false"!=localStorage.getItem("stop1")){e.next=15;break}return e.next=5,y.a.post("http://localhost:8733/PrintVisaHajj",Object(o.a)(Object(o.a)({},n[t]),{},{firstName:n[t].customer.firstName,passportNumber:n[t].customer.passportNumber}));case 5:a=e.sent,c=Object(o.a)({},n[t]),r=/^-?\d+\.?\d*$/,200==a.status&&a.data&&a.data.includes(",")&&r.test(a.data.split(",")[0])&&!a.data.startsWith("Error")?(c.errorMessage="",c.visaCode=a.data.split(",")[0],c.wakil=a.data.split(",")[1],c.hasVisa=!0):(c.errorMessage=a.data?a.data:c.errorMessage,a.data.includes(",")&&r.test(a.data.split(",")[0])||c.hasVisa||(c.hasVisa=!1,c.visaCode="")),u((function(e){var a=Object(qe.a)(e),r=a.findIndex((function(e){return e.id==n[t].id}));return a[r]=c,a})),delete c.client,delete c.disponibility,delete c.packageUmrah,delete c.price,B.a.createAPIEndpoint(pe.a.Order+"/Umrah").update2(c).then((function(e){t4&&void 0!==arguments[4]?arguments[4]:null;t&&B.a.createAPIEndpoint(e,Object(o.a)({city:t},null!==c&&{take:c})).customGet().then((function(e){n((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},a,e.data.data||e.data.hotels||[]))}))}))}),[]);return Object(c.useEffect)((function(){C(B.a.ENDPOINTS.Airport,t.paysDepartureId,m,"departure",500),C(B.a.ENDPOINTS.Airport,t.paysArrivalId,m,"arrival",500),C(B.a.ENDPOINTS.HotelList+"/HotelsByCity",t.paysDepartureId,v,"departure"),C(B.a.ENDPOINTS.HotelList+"/HotelsByCity",t.paysArrivalId,v,"arrival")}),[t.paysDepartureId,t.paysArrivalId]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.8,children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{block:!0,value:t.name||"",onChange:function(e){return n("name",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:2,xl:1.8,children:[Object(me.jsx)("label",{children:"Date:"}),Object(me.jsx)(fe.a,{type:"date",value:_e()(t.date).format("YYYY-MM-DD")||"",onChange:function(e){return n("date",e)}})]}),Object(me.jsxs)("div",{style:Ln.typeTransfert,children:[Object(me.jsxs)(be.a,{className:"p-5",m:4,l:2,xl:1.7,children:[Object(me.jsx)("label",{children:"Type de d\xe9part: "}),Object(me.jsx)(Ze.a,{value:l,data:Fe.m,block:!0,noSearch:!0,onSelect:function(e){n("departType",e),u(e)}})]}),y(l)?Object(me.jsxs)(be.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(me.jsxs)("label",{children:[V.departureName,":"]}),Object(me.jsx)(fe.a,{block:!0,value:t.departName||"",onChange:function(e){return n("departName",e)}})]}):Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsx)("label",{children:"Pays de d\xe9part:"}),Object(me.jsx)(Ze.a,{data:null===a||void 0===a?void 0:a.map((function(e){return{label:e.nom,value:e.nom}})),block:!0,value:t.paysDepartureId,onSelect:function(e){return n("paysDepartureId",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(me.jsx)("label",{children:2===l?"h\xf4tel":"A\xe9roport"}),Object(me.jsx)(Ze.a,{value:t.departName||"",data:2===l?_.departure.map((function(e){return{label:e.name_en,value:e.name_en}})):1===l?p.departure.map((function(e){return{label:"".concat(e.city," - ").concat(e.name),value:e.name}})):[],block:!0,noSearch:!0,onSelect:function(e){return n("departName",e)}})]})]})]}),Object(me.jsxs)("div",{style:Ln.typeTransfert,children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:2,xl:1.7,children:[Object(me.jsx)("label",{children:"Type d'arriv\xe9e: "}),Object(me.jsx)(Ze.a,{value:b,data:Fe.m,block:!0,noSearch:!0,onSelect:function(e){n("arrivalType",e),O(e)}})]}),y(b)?Object(me.jsxs)(be.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(me.jsxs)("label",{children:[V.arrivalName,":"]}),Object(me.jsx)(fe.a,{block:!0,value:t.arrivalName||"",onChange:function(e){return n("arrivalName",e)}})]}):Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsx)("label",{children:"Pays d'arriv\xe9e:"}),Object(me.jsx)(Ze.a,{data:null===a||void 0===a?void 0:a.map((function(e){return{label:e.nom,value:e.nom}})),block:!0,value:t.paysArrivalId,onSelect:function(e){return n("paysArrivalId",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(me.jsx)("label",{children:2===b?"h\xf4tel":"A\xe9roport"}),Object(me.jsx)(Ze.a,{value:t.arrivalName||"",data:2===b?_.arrival.map((function(e){return{label:e.name_en,value:e.name_en}})):1===b?p.arrival.map((function(e){return{label:"".concat(e.city," - ").concat(e.name),value:e.name}})):[],block:!0,noSearch:!0,onSelect:function(e){return n("arrivalName",e)}})]})]})]})]})},Kn=function(e){var t=e.mode,n=e.i,a=e.addNewTransport,c=e.modeTransports,r=e.deleteTransport,i=e.handleInputChangeTransport;return Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{className:"p-5",s:6,m:6,l:3,xl:1.8,children:[Object(me.jsxs)("label",{children:[V.name,":"]}),Object(me.jsx)(Ze.a,{data:Fe.A,block:!0,noSearch:!0,value:t.name,onChange:function(e){return i(n,"name",e)}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-5",children:[Object(me.jsx)("label",{children:"Prix:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:t.price||0,onChange:function(e){return function(e,t){var n=parseFloat(t);n>=0&&i(e,"price",n)}(n,e)}})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,style:{gap:"8px"},children:[Object(me.jsx)("div",{style:{height:"38px"}}),Object(me.jsx)(Je.a,{onClick:function(){return r(n)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),n+1===c.length&&Object(me.jsx)(Je.a,{onClick:a,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]})},zn=function(e){var t=e.setModel,n=e.disponibilitie,a=e.indexTransfert,r=e.transfertList,i=e.indexDisponibilitie,l=Object(c.useState)(r),u=Object(s.a)(l,2),d=u[0],j=u[1],b=Object(c.useState)([]),O=Object(s.a)(b,2),f=O[0],h=O[1],p=function(e,c){var r=Object(o.a)(Object(o.a)({},d),{},Object(G.a)({},e,c));j(r);var s=[].concat(Object(qe.a)(n.transfert.transfertLists.slice(0,a)),[r],Object(qe.a)(n.transfert.transfertLists.slice(a+1)));t((function(e){return Object(o.a)(Object(o.a)({},e),{},{disponibilities:e.disponibilities.map((function(e,t){return t===i?Object(o.a)(Object(o.a)({},e),{},{transfert:Object(o.a)(Object(o.a)({},e.transfert),{},{transfertLists:s})}):e}))})}))},m=function(){var e=new se,t=Object(o.a)(Object(o.a)({},d),{},{modeTransports:[].concat(Object(qe.a)(d.modeTransports),[e])});j(t),p("modeTransports",t.modeTransports)},x=function(e){var t=d.modeTransports.filter((function(t,n){return n!==e}));p("modeTransports",t)},g=function(e,t,n){var a=Object(qe.a)(d.modeTransports);a[e]=Object(o.a)(Object(o.a)({},a[e]),{},Object(G.a)({},t,n)),p("modeTransports",a)},_=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Pays,{}).customGet().then((function(e){return h(e.data)}))}),[]);return Object(c.useEffect)((function(){_()}),[_]),Object(me.jsxs)("div",{style:{background:"rgb(70, 90, 238, 0.2)",padding:"10px"},className:"p-5",children:[Object(me.jsx)(Fn,{transfertList:d,handleChange:p,paysData:f}),Object(me.jsx)("hr",{style:{margin:"10px 0"}}),Object(me.jsx)("h6",{children:"Transport"}),d.modeTransports.map((function(e,t){return Object(me.jsx)(Kn,{mode:e,i:t,addNewTransport:m,modeTransports:d.modeTransports,deleteTransport:x,handleInputChangeTransport:g})}))]})},Wn={mainContainer:{display:"flex",flexDirection:"column"},rowContainer:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},transfertListContainer:{display:"flex",alignItems:"center",width:"100%",marginBottom:"16px"},iconContainer:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"8px",width:"5%"},iconButton:{width:"30px",height:"30px"},addDispo:{display:"flex",justifyContent:"flex-end",padding:"20px"}},Yn={container:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",width:"100%"},label:(wn={display:"flex",gap:"8px",fontSize:"18px"},Object(G.a)(wn,"display","flex"),Object(G.a)(wn,"alignItems","center"),wn)},Gn=function(e){var t=e.setCaracteristiques,n=e.caracteristique,a=e.translations,c=function(e){return function(a){var c=Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},e,a.target.checked));t(c)}};return Object(me.jsx)("div",{style:Yn.container,children:Object.keys(n).filter((function(e){return"id"!==e})).map((function(e){return Object(me.jsx)(be.a,{className:"p-5",m:1,l:1,xl:1,children:Object(me.jsxs)("label",{style:Yn.label,children:[a[e]||e,Object(me.jsx)("input",{type:"checkbox",checked:n[e],onChange:c(e)})]})},e)}))})},Vn=function(e){var t,n,a,c,r=e.setModel,i=e.disponibilitie,s=e.index,l=function(e,t){r((function(n){return Object(o.a)(Object(o.a)({},n),{},{disponibilities:n.disponibilities.map((function(n,a){return a===s?Object(o.a)(Object(o.a)({},n),{},{transfert:Object(o.a)(Object(o.a)({},n.transfert),{},Object(G.a)({},e,t))}):n}))})}))},u=function(){var e=new oe;r((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilities:t.disponibilities.map((function(t,n){return n===s?Object(o.a)(Object(o.a)({},t),{},{transfert:Object(o.a)(Object(o.a)({},t.transfert),{},{transfertLists:[].concat(Object(qe.a)(t.transfert.transfertLists),[e])})}):t}))})}))};return Object(me.jsxs)("div",{className:"p-5",children:[Object(me.jsx)("h6",{children:"Transfert"}),Object(me.jsxs)("div",{style:Wn.mainContainer,children:[Object(me.jsxs)("div",{style:Wn.rowContainer,children:[Object(me.jsxs)(be.a,{l:5,xl:5,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom : "}),Object(me.jsx)(fe.a,{block:!0,name:"name",value:(null===i||void 0===i||null===(t=i.transfert)||void 0===t?void 0:t.name)||"",onChange:function(e){return l("name",e)}})]}),Object(me.jsxs)(be.a,{l:5,xl:6.5,className:"p-10",children:[Object(me.jsx)("label",{children:"Description : "}),Object(me.jsx)(fe.a,{as:"textarea",rows:3,block:!0,name:"description",value:(null===i||void 0===i||null===(n=i.transfert)||void 0===n?void 0:n.description)||"",onChange:function(e){return l("description",e)}})]})]}),Object(me.jsx)(Gn,{setCaracteristiques:function(e){r((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilities:t.disponibilities.map((function(t,n){return n===s?Object(o.a)(Object(o.a)({},t),{},{transfert:Object(o.a)(Object(o.a)({},t.transfert),{},{caracteristiques:e})}):t}))})}))},caracteristique:(null===i||void 0===i||null===(a=i.transfert)||void 0===a?void 0:a.caracteristiques)||{},translations:Fe.e}),null===i||void 0===i||null===(c=i.transfert)||void 0===c?void 0:c.transfertLists.map((function(e,t){var n;return Object(me.jsxs)("div",{style:Wn.transfertListContainer,children:[Object(me.jsx)("div",{style:{flexGrow:1},children:Object(me.jsx)(zn,{setModel:r,disponibilitie:i,indexTransfert:t,transfertList:e,indexDisponibilitie:s})}),Object(me.jsxs)(be.a,{s:2,m:2,l:2,xl:2,style:Wn.iconContainer,children:[Object(me.jsx)(Je.a,{onClick:function(){return e=t,void r((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilities:t.disponibilities.map((function(t,n){return n===s?Object(o.a)(Object(o.a)({},t),{},{transfert:Object(o.a)(Object(o.a)({},t.transfert),{},{transfertLists:t.transfert.transfertLists.filter((function(t,n){return n!==e}))})}):t}))})}));var e},color:"violet",icon:Object(me.jsx)(wt.a,{}),style:Wn.iconButton}),t+1===(null===i||void 0===i||null===(n=i.transfert)||void 0===n?void 0:n.transfertLists.length)&&Object(me.jsx)(Je.a,{onClick:u,color:"violet",icon:Object(me.jsx)(et.a,{}),style:Wn.iconButton})]})]},t)}))]})]})},Hn={section:{paddingBottom:"10px"},flightContainer:{display:"flex",flexDirection:"column"},flightRow:{display:"flex",alignItems:"center",width:"100%",marginBottom:"16px"},flightContent:{flexGrow:1},buttonGroup:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"8px",width:"5%"},iconButton:{width:"30px",height:"30px"},container:{display:"flex",gap:"16px",alignItems:"center"},baggages:{display:"flex",gap:"2px",alignItems:"center"},baggageInput:{width:"60px"},labelX:{fontSize:"12px"},labelKg:{fontSize:"14px"}},qn=Fe.v.reduce((function(e,t){return e[t.value]=t.label,e}),{}),Zn=function(e,t){return 0!==e?qn[e]||"":t},Jn=function(e){var t=e.flight,n=e.handleChange,a=e.departureAirportData,r=e.arrivalAirportData,i=e.departureCity,o=e.setDepartureCity,l=e.arrivalCity,u=e.setArrivalCity,d=e.paysData,j=e.index,b=e.previousArrivalDate,O=function(e,t){n(j,e,t)},f=Object(c.useState)(""),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(c.useState)(""),g=Object(s.a)(x,2),_=g[0],v=g[1],y=/^(\d{0,2})(h)?( ?)?([0-5]?\d{0,1})?(m?)?$/;Object(c.useEffect)((function(){t.departureAirportId&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Airport).fetchById(t.departureAirportId).then((function(e){m(e.data)}))}),[t.departureAirportId]),Object(c.useEffect)((function(){t.arrivalAirportId&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Airport).fetchById(t.arrivalAirportId).then((function(e){v(e.data)}))}),[t.arrivalAirportId]);var C=Object(c.useMemo)((function(){return(null===d||void 0===d?void 0:d.map((function(e){return{label:e.nom,value:e.nom}})))||[]}),[d]),I=Object(c.useMemo)((function(){return(null===a||void 0===a?void 0:a.map((function(e){return{label:"".concat(e.city," - ").concat(e.name),value:e.id}})))||[]}),[a]),E=Object(c.useMemo)((function(){return(null===r||void 0===r?void 0:r.map((function(e){return{label:"".concat(e.city," - ").concat(e.name),value:e.id}})))||[]}),[r]),S=function(e,t){var n=parseFloat(t);n>=0&&O(e,n)};return Object(me.jsxs)("div",{children:[Object(me.jsxs)("div",{style:Hn.container,children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsxs)("label",{children:[V.name,": "]}),Object(me.jsx)(fe.a,{block:!0,value:t.name||"",onChange:function(e){return O("name",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsxs)("label",{children:[V.flightNumber,": "]}),Object(me.jsx)(fe.a,{block:!0,value:t.flightNumber||"",onChange:function(e){return O("flightNumber",e)}})]})]}),Object(me.jsxs)("div",{style:Hn.container,children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(me.jsxs)("label",{children:[V.countryDeparture,":"]}),Object(me.jsx)(Ze.a,{data:C,block:!0,value:i,onSelect:function(e){return o(e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsx)("label",{children:V.airport}),Object(me.jsx)(Ze.a,{data:I,block:!0,value:t.departureAirportId,onSelect:function(e){return O("departureAirportId",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsxs)("label",{children:[V.startingName,":"]}),Object(me.jsx)(fe.a,{block:!0,value:p.name||"",disabled:!0})]})]}),Object(me.jsxs)("div",{style:Hn.container,children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(me.jsxs)("label",{children:[V.countryArrival,":"]}),Object(me.jsx)(Ze.a,{data:C,block:!0,value:l,onSelect:function(e){return u(e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsx)("label",{children:V.airport}),Object(me.jsx)(Ze.a,{data:E,block:!0,value:t.arrivalAirportId,onSelect:function(e){return O("arrivalAirportId",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(me.jsxs)("label",{children:[V.arrivalName,":"]}),Object(me.jsx)(fe.a,{block:!0,value:_.name||"",disabled:!0})]})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.5,children:[Object(me.jsxs)("label",{children:[V.departureDate," :"]}),Object(me.jsx)(fe.a,{min:b?_e()(b).format("YYYY-MM-DDTHH:mm"):"",type:"datetime-local",value:_e()(t.departDate).format("YYYY-MM-DDTHH:mm")||"",onChange:function(e){return O("departDate",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.5,children:[Object(me.jsxs)("label",{children:[V.arrivalDate,":"]}),Object(me.jsx)(fe.a,{min:_e()(t.departDate).format("YYYY-MM-DDTHH:mm"),type:"datetime-local",value:_e()(t.arrivalDate).format("YYYY-MM-DDTHH:mm")||"",onChange:function(e){return O("arrivalDate",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.3,children:[Object(me.jsxs)("label",{children:[V.flightDuration,": "]}),Object(me.jsx)(fe.a,{block:!0,value:t.flightDuration||"",placeholder:"1h 00m",onChange:function(e){(""===e||y.test(e))&&O("flightDuration",e)},onBlur:function(){/^\d{1,2}h [0-5]\d{1}m$/.test(t.flightDuration)||O("flightDuration","")}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(me.jsxs)("label",{children:[V.class,":"]}),Object(me.jsx)(Ze.a,{data:Fe.p,block:!0,noSearch:!0,value:t.class,onChange:function(e){return O("class",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:3.5,l:2.2,xl:1.6,children:[Object(me.jsxs)("label",{children:[V.handLuggage,":"]}),Object(me.jsxs)("div",{style:Hn.baggages,children:[Object(me.jsx)(fe.a,{type:"number",step:"1",min:"0",value:t.nbrHandBaggages,onChange:function(e){return S("nbrHandBaggages",e)},style:Hn.baggageInput}),Object(me.jsx)("label",{style:Hn.labelX,children:"x"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:t.handBaggages,onChange:function(e){return S("handBaggages",e)},style:{flex:1}}),Object(me.jsx)("label",{style:Hn.labelKg,children:"Kg"})]})]}),Object(me.jsxs)(be.a,{className:"p-5",m:3,l:2.2,xl:1.6,children:[Object(me.jsxs)("label",{children:[V.luggage,":"]}),Object(me.jsxs)("div",{style:Hn.baggages,children:[Object(me.jsx)(fe.a,{type:"number",step:"1",min:"0",value:t.nbrBaggages,onChange:function(e){return S("nbrBaggages",e)},style:Hn.baggageInput}),Object(me.jsx)("label",{style:Hn.labelX,children:"x"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:t.baggages,onChange:function(e){return S("baggages",e)}}),Object(me.jsx)("label",{style:Hn.labelKg,children:"Kg"})]})]}),Object(me.jsxs)(be.a,{className:"p-5",m:8,l:6,xl:6,children:[Object(me.jsxs)("label",{children:[V.description,": "]}),Object(me.jsx)(fe.a,{block:!0,value:t.description||"",onChange:function(e){return O("description",e)}})]})]})},Xn=function(e){var t=e.index,n=e.flight,a=e.type,r=e.setList,i=e.previousArrivalDate,l=Object(c.useState)({departure:[],arrival:[]}),u=Object(s.a)(l,2),d=u[0],j=u[1],b=Object(c.useState)({departure:"",arrival:""}),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)([]),m=Object(s.a)(p,2),x=m[0],g=m[1],_=Object(c.useCallback)((function(e){var t=f[e];t&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Airport,{city:t,take:500}).customGet().then((function(t){j((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},e,t.data.data||[]))}))}))}),[f]),v=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Pays,{}).customGet().then((function(e){return g(e.data)}))}),[]);return Object(c.useEffect)((function(){_("departure"),_("arrival")}),[_]),Object(c.useEffect)((function(){v()}),[v]),Object(me.jsx)("div",{style:{background:"rgb(70, 90, 238, 0.2)",padding:"10px"},className:"p-5",children:Object(me.jsx)(Jn,{flight:n,handleChange:function(e,t,n){r((function(a){return a.map((function(a,c){return c===e?Object(o.a)(Object(o.a)({},a),{},Object(G.a)({},t,n)):a}))}))},type:a,index:t,departureAirportData:d.departure,arrivalAirportData:d.arrival,paysData:x,setArrivalCity:function(e){return h((function(t){return Object(o.a)(Object(o.a)({},t),{},{arrival:e})}))},setDepartureCity:function(e){return h((function(t){return Object(o.a)(Object(o.a)({},t),{},{departure:e})}))},arrivalCity:f.arrival,departureCity:f.departure,previousArrivalDate:i})})},Qn=function(e){var t=e.model,n=e.setModel,a=e.disponibilitie,r=e.index,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1];Object(c.useMemo)((function(){if(a.flights){var e=a.flights;d(e.filter((function(e){return 0===e.type}))),f(e.filter((function(e){return 1===e.type})))}}),[]);var h=function(e){var t=new ee(e,a.airlineId);0===e?d((function(e){return[].concat(Object(qe.a)(e),[t])})):f((function(e){return[].concat(Object(qe.a)(e),[t])}))},p=function(e,t){0===e?d((function(e){return e.filter((function(e,n){return n!==t}))})):1===e&&f((function(e){return e.filter((function(e,n){return n!==t}))}))};Object(c.useEffect)((function(){var e=[].concat(Object(qe.a)(u),Object(qe.a)(O));n((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilities:t.disponibilities.map((function(t,n){return n===r?Object(o.a)(Object(o.a)({},t),{},{flights:e}):t}))})}))}),[u,O]);return Object(c.useEffect)((function(){n((function(e){return Object(o.a)(Object(o.a)({},e),{},{disponibilities:e.disponibilities.map((function(e,t){if(t===r){var n,a,c=[].concat(Object(qe.a)(u),Object(qe.a)(O)),i=(null===(n=c.find((function(e){return 0===e.type})))||void 0===n?void 0:n.departDate)||null,s=(null===(a=c.filter((function(e){return 1===e.type})).sort((function(e,t){return new Date(t.arrivalDate)-new Date(e.arrivalDate)}))[0])||void 0===a?void 0:a.arrivalDate)||null;return Object(o.a)(Object(o.a)({},e),{},{date:i,returnDate:s})}return e}))})}))}),[u,O,r]),Object(me.jsxs)("div",{className:"p-5",children:[Object(me.jsxs)("div",{style:Hn.section,children:[Object(me.jsx)("h6",{children:"Vols de d\xe9part"}),0===u.length&&Object(me.jsx)(Je.a,{onClick:function(){h(0)},color:"violet",icon:Object(me.jsx)(et.a,{})}),Object(me.jsx)("div",{style:Hn.flightContainer,children:u.map((function(e,c){return Object(me.jsxs)("div",{style:Hn.flightRow,children:[Object(me.jsx)("div",{style:Hn.flightContent,children:Object(me.jsx)(Xn,{model:t,setModel:n,disponibilitie:a,index:c,flight:e,type:0,setList:d,previousArrivalDate:c>0?u[c-1].arrivalDate:null})}),Object(me.jsxs)("div",{style:Hn.buttonGroup,children:[Object(me.jsx)(Je.a,{onClick:function(){p(0,c)},color:"violet",icon:Object(me.jsx)(wt.a,{}),style:Hn.iconButton}),c+1===u.length&&Object(me.jsx)(Je.a,{onClick:function(){h(0)},color:"violet",icon:Object(me.jsx)(et.a,{}),style:Hn.iconButton})]})]},c)}))})]}),Object(me.jsxs)("div",{children:[Object(me.jsx)("h6",{children:"Vols retour"}),0===O.length&&Object(me.jsx)(Je.a,{onClick:function(){h(1)},color:"violet",icon:Object(me.jsx)(et.a,{})}),Object(me.jsx)("div",{style:Hn.flightContainer,children:O.map((function(e,c){var r=function(e,t,n){var a=null;if(0===e){var c=t.slice().reverse().find((function(e){return 0===e.type}));a=c?c.arrivalDate:null}else a=n[e-1].arrivalDate;return a}(c,u,O);return Object(me.jsxs)("div",{style:Hn.flightRow,children:[Object(me.jsx)("div",{style:Hn.flightContent,children:Object(me.jsx)(Xn,{model:t,setModel:n,disponibilitie:a,index:c,flight:e,type:1,setList:f,previousArrivalDate:r})}),Object(me.jsxs)("div",{style:Hn.buttonGroup,children:[Object(me.jsx)(Je.a,{onClick:function(){p(1,c)},color:"violet",icon:Object(me.jsx)(wt.a,{}),style:Hn.iconButton}),c+1===O.length&&Object(me.jsx)(Je.a,{onClick:function(){h(1)},color:"violet",icon:Object(me.jsx)(et.a,{}),style:Hn.iconButton})]})]},c)}))})]})]})},$n=function e(){Object(U.a)(this,e),this.id=0,this.name=null,this.prices=[],this.note="",this.disponibilities=[new aa],this.extrats=[new ea],this.description="",this.caracteristique=new ra,this.destinations=[],this.images=[],this.imageUrls=[],this.programId=0,this.isDisplayed=!1,this.categoryIds=[]},ea=function e(){Object(U.a)(this,e),this.id=0,this.providerId=0,this.service=null,this.unitCost=0,this.unitFee=0,this.note="",this.exchange=1},ta=function e(){Object(U.a)(this,e),this.id=0,this.name="",this.order=0,this.nbrDay=1,this.hotelsVo=[new na],this.excursionDestIds=[]},na=function e(t){Object(U.a)(this,e),this.id=0,this.duration=1,this.checkin=new Date,this.exchange=0,this.currencyId=0,this.providerId=0,this.name=t||"",this.hotelListId=0,this.destinationId=0,this.packageMealTypes=[],this.caracteristique=new ce},aa=function e(){Object(U.a)(this,e),this.id=0,this.date="",this.returnDate="",this.onStock=0,this.cost=0,this.commission=0,this.b2BCommission=0,this.airlineId=null,this.transfert=new ca,this.flights=[]},ca=function e(){Object(U.a)(this,e),this.id=0,this.name="",this.description="",this.packageId=0,this.caracteristiqueId=0,this.caracteristiques=new ie,this.transfertLists=[new oe]},ra=function e(){Object(U.a)(this,e),this.hasVol=!1,this.hasTransfert=!1,this.hasHotels=!1,this.hasVisa=!1,this.hasMeal=!1},ia=function(e){var t=e.model,n=e.setModel,a=e.isUmrah,r=Object(D.d)(K);Object(c.useEffect)((function(){n((function(e){var t=Object(qe.a)(e.disponibilities).sort((function(e,t){return e&&!t?-1:new Date(e.date)>=new Date(t.date)?1:-1}));return Object(o.a)(Object(o.a)({},e),{},{disponibilities:t})}))}),[t.id]);var i=function(e,t){n((function(n){return Object(o.a)(Object(o.a)({},n),{},{disponibilities:n.disponibilities.map((function(n,a){if(a===e){var c=n.flights.map((function(e){return Object(o.a)(Object(o.a)({},e),{},{airlineId:t.airlineId})}));return Object(o.a)(Object(o.a)(Object(o.a)({},n),t),{},{flights:c})}return n}))})}))},s=function(){n((function(e){return Object(o.a)(Object(o.a)({},e),{},{disponibilities:[].concat(Object(qe.a)(e.disponibilities),[a?new $:new aa])})}))},l=function(e,t,n){var a=parseFloat(t);a>=0&&i(e,Object(G.a)({},n,a))};return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("h6",{children:"Vols"}),(!t.disponibilities||!t.disponibilities.length)&&Object(me.jsx)("div",{children:Object(me.jsx)(Je.a,{onClick:s,color:"violet",icon:Object(me.jsx)(et.a,{}),children:"ajouter"})}),t.disponibilities.map((function(e,a){var c;return Object(me.jsxs)("div",{className:"p-10",children:[Object(me.jsxs)(Pe.a,{header:Object(me.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(me.jsx)("span",{children:"Disponibilit\xe9 ".concat(a+1)}),Object(me.jsx)(Je.a,{onClick:function(){return e=a,void n((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilities:t.disponibilities.filter((function(t,n){return n!==e}))})}));var e},color:"violet",icon:Object(me.jsx)(wt.a,{}),style:{marginLeft:"10px"}})]}),bordered:!0,collapsible:!0,bodyFill:!0,children:[Object(me.jsxs)(be.a,{className:"p-10",m:6,l:2,xl:2,children:[Object(me.jsxs)("label",{children:[V.date,":"]}),Object(me.jsx)(fe.a,{disabled:!0,type:"datetime-local",value:_e()(e.date).format("YYYY-MM-DDTHH:mm")||""})]}),Object(me.jsxs)(be.a,{className:"p-10",m:6,l:2,xl:2,children:[Object(me.jsxs)("label",{children:[V.returnDate,":"]}),Object(me.jsx)(fe.a,{type:"datetime-local",value:_e()(e.returnDate).format("YYYY-MM-DDTHH:mm")||"",disabled:!0})]}),Object(me.jsx)(be.a,{s:2,m:1,l:.5,xl:.5,className:"p-10",children:e.airlineId&&Object(me.jsx)("img",{alt:"Airline logo",style:{width:"50px"},src:null===(c=r.find((function(t){return t.id===e.airlineId})))||void 0===c?void 0:c.logo})}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsx)("label",{children:"Airline:"}),Object(me.jsx)(Ze.a,{data:r.map((function(e){return{label:e.name,value:e.id}})),block:!0,value:e.airlineId,onSelect:function(e){return i(a,{airlineId:e})}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.number,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"1",min:"0",value:e.onStock,onChange:function(e){return l(a,e,"onStock")}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.cost,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:function(e){return l(a,e,"cost")}})]}),Object(me.jsxs)(be.a,{s:3,m:2,l:1.5,xl:1.5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.commission,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.commission,onChange:function(e){return l(a,e,"commission")}})]}),Object(me.jsxs)(be.a,{s:3,m:2,l:1.5,xl:1.5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.commissionB2B,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.b2BCommission||0,onChange:function(e){return l(a,e,"b2BCommission")}})]}),Object(me.jsx)(Vn,{setModel:n,disponibilitie:e,index:a}),Object(me.jsx)(Qn,{model:t,setModel:n,disponibilitie:e,index:a})]}),Object(me.jsx)("div",{style:Wn.addDispo,children:a+1===t.disponibilities.length&&Object(me.jsx)(Je.a,{onClick:s,color:"violet",icon:Object(me.jsx)(et.a,{})})})]},a)}))]})},oa=(n(196),function(e){var t=e.model,n=e.setModel,a=function(e,a,c){var r=t.differentFees.map((function(t,n){return n===e?Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},a,"cost"===a?parseFloat(c):c)):t}));n(Object(o.a)(Object(o.a)({},t),{},{differentFees:r}))},c=function(){var e=[].concat(Object(qe.a)(t.differentFees),[new X]);n(Object(o.a)(Object(o.a)({},t),{},{differentFees:e}))};return Object(me.jsxs)("div",{children:[Object(me.jsxs)("h6",{children:["Autres Frais"," ",0===t.differentFees.length&&Object(me.jsx)(Je.a,{onClick:c,color:"violet",icon:Object(me.jsx)(et.a,{})})]}),t.differentFees.map((function(e,r){return Object(me.jsxs)("div",{className:"fee-entry",children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Designation :"}),Object(me.jsx)(fe.a,{value:e.designation,onChange:function(e){return a(r,"designation",e)}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Co\xfbt :"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:function(e){return function(e,t){var n=parseFloat(t);n>=0&&a(e,"cost",n)}(r,e)}})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:{height:"42px"}}),Object(me.jsx)(Je.a,{onClick:function(){return function(e){var a=t.differentFees.filter((function(t,n){return n!==e}));n(Object(o.a)(Object(o.a)({},t),{},{differentFees:a}))}(r)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),r+1===t.differentFees.length&&Object(me.jsx)(Je.a,{onClick:c,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},e.id||r)}))]})}),sa=n(1248),la={extratsMainContainer:{display:"flex",flexDirection:"column"},conatainer:{display:"flex"},iconButton:{height:"42px"},mainInformations:{display:"flex",flexDirection:"column"},subMain:{display:"flex",flexDirection:"row"}},ua=function(e){var t=e.model,n=e.setModel,a=function(e,t,a){n((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},e,a?a(t):t))}))},r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=function(e,t,n){n(t)>=0&&a(e,t,n)};Object(c.useEffect)((function(){B.a.createAPIEndpoint("".concat(B.a.ENDPOINTS.Category,"/GetFiltreData"),{isUmrah:!0}).fetchAll().then((function(e){u(e.data.categories)})).catch((function(e){console.log("e",e)}))}),[]);return Object(me.jsxs)("div",{style:la.mainInformations,children:[Object(me.jsxs)("div",{style:la.subMain,children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom : "}),Object(me.jsx)(fe.a,{value:t.name,onChange:function(e){return a("name",e.toUpperCase())}})]}),Object(me.jsxs)(be.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission : "}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:t.commission,onChange:function(e){return d("commission",e,parseFloat)}})]}),Object(me.jsxs)(be.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission B2B : "}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:t.b2Bcommission,onChange:function(e){return d("b2Bcommission",e,parseFloat)}})]}),Object(me.jsxs)(be.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Nbre pour une gratuit\xe9 : "}),Object(me.jsx)(fe.a,{type:"number",step:"1",min:"0",value:t.nbr_for_free_place,onChange:function(e){return d("nbr_for_free_place",e,parseInt)}})]}),Object(me.jsxs)(be.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.categories," :"]}),Object(me.jsx)("div",{className:"p-2 font-sans",children:Object(me.jsx)(sa.a,{value:t.categoryIds||[],data:l.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,onChange:function(e){a("categoryIds",e)},placeholder:V.chooseCategories})})]})]}),Object(me.jsxs)(be.a,{l:12,xl:12,m:12,className:"p-5",children:[Object(me.jsxs)("label",{children:[V.description," : "]}),Object(me.jsx)(fe.a,{as:"textarea",rows:4,block:!0,name:"description",value:t.description||"",onChange:function(e){return a("description",e)}})]})]})},da=function(e){var t=e.model,n=e.fetchProviders,a=e.providers,c=e.handleUpdateExtrat,r=e.getCurrencyOptions,i=e.handleCurrencySelect,s=e.handleProviderSelect,l=e.exchange,u=e.providerId,d=e.currencyId,j=e.handleAddExtrats,b=e.handleRemoveExtrat,O=e.setModel,f=function(e){var n=h(e).length>0,a=t.extrats.filter((function(t,n){return n!==e})).map((function(e){return e.service}));return Fe.v.filter((function(e){return!(0!==e.value||!n)||!a.includes(e.value)}))},h=function(e){var n=t.extrats.filter((function(t,n){return n!==e&&0===t.service})).map((function(e){return e.designation}));return Fe.y.filter((function(e){return!n.includes(e.value)}))};return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("h6",{children:"Extrats"}),0===t.extrats.length?Object(me.jsx)(Je.a,{onClick:j,color:"violet",icon:Object(me.jsx)(et.a,{})}):Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("div",{style:la.extratsMainContainer,children:[Object(me.jsxs)("div",{style:la.conatainer,children:[Object(me.jsxs)(be.a,{className:"p-10",m:4,l:3,xl:2.5,children:[Object(me.jsxs)("label",{children:[V.supplier,":"]}),Object(me.jsx)(Ze.a,{onSearch:n,data:function(e){return e.map((function(e){return{label:e.name,value:e.id}}))}(a),block:!0,noSearch:!0,value:u,onSelect:s})]}),Object(me.jsxs)(be.a,{s:3,m:3,l:2.5,xl:2,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.currency,":"]}),Object(me.jsx)(Ze.a,{data:r(),block:!0,noSearch:!0,value:d,onSelect:i})]}),Object(me.jsxs)(be.a,{s:3,m:3,l:1.5,xl:1,className:"p-10",children:[Object(me.jsx)("label",{children:"Cour:"}),Object(me.jsx)(fe.a,{type:"text",value:l,disabled:!0})]})]}),t.extrats.map((function(e,n){return Object(me.jsxs)("div",{className:"fee-entry",style:la.conatainer,children:[Object(me.jsxs)(be.a,{className:"p-10",m:4,l:2.5,xl:1.8,children:[Object(me.jsxs)("label",{children:[V.service,":"]}),Object(me.jsx)(Ze.a,{data:f(n),block:!0,noSearch:!0,value:e.service,onSelect:function(e){!function(e,n){var a=t.extrats.map((function(t,a){return a===e?Object(o.a)(Object(o.a)({},t),{},{service:n,designation:Zn(n,"")}):t}));O((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:a})}))}(n,e)}})]}),Object(me.jsxs)(be.a,{m:4,l:3,xl:3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.designation,":"]}),0===e.service?Object(me.jsx)(Ze.a,{data:h(n),block:!0,noSearch:!0,value:e.designation,onSelect:function(e){return c(n,"designation",e)}}):Object(me.jsx)(fe.a,{value:Zn(e.service,e.designation),disabled:!0})]}),Object(me.jsxs)(be.a,{s:4,m:4,l:1.5,xl:1.5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.cost,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:function(e){return function(e,t){var n=parseFloat(t);n>=0&&c(e,"cost",n)}(n,e)}})]}),Object(me.jsxs)(be.a,{s:4,m:4,l:1.3,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.cost," ",V.TND,":"]}),Object(me.jsx)(fe.a,{type:"text",value:Object(st.a)(e.cost*e.exchange),disabled:!0})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:la.iconButton}),Object(me.jsx)(Je.a,{onClick:function(){return b(n)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),n+1===t.extrats.length&&Object(me.jsx)(Je.a,{onClick:j,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},n)}))]})})]})},ja=function(e){var t,n,a,r=e.model,i=e.setModel,l=e.fetchProviders,u=e.exchanges,d=e.currencies,j=e.providers,b=Object(c.useState)((null===r||void 0===r||null===(t=r.extrats[0])||void 0===t?void 0:t.providerId)||0),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)((null===r||void 0===r||null===(n=r.extrats[0])||void 0===n?void 0:n.currencyId)||0),m=Object(s.a)(p,2),x=m[0],g=m[1],_=Object(c.useState)((null===r||void 0===r||null===(a=r.extrats[0])||void 0===a?void 0:a.exchange)||1),v=Object(s.a)(_,2),y=v[0],C=v[1],I=function(e){var t=r.extrats.map((function(t){return Object(o.a)(Object(o.a)({},t),e)}));i((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:t})}))};return Object(me.jsxs)("div",{children:[Object(me.jsx)(ua,{model:r,setModel:i}),Object(me.jsx)(Gn,{setCaracteristiques:function(e){i((function(t){return Object(o.a)(Object(o.a)({},t),{},{caracteristique:e})}))},caracteristique:r.caracteristique||{},translations:Fe.c}),Object(me.jsx)(oa,{model:r,setModel:i}),Object(me.jsx)(da,{model:r,providers:j,fetchProviders:l,handleUpdateExtrat:function(e,t,n){var a=r.extrats.map((function(a,c){return c===e?Object(o.a)(Object(o.a)({},a),{},Object(G.a)({},t,"cost"===t?parseFloat(n):n)):a}));i((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:a})}))},getCurrencyOptions:function(){var e,t=j.find((function(e){return e.id===f}));return(null===t||void 0===t||null===(e=t.currencies)||void 0===e?void 0:e.map((function(e){var t=e.currency;return{label:t.name,value:t.id}})))||d.map((function(e){return{label:e.name,value:e.id}}))},handleCurrencySelect:function(e){var t;g(e);var n=(null===(t=u.find((function(t){return t.currencySourceId===e})))||void 0===t?void 0:t.rate)||1;C(n),I({currencyId:e,exchange:n})},handleProviderSelect:function(e){h(e),I({providerId:e})},exchange:y,providerId:f,currencyId:x,handleAddExtrats:function(){var e=[].concat(Object(qe.a)(r.extrats),[new J(f,x,y)]);i(Object(o.a)(Object(o.a)({},r),{},{extrats:e}))},handleRemoveExtrat:function(e){var t=r.extrats.filter((function(t,n){return n!==e}));i(Object(o.a)(Object(o.a)({},r),{},{extrats:t}))},setModel:i})]})},ba=function(e){var t,n=e.index,a=e.model,c=e.data,r=e.keyName,i=e.setModel,s=e.grouppedBy;return Object(me.jsxs)("tr",{style:{background:n%2?"rgb(244,81,108,0)":"rgb(70,103,209,0.2)",borderBottom:"3px solid #eee"},children:[Object(me.jsx)("td",{children:Object(me.jsx)(en.a,{onChange:function(){var e=Object(qe.a)(a.prices);c[r].forEach((function(t,n){var a="".concat(t.hotelMakkahName," - ").concat(t.hotelMadinahName," - ").concat(t.typeTraveler),c=e.findIndex((function(e){return"".concat(e.hotelMakkahName," - ").concat(e.hotelMadinahName," - ").concat(e.typeTraveler)===a}));-1!==c&&(e[c]=Object(o.a)(Object(o.a)({},e[c]),{},{isHidden:!e[c].isHidden}))})),s(e),i((function(t){return Object(o.a)(Object(o.a)({},t),{},{prices:e})}))},checked:!(null===(t=a.prices.filter((function(e){return c[r].find((function(t){return JSON.stringify(e)===JSON.stringify(t)}))}))[0])||void 0===t?void 0:t.isHidden)})}),Object(me.jsx)("td",{children:Object(me.jsx)("h6",{children:r})}),Object(me.jsx)("td",{children:Object(st.a)(a.b2Bcommission+a.commission)}),["SIMPLE","DOUBLE","TRIPLE","QUAD","FAMILIALE","SUITE"].map((function(e,t){var n=c[r].find((function(t){return t.arrangementMadinahDesignation.toUpperCase().includes(e)&&t.arrangementMakkahDesignation.toUpperCase().includes(e)})),s=null===n||void 0===n?void 0:n.arrangementMadinahDesignation,l=null===n||void 0===n?void 0:n.arrangementMakkahDesignation,u=a.prices.find((function(e){return e.hotelMakkahName===(null===n||void 0===n?void 0:n.hotelMakkahName)&&e.hotelMadinahName===(null===n||void 0===n?void 0:n.hotelMadinahName)&&e.typeTraveler===(null===n||void 0===n?void 0:n.typeTraveler)&&e.arrangementMadinahDesignation===s&&e.arrangementMakkahDesignation===l})),d=u?u.price:(null===n||void 0===n?void 0:n.baseCost)+a.b2Bcommission+a.commission||0,j=(null===n||void 0===n?void 0:n.baseCost)+(null===a||void 0===a?void 0:a.b2Bcommission)+(null===a||void 0===a?void 0:a.commission);return Object(me.jsx)("td",{children:n?Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("b",{children:Object(st.a)(j)}),Object(me.jsx)(fe.a,{value:d||0,onChange:function(e){!function(e,t){var n=Object(qe.a)(a.prices),c=n.findIndex((function(e){return e.hotelMakkahName===t.hotelMakkahName&&e.hotelMadinahName===t.hotelMadinahName&&e.typeTraveler===t.typeTraveler&&e.arrangementMadinahDesignation===t.arrangementMadinahDesignation&&e.arrangementMakkahDesignation===t.arrangementMakkahDesignation}));-1!==c&&(n[c]=Object(o.a)(Object(o.a)({},n[c]),{},{price:parseFloat(e)})),i((function(e){return Object(o.a)(Object(o.a)({},e),{},{prices:n})}))}(e,n)}})]}):0},"".concat(e,"-").concat(t))}))]})},Oa=function(e){var t=e.model,n=e.data,a=e.setModel,c=e.grouppedBy;return Object(me.jsxs)("div",{children:[Object(me.jsxs)("table",{children:[Object(me.jsx)("thead",{children:Object(me.jsxs)("tr",{children:[Object(me.jsx)("th",{children:"-"}),Object(me.jsx)("th",{children:"Designation"}),Object(me.jsx)("th",{children:"Commission"}),Object(me.jsx)("th",{children:"SIMPLE"}),Object(me.jsx)("th",{children:"DOUBLE"}),Object(me.jsx)("th",{children:"TRIPLE"}),Object(me.jsx)("th",{children:"QUAD"}),Object(me.jsx)("th",{children:"FAMILIALE"}),Object(me.jsx)("th",{children:"SUITE"})]})}),Object(me.jsx)("tbody",{children:t.destinations&&0!==t.destinations.length&&n&&Object.keys(n).map((function(e,r){return Object(me.jsx)(ba,{index:r,model:t,data:n,keyName:e,setModel:a,grouppedBy:c},e)}))})]}),Object(me.jsx)("style",{jsx:!0,children:"\n thead {\n background: rgb(70, 103, 209);\n color: #fff;\n }\n th,\n td {\n padding: 5px 8px;\n }\n th {\n text-align: left;\n }\n "})]})},fa=function(e){var t=e.model,n=e.setModel,a=Object(c.useState)([]),r=Object(s.a)(a,2),i=r[0],l=r[1],u=Object(c.useRef)(t.prices),d=function(e,n,a,c,r,i,o){var s=e+n+r.unitCost*a.duration*a.exchange+i.unitCost*c.duration*c.exchange;return t.nbr_for_free_place&&(s*=1+1/t.nbr_for_free_place),{typeTraveler:i.typeTraveler,baseCost:s,hotelMadinahName:a.name,hotelMakkahName:c.name,arrangementMadinahDesignation:r.designation,arrangementMakkahDesignation:i.designation,price:(null===o||void 0===o?void 0:o.price)||0,id:(null===o||void 0===o?void 0:o.id)||0,packageUmrahId:(null===o||void 0===o?void 0:o.packageUmrahId)||0,hotelMadinahId:(null===o||void 0===o?void 0:o.hotelMadinahId)||0,hotelMakkahId:(null===o||void 0===o?void 0:o.hotelMakkahId)||0}},j=function(e){var t=e.reduce((function(e,t){var n="".concat(t.hotelMakkahName," - ").concat(t.hotelMadinahName," - ").concat(t.typeTraveler);return e[n]||(e[n]=[]),e[n].push(t),e}),{});l(t)};return Object(c.useEffect)((function(){var e=function(e){var n,a,c=(null===(n=t.differentFees)||void 0===n?void 0:n.reduce((function(e,t){return e+t.cost}),0))||0,r=(null===(a=t.packageUmrahCosts)||void 0===a?void 0:a.reduce((function(e,t){return e+t.cost*t.exchange}),0))||0,i=e.filter((function(e){return"makkah"===e.name})),o=e.filter((function(e){return"madinah"===e.name})),s=[];return o.forEach((function(e){e.hotelsUmrah.forEach((function(e){e.arrangements.forEach((function(t){i.forEach((function(n){n.hotelsUmrah.forEach((function(n){n.arrangements.forEach((function(a){if(t.designation===a.designation&&t.typeTraveler===a.typeTraveler){var i=u.current.find((function(c){return c.hotelMadinahName===e.name&&c.hotelMakkahName===n.name&&c.arrangementMadinahDesignation===t.designation&&c.arrangementMakkahDesignation===a.designation&&c.typeTraveler===a.typeTraveler}))||null,o=d(c,r,e,n,t,a,i);s.push(o)}}))}))}))}))}))})),s}(t.destinations);e.length&&j(e),n((function(t){return Object(o.a)(Object(o.a)({},t),{},{prices:e})})),u.current=e}),[t.destinations]),Object(me.jsx)("div",{className:"p-10",children:Object(me.jsx)(Oa,{model:t,data:i,setModel:n,grouppedBy:j})})},ha=Object(D.b)({key:"hotelAtoms",default:[]}),pa=(n(555),n(782)),ma=function(e){var t=e.open,n=e.selectedFile,a=e.onClose,r=e.onUploadInModal,i=e.crop,o=e.setCrop,l=Object(c.useState)(!1),u=Object(s.a)(l,2),d=u[0],j=u[1],b=Object(c.useState)(!1),O=Object(s.a)(b,2),f=O[0],h=O[1];return Object(me.jsxs)(dt.a,{open:t,onClose:a,size:"md",children:[Object(me.jsx)(dt.a.Header,{children:Object(me.jsx)(dt.a.Title,{children:"T\xe9l\xe9charger le fichier"})}),Object(me.jsx)(dt.a.Body,{children:n&&n.blobFile instanceof Blob?Object(me.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",position:"relative"},children:[Object(me.jsx)(pa.a,{crop:i,onChange:function(e){return o(e)},keepSelection:!0,locked:!0,children:Object(me.jsx)("img",{src:URL.createObjectURL(n.blobFile),alt:"Selected File",onLoad:function(e){var t=e.target,n=t.naturalWidth,a=t.naturalHeight;j(i.height>a),h(i.width>n)},style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}),(d||f)&&Object(me.jsxs)("div",{style:{position:"absolute",bottom:0,background:"rgba(255,0,0,0.6)",color:"white",padding:"5px",borderRadius:"3px",fontSize:"12px",display:"flex",flexDirection:"column",alignItems:"center"},children:[d&&Object(me.jsx)("div",{children:"La hauteur du recadrage d\xe9passe la hauteur de l'image!"}),f&&Object(me.jsx)("div",{children:"La largeur du recadrage d\xe9passe la largeur de l'image!"})]})]}):Object(me.jsx)("p",{children:"Aucun fichier s\xe9lectionn\xe9"})}),Object(me.jsx)(dt.a.Footer,{children:Object(me.jsxs)("div",{style:{display:"flex",gap:2,justifyContent:"center",alignContent:"center",paddingTop:"10px"},children:[Object(me.jsx)(he.a,{onClick:a,appearance:"subtle",children:"Annuler"}),Object(me.jsx)(he.a,{onClick:r,appearance:"primary",children:"Recadrer"})]})})]})},xa=function(e,t,n){return new Promise((function(a,c){var r=new Image;r.src=e,r.onload=function(){var e=document.createElement("canvas"),i=r.naturalWidth/r.width,o=r.naturalHeight/r.height,s={x:t.x/100*n.width,y:t.y/100*n.height,width:t.width/100*n.width,height:t.height/100*n.height};s.x=Math.max(0,Math.min(s.x,n.width-s.width)),s.y=Math.max(0,Math.min(s.y,n.height-s.height)),s.width=Math.min(s.width,n.width-s.x),s.height=Math.min(s.height,n.height-s.y),e.width=s.width,e.height=s.height,e.getContext("2d").drawImage(r,s.x*i,s.y*o,s.width*i,s.height*o,0,0,s.width,s.height),e.toBlob((function(e){e?a(e):c(new Error("Canvas is empty"))}),"image/jpeg",1)},r.onerror=function(e){console.error("Image failed to load:",e),c(e)}}))},ga={container:{padding:"10px"},fileUploadWrapper:{background:"rgba(200,200,200,0.1)"},fileInputLabel:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},fileUploadIcon:{fontSize:"50px",cursor:"pointer"},fileInputText:{color:"#bbb",fontWeight:"400"},warningMessage:{color:"red",marginTop:"10px"},fileContainer:{display:"flex",flexWrap:"wrap",gap:"10px"},filePreviewContainer:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},filePreview:{width:"150px",height:"120px",position:"relative",border:"1px solid #ddd",borderRadius:"5px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},deleteIcon:{cursor:"pointer"},file:{width:"100%",height:"100%",objectFit:"cover"}},_a=n(783),va=n.n(_a),ya=function(e){var t=e.state,n=e.handleDelete,a=e.canDelete;return Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("div",{children:[Object(me.jsx)("h5",{children:"Fichiers t\xe9l\xe9charg\xe9s :"}),Object(me.jsx)("br",{}),Object(me.jsx)("div",{style:ga.fileContainer,children:t.map((function(e,t){var c;return Object(me.jsxs)("div",{style:ga.filePreviewContainer,children:[Object(me.jsx)("div",{style:ga.filePreview,children:e?(null===(c=e.blobFile)||void 0===c?void 0:c.type.startsWith("video"))?Object(me.jsx)("video",{src:e.url||URL.createObjectURL(e.blobFile),controls:!0,style:ga.file}):Object(me.jsx)("img",{src:e.url||URL.createObjectURL(e.blobFile),alt:"Preview",style:ga.file}):Object(me.jsx)("p",{children:"Pas d'aper\xe7u"})}),!a&&Object(me.jsx)("div",{style:ga.deleteIcon,onClick:function(){return n(t)},children:Object(me.jsx)(va.a,{style:{color:"red"}})})]},e.fileKey)}))})]})})},Ca=function(e){return new Promise((function(t,n){var a=new Image;a.src=e,a.onload=function(){t({width:a.width,height:a.height})},a.onerror=function(e){n(e)}}))},Ia=function(e){var t=e.model,n=e.setModel,a=e.hasVideo,r=void 0!==a&&a,i=e.isProgram,l=void 0!==i&&i,u=e.index,d=e.showFileInput,j=void 0===d||d,b=e.program,O=e.state,f=e.setState,h=Object(c.useState)(!1),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(null),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(""),I=Object(s.a)(C,2),E=I[0],S=I[1],D=Object(c.useRef)(null),N=75,P=75,k=Object(c.useState)({unit:"%",x:25,y:25,width:N,height:P}),A=Object(s.a)(k,2),M=A[0],T=A[1];Object(c.useEffect)((function(){var e,n=function(e){f((function(t){var n=new Set(t.map((function(e){return e.url}))),a=e.filter((function(e){return!n.has(e.url)}));return[].concat(Object(qe.a)(t),Object(qe.a)(a))}))};t.imageIds&&0!==t.imageIds.length&&n(t.imageIds.map((function(e){return{id:e,fileKey:null,blobFile:{type:"image"},url:"".concat(Te.a).concat(e,"/content"),name:null,status:"finished"}})));t.imageUrls&&0!==t.imageUrls.length&&n(t.imageUrls.map((function(e){return{id:e,fileKey:null,blobFile:{type:"image"},url:"".concat(Te.a).concat(e,"/content"),name:null,status:"finished"}})));(l&&b&&f([]),l&&t.programsLists&&0!==t.programsLists[u].imageIds)&&n(null===(e=t.programsLists)||void 0===e?void 0:e[u].imageIds.map((function(e){return{id:e,fileKey:null,blobFile:{type:"image"},url:"".concat(Te.a).concat(e,"/content"),name:null,status:"finished"}})));l&&b&&0!==b.imageIds&&n(b.imageIds.map((function(e){return{id:e,fileKey:null,blobFile:{type:"image"},url:"".concat(Te.a).concat(e,"/content"),name:null,status:"finished"}})));r&&t.videoId&&n([{id:t.videoId,fileKey:null,blobFile:{type:"video"},url:"".concat(Te.a).concat(t.videoId,"/content"),name:null,status:"finished"}]);r&&t.videoIds&&n(t.videoIds.map((function(e){return{id:e,fileKey:null,blobFile:{type:"video"},url:"".concat(Te.a).concat(e,"/content"),name:null,status:"finished"}})))}),[t,r,b,l]);var w=function(){var e=Object(hn.a)(fn.a.mark((function e(){var a,c,r,i,s,d,j;return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!v){e.next=23;break}return e.prev=1,a=URL.createObjectURL(v.blobFile),e.next=5,Ca(a);case 5:return c=e.sent,e.next=8,xa(a,M,c);case 8:r=e.sent,i=new File([r],v.name,{type:v.blobFile.type}),s=Object(o.a)(Object(o.a)({},v),{},{id:null,blobFile:r,status:"pending"}),f((function(e){return[].concat(Object(qe.a)(e),[s])})),d=[].concat(Object(qe.a)(t.images||[]),[i]),l?(j={fileName:i.name,day:t.programsLists[u].day},n((function(e){return Object(o.a)(Object(o.a)({},e),{},{images:d,fileDay:[].concat(Object(qe.a)(e.fileDay||[]),[j])})}))):n((function(e){return Object(o.a)(Object(o.a)({},e),{},{images:d})})),T({unit:"%",x:25,y:25,width:N,height:P}),x(!1),y(null),d.length>=5?S(""):S("Vous devez t\xe9l\xe9charger au moins ".concat(5," images")),e.next=23;break;case 20:e.prev=20,e.t0=e.catch(1),console.error("Error cropping image:",e.t0);case 23:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(){return e.apply(this,arguments)}}(),B=Object(c.useCallback)((function(e){if(!(e<0||e>=O.length)){var a=O[e],c=Object(qe.a)(t.images||[]);if(c.splice(e,1),a.id){var r=t.imageUrls||t.imageIds||[],i=t.videos||[],s=t.videoIds||[];"video"===a.blobFile.type?(i=i.filter((function(e){return e.id!==a.id})),s=s.filter((function(e){return e!==a.id}))):r=r.filter((function(e){return e!==a.id})),n((function(e){return Object(o.a)(Object(o.a)({},e),{},{idsDelete:[].concat(Object(qe.a)(e.idsDelete||[]),[a.id]),images:c,imageUrls:t.imageUrls?r:e.imageUrls,imageIds:t.imageIds?r:e.imageIds,videos:t.videos?i:e.videos,videoIds:t.videoIds?s:e.videoIds},l&&{programsLists:(e.programsLists||[]).map((function(e){return Object(o.a)(Object(o.a)({},e),{},{imageIds:e.imageIds.filter((function(e){return e!==a.id}))})}))})}))}else n((function(e){return Object(o.a)(Object(o.a)({},e),{},{images:c})}));f((function(t){return t.filter((function(t,n){return n!==e}))})),c.length<5?S("Vous devez t\xe9l\xe9charger au moins ".concat(5," images")):S("")}}),[t.images,O,t.videos]);return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{style:ga.container,children:[j&&Object(me.jsxs)("div",{style:ga.fileUploadWrapper,children:[Object(me.jsx)("input",{type:"file",onChange:function(e){var a=e.target.files[0];if((null===a||void 0===a?void 0:a.size)>1048576&&(null===a||void 0===a?void 0:a.type.startsWith("image")))alert("La taille du fichier d\xe9passe la limite de 1 Mo.");else if((null===a||void 0===a?void 0:a.size)>10485760&&(null===a||void 0===a?void 0:a.type.startsWith("video")))alert("La taille du fichier d\xe9passe la limite de 10 Mo.");else{var c={id:null,fileKey:Date.now(),blobFile:a,name:null===a||void 0===a?void 0:a.name,status:"pending"};if(null===a||void 0===a?void 0:a.type.startsWith("video")){f((function(e){return[].concat(Object(qe.a)(e),[c])}));var r=[].concat(Object(qe.a)(t.videos||[]),[a]);n((function(e){return Object(o.a)(Object(o.a)({},e),{},{videos:r})}))}else(null===a||void 0===a?void 0:a.type.startsWith("image"))&&(y(c),x(!0))}},accept:r?"image/*,video/*":"image/*",style:{display:"none"},id:"file-input-".concat(u),name:"files",ref:D}),Object(me.jsxs)("label",{htmlFor:"file-input-".concat(u),style:ga.fileInputLabel,children:[Object(me.jsx)("div",{style:ga.fileUploadIcon,children:Object(me.jsx)(Rt.a,{color:"#3598ff"})}),Object(me.jsx)("h4",{style:ga.fileInputText,children:"Cliquez ou Faites glisser les fichiers vers cette zone"})]})]}),Object(me.jsx)(ya,{state:O,handleDelete:B,warningMessage:E,canDelete:!!b})]}),Object(me.jsx)(ma,{open:m,selectedFile:v,onClose:function(){x(!1),y(null),D.current&&(D.current.value="")},onUploadInModal:w,crop:M,setCrop:T})]})},Ea=function(e){var t=e.destinations,n=e.setDestinationModel,a=e.updateModel;return Object(me.jsxs)("table",{className:"table-container",children:[Object(me.jsx)("thead",{children:Object(me.jsxs)("tr",{className:"table-header",children:[Object(me.jsx)("td",{children:"Nom"}),Object(me.jsx)("td",{children:"Actions"})]})}),Object(me.jsx)("tbody",{children:t&&t.map((function(e){return Object(me.jsxs)("tr",{className:"table-row",children:[Object(me.jsx)("td",{children:e.name}),Object(me.jsxs)("td",{className:"table-actions",children:[Object(me.jsx)(Je.a,{appearance:"subtle",onClick:function(){return function(e){n(e)}(e)},icon:Object(me.jsx)(l.b,{}),circle:!0}),Object(me.jsx)(Pt.a,{vertical:!0}),Object(me.jsx)(Je.a,{appearance:"subtle",onClick:function(){return t=e.id,n=e.uuid,void a((function(e){return Object(o.a)(Object(o.a)({},e),{},{destinations:e.destinations.filter((function(e){return t&&e.id!==t||n&&e.uuid!==n}))})}));var t,n},icon:Object(me.jsx)(wt.a,{}),circle:!0})]})]},e.id||e.uuid)}))})]})},Sa=function(e){var t=e.packageMealTypes,n=e.setPackageMealTypes,a=e.exchange,c=e.duration,r=function(e,a){var c=Object(qe.a)(t),r=Object(o.a)(Object(o.a)({},c[e]),{},{cost:parseFloat(a)});c[e]=r,n(c)},i=function(e,a){var c=Object(qe.a)(t);c[e]=Object(o.a)(Object(o.a)({},c[e]),{},{totalPrice:parseFloat(a)}),n(c)},s=function(){n([].concat(Object(qe.a)(t),[new ae]))},l=function(e){var n=t.filter((function(t,n){return n!==e})).map((function(e){return e.typeMeal}));return Fe.z.filter((function(e){return!n.includes(e.value)}))},u=function(e,t,n){parseFloat(t)>=0&&n(e,t)};return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("h6",{children:["Repas \xe0 l'h\xf4tel :"," ",0===t.length&&Object(me.jsx)(Je.a,{onClick:s,color:"violet",icon:Object(me.jsx)(et.a,{})})]}),t.map((function(e,d){return Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{m:4,l:3,xl:3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.meal,":"]}),Object(me.jsx)(Ze.a,{data:l(d),block:!0,value:e.typeMeal,onSelect:function(e){return function(e,a){var c=Object(qe.a)(t);c[e]=Object(o.a)(Object(o.a)({},c[e]),{},{typeMeal:a}),n(c)}(d,e)}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.cost," :"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:function(e){return u(d,e,r)}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.price," TND:"]}),Object(me.jsx)("h6",{children:Object(st.a)(e.cost*c*a||0)})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.totalPrice,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.totalPrice,onChange:function(e){return u(d,e,i)}})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:{height:"42px"}}),Object(me.jsx)(Je.a,{onClick:function(){return function(e){var a=t.filter((function(t,n){return n!==e}));n(a)}(d)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),d+1===t.length&&Object(me.jsx)(Je.a,{onClick:s,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},d)}))]})},Da=function(e){var t=e.arrangements,n=e.setArrangements,a=e.exchange,c=e.duration,r=function(e,t){return e/("Chambre quadruple"===t?4:"Chambre triple"===t?3:2)},i=function(){var e=[].concat(Object(qe.a)(t),[new ne]);n(e)},s=function(e,a){parseFloat(a)>=0&&function(e,a){var c=t.map((function(t,n){return n===e?Object(o.a)(Object(o.a)({},t),{},{cost:a,unitCost:r(a,t.designation)}):t}));n(c)}(e,parseFloat(a)||0)};return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("h6",{children:["Arrangements :"," ",0===t.length&&Object(me.jsx)(Je.a,{onClick:i,color:"violet",icon:Object(me.jsx)(et.a,{})})]}),t.map((function(e,r){return Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{className:"p-10",m:6,l:4,xl:2,children:[Object(me.jsx)("label",{children:"Type du Chambre:"}),Object(me.jsx)(Ze.a,{data:Fe.t,block:!0,noSearch:!0,value:e.designation,onChange:function(e){var a=t.map((function(t,n){return n===r?Object(o.a)(Object(o.a)({},t),{},{designation:e}):t}));n(a)}})]}),Object(me.jsxs)(be.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(me.jsx)("label",{children:"type voyageur:"}),Object(me.jsx)(Ze.a,{data:Fe.B,block:!0,noSearch:!0,value:e.typeTraveler,onChange:function(e){var a=t.map((function(t,n){return n===r?Object(o.a)(Object(o.a)({},t),{},{typeTraveler:e}):t}));n(a)}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.cost,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.cost||0,onChange:function(e){return s(r,e)}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(me.jsx)("label",{children:"Co\xfbt Par Personne:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",disabled:!0,value:e.unitCost||0})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:2,xl:1.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Co\xfbt Total TND:"}),Object(me.jsx)("h6",{className:"p-10",children:Object(st.a)(e.unitCost*a*c||0)})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:{height:"42px"},children:" "}),Object(me.jsx)(Je.a,{onClick:function(){return function(e){var a=t.filter((function(t,n){return n!==e}));n(a)}(r)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),r+1===t.length&&Object(me.jsx)(Je.a,{onClick:i,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},r)}))]})},Na=function(e){var t=e.updateHotel,n=e.hotelData,a=e.hotel,c=e.index,r=e.fetchHotels,i=e.setPackageMealTypes,o=e.setCaracteristiques,s=e.providers,l=e.currencies,u=e.exchanges,d=e.fetchProviders,j=e.setArrangements,b=e.isUmrah;return Object(me.jsxs)("div",{style:{display:"flex",gap:10,flexDirection:"column"},children:[Object(me.jsxs)("div",{style:{display:"flex",gap:8},children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(me.jsx)("label",{children:"H\xf4tel:"}),Object(me.jsx)(Ze.a,{value:a.hotelListId,onSearch:r,data:n.map((function(e){return{label:e.name_en,value:e.id}})),block:!0,noSearch:!0,onSelect:function(e){return function(e,t,n,a){var c=a.find((function(t){return t.id===e}));n(t,{hotelListId:e,name:(null===c||void 0===c?void 0:c.name_en)||""})}(e,c,t,n)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(me.jsx)("label",{children:"Fournisseur:"}),Object(me.jsx)(Ze.a,{value:a.providerId,onSearch:d,data:s.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,onSelect:function(e){t(c,{providerId:e})}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(me.jsx)("label",{children:"Devise:"}),Object(me.jsx)(Ze.a,{data:function(e){if(e){var t=s.find((function(t){return t.id===e}));return t?t.currencies.map((function(e){return{label:e.currency.name,value:e.currency.id}})):[]}return l.map((function(e){return{label:e.name,value:e.id}}))}(),block:!0,noSearch:!0,value:a.currencyId,onSelect:function(e){return function(e,t,n,a){var c=a.find((function(t){return t.currencySourceId===e}));n(t,{currencyId:e}),n(t,{exchange:c?c.rate:1})}(e,c,t,u)}})]}),Object(me.jsxs)(be.a,{s:3,m:3,l:1.5,xl:1,className:"p-10",children:[Object(me.jsx)("label",{children:"Cour:"}),Object(me.jsx)("h6",{className:"p-5",children:a.exchange})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:1.5,xl:1,className:"p-10",children:[Object(me.jsx)("label",{children:"Dur\xe9e:"}),Object(me.jsx)(fe.a,{type:"number",step:"1",min:"0",value:a.duration,onChange:function(e){return function(e,t,n){if(parseInt(e)>=0){var a=parseInt(e,10);n(t,{duration:isNaN(a)?0:a})}}(e,c,t)}})]})]}),Object(me.jsx)(Gn,{setCaracteristiques:function(e){return o(c,e)},caracteristique:a.caracteristique||{},translations:Fe.b}),b&&Object(me.jsx)(Da,{arrangements:a.arrangements,setArrangements:function(e){return j(c,e)},exchange:a.exchange,duration:a.duration}),Object(me.jsx)(Sa,{packageMealTypes:a.packageMealTypes,setPackageMealTypes:function(e){return i(c,e)},exchange:a.exchange,duration:a.duration})]})},Pa={mainContainer:{gap:8,display:"flex",flexDirection:"column"},hotel:{border:"1px solid",width:"95%",gap:4,display:"flex",flexDirection:"column"},container:{display:"flex",gap:5,alignItems:"center"},iconButton:{height:"42px"},label:{display:"flex",gap:4,padding:12},destintaion:{display:"flex",alignItems:"center"}},ka=function(e){var t=e.hotels,n=e.updateHotel,a=e.hotelData,r=e.addHotel,i=e.removeHotel,s=e.setDestinationModel,l=e.fetchHotels,u=e.providers,d=e.currencies,j=e.exchanges,b=e.fetchProviders,O=e.destinationModel,f=e.isUmrah,h=Object(c.useMemo)((function(){return t.reduce((function(e,t){return e+(t.duration||0)}),0)}),[t]);Object(c.useEffect)((function(){s((function(e){return Object(o.a)(Object(o.a)({},e),{},{nbrDay:h})}))}),[h]);var p=function(e,t){s((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},f?"hotelsUmrah":"hotelsVo",(f?n.hotelsUmrah:n.hotelsVo).map((function(n,a){return a===e?Object(o.a)(Object(o.a)({},n),{},{packageMealTypes:t}):n}))))}))},m=function(e,t){s((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},f?"hotelsUmrah":"hotelsVo",(f?n.hotelsUmrah:n.hotelsVo).map((function(n,a){return a===e?Object(o.a)(Object(o.a)({},n),{},{caracteristique:t}):n}))))}))},x=function(e,t){s((function(n){return Object(o.a)(Object(o.a)({},n),{},{hotelsUmrah:n.hotelsUmrah.map((function(n,a){return a===e?Object(o.a)(Object(o.a)({},n),{},{arrangements:t}):n}))})}))};return Object(me.jsx)("div",{style:Pa.mainContainer,children:t.map((function(e,c){return Object(me.jsxs)("div",{style:Pa.container,children:[Object(me.jsx)("div",{style:Pa.hotel,className:"p-10",children:Object(me.jsx)(Na,{fetchHotels:l,hotel:e,updateHotel:n,hotelData:a,index:c,setPackageMealTypes:p,setCaracteristiques:m,providers:u,currencies:d,exchanges:j,fetchProviders:b,setDestinationModel:s,setArrangements:x,isUmrah:f})}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:Pa.iconButton}),Object(me.jsx)(Je.a,{onClick:function(){return i(c)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),c+1===t.length&&Object(me.jsx)(Je.a,{onClick:function(){return r(O.name||"")},color:"violet",icon:Object(me.jsx)(et.a,{})})]})]})}))})},Aa=function(e){var t=e.destinationModel,n=e.setModel,a=e.setDestinationModel,c=t.id||t.uuid?"modifier":"ajouter";return Object(me.jsx)("div",{className:"button-container",children:Object(me.jsx)("button",{className:"button-primary",onClick:function(){n((function(e){var n=e.prices.map((function(n){var a,c,r,i=null===(a=e.destinations.flatMap((function(e){return e.hotelsVo||[]})).find((function(e){var n;return null===(n=t.hotelsVo)||void 0===n?void 0:n.some((function(t){return e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid}))})))||void 0===a?void 0:a.name;return n.name===i?Object(o.a)(Object(o.a)({},n),{},{name:null===(c=t.hotelsVo)||void 0===c||null===(r=c[0])||void 0===r?void 0:r.name}):n})),a=Object(qe.a)(e.destinations),c=a.findIndex((function(e){return e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid}));return-1!==c?a[c]=t:a.push(Object(o.a)(Object(o.a)({},t),{},{uuid:Date.now()})),Object(o.a)(Object(o.a)({},e),{},{destinations:a,prices:n})})),a(new ta)},children:c})})},Ma=function(e){var t=e.destinationModel,n=e.setDestinationModel,a=e.excursionData,c=e.isUmrah,r=e.setCity,i=e.city,s=e.paysData,l=function(e,t){n((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},e,t))}))};return Object(me.jsxs)("div",{style:Pa.destintaion,children:[!c&&Object(me.jsxs)(be.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(me.jsx)("label",{children:"Pays:"}),Object(me.jsx)(Ze.a,{data:null===s||void 0===s?void 0:s.map((function(e){return{label:e.nom,value:e.nom}})),block:!0,value:i,onSelect:function(e){return r(e)}})]}),c?Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(me.jsxs)("label",{children:[V.destination,":"]}),Object(me.jsx)(Ze.a,{value:t.name,data:Fe.r,block:!0,noSearch:!0,onSelect:function(e){l("name",e)}})]}),Object(me.jsxs)("label",{style:Pa.label,children:[V.firstDestination,Object(me.jsx)("input",{type:"checkbox",checked:t.isFirst,onChange:function(e){return l("isFirst",e.target.checked)}})]})]}):Object(me.jsxs)(be.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(me.jsxs)("label",{children:[V.destination,":"]}),Object(me.jsx)(fe.a,{value:t.name,onChange:function(e){return l("name",e)}})]}),Object(me.jsxs)(be.a,{className:"p-10",m:6,l:3,xl:2,children:[Object(me.jsx)("label",{children:"Excursion:"}),Object(me.jsx)(sa.a,{value:t.excursionDestIds||[],data:a.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,onChange:function(e){n((function(t){return Object(o.a)(Object(o.a)({},t),{},{excursionDestIds:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:1.4,xl:1,className:"p-10",children:[Object(me.jsx)("label",{children:"Dur\xe9e Total:"}),Object(me.jsx)(fe.a,{type:"text",value:t.nbrDay,disabled:!0})]})]})},Ta=function(e){var t=e.destinationModel,n=e.setModel,a=e.setDestinationModel,c=t.id||t.uuid?"modifier":"ajouter";return Object(me.jsx)("div",{className:"button-container",children:Object(me.jsx)("button",{className:"button-primary",onClick:function(){n((function(e){var n=(t.hotelsUmrah||[]).map((function(e){var n;return Object(o.a)(Object(o.a)({},e),{},{isMakkah:"makkah"===(null===(n=t.name)||void 0===n?void 0:n.toLowerCase())})})),a=Object(o.a)(Object(o.a)({},t),{},{hotelsUmrah:n}),c=e.prices.map((function(t){var n,c,r,i=null===(n=e.destinations.flatMap((function(e){return e.hotelsUmrah||[]})).find((function(e){var t;return null===(t=a.hotelsUmrah)||void 0===t?void 0:t.some((function(t){return e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid}))})))||void 0===n?void 0:n.name;return t.hotelMakkahName===i?Object(o.a)(Object(o.a)({},t),{},{hotelMakkahName:null===(c=a.hotelsUmrah)||void 0===c||null===(r=c[0])||void 0===r?void 0:r.name}):t})),r=Object(qe.a)(e.destinations),i=r.findIndex((function(e){return e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid}));return-1!==i?r[i]=a:r.push(Object(o.a)(Object(o.a)({},a),{},{uuid:Date.now()})),Object(o.a)(Object(o.a)({},e),{},{destinations:r,prices:c})})),a(new Q)},children:c})})},wa=function(e){var t=e.providers,n=e.currencies,a=e.exchanges,r=e.fetchProviders,i=e.setModel,l=e.model,u=e.title,d=e.fetchPays,j=e.fetchHotels,b=e.hotelData,O=e.excursionData,f=e.isUmrah,h=e.paysData,p=e.city,m=e.setCity,x=Object(c.useState)(f?new Q:new ta),g=Object(s.a)(x,2),_=g[0],v=g[1];return Object(me.jsxs)("div",{children:[Object(me.jsx)("h3",{children:u}),Object(me.jsxs)("div",{style:{background:"rgb(70,90,238,0.2)"},className:"p-10",children:[Object(me.jsx)(Ma,{destinationModel:_,setDestinationModel:v,fetchPays:d,excursionData:O,isUmrah:f,paysData:h,city:p,setCity:m}),Object(me.jsx)(ka,{hotels:f?_.hotelsUmrah:_.hotelsVo,updateHotel:function(e,t){v((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},f?"hotelsUmrah":"hotelsVo",(f?n.hotelsUmrah:n.hotelsVo).map((function(n,a){return a===e?Object(o.a)(Object(o.a)({},n),t):n}))))}))},addHotel:function(e){v((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},f?"hotelsUmrah":"hotelsVo",[].concat(Object(qe.a)(f?t.hotelsUmrah:t.hotelsVo),[f?new te(e):new na(e)])))}))},removeHotel:function(e){v((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},f?"hotelsUmrah":"hotelsVo",(f?t.hotelsUmrah:t.hotelsVo).filter((function(t,n){return n!==e}))))}))},hotelData:b,setDestinationModel:v,fetchHotels:j,providers:t,currencies:n,exchanges:a,fetchProviders:r,destinationModel:_,isUmrah:f}),Object(me.jsx)("hr",{}),f?Object(me.jsx)(Ta,{destinationModel:_,setModel:i,setDestinationModel:v}):Object(me.jsx)(Aa,{destinationModel:_,setModel:i,setDestinationModel:v}),Object(me.jsx)(Ea,{destinations:l.destinations,setDestinationModel:v,updateModel:i})]})]})},Ba={container:{padding:"5px 5px",marginBottom:"16px",background:"rgb(70,90,238,0.2)",display:"flex",flexDirection:"column",justifyContent:"center",width:"98%"},formSection:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"16px",padding:"10px",flexGrow:1},dayLabel:{fontWeight:"bold"},programList:{display:"flex",alignItems:"center",justifyContent:"center"},containerButton:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"8px",width:"5%"}},Ra=function e(){Object(U.a)(this,e),this.id=0,this.isUmrah=!0,this.images=[],this.programsLists=[new Ua],this.fileDay=[],this.name="",this.idsDelete=[]},Ua=function e(t){Object(U.a)(this,e),this.name="",this.description="",this.imageIds=[],this.day=t||1},La=Object(D.b)({key:"ProgramAtom",default:new Ra}),Fa=function(e){var t=e.program,n=e.setModel,a=e.model,r=e.index,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=function(e,t){n((function(n){var a=Object(qe.a)(n.programsLists);return a[r]=Object(o.a)(Object(o.a)({},a[r]),{},Object(G.a)({},e,t)),Object(o.a)(Object(o.a)({},n),{},{programsLists:a})}))};return Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("div",{style:Ba.container,children:[Object(me.jsxs)("div",{style:Ba.dayLabel,children:["Jour ",t.day]}),Object(me.jsxs)("div",{style:Ba.formSection,children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{block:!0,value:t.name||"",onChange:function(e){return j("name",e)}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:5,xl:9,children:[Object(me.jsx)("label",{children:"Description: "}),Object(me.jsx)(fe.a,{as:"textarea",rows:3,block:!0,value:t.description||"",onChange:function(e){return j("description",e)}})]})]}),Object(me.jsx)(Ia,{model:a,setModel:n,isProgram:!0,index:r,state:u,setState:d})]})})},Ka=function(e){var t=e.isLoading,n=(e.error,Object(D.c)(La)),a=Object(s.a)(n,2),c=a[0],r=a[1],i=function(){r((function(e){var t=Math.max.apply(Math,Object(qe.a)(e.programsLists.map((function(e){return e.day}))).concat([0]));return Object(o.a)(Object(o.a)({},e),{},{programsLists:[].concat(Object(qe.a)(e.programsLists),[Object(o.a)(Object(o.a)({},new Ua),{},{day:t+1})])})}))};return Object(me.jsx)(me.Fragment,{children:t?Object(me.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:Object(me.jsx)(Un.a,{size:"lg"})}):Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{block:!0,value:c.name||"",onChange:function(e){return t=e,void r((function(e){return Object(o.a)(Object(o.a)({},e),{},{name:t})}));var t}})]}),Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(me.jsx)("label",{children:"Programme type"}),Object(me.jsx)(Ze.a,{data:Fe.l,block:!0,noSearch:!0,value:c.isUmrah?0:1,onChange:function(e){return t=e,void r((function(e){return Object(o.a)(Object(o.a)({},e),{},{isUmrah:1!==t})}));var t}})]}),c.programsLists.map((function(e,t){return Object(me.jsxs)("div",{style:Ba.programList,children:[Object(me.jsx)(Fa,{index:t,program:e,model:c,setModel:r}),0===c.id&&Object(me.jsxs)(be.a,{s:2,m:2,l:2,xl:2,style:Ba.containerButton,children:[0!==t&&Object(me.jsx)(Je.a,{onClick:function(){return function(e){r((function(t){return Object(o.a)(Object(o.a)({},t),{},{programsLists:t.programsLists.filter((function(t,n){return n!==e}))})}))}(t)},color:"violet",icon:Object(me.jsx)(wt.a,{}),style:Ba.iconButton}),t+1===c.programsLists.length&&Object(me.jsx)(Je.a,{onClick:i,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},t)}))]})})},za={modalContainer:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"15px 0",zIndex:1,maxWidth:"100vw"},modal:{maxHeight:"calc(100vh - 50px)",overflow:"auto",maxWidth:"100vw"},modalBody:{maxHeight:"calc(100vh - 240px)",overflow:"auto",maxWidth:"100vw"}};function Wa(e){var t=e.open,n=e.handleClose,a=e.save,c=e.error,r=e.isLoading;return Object(me.jsx)("div",{style:za.modalContainer,children:Object(me.jsxs)(dt.a,{size:"xl",overflow:!1,style:za.modal,open:t,onClose:n,children:[Object(me.jsx)(dt.a.Header,{children:Object(me.jsx)(dt.a.Title,{children:"Ajouter un programme"})}),Object(me.jsx)(dt.a.Body,{children:Object(me.jsx)("div",{style:za.modalBody,children:Object(me.jsx)(Ka,{isLoading:!1,error:c})})}),Object(me.jsxs)(dt.a.Footer,{children:[Object(me.jsx)(he.a,{onClick:a,appearance:"primary",children:r?Object(me.jsx)(Un.a,{size:"sm"}):"Enregistrer"}),Object(me.jsx)(he.a,{onClick:n,appearance:"subtle",children:"Annuler"})]})]})})}var Ya=function e(t,n,a){"object"===typeof a&&null!==a?Array.isArray(a)?0===a.length?t.append("".concat(n),"[]"):a.forEach((function(a,c){e(t,"".concat(n,"[").concat(c,"]"),a)})):Object.keys(a).forEach((function(c){e(t,"".concat(n,"[").concat(c,"]"),a[c])})):t.append(n,a)},Ga=function(e,t){Object.keys(t).forEach((function(n){Array.isArray(t[n])?0===t[n].length?e.append("".concat(n),"[]"):t[n].forEach((function(t,a){"object"===typeof t&&null!==t?Object.keys(t).forEach((function(c){Ya(e,"".concat(n,"[").concat(a,"][").concat(c,"]"),t[c])})):e.append("".concat(n,"[").concat(a,"]"),t)})):"object"===typeof t[n]&&null!==t[n]?Object.keys(t[n]).forEach((function(a){Ya(e,"".concat(n,"[").concat(a,"]"),t[n][a])})):e.append(n,t[n])})),t.images&&Array.isArray(t.images)&&t.images.forEach((function(t){t instanceof File&&e.append("images",t)})),t.videos&&Array.isArray(t.videos)&&t.videos.forEach((function(t){t instanceof File&&e.append("videos",t)}))},Va=n(1249),Ha=n(1254),qa={programContainer:{backgroundColor:"rgba(70, 103, 209, 0.2)",padding:"10px",margin:"10px 0"},dayLabel:{fontWeight:"bold"},programContent:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},responsiveBlock:{padding:"10px"}},Za=function(e){var t=e.p,n=e.index,a=e.model,r=e.setModel,i=Object(c.useState)([]),o=Object(s.a)(i,2),l=o[0],u=o[1];return Object(me.jsxs)("div",{style:qa.programContainer,children:[Object(me.jsxs)("div",{style:qa.dayLabel,children:[V.day," ",t.day]}),Object(me.jsxs)("div",{style:qa.programContent,children:[Object(me.jsxs)(be.a,{l:5,xl:4,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.name," : "]}),Object(me.jsx)(fe.a,{block:!0,value:t.name,disabled:!0})]}),Object(me.jsxs)(be.a,{l:5,xl:5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.description," : "]}),Object(me.jsx)(fe.a,{as:"textarea",rows:3,block:!0,value:t.description,disabled:!0})]})]}),Object(me.jsx)(Ia,{model:a,setModel:r,isProgram:!0,index:n,showFileInput:!1,program:t,state:l,setState:u})]},n)},Ja=function(e){var t=e.model,n=e.setModel,a=e.programs,r=e.fetchPrograms,i=Object(c.useState)(),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)(!1),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(D.c)(La),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(!1),I=Object(s.a)(C,2),E=I[0],S=I[1];Object(c.useEffect)((function(){var e=null===a||void 0===a?void 0:a.find((function(e){return e.id===t.programId}));e&&d(e)}),[t.programId,a]);var N=function(){f(!1)};return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(me.jsx)("label",{children:"Programs: "})," ",Object(me.jsx)(Je.a,{onClick:function(){f(!0)},color:"violet",icon:Object(me.jsx)(et.a,{})}),Object(me.jsx)(Ze.a,{data:null===a||void 0===a?void 0:a.map((function(e){return{label:e.name,value:e.id}})),block:!0,value:t.programId,onSelect:function(e){var t=null===a||void 0===a?void 0:a.find((function(t){return t.id===e}));t&&(d(t),n((function(e){return Object(o.a)(Object(o.a)({},e),{},{programId:t.id})})))}})]}),u&&u.programsLists.map((function(e,a){return Object(me.jsx)(Za,{p:e,index:a,model:t,setModel:n},a)}))]}),Object(me.jsx)(Wa,{open:O,handleClose:N,save:function(){S(!0);var e=v,t=new FormData;Ga(t,e);var n=B.a.createAPIEndpoint(B.a.ENDPOINTS.Programs);(e.id?n.update(e.id,t):n.create(t)).then((function(){Le.a.fire({position:"top-end",icon:"success",title:e.id?"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !":"\xc9l\xe9ment a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),r(),N(),y(new Ra),x("")})).catch((function(e){var t,n,a,c;x(e.Message),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})})).finally((function(){S(!1)}))},error:m,isLoading:E})]})},Xa={mainConatiner:{padding:"40px 10px"},steps:{verticalAlign:"top"},loader:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},button:{textAlign:"right"},message:{marginTop:"20px"}};var Qa=function(e){var t=e.error,n=e.providers,a=e.save,r=e.fetchProviders,i=e.isDefault,o=void 0!==i&&i,l=e.loading,u=e.isLoading,d=Object(D.d)(Y),j=Object(D.d)(ue),b=Object(D.c)(ha),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)([]),m=Object(s.a)(p,2),x=m[0],g=m[1],_=Object(D.c)(Rn),v=Object(s.a)(_,2),y=v[0],C=v[1],I=Object(c.useState)([]),E=Object(s.a)(I,2),S=E[0],N=E[1],P=Object(c.useState)(0),k=Object(s.a)(P,2),A=k[0],M=k[1],T=Object(c.useState)([]),w=Object(s.a)(T,2),R=w[0],U=w[1],L=Object(c.useState)([]),F=Object(s.a)(L,2),K=F[0],z=F[1],W=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.HotelList+"/HotelsByCity",{city:"Saudi Arabia"}).customGet().then((function(e){h(e.data.hotels)}))}),[]);Object(c.useEffect)((function(){W()}),[W]),Object(c.useEffect)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Excursion+"/getAll",{find:"Umrah"}).customGet().then((function(e){g(e.data.excursions)}))}),[]);var G=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Pays,{}).customGet().then((function(e){return U(e.data)}))}),[]);Object(c.useEffect)((function(){G()}),[G]);var V=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Programs+"/getAll",{isUmrah:!0}).customGet().then((function(e){z(e.data.programs)}))}),[]);Object(c.useEffect)((function(){V()}),[V]);var H=[Object(me.jsx)(ja,{model:y,setModel:C,fetchProviders:r,exchanges:j,currencies:d,providers:n,isUmrah:!0}),Object(me.jsx)(ia,{model:y,setModel:C,isUmrah:!0}),Object(me.jsx)(wa,{title:"Destination et H\xf4tels",providers:n,currencies:d,exchanges:j,fetchProviders:r,setModel:C,model:y,fetchPays:G,fetchHotels:W,hotelData:f||[],paysData:R||[],excursionData:x||[],isUmrah:!0}),Object(me.jsx)(Ja,{setModel:C,programs:K||[],model:y,fetchPrograms:V}),Object(me.jsx)(fa,{model:y,setModel:C,isUmrah:!0}),Object(me.jsx)(Ia,{model:y,setModel:C,state:S,setState:N})];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{style:Xa.mainConatiner,children:[Object(me.jsx)(Nt.a,{current:A,style:Xa.steps,children:Fe.w.map((function(e,t){return Object(me.jsx)(Nt.a.Item,{title:e,onClick:function(){return M(t)}},t)}))}),u?Object(me.jsx)("div",{style:Xa.loader,children:Object(me.jsx)(Un.a,{size:"lg"})}):H[A]]}),o&&Object(me.jsx)("div",{style:Xa.button,children:Object(me.jsx)("button",{onClick:a,children:l?Object(me.jsx)(Un.a,{size:"sm"}):"Enregistrer"})}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{})]})};function $a(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=(Object(D.d)(L),Object(D.c)(le)),b=Object(s.a)(j,2),O=b[0],f=(b[1],Object(c.useState)(0)),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(c.useState)(!1),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)({page:1,take:20,q:"",date:null}),C=Object(s.a)(y,2),I=C[0],E=C[1],S=Object(c.useState)(""),N=Object(s.a)(S,2),P=N[0],k=N[1],A=Object(D.c)(Rn),M=Object(s.a)(A,2),T=M[0],w=M[1],R=Object(D.c)(ye.a),U=Object(s.a)(R,2),F=U[0],K=U[1],z=function(){w(O),k("")},W=function(e){("undefined"==typeof e||e.length>0)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return d(e.data)}))},Y=function(){K((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah,Object(o.a)(Object(o.a)({},I),{},{date:I.date?_e()(I.date).format("DD MMM YYYY"):null})).customGet().then((function(e){r(e.data.data),K((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),m(e.data.totalCount)})).catch((function(e){k(e.Message),K((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){z(),W(),w(O)}),[]),Object(c.useEffect)((function(){Y()}),[I.page,I.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return Y()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"D\xe9signation: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){E((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date : "}),Object(me.jsx)(fe.a,{type:"date",value:I.date,onChange:function(e){E((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{ActionOnClose:z,noExport:!0,size:"xl",save:function(){var e;K((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var t=Object(o.a)({},T),n=new FormData;(null===t||void 0===t||null===(e=t.categoryIds)||void 0===e?void 0:e.length)||delete t.categoryIds,Ga(n,t);var a=B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah);(t.id?a.update(t.id,n):a.create(n)).then((function(){Le.a.fire({position:"top-end",icon:"success",title:t.id?"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !":"\xc9l\xe9ment a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),z(),K((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),Y()})).catch((function(e){var t,n,a,c;K((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})}))},title:"Ajouter package umrah",AddComponent:Object(me.jsx)(Qa,{providers:u,fetchProviders:W,error:P,loading:F.loading,isLoading:_})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){k(""),v(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah).fetchById(e).then((function(e){var t=Object(o.a)({},e.data);w(t)})).catch((function(e){console.log(e)})).finally((function(){v(!1)}))}(e),K((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah).delete(e).then((function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:"",notFromCache:!0}).customGet().then((function(e){return Y()})),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){var t,n,a,c;k(e.Message),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})}))},displayAction:function(e,t){B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/UpdateIsDisplayed",{etat:!t}).update3(e,!t).then((function(e){Y(),Le.a.fire("Updated !","","success")})).catch((function(e){var t,n,a,c;k(e.Message),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})}))},actionKey:"id",display:"isDisplayed",noAdvancedActions:!0,columns:ec,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:p,limitOptions:[10,20,50,100],limit:I.take,activePage:I.page,onChangePage:function(e){window.scrollTo(0,0),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),E((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var ec=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e?e.toUpperCase():""})}},{value:"commission",name:"Commission",render:function(e){return Object(me.jsx)("a",{children:Object(st.a)(e)})}},{value:"b2Bcommission",name:"Commission B2B",render:function(e){return Object(me.jsx)("a",{children:Object(st.a)(e)})}}];function tc(){var e=Object(c.useState)([]),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(D.c)(Rn),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(D.c)(le),j=Object(s.a)(d,2),b=(j[0],j[1],function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getDefault",{}).customGet().then((function(e){var t=Object(o.a)({},e.data);console.log(e.data),u((function(e){return t}))})).catch((function(e){console.log(e)}))});Object(c.useEffect)((function(){}),[]);return Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("div",{style:{background:"#fff",padding:"10px",borderRadius:"5px"},children:[Object(me.jsx)("h5",{children:"Template"}),Object(me.jsx)(Qa,{providers:n,fetchProviders:function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return a(e.data)}))},isDefault:!0,save:function(){var e=Object(o.a)(Object(o.a)({},l),{},{isDefault:!0});e.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah).update(e.id,e).then((function(e){b(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){})):B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah).create(e).then((function(e){b(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){}))}})]})})}var nc=n(97),ac=n(82);function cc(){var e=Object(c.useState)([]),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)({page:1,take:20,q:"",date:null}),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(c.useState)([]),h=Object(s.a)(f,2),p=h[0],m=h[1],x=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){O(e.data);var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities.map((function(e){return Object(o.a)({packageUmrahId:t.id},e)})))}),[]);console.log(t),m(t.filter((function(e){return e.onStock})))}))},g=function(){B.a.createAPIEndpoint(pe.a.PackageUmrah+"/getForPrices",l).fetchAll().then((function(e){return a(e.data)}))};return Object(c.useEffect)((function(){g(),x()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:g,children:[" ",Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){u((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{onSearch:x,data:b?[{label:"Tout",value:0}].concat(b.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:l.packageUmrahId,onSelect:function(e){u((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(p?p.map((function(e){return{label:Object(me.jsxs)("div",{style:{color:"#232323"},children:[_e()(e.date).format("DD MMM YYYY")," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:b&&b.find((function(t){return t.id==e.packageUmrahId}))&&b.find((function(t){return t.id==e.packageUmrahId})).name}),")"]}),value:e.id}})):[]),block:!0,noSearch:!0,value:l.disponibilityId,onSelect:function(e){u((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})]})]}),Object(me.jsx)("div",{className:"p-10",children:n&&n.map((function(e){return Object(me.jsxs)("div",{children:[Object(me.jsx)("h4",{children:e.name}),Object(me.jsx)(be.a,{m:5.5,l:5.5,xl:5.5,className:"p-10",children:Object(me.jsx)(rc,{pack:e})})," ",Object(me.jsx)(be.a,{style:{background:"#fff",padding:"5px",borderRadius:"5px",boxShadow:"-11px 4px 26px -10px rgba(31,50,150,0.67)"},m:6,l:6,xl:6,className:"p-5",children:e.disponibilities.map((function(e){return Object(me.jsxs)("div",{style:{background:e.onStock?"#fff":"rgb(244,81,108,0.2)",padding:"3px",borderRadius:"5px",boxShadow:"-14px 4px 26px -15px rgba(31,50,150,0.67)",display:"flex",alignItems:"center",margin:"3px",border:"1px solid #eee"},children:[Object(me.jsx)("img",{alt:"",src:e.airline&&e.airline.logo,style:{width:"50px"}})," ",Object(me.jsxs)("div",{style:{padding:"4px"},children:[Object(me.jsx)("h6",{children:e.date.substring(0,10)}),Object(me.jsx)("span",{style:{fontWeight:"lighter",fontSize:"small"},children:"NOMBRE DES PLACES DISPO. :"})," ",Object(me.jsx)("b",{children:e.onStock})]})]})}))}),Object(me.jsx)("hr",{})," "]})}))}),Object(me.jsx)("style",{jsx:!0,children:"\n table {\n border-radius: 5px;\n }\n thead {\n {\n /* background: rgb(70, 103, 209); */\n }\n color: #fff;\n border-radius: 5px;\n }\n th,\n td {\n padding: 5px 8px;\n }\n th {\n text-align: left;\n }\n "})]})}var rc=function(e){var t=e.pack,n=Object(c.useState)(null),a=Object(s.a)(n,2),r=a[0],i=a[1];return Object(c.useEffect)((function(){t.prices&&function(e){e=e.filter((function(e){return!e.isHidden})).map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{h:e.hotelMakkahName+" - "+e.hotelMadinahName,index:t})}));var t=new Set(e.map((function(e){return e.h}))),n={};t.forEach((function(t){n[t]=e.filter((function(e){return e.h==t}))})),i(n)}(t.prices)}),[t]),Object(me.jsx)(me.Fragment,{children:r&&Object.keys(r).map((function(e,n){return Object(me.jsxs)("div",{style:{marginBottom:"30px",background:"#fff",borderRadius:"5px",boxShadow:"-11px 4px 26px -10px rgba(31,50,150,0.67)"},children:[Object(me.jsxs)("div",{style:{padding:"5px"},children:[" ",Object(me.jsxs)("table",{children:[Object(me.jsx)("thead",{style:{background:n%2?"rgba(236,182,28)":"rgb(31,50,150)",color:n%2?"":"#fff"},children:Object(me.jsxs)("tr",{children:[Object(me.jsx)("th",{children:"Designation"}),Object(me.jsx)("th",{children:"QUAD "}),Object(me.jsx)("th",{children:"TRIPLE "}),Object(me.jsx)("th",{children:"DOUBLE "})]})}),Object(me.jsx)("tbody",{children:Object(me.jsxs)("tr",{children:[Object(me.jsxs)("td",{children:[Object(me.jsx)("span",{style:{color:"#eee"},children:Object(me.jsx)(ac.c,{})})," ",Object(me.jsxs)("b",{children:[" ",e]})]}),Object(me.jsx)("td",{children:Object(me.jsx)("b",{style:{color:"#53af50",fontSize:"17px"},children:r[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("QUAD")}))?Object(st.a)(r[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("QUAD")})).price):"-"})}),Object(me.jsx)("td",{children:Object(me.jsx)("b",{style:{color:"#53af50",fontSize:"17px"},children:r[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE")}))?Object(st.a)(r[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE")})).price):"-"})}),Object(me.jsx)("td",{children:Object(me.jsx)("b",{style:{color:"#53af50",fontSize:"17px"},children:r[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE")}))?Object(st.a)(r[e].find((function(e){return e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE")})).price):"-"})})]})})]})]}),Object(me.jsx)("div",{style:{marginTop:"5px",background:"#fff",padding:"5px",borderRadius:"5px"},children:t.hotels&&t.hotels.filter((function(t){return t.name==r[e][0].hotelMadinahName||t.name==r[e][0].hotelMakkahName})).map((function(e){if(e.packageUmrahMealTypes)return e.packageUmrahMealTypes.map((function(t){return Object(me.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"space-between",padding:"5px",border:"1px solid #ddd",borderRadius:"5px",margin:"2px"},children:[Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",marginRight:"10px"},children:[Object(me.jsxs)("span",{style:{fontSize:"25px",color:"rgb(70, 103, 209)",borderRadius:"50%",border:"1px solid #eee",width:"40px",height:"40px",textAlign:"center",display:"inline-block",marginRight:"8px",background:"rgb(70, 103, 209,0.2)"},children:[Object(me.jsx)(nc.d,{})," "]}),Object(me.jsxs)("span",{children:[t.designation,Object(me.jsx)("br",{}),Object(me.jsxs)("span",{style:{textTransform:"uppercase",color:"#888",fontWeight:"lighter"},children:[e.name," ",Object(me.jsx)("span",{style:{fontSize:"0.7em"},children:e.isMakkah?"Makkah":"Madinah"})]})]})]})," ",Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"15px",margin:"3px"},children:[t.totalPrice?Object(st.a)(t.totalPrice):Object(st.a)(e.duration*e.exchange*t.cost),Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})]})}))}))})]})}))})},ic=function(e){var t=e.pack,n=e.model,a=e._setmodel,r=e.multiple,i=void 0!==r&&r,l=e.prices,u=e.visa,d=void 0===u?0:u,j=(e.ident,Object(c.useState)(null)),b=Object(s.a)(j,2),O=(b[0],b[1],Object(c.useState)(null)),f=Object(s.a)(O,2),h=f[0],p=f[1],m=Object(c.useState)([]),x=Object(s.a)(m,2),g=x[0],_=x[1];return Object(c.useEffect)((function(){l&&function(e){e=e.filter((function(e){return!e.isHidden})).map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{h:e.hotelMakkahName+" - "+e.hotelMadinahName,index:t})}));var t=new Set(e.map((function(e){return e.h}))),n={};t.forEach((function(t){n[t]=e.filter((function(e){return e.h==t}))})),p(n)}(l)}),[l]),Object(c.useEffect)((function(){var e=[];t.hotels&&(n.packageUmrahMealTypeMadinahId||n.packageUmrahMealTypeMakkahId)&&t.hotels.map((function(t){var a=t.packageUmrahMealTypes.find((function(e){return e.id==n.packageUmrahMealTypeMadinahId||e.id==n.packageUmrahMealTypeMakkahId}));a&&e.push(Object(o.a)(Object(o.a)({},a),{},{k:l.find((function(e){return e.id==n.priceId})).hotelMakkahName+" - "+l.find((function(e){return e.id==n.priceId})).hotelMadinahName}))})),_(e),console.log(t)}),[n.id]),Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)("label",{children:[" ",Object(me.jsx)(en.a,{onChange:function(e){a((function(e){return Object(o.a)(Object(o.a)({},e),{},{onlyTicket:!0,priceId:null,packageUmrahMealTypeMakkahId:null,packageUmrahMealTypeMadinahId:null,totalPrice:0,withoutTicket:!1,withoutVisa:!1})}))},checked:n.onlyTicket})," ","Billet Seulement"," "]}),Object(me.jsx)("hr",{}),h&&Object.keys(h).map((function(e,c){return Object(me.jsxs)("div",{style:{marginBottom:"30px",background:"#fff",borderRadius:"5px",boxShadow:"-11px 4px 26px -10px rgba(31,50,150,0.67)"},children:[Object(me.jsxs)("div",{style:{padding:"5px"},children:[" ",Object(me.jsx)("table",{style:{borderRadius:"5px !important"},children:h[e].filter((function(e){return!e.isHidden})).map((function(t,c){return Object(me.jsxs)("tr",{style:{padding:"5px",borderRadius:"5px !important",background:c%2?"rgb(70,103,209,0.2)":""},children:[Object(me.jsxs)("td",{style:{padding:"5px"},children:[Object(me.jsx)(en.a,{onChange:function(n){i?a((function(e){var n=Object(qe.a)(e.prices);return e.prices.find((function(e){return e.id==t.id}))?n=n.filter((function(e){return e.id!=t.id})):n.push(t),Object(o.a)(Object(o.a)({},e),{},{prices:n})})):(_([]),a((function(n){return Object(o.a)(Object(o.a)({},n),{},{priceId:t.id,totalPrice:t.price,packageUmrahMealTypeMakkahId:null,packageUmrahMealTypeMadinahId:null,onlyTicket:!1,withoutTicket:!!h[e].find((function(e){return e.id==n.priceId}))&&n.withoutTicket,withoutVisa:!!h[e].find((function(e){return e.id==n.priceId}))&&n.withoutVisa})})))},checked:n.priceId==t.id})," ",Object(me.jsx)(Re.a,{color:["red","green","yellow"][Fe.t.findIndex((function(e){return e.label==t.arrangementMakkahDesignation}))],children:t.arrangementMakkahDesignation})]}),Object(me.jsxs)("td",{children:[" ",Object(me.jsx)("img",{alt:"",src:"/makkah.png",style:{width:"40px"}}),t.hotelMakkahName]}),Object(me.jsxs)("td",{children:[" ",Object(me.jsx)("img",{alt:"",src:"/madinah4.png",style:{width:"40px"}}),t.hotelMadinahName]}),Object(me.jsx)("td",{children:Object(me.jsxs)("b",{style:{color:"#232323",fontSize:"17px"},children:[t.price,Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})})]})}))})]}),!i&&Object(me.jsxs)("div",{style:{marginTop:"5px",background:"#fff",padding:"5px",borderRadius:"5px"},children:[t.hotels&&t.hotels.filter((function(t){return t.name==h[e][0].hotelMadinahName||t.name==h[e][0].hotelMakkahName})).map((function(c){if(c.packageUmrahMealTypes)return c.packageUmrahMealTypes.map((function(r){return Object(me.jsxs)("div",{onClick:function(){var i=[];n.packageUmrahMealTypeMadinahId&&t.hotels.filter((function(t){return t.name==h[e][0].hotelMadinahName})).map((function(t){return i.push(Object(o.a)(Object(o.a)({},t.packageUmrahMealTypes.find((function(e){return e.id===n.packageUmrahMealTypeMadinahId}))),{},{k:e}))})),n.packageUmrahMealTypeMakkahId&&t.hotels.filter((function(t){return t.name==h[e][0].hotelMakkahName})).map((function(t){return i.push(Object(o.a)(Object(o.a)({},t.packageUmrahMealTypes.find((function(e){return e.id===n.packageUmrahMealTypeMakkahId}))),{},{k:e}))})),console.log(i),i.find((function(e){return e.id==r.id}))?i=i.filter((function(e){return e.id!==r.id})):i.push(Object(o.a)(Object(o.a)({},r),{},{k:e})),h[e].find((function(e){return e.id==n.priceId}))||(i=[]),console.log("meals"),console.log(i),_(i),a((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahMealTypeMakkahId:c.isMakkah?i.find((function(t){return t.id==r.id&&t.k==e}))?r.id:null:t.packageUmrahMealTypeMakkahId,packageUmrahMealTypeMadinahId:c.isMakkah?t.packageUmrahMealTypeMadinahId:i.find((function(t){return t.id==r.id&&t.k==e}))?r.id:null,totalPrice:(h[e].find((function(e){return e.id==t.priceId}))?h[e].find((function(e){return e.id==t.priceId})).price:0)+i.reduce((function(e,t){return e+t.totalPrice}),0)})}))},style:{display:"inline-flex",alignItems:"center",justifyContent:"space-between",padding:"5px",border:g.find((function(t){return t.id===r.id&&e===t.k}))||h[e].find((function(e){return e.id==n.priceId}))&&(n.packageUmrahMealTypeMakkahId==r.id||n.packageUmrahMealTypeMadinahId==r.id)?"2px solid rgb(70, 103, 209)":"1px solid #ddd",borderRadius:"5px",margin:"2px",cursor:n&&"pointer"},children:[Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",marginRight:"10px"},children:[Object(me.jsxs)("span",{style:{fontSize:"25px",color:"rgb(70, 103, 209)",borderRadius:"50%",border:"1px solid #eee",width:"40px",height:"40px",textAlign:"center",display:"inline-block",marginRight:"8px",background:"rgb(70, 103, 209,0.2)"},children:[Object(me.jsx)(nc.d,{})," "]}),Object(me.jsxs)("span",{children:[r.designation,Object(me.jsx)("br",{}),Object(me.jsxs)("span",{style:{textTransform:"uppercase",color:"#888",fontWeight:"lighter"},children:[c.name," ",Object(me.jsx)("span",{style:{fontSize:"0.7em"},children:c.isMakkah?"Makkah":"Madinah"})]})]})]})," ",Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px",margin:"3px"},children:[r.totalPrice?Object(st.a)(r.totalPrice):Object(st.a)(c.duration*c.exchange*r.cost),Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})]})}))})),Object(me.jsx)("hr",{}),Object(me.jsxs)("label",{children:[" ",Object(me.jsx)(en.a,{onChange:function(e){a((function(e){return Object(o.a)(Object(o.a)({},e),{},{withoutVisa:!e.withoutVisa,totalPrice:e.totalPrice-(e.withoutVisa?0:d)})}))},checked:n.withoutVisa&&h[e].find((function(e){return e.id==n.priceId}))})," ","Sans Visa"," ",n.withoutVisa&&h[e].find((function(e){return e.id==n.priceId}))&&Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px",margin:"3px"},children:[Object(st.a)(n.totalPrice),Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})]})," ",Object(me.jsxs)("label",{children:[Object(me.jsx)(en.a,{onChange:function(e){a((function(e){return Object(o.a)(Object(o.a)({},e),{},{withoutTicket:!e.withoutTicket})}))},checked:n.withoutTicket&&h[e].find((function(e){return e.id==n.priceId}))}),"Sans Billet"]})]})]})}))]})},oc=function(e){return[{columns:[{title:"Identifiant",width:{wpx:120}},{title:"Client",width:{wpx:150}},{title:"Tags",width:{wpx:150}},{title:"Prix Total",width:{wpx:100}},{title:"date",width:{wpx:100}},{title:"Services",width:{wpx:150}},{title:"Notes",width:{wpx:100}}],data:e.map((function(e){return[{value:e.id,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.client?e.client.name:"",style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.tags?e.tags.map((function(e){return e.name})).join(" , "):"",style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:Object(st.a)(e.totatlPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:_e()(e.date).format("DD MMM YYYY"),style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.services?Fe.u.filter((function(t){return e.services.findIndex((function(e){return e==t.value}))>-1})).map((function(e){return e.label})).join(","):"",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13"},alignment:{horizontal:"center"}}},{value:e.note?e.note:"",style:{font:{sz:"14"},alignment:{horizontal:"center"}}}]}))}]},sc=Object(D.b)({key:"PackageAtom",default:new $n}),lc={extratsMainContainer:{display:"flex",flexDirection:"column"},conatainer:{display:"flex"},iconButton:{height:"42px"}},uc=function(e){var t,n,a,r=e.providers,i=e.fetchProviders,l=e.model,u=e.setModel,d=Object(D.d)(Y),j=Object(D.d)(ue),b=Object(c.useState)((null===l||void 0===l||null===(t=l.extrats[0])||void 0===t?void 0:t.providerId)||0),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)((null===l||void 0===l||null===(n=l.extrats[0])||void 0===n?void 0:n.currencyId)||0),m=Object(s.a)(p,2),x=m[0],g=m[1],_=Object(c.useState)((null===l||void 0===l||null===(a=l.extrats[0])||void 0===a?void 0:a.exchange)||1),v=Object(s.a)(_,2),y=v[0],C=v[1],I=function(e){var t=l.extrats.map((function(t){return Object(o.a)(Object(o.a)({},t),e)}));u((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:t})}))},E=function(e,t,n){var a=l.extrats.map((function(a,c){return c===e?Object(o.a)(Object(o.a)({},a),{},Object(G.a)({},t,"cost"===t?parseFloat(n):n)):a}));u((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:a})}))},S=function(){u((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:[].concat(Object(qe.a)(e.extrats),[new ea])})}))},N=function(e){var t=l.extrats.filter((function(t,n){return n!==e})).map((function(e){return e.service}));return Fe.v.filter((function(e){return 0===e.value||!t.includes(e.value)}))},P=function(e,t,n,a){var c=a(n);c>=0&&E(e,t,c)};return Object(me.jsx)(me.Fragment,{children:Object(me.jsxs)("div",{style:lc.extratsMainContainer,children:[Object(me.jsx)("h6",{children:"Extrats"}),Object(me.jsxs)("div",{style:lc.conatainer,children:[Object(me.jsxs)(be.a,{className:"p-10",m:4,l:2.5,xl:1.8,children:[Object(me.jsxs)("label",{children:[V.supplier,":"]}),Object(me.jsx)(Ze.a,{onSearch:i,data:function(e){return e.map((function(e){return{label:e.name,value:e.id}}))}(r),block:!0,noSearch:!0,value:f,onSelect:function(e){h(e),I({providerId:e})}})]}),Object(me.jsxs)(be.a,{s:3,m:3,l:1.5,xl:1.5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.currency,":"]}),Object(me.jsx)(Ze.a,{data:function(){var e,t=r.find((function(e){return e.id===f}));return(null===t||void 0===t||null===(e=t.currencies)||void 0===e?void 0:e.map((function(e){var t=e.currency;return{label:t.name,value:t.id}})))||d.map((function(e){return{label:e.name,value:e.id}}))}(),block:!0,noSearch:!0,value:x,onSelect:function(e){var t;g(e);var n=(null===(t=j.find((function(t){return t.currencySourceId===e})))||void 0===t?void 0:t.rate)||1;C(n),I({currencyId:e,exchange:n})}})]}),Object(me.jsxs)(be.a,{s:3,m:3,l:1.5,xl:.8,className:"p-10",children:[Object(me.jsx)("label",{children:"Cour:"}),Object(me.jsx)(fe.a,{type:"number",value:y,disabled:!0})]})]}),l.extrats.map((function(e,t){return Object(me.jsxs)("div",{className:"fee-entry",style:{display:"flex"},children:[Object(me.jsxs)(be.a,{className:"p-10",m:4,l:2.5,xl:1.8,children:[Object(me.jsxs)("label",{children:[V.service,":"]}),Object(me.jsx)(Ze.a,{data:N(t),block:!0,noSearch:!0,value:e.service,onSelect:function(e){!function(e,t){var n=l.extrats.map((function(n,a){return a===e?Object(o.a)(Object(o.a)({},n),{},{service:t,note:Zn(t,"")}):n}));u((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:n})}))}(t,e)}})]}),Object(me.jsxs)(be.a,{m:4,l:3,xl:3,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.designation,":"]}),Object(me.jsx)(fe.a,{value:e.note,onChange:function(e){return E(t,"note",e)},disabled:0!==e.service})]}),Object(me.jsxs)(be.a,{s:4,m:4,l:1.5,xl:1.5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.unitCost,":"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.unitCost,onChange:function(e){return P(t,"unitCost",e,parseFloat)}})]}),Object(me.jsxs)(be.a,{s:4,m:4,l:1,xl:1,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.cost," ",V.TND,":"]}),Object(me.jsx)(fe.a,{type:"text",value:Object(st.a)(e.unitCost*y),disabled:!0})]}),Object(me.jsxs)(be.a,{s:4,m:4,l:1.5,xl:1.5,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.unitCosts," :"]}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",min:"0",value:e.unitFee,onChange:function(e){return P(t,"unitFee",e,parseFloat)}})]}),Object(me.jsxs)(be.a,{s:4,m:4,l:1,xl:1,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.costs," ",V.TND,":"]}),Object(me.jsx)(fe.a,{type:"text",value:Object(st.a)(e.unitFee*y),disabled:!0})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:lc.iconButton,children:" "}),Object(me.jsx)(Je.a,{onClick:function(){return function(e){var t=l.extrats.filter((function(t,n){return n!==e}));u((function(e){return Object(o.a)(Object(o.a)({},e),{},{extrats:t})}))}(t)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),t+1===l.extrats.length&&Object(me.jsx)(Je.a,{onClick:S,color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},t)}))]})})},dc=function(e){var t=e.setModel,n=e.providers,a=e.fetchProviders,r=e.model,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1];Object(c.useEffect)((function(){B.a.createAPIEndpoint("".concat(B.a.ENDPOINTS.Category,"/GetFiltreData"),{isUmrah:!1}).fetchAll().then((function(e){d(e.data.categories)})).catch((function(e){console.log("e",e)}))}),[]);return Object(me.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[Object(me.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom :"}),Object(me.jsx)(fe.a,{value:r.name,onChange:function(e){return t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e.toUpperCase()})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Description :"}),Object(me.jsx)(fe.a,{value:r.description,onChange:function(e){return t((function(t){return Object(o.a)(Object(o.a)({},t),{},{description:e})}))}})]}),Object(me.jsxs)(be.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(me.jsxs)("label",{children:[V.categories," :"]}),Object(me.jsx)("div",{className:"p-2 font-sans",children:Object(me.jsx)(sa.a,{value:r.categoryIds||[],data:u.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{categoryIds:e})}))},placeholder:V.chooseCategories})})]})]}),Object(me.jsx)(Gn,{setCaracteristiques:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{caracteristique:e})}))},caracteristique:r.caracteristique||{},translations:Fe.d}),Object(me.jsx)(uc,{providers:n,fetchProviders:a,model:r,setModel:t})]})},jc={thead:{background:"rgb(70, 103, 209)",color:"#fff"},th:{padding:"5px 8px",textAlign:"left"},td:{padding:"5px 8px"}},bc=function(e){var t=e.onPriceChange,n=e.onDeletePrice,a=e.onAddPrice,c=e.prices;return Object(me.jsx)("div",{children:Object(me.jsxs)("table",{children:[Object(me.jsx)("thead",{style:jc.thead,children:Object(me.jsxs)("tr",{children:[Object(me.jsx)("th",{style:jc.th,children:V.hotel}),Object(me.jsx)("th",{style:jc.th,children:"Nom de l'arrangement"}),Fe.B.map((function(e){return Object(me.jsx)("th",{style:jc.th,children:e.label},e.value)})),Object(me.jsx)("th",{style:jc.th,children:"Actions"})]})}),Object(me.jsx)("tbody",{children:Object.entries(c).map((function(e){var c=Object(s.a)(e,2),r=c[0],i=c[1];return Object.entries(i).map((function(e,c){var o=Object(s.a)(e,2),l=o[0],u=o[1];return Object(me.jsxs)("tr",{children:[Object(me.jsx)("td",{style:jc.td,children:Object(me.jsx)("h6",{children:r})}),Object(me.jsx)("td",{style:jc.td,children:Object(me.jsx)(fe.a,{disabled:!0,value:l})}),Fe.B.map((function(e){var n,a=(null===(n=u.find((function(t){return t.typeTraveler===e.value})))||void 0===n?void 0:n.price)||0;return Object(me.jsx)("td",{style:jc.td,children:Object(me.jsx)(fe.a,{value:a,onChange:function(n){return t(r,l,e.value,"price",parseFloat(n))}})},e.value)})),Object(me.jsxs)("td",{style:jc.td,children:[Object(me.jsx)(Je.a,{onClick:function(){return n(r,l)},color:"violet",icon:Object(me.jsx)(wt.a,{})}),c===Object.entries(i).length-1&&Object.entries(i).length<6&&Object(me.jsx)(Je.a,{onClick:function(){return a(r)},color:"violet",icon:Object(me.jsx)(et.a,{})})]})]},"".concat(r,"-").concat(l,"-").concat(c))}))}))})]})})},Oc=function(e){var t,n=e.model,a=e.setModel;return Object(me.jsx)("div",{className:"p-10",children:Object(me.jsx)(bc,{prices:(t=n.prices,t.reduce((function(e,t){var n=e[t.name]||{};return n[t.arrangementName]=n[t.arrangementName]||[],n[t.arrangementName].push(t),e[t.name]=n,e}),{})),onPriceChange:function(e,t,c,r,i){var s=n.prices.map((function(n){return n.name===e&&n.arrangementName===t&&n.typeTraveler===c?Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},r,i)):n}));a((function(e){return Object(o.a)(Object(o.a)({},e),{},{prices:s})}))},onDeletePrice:function(e,t){var c=n.prices.filter((function(n){return!(n.name===e&&n.arrangementName===t)}));a((function(e){return Object(o.a)(Object(o.a)({},e),{},{prices:c})}))},onAddPrice:function(e){var t=n.destinations.flatMap((function(e){return e.hotelsVo})).find((function(t){return t.name===e}));if(t){var c=t.hotelListId,r=n.prices.filter((function(t){return t.name===e})).map((function(e){return e.arrangementName})),i=Fe.t.filter((function(e){return!r.includes(e.value)})).flatMap((function(t){return Fe.B.map((function(n){return{name:e,price:0,typeTraveler:n.value,arrangementName:t.value,hotelListIds:[c],costs:[]}}))}));a((function(e){return Object(o.a)(Object(o.a)({},e),{},{prices:[].concat(Object(qe.a)(e.prices),Object(qe.a)(i))})}))}}})})},fc=function(e){var t=e.error,n=e.providers,a=e.fetchProviders,r=e.isLoading,i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(D.c)(sc),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)([]),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.d)(Y),I=Object(D.d)(ue),E=Object(c.useState)([]),S=Object(s.a)(E,2),N=S[0],P=S[1],k=Object(c.useState)(""),A=Object(s.a)(k,2),M=A[0],T=A[1],w=Object(D.c)(ha),R=Object(s.a)(w,2),U=R[0],L=R[1],F=Object(c.useState)([]),K=Object(s.a)(F,2),z=K[0],W=K[1],G=Object(c.useMemo)((function(){var e;return(null===(e=O.destinations)||void 0===e?void 0:e.reduce((function(e,t){return e+t.nbrDay}),0))||0}),[O.destinations]),V=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Programs+"/getAll",{isUmrah:!1,maxDay:G}).customGet().then((function(e){y(e.data.programs)}))}),[G]);Object(c.useEffect)((function(){V()}),[V]);var H=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Pays,{}).customGet().then((function(e){return P(e.data)}))}),[]);Object(c.useEffect)((function(){H()}),[H]);var q=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.HotelList+"/HotelsByCity",{city:M}).customGet().then((function(e){L(e.data.hotels)}))}),[M]);Object(c.useEffect)((function(){q()}),[q]);var Z=Object(c.useCallback)((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Excursion+"/getAll",{find:"Vo"}).customGet().then((function(e){W(e.data.excursions)}))}),[]);Object(c.useEffect)((function(){Z()}),[Z]);var J=function(e,t,n){return 0===n.id?function(e){return e&&0!==e.length?e.flatMap((function(e){return e.hotelsVo.flatMap((function(e){var t=e.name,n=e.hotelListId;return Fe.t.flatMap((function(e){return Fe.B.map((function(a){return{name:t,price:0,typeTraveler:a.value,arrangementName:e.value,hotelListIds:[n],costs:[]}}))}))}))})):[]}(t):e.map((function(e){if(!e.hotelListIds||0===e.hotelListIds.length)return e;var n=t.flatMap((function(e){return e.hotelsVo})).find((function(t){return t.hotelListId&&e.hotelListIds.includes(t.hotelListId)}));if(n){var a=n.name;return Object(o.a)(Object(o.a)({},e),{},{name:a,price:e.price})}return e}))};Object(c.useEffect)((function(){if(O.destinations&&O.destinations.length>0){var e=J(O.prices,O.destinations,O);f((function(t){return Object(o.a)(Object(o.a)({},t),{},{prices:e})}))}}),[O.destinations]);var X={0:Object(me.jsx)(dc,{setModel:f,providers:n,fetchProviders:a,model:O}),1:Object(me.jsx)(ia,{model:O,setModel:f,fetchProviders:a,providers:n,isUmrah:!1}),2:Object(me.jsx)(wa,{title:"Destination et H\xf4tels",providers:n,currencies:C,exchanges:I,fetchProviders:a,setModel:f,model:O,fetchPays:H,fetchHotels:q,hotelData:U||[],paysData:N||[],excursionData:z||[],isUmrah:!1,city:M,setCity:T}),3:Object(me.jsx)(Ja,{setModel:f,programs:v||[],model:O,fetchPrograms:V}),4:Object(me.jsx)(Oc,{model:O,setModel:f}),5:Object(me.jsx)(Ia,{model:O,setModel:f,state:m,setState:x})};return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)(Nt.a,{current:u,style:Xa.steps,children:Fe.w.map((function(e,t){return Object(me.jsx)(Nt.a.Item,{title:e,onClick:function(){return d(t)}},t)}))}),r?Object(me.jsx)("div",{style:Xa.loader,children:Object(me.jsx)(Un.a,{size:"lg"})}):X[u],t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",style:Xa.message,children:t}),Object(me.jsx)(Pt.a,{})]})};function hc(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=(Object(D.d)(L),Object(c.useState)(0)),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(!1),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({page:1,take:20,date:null}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(""),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(sc),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(D.c)(ye.a),T=Object(s.a)(M,2),w=(T[0],T[1]),R=function(){A(new $n),S("")},U=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return d(e.data)}))},F=function(){w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Package,Object(o.a)(Object(o.a)({},v),{},{date:v.date?_e()(v.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),f(e.data.totalCount)})).catch((function(e){S(e.Message),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){U()}),[]),Object(c.useEffect)((function(){F()}),[v.page,v.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return F()},children:Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Date : "}),Object(me.jsx)(fe.a,{type:"date",value:v.date,onChange:function(e){y((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})}),Object(me.jsx)(Ce.a,{ActionOnClose:R,excelData:oc(a),nameExcel:"packages",size:"xl",save:function(){var e;w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var t=Object(o.a)({},k),n=new FormData;(null===t||void 0===t||null===(e=t.categoryIds)||void 0===e?void 0:e.length)||delete t.categoryIds,Ga(n,t);var a=B.a.createAPIEndpoint(B.a.ENDPOINTS.Package);(t.id?a.update(t.id,n):a.create(n)).then((function(){Le.a.fire({position:"top-end",icon:"success",title:t.id?"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !":"\xc9l\xe9ment a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),R(),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),F()})).catch((function(e){var t,n,a,c;w((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})}))},title:"Ajouter un voyage organis\xe9",AddComponent:Object(me.jsx)(fc,{providers:u,fetchProviders:U,error:E,isLoading:m})}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){S(""),x(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.Package).fetchById(e).then((function(e){var t=Object(o.a)({},e.data);t.disponibilities&&(t.disponibilities=t.disponibilities.map((function(e){return Object(o.a)(Object(o.a)({},e),{},{date:e.date.substring(0,10)})}))),A(t)})).catch((function(e){console.log(e)})).finally((function(){x(!1)}))}(e),w((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Package).delete(e).then((function(){F(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){var t,n,a,c;S(e.Message),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})}))},displayAction:function(e,t){B.a.createAPIEndpoint(B.a.ENDPOINTS.Package+"/UpdateIsDisplayed",{etat:!t}).update3(e,!t).then((function(e){F(),Le.a.fire("Updated !","","success")})).catch((function(e){var t,n,a,c;S(e.Message),Va.a.push(Object(me.jsx)(Ha.a,{type:"error",header:V.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.title)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(c=a.data)||void 0===c?void 0:c.message)||V.error}),{placement:"topEnd"})}))},actionKey:"id",display:"isDisplayed",noAdvancedActions:!0,columns:pc,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:O,limitOptions:[10,20,50,100],limit:v.take,activePage:v.page,onChangePage:function(e){window.scrollTo(0,0),y((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),y((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var pc=[{value:"id",name:"Identifiant",render:function(e){return Object(me.jsx)("h5",{children:e})}},{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e?e.toUpperCase():""})}},{value:"description",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}}];var mc=function(e){var t=e._setmodel,n=e.model,a=e.clients,r=e.fetchClients,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(!1),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Xe.a),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(c.useState)(""),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(c.useState)([]),T=Object(s.a)(M,2),w=T[0],R=T[1],U=Object(c.useState)(!1),L=Object(s.a)(U,2),F=(L[0],L[1]),K=Object(D.d)(je.a),z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;B.a.createAPIEndpoint(B.a.ENDPOINTS.Check,{q:e,clientId:t||n.clientId},"/autocomplete").customGet().then((function(e){return d(e.data.map((function(e){return{value:e.id,label:e.name}})))}))},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data.map((function(e){return{value:e.id,label:e.name}})))}))};return Object(c.useEffect)((function(){z(),W(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}()}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Point de recouvrement:"}),Object(me.jsx)(Ze.a,{noSearch:!0,data:K,block:!0,value:n.recoveryPointId,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{recoveryPointId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Service : "}),Object(me.jsx)(Ze.a,{data:Fe.u,block:!0,noSearch:!0,value:n.service,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{service:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Client:"}),Object(me.jsx)(Ze.a,{onSearch:function(e){return r(e)},data:[{label:"Tout",value:0}].concat(a.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:n.clientId,onSelect:function(e){z("",e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:n.amount,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{amount:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Type De Paiment : "}),Object(me.jsx)(Ze.a,{data:Fe.s,block:!0,noSearch:!0,value:n.type,onSelect:function(e){t((function(t){var n=Object(o.a)({},t);return 1!=e&&delete n.checkId,2!=e&&delete n.checkoutId,4!=e&&delete n.bankId,Object(o.a)(Object(o.a)({},n),{},{type:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date:"}),Object(me.jsx)(fe.a,{type:"date",value:n.date,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(me.jsx)(fe.a,{value:n.refReglement,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{refReglement:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(me.jsx)("label",{children:"Notes:"}),Object(me.jsx)(fe.a,{value:n.notes,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{notes:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:1==n.type?"Ch\xe9que":4==n.type?"Banque":"Caisse"}),Object(me.jsxs)("div",{style:{display:"inline-block",width:1==n.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(me.jsx)(Ze.a,{renderMenuItem:function(e){return Object(me.jsxs)(me.Fragment,{children:[e.split(" ")[0],Object(me.jsx)("span",{style:{paddingLeft:"8px",color:"#aaa",fontSize:"12px"},children:e.split(" ")[1]})]})},block:!0,data:1==n.type?u:4==n.type?O:m,noSearch:!0,value:n[1==n.type?"checkId":4==n.type?"bankId":"checkoutId"],onSearch:function(e){return z(e)},onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},1==n.type?"checkId":4==n.type?"bankId":"checkoutId",e))}))}})]}),1==n.type&&Object(me.jsx)(Je.a,{size:"sm",onClick:function(){return y(!0)},icon:Object(me.jsx)(et.a,{})})]}),4==n.type&&Object(me.jsxs)(be.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(me.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(me.jsx)(fe.a,{value:n.EmissionBank,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{EmissionBank:e})}))}})]}),v&&1==n.type&&Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsx)(Qe.a,{_delete:function(e){var t=w.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(w[t].name).then((function(e){R((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var n=Object(qe.a)(E.attachments);n.splice(t),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:n})}))})).catch((function(e){}))},upload:function(e,t,n){F(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){F(!1);var a=e.findIndex((function(e){return e.fileKey==n}));R((function(t){var n=Object(qe.a)(e);return n[a].status="finished",n}));var c=Object(qe.a)(E.attachments);c.push(t.data[0].fileName),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:c})}))})).catch((function(t){F(!1);var a=e.findIndex((function(e){return e.fileKey==n}));R((function(t){var n=Object(qe.a)(e);return n[a].status="error",n}))}))},error:k,model:Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount),attachments:E.attachments&&E.attachments.join(),clientId:n.clientId,recoveryPointId:n.recoveryPointId}),banks:O,fetchBanks:W,_setmodel:S}),Object(me.jsx)(he.a,{onClick:function(){var e=Object(Ke.a)(E,[{number:"Num\xe9ro"},{amount:"Montant"}]);e?A(e):B.a.createAPIEndpoint(B.a.ENDPOINTS.Check+"/CreateFromRecov").create(Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount),attachments:E.attachments&&E.attachments.join(),clientId:n.clientId})).then((function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{checkId:e.data.id})})),z(E.number),S(new Xe.a),A(""),y(!1),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){A(e.response.data),console.log(e.response.data)}))},appearance:"primary",children:"Enregistrer"})]})]})};function xc(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)({q:"",page:1,take:20}),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(""),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new ot),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(ye.a),P=Object(s.a)(N,2),k=(P[0],P[1]),A=function(){S(new ot),y("")},M=function(){k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment,m).fetchAll().then((function(e){r(e.data.data),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};Object(c.useEffect)((function(){M()}),[m.page,m.take]);return Object(c.useEffect)((function(){M()}),[m.page,m.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return M()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){x((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{nameExcel:"payments",size:"md",save:function(){var e=Object(Ke.a)(E,[{clientId:"Client"},{amount:"Montant"}]);e?y(e):(k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),E.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).update(E.id,Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount)})).then((function(e){M(),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),A(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).create(Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount)})).then((function(e){M(),A(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:A,AddComponent:Object(me.jsx)(mc,{clients:O,fetchClients:function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))},error:v,model:E,_setmodel:S})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).fetchById(e).then((function(e){S(e.data),e.data.client&&f([e.data.client])}))}(e),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).delete(e).then((function(e){M(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return y(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:gc,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:m.take,activePage:m.page,onChangePage:function(e){window.scrollTo(0,0),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var gc=[{value:"id",name:"Identifiant",render:function(e){return Object(me.jsx)("h5",{children:e})}},{value:"account",name:"Client",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():"-"})}},{value:"amount",name:"Montant",render:function(e){return Object(me.jsx)("b",{children:e.toFixed(3)})}},{value:"date",name:"Date de D\xe9p\xf4t",render:function(e){return Object(me.jsx)("h6",{style:{fontSize:"12px"},children:_e()(e).format("DD MMM YYYY")})}},{value:"type",name:"Type",render:function(e){return Object(me.jsx)(Re.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:Fe.s.find((function(t){return t.value==e})).label})}},{value:"check",name:"N\xb0 Ch\xe9que",render:function(e){return Object(me.jsx)("b",{children:e||"-"})}},{value:"checkout",name:"Caisse",render:function(e){return Object(me.jsx)("b",{children:e||"-"})}},{name:"Virement",value:"depositBank",value2:"emissionBank",render:function(e,t){return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("b",{children:t?Object(me.jsxs)(me.Fragment,{children:[" ",t," ",Object(me.jsx)(at.a,{})]}):"-"})," ",Object(me.jsx)("b",{children:e||"-"})]})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}}];var _c=function(e){var t=e._setmodel,n=e.model,a=e.providers,r=e.fetchproviders,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(!1),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Xe.a),I=Object(s.a)(C,2),E=I[0],S=I[1],D=Object(c.useState)(""),N=Object(s.a)(D,2),P=N[0],k=N[1],A=Object(c.useState)([]),M=Object(s.a)(A,2),T=M[0],w=M[1],R=Object(c.useState)(!1),U=Object(s.a)(R,2),L=(U[0],U[1]),F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;B.a.createAPIEndpoint(B.a.ENDPOINTS.Check,{q:e,providerId:t||n.providerId},"/autocomplete").customGet().then((function(e){return d(e.data.map((function(e){return{value:e.id,label:e.name}})))}))},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data.map((function(e){return{value:e.id,label:e.name}})))}))};return Object(c.useEffect)((function(){F(),K(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}()}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Provider:"}),Object(me.jsx)(Ze.a,{onSearch:function(e){return r(e)},data:[{label:"Tout",value:0}].concat(a.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:n.providerId,onSelect:function(e){F("",e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:n.amount,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{amount:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Type De Paiment : "}),Object(me.jsx)(Ze.a,{data:Fe.s,block:!0,noSearch:!0,value:n.type,onSelect:function(e){t((function(t){var n=Object(o.a)({},t);return 1!=e&&delete n.checkId,2!=e&&delete n.checkoutId,4!=e&&delete n.bankId,Object(o.a)(Object(o.a)({},n),{},{type:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date:"}),Object(me.jsx)(fe.a,{type:"date",value:n.date,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]}),Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(me.jsx)(fe.a,{value:n.refReglement,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{refReglement:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(me.jsx)("label",{children:"Notes:"}),Object(me.jsx)(fe.a,{value:n.notes,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{notes:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:1==n.type?"Ch\xe9que":4==n.type?"Banque":"Caisse"}),Object(me.jsxs)("div",{style:{display:"inline-block",width:1==n.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(me.jsx)(Ze.a,{renderMenuItem:function(e){return Object(me.jsxs)(me.Fragment,{children:[e.split(" ")[0],Object(me.jsx)("span",{style:{paddingLeft:"8px",color:"#aaa",fontSize:"12px"},children:e.split(" ")[1]})]})},block:!0,data:1==n.type?u:4==n.type?O:m,noSearch:!0,value:n[1==n.type?"checkId":4==n.type?"bankId":"checkoutId"],onSearch:function(e){return F(e)},onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},1==n.type?"checkId":4==n.type?"bankId":"checkoutId",e))}))}})]}),1==n.type&&Object(me.jsx)(Je.a,{size:"sm",onClick:function(){return y(!0)},icon:Object(me.jsx)(et.a,{})})]}),4==n.type&&Object(me.jsxs)(be.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(me.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(me.jsx)(fe.a,{value:n.EmissionBank,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{EmissionBank:e})}))}})]}),v&&1==n.type&&Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsx)(Qe.a,{_delete:function(e){var t=T.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(T[t].name).then((function(e){w((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var n=Object(qe.a)(E.attachments);n.splice(t),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:n})}))})).catch((function(e){}))},upload:function(e,t,n){L(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){L(!1);var a=e.findIndex((function(e){return e.fileKey==n}));w((function(t){var n=Object(qe.a)(e);return n[a].status="finished",n}));var c=Object(qe.a)(E.attachments);c.push(t.data[0].fileName),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:c})}))})).catch((function(t){L(!1);var a=e.findIndex((function(e){return e.fileKey==n}));w((function(t){var n=Object(qe.a)(e);return n[a].status="error",n}))}))},error:P,model:E,banks:O,fetchBanks:K,_setmodel:S}),Object(me.jsx)(he.a,{onClick:function(){var e=Object(Ke.a)(E,[{number:"Num\xe9ro"},{amount:"Montant"},{date:"Date de D\xe9p\xf4t"}]);e?k(e):B.a.createAPIEndpoint(B.a.ENDPOINTS.Check).create(Object(o.a)(Object(o.a)({},E),{},{amount:parseFloat(E.amount),attachments:E.attachments&&E.attachments.join(),providerId:n.providerId})).then((function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{checkId:e.data.id})})),F(E.number),S(new Xe.a),k(""),y(!1),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){k(e.response.data),console.log(e.response.data)}))},appearance:"primary",children:"Enregistrer"})]})]})};function vc(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)({q:"",page:1,take:20}),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(""),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Kt),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(ye.a),P=Object(s.a)(N,2),k=(P[0],P[1]),A=function(){S(new Kt),y("")},M=function(){k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment,m,"/getPaymentsProvider").customGet().then((function(e){r(e.data.data),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){M()}),[m.page,m.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return M()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){x((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{nameExcel:"payments",size:"md",save:function(){var e=Object(Ke.a)(E,[{providerId:"Fournisseur"},{amount:"Montant"}]);e?y(e):(k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),E.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).update(E.id,Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount)})).then((function(e){M(),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),A(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).create(Object(o.a)(Object(o.a)({},E),{},{amount:Number(E.amount)})).then((function(e){M(),A(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:A,AddComponent:Object(me.jsx)(_c,{providers:O,fetchproviders:function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))},error:v,model:E,_setmodel:S})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).fetchById(e).then((function(e){S(e.data),e.data.provider&&f([e.data.provider])}))}(e),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Payment).delete(e).then((function(e){M(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return y(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:yc,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:m.take,activePage:m.page,onChangePage:function(e){window.scrollTo(0,0),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var yc=[{value:"id",name:"Identifiant",render:function(e){return Object(me.jsx)("h5",{children:e})}},{value:"account",name:"Fournisseur",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():"-"})}},{value:"amount",name:"Montant",render:function(e){return Object(me.jsx)("b",{children:e.toFixed(3)})}},{value:"date",name:"Date de D\xe9p\xf4t",render:function(e){return Object(me.jsx)("h6",{style:{fontSize:"12px"},children:_e()(e).format("DD MMM YYYY")})}},{value:"type",name:"Type",render:function(e){return Object(me.jsx)(Re.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:Fe.s.find((function(t){return t.value==e})).label})}},{value:"check",name:"N\xb0 Ch\xe9que",render:function(e){return Object(me.jsx)("b",{children:e||"-"})}},{value:"checkout",name:"Caisse",render:function(e){return Object(me.jsx)("b",{children:e||"-"})}},{name:"Virement",value:"depositBank",value2:"emissionBank",render:function(e,t){return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("b",{children:t?Object(me.jsxs)(me.Fragment,{children:[" ",t," ",Object(me.jsx)(at.a,{})]}):"-"})," ",Object(me.jsx)("b",{children:e||"-"})]})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}}],Cc=n(784),Ic=n(1238),Ec={verticalAlign:"top"};var Sc=function(e){var t=e.error,n=(e.clients,e.banks,e.fetchBanks,e.fetchClients,e.checkouts,e.fetchCheckouts,e.providers),a=e.fetchProviders,r=e.agentBookingFlights,i=e.fetchTags,o=e.tags,l=Object(c.useState)(0),u=Object(s.a)(l,2),d=u[0],j=u[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(Nt.a,{current:d,style:Ec,children:[Object(me.jsx)(Nt.a.Item,{title:"Infos G\xe9nerales",onClick:function(){return j(0)}}),Object(me.jsx)(Nt.a.Item,{title:"Services Achet\xe9es",onClick:function(){return j(1)}}),Object(me.jsx)(Nt.a.Item,{onClick:function(){return j(2)},title:"Encaissement"}),Object(me.jsx)(Nt.a.Item,{title:"Attachments",onClick:function(){return j(3)}})]}),Object(me.jsx)("div",{style:{padding:"40px 10px"},children:d?1==d?Object(me.jsx)(Nc,{agentBookingFlights:r}):2==d?Object(me.jsx)(Ac,{}):Object(me.jsx)(Mc,{}):Object(me.jsx)(Dc,{fetchProviders:a,providers:n,tags:o,fetchTags:i})}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{})]})},Dc=function(e){var t=e.providers,n=e.fetchProviders,a=e.tags,r=e.fetchTags,i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(D.c)(zt),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(D.d)(Y);return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Fournisseur: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:[{label:"Tout",value:0}].concat(t.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:O.providerId,onSelect:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}}),Object(me.jsx)("label",{children:"Date D'Achat': "}),Object(me.jsx)(fe.a,{type:"date",value:O.date,onChange:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}}),Object(me.jsx)("label",{children:"Mots Cl\xe9s: "}),Object(me.jsx)(Ic.a,{data:a?a.map((function(e){return{label:e.name,value:e.id}})):[],block:!0,onSearch:r,onSelect:function(e){var t=u.filter((function(t){return e.find((function(e){return e==t.id}))})),n=a.filter((function(t){return e.find((function(e){return e==t.id}))&&!u.find((function(e){return e.id==t.id}))}));d((function(e){return[].concat(Object(qe.a)(t),Object(qe.a)(n))})),f((function(e){return Object(o.a)(Object(o.a)({},e),{},{tags:[].concat(Object(qe.a)(t),Object(qe.a)(n))})}))}}),Object(me.jsx)("label",{children:"Devise: "}),Object(me.jsx)(Ze.a,{data:h.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:O.currencyId,onSelect:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{currencyId:e})}))}})]})},Nc=function(e){Object(Cc.a)(e);var t=Object(D.c)(zt),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(new Ft),l=Object(s.a)(i,2),u=l[0],d=l[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Service : "}),Object(me.jsx)(Ze.a,{data:Fe.u,block:!0,noSearch:!0,value:u.service,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{service:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Co\xfbt Unitaire:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:u.unitCost,onChange:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{unitCost:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission Unitaire:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:u.unitFee,onChange:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{unitFee:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Quantit\xe9:"}),Object(me.jsx)(fe.a,{type:"number",step:"1",value:u.qty,onChange:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{qty:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission ( % ):"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:u.commission,onChange:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{commission:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Co\xfbt Total:"}),Object(me.jsxs)("div",{children:[" ",Object(me.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(u.commission)/100)*parseInt(u.qty)*(parseFloat(u.unitFee)+parseFloat(u.unitCost))).toFixed(3)})]})]}),Object(me.jsx)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"D\xe9signation:"}),Object(me.jsx)(fe.a,{as:"textarea",rows:2,placeholder:"Notes"})]})}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsx)(Je.a,{onClick:function(){r((function(e){console.log(e);var t=Object(o.a)({},e);if("object"!=typeof t.package.packageItems&&(t.package.packageItems=[]),"number"==typeof u.index){var n=Object(qe.a)(t.package.packageItems);n[u.index]=u,t.package=Object(o.a)(Object(o.a)({},t.package),{},{packageItems:n})}else{var a=Object(qe.a)(t.package.packageItems);a.push(u),t.package=Object(o.a)(Object(o.a)({},t.package),{},{packageItems:a})}return t})),d(new Ft)},color:"violet",icon:Object(me.jsx)(b.a,{}),children:"Ajouter"})}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)(Ee.a,{editAction:function(e){d(Object(o.a)(Object(o.a)({},a.package.packageItems[e]),{},{index:e}))},deleteAction:function(e){r((function(t){var n=Object(o.a)({},t),a=Object(qe.a)(n.package.packageItems);return a.splice(e,1),n.package=Object(o.a)(Object(o.a)({},n.package),{},{packageItems:a}),n}))},actionKey:"index",noAdvancedActions:!0,columns:Pc,rows:a.package.packageItems.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{index:t})}))}),Object(me.jsxs)("h5",{children:["Cout Total:"," ",Object(me.jsx)("i",{children:Pc.reduce((function(e,t){return e+parseInt(t.qty)*(1+parseFloat(t.commission)/100)*(parseFloat(t.unitFee)+parseFloat(t.unitCost))}),0)})]})]})},Pc=[{value:"service",name:"Service",render:function(e){return Object(me.jsxs)("b",{children:[Object(me.jsx)("a",{children:Fe.u.find((function(t){return t.value==e})).label})," ",Object(me.jsx)("br",{})]})}},{value:"commission",value2:"unitFee",value3:"unitCost",value4:"qty",name:"Co\xfbt Total",render:function(e,t,n,a){return Object(me.jsx)("b",{children:(parseInt(a)*(1+parseFloat(e)/100)*(parseFloat(t)+parseFloat(n))).toFixed(3)})}}],kc=[{value:"amount",name:"Montant",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"type",name:"Type",render:function(e){return Object(me.jsx)(Re.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:Fe.s.find((function(t){return t.value==e}))&&Fe.s.find((function(t){return t.value==e})).label})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}}],Ac=function(){var e=Object(c.useState)([]),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(D.c)(zt),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)([]),j=Object(s.a)(d,2),O=j[0],f=j[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(!1),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Xe.a),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(c.useState)(""),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(c.useState)([]),T=Object(s.a)(M,2),w=T[0],R=T[1],U=Object(c.useState)(!1),L=Object(s.a)(U,2),F=(L[0],L[1]),K=Object(c.useState)(new Kt),z=Object(s.a)(K,2),W=z[0],Y=z[1],V=function(){Y(new Kt)},H=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data.map((function(e){return{value:e.id,label:e.name}})))}))};return Object(c.useEffect)((function(){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Check,{q:e},"/autocomplete").customGet().then((function(e){return a(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}(),H(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data.map((function(e){return{value:e.id,label:e.name}})))}))}()}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.02)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:W.amount,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{amount:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Type De Paiment : "}),Object(me.jsx)(Ze.a,{data:Fe.s,block:!0,noSearch:!0,value:W.type,onSelect:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{type:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Date:"}),Object(me.jsx)(fe.a,{type:"date",value:l.date,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(me.jsx)(fe.a,{value:W.refReglement,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{refReglement:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(me.jsx)("label",{children:"Notes:"}),Object(me.jsx)(fe.a,{value:W.notes,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{notes:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:1==W.type?"Ch\xe9que":4==W.type?"Banque":"Caisse"}),Object(me.jsxs)("div",{style:{display:"inline-block",width:1==W.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(me.jsx)(Ze.a,{block:!0,data:1==W.type?n:4==W.type?O:m,noSearch:!0,value:W[1==W.type?"checkId":4==W.type?"bankId":"checkoutId"],onSelect:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},Object(G.a)({},1==W.type?"checkId":4==W.type?"bankId":"checkoutId",e))}))}})]}),1==W.type&&Object(me.jsx)(Je.a,{size:"sm",onClick:function(){return y(!0)},icon:Object(me.jsx)(et.a,{})})]}),4==W.type&&Object(me.jsxs)(be.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(me.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(me.jsx)(fe.a,{value:W.EmissionBank,onChange:function(e){Y((function(t){return Object(o.a)(Object(o.a)({},t),{},{EmissionBank:e})}))}})]}),v&&1==W.type&&Object(me.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(me.jsx)(Qe.a,{_delete:function(e){var t=w.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(w[t].name).then((function(e){R((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var n=Object(qe.a)(E.attachments);n.splice(t),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:n})}))})).catch((function(e){}))},upload:function(e,t,n){F(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){F(!1);var a=e.findIndex((function(e){return e.fileKey==n}));R((function(t){var n=Object(qe.a)(e);return n[a].status="finished",n}));var c=Object(qe.a)(E.attachments);c.push(t.data[0].fileName),S((function(e){return Object(o.a)(Object(o.a)({},E),{},{attachments:c})}))})).catch((function(t){F(!1);var a=e.findIndex((function(e){return e.fileKey==n}));R((function(t){var n=Object(qe.a)(e);return n[a].status="error",n}))}))},error:k,model:E,banks:O,fetchBanks:H,_setmodel:S}),Object(me.jsx)(he.a,{onClick:function(){var e=Object(Ke.a)(E,[{number:"Num\xe9ro"},{status:"Status"},{amount:"Montant"},{depositDate:"Date de D\xe9p\xf4t"}]);e?A(e):(a((function(e){return[{value:-1,label:E.number+"("+(O.find((function(e){return e.value==E.depositBankId}))?O.find((function(e){return e.value==E.depositBankId})).label:"")+")"}].concat(Object(qe.a)(e))})),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{check:Object(o.a)(Object(o.a)({},E),{},{amount:parseFloat(E.amount),attachments:E.attachments&&E.attachments.join(),clientId:l.clientId}),checkId:-1})})),S(new Xe.a),A(""),y(!1))},appearance:"primary",children:"Enregistrer"})]}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsx)(Me.a,{children:Object(me.jsx)(Je.a,{onClick:function(){u((function(e){console.log(e);var t=Object(o.a)({},e);if("object"!=typeof t.payments&&(t.payments=[]),"number"==typeof W.index){var n=Object(qe.a)(t.payments);n[W.index]=W,t.payments=Object(qe.a)(n)}else{var a=Object(qe.a)(t.payments);a.push(W),t.payments=Object(qe.a)(a)}return t})),V()},appearance:"primary",color:"blue",icon:Object(me.jsx)(b.a,{}),children:"Ajouter"})})})]}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)(Ee.a,{editAction:function(e){Y(Object(o.a)(Object(o.a)({},l.payments[e]),{},{index:e}))},deleteAction:function(e){u((function(t){var n=Object(o.a)({},t),a=Object(qe.a)(n.payments);return a.splice(e,1),n.payments=Object(qe.a)(a),n})),V()},actionKey:"index",noAdvancedActions:!0,columns:kc,rows:l.payments?l.payments.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{index:t})})):[]})]})},Mc=function(){var e=Object(D.c)(At),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)(!1),j=Object(s.a)(d,2),b=j[0],O=j[1];return Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsx)(kt.a,{loading:b,autoUpload:!1,fileList:l,action:"#",draggable:!0,onRemove:function(e){return function(e){var t=l.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(n.attachments[t].name).then((function(e){u((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var c=Object(qe.a)(n.attachments);c.splice(t),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:c})}))})).catch((function(e){}))}(e.fileKey)},onChange:function(e){console.log(e);var t=e.filter((function(e){return"finished"!=e.status})).reverse()[0];t&&function(e,t,c){O(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){O(!1);var r=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var n=Object(qe.a)(e);return n[r].status="finished",n}));var i=Object(qe.a)(n.attachments);i.push({name:t.data[0].fileName}),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:i})}))})).catch((function(t){O(!1);var n=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var a=Object(qe.a)(e);return a[n].status="error",a}))}))}(e,t.blobFile,t.fileKey)},children:Object(me.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(me.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(me.jsx)(Rt.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),b&&Object(me.jsx)(me.Fragment,{})]})};function Tc(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)([]),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(0),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(c.useState)({page:1,take:20,providerId:0,status:0,date:null}),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(c.useState)(""),T=Object(s.a)(M,2),w=T[0],R=T[1],U=Object(D.c)(zt),L=Object(s.a)(U,2),F=L[0],K=L[1],z=Object(D.c)(ye.a),W=Object(s.a)(z,2),Y=(W[0],W[1]),G=function(){K(new Ut),R("")},V=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return d(e.data)}))},H=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))},q=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete").customGet().then((function(e){return y(e.data)}))},Z=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data)}))},J=function(){Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Purchase,Object(o.a)(Object(o.a)({},k),{},{date:k.date?_e()(k.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),S(e.data.totalCount)})).catch((function(e){R(e.Message),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){J(),V(),H(),Z(),q()}),[]),Object(c.useEffect)((function(){J()}),[k.page,k.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return J()},children:[Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Provider: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return q(e)},data:[{label:"Tout",value:0}].concat(v.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:k.providerId,onSelect:function(e){A((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Status du Paiement: "}),Object(me.jsx)(Ze.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(Fe.j),block:!0,noSearch:!0,value:k.status,onSelect:function(e){A((function(t){return Object(o.a)(Object(o.a)({},t),{},{status:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Tags: "}),Object(me.jsx)(Ze.a,{onSearch:Z,data:[{label:"Tout",value:0}].concat(m.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:k.tagId,onSelect:function(e){A((function(t){return Object(o.a)(Object(o.a)({},t),{},{tagId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Date du Vente: "}),Object(me.jsx)(fe.a,{type:"date",value:k.date,onChange:function(e){A((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{nameExcel:"sale",size:"lg",save:function(){console.log(F),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)(Object(o.a)({},F),{},{tagPurchases:F.tags.map((function(e){return{tagId:e.id}})),package:Object(o.a)(Object(o.a)({},F.package),{},{packageItems:F.package.packageItems.map((function(e){return Object(o.a)(Object(o.a)({},e),{},{unitCost:parseFloat(e.unitCost),commission:parseInt(e.commission),unitFee:parseFloat(e.unitFee),qty:parseInt(e.qty),totalCost:parseInt(e.qty)*(parseFloat(e.unitCost)+parseFloat(e.unitFee)*(1+parseInt(e.commission)/100))})}))}),payments:Object(qe.a)(F.payments.map((function(e){return Object(o.a)(Object(o.a)({},e),{},{amount:parseFloat(e.amount),date:e.date?e.date:new Date,providerId:F.providerId})}))),attachments:F.attachments?F.attachments.map((function(e){return e.name})).join():""});delete e.tags,F.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Purchase).update(e.id,e).then((function(e){J(),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),G(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){R(e.Message),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Purchase).create(e).then((function(e){J(),G(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){R(e.Message),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Sc,{checkouts:O,tags:m,fetchCheckouts:H,fetchTags:Z,providers:v,fetchProviders:q,error:w,banks:u,fetchBanks:V})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){R(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Purchase).fetchById(e).then((function(e){K(Object(o.a)(Object(o.a)({},e.data),{},{depositDate:new Date(e.data.depositDate)}))})).catch((function(e){console.log(e)}))}(e),Y((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Purchase).delete(e).then((function(e){J(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return R(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:wc,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:E,limitOptions:[10,20,50,100],limit:k.take,activePage:k.page,onChangePage:function(e){window.scrollTo(0,0),A((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),A((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var wc=[{value:"provider",name:"Fournisseur",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})}},{value:"tags",name:"Tags",render:function(e){return Object(me.jsx)(me.Fragment,{children:e&&e.map((function(e){return Object(me.jsx)(Re.a,{children:e.name})}))})}},{value:"totatlCost",value2:"currency",name:"Prix Total",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})}},{value:"date",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}}];var Bc=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Designation:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{designation:e})}))},value:a.designation}),Object(me.jsx)("label",{children:"jours :"}),Object(me.jsx)("input",{style:{display:"block"},value:a.days,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{days:e.target.value})}))}}),Object(me.jsx)("br",{}),Object(me.jsx)("label",{htmlFor:"monthSelect",children:" Mois: "}),Object(me.jsxs)("select",{id:"monthSelect",value:a.month,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{month:e.target.value})}))},children:[Object(me.jsx)("option",{value:"",children:"Select"}),Object(me.jsx)("option",{value:"0",children:"Ce Mois"}),Object(me.jsx)("option",{value:"1",children:"Mois Prochain"})]}),Object(me.jsx)("br",{}),Object(me.jsxs)("label",{children:[" ","Genre : male",Object(me.jsx)("br",{})," ",Object(me.jsx)("input",{type:"checkbox",onChange:function(e){t((function(e){return Object(o.a)(Object(o.a)({},e),{},{isMale:!0})}))},checked:1==a.isMale})]}),Object(me.jsx)("br",{}),Object(me.jsxs)("label",{children:[" ","Genre female :",Object(me.jsx)("br",{})," ",Object(me.jsx)("input",{type:"checkbox",onChange:function(e){t((function(e){return Object(o.a)(Object(o.a)({},e),{},{isMale:!1})}))},checked:0==a.isMale})]}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})},Rc=function e(){Object(U.a)(this,e),this.date=new Date},Uc=Object(D.b)({key:"rawdhasAtoms",default:[]});function Lc(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(!1),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)(0),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(D.c)(Uc),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(0),_=Object(s.a)(g,2),v=_[0],C=_[1],I=Object(c.useState)(0),E=Object(s.a)(I,2),S=(E[0],E[1],Object(c.useState)([])),N=Object(s.a)(S,2),P=N[0],k=N[1],A=Object(c.useState)(!1),M=Object(s.a)(A,2),T=M[0],w=M[1],R=Object(D.c)(Oe),U=Object(s.a)(R,2),L=(U[0],U[1],Object(c.useState)({q:"",page:1,take:50,date:null})),F=Object(s.a)(L,2),K=F[0],z=F[1],W=Object(c.useState)(""),Y=Object(s.a)(W,2),G=Y[0],V=Y[1],H=Object(c.useState)(new Rc),q=Object(s.a)(H,2),Z=q[0],J=q[1],X=Object(c.useState)(0),Q=Object(s.a)(X,2),$=Q[0],ee=Q[1],te=Object(D.c)(ye.a),ne=Object(s.a)(te,2),ae=(ne[0],ne[1]),ce=function(){J(new Rc),V("")},re=function(){ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Rawdha,K).fetchAll().then((function(e){r(e.data.data),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),C(e.data.totalCount)})).catch((function(e){V(e.Message),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Rawdha,{page:1,take:1e3,q:""}).fetchAll().then((function(e){x(e.data.data)})).catch((function(e){}))};Object(c.useEffect)((function(){re()}),[K.page,K.take]),Object(c.useEffect)((function(){O&&le()}),[O]);var ie=[{value:"designation",name:"Designation",render:function(e){return Object(me.jsx)("b",{style:{fontSize:"18px"},children:e})}},{value:"date",name:"DATE",render:function(e){return Object(me.jsx)("b",{children:e?e.substring(0,10):e})}},{value:"date",name:"Temps",render:function(e){return Object(me.jsx)("b",{children:e?e.substring(11,16):e})}},{value:"id",name:"DETAILS",render:function(e){return Object(me.jsx)(he.a,{appearance:"ghost",color:"blue",onClick:function(){d(!0),f(e)},children:"D\xe9tails"})}},{value:"id",name:"-",render:function(e){return Object(me.jsx)(he.a,{loading:$==e&&T,appearance:"primary",color:"orange",onClick:function(){oe(e),ee(e)},children:"envoyer"})}}],oe=function(){var e=Object(hn.a)(fn.a.mark((function e(t){var n,a;return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("rawdha"),w(!0),n=m.find((function(e){return e.id==t})),(a={}).passportNumbers="",console.log(a.passportNumbers),a.month=n.month,a.days=n.days,a.isMale=n.isMale,a.designation=n.designation,a.user="nusk1031",a.password="nusk_1031#",y.a.post("http://localhost:8733/rawdha",a).then((function(e){console.log(e),e.data.Erreur?oe(t):alert("success")})),w(!1);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),se=function(){k([]),f(0),d(!1)},le=function(){B.a.createAPIEndpoint(pe.a.Order+"/Umrah",{page:1,take:1e4,rawdhaId:O}).customGet().then((function(e){return k(e.data.data.filter((function(e){return e})).map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{index:t+1})})))}))};return Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return re()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){z((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"P\xe9riode: "}),Object(me.jsx)(xn.a,{placement:"bottomStart",value:K.date,onChange:function(e){return z((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))},onSelect:function(e){return z((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))},block:!0})]})]}),Object(me.jsx)(Ce.a,{noExport:!0,size:"md",save:function(){ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),Z.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Rawdha).update(Z.id,Z).then((function(e){re(),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),ce(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){V(e.Message),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Rawdha).create(Z).then((function(e){re(),ce(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){V(e.Message),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))},AddComponent:Object(me.jsx)(Bc,{error:G,model:Z,_setmodel:J})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){V(""),J(a.find((function(t){return t.id==e})))}(e),ae((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Rawdha).delete(e).then((function(e){re(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return V(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:ie,rows:a}),Object(me.jsxs)("div",{style:{padding:20,background:"#fff"},children:[Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:v,limitOptions:[10,20,50,100],limit:K.take,activePage:K.page,onChangePage:function(e){window.scrollTo(0,0),z((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),z((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}}),Object(me.jsxs)(dt.a,{size:"lg",overflow:!1,style:{maxHeight:"calc(100vh - 50px)",overflow:"auto",maxWidth:"100vw"},open:u,onClose:function(){se()},children:[Object(me.jsx)(dt.a.Header,{children:Object(me.jsx)(dt.a.Title,{children:"Rawdha D\xe9tails"})}),Object(me.jsx)(dt.a.Body,{children:Object(me.jsx)("div",{style:{maxHeight:"calc(100vh - 240px)",overflow:"auto",maxWidth:"100vw"},children:Object(me.jsx)(Ee.a,{columns:Fc,rows:P})})}),Object(me.jsx)(dt.a.Footer,{children:Object(me.jsx)(he.a,{onClick:function(){se()},appearance:"subtle",children:"Annuler"})})]})]})]})}var Fc=[{value:"codeMoufa",value2:"errorMessage",render:function(e,t){return Object(me.jsx)("span",{style:{content:"",width:"10px",height:"50px",background:e||"Success"==t?"green":t?"red":"orange",display:"block"}})}},{value:"index",name:"-",render:function(e){return Object(me.jsx)("b",{style:{fontSize:"20px"},children:e})}},{value:"customer",name:"Client B2C",render:function(e){return Object(me.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.picture+"?"+Date.now(),width:"43",height:"43",style:{border:"1px solid #eee",borderRadius:"50%",boxShadow:"-11px -5px 20px -13px rgba(0,0,0,0.75)"}}):Object(me.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(me.jsx)("i",{style:{color:"#999",fontSize:"14px",fontWeight:"lighter"},children:e?e.passportNumber:""}),Object(me.jsx)("br",{})," ",Object(me.jsx)("i",{style:{color:"#444"},children:e.firstNameAr+" "+e.lastNameAr})]})]})}},{name:"Rawdha",value:"isRawdhaSent",render:function(e){return Object(me.jsx)(Re.a,{color:e?"blue":"orange",children:e?"oui":"non"})}}];function Kc(){var e=Object(c.useState)([]),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)({disponibilityId:0,page:1,take:1e3}),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(c.useState)(0),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(c.useState)([]),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)([]),I=Object(s.a)(y,2),E=I[0],S=I[1],D=Object(c.useState)(0),N=Object(s.a)(D,2),P=N[0],k=N[1],A=Object(c.useState)(null),M=Object(s.a)(A,2),T=M[0],w=M[1];function R(e){e.preventDefault()}function U(e,t){e.dataTransfer.setData("pilgrim",t),w(E.find((function(e){return e.id==t})))}function L(e,t){var n=e.dataTransfer.getData("pilgrim"),a="[data-id='"+n+"']",c=Object(qe.a)(E),r=c.findIndex((function(e){return e.id==T.id})),i=Object(o.a)({},c[r]),s=e.target.getAttribute("data-id"),u=e.target.getAttribute("data-type");if(s&&c.find((function(e){return e.id==s}))&&!c.find((function(e){return e.id==s})).roomId){var d=document.querySelector("#__root");d.appendChild(document.querySelector(a)),i.roomId=0,c[r]=i,S(c)}else{if(s)return!1;if("__root"!=e.target.id||s){if(!(u&&T.price&&u==T.price.arrangementMakkahDesignation&&E.filter((function(e){return e.roomId==t})).length2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities)}),[]);a(t.filter((function(e){return e.onStock})))}))}),[]),Object(c.useEffect)((function(){var e=document.querySelector("#__root");E.filter((function(e){return e.roomId})).map((function(t){var n="[data-id='"+t.id+"']";e.appendChild(document.querySelector(n))})),b.disponibilityId&&F()}),[b.disponibilityId]),Object(c.useEffect)((function(){setTimeout((function(){console.log("tetst"),E.filter((function(e){return e.roomId})).map((function(e){console.log(e.roomId);var t="[data-roomId='"+e.roomId+"']",n=document.querySelector(t),a="[data-id='"+e.id+"']";n.appendChild(document.querySelector(a))}))}),500)}),[E.length]);return Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{m:4,l:4,xl:4,children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(n?n.map((function(e){return{label:Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),value:e.id}})):[]),block:!0,noSearch:!0,value:b.disponibilityId,onSelect:function(e){O((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}}),Object(me.jsx)("div",{style:{borderBottom:"1px solid #eee",textTransform:"uppercase",fontWeight:"lighter",color:"#232323"},className:"p-5",children:"Liste Des P\xe9l\xe9rins :"}),Object(me.jsx)("div",{style:{width:"100%",overflowY:"auto"},children:Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(me.jsx)("button",{onClick:function(){m(0)},style:{background:p?"#fff":"#232323",color:p?"#232323":"#fff",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Tout"}),Object(me.jsx)("button",{onClick:function(){m(2)},style:{background:2!=p?"#fff":"#232323",color:2==p?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Double"}),Object(me.jsx)("button",{onClick:function(){m(3)},style:{background:3!=p?"#fff":"#232323",color:3==p?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Triple"}),Object(me.jsx)("button",{onClick:function(){m(4)},style:{background:4!=p?"#fff":"#232323",color:4==p?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Quad"})]})}),Object(me.jsx)("div",{id:"__root",onDrop:function(e){return L(e,null,!0)},onDragOver:R,style:{height:"calc(100vh - 100px)",overflowY:"auto",background:"#fff",borderRadius:"5px"},children:E.map((function(e,t){return Object(me.jsxs)("div",{className:"____node",draggable:!0,style:{background:1==e.customer.gender?"rgb(0,169,141,0.1)":"rgb(229,57,53,0.1)",borderRadius:"5px",margin:e.roomId||!p||e.price&&(4==p&&e.price.arrangementMakkahDesignation.includes("quad")||3==p&&e.price.arrangementMakkahDesignation.includes("triple")||2==p&&e.price.arrangementMakkahDesignation.includes("double"))?"5px":"0",display:"flex",alignItems:"center",height:e.roomId||!p||e.price&&(4==p&&e.price.arrangementMakkahDesignation.includes("quad")||3==p&&e.price.arrangementMakkahDesignation.includes("triple")||2==p&&e.price.arrangementMakkahDesignation.includes("double"))?"unset":"0",overflow:"hidden"},"data-id":e.id,onDragStart:function(t){return U(t,e.id)},onTouchStart:function(t){return U(t,e.id)},children:[e.customer.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.customer.picture,width:"43",height:"43",style:{border:"1px solid #eee",margin:"3px",borderColor:1==e.customer.gender?"rgb(0,169,141,01)":"rgb(229,57,53,01)",borderRadius:"50%"}}):Object(me.jsx)("div",{className:"non_drop",style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{className:"non_drop",style:{paddingLeft:"5px",fontSize:"12px"},children:[e?e.customer.name.toUpperCase():"",Object(me.jsx)("br",{}),Object(me.jsx)(Re.a,{size:"xs",color:1==e.customer.gender?"green":"red",children:Object(me.jsx)("b",{style:{fontSize:"11px",padding:"0 6px"},children:e?e.customer.passportNumber:""})}),Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[Object(me.jsx)(nc.c,{color:"rgb(191,155,48)",fontWeight:"lighter",size:"20px"})," ",Object(me.jsxs)("p",{children:[Object(me.jsx)("b",{children:e.price&&e.price.hotelMakkahName+" - "+e.price.hotelMadinahName})," ","(",e.price&&("Chambre quadruple"==e.price.arrangementMakkahDesignation?"Quad":"Chambre triple"==e.price.arrangementMakkahDesignation?"Triple":"Double"),")"]})]})]})]},e.id)}))})]}),Object(me.jsxs)(be.a,{m:8,l:8,xl:8,className:"p-5",children:[Object(me.jsx)("div",{style:{textAlign:"right",padding:"10px"},children:Object(me.jsx)(he.a,{appearance:"primary",color:"blue",onClick:function(){var e={disponibilityId:b.disponibilityId};e.rooms=l.map((function(e){var t=Object(o.a)(Object(o.a)({},e),{},{orderUmrahIds:E.filter((function(t){return t.roomId==e.id}))?E.filter((function(t){return t.roomId==e.id})).map((function(e){return e.id})).join(","):""});return delete t.id,t})),console.log(e),P?Object(pt.a)(pe.a.Rooming).update2(Object(o.a)({id:P},e)).then((function(e){return console.log(e.data)})):Object(pt.a)(pe.a.Rooming).create(e).then((function(e){return console.log(e.data)}))},children:"Enregistrer"})}),Object(me.jsxs)("div",{style:{background:"#fff",borderRadius:"10px",border:"1px solid #ddd",minHeight:"500px",maxHeight:"90vh",overflowY:"auto"},className:"p-5",children:[Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-5",children:[l.filter((function(e){return 4==e.nbr})).map((function(e){return Object(me.jsx)("div",{style:{background:"#fff",minHeight:_.find((function(t){return t==e.id}))?"240px":"60px",maxHeight:_.find((function(t){return t==e.id}))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:E.filter((function(t){return t.roomId==e.id})).length2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities)}),[]);a(t.filter((function(e){return e.onStock})))}))}),[]),Object(c.useEffect)((function(){b.disponibilityId&&A()}),[b.disponibilityId]);var M=function(e,t){return Object(me.jsxs)("div",{style:{width:"calc(100% - 0px)"},children:[" ",Object(me.jsx)(Ze.a,{block:!0,disabled:E.filter((function(t){return t.roomId==e})).length==t,data:[{label:"S\xe9l\xe9ctionner",value:0}].concat(E?E.filter((function(e){return!e.roomId&&e.price&&("Chambre quadruple"==e.price.arrangementMakkahDesignation?4:"Chambre triple"==e.price.arrangementMakkahDesignation?3:2)==t})).map((function(e){return{label:Object(me.jsxs)("div",{style:{color:"#232323",display:"flex"},children:[e.customer.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.customer.picture,width:"43",height:"43",style:{border:"1px solid #eee",margin:"3px",borderColor:1==e.customer.gender?"rgb(0,169,141,01)":"rgb(229,57,53,01)",borderRadius:"50%"}}):Object(me.jsx)("div",{className:"non_drop",style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{className:"non_drop",style:{paddingLeft:"5px",fontSize:"12px"},children:[e?e.customer.name.toUpperCase():"",Object(me.jsx)("br",{}),Object(me.jsx)(Re.a,{size:"xs",color:1==e.customer.gender?"green":"red",children:Object(me.jsx)("b",{style:{fontSize:"11px",padding:"0 6px"},children:e?e.customer.passportNumber:""})}),Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[Object(me.jsx)(nc.c,{color:"rgb(191,155,48)",fontWeight:"lighter",size:"20px"})," ",Object(me.jsxs)("p",{children:[Object(me.jsx)("b",{children:e.price&&e.price.hotelMakkahName+" - "+e.price.hotelMadinahName})," ","(",e.price&&("Chambre quadruple"==e.price.arrangementMakkahDesignation?"Quad":"Chambre triple"==e.price.arrangementMakkahDesignation?"Triple":"Double"),")"]})]})]})]}),value:e.id}})):[]),value:0,onSelect:function(t){S((function(n){return Object(qe.a)(n).map((function(n){var a=Object(o.a)({},n);return n.id==t&&(a.roomId=e),a}))}))}})]})},T=function(e,t){return Object(me.jsx)("div",{style:{paddingTop:t?"50px":"0"},children:e.map((function(e,n){return Object(me.jsxs)("div",{className:"____node",style:{background:1==e.customer.gender?"rgb(0,169,141,0.1)":"rgb(229,57,53,0.1)",borderRadius:"5px",margin:e.roomId||!p||e.price&&(4==p&&e.price.arrangementMakkahDesignation.includes("quad")||3==p&&e.price.arrangementMakkahDesignation.includes("triple")||2==p&&e.price.arrangementMakkahDesignation.includes("double"))?"5px":"0",display:"flex",alignItems:"center",position:"relative",height:e.roomId||!p||e.price&&(4==p&&e.price.arrangementMakkahDesignation.includes("quad")||3==p&&e.price.arrangementMakkahDesignation.includes("triple")||2==p&&e.price.arrangementMakkahDesignation.includes("double"))?"unset":"0",overflow:"hidden"},"data-id":e.id,children:[t&&Object(me.jsx)("button",{className:"button_icon",style:{position:"absolute",top:"10px",right:0},onClick:function(){S((function(t){return Object(qe.a)(t).map((function(t){var n=Object(o.a)({},t);return t.id==e.id&&(n.roomId=0),n}))}))},children:"-"}),e.customer.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.customer.picture,width:"43",height:"43",style:{border:"1px solid #eee",margin:"3px",borderColor:1==e.customer.gender?"rgb(0,169,141,01)":"rgb(229,57,53,01)",borderRadius:"50%"}}):Object(me.jsx)("div",{className:"non_drop",style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{className:"non_drop",style:{paddingLeft:"5px",fontSize:"12px"},children:[e?e.customer.name.toUpperCase():"",Object(me.jsx)("br",{}),Object(me.jsx)(Re.a,{size:"xs",color:1==e.customer.gender?"green":"red",children:Object(me.jsx)("b",{style:{fontSize:"11px",padding:"0 6px"},children:e?e.customer.passportNumber:""})}),Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[Object(me.jsx)(nc.c,{color:"rgb(191,155,48)",fontWeight:"lighter",size:"20px"})," ",Object(me.jsxs)("p",{children:[Object(me.jsx)("b",{children:e.price&&e.price.hotelMakkahName+" - "+e.price.hotelMadinahName})," ","(",e.price&&("Chambre quadruple"==e.price.arrangementMakkahDesignation?"Quad":"Chambre triple"==e.price.arrangementMakkahDesignation?"Triple":"Double"),")"]})]})]})]},e.id)}))})};return Object(me.jsxs)("div",{children:[Object(me.jsxs)(be.a,{m:4,l:4,xl:4,children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(n?n.map((function(e){return{label:Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),value:e.id}})):[]),block:!0,noSearch:!0,value:b.disponibilityId,onSelect:function(e){O((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}}),Object(me.jsx)("div",{style:{borderBottom:"1px solid #eee",textTransform:"uppercase",fontWeight:"lighter",color:"#232323"},className:"p-5",children:"Liste Des P\xe9l\xe9rins :"}),Object(me.jsx)("div",{style:{width:"100%",overflowY:"auto"},children:Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(me.jsx)("button",{onClick:function(){m(0)},style:{background:p?"#fff":"#232323",color:p?"#232323":"#fff",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Tout"}),Object(me.jsx)("button",{onClick:function(){m(2)},style:{background:2!=p?"#fff":"#232323",color:2==p?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Double"}),Object(me.jsx)("button",{onClick:function(){m(3)},style:{background:3!=p?"#fff":"#232323",color:3==p?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Triple"}),Object(me.jsx)("button",{onClick:function(){m(4)},style:{background:4!=p?"#fff":"#232323",color:4==p?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Quad"})]})}),Object(me.jsx)("div",{id:"__root",style:{height:"calc(100vh - 100px)",overflowY:"auto",background:"#fff",borderRadius:"5px"},children:T(E.filter((function(e){return!e.roomId})))})]}),Object(me.jsxs)(be.a,{m:8,l:8,xl:8,className:"p-5",children:[Object(me.jsx)("div",{style:{textAlign:"right",padding:"10px"},children:Object(me.jsx)(he.a,{appearance:"primary",color:"blue",onClick:function(){var e={disponibilityId:b.disponibilityId};e.rooms=l.map((function(e){var t=Object(o.a)(Object(o.a)({},e),{},{orderUmrahIds:E.filter((function(t){return t.roomId==e.id}))?E.filter((function(t){return t.roomId==e.id})).map((function(e){return e.id})).join(","):""});return delete t.id,t})),console.log(e),P?Object(pt.a)(pe.a.Rooming).update2(Object(o.a)({id:P},e)).then((function(e){return console.log(e.data)})):Object(pt.a)(pe.a.Rooming).create(e).then((function(e){return console.log(e.data)}))},children:"Enregistrer"})}),Object(me.jsxs)("div",{style:{background:"#fff",borderRadius:"10px",border:"1px solid #ddd",minHeight:"500px",maxHeight:"90vh",overflowY:"auto"},className:"p-5",children:[Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-5",children:[l.filter((function(e){return 4==e.nbr})).map((function(e){return Object(me.jsxs)("div",{style:{background:"#fff",minHeight:_.find((function(t){return t==e.id}))?"240px":"60px",maxHeight:_.find((function(t){return t==e.id}))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:E.filter((function(t){return t.roomId==e.id})).length1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?d(e.data):f(e.data)}))},se=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return y(e.data)}))},le=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data)}))},ue=function(){re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order,Object(o.a)(Object(o.a)({},G),{},{date:G.date?_e()(G.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),S(e.data.totalCount),A(e.data.totalSale),R(e.data.totalRefund),z(e.data.totalCommission)})).catch((function(e){return Q(e.Message)}))},de=[{value2:"client",value:"id",name:"Client",render:function(e,t){return Object(me.jsx)("b",{children:t?t.name.toUpperCase():""})}},{value:"customer",name:"Client B2C",render:function(e){return Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})]})}},{value:"totalPrice",value2:"currency",name:"Prix Total",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e&&e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t&&t.code})]})}},{value:"commission",value2:"currency",name:"Commission",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#2f1a4c",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t&&t.code})]})}},{value:"date",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}},{value:"note",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}}];return Object(c.useEffect)((function(){ue(),oe(),le(),se()}),[]),Object(c.useEffect)((function(){ue()}),[G.page,G.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){ue()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return oe(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:G.clientId,onSelect:function(e){V((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date du Vente: "}),Object(me.jsx)(fe.a,{type:"date",value:G.date,onChange:function(e){V((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{nameExcel:"vente",size:"lg",save:function(){console.log(te),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)(Object(o.a)({},te),{},{attachments:te.attachments?te.attachments.map((function(e){return e.name})).join():"",date:te.date?te.date:new Date});delete e.tags,e.totalPrice=(1+parseFloat(e.commissionPercent)/100)*(parseFloat(e.commission)+parseFloat(e.fare)),te.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).update(e.id,e).then((function(e){ue(),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),ie(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){Q(e.Message),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).create(e).then((function(e){ue(),ie(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){Q(e.Message),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:ie,AddComponent:Object(me.jsx)(Vc,{tags:m,fetchTags:le,providers:v,fetchProviders:se,error:X,clients:O,fetchClients:function(e){return oe(e,!1)}})}),Object(me.jsxs)("div",{children:[Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{icon:Object(me.jsx)(ac.c,{}),notAmount:!0,text:"Nbre de Vente",color:"245,195,35",amount:E})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Vente",color:"0,169,141",amount:k})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Remboursement",amount:w,color:"229,57,53"})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Commission",amount:K})})]}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){Q(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).fetchById(e).then((function(e){if(e.data.client&&!O.find((function(t){return t.id==e.data.client.id}))){var t=Object(qe.a)(O);t.unshift({id:e.data.client.id,name:e.data.client.name}),f(t)}ne(Object(o.a)(Object(o.a)({},e.data),{},{date:e.data.date?e.data.date.substring(0,10):new Date}))})).catch((function(e){console.log(e)}))}(e),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).delete(e).then((function(e){ue(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return Q(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:de,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:E,limitOptions:[10,20,50,100],limit:G.take,activePage:G.page,onChangePage:function(e){window.scrollTo(0,0),V((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),V((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var Jc=function e(){Object(U.a)(this,e),this.date=new Date,this.customer=new rt,this.totalPrice=0,this.totalRefund=0,this.commission=0,this.fare=0,this.commissionPercent=0,this.note="",this.service=8,this.ref="",this.hotelReservation=new Xc},Xc=function e(){Object(U.a)(this,e),this.guests=[new rt],this.hotelName="",this.board="",this.checkIn=new Date,this.checkOut=new Date},Qc=Object(D.b)({key:"SaleHostingState",default:new Jc}),$c=function e(){Object(U.a)(this,e),this.date=new Date,this.customer=new rt,this.totalPrice=0,this.totalRefund=0,this.commission=0,this.fare=0,this.commissionPercent=0,this.note="",this.service=4,this.ref="",this.bus=new er},er=function e(){Object(U.a)(this,e),this.items=[new tr]},tr=function e(){Object(U.a)(this,e),this.departDate=new Date,this.arrivalDate=new Date,this.departCity="",this.arrivalCity="",this.driverName=""},nr=new D.b({default:new $c,key:"SaleBusState"}),ar={verticalAlign:"top"};var cr=function(e){var t=e.error,n=e.clients,a=e.fetchClients,r=e.providers,i=e.fetchProviders,l=e.fetchTags,u=e.tags,d=Object(c.useState)(0),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(D.c)(nr),h=Object(s.a)(f,2),p=h[0],m=h[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(Nt.a,{current:b,style:ar,children:[Object(me.jsx)(Nt.a.Item,{title:"Infos G\xe9nerales",onClick:function(){return O(0)}}),Object(me.jsx)(Nt.a.Item,{title:"D\xe9tails",onClick:function(){return O(1)}}),Object(me.jsx)(Nt.a.Item,{title:"Attachments",onClick:function(){return O(3)}})]}),Object(me.jsx)("div",{style:{padding:"40px 10px"},children:b?1==b?Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Fournisseur : "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return i(e)},data:r.map((function(e){return{label:e.name,value:e.id}})),block:!0,value:p.providerId,noSearch:!0,onSelect:function(e){r.find((function(t){return t.id==e}));m((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Prix :"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:p.fare,onChange:function(e){m((function(t){return Object(o.a)(Object(o.a)({},t),{},{fare:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:p.commission,onChange:function(e){m((function(t){return Object(o.a)(Object(o.a)({},t),{},{commission:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission ( % ):"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:p.commissionPercent,onChange:function(e){m((function(t){return Object(o.a)(Object(o.a)({},t),{},{commissionPercent:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Prix De Vente:"}),Object(me.jsx)("div",{children:Object(me.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(p.commissionPercent)/100)*(parseFloat(p.commission)+parseFloat(p.fare))).toFixed(3)})})]}),Object(me.jsx)("hr",{}),Object(me.jsx)(ir,{model:p.bus,setModel:function(e){return m((function(t){return Object(o.a)(Object(o.a)({},t),{},{bus:e})}))}})]}):Object(me.jsx)(or,{}):Object(me.jsx)(rr,{fetchClients:a,clients:n,tags:u,fetchTags:l})}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{})]})},rr=function(e){var t=e.clients,n=e.fetchClients,a=(e.tags,e.fetchTags,Object(c.useState)([])),r=Object(s.a)(a,2),i=(r[0],r[1],Object(D.c)(nr)),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(D.d)(Y);return Object(c.useEffect)((function(){j&&j.length&&!u.currencyId&&d((function(e){return Object(o.a)(Object(o.a)({},u),{},{currencyId:j[0].id})}))}),[u.clientId]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:[{label:"Tout",value:0}].concat(t.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:u.clientId,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}}),Object(me.jsx)("label",{children:"Date De vente: "}),Object(me.jsx)(fe.a,{type:"date",value:u.date,defaultValue:u.date,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}}),Object(me.jsx)("label",{children:"Devise: "}),Object(me.jsx)(Ze.a,{data:j.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:u.currencyId,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{currencyId:e})}))}})]})},ir=function(e){var t=e.model,n=void 0===t?new er:t,a=e.setModel;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("h5",{children:"Liste Des Voyages"}),n.items.map((function(e,t){return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:3.8,xl:3.8,className:"p-5",children:[Object(me.jsx)("label",{children:"Nom Du chauffeur:"}),Object(me.jsx)(fe.a,{value:n.items[t].driverName,onChange:function(e){var c=Object(qe.a)(n.items),r=Object(o.a)({},c[t]);r.driverName=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{items:c}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(me.jsx)("label",{children:"Date De Depart:"}),Object(me.jsx)(fe.a,{type:"datetime-local",value:n.items[t].departDate,onChange:function(e){var c=Object(qe.a)(n.items),r=Object(o.a)({},c[t]);r.departDate=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{items:c}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(me.jsx)("label",{children:"Date De Retour:"}),Object(me.jsx)(fe.a,{type:"datetime-local",value:n.items[t].arrivalDate,onChange:function(e){var c=Object(qe.a)(n.items),r=Object(o.a)({},c[t]);r.arrivalDate=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{items:c}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(me.jsx)("label",{children:"Ville De Depart:"}),Object(me.jsx)(fe.a,{value:n.items[t].departCity,onChange:function(e){var c=Object(qe.a)(n.items),r=Object(o.a)({},c[t]);r.departCity=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{items:c}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(me.jsx)("label",{children:"Ville D'Arriv\xe9:"}),Object(me.jsx)(fe.a,{value:n.items[t].arrivalCity,onChange:function(e){var c=Object(qe.a)(n.items),r=Object(o.a)({},c[t]);r.arrivalCity=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{items:c}))}})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:{height:"42px"},children:" "}),t?Object(me.jsx)(Je.a,{onClick:function(){var e=Object(qe.a)(n.items);e.splice(t,1),a(Object(o.a)(Object(o.a)({},n),{},{items:e}))},color:"violet",icon:Object(me.jsx)(wt.a,{})}):"",t+1==n.items.length&&Object(me.jsx)(Je.a,{onClick:function(){var e=Object(qe.a)(n.items);e.push(new tr),a(Object(o.a)(Object(o.a)({},n),{},{items:e}))},color:"violet",icon:Object(me.jsx)(et.a,{})})]})]})}))]})},or=function(){var e=Object(D.c)(At),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)(!1),j=Object(s.a)(d,2),b=j[0],O=j[1];return Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsx)(kt.a,{loading:b,autoUpload:!1,fileList:l,action:"#",draggable:!0,onRemove:function(e){return function(e){var t=l.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(n.attachments[t].name).then((function(e){u((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var c=Object(qe.a)(n.attachments);c.splice(t),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:c})}))})).catch((function(e){}))}(e.fileKey)},onChange:function(e){console.log(e);var t=e.filter((function(e){return"finished"!=e.status})).reverse()[0];t&&function(e,t,c){O(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){O(!1);var r=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var n=Object(qe.a)(e);return n[r].status="finished",n}));var i=Object(qe.a)(n.attachments);i.push({name:t.data[0].fileName}),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:i})}))})).catch((function(t){O(!1);var n=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var a=Object(qe.a)(e);return a[n].status="error",a}))}))}(e,t.blobFile,t.fileKey)},children:Object(me.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(me.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(me.jsx)(Rt.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),b&&Object(me.jsx)(me.Fragment,{})]})};function sr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)([]),_=Object(s.a)(g,2),v=_[0],y=_[1],C=(Object(D.d)(L),Object(c.useState)(0)),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(c.useState)(0),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(c.useState)(0),T=Object(s.a)(M,2),w=T[0],R=T[1],U=Object(c.useState)(0),F=Object(s.a)(U,2),K=F[0],z=F[1],W=Object(c.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0,service:4}),Y=Object(s.a)(W,2),G=Y[0],V=Y[1],H=Object(c.useState)([]),q=Object(s.a)(H,2),Z=(q[0],q[1],Object(c.useState)("")),J=Object(s.a)(Z,2),X=J[0],Q=J[1],$=Object(D.c)(nr),ee=Object(s.a)($,2),te=ee[0],ne=ee[1],ae=Object(D.c)(ye.a),ce=Object(s.a)(ae,2),re=(ce[0],ce[1]),ie=function(){ne(new $c),Q("")},oe=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?d(e.data):f(e.data)}))},se=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return y(e.data)}))},le=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data)}))},ue=function(){re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Bus",Object(o.a)(Object(o.a)({},G),{},{date:G.date?_e()(G.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),S(e.data.totalCount),A(e.data.totalSale),R(e.data.totalRefund),z(e.data.totalCommission)})).catch((function(e){return Q(e.Message)}))},de=[{value2:"client",value:"id",name:"Client",render:function(e,t){return Object(me.jsx)("div",{children:t?t.name.toUpperCase():""})}},{value:"totalPrice",value2:"currency",name:"Prix Total",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t?t.code:""})]})}},{value:"date",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}}];return Object(c.useEffect)((function(){ue(),oe(),le(),se()}),[]),Object(c.useEffect)((function(){ue()}),[G.page,G.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){ue()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return oe(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:G.clientId,onSelect:function(e){V((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date du Vente: "}),Object(me.jsx)(fe.a,{type:"date",value:G.date,onChange:function(e){V((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{nameExcel:"sale",size:"lg",ActionOnClose:ie,save:function(){console.log(te),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},te);delete e.customer,e.totalPrice=(1+parseFloat(e.commissionPercent)/100)*(parseFloat(e.commission)+parseFloat(e.fare)),te.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).update(e.id,e).then((function(e){ue(),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),ie(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){Q(e.Message),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).create(e).then((function(e){ue(),ie(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){Q(e.Message),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(cr,{tags:m,fetchTags:le,providers:v,fetchProviders:se,error:X,clients:O,fetchClients:function(e){return oe(e,!1)}})}),Object(me.jsxs)("div",{children:[Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{icon:Object(me.jsx)(ac.c,{}),notAmount:!0,text:"Nbre de Vente",color:"245,195,35",amount:E})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Vente",color:"0,169,141",amount:k})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Remboursement",amount:w,color:"229,57,53"})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Commission",amount:K})})]}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){Q(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).fetchById(e).then((function(e){if(e.data.client&&!O.find((function(t){return t.id==e.data.client.id}))){var t=Object(qe.a)(O);t.unshift({id:e.data.client.id,name:e.data.client.name}),f(t)}ne(Object(o.a)(Object(o.a)({},e.data),{},{date:e.data.date?e.data.date.substring(0,10):new Date}))})).catch((function(e){console.log(e)}))}(e),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).delete(e).then((function(e){ue(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return Q(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:de,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:E,limitOptions:[10,20,50,100],limit:G.take,activePage:G.page,onChangePage:function(e){window.scrollTo(0,0),V((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),V((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var lr={verticalAlign:"top"};var ur=function(e){var t=e.error,n=e.clients,a=e.fetchClients,r=e.providers,i=e.fetchProviders,l=e.fetchTags,u=e.tags,d=Object(c.useState)(0),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(D.c)(Qc),h=Object(s.a)(f,2),p=h[0],m=h[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(Nt.a,{current:b,style:lr,children:[Object(me.jsx)(Nt.a.Item,{title:"Infos G\xe9nerales",onClick:function(){return O(0)}}),Object(me.jsx)(Nt.a.Item,{title:"D\xe9tails",onClick:function(){return O(1)}}),Object(me.jsx)(Nt.a.Item,{title:"Attachments",onClick:function(){return O(3)}})]}),Object(me.jsx)("div",{style:{padding:"40px 10px"},children:b?1==b?Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Fournisseur : "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return i(e)},data:r.map((function(e){return{label:e.name,value:e.id}})),block:!0,value:p.providerId,noSearch:!0,onSelect:function(e){r.find((function(t){return t.id==e}));m((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Prix :"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:p.fare,onChange:function(e){m((function(t){return Object(o.a)(Object(o.a)({},t),{},{fare:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:p.commission,onChange:function(e){m((function(t){return Object(o.a)(Object(o.a)({},t),{},{commission:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Commission ( % ):"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:p.commissionPercent,onChange:function(e){m((function(t){return Object(o.a)(Object(o.a)({},t),{},{commissionPercent:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Prix De Vente:"}),Object(me.jsx)("div",{children:Object(me.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(p.commissionPercent)/100)*(parseFloat(p.commission)+parseFloat(p.fare))).toFixed(3)})})]}),Object(me.jsx)("hr",{}),Object(me.jsx)(jr,{model:p.hotelReservation,setModel:function(e){return m((function(t){return Object(o.a)(Object(o.a)({},t),{},{hotelReservation:e})}))}})]}):Object(me.jsx)(br,{}):Object(me.jsx)(dr,{fetchClients:a,clients:n,tags:u,fetchTags:l})}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{})]})},dr=function(e){var t=e.clients,n=e.fetchClients,a=(e.tags,e.fetchTags,Object(c.useState)([])),r=Object(s.a)(a,2),i=(r[0],r[1],Object(D.c)(Qc)),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(D.d)(Y);return Object(c.useEffect)((function(){j&&j.length&&!u.currencyId&&d((function(e){return Object(o.a)(Object(o.a)({},u),{},{currencyId:j[0].id})}))}),[u.clientId]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:[{label:"Tout",value:0}].concat(t.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:u.clientId,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}}),Object(me.jsx)("label",{children:"Date De vente: "}),Object(me.jsx)(fe.a,{type:"date",value:u.date,defaultValue:u.date,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}}),Object(me.jsx)("label",{children:"Devise: "}),Object(me.jsx)(Ze.a,{data:j.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:u.currencyId,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{currencyId:e})}))}})]})},jr=function(e){var t=e.model,n=void 0===t?new Xc:t,a=e.setModel,r=Object(c.useState)({arrangement:"",room:""}),i=Object(s.a)(r,2),l=i[0],u=i[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"H\xf4tel : "}),Object(me.jsx)(fe.a,{value:n.hotelName,onChange:function(e){return a(Object(o.a)(Object(o.a)({},n),{},{hotelName:e}))}})]})," ",Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"R\xe9ference : "}),Object(me.jsx)(fe.a,{value:n.ref,onChange:function(e){return a(Object(o.a)(Object(o.a)({},n),{},{ref:e}))}})]}),Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Type du Chambre: "}),Object(me.jsx)(Ze.a,{data:Fe.t,block:!0,noSearch:!0,value:l.room,onChange:function(e){var t=e+" "+l.arrangement;u((function(t){return Object(o.a)(Object(o.a)({},t),{},{room:e})})),a(Object(o.a)(Object(o.a)({},n),{},{board:t}))}})]}),Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Arrangement : "}),"!",Object(me.jsx)(Ze.a,{data:Mt.map((function(e){return{label:e.name_fr,value:e.name_fr}})),block:!0,noSearch:!0,value:l.arrangement,onChange:function(e){var t=l.room+" "+e;u((function(t){return Object(o.a)(Object(o.a)({},t),{},{arrangement:e})})),a(Object(o.a)(Object(o.a)({},n),{},{board:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date D'arriv\xe9:"}),Object(me.jsx)(fe.a,{type:"date",value:n.checkIn,onChange:function(e){return a(Object(o.a)(Object(o.a)({},n),{},{checkIn:e}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date De Depart:"}),Object(me.jsx)(fe.a,{type:"date",value:n.checkOut,onChange:function(e){return a(Object(o.a)(Object(o.a)({},n),{},{checkOut:e}))}})]}),Object(me.jsx)("h5",{children:"Liste Des R\xe9sidents"}),n.guests&&n.guests.map((function(e,t){return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Complet:"}),Object(me.jsx)(fe.a,{value:n.guests[t].name,onChange:function(e){var c=Object(qe.a)(n.guests),r=Object(o.a)({},c[t]);r.name=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{guests:c}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Type : "}),Object(me.jsx)(Ze.a,{data:Fe.a,block:!0,noSearch:!0,value:n.guests[t].ageType,onChange:function(e){var c=Object(qe.a)(n.guests),r=Object(o.a)({},c[t]);r.ageType=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{guests:c}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Genre : "}),Object(me.jsx)(Ze.a,{data:Fe.h,block:!0,noSearch:!0,value:n.guests[t].gender,onChange:function(e){var c=Object(qe.a)(n.guests),r=Object(o.a)({},c[t]);r.gender=e,c[t]=r,a(Object(o.a)(Object(o.a)({},n),{},{guests:c}))}})]}),Object(me.jsxs)(be.a,{s:2,m:1.6,l:1,xl:1,children:[Object(me.jsx)("div",{style:{height:"42px"},children:" "}),t?Object(me.jsx)(Je.a,{onClick:function(){var e=Object(qe.a)(n.guests);e.splice(t,1),a(Object(o.a)(Object(o.a)({},n),{},{guests:e}))},color:"violet",icon:Object(me.jsx)(wt.a,{})}):"",t+1==n.guests.length&&Object(me.jsx)(Je.a,{onClick:function(){var e=Object(qe.a)(n.guests);e.push(new rt),a(Object(o.a)(Object(o.a)({},n),{},{guests:e}))},color:"violet",icon:Object(me.jsx)(et.a,{})})]})]})}))]})},br=function(){var e=Object(D.c)(At),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)(!1),j=Object(s.a)(d,2),b=j[0],O=j[1];return Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsx)(kt.a,{loading:b,autoUpload:!1,fileList:l,action:"#",draggable:!0,onRemove:function(e){return function(e){var t=l.findIndex((function(t){return t.fileKey==e}));B.a.createAPIEndpoint(B.a.ENDPOINTS.File).delete(n.attachments[t].name).then((function(e){u((function(e){var n=Object(qe.a)(e);return n.splice(t),n}));var c=Object(qe.a)(n.attachments);c.splice(t),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:c})}))})).catch((function(e){}))}(e.fileKey)},onChange:function(e){console.log(e);var t=e.filter((function(e){return"finished"!=e.status})).reverse()[0];t&&function(e,t,c){O(!0),B.a.createAPIEndpoint(B.a.ENDPOINTS.File).upload(t).then((function(t){O(!1);var r=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var n=Object(qe.a)(e);return n[r].status="finished",n}));var i=Object(qe.a)(n.attachments);i.push({name:t.data[0].fileName}),a((function(e){return Object(o.a)(Object(o.a)({},n),{},{attachments:i})}))})).catch((function(t){O(!1);var n=e.findIndex((function(e){return e.fileKey==c}));u((function(t){var a=Object(qe.a)(e);return a[n].status="error",a}))}))}(e,t.blobFile,t.fileKey)},children:Object(me.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(me.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(me.jsx)(Rt.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),b&&Object(me.jsx)(me.Fragment,{})]})};function Or(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)([]),_=Object(s.a)(g,2),v=_[0],y=_[1],C=(Object(D.d)(L),Object(c.useState)(0)),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(c.useState)(0),P=Object(s.a)(N,2),k=P[0],A=P[1],M=Object(c.useState)(0),T=Object(s.a)(M,2),w=T[0],R=T[1],U=Object(c.useState)(0),F=Object(s.a)(U,2),K=F[0],z=F[1],W=Object(c.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),Y=Object(s.a)(W,2),G=Y[0],V=Y[1],H=Object(c.useState)([]),q=Object(s.a)(H,2),Z=(q[0],q[1],Object(c.useState)("")),J=Object(s.a)(Z,2),X=J[0],Q=J[1],$=Object(D.c)(Qc),ee=Object(s.a)($,2),te=ee[0],ne=ee[1],ae=Object(D.c)(ye.a),ce=Object(s.a)(ae,2),re=(ce[0],ce[1]),ie=function(){ne(new Jc),Q("")},oe=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?d(e.data):f(e.data)}))},se=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return y(e.data)}))},le=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((function(e){return x(e.data)}))},ue=function(){re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Hosting",Object(o.a)(Object(o.a)({},G),{},{date:G.date?_e()(G.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),S(e.data.totalCount),A(e.data.totalSale),R(e.data.totalRefund),z(e.data.totalCommission)})).catch((function(e){return Q(e.Message)}))},de=[{value:"ref",name:"R\xe9f\xe9rence",render:function(e){return Object(me.jsxs)("a",{href:"#",children:[" ",e]})}},{value2:"client",value:"id",name:"Client",render:function(e,t){return Object(me.jsx)("div",{children:t?t.name.toUpperCase():""})}},{value:"customer",name:"R\xe9sident",render:function(e){return Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})]})}},{value:"totalPrice",value2:"currency",name:"Prix Total",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t?t.code:""})]})}},{value:"date",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}},{value:"hotelReservation",name:"D\xe9tails",render:function(e){return Object(me.jsxs)("strong",{children:[Object(me.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[Object(me.jsx)(ac.c,{color:"#aaa"}),Object(me.jsxs)("span",{style:{marginLeft:"5px"},children:[" ",e?e.hotelName.toUpperCase():""]})]}),Object(me.jsx)("i",{style:{color:"#4667d1"},children:e?e.board:""})]})}},{value:"hotelReservation",name:"Nbre Nuit\xe9es",render:function(e){return Object(me.jsxs)("strong",{children:[Object(me.jsxs)("span",{style:{display:"",alignItems:"center"},children:["de "," ",Object(me.jsx)("i",{children:_e()(e.checkIn).format("DD MMM YYYY")})," "," \xe0 ",Object(me.jsx)("i",{children:_e()(e.checkOut).format("DD MMM YYYY")})]}),Object(me.jsx)("br",{}),Object(me.jsxs)(Re.a,{color:"orange",children:[Object(me.jsx)(ac.a,{color:"#fff"}),Object(me.jsxs)("span",{style:{marginLeft:"5px"},children:[_e()(e.checkOut).diff(_e()(e.checkIn),"days")," nuit\xe9e",_e()(e.checkOut).diff(_e()(e.checkIn),"days")>1?"s":""]})]})]})}},{value:"status",name:"Status",render:function(e){return Object(me.jsx)(Re.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:Fe.j.find((function(t){return t.value==e}))&&Fe.j.find((function(t){return t.value==e})).label})}}];return Object(c.useEffect)((function(){ue(),oe(),le(),se()}),[]),Object(c.useEffect)((function(){ue()}),[G.page,G.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){ue()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return oe(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:G.clientId,onSelect:function(e){V((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date du Vente: "}),Object(me.jsx)(fe.a,{type:"date",value:G.date,onChange:function(e){V((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{nameExcel:"sale",size:"lg",save:function(){console.log(te),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},te);e.customer=e.hotelReservation.guests[0],e.totalPrice=(1+parseFloat(e.commissionPercent)/100)*(parseFloat(e.commission)+parseFloat(e.fare)),te.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Hosting").update(e.id,e).then((function(e){ue(),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),ie(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){Q(e.Message),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Hosting").create(e).then((function(e){ue(),ie(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){Q(e.Message),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},ActionOnClose:ie,AddComponent:Object(me.jsx)(ur,{tags:m,fetchTags:le,providers:v,fetchProviders:se,error:X,clients:O,fetchClients:function(e){return oe(e,!1)}})}),Object(me.jsxs)("div",{children:[Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{icon:Object(me.jsx)(ac.c,{}),notAmount:!0,text:"Nbre de Vente",color:"245,195,35",amount:E})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Vente",color:"0,169,141",amount:k})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Remboursement",amount:w,color:"229,57,53"})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Commission",amount:K})})]}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){Q(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).fetchById(e).then((function(e){if(e.data.client&&!O.find((function(t){return t.id==e.data.client.id}))){var t=Object(qe.a)(O);t.unshift({id:e.data.client.id,name:e.data.client.name}),f(t)}ne(Object(o.a)(Object(o.a)({},e.data),{},{date:e.data.date?e.data.date.substring(0,10):new Date}))})).catch((function(e){console.log(e)}))}(e),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Hosting").delete(e).then((function(e){ue(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return Q(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:de,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:E,limitOptions:[10,20,50,100],limit:G.take,activePage:G.page,onChangePage:function(e){window.scrollTo(0,0),V((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),V((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var fr=n(537),hr=Object(D.b)({key:"SaleVoState",default:new ct}),pr=function e(){Object(U.a)(this,e),this.customer=new rt,this.withoutVisa=!1,this.onlyTicket=!1},mr=Object(D.b)({key:"SaleUmrahAtom",default:new pr}),xr=n(785),gr=n.n(xr),_r={verticalAlign:"top"};var vr=function(e){var t=e.error,n=e.clients,a=e.fetchClients,r=e.providers,i=e.fetchProviders,l=e.vols,u=void 0===l?[]:l,d=e.packs,j=void 0===d?[]:d,b=Object(c.useState)(0),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)(null),m=Object(s.a)(p,2),x=(m[0],m[1]),g=Object(D.c)(mr),_=Object(s.a)(g,2),v=_[0],C=_[1],I=Object(c.useState)(!1),E=Object(s.a)(I,2),S=E[0],N=E[1],P=Object(c.useState)(null),k=Object(s.a)(P,2),A=k[0],M=k[1],T=Object(c.useState)(""),w=Object(s.a)(T,2),R=w[0],U=w[1];Object(c.useEffect)((function(){console.log(v),x(v.package)}),[v.id]);var L=function(){var e=Object(hn.a)(fn.a.mark((function e(t){var n,a,c,r,i;return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target.files,N(!0),a=n[0],M(a),(c=new FormData).append("File",a,a.name),r="",e.next=9,B.a.createAPIEndpoint(B.a.ENDPOINTS.File+"/Passport").upload1(a);case 9:i=e.sent,console.log(r),i&&(r=i.data,C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:Object(o.a)(Object(o.a)({},e.customer),{},{passportPicture:r})})}))),y.a.post("https://scan.kounouz.travel/api/Scan/",c,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){C((function(t){var n=Object(o.a)(Object(o.a)({},v.customer),{},{passportPicture:r});n.birthDate=e.data.birthDate,n.passportNumber=e.data.passportNumber;var a=vn.find((function(t){return t.alpha3==e.data.nationalityCountryId||"TN"==t.iso}));a&&(console.log(a),n.nationality=a.code,n.addressCountry=a.code,n.birthCountry=a.code,n.passportDeliveryCountry=a.code,n.birthCity=a.country,n.city=a.country,n.passportDeliveryCity=a.country),n.mrz=e.data.mrz,n.expirationPassportDate=e.data.passportExpiryDate,n.lastNameAr=e.data.arlastName,n.firstNameAr=e.data.arfirstName,n.lastName=e.data.lastName,n.firstName=e.data.firstName?e.data.firstName.replace(e.data.lastName,""):"",n.name=e.data.firstName!==e.data.lastName?e.data.firstName+" "+e.data.lastName:e.data.firstName,n.gender=e.data.gender,n.title=e.data.gender,n.picture=e.data.pilgrimPicture,n.job="nothing",n.status=2;try{var c=gr.a.parse(e.data.mrz);n.cin=c.personalNumber.split(" ")[0],console.log(c);var i=new Date(e.data.passportExpiryDate),s=Date.parse(i);if(!isNaN(s)){var l=new Date(s),u=new Date;u.setDate(u.getDate()+15),u.setMonth(u.getMonth()+6),lnew Date?U("Probleme de date d'expiration"):U("")}i.setFullYear(i.getFullYear()-5),n.deliveryPassportDate=i,console.log(_e()(n.deliveryPassportDate)),n.deliveryPassportDate=_e()(n.deliveryPassportDate).add(1,"days").format("YYYY-MM-DD")}catch(d){}return Object(o.a)(Object(o.a)({},t),{},{customer:n})})),N(!1)})).catch((function(e){return N(!1)}));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(Nt.a,{current:f,style:_r,children:[Object(me.jsx)(Nt.a.Item,{title:"Infos G\xe9nerales",onClick:function(){return h(0)}}),Object(me.jsx)(Nt.a.Item,{title:"P\xe9lerin",onClick:function(){return h(1)}})]}),Object(me.jsx)("div",{style:{padding:"40px 10px"},children:f?1==f?Object(me.jsxs)(me.Fragment,{children:[R&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:R}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsxs)("div",{style:{textAlign:"right"},children:[" ",Object(me.jsx)("input",{id:"hidden3",style:{visibility:"hidden",width:"0",height:0,overflow:"hidden"},type:"file",onChange:L,accept:".jpg,.jpeg,.png"}),Object(me.jsx)(Je.a,{loading:S,icon:Object(me.jsx)(nc.b,{}),onClick:function(){var e=document.querySelector("input#hidden3");console.log(e),e.click()},color:"green",appearance:"primary"}),Object(me.jsx)("br",{}),Object(me.jsxs)("div",{style:{width:"170px",heigth:"90px",display:"inline-block"},children:[" ",(A||v.customer&&v.customer.passportNumber)&&Object(me.jsx)(kt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.File+"/Passport").upload1(e[e.length-1].blobFile).then((function(e){return C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{passportPicture:e.data})})}))})),Object(fr.a)(e[e.length-1].blobFile,(function(e){}))},children:Object(me.jsxs)("div",{style:{textAlign:"center",width:"170px",heigth:"90px",display:"inline-block",marginTop:"5px"},children:[" ",v.customer.passportPicture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/"+v.customer.passportPicture+"?"+Date.now(),width:"170",height:"90",style:{border:"1px dashed #888",borderRadius:"5px"}}):Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(me.jsx)(mn.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Passport"})]})," "]})}),v.customer.passportPicture?Object(me.jsxs)("a",{download:v.customer.passportPicture,target:"_blank",href:Te.d+"Uploads/"+v.customer.passportPicture+"?t="+Date.now(),children:["t\xe9l\xe9charger ",v.customer.passportPicture]}):""]})]}),Object(me.jsx)("div",{style:{textAlign:"center"},children:Object(me.jsx)(kt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.File+"/Customer").upload1(e[e.length-1].blobFile).then((function(e){return C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{picture:e.data})})}))}))},children:Object(me.jsx)("div",{style:{background:"rgba(200,200,200,0.1)",width:"130px",height:"150px",padding:"0",display:"inline-block",borderRadius:"10px",cursor:"pointer"},children:v.customer&&v.customer.picture?Object(me.jsx)("img",{width:"130",height:"150",src:v.customer.picture.includes("base64")?v.customer.picture:Te.d+"Uploads/CustomerPictures/"+v.customer.picture+"?"+Date.now(),style:{borderRadius:"10px"},alt:""}):Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(me.jsx)(mn.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Image"})]})})})}),Object(me.jsx)("label",{children:"Type : "}),Object(me.jsx)(Ze.a,{data:Fe.g,block:!0,noSearch:!0,value:v.customer.customerType,onSelect:function(e){C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{customerType:e})})}))}})," ",Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Arabe:"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)({},v.customer);t.lastNameAr=e,C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.lastNameAr})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Pr\xe9nom Arabe:"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)({},v.customer);t.firstNameAr=e,C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.firstNameAr})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom :"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{lastName:e});t.name=t.firstName+" "+e,C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.lastName})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Pr\xe9nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{firstName:e});t.name=e+" "+t.lastName,C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.firstName})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Du P\xe9re :"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{fatherName:e});C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.fatherName})]}),Object(me.jsxs)(be.a,{l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"CIN:"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{cin:e});C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.cin})]}),Object(me.jsxs)(be.a,{m:3,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"T\xe9l:"}),Object(me.jsx)(fe.a,{type:"phone",value:v.customer.phoneNumber,onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{phoneNumber:e});C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{m:3,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Email:"}),Object(me.jsx)(fe.a,{type:"email",value:v.customer.email,onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{email:e});C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:3,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Type : "}),Object(me.jsx)(Ze.a,{data:Fe.k,block:!0,noSearch:!0,value:v.customer.title,onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{title:e});C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:3,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Genre : "}),Object(me.jsx)(Ze.a,{data:Fe.h,block:!0,noSearch:!0,value:v.customer.gender,onChange:function(e){var t=Object(o.a)({},v.customer);t.gender=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Lieu De Naissance:"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)(Object(o.a)({},v.customer),{},{birthCity:e});C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.birthCity})]}),Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Pays De Naissance : "}),Object(me.jsx)(Ze.a,{data:vn.map((function(e){return{label:e.country,value:e.code}})),block:!0,noSearch:!0,value:v.customer.birthCountry,onChange:function(e){var t=Object(o.a)({},v.customer);t.birthCountry=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Date de naissance :"}),Object(me.jsx)(fe.a,{type:"date",value:"string"==typeof v.customer.birthDate?v.customer.birthDate.substring(0,10):v.customer.birthDate,onChange:function(e){var t=Object(o.a)({},v.customer);t.birthDate=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Lieu De R\xe9sidance:"}),Object(me.jsx)(fe.a,{onChange:function(e){var t=Object(o.a)({},v.customer);t.city=e,C((function(e){return Object(o.a)(Object(o.a)({},e),{},{customer:t})}))},value:v.customer.city})]})," ",Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Pays De Sejour: "}),Object(me.jsx)(Ze.a,{data:vn.map((function(e){return{label:e.country,value:e.code}})),block:!0,noSearch:!0,value:v.customer.addressCountry,onChange:function(e){var t=Object(o.a)({},v.customer);t.addressCountry=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Nationalit\xe9: "}),Object(me.jsx)(Ze.a,{data:vn.map((function(e){return{label:e.country,value:e.code}})),block:!0,noSearch:!0,value:v.customer.nationality,onChange:function(e){var t=Object(o.a)({},v.customer);t.nationality=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsx)("hr",{}),Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Passport:"}),Object(me.jsx)(fe.a,{onChange:function(e){C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{passportNumber:e})})}))},value:v.customer.passportNumber})]})," ",Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Pays D'Issuance : "}),Object(me.jsx)(Ze.a,{data:vn.map((function(e){return{label:e.country,value:e.code}})),block:!0,noSearch:!0,value:v.customer.passportDeliveryCountry,onChange:function(e){var t=Object(o.a)({},v.customer);t.passportDeliveryCountry=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Ville D'Issuance :"}),Object(me.jsx)(fe.a,{onChange:function(e){C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{passportDeliveryCity:e})})}))},block:!0,value:v.customer.passportDeliveryCity})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Date D'Issuance :"}),Object(me.jsx)(fe.a,{type:"date",onChange:function(e){C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{deliveryPassportDate:e})})}))},block:!0,value:"string"==typeof v.customer.deliveryPassportDate?v.customer.deliveryPassportDate.substring(0,10):v.customer.deliveryPassportDate})]}),Object(me.jsxs)(be.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{style:{color:R?"red":""},children:"Date d'expiration :"}),Object(me.jsx)(fe.a,{type:"date",value:"string"==typeof v.customer.expirationPassportDate?v.customer.expirationPassportDate.substring(0,10):v.customer.expirationPassportDate,onChange:function(e){var t=Object(o.a)({},v.customer);t.expirationPassportDate=e,t.deliveryPassportDate=v.customer.expirationPassportDate.substring(0,10);try{var n=new Date(e),a=Date.parse(n);if(!isNaN(a)){var c=new Date(a),r=new Date;r.setDate(r.getDate()+15),r.setMonth(r.getMonth()+6),cnew Date?U("Probleme de date d'expiration"):U("")}n.setFullYear(n.getFullYear()-5),t.deliveryPassportDate=n,t.deliveryPassportDate=_e()(t.deliveryPassportDate).add(1,"days").format("YYYY-MM-DD")}catch(i){}C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsx)("label",{children:"MRZ"}),Object(me.jsx)(fe.a,{as:"textarea",rows:3,onChange:function(e){C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{mrz:e})})}))},value:v.customer.mrz}),Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Status : "}),Object(me.jsx)(Ze.a,{data:Fe.i,noSearch:!0,block:!0,value:v.customer.status,onChange:function(e){var t=Object(o.a)({},v.customer);t.status=e,C(Object(o.a)(Object(o.a)({},v),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"M\xe9tier:"}),Object(me.jsx)(fe.a,{onChange:function(e){C((function(t){return Object(o.a)(Object(o.a)({},t),{},{customer:Object(o.a)(Object(o.a)({},t.customer),{},{job:e})})}))},value:v.customer.job})]})]}):Object(me.jsx)(Cr,{providers:r,fetchProviders:i}):Object(me.jsx)(yr,{fetchClients:a,clients:n,packs:j,vols:u})}),Object(me.jsx)("br",{}),Object(me.jsx)(Pt.a,{})]})},yr=function(e){var t=e.clients,n=e.fetchClients,a=e.packs,r=e.vols,i=Object(D.c)(mr),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1];return Object(c.useEffect)((function(){var e=a.find((function(e){return u.packageUmrahId===e.id}));e&&f(e)}),[u.id]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:[{label:"Tout",value:0}].concat(t.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:u.clientId,onSelect:function(e){d((function(n){return Object(o.a)(Object(o.a)({},n),{},{clientId:e,client:t.find((function(t){return t.id==e}))})}))}}),Object(me.jsx)("label",{children:"Vols : "}),Object(me.jsx)(Ze.a,{data:r.map((function(e,t){return{label:Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",background:t%2?"rgb(70,103,209,0.2)":"",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsxs)("div",{style:{color:"#232323"},children:[_e()(e.date).format("DD MMM YYYY")," ",_e()(e.date).format("DD MMM YYYY")," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:a&&a.find((function(t){return t.id==e.packageUmrahId}))&&a.find((function(t){return t.id==e.packageUmrahId})).name})," ",")"]}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}),value:e.id}})),block:!0,noSearch:!0,value:u.disponibilityId,onSelect:function(e){var t=a.find((function(t){return t.disponibilities.find((function(t){return t.id==e}))}));f(t),d((function(n){return Object(o.a)(Object(o.a)({},n),{},{disponibilityId:e,packageUmrahId:t.id})}))}})," ",O&&Object(me.jsx)(me.Fragment,{children:Object(me.jsx)(ic,{pack:O,visa:O.packageUmrahCosts?O.packageUmrahCosts.find((function(e){return e.designation.toUpperCase().includes("VISA")})).cost*O.packageUmrahCosts.find((function(e){return e.designation.toUpperCase().includes("VISA")})).exchange:0,prices:O.prices?O.prices.filter((function(e){return!e.isHidden})).map((function(e){var t=r.find((function(e){return e.id==u.disponibilityId})),n=0;return t&&(n=t.commission+t.b2Bcommission-(O.commission+O.b2Bcommission)),Object(o.a)(Object(o.a)({},e),{},{price:e.price+n})})):[],model:u,_setmodel:d})}),Object(me.jsx)("br",{}),Object(me.jsx)("label",{children:"Date De vente: "}),Object(me.jsx)(fe.a,{type:"date",value:u.date,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}}),Object(me.jsx)("br",{}),Object(me.jsxs)("label",{children:["N'est pas confirm\xe9:"," ",Object(me.jsx)("input",{type:"checkbox",onChange:function(e){d((function(e){return Object(o.a)(Object(o.a)({},e),{},{confirmationStatus:2==e.confirmationStatus?1:2})}))},checked:2==u.confirmationStatus})]}),Object(me.jsx)("br",{}),Object(me.jsx)("label",{children:"Note: "}),Object(me.jsx)(fe.a,{as:"textarea",value:u.note,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{note:e})}))}}),Object(me.jsx)("br",{}),Object(me.jsxs)("label",{children:["empreinte digitale ",Object(me.jsx)("br",{})," ",Object(me.jsx)("input",{type:"checkbox",onChange:function(e){d((function(e){return Object(o.a)(Object(o.a)({},e),{},{fingerprint:!e.fingerprint})}))},checked:u.fingerprint})]})]})},Cr=function(e){var t=e.providers,n=e.fetchProviders,a=Object(c.useState)(Fe.u),r=Object(s.a)(a,2),i=(r[0],r[1],Object(D.c)(hr)),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)(new ct),O=Object(s.a)(j,2),f=O[0],h=O[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Fournisseur : "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:t.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:f.providerId,onSelect:function(e){var n=t.find((function(t){return t.id==e}));console.log(n),h((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Cout Unitaire:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:f.unitCost,onChange:function(e){h((function(t){return Object(o.a)(Object(o.a)({},t),{},{unitCost:parseInt(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Frais de service:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:f.unitFee,onChange:function(e){h((function(t){return Object(o.a)(Object(o.a)({},t),{},{unitFee:parseInt(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Prix Total:"}),Object(me.jsxs)("div",{children:[" ",Object(me.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:(Number(f.unitFee)+Number(f.unitCost)).toFixed(3)})]})]}),Object(me.jsx)("hr",{}),Object(me.jsx)("label",{children:"D\xe9signation:"}),Object(me.jsx)(fe.a,{as:"textarea",rows:2,placeholder:"Notes",value:f.note,onChange:function(e){h((function(t){return Object(o.a)(Object(o.a)({},t),{},{note:e})}))}}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsx)(Je.a,{onClick:function(){d((function(e){console.log(e);var t=Object(o.a)({},e);if("object"!=typeof t.extrats&&(t.extrats=[]),"number"==typeof f.index){var n=Object(qe.a)(t.extrats);n[f.index]=f,t=Object(o.a)(Object(o.a)({},t),{},{extrats:n})}else{var a=Object(qe.a)(t.extrats);a.push(f),t=Object(o.a)(Object(o.a)({},t),{},{extrats:a})}return t})),h(new ea)},color:"violet",icon:Object(me.jsx)(b.a,{}),children:"Ajouter"})}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)(Ee.a,{editAction:function(e){h(Object(o.a)(Object(o.a)({},u.extrats[e]),{},{index:e}))},deleteAction:function(e){d((function(t){var n=Object(o.a)({},t),a=Object(qe.a)(n.extrats);return a.splice(e,1),n=Object(o.a)(Object(o.a)({},n),{},{extrats:a})}))},actionKey:"index",noAdvancedActions:!0,columns:Ir(t),rows:u.extrats.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{index:t})}))})]})},Ir=function(e){return[{value:"note",name:"Nom ",render:function(e){return Object(me.jsx)("b",{children:Object(me.jsx)("i",{children:e})})}}]},Er=function(e){if(e&&e.length)return[{columns:[{title:"P\xe9l\xe9rin",width:{wpx:200}},{title:"Num\xe9ro de passeport",width:{wpx:120}},{title:"Voyage",width:{wpx:120}},{title:"Vol",width:{wpx:120}},{title:"Client B2B",width:{wpx:120}},{title:"Arrangement",width:{wpx:130}},{title:"Hotel Makkah",width:{wpx:150}},{title:"Hotel Madinah",width:{wpx:150}},{title:"Status",width:{wpx:160}},{title:"Prix total",width:{wpx:100}}],data:e.map((function(e){return[{value:e.customer.name,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"12",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.customer.passportNumber,style:{alignment:{horizontal:"center"}}},{value:e.packageUmrah?e.packageUmrah.name:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.disponibility?_e()(e.disponibility.date).format("DD MMM")+(e.disponibility.airline?e.disponibility.airline.name:""):"-",style:{font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.client?e.client.name:"-",style:{font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.price?e.price.arrangementMadinahDesignation:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:e.price?"Chambre triple"==e.price.arrangementMadinahDesignation?"2f1a4c":"Chambre double"==e.price.arrangementMadinahDesignation?"ecb61c":"5a2c3e":"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.price?e.price.hotelMakkahName:"-",style:{font:{sz:"13",color:{rgb:"777777"}},alignment:{horizontal:"center"}}},{value:e.price?e.price.hotelMadinahName:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"888888"}},alignment:{horizontal:"center"}}},{value:Fe.f.find((function(t){return null===e.confirmationStatus||t.value===e.confirmationStatus}))?Fe.f.find((function(t){return null===e.confirmationStatus||t.value===e.confirmationStatus})).label:Fe.f.find((function(e){return 1===e.value})).label,style:{font:{sz:"13",color:{rgb:2===e.confirmationStatus?"663399":3==e.confirmationStatus?"0b9666":4==e.confirmationStatus?"b61955":"e68019"}},alignment:{horizontal:"center"}}},{value:Object(st.a)(e.totalPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}}]}))}]},Sr=n(129);function Dr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=(p[1],Object(c.useState)([])),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)([]),C=Object(s.a)(y,2),I=C[0],E=C[1],S=Object(c.useState)(null),N=Object(s.a)(S,2),P=N[0],k=N[1],A=Object(c.useState)([]),M=Object(s.a)(A,2),T=M[0],w=M[1],R=(Object(D.d)(L),Object(D.c)(de)),U=Object(s.a)(R,2),F=U[0],K=(U[1],Object(c.useState)([])),z=Object(s.a)(K,2),W=z[0],Y=z[1],G=Object(c.useState)({disponibilityId:null,orders:[]}),V=Object(s.a)(G,2),H=V[0],q=V[1],Z=Object(c.useState)(0),J=Object(s.a)(Z,2),X=J[0],Q=J[1],$=Object(c.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),ee=Object(s.a)($,2),te=ee[0],ne=ee[1],ae=Object(c.useState)(""),ce=Object(s.a)(ae,2),re=ce[0],ie=ce[1],oe=Object(D.c)(mr),se=Object(s.a)(oe,2),le=se[0],ue=se[1],je=Object(D.c)(ye.a),Oe=Object(s.a)(je,2),xe=(Oe[0],Oe[1]),ge=function(){ue(new pr),ie("")},Se=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?d(e.data):f(e.data)}))},De=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return w(e.data)}))},Ne=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){v(e.data);var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities.map((function(e){return Object(o.a)({packageUmrahId:t.id},e)})))}),[]);console.log(t),E(t.filter((function(e){return e.onStock})))}))},Pe=function(){xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah",Object(o.a)(Object(o.a)({},te),{},{date:te.date?_e()(te.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),Q(e.data.totalCount)})).catch((function(e){ie(e.Message),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};Object(c.useEffect)((function(){Se(),De(),Ne()}),[]),Object(c.useEffect)((function(){Pe()}),[te.page,te.take]);var ke=[{value:"id",name:" ",render:function(e){return Object(me.jsx)("b",{style:{color:"green",display:"flex",alignItems:"center"},children:Object(me.jsx)(en.a,{onChange:function(t){W.find((function(t){return t==e}))?Y((function(t){return t.filter((function(t){return t!=e}))})):Y((function(t){return[].concat(Object(qe.a)(t),[e])}))},checked:null!=W.find((function(t){return t==e}))})})}},{value:"packageUmrah",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Voyage",render:function(e,t,n,a){return Object(me.jsxs)("b",{style:{color:"#549f0a"},children:[e?e.name.toUpperCase():""," ",t?Object(me.jsx)(Re.a,{color:"blue",children:"Billet"}):""," ",n?Object(me.jsx)(Re.a,{color:"orange",children:"Sans Visa"}):"",a?Object(me.jsx)(Re.a,{color:"violet",children:"Sans Billet"}):""]})}},{value:"groupId",name:"Groupe",render:function(e){return Object(me.jsx)("a",{children:Object(me.jsx)("b",{children:e&&F&&F.find((function(t){return t.id==e}))?F.find((function(t){return t.id==e})).name:""})})}},{value:"disponibility",name:"Vol",render:function(e){return e?Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(me.jsx)("b",{children:"-"})}},{value:"confirmationStatus",name:"Etat",render:function(e){return Object(me.jsx)(Re.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:Fe.f.find((function(t){return null===e||t.value===e}))?Fe.f.find((function(t){return null===e||t.value===e})).label:Fe.f.find((function(e){return 1===e.value})).label})}},{value:"fingerprint",name:"Empreinte",render:function(e){return e?Object(me.jsx)(Sr.a,{color:"green"}):Object(me.jsx)("b",{children:"-"})}},{value:"client",name:"Client B2B",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})}},{value:"customer",name:"Client B2C",render:function(e){return Object(me.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.picture+"?"+Date.now(),width:"43",height:"43",style:{border:"1px solid #eee",borderRadius:"50%",boxShadow:"-11px -5px 20px -13px rgba(0,0,0,0.75)"}}):Object(me.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{style:{padding:"0 5px"},children:[e.firstName+" "+e.lastName," ",Object(me.jsx)("b",{style:{color:"#111",fontSize:"15px"},children:e?e.passportNumber:""}),Object(me.jsx)("br",{}),Object(me.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr})]})]})}},{value:"totalPrice",name:"Prix Total",render:function(e){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e&&e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}},{value:"disponibility",value2:"onlyTicket",name:"Commission B2B",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[!t&&e&&e.b2Bcommission.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:!t&&"TND "})]})}},{value:"date",name:"Date De Vente",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}}];return Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return Pe()},children:[Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Recherche: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return Se(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:te.clientId,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Status : "}),Object(me.jsx)(Ze.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(Fe.f),block:!0,noSearch:!0,value:te.status,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{status:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{onSearch:Ne,data:_?[{label:"Tout",value:0}].concat(_.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:te.packageUmrahId,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(I?I.map((function(e){return{label:Object(me.jsxs)("div",{style:{color:"#232323"},children:[_e()(e.date).format("DD MMM YYYY")," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:_&&_.find((function(t){return t.id==e.packageUmrahId}))&&_.find((function(t){return t.id==e.packageUmrahId})).name}),")"]}),value:e.id}})):[]),block:!0,noSearch:!0,value:te.disponibilityId,onSelect:function(e){Object(pt.a)(pe.a.Disponibility).fetchById(e).then((function(e){console.log(e.data),k(e.data)})),ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})]})]}),Object(me.jsx)(Ce.a,{excelData:Er(a),ActionOnClose:ge,nameExcel:"saleUmrah",size:"lg",save:function(){console.log(le),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},le);delete e.client,delete e.disponibility,delete e.packageUmrah,delete e.price,e.id?(ie(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah").update2(e).then((function(e){Pe(),ge(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){e.response&&(ie(e.response.data),Le.a.fire({position:"top-center",icon:"warning",title:e.response.data,showConfirmButton:!1,timer:1500})),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))):(ie(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah").create(e).then((function(e){Pe(),ge(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){e.response&&(ie(e.response.data),Le.a.fire({position:"top-center",icon:"warning",title:e.response.data,showConfirmButton:!1,timer:1500})),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(vr,{tags:m,providers:T,fetchProviders:De,error:re,clients:O,fetchClients:function(e){return Se(e,!1)},vols:I,packs:_})})," ",Object(me.jsxs)("div",{onClick:function(e){return Y((function(e){return e.length?[]:a.map((function(e){return e.id}))}))},style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(me.jsx)(en.a,{checked:W.length>0})," S\xe9lectionner Tout"]}),Object(me.jsxs)("div",{className:"p-10",children:[Object(me.jsx)(be.a,{s:6,m:6,l:4,xl:3,children:Object(me.jsx)(Ze.a,{data:[{label:"Selectionner",value:0}].concat(I.map((function(e){return{label:Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}),value:e.id}}))),block:!0,noSearch:!0,value:H.disponibilityId,onSelect:function(e){q((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})})," ",Object(me.jsx)(he.a,{appearance:"primary",color:"blue",onClick:function(){console.log(W),B.a.createAPIEndpoint(pe.a.Order+"/changeDisponibility").create(Object(o.a)(Object(o.a)({},H),{},{orders:W})).then((function(e){Pe(),alert("success")}))},children:"changer"})]}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){ie(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah").fetchById(e).then((function(e){if(e.data.client&&!O.find((function(t){return t.id==e.data.client.id}))){var t=Object(qe.a)(O);t.unshift({id:e.data.client.id,name:e.data.client.name}),f(t)}ue((function(t){var n=Object(o.a)({},e.data);n.date=n.date.substring(0,10);var a=Object(o.a)({},n.customer);return Object(o.a)(Object(o.a)({},n),{},{customer:a})}))})).catch((function(e){console.log(e)}))}(e),xe((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah").delete(e).then((function(e){Pe(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return ie(e.Message)}))},actionKey:"id",actions:[{label:"Confirmer",action:function(e){B.a.createAPIEndpoint(pe.a.Order+"/Umrah/confirm/"+e,{}).customGet().then((function(e){return Pe()}))},render:function(e,t){return Object(me.jsx)("button",{style:{color:"rgb(0,169,141)",padding:"6px 10px",fontSize:"12px",background:"rgba(0,169,141,0.1)",borderRadius:"4px"},children:e})}},{label:"Refuser",action:function(e){B.a.createAPIEndpoint(pe.a.Order+"/Umrah/revoke/"+e,{}).customGet().then((function(e){return Pe()}))},render:function(e,t){return Object(me.jsx)("button",{style:{color:"rgb(229,57,53)",padding:"6px 10px",fontSize:"12px",background:"rgba(229,57,53,0.1)",borderRadius:"4px"},children:e})}},{label:"Rendre En Attente",action:function(e){B.a.createAPIEndpoint(pe.a.Order+"/Umrah/pending/"+e,{}).customGet().then((function(e){return Pe()}))},render:function(e,t){return Object(me.jsx)("button",{style:{color:"rgb(219,157,53)",padding:"6px 10px",fontSize:"12px",background:"rgba(219,157,53,0.1)",borderRadius:"4px"},children:e})}}],columns:ke,rows:a}),Object(me.jsxs)("div",{style:{padding:20,background:"#fff"},children:[Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:X,limitOptions:[10,20,50,100],limit:te.take,activePage:te.page,onChangePage:function(e){window.scrollTo(0,0),ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}}),P&&te.disponibilityId&&Object(me.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"2px"},children:[Object(me.jsx)(fe.a,{type:"number",value:P.adddedNumber,width:120,onChange:function(e){return k((function(t){return Object(o.a)(Object(o.a)({},t),{},{adddedNumber:parseInt(e)})}))}}),Object(me.jsx)(he.a,{style:{width:"120px"},onClick:function(e){return Object(pt.a)(pe.a.Disponibility).update(P.id,P).then((function(e){return alert("Enregistr\xe9")}))},appearance:"primary",color:"yellow",children:"Enregistrer"})]})]})]})}var Nr=function(e){if(e&&e.length)return[{columns:[{title:"Voyage",width:{wpx:120}},{title:"Vol",width:{wpx:120}},{title:"Client B2B",width:{wpx:120}},{title:"Coupon",width:{wpx:100}},{title:"Wakil",width:{wpx:120}},{title:"Arrangement",width:{wpx:130}},{title:"Hotel Makkah",width:{wpx:150}},{title:"Hotel Madinah",width:{wpx:150}},{title:"Status",width:{wpx:160}},{title:"P\xe9l\xe9rin",width:{wpx:200}},{title:"Num\xe9ro de passeport",width:{wpx:120}},{title:"Prix total",width:{wpx:100}}],data:e.map((function(e){return[{value:e.packageUmrah?e.packageUmrah.name:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.disponibility?_e()(e.disponibility.date).format("DD MMM"):"-",style:{font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.client?e.client.name:"-",style:{font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.coupon||"-",style:{font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.wakil||"-",style:{font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.price?e.price.arrangementMadinahDesignation:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:e.price?"Chambre triple"==e.price.arrangementMadinahDesignation?"2f1a4c":"Chambre double"==e.price.arrangementMadinahDesignation?"ecb61c":"5a2c3e":"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.price?e.price.hotelMakkahName:"-",style:{font:{sz:"13",color:{rgb:"777777"}},alignment:{horizontal:"center"}}},{value:e.price?e.price.hotelMadinahName:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"888888"}},alignment:{horizontal:"center"}}},{value:Fe.f.find((function(t){return null===e.confirmationStatus||t.value===e.confirmationStatus}))?Fe.f.find((function(t){return null===e.confirmationStatus||t.value===e.confirmationStatus})).label:Fe.f.find((function(e){return 1===e.value})).label,style:{font:{sz:"13",color:{rgb:2===e.confirmationStatus?"663399":3==e.confirmationStatus?"0b9666":4==e.confirmationStatus?"b61955":"e68019"}},alignment:{horizontal:"center"}}},{value:e.customer.name,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"12",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.customer.passportNumber,style:{alignment:{horizontal:"center"}}},{value:Object(st.a)(e.totalPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}}]}))}]};function Pr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=(b[0],b[1]),f=Object(c.useState)([]),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(c.useState)([]),g=Object(s.a)(x,2),_=g[0],v=g[1],y=Object(c.useState)(null),C=Object(s.a)(y,2),I=(C[0],C[1]),E=Object(c.useState)([]),S=Object(s.a)(E,2),N=(S[0],S[1]),P=(Object(D.d)(L),Object(c.useState)([])),k=Object(s.a)(P,2),A=k[0],M=k[1],T=Object(c.useState)(Date.now()),w=Object(s.a)(T,2),R=w[0],U=w[1],F=Object(c.useState)(0),K=Object(s.a)(F,2),z=K[0],W=K[1],Y=Object(c.useState)(!1),G=Object(s.a)(Y,2),V=G[0],H=G[1],q=function(){W((function(e){return e+1}))},Z=Object(c.useState)(0),J=Object(s.a)(Z,2),X=J[0],Q=J[1],$=Object(c.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),ee=Object(s.a)($,2),te=ee[0],ne=ee[1],ae=Object(D.c)(ye.a),ce=Object(s.a)(ae,2),re=(ce[0],ce[1]),ie=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?d(e.data):O(e.data)}))},oe=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){m(e.data);var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities.map((function(e){return Object(o.a)({packageUmrahId:t.id},e)})))}),[]);console.log(t),v(t.filter((function(e){return e.onStock})))}))},se=function(){re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah",Object(o.a)(Object(o.a)({},te),{},{date:te.date?_e()(te.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),Q(e.data.totalCount)})).catch((function(e){re((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};Object(c.useEffect)((function(){var e;ie(),("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return N(e.data)})),oe()}),[]),Object(c.useEffect)((function(){se()}),[te.page,te.take]);var le=[{value:"id",value2:"hasVisa",value3:"withoutVisa",name:" ",render:function(e,t,n){return Object(me.jsx)("b",{style:{color:"green",display:"flex",alignItems:"center"},children:Object(me.jsx)(en.a,{disabled:!t||n,onChange:function(n){U(Date.now()),A.find((function(t){return t==e}))?M((function(t){return t.filter((function(t){return t!=e}))})):M((function(n){return t?[].concat(Object(qe.a)(n),[e]):n}))},checked:null!=A.find((function(t){return t==e}))})})}},{value:"packageUmrah",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Voyage",render:function(e,t,n,a){return Object(me.jsxs)("b",{style:{color:"#549f0a"},children:[e?e.name.toUpperCase():""," ",t?Object(me.jsx)(Re.a,{color:"blue",children:"Billet"}):""," ",n?Object(me.jsx)(Re.a,{color:"orange",children:"Sans Visa"}):"",a?Object(me.jsx)(Re.a,{color:"violet",children:"Sans Billet"}):""]})}},{value:"coupon",name:"Coupon Utilis\xe9",render:function(e){return Object(me.jsx)("b",{children:e||"---"})}},{value:"disponibility",name:"Vol",render:function(e){return e?Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(me.jsx)("b",{children:"-"})}},{value:"confirmationStatus",name:"Etat",render:function(e){return Object(me.jsx)(Re.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:Fe.f.find((function(t){return null===e||t.value===e}))?Fe.f.find((function(t){return null===e||t.value===e})).label:Fe.f.find((function(e){return 1===e.value})).label})}},{value:"client",name:"Client B2B",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})}},{value:"customer",name:"Client B2C",render:function(e){return Object(me.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.picture+"?"+Date.now(),width:"43",height:"43",style:{border:"1px solid #eee",borderRadius:"50%",boxShadow:"-11px -5px 20px -13px rgba(0,0,0,0.75)"}}):Object(me.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(me.jsx)("b",{style:{color:"#111",fontSize:"14px"},children:e?e.passportNumber:""}),Object(me.jsx)("br",{})," ",Object(me.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr})]})]})}},{value:"wakil",name:"Wakil",render:function(e){return Object(me.jsx)("strong",{children:e?e.toUpperCase():""})}},{value:"totalPrice",name:"Prix Total",render:function(e){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e&&e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}},{value:"disponibility",value2:"onlyTicket",name:"Commission B2B",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[!t&&e&&e.b2Bcommission.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:!t&&"TND "})]})}},{value:"date",name:"Date De Vente",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}}];function ue(){var e=a.filter((function(e){return A.find((function(t){return t==e.id}))})).map((function(e){return e.customer})).map((function(e,t){return' \n \n \n \n \n '.concat(Date.now(),"\n \n \n ").concat(e,"\n \n \n ")}return Object(me.jsxs)("div",{children:[Object(me.jsxs)("div",{style:{overflow:"hidden",height:0},children:[Object(me.jsx)("iframe",{id:"iframe",title:"printFrame",width:"100%"}),a.filter((function(e){return A.find((function(t){return t==e.id}))})).map((function(e){return e.customer})).map((function(e){return Object(me.jsx)("img",{onLoad:q,onError:q,src:Te.d+"Uploads/Visas/"+e.passportNumber+".png?t="+R,alt:""},e.id)}))]}),Object(me.jsxs)(Ie.a,{search:function(){return se()},children:[Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Recherche: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return ie(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:te.clientId,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Status : "}),Object(me.jsx)(Ze.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(Fe.f),block:!0,noSearch:!0,value:te.status,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{status:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{onSearch:oe,data:p?[{label:"Tout",value:0}].concat(p.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:te.packageUmrahId,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(_?_.map((function(e){return{label:Object(me.jsxs)("div",{style:{color:"#232323"},children:[_e()(e.date).format("DD MMM YYYY")," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:p&&p.find((function(t){return t.id==e.packageUmrahId}))&&p.find((function(t){return t.id==e.packageUmrahId})).name}),")"]}),value:e.id}})):[]),block:!0,noSearch:!0,value:te.disponibilityId,onSelect:function(e){Object(pt.a)(pe.a.Disponibility).fetchById(e).then((function(e){console.log(e.data),I(e.data)})),ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})]})]}),Object(me.jsx)(Ce.a,{excelData:Nr(a),nameExcel:"saleUmrah",size:"lg",noAdd:!0})," ",Object(me.jsxs)("div",{onClick:function(e){U(Date.now()),M((function(e){return e.length?[]:a.filter((function(e){return e.hasVisa&&!e.withoutVisa})).map((function(e){return e.id}))}))},style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(me.jsx)(en.a,{checked:A.length>0})," S\xe9lectionner Tout"]}),Object(me.jsxs)("div",{style:{textAlign:"right",padding:"10px"},children:[Object(me.jsx)(he.a,{loading:V,appearance:"primary",color:"blue",onClick:function(){H(!0);var e=document.getElementById("iframe");if(A.length&&z===A.length){e.contentDocument.body.innerHTML="";var t=ue();e.contentDocument.write(t),e.contentWindow.print(),H(!1),W(0)}else setTimeout((function(){if(A.length&&z===A.length){e.contentDocument.body.innerHTML="";var t=ue();e.contentDocument.write(t),e.contentWindow.print(),H(!1),W(0)}else setTimeout((function(){e.contentDocument.body.innerHTML="";var t=ue();e.contentDocument.write(t),e.contentWindow.print(),H(!1),W(0)}),5e3)}),1e4)},children:"imprimer visas"})," "]}),Object(me.jsx)(Ee.a,{columns:le,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:X,limitOptions:[10,20,50,100,200,500],limit:te.take,activePage:te.page,onChangePage:function(e){window.scrollTo(0,0),ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var kr={verticalAlign:"top"};var Ar=function(e){var t=e.error,n=e.clients,a=e.fetchClients,r=e.providers,i=e.fetchProviders,l=Object(c.useState)(0),u=Object(s.a)(l,2),d=u[0],j=u[1],b=Object(c.useState)(null),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(D.c)(hr),m=Object(s.a)(p,2),x=m[0],g=m[1];return Object(c.useEffect)((function(){console.log(x),h(x.package)}),[x.id]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(Nt.a,{current:d,style:kr,children:[Object(me.jsx)(Nt.a.Item,{title:"Infos G\xe9nerales",onClick:function(){return j(0)}}),Object(me.jsx)(Nt.a.Item,{title:"Voyageur",onClick:function(){return j(1)}})]}),Object(me.jsx)("div",{style:{padding:"40px 10px"},children:d?1==d?Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Complet:"}),Object(me.jsx)(fe.a,{value:x.customer.name,onChange:function(e){var t=Object(o.a)({},x.customer);t.name=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(me.jsx)("label",{children:"T\xe9l:"}),Object(me.jsx)(fe.a,{type:"phone",value:x.customer.phoneNumber,onChange:function(e){var t=Object(o.a)({},x.customer);t.phoneNumber=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(me.jsx)("label",{children:"N\xb0 Passport:"}),Object(me.jsx)(fe.a,{value:x.customer.passportNumber,onChange:function(e){var t=Object(o.a)({},x.customer);t.passportNumber=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:10,m:4.4,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Date d'expiration :"}),Object(me.jsx)(fe.a,{type:"date",value:x.customer.expirationPassportDate,onChange:function(e){var t=Object(o.a)({},x.customer);t.expirationPassportDate=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Type : "}),Object(me.jsx)(Ze.a,{data:Fe.a,block:!0,noSearch:!0,value:x.customer.ageType,onChange:function(e){var t=Object(o.a)({},x.customer);t.ageType=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Genre : "}),Object(me.jsx)(Ze.a,{data:Fe.h,block:!0,noSearch:!0,value:x.customer.gender,onChange:function(e){var t=Object(o.a)({},x.customer);t.gender=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]}),Object(me.jsxs)(be.a,{s:10,m:4.4,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Date de naissance :"}),Object(me.jsx)(fe.a,{type:"date",value:x.customer.birthDate,onChange:function(e){var t=Object(o.a)({},x.customer);t.birthDate=e,g(Object(o.a)(Object(o.a)({},x),{},{customer:t}))}})]})]}):Object(me.jsx)(Tr,{providers:r,fetchProviders:i}):Object(me.jsx)(Mr,{fetchClients:a,clients:n,setPack:h,pack:f})}),Object(me.jsx)("br",{}),t&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:t}),Object(me.jsx)(Pt.a,{})]})},Mr=function(e){var t=e.clients,n=e.fetchClients,a=e.setPack,r=e.pack,i=Object(D.c)(hr),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Object(pt.a)(pe.a.Package+"/GetForSale",{q:e,page:1,take:1e3}).fetchAll().then((function(e){return f(e.data.data)}))};return Object(c.useEffect)((function(){h()}),[]),Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:[{label:"Tout",value:0}].concat(t.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:u.clientId,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}}),u.clientId&&Object(me.jsxs)("div",{style:{background:"rgb(107,121,196)",color:"white",padding:"10px",borderRadius:"5px",margin:"10px"},children:[Object(me.jsxs)("b",{children:["Commission:"," ",t.find((function(e){return e.id==u.clientId}))&&t.find((function(e){return e.id==u.clientId})).voCommission]}),Object(me.jsx)("br",{}),Object(me.jsx)("label",{children:"Remise/addition"}),Object(me.jsx)(fe.a,{type:"number",value:u.regulated_value,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{regulated_value:parseFloat(e)})}))},block:!0})]}),Object(me.jsx)("label",{children:"Voyage Organis\xe9: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return h(e)},data:[{label:"Tout",value:0}].concat(O.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:u.packageId,onSelect:function(e){a(O.find((function(t){return t.id==e}))),console.log(O.find((function(t){return t.id==e}))),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageId:e})}))}})," ",r&&Object(me.jsxs)("div",{style:{background:"rgb(107,121,196)",color:"white",padding:"10px",borderRadius:"5px",margin:"10px"},children:[Object(me.jsx)("label",{children:"Choir parmi les vols: "}),Object(me.jsx)(Ze.a,{data:r.disponibilities.map((function(e){return{label:_e()(e.date).format("DD MMM YYYY"),value:e.id}})),block:!0,noSearch:!0,value:u.disponibilityId,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}}),r.packageProviders&&r.packageProviders.find((function(e){return e.hotels}))?r.packageProviders.filter((function(e){return e.hotels})).map((function(e,t){return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)("label",{children:["Choir Hotel N\xb0 ",t+1,": "]}),Object(me.jsx)(Ze.a,{data:e.hotels.split(",").map((function(e){return{label:e,value:e}})),block:!0,noSearch:!0,value:u["hotelName"+(t+1)],onSelect:function(e){d((function(n){return Object(o.a)(Object(o.a)({},n),{},Object(G.a)({},"hotelName"+(t+1),e))}))}})]})})):Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Hotel: "}),Object(me.jsx)(fe.a,{value:u.hotelName1,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{hotelName1:e})}))},block:!0})]}),Object(me.jsx)("label",{children:"Choir parmi les arrangements: "}),Object(me.jsx)(Ze.a,{data:r.prices.map((function(e){return{label:e.name+" --- "+e.price+"TND",value:e.name}})),block:!0,noSearch:!0,value:u.arrangement,onSelect:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{arrangement:e,totalPrice:r.prices.find((function(t){return t.name==e})).price})}))}})," "]}),Object(me.jsx)("br",{}),Object(me.jsx)("label",{children:"Date De vente: "}),Object(me.jsx)(fe.a,{type:"date",value:u.date,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}}),Object(me.jsx)("label",{children:"Note: "}),Object(me.jsx)(fe.a,{as:"textarea",value:u.note,onChange:function(e){console.log(e),d((function(t){return Object(o.a)(Object(o.a)({},t),{},{note:e})}))}}),Object(me.jsx)("br",{}),Object(me.jsxs)("label",{children:["N'est pas confirm\xe9:"," ",Object(me.jsx)("input",{type:"checkbox",onChange:function(e){d((function(e){return Object(o.a)(Object(o.a)({},e),{},{confirmationStatus:2==e.confirmationStatus?1:2})}))},checked:2==u.confirmationStatus})]})]})},Tr=function(e){var t=e.providers,n=e.fetchProviders,a=Object(c.useState)(Fe.u),r=Object(s.a)(a,2),i=(r[0],r[1],Object(D.c)(hr)),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)(new ct),O=Object(s.a)(j,2),f=O[0],h=O[1];return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Fournisseur : "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return n(e)},data:t.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:f.providerId,onSelect:function(e){var n=t.find((function(t){return t.id==e}));console.log(n),h((function(t){return Object(o.a)(Object(o.a)({},t),{},{providerId:e})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Cout Unitaire:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:f.unitCost,onChange:function(e){h((function(t){return Object(o.a)(Object(o.a)({},t),{},{unitCost:parseInt(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(me.jsx)("label",{children:"Frais de service:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:f.unitFee,onChange:function(e){h((function(t){return Object(o.a)(Object(o.a)({},t),{},{unitFee:parseInt(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Prix Total:"}),Object(me.jsxs)("div",{children:[" ",Object(me.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:(Number(f.unitFee)+Number(f.unitCost)).toFixed(3)})]})]}),Object(me.jsx)("hr",{}),Object(me.jsx)("label",{children:"D\xe9signation:"}),Object(me.jsx)(fe.a,{as:"textarea",rows:2,placeholder:"Notes",value:f.note,onChange:function(e){h((function(t){return Object(o.a)(Object(o.a)({},t),{},{note:e})}))}}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsx)(Je.a,{onClick:function(){d((function(e){console.log(e);var t=Object(o.a)({},e);if("object"!=typeof t.extrats&&(t.extrats=[]),"number"==typeof f.index){var n=Object(qe.a)(t.extrats);n[f.index]=f,t=Object(o.a)(Object(o.a)({},t),{},{extrats:n})}else{var a=Object(qe.a)(t.extrats);a.push(f),t=Object(o.a)(Object(o.a)({},t),{},{extrats:a})}return t})),h(new ea)},color:"violet",icon:Object(me.jsx)(b.a,{}),children:"Ajouter"})}),Object(me.jsx)(Pt.a,{}),Object(me.jsx)(Ee.a,{editAction:function(e){h(Object(o.a)(Object(o.a)({},u.extrats[e]),{},{index:e}))},deleteAction:function(e){d((function(t){var n=Object(o.a)({},t),a=Object(qe.a)(n.extrats);return a.splice(e,1),n=Object(o.a)(Object(o.a)({},n),{},{extrats:a})}))},actionKey:"index",noAdvancedActions:!0,columns:wr(t),rows:u.extrats.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{index:t})}))})]})},wr=function(e){return[{value:"note",name:"Nom ",render:function(e){return Object(me.jsx)("b",{children:Object(me.jsx)("i",{children:e})})}}]},Br=function(e){if(e&&e.length)return[{columns:[{title:"Voyage",width:{wpx:120}}].concat(Object(qe.a)(e[0].costs.map((function(e){return e.hotelName?[{title:"Nom du fournisseur",width:{wpx:150}},{title:"Co\xfbt",width:{wpx:100}},{title:"H\xf4tel",width:{wpx:100}},{title:"Arrangement",width:{wpx:150}}]:[{title:"Nom du fournisseur",width:{wpx:150}},{title:"Co\xfbt",width:{wpx:100}}]})).reduce((function(e,t){return[].concat(Object(qe.a)(e),Object(qe.a)(t))}),[])),[{title:"Co\xfbt total",width:{wpx:100}},{title:"Client",width:{wpx:150}},{title:"Voyageur",width:{wpx:100}},{title:"Num\xe9ro de passeport",width:{wpx:120}},{title:"commission",width:{wpx:150}},{title:"Prix total",width:{wpx:100}},{title:"net A payer",width:{wpx:100}},{title:"Benifice",width:{wpx:100}}]),data:e.map((function(e){return[{value:e.packageName,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}}].concat(Object(qe.a)(e.costs.map((function(e){return e.hotelName||e.arrangement?[{value:e.providerName,style:{font:{sz:"14",color:{rgb:"ffffff"}},alignment:{horizontal:"center"},fill:{fgColor:{rgb:"2f1a4c"}}}},{value:e.cost,style:{font:{sz:"14",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}},{value:e.hotelName,style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"left"}}},{value:e.arrangement,style:{font:{sz:"14",color:{rgb:"00a98d"}},alignment:{horizontal:"left"}}}]:[{value:e.providerName,style:{font:{sz:"14",color:{rgb:"ffffff"}},alignment:{horizontal:"center"},fill:{fgColor:{rgb:"2f1a4c"}}}},{value:e.cost,style:{font:{sz:"14",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}}]})).reduce((function(e,t){return[].concat(Object(qe.a)(e),Object(qe.a)(t))}),[])),[{value:parseFloat(e.costs.reduce((function(e,t){return e+t.cost}),0)),style:{font:{sz:"16",color:{rgb:"ffffff"}},fill:{fgColor:{rgb:"ad5389"}},alignment:{horizontal:"center"}}},{value:e.client?e.client.name:"",style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"left"}}},{value:e.customer.name,style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"left"}}},{value:e.customer.passportNumber,style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:parseFloat(e.commission),style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"14",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}},{value:parseFloat(e.totatlPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"14",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}},{value:parseFloat(e.totatlPrice-e.commission),style:{font:{sz:"14",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}},{value:parseFloat(e.totatlPrice-e.commission-e.costs.reduce((function(e,t){return e+t.cost}),0)),style:{font:{sz:"16",color:{rgb:"ffffff"}},fill:{fgColor:{rgb:"0b9666"}},alignment:{horizontal:"center"}}}])}))}]};function Rr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)([]),_=Object(s.a)(g,2),v=_[0],y=_[1],I=Object(c.useState)([]),E=Object(s.a)(I,2),S=E[0],N=E[1],P=Object(c.useState)([]),k=Object(s.a)(P,2),A=k[0],M=k[1],T=Object(c.useState)([]),w=Object(s.a)(T,2),R=w[0],U=w[1],F=Object(c.useState)([]),K=Object(s.a)(F,2),z=K[0],W=K[1],Y=(Object(D.d)(L),Object(c.useState)([])),G=Object(s.a)(Y,2),V=G[0],H=G[1],q=Object(c.useState)([]),Z=Object(s.a)(q,2),J=Z[0],X=Z[1],Q=Object(c.useState)(0),$=Object(s.a)(Q,2),ee=$[0],te=$[1],ne=Object(c.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),ae=Object(s.a)(ne,2),ce=ae[0],re=ae[1],ie=Object(c.useState)(""),oe=Object(s.a)(ie,2),se=oe[0],le=oe[1],ue=Object(D.c)(hr),de=Object(s.a)(ue,2),je=de[0],Oe=de[1],he=Object(D.c)(ye.a),xe=Object(s.a)(he,2),ge=(xe[0],xe[1]),Se=function(){Oe(new ct),le("")},De=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?f(e.data):x(e.data)}))},Ne=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return y(e.data)}))},Pe=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.AgentBookingFlight,{q:e},"/autocomplete").customGet().then((function(e){return M(e.data)}))},ke=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((function(e){return N(e.data)}))},Ae=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((function(e){return W(e.data)}))},Me=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((function(e){return U(e.data)}))},Te=function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/VO",Object(o.a)(Object(o.a)({},ce),{},{date:ce.date?_e()(ce.date).format("DD MMM YYYY"):null,page:e||ce.page})).fetchAll().then((function(e){r(e.data.data),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),te(e.data.totalCount)})).catch((function(e){le(e.Message),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))},we=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Package,{q:e},"").customGet().then((function(e){H(e.data.data);var t=e.data.data.reduce((function(e,t){return e.concat(t.disponibilities.map((function(e){return Object(o.a)({packageId:t.id},e)})))}),[]);console.log(t),X(t.filter((function(e){return e.onStock})))}))};return Object(c.useEffect)((function(){Te(),De(),Ne(),ke(),Me(),Ae(),Pe(),we()}),[]),Object(c.useEffect)((function(){Te()}),[ce.page,ce.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return Te()},children:[Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Recherche: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){re((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return De(e)},data:[{label:"Tout",value:0}].concat(O.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:ce.clientId,onSelect:function(e){re((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Voyage: "}),Object(me.jsx)(Ze.a,{onSearch:we,data:[{label:"Tout",value:0}].concat(V.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:ce.packageId,onSelect:function(e){re((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(J?J.map((function(e){return{label:Object(me.jsxs)("div",{style:{color:"#232323"},children:[_e()(e.date).format("DD MMM YYYY")," ("," ",Object(me.jsx)("i",{style:{color:"#999"},children:V&&V.find((function(t){return t.id==e.packageId}))&&V.find((function(t){return t.id==e.packageId})).name}),")"]}),value:e.id}})):[]),block:!0,noSearch:!0,value:ce.disponibilityId,onSelect:function(e){re((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Date du Vente: "}),Object(me.jsx)(fe.a,{type:"date",value:ce.date,onChange:function(e){re((function(t){return Object(o.a)(Object(o.a)({},t),{},{date:e})}))}})]})]}),Object(me.jsx)(Ce.a,{excelData:Br(u),ActionOnClose:Se,nameExcel:"saleVo",size:"lg",save:function(){console.log(je),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},je);delete e.client,delete e.disponibility,delete e.package,console.log(e),je.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/VO").update(e.id,e).then((function(e){Te(),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),Se(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){le(e.Message),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/VO").create(e).then((function(e){Te(),Se(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){le(e.Message),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))},handleExport:function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/GetOrerVosForExcel",Object(o.a)(Object(o.a)({},ce),{},{date:ce.date?_e()(ce.date).format("DD MMM YYYY"):null,take:ee+10,page:1})).fetchAll().then((function(e){d(e.data.data)})).catch((function(e){return le(e.Message)}))},AddComponent:Object(me.jsx)(Ar,{checkouts:S,tags:R,fetchCheckouts:ke,fetchTags:Me,providers:z,fetchProviders:Ae,error:se,banks:v,fetchBanks:Ne,clients:m,fetchClients:function(e){return De(e,!1)},fetchAgentBookingFlights:Pe,agentBookingFlights:A})}),Object(me.jsxs)("div",{children:[Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{icon:Object(me.jsx)(C.e,{}),notAmount:!0,text:"Total Voyages",color:"245,195,35",amount:ee})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Vente",color:"0,169,141"})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Remboursement",color:"229,57,53"})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Commission"})})]}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){le(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/VO").fetchById(e).then((function(e){if(e.data.client&&!m.find((function(t){return t.id==e.data.client.id}))){var t=Object(qe.a)(m);t.unshift({id:e.data.client.id,name:e.data.client.name}),x(t)}Oe((function(t){var n=Object(o.a)({},e.data);n.date=n.date.substring(0,10);var a=Object(o.a)({},n.customer);return Object(o.a)(Object(o.a)({},n),{},{customer:a})}))})).catch((function(e){console.log(e)}))}(e),ge((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/VO").delete(e).then((function(e){Te(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return le(e.Message)}))},actionKey:"id",actions:[{label:"Confirmer",action:function(e){B.a.createAPIEndpoint(pe.a.Order+"/VO/confirm/"+e,{}).customGet().then((function(e){return Te()}))},render:function(e,t){return Object(me.jsx)("button",{style:{color:"rgb(0,169,141)",padding:"6px 10px",fontSize:"12px",background:"rgba(0,169,141,0.1)",borderRadius:"4px"},children:e})}},{label:"Refuser",action:function(e){B.a.createAPIEndpoint(pe.a.Order+"/VO/revoke/"+e,{}).customGet().then((function(e){return Te()}))},render:function(e,t){return Object(me.jsx)("button",{style:{color:"rgb(229,57,53)",padding:"6px 10px",fontSize:"12px",background:"rgba(229,57,53,0.1)",borderRadius:"4px"},children:e})}},{label:"Rendre En Attente",action:function(e){B.a.createAPIEndpoint(pe.a.Order+"/Vo/pending/"+e,{}).customGet().then((function(e){return Te()}))},render:function(e,t){return Object(me.jsx)("button",{style:{color:"rgb(219,157,53)",padding:"6px 10px",fontSize:"12px",background:"rgba(219,157,53,0.1)",borderRadius:"4px"},children:e})}}],columns:Ur,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:ee,limitOptions:[10,20,50,100],limit:ce.take,activePage:ce.page,onChangePage:function(e){window.scrollTo(0,0),re((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),re((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var Ur=[{value:"package",name:"Voyage",render:function(e){return Object(me.jsx)("b",{style:{color:"#549f0a"},children:e?e.name.toUpperCase():""})}},{value:"client",name:"Client B2B",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})}},{value:"customer",name:"Client B2C",render:function(e){return Object(me.jsxs)("a",{children:[e?e.name.toUpperCase():"",Object(me.jsx)("br",{})," ",Object(me.jsx)("i",{style:{color:"#aaa"},children:e?e.passportNumber:""})]})}},{value:"disponibility",name:"Vol",render:function(e){return e?Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(me.jsx)("b",{children:"-"})}},{value:"confirmationStatus",name:"Etat",render:function(e){return Object(me.jsx)(Re.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:Fe.f.find((function(t){return null===e||t.value===e}))?Fe.f.find((function(t){return null===e||t.value===e})).label:Fe.f.find((function(e){return 1===e.value})).label})}},{value2:"currency",value:"commission",name:"Commission B2B",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#333",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})}},{value:"totalPrice",value2:"currency",name:"Prix Total",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})}},{value:"date",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:_e()(e).format("DD MMM YYYY")})}},{value:"notes",name:"Notes",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}}],Lr=n(382),Fr=n.n(Lr);function Kr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(D.c)(de),_=Object(s.a)(g,2),v=_[0],y=(_[1],Object(c.useState)(Date.now())),C=Object(s.a)(y,2),I=C[0],E=(C[1],Object(c.useState)(0)),S=Object(s.a)(E,2),N=S[0],P=S[1],k=Object(c.useState)(!1),A=Object(s.a)(k,2),M=A[0],T=A[1],w=Object(c.useState)([]),R=Object(s.a)(w,2),U=R[0],L=R[1],F=Object(D.c)(W),K=Object(s.a)(F,2),z=(K[0],K[1],Object(c.useState)(0)),Y=Object(s.a)(z,2),G=Y[0],V=Y[1],H=Object(c.useState)(!1),q=Object(s.a)(H,2),Z=(q[0],q[1],Object(c.useState)({page:1,take:100,clientId:0,status:3,date:null,tagId:0})),J=Object(s.a)(Z,2),X=J[0],Q=J[1],$=Object(c.useState)({groupId:null,orders:[]}),ee=Object(s.a)($,2),te=ee[0],ne=ee[1],ae=Object(c.useState)(""),ce=Object(s.a)(ae,2),re=(ce[0],ce[1],function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return d(e.data)}))}),ie=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){f(e.data);var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities)}),[]);console.log(t),L(t.filter((function(e){return e.onStock})))}))},oe=function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah",Object(o.a)(Object(o.a)({},X),{},{date:X.date?_e()(X.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),x([]),V(e.data.totalCount)})).catch((function(e){}))};Object(c.useEffect)((function(){re(),ie()}),[]),Object(c.useEffect)((function(){oe()}),[X.page,X.take]);var se=[{value:"id",name:"-",render:function(e){return Object(me.jsx)(en.a,{onChange:function(t){m.find((function(t){return t==e}))?x((function(t){return t.filter((function(t){return t!=e}))})):x((function(t){return[].concat(Object(qe.a)(t),[e])}))},checked:null!=m.find((function(t){return t==e}))})}},{value:"groupId",name:"Groupe",render:function(e){return Object(me.jsx)("a",{children:Object(me.jsx)("b",{children:e&&v.find((function(t){return t.id==e}))?v.find((function(t){return t.id==e})).name:""})})}},{value:"customer",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Client B2C",render:function(e,t,n,a){return Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.picture+"?"+Date.now(),width:"43",height:"43",style:{border:"1px solid #eee",borderRadius:"50%",boxShadow:"-11px -5px 20px -13px rgba(0,0,0,0.75)"}}):Object(me.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{style:{padding:"0 5px"},children:[e.firstName+" "+e.lastName," ",Object(me.jsx)("b",{style:{color:"#111",fontSize:"15px"},children:e?e.passportNumber:""}),Object(me.jsx)("br",{}),Object(me.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr}),t?Object(me.jsx)(Re.a,{color:"blue",children:"Billet"}):""," ",n?Object(me.jsx)(Re.a,{color:"orange",children:"sans visa"}):"",a?Object(me.jsx)(Re.a,{color:"violet",children:"Sans Billet"}):""]})]})}},{value:"disponibility",name:"Vol",render:function(e){return e?Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(me.jsx)("b",{children:"-"})}},{value:"fingerprint",name:"Empreinte",render:function(e){return e?Object(me.jsx)(Sr.a,{color:"green"}):Object(me.jsx)("b",{children:"-"})}},{value:"client",name:"Client B2B",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})}},{value:"codeMoufa",name:"Code Wakil",render:function(e,t){return Object(me.jsx)("span",{style:{color:e?"green":t?"red":""},children:e?"Envoy\xe9 vers wakil":"-"})}},{value:"errorMessage",value2:"codeMoufa",name:"Erreur",render:function(e,t){return Object(me.jsx)("span",{style:{color:e?"green":e?"red":""},children:e?t?"":"Probl\xe9me envoie":"-"})}},{value:"visaCode",name:"Visa",render:function(e){return Object(me.jsx)("b",{style:{color:e?"white":"",padding:"5px 10px",background:e?"blue":"",borderRadius:"5px"},children:e||"-"})}}],le=function(){var e=Object(hn.a)(fn.a.mark((function e(){return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("http://localhost:8733/getImages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});case 2:e.sent&&alert("succ\xe9s");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(){var e=Object(hn.a)(fn.a.mark((function e(){var t,n,a,c,r,i=arguments;return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"exportPictures",e.prev=1,e.next=4,fetch("https://financeapi.kounouz.travel/".concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});case 4:return n=e.sent,e.next=7,n.blob();case 7:a=e.sent,c=window.URL.createObjectURL(a),(r=document.createElement("a")).href=c,r.download="exportPictures"==t?"pictures.zip":"passports.zip",document.body.appendChild(r),r.click(),document.body.removeChild(r),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(1),console.error("Error downloading ZIP file:",e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){ne((function(e){return Object(o.a)(Object(o.a)({},e),{},{orders:m})}))}),[m.length]);function je(){var e=a.filter((function(e){return m.find((function(t){return t==e.id}))})).map((function(e){return e.customer})).map((function(e,t){return' \n \n \n \n \n '.concat(Date.now(),"\n \n \n ").concat(e,"\n \n \n ")}return Object(me.jsxs)("div",{children:[Object(me.jsxs)("div",{style:{overflow:"hidden",height:0},children:[Object(me.jsx)("iframe",{id:"iframe",title:"printFrame",width:"100%"}),a.filter((function(e){return m.find((function(t){return t==e.id}))})).map((function(e){return e.customer})).map((function(e){return Object(me.jsx)("img",{onLoad:function(){return P((function(e){return e+1}))},onError:function(){return P((function(e){return e+1}))},src:Te.d+"Uploads/"+e.passportPicture+"?t="+I,alt:""},e.id)}))]}),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return oe()},children:[Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Recherche: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Group: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(v.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:X.groupId,onSelect:function(e){Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{groupId:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return re(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:X.clientId,onSelect:function(e){Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{onSearch:ie,data:O?[{label:"Tout",value:0}].concat(O.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:X.packageUmrahId,onSelect:function(e){Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(U?U.map((function(e){return{label:Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),value:e.id}})):[]),block:!0,noSearch:!0,value:X.disponibilityId,onSelect:function(e){Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})]})]}),Object(me.jsx)(Ce.a,{nameExcel:"saleUmrah",size:"lg",noAdd:!0,additionalBtn:Object(me.jsx)("div",{className:"p-5",children:Object(me.jsx)(he.a,{color:"blue",appearance:"primary",onClick:function(){le()},children:"t\xe9l\xe9chargement auto"})})}),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Je.a,{icon:Object(me.jsx)(Fr.a,{}),onClick:function(){return ue()},appearance:"primary",children:["Images"," "]})," ",Object(me.jsxs)(Je.a,{icon:Object(me.jsx)(Yc.a,{}),appearance:"primary",onClick:function(){return ue("exportPassportPictures")},children:["Passports"," "]}),Object(me.jsxs)(he.a,{onClick:function(){!function(){if(m&&m.length){var e=a.filter((function(e){return m.some((function(t){return t==e.id}))})).map((function(e){return Object(o.a)(Object(o.a)({},e),{},{_name:"".concat(e.customer.lastName.trim().toUpperCase(),"-").concat(e.customer.firstName.trim().toUpperCase())})})).sort((function(e,t){return(""+e._name).localeCompare(t._name)})),t=document.createElement("a"),n="",c="";e.map((function(t,a){n+="".concat(!a||a%5?"":"\n","SRDOCS ").concat(t.disponibility.airline.logo.replace("https://images.kiwi.com/airlines/64/","").substring(0,2)," HK1-P-TUN-").concat(t.customer.passportNumber,"-TUN-").concat(_e()(t.customer.birthDate).format("DDMMMYY").toUpperCase(),"-").concat(1==t.customer.gender?"M":"F","-").concat(_e()(t.customer.expirationPassportDate).format("DDMMMYY").toUpperCase(),"-").concat(t.customer.lastName.trim().toUpperCase(),"-").concat(t.customer.firstName.trim().toUpperCase(),"/P").concat(a+1,";\n"),c=c+(a%10?"":"\nNM1 ")+"".concat(t.customer.lastName.trim().toUpperCase(),"/").concat(t.customer.firstName.trim().toUpperCase()," ").concat(2==t.customer.title?"MRS":3==t.customer.title?"MSS":"MR").concat(a%10<9&&a0})," S\xe9lectionner Tout"]}),Object(me.jsxs)("div",{className:"p-10",children:[Object(me.jsx)(be.a,{s:6,m:6,l:4,xl:3,children:Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(v.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:te.groupId,onSelect:function(e){ne((function(t){return Object(o.a)(Object(o.a)({},t),{},{groupId:e})}))}})})," ",Object(me.jsx)(he.a,{appearance:"primary",color:"blue",onClick:function(){B.a.createAPIEndpoint(pe.a.Order+"/changGgroup").create(te).then((function(e){oe(),alert("success")}))},children:"changer"})]}),Object(me.jsx)(Ee.a,{columns:se,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:G,limitOptions:[10,20,50,100,200,250,500,1e3],limit:X.take,activePage:X.page,onChangePage:function(e){window.scrollTo(0,0),Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),Q((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})," "]})}var zr=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code Agent:"}),Object(me.jsx)(fe.a,{value:a.agentCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{agentCode:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function Wr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:"",agentCode:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:"",agentCode:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.AgentBookingFlight,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){return N()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{agentCode:"Code Agent"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.AgentBookingFlight).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.AgentBookingFlight).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(zr,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){x(""),y(a.find((function(t){return t.id==e})))}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.AgentBookingFlight).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:Yr,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var Yr=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"agentCode",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}}];var Gr=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Iso Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function Vr(e){var t=Object(D.c)(Y),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:"",code:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:"",code:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Currency,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){return N()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{code:"Iso Code"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Currency).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Currency).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Gr,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){x(""),y(a.find((function(t){return t.id==e})))}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Currency).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:Hr,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var Hr=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}}];var qr=function(e){var t=e._setmodel,n=e.error,a=e.model,c=void 0===a?{}:a,r=e.Positions,i=e.fetchPositions;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:c.name}),Object(me.jsx)("label",{children:"Adresse"}),Object(me.jsx)(fe.a,{value:c.address,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{address:e})}))}}),Object(me.jsx)("label",{children:"Email"}),Object(me.jsx)(fe.a,{block:!0,placeholder:"example@cc.ccc ",value:c.email,onChange:function(e){var n=Object(o.a)(Object(o.a)({},c),{},{email:e});t(n)}}),Object(me.jsx)("label",{children:"T\xe9lephones"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:c.phones?c.phones.split(","):[],onChange:function(e){c.phones=e.join(",");var n=Object(o.a)({},c);t(n)}}),Object(me.jsx)("label",{children:"position"}),Object(me.jsx)(Ze.a,{onSearch:function(e){return i(e)},data:[{label:"Tout",value:null}].concat(r.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:c.positionId,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{positionId:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function Zr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)({q:"",page:1,take:50,clientType:1,isCCA:!1}),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(""),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)({phones:"",emails:"",name:"",address:""}),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(ye.a),P=Object(s.a)(N,2),k=(P[0],P[1]),A=function(){S({phones:"",emails:"",name:"",address:""}),y("")},M=function(){k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Employee,m).fetchAll().then((function(e){r(e.data.data),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))},T=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.EmployeePosition,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))};return Object(c.useEffect)((function(){M(),T()}),[m.page,m.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return M()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){x((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{ActionOnClose:A,noExport:!0,size:"md",save:function(){var e=Object(Ke.a)(E,[{name:"Nom"}]);e?y(e):(k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),E.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Employee).update(E.id,E).then((function(e){M(),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),A(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Employee).create(E).then((function(e){console.log(e),M(),A(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(qr,{error:v,model:E,_setmodel:S,Positions:O,fetchPositions:function(e){return T(e,!1)}})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(""),S(a.find((function(t){return t.id==e})))}(e),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Employee).delete(e).then((function(e){M(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return y(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:Jr,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:m.take,activePage:m.page,onChangePage:function(e){window.scrollTo(0,0),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var Jr=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"position",name:"Position",render:function(e){return Object(me.jsx)("b",{children:e&&e.name})}},{value:"address",name:"Adresse",render:function(e){return Object(me.jsx)("i",{style:{color:"#232323"},children:e})}},{value:"email",name:"Email",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:Object(me.jsx)("a",{href:"mailto:"+e,style:{display:"inline-block",margin:"5px",border:"1px solid rgba(93,120,255,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})})}},{value:"phones",name:"Num\xe9ros de t\xe9l\xe9phones",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"tel:"+e,style:{color:"rgba(11,150,102,1)",display:"inline-block",margin:"5px",border:"1px solid rgba(11,150,102,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}}];var Xr=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function Qr(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.EmployeePosition,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){return N()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.EmployeePosition).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.EmployeePosition).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Xr,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(a.find((function(t){return t.id==e}))),x("")}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.EmployeePosition).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:$r,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var $r=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}}];var ei=function(e){var t=e._setmodel,n=e.error,a=e.model,c=Object(D.d)(Y);return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsxs)(be.a,{s:3,m:3,l:3,xl:3,className:"p-10",children:[" ",Object(me.jsx)("label",{children:"Source:"}),Object(me.jsx)(Ze.a,{data:c.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:a.currencySourceId,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},a),{},{currencySourceId:e})}))}})]}),Object(me.jsxs)(be.a,{s:3,m:3,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Rate"}),Object(me.jsx)(fe.a,{type:"number",step:"0.001",value:a.rate,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{rate:e})}))}})," "]}),Object(me.jsxs)(be.a,{s:3,m:3,l:3,xl:3,className:"p-10",children:[" ",Object(me.jsx)("label",{children:"Currency:"}),Object(me.jsx)(Ze.a,{data:c.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:a.currencyId,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},a),{},{currencyId:e})}))}})]}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function ti(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=(l[0],l[1],Object(D.d)(Y)),d=Object(c.useState)(""),j=Object(s.a)(d,2),b=j[0],O=j[1],f=Object(c.useState)({rate:1,currencySourceId:0,currencyId:0}),h=Object(s.a)(f,2),p=h[0],m=h[1],x=Object(D.c)(ye.a),g=Object(s.a)(x,2),_=(g[0],g[1]),v=function(){m((function(e){return{rate:1,currencySourceId:0,currencyId:0}})),O("")},y=function(){_((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Exchange,{}).fetchAll().then((function(e){r(e.data.map((function(e,t){return Object(o.a)(Object(o.a)({},e),{},{id:t+1})})))})).catch((function(e){return O(e.Message)}))},C=[{value:"currencySourceId",name:"Source",render:function(e){return Object(me.jsx)("a",{children:u.find((function(t){return t.id==e}))?u.find((function(t){return t.id==e})).name:"-"})}},{value:"rate",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"currencyId",name:"---",render:function(e){return Object(me.jsx)("a",{children:u.find((function(t){return t.id==e}))?u.find((function(t){return t.id==e})).name:"-"})}}];return Object(c.useEffect)((function(){return y()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(p,[{name:"Nom"},{code:"Iso Code"}])&&!1;e?O(e):(_((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),p.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Exchange+"/update").create(Object(o.a)(Object(o.a)({},p),{},{rate:Number(p.rate)})).then((function(e){y(),_((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),v(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){O(e.Message),_((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Exchange).create(Object(o.a)(Object(o.a)({},p),{},{rate:Number(p.rate)})).then((function(e){y(),v(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),_((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){O(e.Message),_((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})),v())},AddComponent:Object(me.jsx)(ei,{error:b,model:p,_setmodel:m})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){O(""),console.log(e),m(a.find((function(t){return t.id===e})))}(e),console.log(a),_((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Exchange).delete(e).then((function(e){y(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return O(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:C,rows:a})]})}function ni(){var e=Object(D.d)(Y),t=Object(c.useState)(0),n=Object(s.a)(t,2),a=n[0],r=n[1];return Object(me.jsx)("div",{children:Object(me.jsxs)(be.a,{xl:6,l:6,children:[Object(me.jsx)("h4",{children:"Devise Par defaut :"}),Object(me.jsx)(Ze.a,{data:e.map((function(e){return{label:e.name,value:e.id}})),block:!0,noSearch:!0,value:a,onSelect:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Currency,{id:e},"/SetDefault").customGet().then((function(e){return alert("suvagard\xe9")})),r(e)}})]})})}var ai=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function ci(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.ServiceType,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){return N()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.ServiceType).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.ServiceType).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(ai,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(a.find((function(t){return t.id==e}))),x("")}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.ServiceType).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:ri,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var ri=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}}];var ii=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function oi(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){return N()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(ii,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(a.find((function(t){return t.id==e}))),x("")}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:si,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var si=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}}],li=function e(){Object(U.a)(this,e),this.baseFare=0,this.serviceFees=0,this.serviceFeesTVA=0,this.tax=0,this.totalRefund=0,this.commissionRefund=0,this.refundTax=0,this.emd=0,this.totalTTC=0,this.segments=[]},ui=Object(D.b)({key:"ticketSate",default:new li}),di=[{id:"AF",name:"Afghanistan",continent:"Asia",currencyId:"AFN",phoneCode:"93",flag:"\ud83c\udde6\ud83c\uddeb"},{id:"AX",name:"\xc5land Islands",continent:"Europe",currencyId:"EUR",phoneCode:"35818",flag:"\ud83c\udde6\ud83c\uddfd"},{id:"AL",name:"Albania",continent:"Europe",currencyId:"ALL",phoneCode:"355",flag:"\ud83c\udde6\ud83c\uddf1"},{id:"DZ",name:"Algeria",continent:"Africa",currencyId:"DZD",phoneCode:"213",flag:"\ud83c\udde9\ud83c\uddff"},{id:"AS",name:"American Samoa",continent:"Australia",currencyId:"USD",phoneCode:"1684",flag:"\ud83c\udde6\ud83c\uddf8"},{id:"AD",name:"Andorra",continent:"Europe",currencyId:"EUR",phoneCode:"376",flag:"\ud83c\udde6\ud83c\udde9"},{id:"AO",name:"Angola",continent:"Africa",currencyId:"AOA",phoneCode:"244",flag:"\ud83c\udde6\ud83c\uddf4"},{id:"AI",name:"Anguilla",continent:"North America",currencyId:"XCD",phoneCode:"1264",flag:"\ud83c\udde6\ud83c\uddee"},{id:"AQ",name:"Antarctica",continent:"Antarctica",currencyId:"-/-",phoneCode:"672",flag:"\ud83c\udde6\ud83c\uddf6"},{id:"AG",name:"Antigua And Barbuda",continent:"North America",currencyId:"XCD",phoneCode:"1268",flag:"\ud83c\udde6\ud83c\uddec"},{id:"AR",name:"Argentina",continent:"South America",currencyId:"ARS",phoneCode:"54",flag:"\ud83c\udde6\ud83c\uddf7"},{id:"AM",name:"Armenia",continent:"Asia",currencyId:"AMD",phoneCode:"374",flag:"\ud83c\udde6\ud83c\uddf2"},{id:"AW",name:"Aruba",continent:"North America",currencyId:"ANG",phoneCode:"297",flag:"\ud83c\udde6\ud83c\uddfc"},{id:"AC",name:"Ascension Island",continent:"Africa",currencyId:"SHP",phoneCode:"247",flag:"\ud83c\udde6\ud83c\udde8"},{id:"AU",name:"Australia",continent:"Australia",currencyId:"AUD",phoneCode:"61",flag:"\ud83c\udde6\ud83c\uddfa"},{id:"AT",name:"Austria",continent:"Europe",currencyId:"EUR",phoneCode:"43",flag:"\ud83c\udde6\ud83c\uddf9"},{id:"AZ",name:"Azerbaijan",continent:"Asia",currencyId:"AZN",phoneCode:"994",flag:"\ud83c\udde6\ud83c\uddff"},{id:"BS",name:"Bahamas",continent:"North America",currencyId:"BSD",phoneCode:"1242",flag:"\ud83c\udde7\ud83c\uddf8"},{id:"BH",name:"Bahrain",continent:"Asia",currencyId:"BHD",phoneCode:"973",flag:"\ud83c\udde7\ud83c\udded"},{id:"BD",name:"Bangladesh",continent:"Asia",currencyId:"BDT",phoneCode:"880",flag:"\ud83c\udde7\ud83c\udde9"},{id:"BB",name:"Barbados",continent:"North America",currencyId:"BBD",phoneCode:"1246",flag:"\ud83c\udde7\ud83c\udde7"},{id:"BY",name:"Belarus",continent:"Europe",currencyId:"BYR",phoneCode:"375",flag:"\ud83c\udde7\ud83c\uddfe"},{id:"BE",name:"Belgium",continent:"Europe",currencyId:"EUR",phoneCode:"32",flag:"\ud83c\udde7\ud83c\uddea"},{id:"BZ",name:"Belize",continent:"North America",currencyId:"BZD",phoneCode:"51",flag:"\ud83c\udde7\ud83c\uddff"},{id:"BJ",name:"Benin",continent:"Africa",currencyId:"XOF",phoneCode:"229",flag:"\ud83c\udde7\ud83c\uddef"},{id:"BM",name:"Bermuda",continent:"North America",currencyId:"BMD",phoneCode:"1441",flag:"\ud83c\udde7\ud83c\uddf2"},{id:"BT",name:"Bhutan",continent:"Asia",currencyId:"BTN",phoneCode:"975",flag:"\ud83c\udde7\ud83c\uddf9"},{id:"BO",name:"Bolivia",continent:"South America",currencyId:"BOB",phoneCode:"591",flag:"\ud83c\udde7\ud83c\uddf4"},{id:"BA",name:"Bosnia And Herzegovina",continent:"Europe",currencyId:"BAM",phoneCode:"387",flag:"\ud83c\udde7\ud83c\udde6"},{id:"BW",name:"Botswana",continent:"Africa",currencyId:"BWP",phoneCode:"267",flag:"\ud83c\udde7\ud83c\uddfc"},{id:"BV",name:"Bouvet Island",continent:"Antarctica",currencyId:"NOK",phoneCode:"47",flag:"\ud83c\udde7\ud83c\uddfb"},{id:"BR",name:"Brazil",continent:"South America",currencyId:"BRL",phoneCode:"55",flag:"\ud83c\udde7\ud83c\uddf7"},{id:"IO",name:"British Indian Ocean Territory",continent:"Asia",currencyId:"USD",phoneCode:"246",flag:"\ud83c\uddee\ud83c\uddf4"},{id:"VG",name:"British Virgin Islands",continent:"North America",currencyId:"USD",phoneCode:"1284",flag:"\ud83c\uddfb\ud83c\uddec"},{id:"BN",name:"Brunei Darussalam",continent:"Asia",currencyId:"BND",phoneCode:"673",flag:"\ud83c\udde7\ud83c\uddf3"},{id:"BG",name:"Bulgaria",continent:"Europe",currencyId:"BGN",phoneCode:"359",flag:"\ud83c\udde7\ud83c\uddec"},{id:"BF",name:"Burkina Faso",continent:"Africa",currencyId:"XOF",phoneCode:"226",flag:"\ud83c\udde7\ud83c\uddeb"},{id:"MM",name:"Burma",continent:"Asia",currencyId:"MMK",phoneCode:"95",flag:"\ud83c\uddf2\ud83c\uddf2"},{id:"BI",name:"Burundi",continent:"Africa",currencyId:"BIF",phoneCode:"257",flag:"\ud83c\udde7\ud83c\uddee"},{id:"CI",name:"C\xd4te D'ivoire",continent:"Africa",currencyId:"XOF",phoneCode:"225",flag:"\ud83c\udde8\ud83c\uddee"},{id:"KH",name:"Cambodia",continent:"Asia",currencyId:"KHR",phoneCode:"855",flag:"\ud83c\uddf0\ud83c\udded"},{id:"CM",name:"Cameroon",continent:"Africa",currencyId:"XAF",phoneCode:"237",flag:"\ud83c\udde8\ud83c\uddf2"},{id:"CA",name:"Canada",continent:"North America",currencyId:"CAD",phoneCode:"1",flag:"\ud83c\udde8\ud83c\udde6"},{id:"IC",name:"Canary Islands",continent:"Europe",currencyId:"EUR",phoneCode:"34",flag:"\ud83c\uddee\ud83c\udde8"},{id:"CV",name:"Cape Verde",continent:"Africa",currencyId:"CVE",phoneCode:"238",flag:"\ud83c\udde8\ud83c\uddfb"},{id:"KY",name:"Cayman Islands",continent:"North America",currencyId:"KYD",phoneCode:"1345",flag:"\ud83c\uddf0\ud83c\uddfe"},{id:"CF",name:"Central African Republic",continent:"Africa",currencyId:"XAF",phoneCode:"236",flag:"\ud83c\udde8\ud83c\uddeb"},{id:"TD",name:"Chad",continent:"Africa",currencyId:"XAF",phoneCode:"235",flag:"\ud83c\uddf9\ud83c\udde9"},{id:"CL",name:"Chile",continent:"South America",currencyId:"CLP",phoneCode:"56",flag:"\ud83c\udde8\ud83c\uddf1"},{id:"CN",name:"China",continent:"Asia",currencyId:"CNY",phoneCode:"86",flag:"\ud83c\udde8\ud83c\uddf3"},{id:"CX",name:"Christmas Island",continent:"Asia",currencyId:"AUD",phoneCode:"61",flag:"\ud83c\udde8\ud83c\uddfd"},{id:"CC",name:"Cocos (keeling) Islands",continent:"Asia",currencyId:"AUD",phoneCode:"891",flag:"\ud83c\udde8\ud83c\udde8"},{id:"CO",name:"Colombia",continent:"South America",currencyId:"COP",phoneCode:"57",flag:"\ud83c\udde8\ud83c\uddf4"},{id:"KM",name:"Comoros",continent:"Africa",currencyId:"KMF",phoneCode:"269",flag:"\ud83c\uddf0\ud83c\uddf2"},{id:"CG",name:"Congo",continent:"Africa",currencyId:"XAF",phoneCode:"242",flag:"\ud83c\udde8\ud83c\uddec"},{id:"CD",name:"Congo, The Democratic Republic Of The",continent:"Africa",currencyId:"CDF",phoneCode:"243",flag:"\ud83c\udde8\ud83c\udde9"},{id:"CK",name:"Cook Islands",continent:"Australia",currencyId:"NZD",phoneCode:"682",flag:"\ud83c\udde8\ud83c\uddf0"},{id:"CR",name:"Costa Rica",continent:"North America",currencyId:"CRC",phoneCode:"56",flag:"\ud83c\udde8\ud83c\uddf7"},{id:"HR",name:"Croatia",continent:"Europe",currencyId:"HRK",phoneCode:"385",flag:"\ud83c\udded\ud83c\uddf7"},{id:"CU",name:"Cuba",continent:"North America",currencyId:"CUP",phoneCode:"53",flag:"\ud83c\udde8\ud83c\uddfa"},{id:"CY",name:"Cyprus",continent:"Asia",currencyId:"EUR",phoneCode:"357",flag:"\ud83c\udde8\ud83c\uddfe"},{id:"CZ",name:"Czech Republic",continent:"Europe",currencyId:"CZK",phoneCode:"420",flag:"\ud83c\udde8\ud83c\uddff"},{id:"DK",name:"Denmark",continent:"Europe",currencyId:"DKK",phoneCode:"45",flag:"\ud83c\udde9\ud83c\uddf0"},{id:"DG",name:"Diego Garcia",continent:"Africa",currencyId:"GBP",phoneCode:"246",flag:"\ud83c\udde9\ud83c\uddec"},{id:"DJ",name:"Djibouti",continent:"Africa",currencyId:"DJF",phoneCode:"253",flag:"\ud83c\udde9\ud83c\uddef"},{id:"DM",name:"Dominica",continent:"North America",currencyId:"XCD",phoneCode:"1767",flag:"\ud83c\udde9\ud83c\uddf2"},{id:"DO",name:"Dominican Republic",continent:"South America",currencyId:"DOP",phoneCode:"1809",flag:"\ud83c\udde9\ud83c\uddf4"},{id:"TL",name:"East Timor",continent:"Australia",currencyId:"IDR",phoneCode:"670",flag:"\ud83c\uddf9\ud83c\uddf1"},{id:"EC",name:"Ecuador",continent:"South America",currencyId:"USD",phoneCode:"593",flag:"\ud83c\uddea\ud83c\udde8"},{id:"EG",name:"Egypt",continent:"Africa",currencyId:"EGP",phoneCode:"20",flag:"\ud83c\uddea\ud83c\uddec"},{id:"SV",name:"El Salvador",continent:"North America",currencyId:"SVC",phoneCode:"53",flag:"\ud83c\uddf8\ud83c\uddfb"},{id:"GQ",name:"Equatorial Guinea",continent:"Africa",currencyId:"XAF",phoneCode:"240",flag:"\ud83c\uddec\ud83c\uddf6"},{id:"ER",name:"Eritrea",continent:"Africa",currencyId:"ERN",phoneCode:"291",flag:"\ud83c\uddea\ud83c\uddf7"},{id:"EE",name:"Estonia",continent:"Europe",currencyId:"EEK",phoneCode:"372",flag:"\ud83c\uddea\ud83c\uddea"},{id:"ET",name:"Ethiopia",continent:"Africa",currencyId:"ETB",phoneCode:"251",flag:"\ud83c\uddea\ud83c\uddf9"},{id:"FK",name:"Falkland Islands (malvinas)",continent:"Africa",currencyId:"FLP",phoneCode:"500",flag:"\ud83c\uddeb\ud83c\uddf0"},{id:"FO",name:"Faroe Islands",continent:"Europe",currencyId:"DKK",phoneCode:"298",flag:"\ud83c\uddeb\ud83c\uddf4"},{id:"FJ",name:"Fiji",continent:"Australia",currencyId:"FJD",phoneCode:"679",flag:"\ud83c\uddeb\ud83c\uddef"},{id:"FI",name:"Finland",continent:"Europe",currencyId:"EUR",phoneCode:"358",flag:"\ud83c\uddeb\ud83c\uddee"},{id:"FR",name:"France",continent:"Europe",currencyId:"EUR",phoneCode:"33",flag:"\ud83c\uddeb\ud83c\uddf7"},{id:"GF",name:"French Guiana",continent:"South America",currencyId:"EUR",phoneCode:"594",flag:"\ud83c\uddeb\ud83c\uddf7"},{id:"PF",name:"French Polynesia",continent:"Australia",currencyId:"XPF",phoneCode:"689",flag:"\ud83c\uddf5\ud83c\uddeb"},{id:"TF",name:"French Southern Territories",continent:"Antarctica",currencyId:"EUR",phoneCode:"262",flag:"\ud83c\uddf9\ud83c\uddeb"},{id:"GA",name:"Gabon",continent:"Africa",currencyId:"XAF",phoneCode:"241",flag:"\ud83c\uddec\ud83c\udde6"},{id:"GE",name:"Georgia",continent:"Europe",currencyId:"GEL",phoneCode:"995",flag:"\ud83c\uddec\ud83c\uddea"},{id:"DE",name:"Germany",continent:"Europe",currencyId:"EUR",phoneCode:"49",flag:"\ud83c\udde9\ud83c\uddea"},{id:"GH",name:"Ghana",continent:"Africa",currencyId:"GHC",phoneCode:"233",flag:"\ud83c\uddec\ud83c\udded"},{id:"GI",name:"Gibraltar",continent:"Africa",currencyId:"GIP",phoneCode:"350",flag:"\ud83c\uddec\ud83c\uddee"},{id:"GR",name:"Greece",continent:"Europe",currencyId:"EUR",phoneCode:"30",flag:"\ud83c\uddec\ud83c\uddf7"},{id:"GL",name:"Greenland",continent:"North America",currencyId:"DKK",phoneCode:"299",flag:"\ud83c\uddec\ud83c\uddf1"},{id:"GD",name:"Grenada",continent:"North America",currencyId:"XCD",phoneCode:"1473",flag:"\ud83c\uddec\ud83c\udde9"},{id:"GP",name:"Guadeloupe",continent:"North America",currencyId:"EUR",phoneCode:"590",flag:"\ud83c\uddec\ud83c\uddf5"},{id:"GU",name:"Guam",continent:"Asia",currencyId:"USD",phoneCode:"1671",flag:"\ud83c\uddec\ud83c\uddfa"},{id:"GT",name:"Guatemala",continent:"North America",currencyId:"GTQ",phoneCode:"52",flag:"\ud83c\uddec\ud83c\uddf9"},{id:"GG",name:"Guernsey",continent:"Europe",currencyId:"GGP",phoneCode:"44148",flag:"\ud83c\uddec\ud83c\uddec"},{id:"GN",name:"Guinea",continent:"Africa",currencyId:"GNF",phoneCode:"224",flag:"\ud83c\uddec\ud83c\uddf3"},{id:"GW",name:"Guinea-Bissau",continent:"Africa",currencyId:"XOF",phoneCode:"245",flag:"\ud83c\uddec\ud83c\uddfc"},{id:"GY",name:"Guyana",continent:"South America",currencyId:"GYD",phoneCode:"592",flag:"\ud83c\uddec\ud83c\uddfe"},{id:"HT",name:"Haiti",continent:"North America",currencyId:"USD",phoneCode:"59",flag:"\ud83c\udded\ud83c\uddf9"},{id:"HM",name:"Heard Island And Mcdonald Islands",continent:"Australia",currencyId:"AUD",phoneCode:"61",flag:"\ud83c\udded\ud83c\uddf2"},{id:"HN",name:"Honduras",continent:"North America",currencyId:"HNL",phoneCode:"54",flag:"\ud83c\udded\ud83c\uddf3"},{id:"HK",name:"Hong Kong",continent:"Asia",currencyId:"HKD",phoneCode:"852",flag:"\ud83c\udded\ud83c\uddf0"},{id:"HU",name:"Hungary",continent:"Europe",currencyId:"HUF",phoneCode:"36",flag:"\ud83c\udded\ud83c\uddfa"},{id:"IS",name:"Iceland",continent:"Europe",currencyId:"ISK",phoneCode:"354",flag:"\ud83c\udde6\ud83c\uddfd"},{id:"IN",name:"India",continent:"Asia",currencyId:"INR",phoneCode:"91",flag:"\ud83c\uddee\ud83c\uddf3"},{id:"ID",name:"Indonesia",continent:"Asia",currencyId:"IDR",phoneCode:"62",flag:"\ud83c\uddee\ud83c\udde9"},{id:"IR",name:"Iran",continent:"Asia",currencyId:"IRN",phoneCode:"98",flag:"\ud83c\uddee\ud83c\uddf7"},{id:"IQ",name:"Iraq",continent:"Asia",currencyId:"IDR",phoneCode:"964",flag:"\ud83c\uddee\ud83c\uddf6"},{id:"IE",name:"Ireland",continent:"Europe",currencyId:"EUR",phoneCode:"353",flag:"\ud83c\uddee\ud83c\uddea"},{id:"IM",name:"Isle Of Man",continent:"Europe",currencyId:"IMP",phoneCode:"44",flag:"\ud83c\uddee\ud83c\uddf2"},{id:"IL",name:"Israel",continent:"Asia",currencyId:"ILS",phoneCode:"972",flag:"\ud83c\uddee\ud83c\uddf1"},{id:"IT",name:"Italy",continent:"Europe",currencyId:"EUR",phoneCode:"39",flag:"\ud83c\uddee\ud83c\uddf9"},{id:"JM",name:"Jamaica",continent:"North America",currencyId:"JMD",phoneCode:"1876",flag:"\ud83c\uddef\ud83c\uddf2"},{id:"JP",name:"Japan",continent:"Asia",currencyId:"JPY",phoneCode:"81",flag:"\ud83c\uddef\ud83c\uddf5"},{id:"JE",name:"Jersey",continent:"Europe",currencyId:"JEP",phoneCode:"44",flag:"\ud83c\uddef\ud83c\uddea"},{id:"JO",name:"Jordan",continent:"Asia",currencyId:"JOD",phoneCode:"962",flag:"\ud83c\uddef\ud83c\uddf4"},{id:"KZ",name:"Kazakhstan",continent:"Asia",currencyId:"KZT",phoneCode:"7",flag:"\ud83c\uddf0\ud83c\uddff"},{id:"KE",name:"Kenya",continent:"Africa",currencyId:"KES",phoneCode:"254",flag:"\ud83c\uddf0\ud83c\uddea"},{id:"KI",name:"Kiribati",continent:"Australia",currencyId:"AUD",phoneCode:"686",flag:"\ud83c\uddf0\ud83c\uddee"},{id:"KW",name:"Kuwait",continent:"Asia",currencyId:"KWD",phoneCode:"965",flag:"\ud83c\uddf0\ud83c\uddfc"},{id:"KG",name:"Kyrgyzstan",continent:"Asia",currencyId:"KGS",phoneCode:"996",flag:"\ud83c\uddf0\ud83c\uddec"},{id:"LA",name:"Lao People's Democratic Republic",continent:"Asia",currencyId:"LAK",phoneCode:"856",flag:"\ud83c\uddf1\ud83c\udde6"},{id:"LV",name:"Latvia",continent:"Europe",currencyId:"LVL",phoneCode:"371",flag:"\ud83c\uddf1\ud83c\uddfb"},{id:"LB",name:"Lebanon",continent:"Asia",currencyId:"LBP",phoneCode:"961",flag:"\ud83c\uddf1\ud83c\udde7"},{id:"LS",name:"Lesotho",continent:"Africa",currencyId:"LSL",phoneCode:"266",flag:"\ud83c\uddf1\ud83c\uddf8"},{id:"LR",name:"Liberia",continent:"Africa",currencyId:"LRD",phoneCode:"231",flag:"\ud83c\uddf1\ud83c\uddf7"},{id:"LY",name:"Libya",continent:"Africa",currencyId:"LYD",phoneCode:"218",flag:"\ud83c\uddf1\ud83c\uddfe"},{id:"LI",name:"Liechtenstein",continent:"Europe",currencyId:"CHF",phoneCode:"423",flag:"\ud83c\uddf1\ud83c\uddee"},{id:"LT",name:"Lithuania",continent:"Europe",currencyId:"EUR",phoneCode:"370",flag:"\ud83c\uddf1\ud83c\uddf9"},{id:"LU",name:"Luxembourg",continent:"Europe",currencyId:"EUR",phoneCode:"352",flag:"\ud83c\uddf1\ud83c\uddfa"},{id:"MO",name:"Macao",continent:"Asia",currencyId:"MOP",phoneCode:"853",flag:"\ud83c\uddf2\ud83c\uddf4"},{id:"MG",name:"Madagascar",continent:"Africa",currencyId:"MGA",phoneCode:"261",flag:"\ud83c\uddf2\ud83c\uddec"},{id:"MW",name:"Malawi",continent:"Africa",currencyId:"MWK",phoneCode:"265",flag:"\ud83c\uddf2\ud83c\uddfc"},{id:"MY",name:"Malaysia",continent:"Asia",currencyId:"MYR",phoneCode:"60",flag:"\ud83c\uddf2\ud83c\uddfe"},{id:"MV",name:"Maldives",continent:"Asia",currencyId:"MVR",phoneCode:"960",flag:"\ud83c\uddf2\ud83c\uddfb"},{id:"ML",name:"Mali",continent:"Africa",currencyId:"XOF",phoneCode:"223",flag:"\ud83c\uddf2\ud83c\uddf1"},{id:"MT",name:"Malta",continent:"Europe",currencyId:"EUR",phoneCode:"356",flag:"\ud83c\uddf2\ud83c\uddf9"},{id:"MH",name:"Marshall Islands",continent:"Australia",currencyId:"USD",phoneCode:"692",flag:"\ud83c\uddf2\ud83c\udded"},{id:"MQ",name:"Martinique",continent:"North America",currencyId:"EUR",phoneCode:"596",flag:"\ud83c\uddf2\ud83c\uddf6"},{id:"MR",name:"Mauritania",continent:"Africa",currencyId:"MRO",phoneCode:"222",flag:"\ud83c\uddf2\ud83c\uddf7"},{id:"MU",name:"Mauritius",continent:"Africa",currencyId:"MUR",phoneCode:"230",flag:"\ud83c\uddf2\ud83c\uddfa"},{id:"YT",name:"Mayotte",continent:"Africa",currencyId:"EUR",phoneCode:"269",flag:"\ud83c\uddfe\ud83c\uddf9"},{id:"MX",name:"Mexico",continent:"North America",currencyId:"MXN",phoneCode:"52",flag:"\ud83c\uddf2\ud83c\uddfd"},{id:"FM",name:"Micronesia, Federated States Of",continent:"Australia",currencyId:"USD",phoneCode:"691",flag:"\ud83c\uddeb\ud83c\uddf2"},{id:"MD",name:"Moldova",continent:"Europe",currencyId:"MDL",phoneCode:"373",flag:"\ud83c\uddf2\ud83c\udde9"},{id:"MC",name:"Monaco",continent:"Europe",currencyId:"EUR",phoneCode:"377",flag:"\ud83c\uddf2\ud83c\udde8"},{id:"MN",name:"Mongolia",continent:"Asia",currencyId:"MNT",phoneCode:"976",flag:"\ud83c\uddf2\ud83c\uddf3"},{id:"ME",name:"Montenegro",continent:"Europe",currencyId:"EUR",phoneCode:"382",flag:"\ud83c\uddf2\ud83c\uddea"},{id:"MS",name:"Montserrat",continent:"North America",currencyId:"XCD",phoneCode:"1664",flag:"\ud83c\uddf2\ud83c\uddf8"},{id:"MA",name:"Morocco",continent:"Africa",currencyId:"MAD",phoneCode:"211",flag:"\ud83c\uddf2\ud83c\udde6"},{id:"MZ",name:"Mozambique",continent:"Africa",currencyId:"MZM",phoneCode:"258",flag:"\ud83c\uddf2\ud83c\uddff"},{id:"NA",name:"Namibia",continent:"Africa",currencyId:"ZAR",phoneCode:"264",flag:"\ud83c\uddf3\ud83c\udde6"},{id:"NR",name:"Nauru",continent:"Australia",currencyId:"AUD",phoneCode:"674",flag:"\ud83c\uddf3\ud83c\uddf7"},{id:"NP",name:"Nepal",continent:"Asia",currencyId:"NPR",phoneCode:"977",flag:"\ud83c\uddf3\ud83c\uddf5"},{id:"NL",name:"Netherlands",continent:"Europe",currencyId:"EUR",phoneCode:"31",flag:"\ud83c\uddf3\ud83c\uddf1"},{id:"AN",name:"Netherlands Antilles",continent:"North America",currencyId:"ANG",phoneCode:"599",flag:"\ud83c\uddf3\ud83c\uddf1"},{id:"NC",name:"New Caledonia",continent:"Australia",currencyId:"XPF",phoneCode:"687",flag:"\ud83c\uddf3\ud83c\udde8"},{id:"NZ",name:"New Zealand",continent:"Australia",currencyId:"NZD",phoneCode:"64",flag:"\ud83c\uddf3\ud83c\uddff"},{id:"NI",name:"Nicaragua",continent:"North America",currencyId:"NIO",phoneCode:"55",flag:"\ud83c\uddf3\ud83c\uddee"},{id:"NE",name:"Niger",continent:"Africa",currencyId:"XOF",phoneCode:"227",flag:"\ud83c\uddf3\ud83c\uddea"},{id:"NG",name:"Nigeria",continent:"Africa",currencyId:"NGN",phoneCode:"234",flag:"\ud83c\uddf3\ud83c\uddec"},{id:"NU",name:"Niue",continent:"Australia",currencyId:"NZD",phoneCode:"683",flag:"\ud83c\uddf3\ud83c\uddfa"},{id:"NF",name:"Norfolk Island",continent:"Australia",currencyId:"AUD",phoneCode:"6723",flag:"\ud83c\uddf3\ud83c\uddeb"},{id:"KP",name:"North Korea",continent:"Asia",currencyId:"KPW",phoneCode:"850",flag:"\ud83c\uddf0\ud83c\uddf5"},{id:"MP",name:"Northern Mariana Islands",continent:"Australia",currencyId:"USD",phoneCode:"1670",flag:"\ud83c\uddf2\ud83c\uddf5"},{id:"NO",name:"Norway",continent:"Europe",currencyId:"NOK",phoneCode:"47",flag:"\ud83c\uddf3\ud83c\uddf4"},{id:"OM",name:"Oman",continent:"Asia",currencyId:"OMR",phoneCode:"968",flag:"\ud83c\uddf4\ud83c\uddf2"},{id:"PK",name:"Pakistan",continent:"Asia",currencyId:"PKR",phoneCode:"92",flag:"\ud83c\uddf5\ud83c\uddf0"},{id:"PW",name:"Palau",continent:"Australia",currencyId:"USD",phoneCode:"680",flag:"\ud83c\uddf5\ud83c\uddfc"},{id:"PS",name:"Palestinian Territory",continent:"Asia",currencyId:"ILS",phoneCode:"970",flag:"\ud83c\uddf5\ud83c\uddf8"},{id:"PA",name:"Panama",continent:"South America",currencyId:"USD",phoneCode:"57",flag:"\ud83c\uddf5\ud83c\udde6"},{id:"PG",name:"Papua New Guinea",continent:"Australia",currencyId:"PGK",phoneCode:"675",flag:"\ud83c\uddf5\ud83c\uddec"},{id:"PY",name:"Paraguay",continent:"South America",currencyId:"PYG",phoneCode:"595",flag:"\ud83c\uddf5\ud83c\uddfe"},{id:"PE",name:"Peru",continent:"South America",currencyId:"PEN",phoneCode:"51",flag:"\ud83c\uddf5\ud83c\uddea"},{id:"PH",name:"Philippines",continent:"Asia",currencyId:"PHP",phoneCode:"63",flag:"\ud83c\uddf5\ud83c\udded"},{id:"PN",name:"Pitcairn",continent:"Australia",currencyId:"NZD",phoneCode:"649",flag:"\ud83c\uddf5\ud83c\uddf3"},{id:"PL",name:"Poland",continent:"Europe",currencyId:"PLN",phoneCode:"48",flag:"\ud83c\uddf5\ud83c\uddf1"},{id:"PT",name:"Portugal",continent:"Europe",currencyId:"EUR",phoneCode:"351",flag:"\ud83c\uddf5\ud83c\uddf9"},{id:"PR",name:"Puerto Rico",continent:"North America",currencyId:"USD",phoneCode:"1939",flag:"\ud83c\uddf5\ud83c\uddf7"},{id:"QA",name:"Qatar",continent:"Asia",currencyId:"QAR",phoneCode:"974",flag:"\ud83c\uddf6\ud83c\udde6"},{id:"RE",name:"R\xc9union",continent:"Africa",currencyId:"EUR",phoneCode:"262",flag:"\ud83c\uddf7\ud83c\uddea"},{id:"MK",name:"Republic of Macedonia",continent:"Europe",currencyId:"MKD",phoneCode:"389",flag:"\ud83c\uddf2\ud83c\uddf0"},{id:"RO",name:"Romania",continent:"Europe",currencyId:"RON",phoneCode:"40",flag:"\ud83c\uddf7\ud83c\uddf4"},{id:"RU",name:"Russian Federation",continent:"Asia",currencyId:"RUB",phoneCode:"7",flag:"\ud83c\uddf7\ud83c\uddfa"},{id:"RW",name:"Rwanda",continent:"Africa",currencyId:"RWF",phoneCode:"250",flag:"\ud83c\uddf7\ud83c\uddfc"},{id:"SH",name:"Saint Helena",continent:"Africa",currencyId:"SHP",phoneCode:"290",flag:"\ud83c\uddf8\ud83c\udded"},{id:"KN",name:"Saint Kitts And Nevis",continent:"North America",currencyId:"XCD",phoneCode:"1869",flag:"\ud83c\uddf0\ud83c\uddf3"},{id:"LC",name:"Saint Lucia",continent:"South America",currencyId:"XCD",phoneCode:"1758",flag:"\ud83c\uddf1\ud83c\udde8"},{id:"PM",name:"Saint Pierre And Miquelon",continent:"North America",currencyId:"EUR",phoneCode:"508",flag:"\ud83c\uddf5\ud83c\uddf2"},{id:"VC",name:"Saint Vincent and the Grenadines",continent:"South America",currencyId:"XCD",phoneCode:"1784",flag:"\ud83c\uddfb\ud83c\udde8"},{id:"WS",name:"Samoa",continent:"Australia",currencyId:"WST",phoneCode:"685",flag:"\ud83c\uddfc\ud83c\uddf8"},{id:"SM",name:"San Marino",continent:"Europe",currencyId:"EUR",phoneCode:"378",flag:"\ud83c\uddf8\ud83c\uddf2"},{id:"ST",name:"Sao Tome And Principe",continent:"Africa",currencyId:"STD",phoneCode:"239",flag:"\ud83c\uddf8\ud83c\uddf9"},{id:"SA",name:"Saudi Arabia",continent:"Asia",currencyId:"SAR",phoneCode:"966",flag:"\ud83c\uddf8\ud83c\udde6"},{id:"SN",name:"Senegal",continent:"Africa",currencyId:"XOF",phoneCode:"221",flag:"\ud83c\uddf8\ud83c\uddf3"},{id:"RS",name:"Serbia",continent:"Europe",currencyId:"RSD",phoneCode:"381",flag:"\ud83c\uddf7\ud83c\uddf8"},{id:"SC",name:"Seychelles",continent:"Africa",currencyId:"SCR",phoneCode:"248",flag:"\ud83c\uddf8\ud83c\udde8"},{id:"SL",name:"Sierra Leone",continent:"Africa",currencyId:"SLL",phoneCode:"232",flag:"\ud83c\uddf8\ud83c\uddf1"},{id:"SG",name:"Singapore",continent:"Asia",currencyId:"SGD",phoneCode:"65",flag:"\ud83c\uddf8\ud83c\uddec"},{id:"SK",name:"Slovakia",continent:"Europe",currencyId:"EUR",phoneCode:"421",flag:"\ud83c\uddf8\ud83c\uddf0"},{id:"SI",name:"Slovenia",continent:"Europe",currencyId:"EUR",phoneCode:"386",flag:"\ud83c\uddf8\ud83c\uddee"},{id:"SB",name:"Solomon Islands",continent:"Australia",currencyId:"SBD",phoneCode:"677",flag:"\ud83c\uddf8\ud83c\udde7"},{id:"SO",name:"Somalia",continent:"Africa",currencyId:"SOS",phoneCode:"252",flag:"\ud83c\uddf8\ud83c\uddf4"},{id:"ZA",name:"South Africa",continent:"Africa",currencyId:"ZAR",phoneCode:"27",flag:"\ud83c\uddff\ud83c\udde6"},{id:"GS",name:"South Georgia And The South Sandwich Islands",continent:"South America",currencyId:"GBP",phoneCode:"500",flag:"\ud83c\uddec\ud83c\uddf8"},{id:"KR",name:"South Korea",continent:"Asia",currencyId:"KRW",phoneCode:"82",flag:"\ud83c\uddf0\ud83c\uddf7"},{id:"ES",name:"Spain",continent:"Europe",currencyId:"EUR",phoneCode:"34",flag:"\ud83c\uddea\ud83c\uddf8"},{id:"LK",name:"Sri Lanka",continent:"Asia",currencyId:"LKR",phoneCode:"94",flag:"\ud83c\uddf1\ud83c\uddf0"},{id:"SD",name:"Sudan",continent:"Africa",currencyId:"SDD",phoneCode:"249",flag:"\ud83c\uddf8\ud83c\udde9"},{id:"SR",name:"Suriname",continent:"South America",currencyId:"SRD",phoneCode:"597",flag:"\ud83c\uddf8\ud83c\uddf7"},{id:"SJ",name:"Svalbard And Jan Mayen",continent:"Europe",currencyId:"NOK",phoneCode:"47",flag:"\ud83c\uddf8\ud83c\uddef"},{id:"SZ",name:"Swaziland",continent:"Africa",currencyId:"SZL",phoneCode:"268",flag:"\ud83c\uddf8\ud83c\uddff"},{id:"SE",name:"Sweden",continent:"Europe",currencyId:"SEK",phoneCode:"46",flag:"\ud83c\uddf8\ud83c\uddea"},{id:"CH",name:"Switzerland",continent:"Europe",currencyId:"CHF",phoneCode:"41",flag:"\ud83c\udde8\ud83c\udded"},{id:"SY",name:"Syrian Arab Republic",continent:"Asia",currencyId:"SYP",phoneCode:"963",flag:"\ud83c\uddf8\ud83c\uddfe"},{id:"TW",name:"Taiwan",continent:"Asia",currencyId:"TWD",phoneCode:"886",flag:"\ud83c\uddf9\ud83c\uddfc"},{id:"TJ",name:"Tajikistan",continent:"Asia",currencyId:"RUB",phoneCode:"992",flag:"\ud83c\uddf9\ud83c\uddef"},{id:"TZ",name:"Tanzania, United Republic Of",continent:"Africa",currencyId:"TZS",phoneCode:"255",flag:"\ud83c\uddf9\ud83c\uddff"},{id:"TH",name:"Thailand",continent:"Asia",currencyId:"THB",phoneCode:"66",flag:"\ud83c\uddf9\ud83c\udded"},{id:"GM",name:"The Gambia",continent:"Africa",currencyId:"GMD",phoneCode:"220",flag:"\ud83c\uddec\ud83c\uddf2"},{id:"TG",name:"Togo",continent:"Africa",currencyId:"XOF",phoneCode:"228",flag:"\ud83c\uddf9\ud83c\uddec"},{id:"TK",name:"Tokelau",continent:"Australia",currencyId:"NZD",phoneCode:"690",flag:"\ud83c\uddf9\ud83c\uddf0"},{id:"TO",name:"Tonga",continent:"Australia",currencyId:"TOP",phoneCode:"676",flag:"\ud83c\uddf9\ud83c\uddf4"},{id:"TT",name:"Trinidad And Tobago",continent:"South America",currencyId:"TTD",phoneCode:"1868",flag:"\ud83c\uddf9\ud83c\uddf9"},{id:"TA",name:"Tristan da Cunha",continent:"Africa",currencyId:"GBP",phoneCode:"290",flag:"\ud83c\uddf8\ud83c\udded"},{id:"TN",name:"Tunisia",continent:"Africa",currencyId:"TND",phoneCode:"216",flag:"\ud83c\uddf9\ud83c\uddf3"},{id:"TR",name:"Turkey",continent:"Asia",currencyId:"TRY",phoneCode:"90",flag:"\ud83c\uddf9\ud83c\uddf7"},{id:"TM",name:"Turkmenistan",continent:"Asia",currencyId:"TMM",phoneCode:"993",flag:"\ud83c\uddf9\ud83c\uddf2"},{id:"TC",name:"Turks And Caicos Islands",continent:"North America",currencyId:"USD",phoneCode:"1649",flag:"\ud83c\uddf9\ud83c\udde8"},{id:"TV",name:"Tuvalu",continent:"Australia",currencyId:"TVD",phoneCode:"688",flag:"\ud83c\uddf9\ud83c\uddfb"},{id:"UG",name:"Uganda",continent:"Africa",currencyId:"UGX",phoneCode:"256",flag:"\ud83c\uddfa\ud83c\uddec"},{id:"UA",name:"Ukraine",continent:"Europe",currencyId:"UAH",phoneCode:"380",flag:"\ud83c\uddfa\ud83c\udde6"},{id:"AE",name:"United Arab Emirates",continent:"Asia",currencyId:"AED",phoneCode:"971",flag:"\ud83c\udde6\ud83c\uddea"},{id:"GB",name:"United Kingdom",continent:"Europe",currencyId:"GBP",phoneCode:"44",flag:"\ud83c\uddec\ud83c\udde7"},{id:"US",name:"United States",continent:"North America",currencyId:"USD",phoneCode:"1",flag:"\ud83c\uddfa\ud83c\uddf8"},{id:"UY",name:"Uruguay",continent:"South America",currencyId:"UYU",phoneCode:"598",flag:"\ud83c\uddfa\ud83c\uddfe"},{id:"UZ",name:"Uzbekistan",continent:"Asia",currencyId:"UZS",phoneCode:"998",flag:"\ud83c\uddfa\ud83c\uddff"},{id:"VU",name:"Vanuatu",continent:"Australia",currencyId:"VUV",phoneCode:"678",flag:"\ud83c\uddfb\ud83c\uddfa"},{id:"VA",name:"Vatican City",continent:"Europe",currencyId:"EUR",phoneCode:"3906",flag:"\ud83c\uddfb\ud83c\udde6"},{id:"VE",name:"Venezuela",continent:"South America",currencyId:"VEB",phoneCode:"58",flag:"\ud83c\uddfb\ud83c\uddea"},{id:"VN",name:"Viet Nam",continent:"Asia",currencyId:"VND",phoneCode:"84",flag:"\ud83c\uddfb\ud83c\uddf3"},{id:"VI",name:"Virgin Islands, U.s.",continent:"South America",currencyId:"USD",phoneCode:"1340",flag:"\ud83c\uddfb\ud83c\uddee"},{id:"WF",name:"Wallis And Futuna",continent:"Australia",currencyId:"XPF",phoneCode:"681",flag:"\ud83c\uddfc\ud83c\uddeb"},{id:"EH",name:"Western Sahara",continent:"Africa",currencyId:"MAD",phoneCode:"212",flag:"\ud83c\uddea\ud83c\udded"},{id:"YE",name:"Yemen",continent:"Asia",currencyId:"YER",phoneCode:"967",flag:"\ud83c\uddfe\ud83c\uddea"},{id:"ZM",name:"Zambia",continent:"Africa",currencyId:"ZMK",phoneCode:"260",flag:"\ud83c\uddff\ud83c\uddf2"},{id:"ZW",name:"Zimbabwe",continent:"Africa",currencyId:"ZWD",phoneCode:"263",flag:"\ud83c\uddff\ud83c\uddfc"}],ji=function(e){Object(ze.a)(n,e);var t=Object(We.a)(n);function n(){var e;Object(U.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?d(e.data):O(e.data)}))},He=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.AgentBookingFlight,{q:e},"/autocomplete").customGet().then((function(e){return g(e.data)}))},Je=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((function(e){return C(e.data)}))},Xe=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Common,{q:e},"/autocompleteAirlines").customGet().then((function(e){return Ue(e.data)}))},Qe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/ticket",Object(o.a)(Object(o.a)({},he),{},{date:he.date?_e()(he.date).format("DD MMM YYYY"):null,page:e||he.page})).fetchAll().then((function(e){Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),M([]),console.log(e.data.data.filter((function(e){return e.ticket.emd}))),r(e.data.data),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),q(e.data.totalCount),Q(e.data.totalSale),ne(e.data.totalRefund),ie(e.data.totalCommission),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})).catch((function(e){return Ne(e.Message)}))},$e=function(e){Ne(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order).fetchById(e).then((function(e){Me(Object(o.a)({},e.data))})).catch((function(e){console.log(e)}))};Object(c.useEffect)((function(){Ve(),Xe(),Je(),He()}),[]),Object(c.useEffect)((function(){Qe()}),[he.page,he.take]);var et=[{value:"ticket",value2:"tag",value3:"id",name:"N\xb0",render:function(e,t,n){return Object(me.jsxs)("b",{style:{fontSize:"14px"},children:[Object(me.jsx)("img",{alt:"",src:e&&e.airlineCode&&Be.find((function(t){return t.id==e.airlineCode}))?Be.find((function(t){return t.id==e.airlineCode})).logo:""}),Object(me.jsx)(en.a,{onChange:function(e){A.find((function(e){return e==n}))?M((function(e){return e.filter((function(e){return e!=n}))})):M((function(e){return[].concat(Object(qe.a)(e),[n])}))},checked:null!=A.find((function(e){return e==n}))}),Object(me.jsx)("a",{style:{color:"#232323"},onClick:function(e){N(n),$e(n)},children:e?e.ticketNumber:""}),Object(me.jsx)("br",{}),t&&Object(me.jsxs)(Re.a,{color:e?"blue":"black",children:["#",t]})]})}},{value:"client",name:"Client",render:function(e){return Object(me.jsx)("a",{children:e&&e.name?e.name.toUpperCase():""})}},{value:"ticket",name:"PNR",render:function(e){return Object(me.jsx)("b",{style:{color:"#5a2c3e",fontSize:"13px"},children:e?e.pnr:""})}},{value:"customer",value2:"tag",name:"Voyageur",render:function(e,t){return Object(me.jsxs)("a",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",width:"100px"},children:[e?e.name.toUpperCase():"",Object(me.jsx)("br",{})," ",Object(me.jsx)("i",{style:{color:"#aaa"},children:e?e.passportNumber:""})]})}},{value:"totalPrice",value2:"currency",value3:"status",name:"Prix",render:function(e,t,n){return Object(me.jsxs)("b",{style:{color:"#53af50",fontSize:"16px",textDecoration:5==n?"line-through":""},children:[e.toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t.code})]})}},{value:"commission",value3:"commissionRefund",value2:"currency",name:"Com.",render:function(e,t,n){return Object(me.jsxs)("b",{style:{color:"#5a2c3e",fontSize:"15px"},children:[(e+n).toFixed(3)+" ",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t.code})]})}},{value:"ticket",name:"Statut",render:function(e){return Object(me.jsx)(me.Fragment,{children:Object(me.jsx)(Re.a,{color:e?"EMDS"==e.tranc?"blue":"RFND"==e.tranc||"RFBSP"==e.tranc?"green":"EMDA"==e.trancv?"violet":"ADM"==e.tranc?"orange":"CANX"==e.tranc?"red":"yellow":"yellow",children:e&&e.tranc})})}},{value:"ticket",name:"Emd T.",render:function(e){return Object(me.jsx)(me.Fragment,{children:e&&Object(me.jsx)(Re.a,{color:"violet",children:e&&e.emdNumber})})}},{value:"ticket",value2:"currency",name:"EMD",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"rgb(67,55,160)",fontSize:"16px"},children:[e?e.emd.toFixed(3):"-",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:e?t.code:""})]})}},{value:"totalRefund",value2:"currency",name:"M.Remb.",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"rgb(67,55,160)",fontSize:"16px"},children:[e?e.toFixed(3):"-",Object(me.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:e?t.code:""})]})}},{value:"ticket",name:"Date",render:function(e){return Object(me.jsx)("strong",{children:e?_e()(e.emissionDate).format("DD MMM YYYY"):"-"})}},{name:"d\xe9tails",value:"id",render:function(e){return Object(me.jsx)("button",{onClick:function(t){N(e),$e(e)},style:{color:"rgba(67,55,160,1)",padding:"6px 10px",fontSize:"12px",background:"rgba(67,55,160,0.1)",borderRadius:"4px"},children:Object(me.jsx)(_t.a,{})})}}],tt=function(e){var t,n=new Date(2e3+parseInt(e.slice(-2)),(t=e.slice(2,5),["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].findIndex((function(e){return e.toUpperCase()==t}))),e.slice(0,2));return _e()(n).format("YYYY-MM-DDTHH:mm:ss")};var nt=function e(t,n){B.a.createAPIEndpoint(pe.a.Order+"/Ticket").create(n[t]).then((function(a){t2&&de.find((function(t){return t.name==e["Agent Amadeus"].trim()}))&&(c.agentId=de.find((function(t){return t.name==e["Agent Amadeus"]})).id),n.ticket=c,n}));console.log(c.length),nt(0,c)}},a.readAsArrayBuffer(n)}},accept:".xlsx,.xls"}),Object(me.jsx)("div",{style:{textAlign:"right"},children:Object(me.jsxs)("button",{onClick:function(){var e=document.querySelector("input#hidden");console.log(e),e.click()},style:{padding:"7px 10px",background:"#330033",color:"#fff",fontSize:"14px",margin:"0 5px",border:"0 none ",borderRadius:"4px",cursor:"pointer"},children:["Choisir fichier"," "]})})]}),size:"lg",save:function(){console.log(Ae),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})}));var e=Object(o.a)({},Ae);delete e.tags,Ae.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/ticket").update(e.id,e).then((function(e){Qe(),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),Ge(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){Ne(e.Message),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):(console.log(e),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/ticket").create(e).then((function(e){Qe(),Ge(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){Ne(e.Message),Ye((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(_i,{tags:y,fetchTags:Je,error:De,clients:u,airlines:Be,fetchAirlines:Xe,fetchClients:function(e){return Ve(e,!1)},fetchAgentBookingFlights:He,agentBookingFlights:x})}),Object(me.jsxs)("div",{children:[Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{icon:Object(me.jsx)(nc.a,{}),notAmount:!0,text:"Total Billets",color:"245,195,35",amount:H})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Vente",color:"0,169,141",amount:X})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Remboursement",amount:te,color:"229,57,53"})}),Object(me.jsx)(be.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(me.jsx)(ht.a,{text:"Total Commission",amount:re})})]}),Object(me.jsxs)("div",{children:[Object(me.jsxs)("div",{onClick:function(e){return M((function(e){return e.length?[]:a.map((function(e){return e.id}))}))},style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(me.jsx)(en.a,{checked:A.length>0})," S\xe9lectionner Tout"]}),A.length?Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)(be.a,{m:6,l:3,xl:3,className:"p-10",children:Object(me.jsx)(Ze.a,{searchable:!1,data:u.map((function(e){return{value:e.id,label:e.name}})),block:!0,noSearch:!0,value:R,onSelect:function(e){U(e),alert(e)}})})," ",Object(me.jsxs)("button",{onClick:function(){A.map((function(e,t){return B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/ChangeClient").create({id:e,clientId:R}).then((function(e){t==A.length-1&&Qe()})).catch((function(e){console.log(e)}))}))},style:{color:"rgba(67,55,160,1)",padding:"6px 10px",fontSize:"12px",background:"rgba(67,55,160,0.1)",borderRadius:"4px"},children:[Object(me.jsx)(Yc.a,{})," "," ","enregistrer"]})]}):""]}),Object(me.jsx)(Ee.a,{loading:We.loading,actionKey:"id",actions:[{label:"rembourser",action:function(e){"TKTT"===a.find((function(t){return t.id===e})).ticket.tranc&&Y(e)},render:function(e,t){return Object(me.jsx)("button",{disabled:!["TKTT","EMDS"].includes(a.find((function(e){return e.id===t})).ticket.tranc),style:{color:"rgb(84,159,10)",padding:"6px 10px",fontSize:"12px",background:"rgba(84,159,10,0.1)",borderRadius:"4px"},children:e})}},{label:"annuler",action:function(e){var t;"TKTT"===a.find((function(t){return t.id===e})).ticket.tranc&&(t=e,Ne(""),B.a.createAPIEndpoint(B.a.ENDPOINTS.Order,{},"/Cancel/"+t).customGet().then((function(e){Qe()})).catch((function(e){console.log(e)})))},render:function(e,t){return Object(me.jsx)("button",{disabled:!["TKTT","EMDS"].includes(a.find((function(e){return e.id===t})).ticket.tranc),style:{color:"rgb(236,71,40)",padding:"6px 10px",fontSize:"12px",background:"rgba(236,71,40,0.1)",borderRadius:"4px"},children:e})}},{label:"Changer Commission",action:function(e){ue(e)},render:function(e,t){return Object(me.jsx)("button",{disabled:["CANX"].includes(a.find((function(e){return e.id===t})).ticket.tranc),style:{color:"rgb(0,169,141)",padding:"6px 10px",fontSize:"12px",background:"rgba(0,169,141,0.1)",borderRadius:"4px"},children:e})}}],columns:et,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:H,limitOptions:[10,20,50,100],limit:he.take,activePage:he.page,onChangePage:function(e){window.scrollTo(0,0),xe((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),xe((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})}),Object(me.jsx)(Mi,{model:Ae,open:0!=S,handleClose:function(){return N(0)}}),Object(me.jsx)(Ui,{refresh:Qe,open:W,handleClose:function(){Y(null),Qe()}}),Object(me.jsx)(Li,{clientId:a.find((function(e){return e.id==le}))&&a.find((function(e){return e.id==le})).clientId,id:le,open:0!=le,handleClose:function(){return ue(0)},refresh:Qe})]})}var Ui=function(e){var t=e.size,n=e.open,a=e.handleClose,r=(e.clientId,e.refresh),i=Object(c.useState)({id:0,date:"2022-08-11T10:06:09.649Z",totalRefund:0,commissionRefund:0}),l=Object(s.a)(i,2),u=l[0],d=l[1];Object(c.useEffect)((function(){d((function(e){return{date:"2022-08-11T10:06:09.649Z",totalRefund:0,commissionRefund:0,id:n}}))}),[n]);return Object(me.jsxs)(dt.a,{size:t||"lg",overflow:!1,open:n,onClose:a,children:[Object(me.jsx)(dt.a.Header,{children:Object(me.jsx)(dt.a.Title,{children:"Rembourser Ticket"})}),Object(me.jsxs)(dt.a.Body,{children:[Object(me.jsxs)(be.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Date de remboursement:"}),Object(me.jsx)(fe.a,{type:"date",value:u.date,onChange:function(e){return d(Object(o.a)(Object(o.a)({},u),{},{date:e}))}})]}),Object(me.jsx)("h6",{children:"Remboursement"}),Object(me.jsxs)(be.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(me.jsx)("label",{children:"Frais de service :"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:u.commissionRefund,onChange:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{commissionRefund:parseFloat(e)})}))}})]}),Object(me.jsxs)(be.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant Total \xe0 rembourser:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:u.totalRefund,onChange:function(e){d((function(t){return Object(o.a)(Object(o.a)({},t),{},{totalRefund:parseFloat(e)})}))}})]})]}),Object(me.jsxs)(dt.a.Footer,{children:[Object(me.jsx)(he.a,{onClick:function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/RFND").create(u).then((function(e){a(),r()})).catch((function(e){console.log(e)}))},appearance:"primary",children:"rembourser"})," ",Object(me.jsx)(he.a,{onClick:a,appearance:"subtle",children:"fermer"})]})]})},Li=function(e){var t=e.open,n=e.handleClose,a=e.id,r=e.clientId,i=e.refresh,o=Object(c.useState)(0),l=Object(s.a)(o,2),u=l[0],d=l[1];return Object(c.useEffect)((function(){d(0)}),[a]),Object(me.jsxs)(dt.a,{size:"sm",overflow:!1,open:t,onClose:n,children:[Object(me.jsx)(dt.a.Header,{children:Object(me.jsx)(dt.a.Title,{children:"Changer Commission Ticket"})}),Object(me.jsx)(dt.a.Body,{children:Object(me.jsxs)(be.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Montant :"}),Object(me.jsx)(fe.a,{type:"number",value:u,onChange:function(e){return d(parseFloat(e))}})]})}),Object(me.jsxs)(dt.a.Footer,{children:[Object(me.jsx)(he.a,{onClick:function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/CommissionClient").create({id:a,commission:u,clientId:r}).then((function(e){n(),i()})).catch((function(e){console.log(e)}))},appearance:"primary",children:"modifier"})," ",Object(me.jsx)(he.a,{onClick:n,appearance:"subtle",children:"fermer"})]})]})};var Fi=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}}),Object(me.jsx)("label",{children:"Ville"}),Object(me.jsx)(fe.a,{value:a.city,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{city:e})}))}}),Object(me.jsx)("label",{children:"Adresse"}),Object(me.jsx)(fe.a,{value:a.address,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{address:e})}))}}),Object(me.jsx)("label",{children:"Emails"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.emails?a.emails.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.emails=e.join(","),t(n)}}),Object(me.jsx)("label",{children:"T\xe9lephones"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.phones?a.phones.split(","):[],onChange:function(e){a.phones=e.join(",");var n=Object(o.a)({},a);t(n)}}),Object(me.jsx)("label",{children:"Code Tax "}),Object(me.jsx)(fe.a,{value:a.taxCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{taxCode:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})},Ki=function(e){return console.log(e),[{columns:[{title:"Nom",width:{wpx:120}},{title:"Code",width:{wpx:80}},{title:"Code Tax",width:{wpx:80}},{title:"Adresse",width:{wpx:150}},{title:"Emails",width:{wpx:150}},{title:"Num\xe9ros de t\xe9l\xe9phones",width:{wpx:150}},{title:"Type",width:{wpx:100}}],data:e.map((function(e){return[{value:e.name,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.code,style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.taxCode,style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:e.address,style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.emails,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13"},alignment:{horizontal:"center"}}},{value:e.phones,style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:1!=e.clientType?"B2C":"B2B",style:{font:{sz:"14",color:{rgb:1==e.clientType?"673ab7":"f0b217"}},alignment:{horizontal:"center"}}}]}))}]};function zi(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20,clientType:1,isCCA:!0}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(new Ve(1,!0)),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y(new Ve(1,!0)),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){return N()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return N()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{excelData:Ki(a),nameExcel:"client",size:"md",save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{code:"Code"},{taxCode:"Tax Code"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Fi,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){x(""),y(a.find((function(t){return t.id==e})))}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:Wi,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var Wi=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"taxCode",name:"Code Tax",render:function(e){return Object(me.jsx)("b",{style:{color:"green"},children:e})}},{value:"address",name:"Adresse",render:function(e){return Object(me.jsx)("i",{style:{color:"#232323"},children:e})}},{value:"emails",name:"Emails",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"mailto:"+e,style:{display:"inline-block",margin:"5px",border:"1px solid rgba(93,120,255,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}},{value:"phones",name:"Num\xe9ros de t\xe9l\xe9phones",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"tel:"+e,style:{color:"rgba(11,150,102,1)",display:"inline-block",margin:"5px",border:"1px solid rgba(11,150,102,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}}];var Yi=function(e){var t=e._setmodel,n=e.error,a=e.model,c=e.clients,r=e.fetchClients;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}}),Object(me.jsx)("label",{children:"Ville"}),Object(me.jsx)(fe.a,{value:a.city,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{city:e})}))}}),Object(me.jsx)("label",{children:"Adresse"}),Object(me.jsx)(fe.a,{value:a.address,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{address:e})}))}}),Object(me.jsx)("label",{children:"Emails"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.emails?a.emails.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.emails=e.join(","),t(n)}}),Object(me.jsx)("label",{children:"T\xe9lephones"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.phones?a.phones.split(","):[],onChange:function(e){a.phones=e.join(",");var n=Object(o.a)({},a);t(n)}}),Object(me.jsx)("label",{children:"Code Tax "}),Object(me.jsx)(fe.a,{value:a.taxCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{taxCode:e})}))}}),Object(me.jsx)("label",{children:"Commission Voyage Organis\xe9:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:a.voCommission,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{voCommission:parseFloat(e)})}))}}),Object(me.jsx)("label",{children:"Commission Omrah:"}),Object(me.jsx)(fe.a,{type:"number",step:"0.1",value:a.umrahCommission,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{umrahCommission:parseFloat(e)})}))}}),Object(me.jsx)("label",{children:"Appartient Au Client"}),Object(me.jsx)(Ze.a,{onSearch:function(e){return r(e)},data:[{label:"Tout",value:null}].concat(c.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:a.belongsToClientId,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{belongsToClientId:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})},Gi=function(e){return console.log(e),[{columns:[{title:"Nom",width:{wpx:120}},{title:"Code",width:{wpx:80}},{title:"Code Tax",width:{wpx:80}},{title:"Adresse",width:{wpx:150}},{title:"Emails",width:{wpx:150}},{title:"Num\xe9ros de t\xe9l\xe9phones",width:{wpx:150}},{title:"Type",width:{wpx:100}}],data:e.map((function(e){return[{value:e.name,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.code,style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.taxCode,style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:e.address,style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.emails,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13"},alignment:{horizontal:"center"}}},{value:e.phones,style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:1!=e.clientType?"B2C":"B2B",style:{font:{sz:"14",color:{rgb:1==e.clientType?"673ab7":"f0b217"}},alignment:{horizontal:"center"}}}]}))}]};function Vi(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)({q:"",page:1,take:50,clientType:1,isCCA:!1}),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(""),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(c.useState)(new Ve),I=Object(s.a)(C,2),E=I[0],S=I[1],N=Object(D.c)(ye.a),P=Object(s.a)(N,2),k=(P[0],P[1]),A=function(){S(new Ve),y("")},M=function(){k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,m).fetchAll().then((function(e){r(e.data.data),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))},T=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return f(e.data)}))};return Object(c.useEffect)((function(){M(),T()}),[m.page,m.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return M()},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){x((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{ActionOnClose:A,excelData:Gi(a),nameExcel:"client",size:"md",save:function(){var e=Object(Ke.a)(E,[{name:"Nom"},{taxCode:"Tax Code"}]);e?y(e):(k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),E.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).update(E.id,E).then((function(e){M(),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),A(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).create(E).then((function(e){console.log(e),M(),A(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){y(e.Message),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Yi,{error:v,model:E,_setmodel:S,clients:O,fetchClients:function(e){return T(e,!1)}})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(""),S(a.find((function(t){return t.id==e})))}(e),k((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).delete(e).then((function(e){M(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return y(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:Hi,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:m.take,activePage:m.page,onChangePage:function(e){window.scrollTo(0,0),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),x((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})}),Object(me.jsx)("button",{onClick:function(){var e=O.filter((function(e){return!e[1].includes("VO ")&&!e[1].includes("UMRA ")&&!e[1].includes("KOUNOUZ ")}));e.map((function(e){var t=new Ve;t.name=e[1],t.address=e[6],t.emails=e[10]?e[10].replaceAll(";",","):"",t.phones=e[7],t.code=e[20],t.taxCode=e[5]||"",setTimeout((function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Client).create(t).then((function(e){})).catch((function(e){}))}),2e3)})),console.log(e)},children:"setClients"})]})}var Hi=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"taxCode",name:"Code Tax",render:function(e){return Object(me.jsx)("b",{style:{color:"green"},children:e})}},{value:"address",name:"Adresse",render:function(e){return Object(me.jsx)("i",{style:{color:"#232323"},children:e})}},{value:"emails",name:"Emails",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"mailto:"+e,style:{display:"inline-block",margin:"5px",border:"1px solid rgba(93,120,255,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}},{value:"phones",name:"Num\xe9ros de t\xe9l\xe9phones",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"tel:"+e,style:{color:"rgba(11,150,102,1)",display:"inline-block",margin:"5px",border:"1px solid rgba(11,150,102,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}}];var qi=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}}),Object(me.jsx)("label",{children:"Ville"}),Object(me.jsx)(fe.a,{value:a.city,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{city:e})}))}}),Object(me.jsx)("label",{children:"Adresse"}),Object(me.jsx)(fe.a,{value:a.address,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{address:e})}))}}),Object(me.jsx)("label",{children:"Emails"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.emails?a.emails.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.emails=e.join(","),t(n)}}),Object(me.jsx)("label",{children:"T\xe9lephones"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.phones?a.phones.split(","):[],onChange:function(e){a.phones=e.join(",");var n=Object(o.a)({},a);t(n)}}),Object(me.jsx)("label",{children:"Code Tax "}),Object(me.jsx)(fe.a,{value:a.taxCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{taxCode:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})},Zi=function(e){return console.log(e),[{columns:[{title:"Nom",width:{wpx:120}},{title:"Code",width:{wpx:80}},{title:"Code Tax",width:{wpx:80}},{title:"Adresse",width:{wpx:150}},{title:"Emails",width:{wpx:150}},{title:"Num\xe9ros de t\xe9l\xe9phones",width:{wpx:150}},{title:"Services Fournies",width:{wpx:150}}],data:e.map((function(e){return[{value:e.name,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.code,style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.taxCode,style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:e.address,style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.emails,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13"},alignment:{horizontal:"center"}}},{value:e.phones,style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:e.serviceTypes?Fe.u.filter((function(t){return e.serviceTypes.includes(t.value)})).map((function(e){return e.label})).join():"",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}}]}))}]};function Ji(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(new Ge),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y(new Ge),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Creditor,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){N()}),[O.page,O.take]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){return N()},children:Object(me.jsxs)("div",{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{code:"Code"},{taxCode:"Tax Code"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Creditor).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Creditor).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(qi,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){x(""),y(a.find((function(t){return t.id==e})))}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Creditor).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:Xi,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e})}))}})})]})}var Xi=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"taxCode",name:"Code Tax",render:function(e){return Object(me.jsx)("b",{style:{color:"green"},children:e})}},{value:"address",name:"Adresse",render:function(e){return Object(me.jsx)("i",{style:{color:"#232323"},children:e})}},{value:"emails",name:"Emails",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"mailto:"+e,style:{display:"inline-block",margin:"5px",border:"1px solid rgba(93,120,255,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}},{value:"phones",name:"Num\xe9ros de t\xe9l\xe9phones",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"tel:"+e,style:{color:"rgba(11,150,102,1)",display:"inline-block",margin:"5px",border:"1px solid rgba(11,150,102,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}}];var Qi=function(e){var t=e._setmodel,n=e.error,a=e.model,c=Object(D.d)(Y);return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Services Fournies "}),Object(me.jsx)(Ic.a,{data:Fe.u,block:!0,onSelect:function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{serviceTypes:e.join()})}))},onChange:function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{serviceTypes:e.join()})}))},value:a.serviceTypes?a.serviceTypes.split(",").map((function(e){return parseInt(e)})):null}),Object(me.jsx)("label",{children:"Devis "}),Object(me.jsx)(Ic.a,{data:c.map((function(e){return{label:e.name,value:e.id}})),block:!0,onSelect:function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{currencies:e.map((function(e){return{currencyId:e}}))})}))},onChange:function(e){console.log(e),t((function(t){return Object(o.a)(Object(o.a)({},t),{},{currencies:e.map((function(e){return{currencyId:e}}))})}))},value:a.currencies?a.currencies.map((function(e){return e.currencyId})):null}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}}),Object(me.jsx)("label",{children:"Type"}),Object(me.jsx)(Ze.a,{block:!0,data:[{label:"Terrestre",value:1},{label:"Aerien",value:2}],searchable:!1,style:{width:224},value:a.type,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{type:e})}))}}),Object(me.jsx)("label",{children:"Ville"}),Object(me.jsx)(fe.a,{value:a.city,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{city:e})}))}}),Object(me.jsx)("label",{children:"Adresse"}),Object(me.jsx)(fe.a,{value:a.address,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{address:e})}))}}),Object(me.jsx)("label",{children:"Emails"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.emails?a.emails.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.emails=e.join(","),t(n)}}),Object(me.jsx)("label",{children:"T\xe9lephones"}),Object(me.jsx)(Dn.a,{block:!0,size:"md",value:a.phones?a.phones.split(","):[],onChange:function(e){a.phones=e.join(",");var n=Object(o.a)({},a);t(n)}}),Object(me.jsx)("label",{children:"Code Tax "}),Object(me.jsx)(fe.a,{value:a.taxCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{taxCode:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function $i(e){var t=Object(c.useState)(to),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20,serviceType:0}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)(new He),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y(new He),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){N()}),[O.page,O.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Services Fournies :"}),Object(me.jsx)(Ze.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(Fe.u),block:!0,noSearch:!0,value:O.serviceType,onSelect:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{serviceType:e})}))}})]})]}),Object(me.jsx)(Ce.a,{ActionOnClose:S,size:"md",excelData:Zi(a),save:function(){var e=Object(Ke.a)(v,[{name:"Nom"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider).update(v.id,Object(o.a)({},v)).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider).create(Object(o.a)({},v)).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(Qi,{error:m,model:v,_setmodel:y,serviceTypes:Fe.u})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){x(""),y(a.find((function(t){return t.id==e})))}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Provider).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:eo,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var eo=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"taxCode",name:"Code Tax",render:function(e){return Object(me.jsx)("b",{style:{color:"green"},children:e})}},{value:"address",name:"Adresse",render:function(e){return Object(me.jsx)("i",{style:{color:"#232323"},children:e})}},{value:"emails",name:"Emails",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"mailto:"+e,style:{display:"inline-block",margin:"5px",border:"1px solid rgba(93,120,255,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}},{value:"phones",name:"Num\xe9ros de t\xe9l\xe9phones",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"tel:"+e,style:{color:"rgba(11,150,102,1)",display:"inline-block",margin:"5px",border:"1px solid rgba(11,150,102,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}},{value:"serviceTypes",name:"Services Fournies",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&Fe.u.filter((function(t){return e.includes(t.value)})).map((function(e,t){return Object(me.jsx)(Re.a,{color:"violet",children:e.label})}))})}}],to=[{id:1,code:"TND",name:"Dinar"}];var no=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}})," ",Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function ao(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:"",code:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:"",code:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){N()}),[O.page,O.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{code:"Code"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(no,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(a.find((function(t){return t.id==e}))),x("")}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Bank).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:co,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var co=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}}];var ro=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}})," ",Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function io(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:"",code:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:"",code:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){N()}),[O.page,O.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{code:"Code"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(ro,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(a.find((function(t){return t.id==e}))),x("")}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Checkout).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:oo,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var oo=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},,{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}}];var so=function(e){var t=e._setmodel,n=e.error,a=e.model;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{name:e})}))},value:a.name}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}})," ",Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function lo(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)({q:"",page:1,take:20}),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)(""),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(c.useState)({name:"",code:""}),_=Object(s.a)(g,2),v=_[0],y=_[1],C=Object(D.c)(ye.a),I=Object(s.a)(C,2),E=(I[0],I[1]),S=function(){y({name:"",code:""}),x("")},N=function(){E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.RecoveryPoint,O).fetchAll().then((function(e){r(e.data.data),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})})),d(e.data.totalCount)})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))}))};return Object(c.useEffect)((function(){N()}),[O.page,O.take]),Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return N()},children:[" ",Object(me.jsxs)("div",{className:"p-10",children:[" ",Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){f((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]})]}),Object(me.jsx)(Ce.a,{size:"md",noExport:!0,save:function(){var e=Object(Ke.a)(v,[{name:"Nom"},{code:"Code"}]);e?x(e):(E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),v.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.RecoveryPoint).update(v.id,v).then((function(e){N(),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),S(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.RecoveryPoint).create(v).then((function(e){N(),S(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){x(e.Message),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},AddComponent:Object(me.jsx)(so,{error:m,model:v,_setmodel:y})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){y(a.find((function(t){return t.id==e}))),x("")}(e),E((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.RecoveryPoint).delete(e).then((function(e){N(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return x(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:uo,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:u,limitOptions:[10,20,50,100],limit:O.take,activePage:O.page,onChangePage:function(e){window.scrollTo(0,0),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),f((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})}var uo=[{value:"name",name:"Nom",render:function(e){return Object(me.jsx)("a",{children:e})}},{value:"code",name:"Code",render:function(e){return Object(me.jsx)("b",{children:e})}}],jo=function e(){Object(U.a)(this,e),this.userName="",this.email="",this.phoneNumber="",this.firstName="",this.lastName="",this.position="SimpleUser",this.password=""};var bo=function(e){var t=e._setmodel,n=e.error,a=e.model,c=e.clients,r=e.fetchClients;return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{lastName:e})}))},value:a.lastName}),Object(me.jsx)("label",{children:"Pr\xe9nom:"}),Object(me.jsx)(fe.a,{onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{firstName:e})}))},value:a.firstName}),Object(me.jsx)("label",{children:"Code"}),Object(me.jsx)(fe.a,{value:a.code,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{code:e})}))}}),Object(me.jsx)("label",{children:"T\xe9lephone"}),Object(me.jsx)(fe.a,{value:a.phoneNumber,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{phoneNumber:e})}))}}),Object(me.jsx)("label",{children:"Email"}),Object(me.jsx)(fe.a,{type:"email",value:a.email,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{email:e,userName:e})}))}}),Object(me.jsx)("label",{children:"Mot de passe"}),Object(me.jsx)(fe.a,{type:"password",value:a.password,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{password:e})}))}}),Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return r(e)},data:[{label:"Tout",value:0}].concat(c.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:a.clientId,onSelect:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function Oo(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=(l[0],l[1],Object(D.c)(ye.a)),d=Object(s.a)(u,2),j=(d[0],d[1]),b=Object(c.useState)([]),O=Object(s.a)(b,2),f=O[0],h=O[1],p=Object(c.useState)(""),m=Object(s.a)(p,2),x=m[0],g=m[1],_=Object(c.useState)(new jo),v=Object(s.a)(_,2),y=v[0],C=v[1],I=function(){C(new jo),g("")},E=function(){j((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),B.a.createAPIEndpoint(B.a.ENDPOINTS.Accounts,{page:1,take:1e3}).fetchAll().then((function(e){r(e.data.filter((function(e){return"admin"!=e.userName})))})).catch((function(e){return g(e.Message)}))},S=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return h(e.data)}))};return Object(c.useEffect)((function(){E(),S()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ce.a,{noExport:!0,size:"md",save:function(){y.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Accounts).update(y.id,y).then((function(e){E(),j((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),I(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){g(e.Message)})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Accounts).create(y).then((function(e){E(),I(),j((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){g(e.Message)}))},AddComponent:Object(me.jsx)(bo,{clients:f,fetchClients:function(e){return S(e,!1)},error:x,model:y,_setmodel:C})}),Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){g(""),C(a.find((function(t){return t.id==e})))}(e),j((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Accounts).delete(e).then((function(e){E(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return g(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:fo,rows:a})]})}var fo=[{value:"firstName",value2:"lastName",name:"Nom",render:function(e,t){return Object(me.jsx)("a",{children:e+" "+t})}},{value:"email",name:"Email",render:function(e){return Object(me.jsx)("b",{children:e})}},{value:"phoneNumber",name:"T\xe9l",render:function(e){return Object(me.jsx)("b",{style:{color:"green"},children:e})}}];function ho(){var e=Object(c.useState)({items:[]}),t=Object(s.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)([]),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)({packageUmrahId:0}),j=Object(s.a)(d,2),b=j[0],O=j[1],f=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){u(e.data)}))};return Object(c.useEffect)((function(){f()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ie.a,{search:function(){B.a.createAPIEndpoint(pe.a.Order,b,"/GetUmrahsStatistics").fetchAll().then((function(e){return a(e.data)}))},children:Object(me.jsxs)(be.a,{className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{onSearch:f,data:[{label:"Tout",value:0}].concat(l.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:b.packageUmrahId,onSelect:function(e){O((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]})}),Object(me.jsx)("div",{children:n.items.map((function(e){return Object(me.jsx)(po,{d:e})}))})]})}var po=function(e){var t=e.d,n=Object(c.useState)(!1),a=Object(s.a)(n,2),r=a[0],i=a[1],o=Object(c.useState)(-1),l=Object(s.a)(o,2),u=l[0],d=l[1];return Object(me.jsxs)("div",{style:{padding:"5px",background:"#fff",borderRadius:"5px",margin:"10px 4px",position:"relative"},children:[Object(me.jsx)("button",{style:{position:"absolute",right:"6px",top:"5px"},onClick:function(){return i((function(e){return!e}))},children:"d\xe9tails"}),Object(me.jsxs)("b",{style:{display:"inline-flex",alignItems:"center",padding:"3px",borderRadius:"5px",marginBottom:"15px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:t.disponibility.airline?t.disponibility.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(t.disponibility.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",t.disponibility.airline?t.disponibility.airline.name:""]})]})]}),Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(me.jsx)("i",{children:"Total:"})," ",Object(me.jsx)("b",{style:{fontSize:"20px",margin:"0 4px"},children:t.total})," ",Object(me.jsxs)("div",{style:{display:"inline-flex",flex:1,height:"25px",background:"#f1f1f1",border:"1px solid #eee",marginLeft:"5px",borderRadius:"5px",overflow:"hidden"},children:[Object(me.jsxs)("div",{style:{display:"inline-block",width:"".concat((t.visasNumber+3)/t.total*100,"%"),background:"rgb(76,103,194)",height:"25px",textAlign:"center",color:"#fff"},children:[t.visasNumber," visas"]}),Object(me.jsxs)("div",{style:{display:"inline-block",width:"".concat((t.sendedNumber+2)/t.total*100,"%"),background:"#334455",height:"25px",textAlign:"center",color:"#fff"},children:[t.sendedNumber," envoy\xe9s"]}),Object(me.jsxs)("div",{style:{display:"inline-block",width:"".concat((t.total-t.sendedNumber-t.visasNumber)/t.total*100,"%"),color:"rgb(76,103,194)",height:"25px",textAlign:"center",background:"rgb(76,103,194,0.2)"},children:[t.total-t.sendedNumber-t.visasNumber," en attente"]})]})]}),r&&Object(me.jsx)("div",{style:{paddingLeft:"2%"},children:t.items.map((function(e,t){return Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(me.jsxs)("a",{href:"#",onClick:function(){return d((function(e){return e==t?-1:t}))},style:{fontWeight:"bold"},children:[e.client.name,":"]})," ",Object(me.jsx)("b",{style:{fontSize:"20px",margin:"0 4px"},children:e.orders.length})," ",Object(me.jsxs)("div",{style:{display:"inline-flex",flex:1,height:"22px",background:"#f1f1f1",border:"1px solid #eee",marginLeft:"5px",borderRadius:"5px",overflow:"hidden"},children:[Object(me.jsxs)("div",{style:{display:"inline-block",width:"".concat((e.visasNumber+1)/e.orders.length*100,"%"),background:"rgb(76,103,194)",height:"22px",textAlign:"center",color:"#fff"},children:[e.visasNumber," visas"]}),Object(me.jsxs)("div",{style:{display:"inline-block",width:"".concat((e.sendedNumber+1)/e.orders.length*100,"%"),background:"#334455",height:"22px",textAlign:"center",color:"#fff"},children:[e.sendedNumber," envoy\xe9s"]}),Object(me.jsxs)("div",{style:{display:"inline-block",width:"".concat((e.orders.length-e.sendedNumber-e.visasNumber)/e.orders.length*100,"%"),color:"rgb(76,103,194)",height:"22px",textAlign:"center",background:"rgb(76,103,194,0.2)"},children:[e.orders.length-e.sendedNumber-e.visasNumber," ","en attente"]})]})]}),u==t&&Object(me.jsx)(Ee.a,{columns:mo,rows:e.orders})]})}))})]})},mo=[{value:"customer",name:"Client B2C",render:function(e){return Object(me.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.picture+"?"+Date.now(),width:"43",height:"43",style:{border:"1px solid #eee",borderRadius:"50%",boxShadow:"-11px -5px 20px -13px rgba(0,0,0,0.75)"}}):Object(me.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e?e.name.toUpperCase():"",Object(me.jsx)("br",{})," ",Object(me.jsx)("i",{style:{color:"#aaa"},children:e?e.passportNumber:""})]})]})}},{value:"gender",name:"Genre",render:function(e){return Object(me.jsx)(Re.a,{color:1===e?"violet":"red",children:1===e?"male":"female"})}},{value:"onlyTicket",value2:"withoutVisa",name:"Type",render:function(e,t){return Object(me.jsxs)("b",{style:{color:"#549f0a"},children:[e?Object(me.jsx)(Re.a,{color:"blue",children:"Billet"}):""," ",t?Object(me.jsx)(Re.a,{color:"orange",children:"sans visa"}):""]})}},{value:"confirmationStatus",name:"Etat",render:function(e){return Object(me.jsx)(Re.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:Fe.f.find((function(t){return null===e||t.value===e}))?Fe.f.find((function(t){return null===e||t.value===e})).label:Fe.f.find((function(e){return 1===e.value})).label})}},{value:"fingerprint",name:"Empreinte",render:function(e){return e?Object(me.jsx)(Sr.a,{color:"green"}):Object(me.jsx)("b",{children:"-"})}}];var xo=function(e){var t=e._setmodel,n=e.error,a=e.model,r=Object(c.useState)(null),i=Object(s.a)(r,2),l=i[0],u=i[1],d=Object(c.useState)(null),j=Object(s.a)(d,2),b=(j[0],j[1]);return Object(me.jsxs)(me.Fragment,{children:[Object(me.jsx)("h5",{children:"Les informations de l'agence pour la facture:"}),Object(me.jsx)("div",{style:{width:"100px",margin:"15px"},children:Object(me.jsx)(kt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:function(e){console.log(e),b(e[e.length-1].blobFile),function(e,t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}(e[e.length-1].blobFile,(function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{logo:e})})),u(e)}))},children:Object(me.jsx)("div",{style:{background:"rgba(200,200,200,0.1)",width:"100px",height:"100px",padding:"0"},children:l?Object(me.jsx)("img",{src:l,width:"100",height:"100",alt:""}):a.logo?Object(me.jsx)("img",{width:"100",height:"100",src:a.logo,alt:""}):Object(me.jsxs)(me.Fragment,{children:[" ",Object(me.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(me.jsx)(mn.a,{color:"#3598ff"})]}),Object(me.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"LOGO"})]})})})}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom:"}),Object(me.jsx)(fe.a,{value:a.name,onChange:function(e){t((function(t){return console.log(t),Object(o.a)(Object(o.a)({},t),{},{name:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Matricule Fiscale :"}),Object(me.jsx)(fe.a,{value:a.taxCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{taxCode:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Addresse :"}),Object(me.jsx)(fe.a,{value:a.address,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{address:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:4,xl:5,className:"p-10",children:[Object(me.jsx)("label",{children:"Ville:"}),Object(me.jsx)(fe.a,{value:a.city,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{city:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:2,xl:1,className:"p-10",children:[Object(me.jsx)("label",{children:"Zip Code :"}),Object(me.jsx)(fe.a,{value:a.zipCode,onChange:function(e){t((function(t){return Object(o.a)(Object(o.a)({},t),{},{zipCode:e})}))}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"T\xe9lephones"}),Object(me.jsx)(Dn.a,{type:"number",block:!0,size:"md",value:a.phones?a.phones.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.phones=e.join(","),t(n)}})]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"Fax:"}),Object(me.jsx)(Dn.a,{type:"number",block:!0,size:"md",value:a.fax?a.fax.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.fax=e.join(","),t(n)}})," "]}),Object(me.jsxs)(be.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(me.jsx)("label",{children:"emails:"}),Object(me.jsx)(Dn.a,{type:"number",block:!0,size:"md",value:a.emails?a.emails.split(","):[],onChange:function(e){var n=Object(o.a)({},a);n.emails=e.join(","),t(n)}})," "]}),Object(me.jsx)("br",{}),n&&Object(me.jsx)(Ae.a,{showIcon:!0,type:"error",children:n})]})};function go(e){var t=Object(D.c)(R),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)(0),l=Object(s.a)(i,2),u=(l[0],l[1],Object(c.useState)({q:"",page:1,take:20,serviceType:0})),d=Object(s.a)(u,2),j=(d[0],d[1],Object(c.useState)("")),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)({}),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(D.c)(ye.a),_=Object(s.a)(g,2),v=(_[0],_[1]),y=function(){x({}),f("")},C=function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Agency+"/getAll",{}).fetchAll().then((function(e){r(e.data)})).catch((function(e){return f(e.Message)}))};return Object(c.useEffect)((function(){C()}),[]),Object(me.jsxs)("div",{children:[Object(me.jsx)(Ce.a,{size:"md",save:function(){var e=Object(Ke.a)(m,[{name:"Nom"}]);e?f(e):(v((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!0})})),m.id?B.a.createAPIEndpoint(B.a.ENDPOINTS.Agency).update(m.id,Object(o.a)({},m)).then((function(e){C(),v((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})})),y(),Le.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){f(e.Message),v((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})):B.a.createAPIEndpoint(B.a.ENDPOINTS.Agency).create(Object(o.a)({},m)).then((function(e){C(),y(),Le.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),v((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){f(e.Message),v((function(e){return Object(o.a)(Object(o.a)({},e),{},{loading:!1})}))})))},noExport:!0,AddComponent:Object(me.jsx)(xo,{error:O,model:m,_setmodel:x})})," ",Object(me.jsx)(Ee.a,{editAction:function(e){!function(e){f(""),x(a.find((function(t){return t.id==e})))}(e),v((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},deleteAction:function(e){B.a.createAPIEndpoint(B.a.ENDPOINTS.Agency).delete(e).then((function(e){C(),Le.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return f(e.Message)}))},actionKey:"id",noAdvancedActions:!0,columns:_o,rows:a})]})}var _o=[{value:"name",value2:"logo",name:"Nom",render:function(e,t){return Object(me.jsxs)("a",{children:[" ",Object(me.jsx)("img",{src:t,height:"30",alt:""}),e]})}},{value:"taxCode",name:"Code Tax",render:function(e){return Object(me.jsx)("b",{style:{color:"green"},children:e})}},{value:"address",name:"Adresse",render:function(e){return Object(me.jsx)("i",{style:{color:"#232323"},children:e})}},{value:"emails",name:"Emails",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"mailto:"+e,style:{display:"inline-block",margin:"5px",border:"1px solid rgba(93,120,255,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}},{value:"phones",name:"Num\xe9ros de t\xe9l\xe9phones",render:function(e){return Object(me.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map((function(e,t){return Object(me.jsx)("a",{href:"tel:"+e,style:{color:"rgba(11,150,102,1)",display:"inline-block",margin:"5px",border:"1px solid rgba(11,150,102,0.2)",borderRadius:"3px",padding:"3px 4px"},children:e})}))})}}];function vo(e){var t=Object(c.useState)([]),n=Object(s.a)(t,2),a=n[0],r=n[1],i=Object(c.useState)([]),l=Object(s.a)(i,2),u=l[0],d=l[1],j=Object(c.useState)([]),b=Object(s.a)(j,2),O=b[0],f=b[1],h=Object(c.useState)([]),p=Object(s.a)(h,2),m=p[0],x=p[1],g=Object(D.c)(Uc),_=Object(s.a)(g,2),v=_[0],y=(_[1],Object(c.useState)([])),C=Object(s.a)(y,2),I=C[0],E=C[1],S=Object(D.c)(W),N=Object(s.a)(S,2),P=(N[0],N[1],Object(c.useState)(0)),k=Object(s.a)(P,2),A=k[0],M=k[1],T=Object(c.useState)(!1),w=Object(s.a)(T,2),R=(w[0],w[1],Object(c.useState)({page:1,take:100,clientId:0,status:3,date:null,tagId:0})),U=Object(s.a)(R,2),L=U[0],F=U[1],K=Object(c.useState)({rawdhaId:null,orders:[]}),z=Object(s.a)(K,2),Y=z[0],G=z[1],V=Object(c.useState)(""),H=Object(s.a)(V,2),q=(H[0],H[1],function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return d(e.data)}))}),Z=function(e){("undefined"==typeof e||e.length>2)&&B.a.createAPIEndpoint(B.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((function(e){f(e.data);var t=e.data.reduce((function(e,t){return e.concat(t.disponibilities)}),[]);console.log(t),E(t.filter((function(e){return e.onStock})))}))},J=function(){B.a.createAPIEndpoint(B.a.ENDPOINTS.Order+"/Umrah",Object(o.a)(Object(o.a)({},L),{},{date:L.date?_e()(L.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){r(e.data.data),x([]),M(e.data.totalCount)})).catch((function(e){}))};Object(c.useEffect)((function(){q(),Z()}),[]),Object(c.useEffect)((function(){J()}),[L.page,L.take]);var X=[{value:"id",name:"-",render:function(e){return Object(me.jsx)(en.a,{onChange:function(t){m.find((function(t){return t==e}))?x((function(t){return t.filter((function(t){return t!=e}))})):x((function(t){return[].concat(Object(qe.a)(t),[e])}))},checked:null!=m.find((function(t){return t==e}))})}},{value:"rawdhaId",name:"Rawdha",render:function(e){return Object(me.jsx)("a",{children:Object(me.jsx)("b",{children:e&&v.find((function(t){return t.id==e}))?v.find((function(t){return t.id==e})).designation:""})})}},{name:"Rawdha",value:"isRawdhaSent",render:function(e){return Object(me.jsx)(Re.a,{color:e?"blue":"orange",children:e?"oui":"non"})}},{value:"customer",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Client B2C",render:function(e,t,n,a){return Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(me.jsx)("img",{alt:"",src:Te.d+"Uploads/CustomerPictures/"+e.picture+"?"+Date.now(),width:"43",height:"43",style:{border:"1px solid #eee",borderRadius:"50%",boxShadow:"-11px -5px 20px -13px rgba(0,0,0,0.75)"}}):Object(me.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(me.jsx)(mn.a,{color:"#3598ff"})}),Object(me.jsxs)("div",{style:{padding:"0 5px"},children:[e.firstName+" "+e.lastName," ",Object(me.jsx)("b",{style:{color:"#111",fontSize:"15px"},children:e?e.passportNumber:""}),Object(me.jsx)("br",{}),Object(me.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr}),t?Object(me.jsx)(Re.a,{color:"blue",children:"Billet"}):""," ",n?Object(me.jsx)(Re.a,{color:"orange",children:"sans visa"}):"",a?Object(me.jsx)(Re.a,{color:"violet",children:"Sans Billet"}):""]})]})}},{value:"disponibility",name:"Vol",render:function(e){return e?Object(me.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(me.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(me.jsxs)("b",{children:[" ",Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),Object(me.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(me.jsx)("b",{children:"-"})}},{value:"client",name:"Client B2B",render:function(e){return Object(me.jsx)("a",{children:e?e.name.toUpperCase():""})}}];return Object(c.useEffect)((function(){G((function(e){return Object(o.a)(Object(o.a)({},e),{},{orders:m})}))}),[m.length]),Object(me.jsxs)("div",{children:[Object(me.jsxs)("div",{children:[Object(me.jsxs)(Ie.a,{search:function(){return J()},children:[Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Recherche: "}),Object(me.jsx)(fe.a,{placeholder:"recherche",onChange:function(e){F((function(t){return Object(o.a)(Object(o.a)({},t),{},{q:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Rawdha: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(v.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:L.rawdhaId,onSelect:function(e){F((function(t){return Object(o.a)(Object(o.a)({},t),{},{rawdhaId:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Client: "}),Object(me.jsx)(Ze.a,{onSearch:function(e){return q(e)},data:[{label:"Tout",value:0}].concat(u.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:L.clientId,onSelect:function(e){F((function(t){return Object(o.a)(Object(o.a)({},t),{},{clientId:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Nom Omrah: "}),Object(me.jsx)(Ze.a,{onSearch:Z,data:O?[{label:"Tout",value:0}].concat(O.map((function(e){return{label:e.name,value:e.id}}))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:L.packageUmrahId,onSelect:function(e){F((function(t){return Object(o.a)(Object(o.a)({},t),{},{packageUmrahId:e})}))}})]}),Object(me.jsxs)(be.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(me.jsx)("label",{children:"Vol: "}),Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(I?I.map((function(e){return{label:Object(me.jsx)("div",{style:{color:"#232323"},children:_e()(e.date).format("DD MMM YYYY")}),value:e.id}})):[]),block:!0,noSearch:!0,value:L.disponibilityId,onSelect:function(e){F((function(t){return Object(o.a)(Object(o.a)({},t),{},{disponibilityId:e})}))}})]})]}),Object(me.jsxs)("div",{onClick:function(e){return x((function(e){return e.length?[]:a.map((function(e){return e.id}))}))},style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(me.jsx)(en.a,{checked:m.length>0})," S\xe9lectionner Tout"]}),Object(me.jsxs)("div",{className:"p-10",children:[Object(me.jsx)(be.a,{s:6,m:6,l:4,xl:3,children:Object(me.jsx)(Ze.a,{data:[{label:"Tout",value:0}].concat(v.map((function(e){return{label:e.designation,value:e.id}}))),block:!0,noSearch:!0,value:Y.rawdhaId,onSelect:function(e){G((function(t){return Object(o.a)(Object(o.a)({},t),{},{rawdhaId:e})}))}})})," ",Object(me.jsx)(he.a,{appearance:"primary",color:"blue",onClick:function(){B.a.createAPIEndpoint(pe.a.Order+"/changeRawdha").create(Y).then((function(e){J(),alert("success")}))},children:"changer"})]}),Object(me.jsx)(Ee.a,{columns:X,rows:a}),Object(me.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(me.jsx)(ve.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:A,limitOptions:[10,20,50,100,200,250,500,1e3],limit:L.take,activePage:L.page,onChangePage:function(e){window.scrollTo(0,0),F((function(t){return Object(o.a)(Object(o.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),F((function(t){return Object(o.a)(Object(o.a)({},t),{},{take:e,page:1})}))}})})]})," "]})}var yo=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--ai",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M9.416 15.795H7.584l-.3.66h-.716l1.572-3.504h.72l1.571 3.504h-.72l-.295-.66zM8.5 13.688l-.651 1.491H9.15l-.65-1.491zM10.729 16.455v-3.504h.655v3.504h-.655z"})]}))};var Co=function(e){return Object(me.jsx)("svg",Object(o.a)(Object(o.a)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em"},e),{},{children:Object(me.jsx)("path",{fill:"#6cc08a",d:"M10.265 18l9.9-9.9-2.2-2.1-7.792 7.792-3.8-3.9-2.2 2.1L8.065 15.9l2.2 2.1"})}))};var Io=function(e){return Object(me.jsx)("svg",Object(o.a)(Object(o.a)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em"},e),{},{children:Object(me.jsx)("path",{fill:"#ed665f",d:"M18 15.9L14.1 12 18 8.1 15.8 6l-3.9 3.9L8.1 6 5.9 8.1 9.8 12l-3.9 3.9L8.1 18l3.8-3.9 3.9 3.9z"})}))};var Eo=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--doc",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M7.104 14.674c.015.886-.525 1.781-1.751 1.781H3.977v-3.504h1.376c1.201 0 1.736.857 1.751 1.723zm-2.472 1.145h.721c.796 0 1.111-.58 1.096-1.151-.015-.545-.335-1.091-1.096-1.091h-.721v2.242zM11.079 14.724c-.01.905-.565 1.812-1.797 1.812-1.231 0-1.802-.886-1.802-1.807s.591-1.847 1.802-1.847c1.207 0 1.808.926 1.797 1.842zm-2.948.014c.015.576.325 1.191 1.151 1.191s1.136-.621 1.146-1.196c.01-.591-.32-1.251-1.146-1.251-.825 0-1.166.665-1.151 1.256zM14.699 16.015c-.36.355-.826.521-1.331.521-1.302 0-1.853-.896-1.857-1.807-.005-.916.591-1.847 1.857-1.847.476 0 .926.18 1.286.535l-.44.426a1.201 1.201 0 0 0-.846-.331c-.846 0-1.212.631-1.206 1.217.005.58.34 1.186 1.206 1.186.305 0 .65-.125.881-.354l.45.454z"})]}))};var So=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--jpg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M7.064 14.959c0 .905-.576 1.566-1.542 1.566-.896 0-1.537-.536-1.537-1.526h.651c0 .601.29.905.886.905.601 0 .881-.415.881-.945v-1.392H5.347v-.616h1.717v2.008zM9.383 15.424h-.991v1.031h-.661v-3.504c.551 0 1.101-.005 1.652-.005 1.712 0 1.717 2.478 0 2.478zm-.991-.606h.991c.846 0 .841-1.241 0-1.241h-.991v1.241z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M13.764 13.808a1.338 1.338 0 0 0-.891-.351c-.751 0-1.206.57-1.206 1.291 0 .576.335 1.172 1.206 1.172.275 0 .516-.061.791-.28v-.621h-.896v-.591h1.502v1.477c-.346.396-.781.631-1.396.631-1.316 0-1.852-.866-1.852-1.787 0-.985.615-1.896 1.852-1.896.471 0 .941.18 1.302.535l-.412.42z"})]}))};var Do=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--pdf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M6.083 15.424h-.992v1.031h-.66v-3.504c.551 0 1.101-.005 1.652-.005 1.711 0 1.716 2.478 0 2.478zm-.992-.606h.991c.846 0 .841-1.241 0-1.241h-.991v1.241zM10.944 14.674c.015.886-.525 1.781-1.751 1.781H7.817v-3.504h1.376c1.201 0 1.736.857 1.751 1.723zm-2.472 1.145h.721c.796 0 1.111-.58 1.096-1.151-.015-.545-.335-1.091-1.096-1.091h-.721v2.242zM11.531 16.455v-3.498h2.518v.635h-1.857v.956h1.757v.611h-1.757v1.296h-.661z"})]}))};var No=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--png",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M5.773 15.424h-.991v1.031h-.661v-3.504c.551 0 1.101-.005 1.652-.005 1.711 0 1.716 2.478 0 2.478zm-.991-.606h.991c.846 0 .841-1.241 0-1.241h-.991v1.241zM9.854 12.946h.661v3.509h-.41v.005l-1.842-2.367v2.362h-.661v-3.504h.535l1.717 2.173v-2.178zM13.769 13.808a1.338 1.338 0 0 0-.891-.351c-.751 0-1.206.57-1.206 1.291 0 .576.335 1.172 1.206 1.172.275 0 .516-.061.791-.28v-.621h-.896v-.591h1.502v1.477c-.346.396-.781.631-1.396.631-1.316 0-1.852-.866-1.852-1.787 0-.985.615-1.896 1.852-1.896.471 0 .941.18 1.302.535l-.412.42z"})]}))};var Po=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--psd",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M5.968 15.424h-.991v1.031h-.661v-3.504c.551 0 1.101-.005 1.652-.005 1.711 0 1.717 2.478 0 2.478zm-.991-.606h.991c.846 0 .841-1.241 0-1.241h-.991v1.241z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M9.908 13.798c-.12-.2-.45-.391-.831-.391-.491 0-.726.205-.726.466 0 .305.36.39.781.439.73.091 1.411.281 1.411 1.116 0 .781-.69 1.116-1.472 1.116-.715 0-1.266-.22-1.526-.86l.551-.285c.155.385.561.556.986.556.416 0 .806-.146.806-.526 0-.33-.345-.465-.811-.515-.716-.086-1.376-.275-1.376-1.062 0-.721.711-1.016 1.356-1.021.545 0 1.111.154 1.376.695l-.525.272zM14.185 14.674c.015.886-.525 1.781-1.752 1.781h-1.376v-3.504h1.376c1.201 0 1.736.857 1.752 1.723zm-2.473 1.145h.721c.796 0 1.111-.58 1.096-1.151-.015-.545-.335-1.091-1.096-1.091h-.721v2.242z"})]}))};var ko=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--xls",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"}),Object(me.jsx)("path",{className:"file-icon__type",d:"M6.916 12.951h.726v.03l-1.186 1.702 1.221 1.752v.02h-.741l-.896-1.316-.896 1.316h-.741v-.02l1.216-1.752-1.181-1.702v-.03h.726l.876 1.307.876-1.307zM8.774 12.951v2.894h1.802v.61H8.113v-3.504h.661zM13.251 13.798c-.12-.2-.45-.391-.831-.391-.49 0-.726.205-.726.466 0 .305.36.39.78.439.731.091 1.412.281 1.412 1.116 0 .781-.691 1.116-1.472 1.116-.716 0-1.267-.22-1.527-.86l.551-.285c.154.385.561.556.985.556.416 0 .806-.146.806-.526 0-.33-.345-.465-.811-.515-.716-.086-1.376-.275-1.376-1.062 0-.721.71-1.016 1.356-1.021.545 0 1.11.154 1.376.695l-.523.272z"})]}))};var Ao=function(e){return Object(me.jsxs)("svg",Object(o.a)(Object(o.a)({className:"icon file-icon file-icon--unknown",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24"},e),{},{children:[Object(me.jsx)("path",{className:"file-icon__shadow",d:"M19.592 7.219v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003-5.451-5.599-.001-.001a.338.338 0 0 0-.238-.102h-.001l-.005-.001H2.947a1.71 1.71 0 0 0-1.708 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V7.221v-.002z"}),Object(me.jsx)("path",{className:"file-icon__outline",d:"M18.354 5.951v-.004c0-.014-.006-.026-.008-.039-.004-.03-.006-.06-.018-.089a.318.318 0 0 0-.055-.085c-.006-.008-.009-.017-.016-.025l-.002-.003-.003-.003L12.801.104 12.8.103a.338.338 0 0 0-.238-.102h-.001L12.556 0H1.708A1.71 1.71 0 0 0 0 1.708v19.331a1.71 1.71 0 0 0 1.708 1.708h14.937a1.71 1.71 0 0 0 1.708-1.707V5.953l.001-.002zm-5.457-4.768l4.305 4.422h-4.305V1.183zm3.749 20.881H1.708c-.565 0-1.025-.46-1.025-1.025V1.708c0-.565.46-1.025 1.025-1.025h10.506v5.264c0 .189.153.342.342.342h5.115v14.75a1.027 1.027 0 0 1-1.025 1.025z"})]}))},Mo=["name"];function To(e){var t=e.name,n=Object(Ei.a)(e,Mo);switch(t){case"AI":return Object(me.jsx)(yo,Object(o.a)({},n));case"CHECK":return Object(me.jsx)(Co,Object(o.a)({},n));case"CLOSE":return Object(me.jsx)(Io,Object(o.a)({},n));case"DOC":case"DOCX":return Object(me.jsx)(Eo,Object(o.a)({},n));case"JPG":case"JPEG":return Object(me.jsx)(So,Object(o.a)({},n));case"PDF":return Object(me.jsx)(Do,Object(o.a)({},n));case"PNG":return Object(me.jsx)(No,Object(o.a)({},n));case"PSD":return Object(me.jsx)(Po,Object(o.a)({},n));case"XLS":return Object(me.jsx)(ko,Object(o.a)({},n));default:return Object(me.jsx)(Ao,Object(o.a)({},n))}}n(1209);function wo(e){var t=e.icon,n=e.name,a=e.uploaded,r=Object(c.useState)(!1),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(c.useState)(0),d=Object(s.a)(u,2),j=d[0],b=d[1],O=Object(c.useState)("#ed665f"),f=Object(s.a)(O,2),h=f[0],p=f[1];return Object(c.useEffect)((function(){if(n){var e=setInterval((function(){b((function(e){return 90!=e||a?e<100?e+1:void 0:e}))}),50);return function(){return clearInterval(e)}}}),[n]),Object(c.useEffect)((function(){a&&(l(!0),p("#6cc08a"),b(100))}),[a]),Object(me.jsxs)("div",{className:"progress",children:[Object(me.jsx)("div",{className:"progress__icon",children:Object(me.jsx)(To,{name:t,width:"50px",height:"50px",opacity:o?1:.5})}),Object(me.jsxs)("div",{className:"progress__content",children:[Object(me.jsxs)("div",{className:"progress__content__1",children:[Object(me.jsx)("p",{className:"progress__content__1__filename",children:n}),Object(me.jsx)(To,{className:o?"check":"close",name:o?"CHECK":"CLOSE",width:"20px",height:"20px"})]}),Object(me.jsx)("div",{className:"progress__content__2",children:Object(me.jsx)("div",{className:"progress__content__2__bar",style:{width:"".concat(j,"%"),background:h}})})]})]})}var Bo=n(786);n(1210),n(1211);function Ro(){return Object(me.jsx)("div",{children:Object(me.jsxs)("div",{children:[" ",Object(me.jsx)(Uo,{refresh:function(){}})]})})}function Uo(e){e.refresh,e.single;var t=Object(c.useRef)(),n=Object(c.useState)([]),a=Object(s.a)(n,2),r=a[0],i=a[1],l=Object(c.useState)(""),u=Object(s.a)(l,2),d=(u[0],u[1],function(){var e=Object(hn.a)(fn.a.mark((function e(t){var n,a,c,s,l,u;return fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null===(n=t[0].name.split(".")[1])||void 0===n?void 0:n.toLowerCase(),console.log(t),void 0===a){e.next=22;break}c=Object.keys(t).map((function(e){var n;return{name:t[e].name,icon:null===(n=t[e].name.split(".")[1])||void 0===n?void 0:n.toUpperCase().trim(),newName:""}})),s=[].concat(Object(qe.a)(r),Object(qe.a)(c)),i((function(e){return Object(qe.a)(s)})),l=Array.from(t),u=0;case 8:if(!(u2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,s=function(e){n(),i[e].action(o)};return Object(v.jsx)(b.a,{ref:t,className:r,style:{left:a,top:c},full:!0,children:Object(v.jsx)(O.a.Menu,{onSelect:s,children:i.map((function(e,t){return Object(v.jsx)(O.a.Item,{eventKey:t,children:e.render?e.render(e.label,o):e.label})}))})})}(e,n,o,t)},children:Object(v.jsx)(f.a,{appearance:"subtle",icon:Object(v.jsx)(j.c,{}),circle:!0})})]})]})})},196:function(e,t,n){},22:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n(84),c=n(76),r=n(98),i=(n(2),n(742)),o=n.n(i),s=n(743),l=n.n(s),u=n(744),d=n.n(u),j=n(745),b=n.n(j),O=(n(7),n(1)),f=["advanced","search","loading"];function h(e){var t=e.advanced,n=e.search,i=e.loading,s=Object(a.a)(e,f);return Object(O.jsxs)("div",{className:o.a.container,children:[Object(O.jsx)("div",{children:s.children}),Object(O.jsxs)("div",{className:"p-10",children:[Object(O.jsx)(c.a,{appearance:"ghost",onClick:function(){return n()},children:i?Object(O.jsx)(l.a,{pulse:!0,style:{fontSize:"2em"}}):Object(O.jsxs)(O.Fragment,{children:[" ",Object(O.jsx)(d.a,{})," Recherche"]})})," ",t&&Object(O.jsx)(r.a,{icon:Object(O.jsx)(b.a,{})})]})]})}},23:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(9),c=Object(a.b)({key:"exportAddAtom",default:{loading:!1,error:"",open:!1}})},24:function(e,t,n){"use strict";n.d(t,"a",(function(){return I}));var a=n(38),c=n.n(a),r=n(59),i=n(5),o=n(3),s=(n(2),n(76)),l=n(98),u=n(152),d=n(1250),j=n(247),b=n.n(j),O=n(29),f=n.n(O),h=n(203),p=n(23),m=n(9),x=n(84),g=n(384),_=n.n(g),v=n(1),y=["name","data"];var C=function(e){var t=e.name,n=e.data,a=(Object(x.a)(e,y),_.a.ExcelFile),c=_.a.ExcelFile.ExcelSheet;return Object(v.jsx)(a,{filename:t||"file",element:Object(v.jsx)("button",{style:{width:"0",height:"0",opacity:0,overflow:"hidden"},type:"button",id:"hidden-btn-export",children:"download"}),children:Object(v.jsx)(c,{dataSet:n,name:t||"file"})})};function I(e){var t=e.AddComponent,n=e.excelData,a=e.nameExcel,j=e.noExport,O=e.save,x=e.noAdd,g=e.ActionOnClose,_=e.handleExport,y=e.size,I=e.additionalBtn,E=e.title,S=Object(m.c)(p.a),D=Object(i.a)(S,2),N=D[0],P=D[1],k=function(){return P((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!1})}))},A=function(){var e=Object(r.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=3;break}return e.next=3,_();case 3:document.querySelector("#hidden-btn-export").click();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(v.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"15px 0",zIndex:"1",maxWidth:"100vw"},children:[!j&&Object(v.jsxs)(s.a,{color:"green",onClick:A,appearance:"primary",children:[Object(v.jsx)(b.a,{})," Export"]}),I||"",!x&&Object(v.jsxs)(v.Fragment,{children:[Object(v.jsx)(h.a,{vertical:!0}),Object(v.jsx)(l.a,{onClick:function(){return P((function(e){return Object(o.a)(Object(o.a)({},e),{},{open:!0})}))},appearance:"primary",icon:Object(v.jsx)(f.a,{}),children:"Ajout"}),Object(v.jsxs)(u.a,{size:y||"lg",overflow:!1,style:{maxHeight:"calc(100vh - 50px)",overflow:"auto",maxWidth:"100vw"},open:N.open,onClose:function(){k(),g&&g()},children:[Object(v.jsx)(u.a.Header,{children:Object(v.jsx)(u.a.Title,{children:E||"Modal Title"})}),Object(v.jsx)(u.a.Body,{children:Object(v.jsx)("div",{style:{maxHeight:"calc(100vh - 240px)",overflow:"auto",maxWidth:"100vw"},children:t})}),Object(v.jsxs)(u.a.Footer,{children:[Object(v.jsx)(s.a,{onClick:O,appearance:"primary",children:N.loading?Object(v.jsx)(d.a,{size:"sm"}):"Enregistrer"}),Object(v.jsx)(s.a,{onClick:function(){k(),g&&g()},appearance:"subtle",children:"Annuler"})]})]})]}),Object(v.jsx)(C,{data:n,name:a})]})}},25:function(e,t,n){"use strict";function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.toFixed(3).toString(),n=t.split(".")[0],a=t.split(".")[1],c="",r=n.split("").reverse().join("");if(n.length>3){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",c=e+n+"/",r=e,i={Authorization:"Bearer "+(localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).token:"")},o={headers:i,params:t};return{fetchAll:function(){return a.c.get(c,o)},fetch:function(){return a.c.get(r,o)},customGet:function(){return a.c.get(c,o)},customPost:function(e){return a.c.get(c,e,o)},fetchById:function(e){return a.c.get(c+e,{headers:i})},create:function(e){return a.c.post(c,e,{headers:i})},update:function(e,t){return a.c.put(c+e,t,o)},update2:function(e){return a.c.put(c,e,{headers:i})},delete:function(e){return a.c.delete(c+e,{headers:i})},update3:function(e,t){var n="".concat(c+e,"?etat=").concat(t);return a.c.put(n,o)},upload:function(e){var t=new FormData;return t.append("files",e),a.c.post(c,t,{headers:i})},upload1:function(e){var t=new FormData;return t.append("File",e),a.c.post(c,t,{headers:i})}}}},7:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(3),c=n(5),r=n(2),i=n(1);function o(e){var t=Object(r.useState)(""),n=Object(c.a)(t,2),o=n[0],s=n[1];function l(){window.innerWidth<=576&&e.xs?s("xs"):window.innerWidth>576&&window.innerWidth<=768&&e.s?s("s"):window.innerWidth>768&&window.innerWidth<=992&&e.m?s("m"):window.innerWidth>992&&window.innerWidth<=1200&&e.l?s("l"):window.innerWidth>1200&&e.xl?s("xl"):s("")}return Object(r.useEffect)((function(){return window.innerWidth<=576&&e.xs?s("xs"):window.innerWidth>576&&window.innerWidth<=768&&e.s?s("s"):window.innerWidth>768&&window.innerWidth<=992&&e.m?s("m"):window.innerWidth>992&&window.innerWidth<=1200&&e.l?s("l"):window.innerWidth>1200&&e.xl?s("xl"):s(""),window.addEventListener("resize",l),function(){window.removeEventListener("resize",l)}}),[o,e]),Object(i.jsx)("div",{style:Object(a.a)(Object(a.a)({display:"inline-block",width:"xs"==o?e.xs*(100/12)+"%":"s"==o?e.s*(100/12)+"%":"m"==o?e.m*(100/12)+"%":"l"==o?e.l*(100/12)+"%":"xl"==o?e.xl*(100/12)+"%":"100%"},e.style),{},{verticalAlign:"top",margin:e.margin?e.margin:0,boxSizing:"border-box"}),className:e.className,children:e.children})}},73:function(e,t,n){"use strict";var a=n(10),c=n(3),r=n(107),i=n(80),o=n(98),s=n(1220),l=n(1222),u=n(14),d=n(77),j=n.n(d),b=n(13),O=n.n(b),f=(n(2),n(9)),h=n(131),p=n(7),m=n(29),x=n.n(m),g=n(43),_=n.n(g),v=n(1);t.a=function(e){var t=e._setmodel,n=e.error,d=e.model,b=e.clients,m=e.banks,g=e.fetchBanks,y=e.fetchClients,C=e.loadingAttach,I=e.attachments,E=e._delete,S=e.upload,D=e.inset,N=Object(f.d)(h.a);return Object(v.jsxs)(v.Fragment,{children:["undefined"!=typeof b&&Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Point de recouvrement:"}),Object(v.jsx)(r.a,{noSearch:!0,data:N,block:!0,value:d.recoveryPointId,onSelect:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{recoveryPointId:e})}))}})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Num\xe9ro:"}),Object(v.jsx)(i.a,{maxlength:"7",onChange:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{number:e})}))},value:d.number})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Status"}),Object(v.jsx)(r.a,{disabled:!d.id,searchable:!1,data:u.o,block:!0,noSearch:!0,value:d.status,onSelect:function(e){console.log(e),t((function(t){return console.log(t.status),Object(c.a)(Object(c.a)({},t),{},{status:e,checkPartialPayments:8!=t.status&&8==e?[{amount:0,date:new Date}]:[]})}))}})]}),8==d.status&&Object(v.jsx)("div",{style:{background:"rgba(76,103,194,0.3)",borderRadius:"5px"},children:d.checkPartialPayments&&d.checkPartialPayments.map((function(e,n){return Object(v.jsxs)(v.Fragment,{children:[Object(v.jsxs)(p.a,{m:4,l:4,xl:4,className:"p-5",children:[Object(v.jsx)("label",{children:"Montant:"}),Object(v.jsx)(i.a,{value:d.checkPartialPayments[n].amount,onChange:function(e){var r=Object(a.a)(d.checkPartialPayments),i=Object(c.a)({},r[n]);i.amount=parseFloat(e),r[n]=i,t(Object(c.a)(Object(c.a)({},d),{},{checkPartialPayments:r}))}})]}),Object(v.jsxs)(p.a,{m:4,l:4,xl:4,className:"p-5",children:[Object(v.jsx)("label",{children:"Date:"}),Object(v.jsx)(i.a,{type:"date",value:"string"==typeof d.checkPartialPayments[n].date?d.checkPartialPayments[n].date.substring(0,10):d.checkPartialPayments[n].date,onChange:function(e){var r=Object(a.a)(d.checkPartialPayments),i=Object(c.a)({},r[n]);i.date=e,r[n]=i,t(Object(c.a)(Object(c.a)({},d),{},{checkPartialPayments:r}))}})]}),Object(v.jsxs)(p.a,{s:2,m:3,l:3,xl:3,className:"p-5",children:[Object(v.jsx)("label",{}),Object(v.jsxs)("div",{className:"p-5",children:[n?Object(v.jsx)(o.a,{onClick:function(){var e=Object(a.a)(d.checkPartialPayments);e.splice(n,1),t(Object(c.a)(Object(c.a)({},d),{},{checkPartialPayments:e}))},color:"violet",icon:Object(v.jsx)(_.a,{})}):"",n+1==d.checkPartialPayments.length&&Object(v.jsx)(o.a,{onClick:function(){var e=Object(a.a)(d.checkPartialPayments);e.push({amount:0,date:new Date}),t(Object(c.a)(Object(c.a)({},d),{},{checkPartialPayments:e}))},color:"violet",icon:Object(v.jsx)(x.a,{})})]})]})]})}))}),1!=d.status&&Object(v.jsxs)(v.Fragment,{children:[Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Date De Changement: "}),Object(v.jsx)(i.a,{defaultValue:O()(d.changeDate).format("YYYY-MM-DD"),type:"date",value:O()(d.changeDate).format("YYYY-MM-DD"),onChange:function(e){return t((function(t){return Object(c.a)(Object(c.a)({},t),{},{changeDate:e})}))},block:!0})," "]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Num\xe9ro de bordereau: "}),Object(v.jsx)(i.a,{value:d.payingInSlip,onChange:function(e){return t((function(t){return Object(c.a)(Object(c.a)({},t),{},{payingInSlip:e})}))},block:!0})," "]})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Montant"}),Object(v.jsx)(i.a,{type:"number",disabled:D,step:"0.1",value:d.amount,onChange:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{amount:e})}))}})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Tireur / Proprietaire"}),Object(v.jsx)(i.a,{value:d.owner,onChange:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{owner:e})}))}})]}),"undefined"!=typeof b&&Object(v.jsxs)(v.Fragment,{children:[Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Client: "}),Object(v.jsx)(r.a,{onSearch:function(e){return y(e)},data:[{label:"Tout",value:0}].concat(b.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:d.clientId,onSelect:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{clientId:e})}))}})]}),b.find((function(e){return e.name.includes("(B2C)")}))&&Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Client B2C"}),Object(v.jsx)(i.a,{value:d.b2CName,onChange:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{b2CName:e})}))}})]})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[" ",Object(v.jsx)("label",{children:"Banque d'Emission: "}),Object(v.jsx)(r.a,{onSearch:function(e){return g(e)},data:[{label:"Tout",value:0}].concat(m),block:!0,noSearch:!0,value:d.emmissionBankId,onSelect:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{emmissionBankId:e})}))}})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Banque de D\xe9p\xf4t: "}),Object(v.jsx)(r.a,{onSearch:function(e){return g(e)},data:[{label:"Tout",value:0}].concat(m),block:!0,noSearch:!0,value:d.depositBankId,onSelect:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{depositBankId:e})}))}})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Date De D\xe9p\xf4t: "}),Object(v.jsx)(i.a,{type:"date",defaultValue:O()(d.date).format("YYYY-MM-DD"),value:O()(d.date).format("YYYY-MM-DD"),onChange:function(e){return t((function(t){return Object(c.a)(Object(c.a)({},t),{},{date:e})}))},block:!0})]}),Object(v.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(v.jsx)("label",{children:"Date D'\xe9ch\xe8ance: "}),Object(v.jsx)(i.a,{type:"date",defaultValue:O()(d.dueDate).format("YYYY-MM-DD"),value:O()(d.dueDate).format("YYYY-MM-DD"),onChange:function(e){return t((function(t){return Object(c.a)(Object(c.a)({},t),{},{dueDate:e})}))},block:!0})]}),Object(v.jsx)(p.a,{l:6,xl:6,className:"p-5",children:"undefined"!=typeof b&&Object(v.jsxs)(v.Fragment,{children:[Object(v.jsx)("label",{children:"Type "}),Object(v.jsx)(r.a,{searchable:!1,data:u.n,block:!0,noSearch:!0,value:d.checkPurpose,onSelect:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{checkPurpose:e})}))}})]})}),Object(v.jsx)("label",{children:"Notes:"}),Object(v.jsx)(i.a,{as:"textarea",rows:3,placeholder:"Textarea",value:d.notes,onChange:function(e){t((function(t){return Object(c.a)(Object(c.a)({},t),{},{notes:e})}))}}),Object(v.jsx)("label",{children:"Attachement:"}),Object(v.jsx)(s.a,{loading:C,autoUpload:!1,fileList:I,action:"#",draggable:!0,onRemove:function(e){return E(e.fileKey)},onChange:function(e){console.log(e);var t=e.filter((function(e){return"finished"!=e.status})).reverse()[0];t&&S(e,t.blobFile,t.fileKey)},children:Object(v.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(v.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(v.jsx)(j.a,{color:"#3598ff"})]}),Object(v.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),Object(v.jsx)("br",{}),n&&Object(v.jsx)(l.a,{showIcon:!0,type:"error",children:n})]})}},742:function(e,t,n){e.exports={container:"filter_container__3aI47"}},767:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Check}));var _app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(10),_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(3),_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5),react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(2),react__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__),recoil__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(9),rsuite__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(179),rsuite__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(76),rsuite__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(80),rsuite__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(1221),rsuite__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(107),rsuite__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(152),rsuite_Pagination__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(26),sweetalert2__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(15),sweetalert2__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_12__),_Api___WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(6),_Atoms_exportAdd_atom__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(23),_Components_Common_ExportAdd__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(24),_Components_Common_Filter__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(22),_Components_Grid__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(19),_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(7),_Constants_types__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(14),_Helpers_validate__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(31),_Models_CheckModel__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(62),_AddEdit_component__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(73),_excel_data__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(770),moment__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(13),moment__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_24__),_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(247),_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_25__),_CheckHistoric__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(771),_Helpers_number_formatter__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(25),_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(50),react_icons_ai__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(776),_Atoms_recoveryPoints_atom__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(131),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(1),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__);function Check(props){var _useState=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState2=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState,2),data=_useState2[0],setdata=_useState2[1],_useState3=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState4=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState3,2),summary=_useState4[0],setsummary=_useState4[1],_useState5=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState6=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState5,2),clients=_useState6[0],setclients=_useState6[1],_useState7=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState8=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState7,2),clients2=_useState8[0],setclients2=_useState8[1],_useState9=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState10=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState9,2),banks=_useState10[0],setbanks=_useState10[1],_useState11=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState12=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState11,2),files=_useState12[0],setfiles=_useState12[1],_useState13=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(!1),_useState14=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState13,2),loading=_useState14[0],setloading=_useState14[1],_useState15=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(!1),_useState16=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState15,2),loadingsummary=_useState16[0],setloadingsummary=_useState16[1],_useState17=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(""),_useState18=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState17,2),color=_useState18[0],setcolor=_useState18[1],_useState19=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState20=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState19,2),summary2=_useState20[0],setsummary2=_useState20[1],_useState21=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(!1),_useState22=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState21,2),open=_useState22[0],setopen=_useState22[1],_useState23=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(""),_useState24=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState23,2),historic=_useState24[0],sethistoric=_useState24[1],_useState25=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(""),_useState26=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState25,2),date=_useState26[0],setdate=_useState26[1],_useState27=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(0),_useState28=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState27,2),totalCount=_useState28[0],settotalCount=_useState28[1],_useState29=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)({page:1,take:20,clientId:0,status:0,type:0,date:null}),_useState30=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState29,2),filterModel=_useState30[0],setfilterModel=_useState30[1],_useState31=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(""),_useState32=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState31,2),error=_useState32[0],setError=_useState32[1],_useState33=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)(new _Models_CheckModel__WEBPACK_IMPORTED_MODULE_21__.a),_useState34=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useState33,2),model=_useState34[0],setmodel=_useState34[1],_useRecoilState=Object(recoil__WEBPACK_IMPORTED_MODULE_4__.c)(_Atoms_exportAdd_atom__WEBPACK_IMPORTED_MODULE_14__.a),_useRecoilState2=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.a)(_useRecoilState,2),state=_useRecoilState2[0],setstate=_useRecoilState2[1],reset=function(){setmodel(new _Models_CheckModel__WEBPACK_IMPORTED_MODULE_21__.a),setError("")},_fetchClients=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((function(e){return t?setclients(e.data):setclients2(e.data)}))},fetchBanks=function(e){("undefined"==typeof e||e.length>2)&&_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((function(e){return setbanks(e.data)}))},fetch=function(){setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!0})})),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!0})})),_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check,Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},filterModel),{},{date:filterModel.date?moment__WEBPACK_IMPORTED_MODULE_24___default()(filterModel.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!1})})),setdata(e.data.data),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!1})})),settotalCount(e.data.totalCount)})).catch((function(e){setError(e.Message),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!1})}))}))},fetchSummary=function(){_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check+"/Summary",Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},filterModel),{},{date:filterModel.date?moment__WEBPACK_IMPORTED_MODULE_24___default()(filterModel.date).format("DD MMM YYYY"):null})).fetchAll().then((function(e){setsummary(e.data)})).catch((function(e){return setError(e.Message)}))},fetchSummary2=function(e){setloadingsummary(!0),_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check+"/Summary1",Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},filterModel),{},{date:filterModel.date?moment__WEBPACK_IMPORTED_MODULE_24___default()(filterModel.date).format("DD MMM YYYY"):null,status:e})).fetchAll().then((function(e){setloadingsummary(!1),setsummary2(e.data)})).catch((function(e){return setloadingsummary(!1)}))},save=function save(){var msg=Object(_Helpers_validate__WEBPACK_IMPORTED_MODULE_20__.a)(model,[{number:"Num\xe9ro"},{status:"Status"},{amount:"Montant"},{checkPurpose:"Type de Ch\xe9que"},{clientId:"Client"}]);msg?setError(msg):(setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!0})})),model.id?(delete model.client,delete model.depositBank,delete model.emmissionBank,_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check).update(model.id,Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},model),{},{amount:Number(model.amount),attachments:model.attachments?model.attachments.join():"",historic:1==model.status||model.historic&&eval("{data:["+model.historic+"]}").find((function(e){return e.status==model.status}))?model.historic:(model.historic?model.historic+",":"")+"{status:"+model.status+',Date:"'+moment__WEBPACK_IMPORTED_MODULE_24___default()(model.changeDate).format("DD/MM/yyyy")+'"}',checkPartialPayments:model.checkPartialPayments?model.checkPartialPayments.map((function(e){return delete e.id,e})):[]})).then((function(e){fetch(),reset(),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{open:!1,loading:!1})})),reset(),sweetalert2__WEBPACK_IMPORTED_MODULE_12___default.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((function(e){setError(e.Message),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!1})}))}))):_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check).create(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},model),{},{amount:Number(model.amount),attachments:model.attachments.join()})).then((function(e){fetch(),reset(),sweetalert2__WEBPACK_IMPORTED_MODULE_12___default.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{open:!1,loading:!1})}))})).catch((function(e){setError(e.Message),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{loading:!1})}))})))},deleteAction=function(e){_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check).delete(e).then((function(e){fetch(),sweetalert2__WEBPACK_IMPORTED_MODULE_12___default.a.fire("Supprim\xe9 !","","success")})).catch((function(e){return setError(e.Message)}))},getBYId=function(e){setError(""),_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.Check).fetchById(e).then((function(e){if(e.data.client&&!clients2.find((function(t){return t.id==e.data.client.id}))){var t=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(clients2);t.unshift({id:e.data.client.id,name:e.data.client.name}),setclients2(t)}setmodel(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e.data))})).catch((function(e){console.log(e)}))};Object(react__WEBPACK_IMPORTED_MODULE_3__.useEffect)((function(){_fetchClients(),fetchBanks(),fetchSummary()}),[]),Object(react__WEBPACK_IMPORTED_MODULE_3__.useEffect)((function(){fetch()}),[filterModel.page,filterModel.take]);var upload=function(e,t,n){files.length||(setloading(!0),_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.File).upload(t).then((function(t){setloading(!1);var a=e.findIndex((function(e){return e.fileKey==n}));setfiles((function(t){var n=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(e);return n[a].status="finished",n})),setmodel((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},model),{},{attachments:t.data[0].name})}))})).catch((function(t){setloading(!1);var a=e.findIndex((function(e){return e.fileKey==n}));setfiles((function(t){var n=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(e);return n[a].status="error",n}))})))},_delete=function(e){var t=files.findIndex((function(t){return t.fileKey==e}));_Api___WEBPACK_IMPORTED_MODULE_13__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_13__.a.ENDPOINTS.File).delete(files[t].name).then((function(e){setfiles((function(e){var n=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(e);return n.splice(t),n}));var n=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(model.attachments);n.splice(t),setmodel((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},model),{},{attachments:n})}))})).catch((function(e){}))},columns=[{value:"number",name:"Num\xe9ro",value2:"id",render:function(e,t){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("b",{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("a",{onClick:function(){getBYId(t),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{open:!0})}))},children:e})})}},{value:"client",value2:"b2CName",name:"Client",render:function(e,t){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)("a",{children:[e?e.name:"-",t?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("br",{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("i",{style:{color:"#777"},children:t})]}):""," "]})}},{value:"owner",name:"Tireur / Proprietaire",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("a",{style:{fontSize:"14px"},children:e||"-"})}},{value:"amount",name:"Montant",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("b",{style:{fontSize:"14px"},children:Object(_Helpers_number_formatter__WEBPACK_IMPORTED_MODULE_27__.a)(e)})}},{value:"depositBank",name:"Banque de D\xe9p\xf4t",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("b",{style:{fontSize:"13px"},children:e?e.name:""})}},{value:"depositDate",name:"Date De D\xe9p\xf4t",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_5__.a,{children:moment__WEBPACK_IMPORTED_MODULE_24___default()(e).format("DD MMM YYYY")})}},{value:"emmissionBank",name:"Banque d'Emission",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("b",{style:{color:"green",fontSize:"13px"},children:e?e.name:""})}},{value:"status",name:"Status",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_5__.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:_Constants_types__WEBPACK_IMPORTED_MODULE_19__.o.find((function(t){return t.value==e})).label})}},{value:"checkPurpose",name:"Type",render:function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_5__.a,{color:1==e?"":2==e?"green":"",children:_Constants_types__WEBPACK_IMPORTED_MODULE_19__.n.find((function(t){return t.value==e})).label})}},{value:"historic",value2:"depositDate",name:"",render:function(e,t){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_6__.a,{disabled:!e,onClick:function(){setopen(!0),sethistoric(e),setdate(t)},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_25___default.a,{})})})}}];return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)("div",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(_Components_Common_Filter__WEBPACK_IMPORTED_MODULE_16__.a,{search:function(){fetch(),fetchSummary()},children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("label",{children:"Num\xe9ro: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_7__.a,{placeholder:"recherche",onChange:function(e){setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{q:e})}))}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("label",{children:"Date De D\xe9p\xf4t: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_8__.a,{placement:"bottomStart",value:filterModel.date,onChange:function(e){return setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{date:e})}))},onSelect:function(e){return setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{date:e})}))},block:!0})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("label",{children:"Client: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_9__.a,{onSearch:function(e){return _fetchClients(e)},data:[{label:"Tout",value:0}].concat(clients.map((function(e){return{label:e.name,value:e.id}}))),block:!0,noSearch:!0,value:filterModel.clientId,onSelect:function(e){setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{clientId:e})}))}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("label",{children:"Status: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_9__.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(_Constants_types__WEBPACK_IMPORTED_MODULE_19__.o),block:!0,noSearch:!0,value:filterModel.status,onSelect:function(e){setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{status:e})}))}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("label",{children:"Type: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_9__.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(_Constants_types__WEBPACK_IMPORTED_MODULE_19__.n),block:!0,noSearch:!0,value:filterModel.type,onSelect:function(e){setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{type:e})}))}})]})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Common_ExportAdd__WEBPACK_IMPORTED_MODULE_15__.a,{excelData:Object(_excel_data__WEBPACK_IMPORTED_MODULE_23__.a)(data),nameExcel:"check",size:"md",save:save,AddComponent:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_AddEdit_component__WEBPACK_IMPORTED_MODULE_22__.a,{upload:upload,error:error,model:model,banks:banks.map((function(e){return{label:e.name,value:e.id}})),_delete:_delete,fetchBanks:fetchBanks,clients:clients2,fetchClients:function(e){return _fetchClients(e,!1)},_setmodel:setmodel})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)("div",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__.a,{action:function(){fetchSummary2(),setcolor("0,169,141")},text:"Total",color:"0,169,141",amount:summary.length&&summary.find((function(e){return e.id<0})).amount})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__.a,{action:function(){fetchSummary2(8),setcolor("245,195,35")},text:"Total Pay\xe9 En \xe9speces",color:"245,195,35",amount:summary.length&&summary.find((function(e){return 8==e.id}))&&summary.find((function(e){return 8==e.id})).amount})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__.a,{action:function(){fetchSummary2(1),setcolor("229,57,53")},text:"Total En Coffre",amount:summary.length&&summary.find((function(e){return 1==e.id}))&&summary.find((function(e){return 1==e.id})).amount,color:"229,57,53"})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__.a,{action:function(){fetchSummary2(2),setcolor("84,159,10")},text:"Total Remis \xe0 l'Encaissement",amount:summary.length&&summary.find((function(e){return 2==e.id}))&&summary.find((function(e){return 2==e.id})).amount,color:"84,159,10"})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_18__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__.a,{action:function(){fetchSummary2(3),setcolor("70,103,209")},text:"Total Encaiss\xe9",amount:summary.length&&summary.find((function(e){return 3==e.id}))&&summary.find((function(e){return 3==e.id})).amount})})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_Grid__WEBPACK_IMPORTED_MODULE_17__.a,{loading:state.loading,editAction:function(e){getBYId(e),setstate((function(e){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},e),{},{open:!0})}))},deleteAction:deleteAction,actionKey:"id",noAdvancedActions:!0,columns:columns,rows:data}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite_Pagination__WEBPACK_IMPORTED_MODULE_11__.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:totalCount,limitOptions:[10,20,50,100],limit:filterModel.take,activePage:filterModel.page,onChangePage:function(e){window.scrollTo(0,0),setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{page:e})}))},onChangeLimit:function(e){console.log(e),setfilterModel((function(t){return Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__.a)({},t),{},{take:e,page:1})}))}})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_CheckHistoric__WEBPACK_IMPORTED_MODULE_26__.a,{open:open,date:date,historic:historic,handleClose:function(){reset(),setopen(!1)}}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(Resume,{data:summary2,color:color,open:color.length>0,handleClose:function(){return setcolor("")}})]})}var Resume=function(e){var t=e.color,n=void 0===t?"70,103,209":t,a=e.open,c=e.handleClose,r=e.data,i=void 0===r?[]:r,o=Object(recoil__WEBPACK_IMPORTED_MODULE_4__.d)(_Atoms_recoveryPoints_atom__WEBPACK_IMPORTED_MODULE_30__.a);return Object(react__WEBPACK_IMPORTED_MODULE_3__.useEffect)((function(){console.log(o)}),[o]),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsxs)(rsuite__WEBPACK_IMPORTED_MODULE_10__.a,{size:"md",overflow:!1,open:a,onClose:c,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_10__.a.Header,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_10__.a.Title,{children:"D\xe9tails"})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_10__.a.Body,{children:o.map((function(e,t){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)("div",{className:"p-5",children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_28__.a,{radius:4,icon:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_31__.jsx)(react_icons_ai__WEBPACK_IMPORTED_MODULE_29__.a,{}),text:e.label,color:n,amount:i.find((function(t){return t.id==e.value}))?i.find((function(t){return t.id==e.value})).amount:0},t)})}))})]})}},770:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(14),c=n(13),r=n.n(c),i=function(e){return[{columns:[{title:"Num\xe9ro",width:{wpx:120}},{title:"Client",width:{wpx:150}},{title:"Banque de D\xe9p\xf4t",width:{wpx:150}},{title:"Date De D\xe9p\xf4t",width:{wpx:120}},{title:"Banque d'Emission",width:{wpx:150}},{title:"Status",width:{wpx:100}},{title:"Type",width:{wpx:150}},{title:"Notes",width:{wpx:100}}],data:e.map((function(e){return[{value:e.number,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.client?e.client.name:"",style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.depositBank?e.depositBank.name:"",style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:r()(e.depositDate).format("DD MMM YYYY"),style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.emmissionBank?e.emmissionBank.name:"",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13"},alignment:{horizontal:"center"}}},{value:a.o.find((function(t){return t.value==e.status})).label,style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:a.n.find((function(t){return t.value==e.checkPurpose})).label,style:{font:{sz:"14",color:{rgb:1==e.checkPurpose?"673ab7":2==e.checkPurpose?"5a2c3e":"f0b217"}},alignment:{horizontal:"center"}}},{value:e.notes,style:{font:{sz:"14"},alignment:{horizontal:"center"}}}]}))}]}},771:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return CheckHistoric}));var _app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(10),_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(5),moment__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(13),moment__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__),react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(2),react__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__),rsuite__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(152),rsuite__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(203),rsuite__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(791),rsuite__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(179),_Constants_types__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(14),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(1),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__);function CheckHistoric(_ref){var open=_ref.open,handleClose=_ref.handleClose,historic=_ref.historic,date=_ref.date,_useState=Object(react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),_useState2=Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.a)(_useState,2),state=_useState2[0],setstate=_useState2[1];return Object(react__WEBPACK_IMPORTED_MODULE_3__.useEffect)((function(){setstate([{status:1,Date:moment__WEBPACK_IMPORTED_MODULE_2___default()(date).format("DD/MM/yyyy")}].concat(Object(_app_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__.a)(eval("{data:["+historic+"]}"))))}),[open]),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(rsuite__WEBPACK_IMPORTED_MODULE_4__.a,{size:"md",overflow:!1,open:open,onClose:handleClose,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_4__.a.Title,{children:"Historique des etats:"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_5__.a,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_4__.a.Body,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_6__.a,{align:"vertical",children:state.map((function(e){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_6__.a.Item,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{style:{padding:"0 20px"},children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_7__.a,{color:1==e.status?"blue":2==e.status?"green":3==e.status?"violet":4==e.status?"black":"red",children:_Constants_types__WEBPACK_IMPORTED_MODULE_8__.o.find((function(t){return t.value==e.status})).label})," ",Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("strong",{children:e.Date})]})})}))})})]})})}var A=function(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment,{children:"test"})}},785:function(e,t,n){"use strict";e.exports={parse:function(e){if(null==e||88!=e.length)throw new Error("Invalid MRZ length");var t=r(e.substring(0,1));if("P"!=t)throw new Error("Not a passport MRZ, only passport MRZ currently supported!");var n=r(e.substring(1,2));""==n&&(n=null);try{var a=r(e.substring(2,5)),c=i(e.substring(5,44)),d=e.substring(44,53),j=r(d),b=e.substring(53,54),O=u(d,b),f=l(r(e.substring(54,57))),h=e.substring(57,63),p=o(r(h)),m=e.substring(63,64),x=u(h,m),g=s(r(e.substring(64,65))),_=e.substring(65,71),v=o(r(_)),y=r(e.substring(71,72)),C=u(_,y),I=e.substring(72,86),E=r(I),S=e.substring(86,87),D=u(I,S),N=e.substring(87,88),P=u(d+b+h+m+_+y+I+S,N);return{documentCode:t,documentType:"PASSPORT",documentTypeCode:n,issuer:a,names:c,documentNumber:j,nationality:f,dob:p,sex:g,checkDigit:{documentNumber:{value:b,valid:O},dob:{value:m,valid:x},expiry:{value:y,valid:C},personalNumber:{value:S,valid:D},finalCheck:{value:N,valid:P},valid:O&&x&&C&&D&&P},expiry:v,personalNumber:E}}catch(k){throw k}}};var a=[];a.AFG="Afghanistan",a.ALB="Albania",a.DZA="Algeria",a.ASM="American Samoa",a.AND="Andorra",a.AGO="Angola",a.AIA="Anguilla",a.ATA="Antarctica",a.ATG="Antigua and Barbuda",a.ARG="Argentina",a.ARM="Armenia",a.ABW="Aruba",a.AUS="Australia",a.AUT="Austria",a.AZE="Azerbaijan",a.BHS="Bahamas",a.BHR="Bahrain",a.BGD="Bangladesh",a.BRB="Barbados",a.BLR="Belarus",a.BEL="Belgium",a.BLZ="Belize",a.BEN="Benin",a.BMU="Bermuda",a.BTN="Bhutan",a.BOL="Bolivia",a.BIH="Bosnia and Herzegovina",a.BWA="Botswana",a.BVT="Bouvet Island",a.BRA="Brazil",a.IOT="British Indian Ocean Territory",a.BRN="Brunei Darussalam",a.BGR="Bulgaria",a.BFA="Burkina Faso",a.BDI="Burundi",a.KHM="Cambodia",a.CMR="Cameroon",a.CAN="Canada",a.CPV="Cape Verde",a.CYM="Cayman Islands",a.CAF="Central African Republic",a.TCD="Chad",a.CHL="Chile",a.CHN="China",a.CXR="Christmas Island",a.CCK="Cocos (Keeling) Islands",a.COL="Colombia",a.COM="Comoros",a.COG="Congo",a.COK="Cook Islands",a.CRI="Costa Rica",a.CIV="C\xf4te d'Ivoire",a.HRV="Croatia",a.CUB="Cuba",a.CYP="Cyprus",a.CZE="Czech Republic",a.PRK="Democratic People's Republic of Korea",a.COD="Democratic Republic of the Congo",a.DNK="Denmark",a.DJI="Djibouti",a.DMA="Dominica",a.DOM="Dominican Republic",a.TMP="East Timor",a.ECU="Ecuador",a.EGY="Egypt",a.SLV="El Salvador",a.GNQ="Equatorial Guinea",a.ERI="Eritrea",a.EST="Estonia",a.ETH="Ethiopia",a.FLK="Falkland Islands (Malvinas)",a.FRO="Faeroe Islands",a.FJI="Fiji",a.FIN="Finland",a.FRA="France",a.FXX="France, Metropolitan",a.GUF="French Guiana",a.PYF="French Polynesia",a.GAB="Gabon",a.GMB="Gambia",a.GEO="Georgia",a.D="Germany",a.GHA="Ghana",a.GIB="Gibraltar",a.GRC="Greece",a.GRL="Greenland",a.GRD="Grenada",a.GLP="Guadeloupe",a.GUM="Guam",a.GTM="Guatemala",a.GIN="Guinea",a.GNB="Guinea-Bissau",a.GUY="Guyana",a.HTI="Haiti",a.HMD="Heard and McDonald Islands",a.VAT="Holy See (Vatican City State)",a.HND="Honduras",a.HKG="Hong Kong",a.HUN="Hungary",a.ISL="Iceland",a.IND="India",a.IDN="Indonesia",a.IRN="Iran, Islamic Republic of",a.IRQ="Iraq",a.IRL="Ireland",a.ISR="Israel",a.ITA="Italy",a.JAM="Jamaica",a.JPN="Japan",a.JOR="Jordan",a.KAZ="Kazakhstan",a.KEN="Kenya",a.KIR="Kiribati",a.KWT="Kuwait",a.KGZ="Kyrgyzstan",a.LAO="Lao People's Democratic Republic",a.LVA="Latvia",a.LBN="Lebanon",a.LSO="Lesotho",a.LBR="Liberia",a.LBY="Libyan Arab Jamahiriya",a.LIE="Liechtenstein",a.LTU="Lithuania",a.LUX="Luxembourg",a.MDG="Madagascar",a.MWI="Malawi",a.MYS="Malaysia",a.MDV="Maldives",a.MLI="Mali",a.MLT="Malta",a.MHL="Marshall Islands",a.MTQ="Martinique",a.MRT="Mauritania",a.MUS="Mauritius",a.MYT="Mayotte",a.MEX="Mexico",a.FSM="Micronesia, Federated States of",a.MCO="Monaco",a.MNG="Mongolia",a.MNE="Montenegro",a.MSR="Montserrat",a.MAR="Morocco",a.MOZ="Mozambique",a.MMR="Myanmar",a.NAM="Namibia",a.NRU="Nauru",a.NPL="Nepal",a.NLD="Netherlands, Kingdom of the",a.ANT="Netherlands Antilles",a.NTZ="Neutral Zone",a.NCL="New Caledonia",a.NZL="New Zealand",a.NIC="Nicaragua",a.NER="Niger",a.NGA="Nigeria",a.NIU="Niue",a.NFK="Norfolk Island",a.MNP="Northern Mariana Islands",a.NOR="Norway",a.OMN="Oman",a.PAK="Pakistan",a.PLW="Palau",a.PSE="Palestine",a.PAN="Panama",a.PNG="Papua New Guinea",a.PRY="Paraguay",a.PER="Peru",a.PHL="Philippines",a.PCN="Pitcairn",a.POL="Poland",a.PRT="Portugal",a.PRI="Puerto Rico",a.QAT="Qatar",a.KOR="Republic of Korea",a.MDA="Republic of Moldova",a.REU="R\xe9union",a.ROU="Romania",a.RUS="Russian Federation",a.RWA="Rwanda",a.SHN="Saint Helena",a.KNA="Saint Kitts and Nevis",a.LCA="Saint Lucia",a.SPM="Saint Pierre and Miquelon",a.VCT="Saint Vincent and the Grenadines",a.WSM="Samoa",a.SMR="San Marino",a.STP="Sao Tome and Principe",a.SAU="Saudi Arabia",a.SRB="Serbia",a.SEN="Senegal",a.SYC="Seychelles",a.SLE="Sierra Leone",a.SGP="Singapore",a.SVK="Slovakia",a.SVN="Slovenia",a.SLB="Solomon Islands",a.SOM="Somalia",a.ZAF="South Africa",a.SGS="South Georgia and the South Sandwich Island",a.SSD="South Sudan",a.ESP="Spain",a.LKA="Sri Lanka",a.SDN="Sudan",a.SUR="Suriname",a.SJM="Svalbard and Jan Mayen Islands",a.SWZ="Swaziland",a.SWE="Sweden",a.CHE="Switzerland",a.SYR="Syrian Arab Republic",a.TWN="Taiwan Province of China",a.TJK="Tajikistan",a.TLS="Timor Leste",a.THA="Thailand",a.MKD="The former Yugoslav Republic of Macedonia",a.TGO="Togo",a.TKL="Tokelau",a.TON="Tonga",a.TTO="Trinidad and Tobago",a.TUN="Tunisia",a.TUR="Turkey",a.TKM="Turkmenistan",a.TCA="Turks and Caicos Islands",a.TUV="Tuvalu",a.UGA="Uganda",a.UKR="Ukraine",a.ARE="United Arab Emirates",a.GBR="United Kingdom of Great Britain and Northern Ireland Citizen",a.GBD="United Kingdom of Great Britain and Northern Ireland Dependent Territories Citizen",a.GBN="United Kingdom of Great Britain and Northern Ireland National (oversees)",a.GBO="United Kingdom of Great Britain and Northern Ireland Oversees Citizen",a.GBP="United Kingdom of Great Britain and Northern Ireland Protected Person",a.GBS="United Kingdom of Great Britain and Northern Ireland Subject",a.TZA="United Republic of Tanzania",a.USA="United States of America",a.UMI="United States of America Minor Outlying Islands",a.URY="Uruguay",a.UZB="Uzbekistan",a.VUT="Vanuatu",a.VEN="Venezuela",a.VNM="Viet Nam",a.VGB="Virgin Islands (Great Britian)",a.VIR="Virgin Islands (United States)",a.WLF="Wallis and Futuna Islands",a.ESH="Western Sahara",a.YEM="Yemen",a.ZAR="Zaire",a.ZMB="Zambia",a.ZWE="Zimbabwe",a.UNO="United Nations Organization Official",a.UNA="United Nations Organization Specialized Agency Official",a.XAA="Stateless (per Article 1 of 1954 convention)",a.XXB="Refugee (per Article 1 of 1951 convention, amended by 1967 protocol)",a.XXC="Refugee (non-convention)",a.XXX="Unspecified / Unknown";var c=[];c["<"]=0,c.A=10,c.B=11,c.C=12,c.D=13,c.E=14,c.F=15,c.G=16,c.H=17,c.I=18,c.J=19,c.K=20,c.L=21,c.M=22,c.N=23,c.O=24,c.P=25,c.Q=26,c.R=27,c.S=28,c.T=29,c.U=30,c.V=31,c.W=32,c.X=33,c.Y=34,c.Z=35;var r=function e(t){if(!t||"undefined"===typeof t|null==t)return t;if(t instanceof Array){for(var n=0;nn?"19"+e.substring(0,2):"20"+e.substring(0,2),month:e.substring(2,4),day:e.substring(4,6),original:e}},s=function(e){var t=void 0,n=void 0;return"M"==e?(t="M",n="Male"):"F"==e?(t="F",n="Female"):(t="X",n="Unspecified"),{abbr:t,full:n}},l=function(e){var t=a[e];if(!t)throw new Error("Invalid region");return{abbr:e,full:t}},u=function(e,t){for(var n=[],a=[7,3,1],r=0;r