(this.webpackJsonptaysirfinance_frontend=this.webpackJsonptaysirfinance_frontend||[]).push([[0],{1e3:function(e,t){},1002:function(e,t){},1008:function(e,t){},1010:function(e,t){},1029:function(e,t){},1041:function(e,t){},1044:function(e,t){},1062:function(e,t,a){},11:function(e,t,a){"use strict";a.d(t,"o",(function(){return n})),a.d(t,"f",(function(){return s})),a.d(t,"x",(function(){return c})),a.d(t,"q",(function(){return i})),a.d(t,"n",(function(){return l})),a.d(t,"s",(function(){return r})),a.d(t,"j",(function(){return o})),a.d(t,"u",(function(){return d})),a.d(t,"h",(function(){return j})),a.d(t,"a",(function(){return b})),a.d(t,"t",(function(){return h})),a.d(t,"i",(function(){return u})),a.d(t,"k",(function(){return p})),a.d(t,"g",(function(){return m})),a.d(t,"b",(function(){return x})),a.d(t,"c",(function(){return O})),a.d(t,"d",(function(){return g})),a.d(t,"B",(function(){return f})),a.d(t,"m",(function(){return y})),a.d(t,"e",(function(){return v})),a.d(t,"l",(function(){return _})),a.d(t,"p",(function(){return C})),a.d(t,"r",(function(){return I})),a.d(t,"w",(function(){return N})),a.d(t,"z",(function(){return E})),a.d(t,"v",(function(){return S})),a.d(t,"y",(function(){return D})),a.d(t,"A",(function(){return k}));const n=[{label:"Re\xe7u",value:1},{label:"Remise \xe0 l'encaissement",value:2},{label:"Log\xe9 dans le compte",value:3},{label:"Preavis",value:4},{label:"Preavis annul\xe9",value:5},{label:"CNP",value:6},{label:"Paiement (ARP)",value:7},{label:"Paiement (Esp\xe8ces)",value:8},{label:"Litige",value:9}],s=[{label:"En Attente",value:1},{label:"Non Confirm\xe9 Par Client",value:2},{label:"Confirm\xe9",value:3},{label:"Refus\xe9",value:4}],c=[{label:"Tous",value:"All"},{label:"TKTT",value:"TKTT"},{label:"EMDS",value:"EMDS"},{label:"RFND",value:"RFND"},{label:"CANX",value:"CANX"},{label:"CAN",value:"CAN"},{label:"RFNC",value:"RFNC"},{label:"SPDR",value:"SPDR"},{label:"ADMS",value:"ADMS"},{label:"ADMA",value:"ADMA"},{label:"ACMS",value:"ACMS"},{label:"ACMA",value:"ACMA"}],i=[{label:"Aujourd'hui",value:1},{label:"Hier",value:2},{label:"Ce mois",value:3},{label:"Le mois dernier",value:4},{label:"Cette ann\xe9e",value:5},{label:"Personnalis\xe9",value:6},{label:"Jour",value:7}],l=[{label:"Recouvrement",value:1},{label:"Garantie Client",value:2}],r=[{label:"Ch\xe9que",value:1},{label:"Esp\xe8ces ",value:2},{label:"Solde",value:3},{label:"Virement Bancaire",value:4}],o=[{label:"Non Pay\xe9",value:1},{label:"Pay\xe9 en Partie",value:2},{label:"En Attente",value:3},{label:"Pay\xe9",value:4},{label:"Rembours\xe9",value:5},{label:"Annul\xe9",value:6},{labe:"Confirm\xe9",value:7}],d=[{label:"Billetterie",value:1},{label:"H\xf4tel",value:2},{label:"Bateau",value:3},{label:"Autobus",value:4},{label:"Excursion",value:5},{label:"Voyage Organis\xe9",value:6},{label:"Omrah",value:7},{label:"Autres",value:8}],j=[{label:"Masculin",value:1},{label:"F\xe9minin",value:2}],b=[{label:"Adulte",value:1},{label:"Enfant",value:2}],h=[{label:"Chambre simple",value:"Chambre simple"},{label:"Chambre double",value:"Chambre double"},{label:"Chambre triple",value:"Chambre triple"},{label:"Chambre quadruple",value:"Chambre quadruple"},{label:"Chambre Familiale",value:"Chambre Familiale"},{label:"Suite",value:"Suite"}],u=[{label:"C\xe9libataire",value:1},{label:"Marri\xe9(e)",value:2},{label:"Divorc\xe9(e)",value:3},{label:"Veuf / veuve",value:4}],p=[{value:1,label:"\u0627\u0644\u0633\u064a\u062f"},{value:2,label:"\u0627\u0644\u0633\u064a\u062f\u0629"},{value:3,label:"\u0627\u0644\u0622\u0646\u0633\u0629"},{value:7,label:"\u0623\u062e\u0631\u0649"}],m=[{value:1,label:"Client B2C"},{value:2,label:"Guide"},{value:3,label:"Employ\xe9"}],x={hasWifi:"Wi-Fi",hasBreakfast:"Petit-d\xe9jeuner",hasLunch:"D\xe9jeuner",hasDinner:"D\xeener",hasPosition:"Position",hasBus:"Bus",hasTransfert:"Transfert",hasVol:"Vol",hasKettle:"Bouilloire",hasRoomService:"Service \xe9tage"},O={hasHotels:"H\xf4tels",hasVisa:"Visa",hasMeal:"Repas",hasTransfert:"Transfert",hasVol:"Vol",hasZemzem:"Zemzem",transfAirportHotel:"Transfert a\xe9roport h\xf4tel",tranfInterUmrah:"Transfert local"},g={hasHotels:"H\xf4tels",hasVisa:"Visa",hasMeal:"Repas",hasTransfert:"Transfert",hasVol:"Vol"},f=[{label:"Adulte",value:"Adult"},{label:"Enfant (5-11)",value:"Child (5-11)"},{label:"B\xe9b\xe9",value:"Baby"}],y=[{label:"Destination",value:0},{label:"A\xe9roport",value:1},{label:"H\xf4tel",value:2}],v={hasBus:"Bus",hasBreakfast:"Petit-d\xe9jeuner",hasWifi:"Wi-Fi",hasTransfert:"Transfert",hasVol:"Vol"},_=[{label:"Umrah",value:0},{label:"Voyage Organis\xe9",value:1}],C=[{label:"Economic ",value:"Y"},{label:"Economic Standard",value:"M"},{label:"Economic Premium,",value:"W"},{label:"Business",value:"C"},{label:"First",value:"F"}],I=[{label:"Makkah",value:"makkah"},{label:"Madinah",value:"madinah"}],N=["Infos G\xe9n\xe9rales","Vols","Destination et H\xf4tels","Programme","Prix","Attachments"],E=[{label:"Petit D\xe9jeuner",value:0},{label:"D\xe9jeuner",value:1},{label:"Dinner",value:2},{label:"Iftar",value:3},{label:"Souhour",value:4},{label:"Others",value:5}],S=[{label:"Others",value:0},{label:"Excursion",value:1},{label:"Service d'\xe9tage",value:2},{label:"\xc9quipements pour les personnes handicap\xe9es",value:3},{label:"Navette A\xe9roport",value:4},{label:"Ticket",value:5},{label:"Bus",value:6},{label:"Ship",value:7},{label:"Visa",value:8}],D=[{label:"Kaaba View",value:"Kaaba View"},{label:"Haram View",value:"Haram View"}],k=[{label:"Bus",value:"Bus"},{label:"Tgv",value:"Tgv"}]},115:function(e){e.exports=JSON.parse('[{"code":"AB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u0627\u0645\u0631\u064a\u0643\u064a","name_en":"AMERICAN BREAKFAST","name_fr":"PETIT D\xc9JEUNER AM\xc9RICAIN","multiLingualCode":"DA"},{"code":"AI","name_ar":"\u0623\u0642\u0627\u0645\u0647 \u0634\u0627\u0645\u0644\u0647 \u0627\u0644\u0648\u062c\u0628\u0627\u062a \u0648 \u0627\u0644\u0645\u0634\u0631\u0648\u0628\u0627\u062a","name_en":"ALL INCLUSIVE","name_fr":"TOUT INCLUS","multiLingualCode":"TI"},{"code":"AS","name_ar":"\u0623\u0642\u0627\u0645\u0647 \u0634\u0627\u0645\u0644\u0647 \u0627\u0644\u0648\u062c\u0628\u0627\u062a \u0648 \u0627\u0644\u0645\u0634\u0631\u0648\u0628\u0627\u062a \u0628\u0631\u064a\u0645\u064a\u064a\u0645","name_en":"All Inclusive Premium","name_fr":"All Inclusive Premium","multiLingualCode":"TS"},{"code":"B1","name_ar":"","name_en":"Breakfast for one guest","name_fr":"PETIT D\xc9JEUNER 1 personne","multiLingualCode":"B1"},{"code":"B2","name_ar":"","name_en":"Breakfast for two guests","name_fr":"PETIT D\xc9JEUNER 2 personnes","multiLingualCode":"B2"},{"code":"BB","name_ar":"\u0623\u0642\u0627\u0645\u0647 \u0648 \u0625\u0641\u0637\u0627\u0631","name_en":"BED AND BREAKFAST","name_fr":"CHAMBRE ET PETIT DEJEUNER","multiLingualCode":"LPD"},{"code":"BH","name_ar":"\u0623\u0642\u0627\u0645\u0647 \u0628\u0627\u0644\u0627\u0641\u0637\u0627\u0631 + \u0623\u0642\u0627\u0645\u0647 \u0627\u0641\u0637\u0627\u0631 \u0648 \u0639\u0634\u0627\u0621","name_en":"1 BED AND BREAKFAST + 1 HALF BOARD","name_fr":"1 CHAMBRE ET PETIT DEJEUNER + 1 DEMI-PENSION","multiLingualCode":"BH"},{"code":"CB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u0643\u0648\u0646\u062a\u064a\u0646\u064a\u0646\u062a\u0627\u0644","name_en":"CONTINENTAL BREAKFAST","name_fr":"PETIT D\xc9JEUNER CONTINENTAL","multiLingualCode":"DC"},{"code":"CE","name_ar":"","name_en":"DINNER INCLUDED","name_fr":"D\xceNER","multiLingualCode":"DI"},{"code":"CO","name_ar":"","name_en":"LUNCH INCLUDED","name_fr":"D\xc9JEUNER","multiLingualCode":"DE"},{"code":"DB","name_ar":"\u0628\u0648\u0641\u064a\u0647 \u0625\u0641\u0637\u0627\u0631","name_en":"BUFFET BREAKFAST","name_fr":"PETIT D\xc9JEUNER BUFFET","multiLingualCode":"DF"},{"code":"FB","name_ar":"\u062c\u0645\u064a\u0639 \u0627\u0644\u0648\u062c\u0628\u0627\u062a","name_en":"FULL BOARD","name_fr":"PENSION COMPL\xc8TE","multiLingualCode":"PC"},{"code":"FH","name_ar":"\u0623\u0642\u0627\u0645\u0647 \u0627\u0641\u0637\u0627\u0631 \u0648 \u0639\u0634\u0627\u0621 + \u0623\u0642\u0627\u0645\u0647 \u0625\u0641\u0637\u0627\u0631 \u063a\u062f\u0627\u0621 \u0648 \u0639\u0634\u0627\u0621","name_en":"1 HALF BOARD + 1 FULL BOARD","name_fr":"1 DEMI-PENSION + 1 PENSION COMPL\xc8TE","multiLingualCode":"FH"},{"code":"GB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u0627\u0646\u062c\u0644\u064a\u0632\u064a","name_en":"ENGLISH BREAKFAST","name_fr":"PETIT D\xc9JEUNER ANGLAIS","multiLingualCode":"PA"},{"code":"HB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u0648 \u0639\u0634\u0627\u0621","name_en":"HALF BOARD","name_fr":"DEMI-PENSION","multiLingualCode":"DP"},{"code":"IB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u0627\u064a\u0631\u0644\u0627\u0646\u062f\u064a","name_en":"IRISH BREAKFAST","name_fr":"PETIT D\xc9JEUNER IRLANDAIS","multiLingualCode":"PI"},{"code":"LB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u062e\u0641\u064a\u0641","name_en":"LIGHT BREAKFAST","name_fr":"Petit-dejeuner l\xe9ger","multiLingualCode":"LB"},{"code":"MB","name_ar":"\u0625\u0641\u0637\u0627\u0631 \u0648 \u0639\u0634\u0627\u0621 \u0645\u062a\u0636\u0645\u0646\u0647 \u0627\u0644\u0645\u0634\u0631\u0648\u0628\u0627\u062a","name_en":"HALF BOARD WITH BEVERAGES INCLUDED","name_fr":"DEMI-PENSION AVEC BOISSONS","multiLingualCode":"DB"},{"code":"PB","name_ar":"\u062c\u0645\u064a\u0639 \u0627\u0644\u0648\u062c\u0628\u0627\u062a \u0645\u062a\u0636\u0645\u0646\u0647 \u0627\u0644\u0645\u0634\u0631\u0648\u0628\u0627\u062a","name_en":"FULL BOARD BEVERAGES INCLUDED","name_fr":"PENSION COMPLETE AVEC BOISSONS","multiLingualCode":"PB"},{"code":"RO","name_ar":"\u063a\u0631\u0641\u0647 \u0641\u0642\u0637 \u0628\u062f\u0648\u0646 \u0648\u062c\u0628\u0627\u062a","name_en":"ROOM ONLY","name_fr":"CHAMBRE SEULEMENT","multiLingualCode":"CS"},{"code":"SB","name_ar":"","name_en":"SCOTTISH BREAKFAST","name_fr":"PETIT D\xc9JEUNER \xc9COSSAI","multiLingualCode":"PE"},{"code":"SC","name_ar":"","name_en":"SELF CATERING","name_fr":"LOGEMENT SEULEMENT","multiLingualCode":"LS"},{"code":"TL","name_ar":"\u0623\u0642\u0627\u0645\u0647 \u0634\u0627\u0645\u0644\u0647 \u0627\u0644\u0648\u062c\u0628\u0627\u062a \u0648 \u0627\u0644\u0645\u0634\u0631\u0648\u0628\u0627\u062a \u063a\u064a\u0631 \u0643\u062d\u0648\u0644\u064a\u0647","name_en":"ALL INCLUSIVE SOFT","name_fr":"TOUT INCLUS SOFT","multiLingualCode":"AA"},{"multiLingualCode":"DP+","name_fr":"Demi Pension Plus","code":"DP+"},{"name_fr":"Pension Compl\xe8te Plus","multiLingualCode":"PC+","code":"PC+"},{"name_fr":"Ultra All Inclusive","multiLingualCode":"Ultra All AI","code":"Ultra All AI"},{"name_fr":"Ultra All Inclusive Soft Drink","multiLingualCode":"Ultra AI Soft Drink","code":"Ultra AI Soft Drink"},{"name_fr":"All Inclusive Soft Drink","multiLingualCode":"All Inc SD","code":"All Inc SD"}]')},117:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(7);const s=Object(n.b)({key:"recoveryPoints",default:[]})},1172:function(e,t,a){},1173:function(e,t,a){},1174:function(e,t,a){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"}},1181:function(e,t,a){"use strict";a.r(t);var n=a(2),s=a(59),c=a.n(s),i=a(121),l=a(187),r=a.n(l),o=a(42),d=a.n(o),j=a(252),b=a.n(j),h=a(161),u=a.n(h),p=(a(712),a(713)),m=a.n(p),x=(a(714),a(715)),O=a.n(x),g=a(62),f=a.n(g),y=a(46),v=a(241),_=a(54),C=a(33),I=a(7),N=a(1202),E=a(1218),S=a(1203),D=a(1206),k=a(763),P=a(1219),A=a(1215),M=(a(1204),a(836),a(4));a(837);const T=Object(I.b)({key:"agencyAtoms",default:[]});const w=Object(I.b)({key:"agencyAtom",default:new class{}}),B=Object(I.b)({key:"AgentsAtom",default:[]}),R=new I.b({key:"Airlines",default:[]}),U=Object(I.b)({key:"isLogged",default:!1}),L=new I.b({default:{},key:"ConfigState"}),F=Object(I.b)({key:"CurrencyAtom",default:[]});var z={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",arrivalName:"Nom d'arriv\xe9e",longitude:"Longitude",latitude:"Latitude",categories:"Categories",chooseCategories:"Choisir des categories"};class K{constructor(){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 W,this.description=z.descriptionPackageDefault,this.idDossAlfresco="",this.prices=[new Y],this.differentFees=[],this.destinations=[],this.disponibilities=[new q],this.packageUmrahCosts=[],this.images=[],this.idsDelete=[],this.extrats=[],this.programId=0,this.isDisplayed=!1,this.categoryIds=[]}}class W{constructor(){this.hasVol=!1,this.hasTransfert=!1,this.hasHotels=!1,this.hasVisa=!1,this.hasMeal=!1,this.hasZemzem=!1,this.transfAirportHotel=!1,this.tranfInterUmrah=!1}}class Y{constructor(){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}}class G{constructor(e,t,a){this.id=0,this.packageUmrahId=0,this.providerId=e||0,this.designation="",this.cost=0,this.exchange=a||1,this.currencyId=t||0,this.service=null}}class V{constructor(){this.id=0,this.packageUmrahId=0,this.designation="",this.cost=0}}class H{constructor(){this.id=0,this.name="",this.order=0,this.nbrDay=1,this.packageUmrahId=0,this.hotelsUmrah=[new J],this.excursionDestIds=[],this.isFirst=!1}}class q{constructor(){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 ee,this.flights=[]}}class Z{constructor(e,t){this.id=0,this.name="",this.departDate="",this.arrivalDate="",this.description="",this.departureAirportId=0,this.arrivalAirportId=0,this.airlineId=null|t,this.class="",this.flightNumber="",this.flightDuration="",this.handBaggages=0,this.baggages=0,this.type=e,this.nbrHandBaggages=0,this.nbrBaggages=0}}class J{constructor(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=e||"",this.packageUmrahId=0,this.hotelListId=0,this.destinationId=0,this.arrangements=[],this.packageMealTypes=[],this.caracteristique=new Q}}class ${constructor(){this.id=0,this.cost=0,this.designation="",this.hotelUmrahId=0,this.unitCost=0,this.typeTraveler=""}}class X{constructor(){this.id=0,this.hotelId=0,this.totalPrice=0,this.cost=0,this.typeMeal=null}}class Q{constructor(){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}}class ee{constructor(){this.id=0,this.name="",this.description="",this.packageUmrahId=0,this.caracteristiqueId=0,this.caracteristiques=new te,this.transfertLists=[new ae]}}class te{constructor(){this.hasVol=!1,this.hasTransfert=!1,this.hasWifi=!1,this.hasBreakfast=!1,this.hasBus=!1}}class ae{constructor(){this.id=0,this.name="",this.date="",this.departName="",this.departType="",this.arrivalName="",this.arrivalType="",this.modeTransports=[new ne],this.paysArrivalId="",this.paysDepartureId=""}}class ne{constructor(){this.id=0,this.name="Bus",this.price=0}}const se=new I.b({default:new K,key:"DefaultTemplateUmrah"}),ce=Object(I.b)({key:"ExchangeAtom",default:[]}),ie=Object(I.b)({key:"groupsAtoms",default:[]});var le=a(117),re=a(5);const oe=new I.b({default:{login:"",password:""},key:"ConfigState"});var de=a(68),je=a(64),be=a(31),he=a(1);function ue(){const[e,t]=Object(I.c)(oe);Object(n.useEffect)((()=>{}),[]);return Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom d'utilisateur Nusuk : "}),Object(he.jsx)(de.a,{value:e.login,onChange:e=>t((t=>({...t,login:e})))})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Mot de passe de Nusuk: "}),Object(he.jsx)(de.a,{value:e.password,onChange:e=>t((t=>({...t,password:e})))})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Email : "}),Object(he.jsx)(de.a,{type:"email",value:e.email,onChange:e=>t((t=>({...t,email:e})))})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"T\xe9l\xe9phone : "}),Object(he.jsx)(de.a,{type:"phone",value:e.phone,onChange:e=>t((t=>({...t,phone:e})))})]}),Object(he.jsx)(je.a,{appearance:"primary",onClick:()=>{e.id?M.a.createAPIEndpoint(be.a.Config).update(e.id,e).then((e=>alert("bien modifi\xe9"))):M.a.createAPIEndpoint(be.a.Config).create({...e}).then((e=>alert("bien enregistr\xe9")))},children:"Enregistrer"})]})}var pe=a(10),me=a.n(pe),xe=a(21),Oe=a(18),ge=a(19),fe=a(17),ye=a(15);function ve(e){let{noHead:t=!1}=e;const[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(0),[l,r]=Object(n.useState)({page:1,take:20,clientId:0,date:null}),[o,d]=Object(I.c)(Oe.a),j=()=>{d((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Ledger,{...l,date:l.date?me()(l.date).format("DD MMM YYYY"):null},"/GetAccountFollwoUp").customGet().then((e=>{s(e.data.data),d((e=>({...e,loading:!1}))),i(e.data.totalCount)})).catch((e=>{}))};return Object(n.useEffect)((()=>{j()}),[l.page,l.take]),Object(he.jsxs)("div",{children:[!t&&Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsx)(fe.a,{search:()=>j()}),Object(he.jsx)(ge.a,{nameExcel:"FollowUp",noAdd:!0})]}),Object(he.jsx)(ye.a,{noAdvancedActions:!0,columns:_e,rows:a}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:c,limitOptions:[10,20,50,100],limit:l.take,activePage:l.page,onChangePage:e=>{window.scrollTo(0,0),r((t=>({...t,page:e})))},onChangeLimit:e=>{r((t=>({...t,take:e,page:1})))}})})]})}const _e=[{value:"account",name:"Client",render:e=>Object(he.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:e=>Object(he.jsx)("b",{style:{color:e>=0?"green":"#e33",fontSize:"18px"},children:e?e.toFixed(3)+" ":0})},{value:"previousBalance",name:"Mois Pr\xe9c\xe9dent",render:e=>Object(he.jsx)("b",{style:{color:e>=0?"green":"#e33",fontSize:"18px"},children:e?e.toFixed(3)+" ":0})},{value:"actualBalance",name:"Ce Mois",render:e=>Object(he.jsx)("b",{style:{color:e>=0?"green":"#e33",fontSize:"18px"},children:e?e.toFixed(3)+" ":0})}];var Ce=a(1208),Ie=a(1209),Ne=a(1205),Ee=a(1185),Se=a(1216),De=a(29);function ke(e){const t=Object(I.e)(U),[a,s]=Object(n.useState)({username:"",password:""}),[c,i]=Object(n.useState)("");return Object(he.jsxs)("div",{children:[" ",Object(he.jsx)("h1",{style:{color:"rgb(61,117,224)",textAlign:"center",marginBottom:"20px"},children:"Taysir Finance"}),Object(he.jsx)(A.a,{children:Object(he.jsx)(Ce.a,{justify:"center",children:Object(he.jsx)(Ce.a.Item,{colspan:12,children:Object(he.jsx)(Ie.a,{style:{background:"#fff"},header:Object(he.jsx)("h3",{children:"Connexion"}),bordered:!0,children:Object(he.jsxs)(Ne.a,{fluid:!0,children:[Object(he.jsxs)(Ne.a.Group,{children:[Object(he.jsx)(Ne.a.ControlLabel,{children:"Nom d'utilisateur ou email:"}),Object(he.jsx)(Ne.a.Control,{name:"username",onChange:e=>{s((t=>({...t,username:e})))}})]}),Object(he.jsxs)(Ne.a.Group,{children:[Object(he.jsx)(Ne.a.ControlLabel,{children:"Mot de passe :"}),Object(he.jsx)(Ne.a.Control,{name:"password",type:"password",onChange:e=>{s((t=>({...t,password:e})))},autoComplete:"off"})]}),c&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:c}),Object(he.jsx)("br",{}),Object(he.jsx)(Ne.a.Group,{children:Object(he.jsxs)(Se.a,{children:[Object(he.jsx)(je.a,{appearance:"primary",onClick:function(){a.username&&a.password&&(()=>{const e={Authorization:"Bearer "+(localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).token:"")};return{login:e=>De.c.post("Auth/Login",e),register_admin:e=>De.c.post("Auth/",e),update_profile:t=>De.c.post("Auth/update-profile",t,{headers:e}),reset_password:t=>De.c.post("Auth/resetPassword",t,{headers:e})}})().login(a).then((e=>{e.data.success?(localStorage.setItem("auth",JSON.stringify(e.data)),t(!0),i("")):i(e.data.message)})).catch((e=>i(e.Message)))},children:"Connexion"}),Object(he.jsx)(je.a,{appearance:"link",children:"Mot de pass oubli\xe9?"})]})})]})})})})})]})}var Pe=a(742),Ae=a(164),Me=a(12),Te=a.n(Me),we=a(11),Be=a(25);class Re{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";this.name=e,this.address=a,this.taxCode=t,this.phones=n,this.code=s,this.emails=c,this.city=i}getPhones(){return this.phones.split(",")}getEmails(){return this.emails.split(",")}setPhones(e){this.phones=e.join(",")}setEmails(e){console.log(e),console.log(e.join(",")),this.emails=e.join(",")}}class Ue extends Re{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.voCommission=0,this.umrahCommission=0,this.clientType=e,this.isCCA=t}}class Le extends Re{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),this.currencies="",this.serviceTypes=e}getCurrencies(e){return e?e.split(";"):[]}getCurrencies(e){this.currencies=e.length?e.reduce(((e,t)=>e+";"+t)):""}}var Fe=a(94),ze=a(85),Ke=a(50),We=a(61),Ye=a(24),Ge=a.n(Ye);var Ve=function(e){let{_setmodel:t,model:a,clients:s,fetchClients:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)(!1),[u,p]=Object(n.useState)(new Ke.a),[m,x]=Object(n.useState)(""),[O,g]=Object(n.useState)([]),[f,y]=Object(n.useState)(!1),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;M.a.createAPIEndpoint(M.a.ENDPOINTS.Check,{q:e,clientId:t||a.clientId},"/autocomplete").customGet().then((e=>l(e.data.map((e=>({value:e.id,label:e.name}))))))},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>o(e.data.map((e=>({value:e.id,label:e.name}))))))};return Object(n.useEffect)((()=>{v(),_(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>j(e.data.map((e=>({value:e.id,label:e.name}))))))}()}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Client:"}),Object(he.jsx)(Fe.a,{onSearch:e=>c(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:a.clientId,onSelect:e=>{v("",e),t((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:a.amount,onChange:e=>{t((t=>({...t,amount:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Type De Paiment : "}),Object(he.jsx)(Fe.a,{data:we.s,block:!0,noSearch:!0,value:a.type,onSelect:e=>{t((t=>{let a={...t};return 1!=e&&delete a.checkId,2!=e&&delete a.checkoutId,4!=e&&delete a.bankId,{...a,type:e}}))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date:"}),Object(he.jsx)(de.a,{type:"date",value:a.date,onChange:e=>{t((t=>({...t,date:e})))}})]}),Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(he.jsx)(de.a,{value:a.refReglement,onChange:e=>{t((t=>({...t,refReglement:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(he.jsx)("label",{children:"Notes:"}),Object(he.jsx)(de.a,{value:a.notes,onChange:e=>{t((t=>({...t,notes:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:1==a.type?"Ch\xe9que":4==a.type?"Banque":"Caisse"}),Object(he.jsxs)("div",{style:{display:"inline-block",width:1==a.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(he.jsx)(Fe.a,{renderMenuItem:e=>Object(he.jsxs)(he.Fragment,{children:[e.split(" ")[0],Object(he.jsx)("span",{style:{paddingLeft:"8px",color:"#aaa",fontSize:"12px"},children:e.split(" ")[1]})]}),block:!0,data:1==a.type?i:4==a.type?r:d,noSearch:!0,value:a[1==a.type?"checkId":4==a.type?"bankId":"checkoutId"],onSearch:e=>v(e),onSelect:e=>{t((t=>({...t,[1==a.type?"checkId":4==a.type?"bankId":"checkoutId"]:e})))}})]}),1==a.type&&Object(he.jsx)(ze.a,{size:"sm",onClick:()=>h(!0),icon:Object(he.jsx)(Ge.a,{})})]}),4==a.type&&Object(he.jsxs)(re.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(he.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(he.jsx)(de.a,{value:a.EmissionBank,onChange:e=>{t((t=>({...t,EmissionBank:e})))}})]}),b&&1==a.type&&Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)(We.a,{_delete:e=>{let t=O.findIndex((t=>t.fileKey==e));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(O[t].name).then((e=>{g((e=>{let a=[...e];return a.splice(t),a}));let a=[...u.attachments];a.splice(t),p((e=>({...u,attachments:a})))})).catch((e=>{}))},upload:(e,t,a)=>{y(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(t).then((t=>{y(!1);let n=e.findIndex((e=>e.fileKey==a));g((t=>{let a=[...e];return a[n].status="finished",a}));let s=[...u.attachments];s.push(t.data[0].fileName),p((e=>({...u,attachments:s})))})).catch((t=>{y(!1);let n=e.findIndex((e=>e.fileKey==a));g((t=>{let a=[...e];return a[n].status="error",a}))}))},error:m,model:u,banks:r,fetchBanks:_,_setmodel:p}),Object(he.jsx)(je.a,{onClick:()=>{let e=Object(Be.a)(u,[{number:"Num\xe9ro"},{amount:"Montant"},{date:"Date de D\xe9p\xf4t"}]);e?x(e):M.a.createAPIEndpoint(M.a.ENDPOINTS.Check).create({...u,amount:parseFloat(u.amount),attachments:u.attachments&&u.attachments.join(),clientId:a.clientId}).then((e=>{console.log(e),t((t=>({...t,checkId:e.data.id}))),v(u.number),p(new Ke.a),x(""),h(!1),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{x(e.response.data),console.log(e.response.data)}))},appearance:"primary",children:"Enregistrer"})]})]})};var He=a(156),qe=a.n(He);class Ze{constructor(){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 Je}}class Je{constructor(){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}}class $e{constructor(){this.date=new Date,this.customer=new Je,this.totalPrice=0,this.totalRefund=0,this.commission=0,this.fare=0,this.commissionPercent=0,this.note="",this.service=8}}class Xe{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;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=t,this.type=e}}var Qe=a(20);function et(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)({q:"",page:1,take:20}),[d,j]=Object(n.useState)(""),[b,h]=Object(n.useState)(new Xe(1,2)),[u,p]=Object(I.c)(Oe.a),m=()=>{h(new Xe(1,2)),j("")},x=()=>{p((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment,r,"/getClientsGuarantees").customGet().then((e=>{a(e.data.data),p((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{x()}),[r.page,r.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>x(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{o((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{nameExcel:"payments",size:"md",save:()=>{let e=Object(Be.a)(b,[{clientId:"Client"},{amount:"Montant"}]);e?j(e):(p((e=>({...e,loading:!0}))),b.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).update(b.id,{...b,amount:Number(b.amount)}).then((e=>{x(),p((e=>({...e,open:!1,loading:!1}))),m(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).create({...b,amount:Number(b.amount)}).then((e=>{x(),m(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),p((e=>({...e,open:!1,loading:!1})))})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})))},ActionOnClose:m,AddComponent:Object(he.jsx)(Ve,{clients:i,fetchClients:function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))},error:d,model:b,_setmodel:h})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).fetchById(e).then((e=>{h(e.data),e.data.client&&l([e.data.client])}))})(e),p((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).delete(e).then((e=>{x(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>j(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:tt,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:r.take,activePage:r.page,onChangePage:e=>{window.scrollTo(0,0),o((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),o((t=>({...t,take:e,page:1})))}})})]})}const tt=[{value:"id",name:"Identifiant",render:e=>Object(he.jsx)("h5",{children:e})},{value:"account",name:"Client",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():"-"})},{value:"amount",name:"Montant",render:e=>Object(he.jsx)("b",{children:Object(Qe.a)(e)})},{value:"date",name:"Date de D\xe9p\xf4t",render:e=>Object(he.jsx)("h6",{style:{fontSize:"12px"},children:me()(e).format("DD MMM YYYY")})},{value:"type",name:"Type",render:e=>Object(he.jsx)(Ae.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:we.s.find((t=>t.value==e)).label})},{value:"check",name:"N\xb0 Ch\xe9que",render:e=>Object(he.jsx)("b",{children:e||"-"})},{value:"checkout",name:"Caisse",render:e=>Object(he.jsx)("b",{children:e||"-"})},{name:"Virement",value:"depositBank",value2:"emissionBank",render:(e,t)=>Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("b",{children:t?Object(he.jsxs)(he.Fragment,{children:[" ",t," ",Object(he.jsx)(qe.a,{})]}):"-"})," ",Object(he.jsx)("b",{children:e||"-"})]})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}];var at=a(138),nt=a(1207),st=a(359),ct=a(752),it=a.n(ct),lt=a(39),rt=a(56);function ot(e){let{id:t}=e;const[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(0),[l,r]=Object(n.useState)(0),[o,d]=Object(n.useState)(0),[j,b]=Object(n.useState)([]),h=Object(n.useRef)(),[u,p]=Object(I.c)(Oe.a),[m,x]=Object(n.useState)({page:1,take:100,date:null,dateTo:null,dateFrom:null}),O=()=>{p((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Ledger,{...m,clientId:t},"/getLedgerClientDetails").customGet().then((e=>{console.log(e.data);var t=[];t=t.concat(e.data),s(t);let a=e.data.map((e=>e.debit)).reduce(((e,t)=>e+t));r(a);let n=e.data.map((e=>e.credit)).reduce(((e,t)=>e+t));d(n),i(e.data.length)})).catch((e=>{}))};return Object(n.useEffect)((()=>{O()}),[t]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>O(),children:[Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(he.jsx)("label",{children:"Dates: "}),Object(he.jsx)(Fe.a,{data:we.q,block:!0,noSearch:!0,value:m.dateType,onSelect:e=>{let t=new Date(me()(Date.now()).format("yyyy-MM-DD"));console.log(t),x((a=>({...a,dateType:e,date:7==e||1==e?t:2==e?me()(me()(Date.now()).add(-1,"d")).format("yyyy-MM-DD"):null,dateFrom:6==e?t:3==e?me()().startOf("month").format("yyyy-MM-DD"):4==e?me()(Date.now()).subtract(1,"months").startOf("month").format("yyyy-MM-DD"):5==e?me()().startOf("year").format("yyyy-MM-DD"):null,dateTo:6==e?new Date(me()(me()(Date.now()).add(1,"d")).format("yyyy-MM-DD")):3==e?t:4==e?me()(Date.now()).subtract(1,"months").endOf("month").format("yyyy-MM-DD"):null})))}})]}),7==m.dateType&&Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(he.jsx)("label",{children:"Date: "}),Object(he.jsx)(de.a,{type:"date",value:m.date,onChange:e=>{x((t=>({...t,date:e})))}})]}),6==m.dateType&&Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(he.jsx)("label",{children:"Plage du temps: "}),Object(he.jsx)(nt.a,{block:!0,value:[m.dateFrom,m.dateTo],onChange:e=>{x((t=>({...t,dateFrom:e[0],dateTo:e[1]})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-5",children:[Object(he.jsx)("label",{children:"Service : "}),Object(he.jsx)(Fe.a,{data:we.u,block:!0,noSearch:!0,value:m.service,onSelect:e=>{x((t=>({...t,service:e})))}})]})]}),Object(he.jsx)("hr",{}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsxs)(je.a,{onClick:()=>{const e=new st.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"}]}),it()(e,{startY:50,head:[["Date","D\xe9bit","Crebit","Description","Solde Progressif"]],body:a.map((e=>Object.values(e)))}),e.save("table.pdf")},style:{color:"#fff",background:"rgb(90,44,62)",padding:"8px 30px",margin:"5px"},id:"print",children:[Object(he.jsx)(v.a,{})," Imprimer"]})}),Object(he.jsx)(re.a,{className:"p-10",s:6,m:6,l:6,xl:6,children:Object(he.jsx)(lt.a,{text:"Total D\xe9bit",color:"0,169,141",amount:l})}),Object(he.jsx)(re.a,{className:"p-10",s:6,m:6,l:6,xl:6,children:Object(he.jsx)(lt.a,{text:"Total Cr\xe9dit",amount:o,color:"229,57,53"})}),Object(he.jsx)("div",{ref:h,style:{maxWidth:"1000px"},id:"printedt____",children:Object(he.jsx)(ye.a,{noAdvancedActions:!0,columns:dt,rows:a})})]})}const dt=[{value:"date",value2:"event",name:"Date",render:(e,t)=>Object(he.jsx)("div",{style:{maxWidth:"150px",padding:"2px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",color:"#4667d1",fontSize:"12px",textTransform:"upperCase",fontWeight:"500"},children:me()(e).format("yyyy-MM-DD")})},{value:"description",name:"Description",render:e=>Object(he.jsx)("b",{style:{letterSpacing:"1px",color:"#111",fontSize:"12px"},children:e})},{value:"debit",name:"D\xe9bit",render:e=>Object(he.jsx)("b",{style:{fontSize:"16px"},children:e?Object(Qe.a)(e):0})},{value:"credit",name:"Cr\xe9dit ",render:e=>Object(he.jsx)("b",{style:{fontSize:"16px"},children:e?Object(Qe.a)(e):0})},{value:"progressiveBalance",name:"Solde Progressif ",render:e=>Object(he.jsx)("b",{style:{fontSize:"16px"},children:e?Object(Qe.a)(e):0})}];var jt=a(154),bt=a.n(jt);function ht(){const[e,t]=Object(n.useState)([]),[a,s]=Object(n.useState)(0),[c,i]=Object(n.useState)([]),[l,r]=Object(I.c)(Oe.a),[o,d]=Object(n.useState)(null),j=function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>i(e.data)))},[b,h]=Object(n.useState)({page:1,take:20,clientId:0,date:null}),u=[{value:"account",name:"Client",render:e=>Object(he.jsx)("b",{style:{color:"#4667d1",fontSize:"16px",textTransform:"upperCase",cursor:"pointer",fontWeight:"500"},children:e.name})},{name:"d\xe9tails",value:"account",render:e=>Object(he.jsxs)("button",{onClick:()=>d(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(he.jsx)(bt.a,{})," "," "]})},{value:"totalDebit",name:"D\xe9bit Total",render:e=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})},{value:"totalCredit",name:"Cr\xe9dit Total",render:e=>Object(he.jsxs)("b",{style:{color:"#5a2c3e",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})},{value:"totalGarantee",name:"Garantie",render:e=>Object(he.jsxs)("b",{style:{color:"#2c92bf",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})},{value:"totalDebit",value2:"totalCredit",name:"Solde",render:(e,t)=>Object(he.jsxs)("b",{style:{color:t-e<0?"#e33":"#53af50",fontSize:"18px"},children:[(t-e==0?0:Object(Qe.a)(t-e))+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})}],p=()=>{r((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Ledger,{...b,date:b.date?me()(b.date).format("DD MMM YYYY"):null},"/getLedgerClient").customGet().then((e=>{t(e.data.data),r((e=>({...e,loading:!1}))),s(e.data.totalCount)})).catch((e=>{}))};return Object(n.useEffect)((()=>{j()}),[]),Object(n.useEffect)((()=>{p()}),[b.page,b.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>p(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>j(e),data:[{label:"Tout",value:0}].concat(c.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:b.clientId,onSelect:e=>{h((t=>({...t,clientId:e})))}})]})}),Object(he.jsx)(ge.a,{nameExcel:"GL",noAdd:!0}),Object(he.jsx)(ye.a,{noAdvancedActions:!0,columns:u,rows:e}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.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],limit:b.take,activePage:b.page,onChangePage:e=>{window.scrollTo(0,0),h((t=>({...t,page:e})))},onChangeLimit:e=>{h((t=>({...t,take:e,page:1})))}})}),Object(he.jsxs)(at.a,{size:"lg",overflow:!0,open:o,onClose:()=>d(null),children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"D\xe9tails Transactions"})}),Object(he.jsx)(at.a.Body,{children:o&&Object(he.jsx)(ot,{id:o})}),Object(he.jsx)(at.a.Footer,{children:Object(he.jsx)(je.a,{onClick:()=>d(null),appearance:"subtle",children:"fermer"})})]})]})}var ut=a(190);var pt=function(e){let{loading:t=!1,amount:a=0,currency:n="TND",title:s="Test",increase:c=100,data:i=[{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}],color:l="rgb(93,120,255)"}=e;return Object(he.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:t?Object(he.jsx)("div",{}):Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("h6",{style:{textTransform:"uppercase"},children:s}),Object(he.jsxs)("div",{style:{height:"70px",overflow:"hidden",position:"relative",left:"-30px"},children:[" ",Object(he.jsx)(ut.d,{height:100,width:130,color:l,children:Object(he.jsx)(ut.c,{data:i})})]}),Object(he.jsxs)("div",{children:[Object(he.jsx)("span",{style:{fontSize:"15px",fontWeight:"lighter"},children:n})," ",Object(he.jsx)("b",{style:{fontSize:"25px",fontWeight:"bolder"},children:a})]}),Object(he.jsxs)("div",{children:[Object(he.jsxs)("b",{style:{color:c>0?"rgb(84,177,7)":"rgb(221,59,75)"},children:[c," %"]})," ",Object(he.jsx)("i",{children:c>0?"plus \xe9lev\xe9 que le mois pr\xe9c\xe9dent":"inf\xe9rieur par rapport au mois pr\xe9c\xe9dent"})]})]})})};function mt(e){let{amount1:t="850.000",amount2:a="200.000",ration:n=(200/580).tofixed(2),title:s="Rapport Vente-Recouvrement",color:c="rgb(84,177,7)"}=e;return Object(he.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(he.jsx)("h4",{style:{textTransform:"uppercase"},children:s}),Object(he.jsx)("div",{style:{backgroundColor:"#eee",height:"10px",borderRadius:"5px",margin:"50px 0 10px 0"},children:Object(he.jsx)("div",{style:{backgroundColor:c,height:"10px",borderRadius:"5px",width:100*n+"%"}})}),Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Object(he.jsxs)("span",{children:[" ",a]}),Object(he.jsx)("b",{style:{color:c},children:100*n+"%"}),Object(he.jsxs)("span",{children:[" ",t]})]})]})}function xt(e){let{data: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}]}=e;return Object(he.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(he.jsx)(ut.a,{orientation:"horizontal",height:100,colorRange:Ot,items:we.u.map((e=>e.label))}),Object(he.jsx)(ut.b,{innerRadius:20,padAngle:.03,colorRange:Ot,data:t,width:300,height:300})]})}const Ot=["#6588cd","#66b046","#a361c7","#ad953f","#c75a87","#55a47b","#cb6141"];var gt=function(){return Object(he.jsxs)("div",{children:[Object(he.jsx)(re.a,{m:6,l:3,xl:3,className:"p-10",children:Object(he.jsx)(pt,{amount:Object(Qe.a)(999.5),title:"Vente Totale",increase:.18})}),Object(he.jsx)(re.a,{m:6,l:3,xl:3,className:"p-10",children:Object(he.jsx)(pt,{amount:Object(Qe.a)(81111.5),title:"Achat Total",increase:-.18,color:"rgb(84,177,7)"})}),Object(he.jsx)(re.a,{m:6,l:3,xl:3,className:"p-10",children:Object(he.jsx)(pt,{amount:Object(Qe.a)(999.5),title:"D\xe9pense Totale",color:"rgb(236,182,28)"})}),Object(he.jsx)(re.a,{m:6,l:3,xl:3,className:"p-10",children:Object(he.jsx)(pt,{amount:"850.000",color:"rgb(84,177,7)"})}),Object(he.jsx)(re.a,{l:6,xl:6,className:"p-10",children:Object(he.jsx)(mt,{amount1:Object(Qe.a)(850),amount2:Object(Qe.a)(200),ration:Object(Qe.a)(Number(200/580)),title:"Rapport Vente-Recouvrement",color:"rgb(84,177,7)"})}),Object(he.jsx)(re.a,{l:6,xl:6,className:"p-10",children:Object(he.jsx)(mt,{amount1:Object(Qe.a)(9990),amount2:Object(Qe.a)(6e3),ration:Object(Qe.a)(Number(6e3/9990)),title:"Rapport Achat-Paiement",color:"red"})}),Object(he.jsx)(re.a,{l:5,xl:5,className:"p-10",children:Object(he.jsx)(xt,{})}),Object(he.jsx)(re.a,{l:7,xl:7,className:"p-10",children:Object(he.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(he.jsx)("h6",{children:"SUIVIE CLIENTS"}),Object(he.jsx)("br",{}),Object(he.jsx)(ve,{noHead:!0})]})})]})},ft=a(1210),yt=a(186),vt=a(1183);const _t=Object(I.b)({key:"saleSate",default:new $e});Object(I.b)({key:"services",default:[]});var Ct=a(115),It=a(32),Nt=a.n(It),Et=a(65),St=a.n(Et);class Dt{constructor(){this.ProviderId=0,this.tags=[],this.attachments=[],this.currencyId="",this.package=new kt,this.note="",this.payments=[]}}class kt{constructor(){this.packageItems=[]}}class Pt{constructor(){this.service=0,this.unitCost=0,this.totalCost=0,this.commission=0,this.unitFee=0,this.qty=1,this.note=""}}class At{constructor(){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}}const Mt=Object(I.b)({key:"purchaseSate",default:new Dt});class Tt{constructor(){this.attachments=[],this.currencyId="",this.note="",this.payments=[]}}class wt{constructor(){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}}const Bt=Object(I.b)({key:"expenseSate",default:new Tt}),Rt={verticalAlign:"top"};var Ut=function(e){let{error:t}=e;const[a,s]=Object(n.useState)(0);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:a,style:Rt,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>s(0)}),Object(he.jsx)(ft.a.Item,{onClick:()=>s(1),title:"Paiement"}),Object(he.jsx)(ft.a.Item,{title:"Attachments",onClick:()=>s(2)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:a?1==a?Object(he.jsx)(zt,{}):Object(he.jsx)(Kt,{}):Object(he.jsx)(Lt,{})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const Lt=()=>{const[e,t]=Object(I.c)(Bt),a=Object(I.d)(F);return Object(n.useEffect)((()=>{a&&a.length&&!e.currencyId&&t((t=>({...e,currencyId:a[0].id})))}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Date de D\xe9pense: "}),Object(he.jsx)(de.a,{type:"date",value:e.date,onChange:e=>{console.log(e),t((t=>({...t,date:e})))}}),Object(he.jsx)("label",{children:"D\xe9signation: "}),Object(he.jsx)(de.a,{value:e.note,onChange:e=>{console.log(e),t((t=>({...t,note:e})))}}),Object(he.jsx)("label",{children:"Devise: "}),Object(he.jsx)(Fe.a,{data:a.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:e.currencyId,onSelect:e=>{t((t=>({...t,currencyId:e})))}})]})},Ft=[{value:"amount",name:"Montant",render:e=>Object(he.jsx)("b",{children:e})},{value:"type",name:"Type",render:e=>Object(he.jsx)(Ae.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:we.s.find((t=>t.value==e))&&we.s.find((t=>t.value==e)).label})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}],zt=()=>{const[e,t]=Object(n.useState)([]),[a,s]=Object(I.c)(Bt),[c,i]=Object(n.useState)([]),[l,r]=Object(n.useState)([]),[o,j]=Object(n.useState)(!1),[b,h]=Object(n.useState)(new Ke.a),[u,p]=Object(n.useState)(""),[m,x]=Object(n.useState)([]),[O,g]=Object(n.useState)(!1),[f,y]=Object(n.useState)(new wt),v=()=>{y(new At)},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>i(e.data.map((e=>({value:e.id,label:e.name}))))))};return Object(n.useEffect)((()=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Check,{q:e},"/autocomplete").customGet().then((e=>t(e.data.map((e=>({value:e.id,label:e.name}))))))}(),_(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>r(e.data.map((e=>({value:e.id,label:e.name}))))))}()}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.02)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:f.amount,onChange:e=>{y((t=>({...t,amount:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Type De Paiment : "}),Object(he.jsx)(Fe.a,{data:we.s,block:!0,noSearch:!0,value:f.type,onSelect:e=>{y((t=>({...t,type:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Date:"}),Object(he.jsx)(de.a,{type:"date",value:a.date,onChange:e=>{y((t=>({...t,date:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(he.jsx)(de.a,{value:f.refReglement,onChange:e=>{y((t=>({...t,refReglement:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(he.jsx)("label",{children:"Notes:"}),Object(he.jsx)(de.a,{value:f.notes,onChange:e=>{y((t=>({...t,notes:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:1==f.type?"Ch\xe9que":4==f.type?"Banque":"Caisse"}),Object(he.jsxs)("div",{style:{display:"inline-block",width:1==f.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(he.jsx)(Fe.a,{block:!0,data:1==f.type?e:4==f.type?c:l,noSearch:!0,value:f[1==f.type?"checkId":4==f.type?"bankId":"checkoutId"],onSelect:e=>{y((t=>({...t,[1==f.type?"checkId":4==f.type?"bankId":"checkoutId"]:e})))}})]}),1==f.type&&Object(he.jsx)(ze.a,{size:"sm",onClick:()=>j(!0),icon:Object(he.jsx)(Ge.a,{})})]}),4==f.type&&Object(he.jsxs)(re.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(he.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(he.jsx)(de.a,{value:f.EmissionBank,onChange:e=>{y((t=>({...t,EmissionBank:e})))}})]}),o&&1==f.type&&Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)(We.a,{_delete:e=>{let t=m.findIndex((t=>t.fileKey==e));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(m[t].name).then((e=>{x((e=>{let a=[...e];return a.splice(t),a}));let a=[...b.attachments];a.splice(t),h((e=>({...b,attachments:a})))})).catch((e=>{}))},upload:(e,t,a)=>{g(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(t).then((t=>{g(!1);let n=e.findIndex((e=>e.fileKey==a));x((t=>{let a=[...e];return a[n].status="finished",a}));let s=[...b.attachments];s.push(t.data[0].fileName),h((e=>({...b,attachments:s})))})).catch((t=>{g(!1);let n=e.findIndex((e=>e.fileKey==a));x((t=>{let a=[...e];return a[n].status="error",a}))}))},error:u,model:b,banks:c,fetchBanks:_,_setmodel:h}),Object(he.jsx)(je.a,{onClick:()=>{let e=Object(Be.a)(b,[{number:"Num\xe9ro"},{status:"Status"},{amount:"Montant"},{depositDate:"Date de D\xe9p\xf4t"}]);e?p(e):(t((e=>[{value:-1,label:b.number+"("+(c.find((e=>e.value==b.depositBankId))?c.find((e=>e.value==b.depositBankId)).label:"")+")"},...e])),y((e=>({...e,check:{...b,amount:parseFloat(b.amount),attachments:b.attachments&&b.attachments.join(),clientId:a.clientId},checkId:-1}))),h(new Ke.a),p(""),j(!1))},appearance:"primary",children:"Enregistrer"})]}),Object(he.jsx)(yt.a,{}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsx)(Se.a,{children:Object(he.jsx)(ze.a,{onClick:()=>{s((e=>{console.log(e);let t={...e};if("object"!=typeof t.payments&&(t.payments=[]),"number"==typeof f.index){let e=[...t.payments];e[f.index]=f,t.payments=[...e]}else{let e=[...t.payments];e.push(f),t.payments=[...e]}return t})),v()},appearance:"primary",color:"blue",icon:Object(he.jsx)(d.a,{}),children:"Ajouter"})})})]}),Object(he.jsx)(yt.a,{}),Object(he.jsx)(ye.a,{editAction:e=>{y({...a.payments[e],index:e})},deleteAction:e=>{s((t=>{let a={...t},n=[...a.payments];return n.splice(e,1),a.payments=[...n],a})),v()},actionKey:"index",noAdvancedActions:!0,columns:Ft,rows:a.payments?a.payments.map(((e,t)=>({...e,index:t}))):[]})]})},Kt=()=>{const[e,t]=Object(I.c)(_t),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(!1);return Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsx)(vt.a,{loading:c,autoUpload:!1,fileList:a,action:"#",draggable:!0,onRemove:n=>(n=>{let c=a.findIndex((e=>e.fileKey==n));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(e.attachments[c].name).then((a=>{s((e=>{let t=[...e];return t.splice(c),t}));let n=[...e.attachments];n.splice(c),t((t=>({...e,attachments:n})))})).catch((e=>{}))})(n.fileKey),onChange:a=>{console.log(a);let n=a.filter((e=>"finished"!=e.status)).reverse()[0];n&&((a,n,c)=>{i(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(n).then((n=>{i(!1);let l=a.findIndex((e=>e.fileKey==c));s((e=>{let t=[...a];return t[l].status="finished",t}));let r=[...e.attachments];r.push({name:n.data[0].fileName}),t((t=>({...e,attachments:r})))})).catch((e=>{i(!1);let t=a.findIndex((e=>e.fileKey==c));s((e=>{let n=[...a];return n[t].status="error",n}))}))})(a,n.blobFile,n.fileKey)},children:Object(he.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(he.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(he.jsx)(St.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),c&&Object(he.jsx)(he.Fragment,{})]})};function Wt(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)(0),[d,j]=Object(n.useState)({page:1,take:20,status:0,date:null}),[b,h]=Object(n.useState)(""),[u,p]=Object(I.c)(Bt),[m,x]=Object(I.c)(Oe.a),O=()=>{p(new Tt),h("")},g=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>c(e.data)))},f=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))},y=()=>{x((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Expense,{...d,date:d.date?me()(d.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),x((e=>({...e,loading:!1}))),o(e.data.totalCount)})).catch((e=>{h(e.Message),x((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{g(),f()}),[]),Object(n.useEffect)((()=>{y()}),[d.page,d.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>y(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Status du Paiement: "}),Object(he.jsx)(Fe.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(we.j),block:!0,noSearch:!0,value:d.status,onSelect:e=>{j((t=>({...t,status:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date du d\xe9pense: "}),Object(he.jsx)(de.a,{type:"date",value:d.date,onChange:e=>{j((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{nameExcel:"Expense",size:"lg",save:()=>{console.log(u),x((e=>({...e,loading:!0})));let e={...u,payments:[...u.payments.map((e=>({...e,amount:parseFloat(e.amount),date:e.date?e.date:new Date,providerId:u.providerId})))],attachments:u.attachments?u.attachments.map((e=>e.name)).join():""};u.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Expense).update(e.id,e).then((e=>{y(),x((e=>({...e,open:!1,loading:!1}))),O(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{h(e.Message),x((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Expense).create(e).then((e=>{y(),O(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),x((e=>({...e,open:!1,loading:!1})))})).catch((e=>{h(e.Message),x((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Ut,{checkouts:i,fetchCheckouts:f,error:b,banks:s,fetchBanks:g})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{h(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Expense).fetchById(e).then((e=>{p({...e.data,depositDate:new Date(e.data.depositDate)})})).catch((e=>{console.log(e)}))})(e),x((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Expense).delete(e).then((e=>{y(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>h(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Yt,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:r,limitOptions:[10,20,50,100],limit:d.take,activePage:d.page,onChangePage:e=>j((t=>({...t,page:e}))),onChangeLimit:e=>{console.log(e),j((t=>({...t,take:e,page:1})))}})})]})}const Yt=[{value:"note",name:"D\xe9signation",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})},{value:"totatlAmount",value2:"currency",name:"Montant Total",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})},{value:"date",name:"Date",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})}];var Gt=a(764);class Vt{constructor(){this.prices=[],this.clients=[],this.note=""}}class Ht{constructor(){this.clients=[],this.note=""}}const qt=new I.b({key:"ForcastAtom",default:new Vt,reset:!0}),Zt=new I.b({key:"ForcastVoAtom",default:new Ht,reset:!0});var Jt=function(e){let{error:t,clients:a,fetchClients:s,vols:c=[],packs:i=[]}=e;const[l,r]=Object(n.useState)(0),[o,d]=Object(I.c)(qt),[j,b]=Object(n.useState)([]),[h,u]=Object(n.useState)({nbr:1}),[p,m]=Object(n.useState)(null),x=e=>{e=e.map(((e,t)=>({...e,h:e.hotelMakkahName+" - "+e.hotelMadinahName,index:t})));let t=new Set(e.map((e=>e.h)));console.log(t);let a={};t.forEach((t=>{a[t]=e.filter((e=>e.h==t))})),m(a)};return Object(n.useEffect)((()=>{let e=i.find((e=>e.id==o.packageUmrahId));e&&(x(e.prices.filter((e=>!e.isHidden))),b(e))}),[o.packageUmrahId]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{style:{padding:"40px 10px"},children:[Object(he.jsx)("label",{children:"Vols : "}),Object(he.jsx)(Fe.a,{data:c.map(((e,t)=>({label:Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",background:t%2?"rgb(70,103,209,0.2)":"",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ( ",Object(he.jsx)("i",{style:{color:"#999"},children:i&&i.find((t=>t.id==e.packageUmrahId))&&i.find((t=>t.id==e.packageUmrahId)).name})," )"]})]}),Object(he.jsx)("b",{className:"p-5",children:Object(he.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:o.disponibilityId,onSelect:e=>{let t=i.find((t=>t.disponibilities.find((t=>t.id==e))));x(i.find((t=>t.disponibilities.find((t=>t.id==e)))).prices.filter((e=>!e.isHidden))),d((a=>({...a,disponibilityId:e,packageUmrahId:t.id})))}}),j&&Object(he.jsxs)("table",{children:[Object(he.jsx)("thead",{children:Object(he.jsxs)("tr",{children:[Object(he.jsx)("th",{children:"-"}),Object(he.jsx)("th",{children:"Designation"}),Object(he.jsx)("th",{children:"Commission"}),Object(he.jsx)("th",{children:"QUAD"}),Object(he.jsx)("th",{children:"TRIPLE"}),Object(he.jsx)("th",{children:"DOUBLE"})]})}),Object(he.jsx)("tbody",{children:j.hotels&&j.hotels.length&&p&&Object.keys(p).map(((e,t)=>Object(he.jsxs)("tr",{style:{background:t%2?"rgb(244,81,108,0)":"rgb(70,103,209,0.2)",borderBottom:"3px solid #eee"},children:[Object(he.jsx)("td",{children:Object(he.jsx)(Gt.a,{onChange:t=>{let a=[...o.prices];a=o.prices&&o.prices.find((t=>t.priceUmrahId==p[e][0].id))?a.filter((t=>!p[e].find((e=>e.id==t.priceUmrahId)))):a.concat(p[e].map((e=>({priceUmrahId:e.id})))),console.log(a),d((e=>({...e,prices:a})))},checked:null!=o.prices.find((t=>p[e][0].id==t.priceUmrahId))})}),Object(he.jsx)("td",{children:Object(he.jsx)("h6",{children:e})}),Object(he.jsx)("td",{children:Object(Qe.a)(j.b2Bcommission)}),Object(he.jsx)("td",{children:p[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("QUAD")))?Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("b",{children:[" ",Object(Qe.a)(p[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("QUAD"))).price)]})," "]}):0}),Object(he.jsx)("td",{children:p[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE")))?Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("b",{children:[Object(Qe.a)(p[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE"))).price)," "]})}):0}),Object(he.jsx)("td",{children:p[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE")))?Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("b",{children:[" ",Object(Qe.a)(p[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE"))).price)," "]})}):0})]})))})]}),Object(he.jsx)("hr",{}),Object(he.jsxs)(re.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(he.jsx)("label",{children:"Date D'option: "}),Object(he.jsx)("input",{style:{display:"block",width:"100%"},type:"date",value:"string"==typeof o.optionDate?o.optionDate.substring(0,10):o.optionDate,onChange:e=>{let{value:t}=e.target;d((e=>({...e,optionDate:t})))}})]}),Object(he.jsxs)(re.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(he.jsx)("label",{children:"Nombre De Pr\xe9vision: "}),Object(he.jsx)(de.a,{type:"number",value:o.virtualStock,onChange:e=>d((t=>({...t,virtualStock:parseInt(e)})))})]}),Object(he.jsx)("hr",{}),Object(he.jsxs)(re.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>s(e),data:[{label:"Tout",value:0}].concat(a.filter((e=>!o.clients.some((t=>t.clientId==e.id)))).map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:o.clientId,onSelect:e=>{u({clientId:e,client:a.find((t=>t.id==e)),nbr:1})}})]}),Object(he.jsxs)(re.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(he.jsx)("label",{children:"Nombre: "}),Object(he.jsx)(de.a,{type:"number",value:h.nbr,onChange:e=>u((t=>({...t,nbr:parseInt(e)})))})]}),Object(he.jsxs)(re.a,{className:"p-10",s:2,m:2,xl:1.5,l:1.2,children:[Object(he.jsx)("label",{children:"."}),Object(he.jsx)(je.a,{color:"violet",appearance:"primary",block:!0,onClick:()=>{h.clientId&&d((e=>({...e,clients:[...e.clients,h]}))),u({nbr:1,clientId:0})},children:"Ajout +"})]}),Object(he.jsxs)("table",{children:[Object(he.jsx)("thead",{children:Object(he.jsxs)("tr",{children:[Object(he.jsx)("th",{children:"Client"})," ",Object(he.jsx)("th",{children:"Nombre"}),Object(he.jsx)("th",{})]})}),Object(he.jsxs)("tbody",{children:[o.clients&&o.clients.map(((e,t)=>Object(he.jsxs)("tr",{children:[Object(he.jsx)("td",{children:e.client&&e.client.name})," ",Object(he.jsx)("td",{children:Object(he.jsx)(de.a,{value:e.nbr,onChange:a=>d((n=>{let s=[...n.clients];return s[t]={...e,nbr:parseInt(a)},{...n,clients:s}}))})}),Object(he.jsx)("td",{children:Object(he.jsxs)("button",{onClick:()=>d((t=>({...t,clients:t.clients.filter((t=>t.clientId!=e.clientId))}))),children:[" ",Object(he.jsx)(y.d,{})]})})]}))),Object(he.jsxs)("tr",{children:[Object(he.jsx)("td",{children:Object(he.jsx)("b",{children:"Total"})})," ",Object(he.jsx)("td",{children:o.clients.reduce(((e,t)=>e+t.nbr),0)})]})]})]})]}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{}),Object(he.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 "})]})};const $t=["ecb61c","b743ae","99c262","2590b5","ffd06d","a90e43","87a910","ff8200","008f96","7986cb","2590b5","ffd06d"],Xt=e=>{console.log(e);let t=e.map((e=>e.items.map((e=>e.client)))).reduce(((e,t)=>e.concat(t)),[]);t=t.filter(((e,a)=>{const n=JSON.stringify(e);return a===t.findIndex((e=>JSON.stringify(e)===n))})),console.log(t);let a=[{title:"-",width:{wpx:70}},{title:"Vol",width:{wpx:120}},{title:"Pr\xe9vision",width:{wpx:120}},{title:"Airline",width:{wpx:50}}];if(t.map(((e,t)=>a=a.concat([{title:e?e.name.toUpperCase().replace("KOUNOUZ","").trim():"",width:{wpx:100},style:{fill:{fgColor:{rgb:t%2?"ffffff":$t[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}},{title:"-",style:{fill:{fgColor:{rgb:t%2?"ffffff":$t[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}]))),e&&e.length)return[{columns:a,data:e.map(((e,a)=>{let n=[{value:e.disponibility?e.disponibility.onStock-e.items.reduce(((e,t)=>e+t.nbr),0):"-",style:{fill:{fgColor:{rgb:e.disponibility.onStock-e.items.reduce(((e,t)=>e+t.nbr),0)>0?"66ff66":e.disponibility.onStock-e.items.reduce(((e,t)=>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?me()(e.disponibility.date).format("DD MMM yyyy"):"-",style:{fill:{fgColor:{rgb:a%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:a%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:a%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}}];return t.map(((t,a)=>{n=n.concat([{value:e.items.find((e=>t&&e.clientId==t.id))?e.items.find((e=>t&&e.clientId==t.id)).nbr:0,width:{wpx:100},style:{fill:{fgColor:{rgb:a%2?"ffffff":$t[a%9]}},font:{sz:"12"},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.items.find((e=>e.clientId==t.id))?e.items.find((e=>e.clientId==t.id)).designation:"-",style:{fill:{fgColor:{rgb:a%2?"ffffff":$t[a%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}])})),n}))}]};function Qt(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)(0),[b,h]=Object(n.useState)({page:1,take:20,providerId:0,status:0,date:null}),[u,p]=Object(n.useState)(""),[m,x]=Object(I.c)(qt),[O,g]=Object(n.useState)([]),[f,y]=Object(n.useState)([]),[v,_]=Object(I.c)(Oe.a),C=()=>{x(new Vt),p("")},N=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},E=()=>{_((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Forcast,{...b,date:b.date?me()(b.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),(e=>{e.map((e=>e.disponibility));let t=e.map((e=>{let t=[];return e.clients.forEach((a=>{let n=e.prices.map((t=>({disponibilityId:e.disponibilityId,disponibility:e.disponibility,client:a.client,clientId:a.clientId,nbr:a.nbr,designation:t.priceUmrah.hotelMadinahName+" - "+t.priceUmrah.hotelMakkahName})));n=n.filter(((e,t)=>{const a=JSON.stringify(e);return t===n.findIndex((e=>JSON.stringify(e)===a))}));let s={...n[0]};n.forEach((e=>{s.designation=s.designation+" / "+e.designation})),t.push(s)})),t}));t=t.reduce(((e,t)=>e.concat(t)),[]);let a=new Set(t.map((e=>e.disponibilityId))),n=[];a.forEach((e=>{n.push({disponibilityId:e,disponibility:t.filter((t=>t.disponibilityId==e))[0].disponibility,items:t.filter((t=>t.disponibilityId==e))})})),console.log(n),o(n)})(e.data.data.filter((e=>e.prices.length))),_((e=>({...e,loading:!1}))),j(e.data.totalCount)})).catch((e=>{p(e.Message),_((e=>({...e,loading:!1})))}))};Object(n.useEffect)((()=>{var e;N(),("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{g(e.data);let t=e.data.reduce(((e,t)=>e.concat(t.disponibilities.map((e=>({packageUmrahId:t.id,...e}))))),[]);y(t.filter((e=>e.onStock)))}))}),[]),Object(n.useEffect)((()=>{E()}),[b.page,b.take]);const S=[{value:"disponibility",name:"Vol",render:e=>Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:O&&O.find((t=>t.id==e.packageUmrahId))&&O.find((t=>t.id==e.packageUmrahId)).name})," ",")"]})]}),Object(he.jsx)("b",{className:"p-5",children:Object(he.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:e=>Object(he.jsx)("b",{style:{color:"#53af50",fontSize:"18px"},children:e})},{value:"optionDate",name:"Date D'option",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})},{value:"note",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}];return Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>E(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{data:O?[{label:"Tout",value:0}].concat(O.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,value:b.packageUmrahId,onSelect:e=>{h((t=>({...t,packageUmrahId:e})))}})]})}),Object(he.jsx)(ge.a,{excelData:r&&r.length?Xt(r):Xt([]),nameExcel:O&&O.find((e=>b.packageUmrahId==e.id))?O.find((e=>b.packageUmrahId==e.id)).name:"forcast",size:"lg",save:()=>{console.log(m),_((e=>({...e,loading:!0})));let e={...m};e.clients=e.clients.map((e=>{let t={...e};return delete t.client,t})),m.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Forcast).update(e.id,e).then((e=>{E(),_((e=>({...e,open:!1,loading:!1}))),C(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{p(e.Message),_((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Forcast).create(e).then((e=>{E(),C(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),_((e=>({...e,open:!1,loading:!1})))})).catch((e=>{p(e.Message),_((e=>({...e,loading:!1})))})))},ActionOnClose:C,AddComponent:Object(he.jsx)(Jt,{vols:f,packs:O,fetchClients:e=>N(e,!1),clients:i,error:u})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{p(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Forcast).fetchById(e).then((e=>{x({...e.data})})).catch((e=>{console.log(e)}))})(e),_((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Forcast).delete(e).then((e=>{E(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>p(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:S,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:d,limitOptions:[10,20,50,100],limit:b.take,activePage:b.page,onChangePage:e=>{window.scrollTo(0,0),h((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),h((t=>({...t,take:e,page:1})))}})})]})}var ea=function(e){let{error:t,clients:a,fetchClients:s,vols:c=[],packs:i=[]}=e;const[l,r]=Object(n.useState)(0),[o,d]=Object(I.c)(Zt),[j,b]=Object(n.useState)([]),[h,u]=Object(n.useState)({nbr:1}),[p,m]=Object(n.useState)(null);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{style:{padding:"40px 10px"},children:[Object(he.jsx)("label",{children:"Vols : "}),Object(he.jsx)(Fe.a,{data:c.map(((e,t)=>({label:Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",background:t%2?"rgb(70,103,209,0.2)":"",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:i&&i.find((t=>t.id==e.packageId))&&i.find((t=>t.id==e.packageId)).name})," ",")"]})]}),Object(he.jsx)("b",{className:"p-5",children:Object(he.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:o.disponibilityId,onSelect:e=>{let t=i.find((t=>t.disponibilities.find((t=>t.id==e))));d((a=>({...a,disponibilityId:e,packageId:t.id})))}}),Object(he.jsx)("hr",{}),Object(he.jsxs)(re.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(he.jsx)("label",{children:"Date D'option: "}),Object(he.jsx)("input",{style:{display:"block",width:"100%"},type:"date",value:"string"==typeof o.optionDate?o.optionDate.substring(0,10):o.optionDate,onChange:e=>{let{value:t}=e.target;d((e=>({...e,optionDate:t})))}})]}),Object(he.jsxs)(re.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(he.jsx)("label",{children:"Nombre De Pr\xe9vision: "}),Object(he.jsx)(de.a,{type:"number",value:o.virtualStock,onChange:e=>d((t=>({...t,virtualStock:parseInt(e)})))})]}),Object(he.jsx)("hr",{}),Object(he.jsxs)(re.a,{className:"p-10",s:7,m:7,xl:7,l:7,children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>s(e),data:[{label:"Tout",value:0}].concat(a.filter((e=>!o.clients.some((t=>t.clientId==e.id)))).map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:o.clientId,onSelect:e=>{u({clientId:e,client:a.find((t=>t.id==e)),nbr:1})}})]}),Object(he.jsxs)(re.a,{className:"p-10",s:3,m:3,xl:3.5,l:3.8,children:[Object(he.jsx)("label",{children:"Nombre: "}),Object(he.jsx)(de.a,{type:"number",value:h.nbr,onChange:e=>u((t=>({...t,nbr:parseInt(e)})))})]}),Object(he.jsxs)(re.a,{className:"p-10",s:2,m:2,xl:1.5,l:1.2,children:[Object(he.jsx)("label",{children:"."}),Object(he.jsx)(je.a,{color:"violet",appearance:"primary",block:!0,onClick:()=>{h.clientId&&d((e=>({...e,clients:[...e.clients,h]}))),u({nbr:1,clientId:0})},children:"Ajout +"})]}),Object(he.jsxs)("table",{children:[Object(he.jsx)("thead",{children:Object(he.jsxs)("tr",{children:[Object(he.jsx)("th",{children:"Client"})," ",Object(he.jsx)("th",{children:"Nombre"}),Object(he.jsx)("th",{})]})}),Object(he.jsxs)("tbody",{children:[o.clients&&o.clients.map(((e,t)=>Object(he.jsxs)("tr",{children:[Object(he.jsx)("td",{children:e.client&&e.client.name})," ",Object(he.jsx)("td",{children:Object(he.jsx)(de.a,{value:e.nbr,onChange:a=>d((n=>{let s=[...n.clients];return s[t]={...e,nbr:parseInt(a)},{...n,clients:s}}))})}),Object(he.jsx)("td",{children:Object(he.jsxs)("button",{onClick:()=>d((t=>({...t,clients:t.clients.filter((t=>t.clientId!=e.clientId))}))),children:[" ",Object(he.jsx)(y.d,{})]})})]}))),Object(he.jsxs)("tr",{children:[Object(he.jsx)("td",{children:Object(he.jsx)("b",{children:"Total"})})," ",Object(he.jsx)("td",{children:o.clients.reduce(((e,t)=>e+t.nbr),0)})]})]})]})]}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{}),Object(he.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 "})]})};const ta=["ecb61c","b743ae","99c262","2590b5","ffd06d","a90e43","87a910","ff8200","008f96","7986cb","2590b5","ffd06d"],aa=e=>{console.log(e);let t=e.map((e=>e.items.map((e=>e.client)))).reduce(((e,t)=>e.concat(t)),[]);t=t.filter(((e,a)=>{const n=JSON.stringify(e);return a===t.findIndex((e=>JSON.stringify(e)===n))})),console.log(t);let a=[{title:"-",width:{wpx:70}},{title:"Vol",width:{wpx:120}},{title:"Pr\xe9vision",width:{wpx:120}},{title:"Airline",width:{wpx:50}}];if(t.map(((e,t)=>a=a.concat([{title:e?e.name.toUpperCase().replace("KOUNOUZ","").trim():"",width:{wpx:100},style:{fill:{fgColor:{rgb:t%2?"ffffff":ta[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}},{title:"-",style:{fill:{fgColor:{rgb:t%2?"ffffff":ta[t%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}]))),e&&e.length)return[{columns:a,data:e.map(((e,a)=>{let n=[{value:e.disponibility?e.disponibility.onStock-e.items.reduce(((e,t)=>e+t.nbr),0):"-",style:{fill:{fgColor:{rgb:e.disponibility.onStock-e.items.reduce(((e,t)=>e+t.nbr),0)>0?"66ff66":e.disponibility.onStock-e.items.reduce(((e,t)=>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?me()(e.disponibility.date).format("DD MMM yyyy"):"-",style:{fill:{fgColor:{rgb:a%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:a%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:a%2?"ffffff":"eeeeee"}},font:{sz:"13",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}}];return t.map(((t,a)=>{n=n.concat([{value:e.items.find((e=>t&&e.clientId==t.id))?e.items.find((e=>t&&e.clientId==t.id)).nbr:0,width:{wpx:100},style:{fill:{fgColor:{rgb:a%2?"ffffff":ta[a%9]}},font:{sz:"12"},alignment:{horizontal:"center"},border:{bottom:{style:"thin",color:"333333"}}}},{value:e.items.find((e=>e.clientId==t.id))?e.items.find((e=>e.clientId==t.id)).designation:"-",style:{fill:{fgColor:{rgb:a%2?"ffffff":ta[a%9]}},font:{sz:"12"},border:{bottom:{style:"thin",color:"333333"}}}}])})),n}))}]};function na(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)(0),[b,h]=Object(n.useState)({page:1,take:20,providerId:0,status:0,date:null}),[u,p]=Object(n.useState)(""),[m,x]=Object(I.c)(Zt),[O,g]=Object(n.useState)([]),[f,y]=Object(n.useState)([]),[v,_]=Object(I.c)(Oe.a),C=()=>{x(new Ht),p("")},N=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},E=()=>{_((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.ForcastVo,{...b,date:b.date?me()(b.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),(e=>{e.map((e=>e.disponibility));let t=e.map((e=>{let t=[];return e.clients.forEach((a=>{let n=e.prices.map((t=>({disponibilityId:e.disponibilityId,disponibility:e.disponibility,client:a.client,clientId:a.clientId,nbr:a.nbr,designation:t.priceUmrah.hotelMadinahName+" - "+t.priceUmrah.hotelMakkahName})));n=n.filter(((e,t)=>{const a=JSON.stringify(e);return t===n.findIndex((e=>JSON.stringify(e)===a))}));let s={...n[0]};n.forEach((e=>{s.designation=s.designation+" / "+e.designation})),t.push(s)})),t}));t=t.reduce(((e,t)=>e.concat(t)),[]);let a=new Set(t.map((e=>e.disponibilityId))),n=[];a.forEach((e=>{n.push({disponibilityId:e,disponibility:t.filter((t=>t.disponibilityId==e))[0].disponibility,items:t.filter((t=>t.disponibilityId==e))})})),console.log(n),o(n)})(e.data.data.filter((e=>e.prices.length))),_((e=>({...e,loading:!1}))),j(e.data.totalCount)})).catch((e=>{p(e.Message),_((e=>({...e,loading:!1})))}))};Object(n.useEffect)((()=>{var e;N(),("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Package,{q:e},"").customGet().then((e=>{g(e.data.data),y(e.data.data.reduce(((e,t)=>e.concat(t.disponibilities)),[]))}))}),[]),Object(n.useEffect)((()=>{E()}),[b.page,b.take]);const S=[{value:"disponibility",name:"Vol",render:e=>Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:O&&O.find((t=>t.id==e.packageId))&&O.find((t=>t.id==e.packageId)).name})," ",")"]})]}),Object(he.jsx)("b",{className:"p-5",children:Object(he.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:e=>Object(he.jsx)("b",{style:{color:"#53af50",fontSize:"18px"},children:e})},{value:"optionDate",name:"Date D'option",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})},{value:"note",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}];return Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>E(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Voyage: "}),Object(he.jsx)(Fe.a,{data:O&&O?[{label:"Tout",value:0}].concat(O.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,value:b.packageId,onSelect:e=>{h((t=>({...t,packageId:e})))}})]})}),Object(he.jsx)(ge.a,{excelData:r&&r.length?aa(r):aa([]),nameExcel:O&&O.find((e=>b.packageId==e.id))?O.find((e=>b.packageId==e.id)).name:"forcast",size:"lg",save:()=>{console.log(m),_((e=>({...e,loading:!0})));let e={...m};e.clients=e.clients.map((e=>{let t={...e};return delete t.client,t})),m.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.ForcastVo).update(e.id,e).then((e=>{E(),_((e=>({...e,open:!1,loading:!1}))),C(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{p(e.Message),_((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.ForcastVo).create(e).then((e=>{E(),C(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),_((e=>({...e,open:!1,loading:!1})))})).catch((e=>{p(e.Message),_((e=>({...e,loading:!1})))})))},ActionOnClose:C,AddComponent:Object(he.jsx)(ea,{vols:f,packs:O,fetchClients:e=>N(e,!1),clients:i,error:u})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{p(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.ForcastVo).fetchById(e).then((e=>{x({...e.data})})).catch((e=>{console.log(e)}))})(e),_((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.ForcastVo).delete(e).then((e=>{E(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>p(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:S,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:d,limitOptions:[10,20,50,100],limit:b.take,activePage:b.page,onChangePage:e=>{window.scrollTo(0,0),h((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),h((t=>({...t,take:e,page:1})))}})})]})}var sa=a(45),ca=a.n(sa),ia=a(1184);class la{constructor(){this.dateArrival=new Date,this.dateDepart=new Date}}var ra=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Date d'arriv\xe9 :"}),Object(he.jsx)(de.a,{type:"date",value:"string"==typeof n.dateArrival?n.dateArrival.substring(0,10):n.dateArrival,onChange:e=>{t((t=>({...t,dateArrival:e})))}}),Object(he.jsx)("label",{children:"Date de retour :"}),Object(he.jsx)(de.a,{type:"date",value:"string"==typeof n.departDate?n.departDate.substring(0,10):n.departDate,onChange:e=>{t((t=>({...t,departDate:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};const oa=[{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"}];var da=e=>{let{groupId:t,group:a,setgroup:s}=e;const[c,i]=Object(n.useState)([]),[l,r]=Object(n.useState)([]),[o,d]=Object(n.useState)(!1),[j,b]=Object(n.useState)(0),[h,u]=Object(n.useState)(!1);Object(n.useEffect)((()=>{localStorage.setItem("stop1",!0),r([])}),[]);const p=async(e,t)=>{if(b(t[e].id),"false"==localStorage.getItem("stop1")){let a=await f.a.post("http://localhost:8733/PrintVisaHajj",{...t[e],firstName:t[e].customer.firstName,passportNumber:t[e].customer.passportNumber}),n={...t[e]};const s=/^-?\d+\.?\d*$/;200==a.status&&a.data&&a.data.includes(",")&&s.test(a.data.split(",")[0])&&!a.data.startsWith("Error")?(n.errorMessage="",n.visaCode=a.data.split(",")[0],n.wakil=a.data.split(",")[1],n.hasVisa=!0):(n.errorMessage=a.data?a.data:n.errorMessage,a.data.includes(",")&&s.test(a.data.split(",")[0])||n.hasVisa||(n.hasVisa=!1,n.visaCode="")),i((a=>{let s=[...a],c=s.findIndex((a=>a.id==t[e].id));return s[c]=n,s})),delete n.client,delete n.disponibility,delete n.packageUmrah,delete n.price,M.a.createAPIEndpoint(be.a.Order+"/Umrah").update2(n).then((a=>{e{console.log("index: ",e),e{M.a.createAPIEndpoint(be.a.Order+"/Umrah",{page:1,take:11e3,groupId:t}).customGet().then((e=>i(e.data.data))),console.log(a)}),[t]);const m=[{value:"customer",value2:"id",name:" Nom",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"green",display:"flex",alignItems:"center"},children:[Object(he.jsx)(Gt.a,{onChange:e=>{l.find((e=>e==t))?r((e=>e.filter((e=>e!=t)))):r((e=>[...e,t]))},checked:null!=l.find((e=>e==t))}),Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(he.jsx)("i",{style:{color:"#999",fontSize:"14px",fontWeight:"lighter"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#444"},children:e.firstNameAr+" "+e.lastNameAr})]})]})]})},{value:"errorMessage",value2:"visaCode",value3:"codeMoufa",name:"Resultat",render:(e,t,a)=>Object(he.jsx)("span",{style:{color:"Error"==e?"red":"Success"==e?"green":""},children:t?Object(he.jsx)(Ae.a,{color:"blue",children:"r\xe9ussi"}):a||e})}];return Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{style:{textAlign:"right",padding:"10px"},children:[Object(he.jsx)(je.a,{appearance:"primary",color:"",onClick:s,children:"retour"})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"blue",onClick:async()=>{localStorage.setItem("stop1",!1),u(!0);let e=c.filter((e=>l.find((t=>t==e.id))&&!e.withoutVisa)).map((e=>({...e,country:oa.find((t=>t.code==e.customer.nationality))?oa.find((t=>t.code==e.customer.nationality)).alpha3:"TUN",id:e.id})));await p(0,e)},children:"visas"})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"red",onClick:()=>{d(!0),localStorage.setItem("stop1",!0),u(!1)},children:"arr\xe9ter"})]}),Object(he.jsxs)("div",{onClick:e=>r((e=>e.length?[]:c.map((e=>e.id)))),style:{display:"flex",alignItems:"center",padding:"8px",borderRadius:"4px",background:"#fff"},children:[Object(he.jsx)(Gt.a,{checked:l.length==c.length})," ","S\xe9lectionner Tout"]}),h&&Object(he.jsxs)("div",{style:{display:"flex ",alignItems:"center",border:"1px solid #eee",padding:"10px",background:"#fff",maxWidth:"800px",margin:"0 auto",marginBottom:"10px",justifyContent:"space-between"},children:[Object(he.jsxs)("div",{children:[" ","En cours :",Object(he.jsxs)("b",{style:{color:"green"},children:[c.find((e=>e.id==j))&&c.find((e=>e.id==j)).customer.firstName+" "+c.find((e=>e.id==j)).customer.lastName," ",Object(he.jsx)("br",{}),Object(he.jsx)("i",{style:{color:"#444"},children:c.find((e=>e.id==j))&&c.find((e=>e.id==j)).customer.firstNameAr+" "+c.find((e=>e.id==j)).customer.lastNameAr})]})]}),Object(he.jsx)("img",{alt:"...loading",src:"/svg-loaders/spinning-circles.svg"})]}),Object(he.jsx)(ye.a,{columns:m,rows:c})]})};class ja{constructor(){this.job="nothing",this.nationality="216",this.birthCountry="216",this.addressCountry="216"}}function ba(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(!1),[i,l]=Object(n.useState)(0),[r,o]=Object(I.c)(ie),[d,j]=Object(n.useState)(0),[b,h]=Object(n.useState)(0),[u,p]=Object(n.useState)([]),[m,x]=Object(n.useState)({q:"",page:1,take:50,date:null}),[O,g]=Object(n.useState)(""),[f,y]=Object(n.useState)(new la),[v,_]=Object(n.useState)(0),[C,N]=Object(I.c)(Oe.a),E=()=>{y(new la),g("")},S=()=>{N((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Group,m).fetchAll().then((e=>{a(e.data.data),N((e=>({...e,loading:!1}))),j(e.data.totalCount)})).catch((e=>{g(e.Message),N((e=>({...e,loading:!1})))})),M.a.createAPIEndpoint(M.a.ENDPOINTS.Group,{page:1,take:1e3,q:""}).fetchAll().then((e=>{o(e.data.data)})).catch((e=>{}))};Object(n.useEffect)((()=>{S()}),[m.page,m.take]),Object(n.useEffect)((()=>{i&&P()}),[i]);const D=[{value:"name",name:"NOM",render:e=>Object(he.jsx)("b",{style:{fontSize:"18px"},children:e})},{value:"dateArrival",name:"DATE D'ARRIVEE",render:e=>Object(he.jsx)("b",{children:e?e.substring(0,10):e})},{value:"total",name:"TOTAL",render:e=>Object(he.jsx)("b",{style:{color:"#23233",fontSize:"20px"},children:e})},{value:"sendedNumber",name:"EVOIYES VERS WAKIL",render:e=>Object(he.jsxs)("b",{style:{color:"orange",fontSize:"20px"},children:[" ",e," "]})},{value:"visasNumber",name:"VISAS",render:e=>Object(he.jsxs)("b",{style:{color:"#4caf50",fontSize:"20px"},children:[" ",e," "]})},{value:"id",name:"DETAILS",render:e=>Object(he.jsx)(je.a,{appearance:"ghost",color:"blue",onClick:()=>{c(!0),l(e)},children:"D\xe9tails"})},{value:"id",name:"-",render:e=>Object(he.jsx)(je.a,{appearance:"primary",color:"orange",onClick:()=>_(e),children:"envoyer"})},{value:"id",name:"-",render:e=>Object(he.jsx)(je.a,{appearance:"primary",color:"green",onClick:()=>h(e),children:"Visas"})}],k=()=>{p([]),l(0),c(!1)},P=()=>{M.a.createAPIEndpoint(be.a.Order+"/Umrah",{page:1,take:1e4,groupId:i}).customGet().then((e=>p(e.data.data.filter((e=>e)).map(((e,t)=>({...e,index:t+1}))))))};return v?Object(he.jsx)(ha,{groupId:v,setgroup:()=>{_(0),localStorage.setItem("stop",!0)},group:t.find((e=>e.id==v))}):b?Object(he.jsx)(da,{groupId:b,setgroup:()=>{h(0),localStorage.setItem("stop1",!0),S()},group:t.find((e=>e.id==b))}):Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>S(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{x((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"P\xe9riode: "}),Object(he.jsx)(ia.a,{placement:"bottomStart",value:m.date,onChange:e=>x((t=>({...t,date:e}))),onSelect:e=>x((t=>({...t,date:e}))),block:!0})]})]}),Object(he.jsx)(ge.a,{noExport:!0,size:"md",save:()=>{N((e=>({...e,loading:!0}))),f.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Group).update(f.id,f).then((e=>{S(),N((e=>({...e,open:!1,loading:!1}))),E(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{g(e.Message),N((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Group).create(f).then((e=>{S(),E(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),N((e=>({...e,open:!1,loading:!1})))})).catch((e=>{g(e.Message),N((e=>({...e,loading:!1})))}))},AddComponent:Object(he.jsx)(ra,{error:O,model:f,_setmodel:y})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{g(""),y(t.find((t=>t.id==e)))})(e),N((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Group).delete(e).then((e=>{S(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>g(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:D,rows:t}),Object(he.jsxs)("div",{style:{padding:20,background:"#fff"},children:[Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:d,limitOptions:[10,20,50,100],limit:m.take,activePage:m.page,onChangePage:e=>{window.scrollTo(0,0),x((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),x((t=>({...t,take:e,page:1})))}}),Object(he.jsxs)(at.a,{size:"lg",overflow:!1,style:{maxHeight:"calc(100vh - 50px)",overflow:"auto",maxWidth:"100vw"},open:s,onClose:()=>{k()},children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"Groupe D\xe9tails"})}),Object(he.jsx)(at.a.Body,{children:Object(he.jsx)("div",{style:{maxHeight:"calc(100vh - 240px)",overflow:"auto",maxWidth:"100vw"},children:Object(he.jsx)(ye.a,{columns:ua,rows:u})})}),Object(he.jsx)(at.a.Footer,{children:Object(he.jsx)(je.a,{onClick:()=>{k()},appearance:"subtle",children:"Annuler"})})]})]})]})}const ha=e=>{let{groupId:t,group:a,setgroup:s}=e;const[c,i]=Object(n.useState)([]),[l,r]=Object(I.c)(oe),[o,d]=Object(n.useState)(!1),[j,b]=Object(n.useState)(0),[h,u]=Object(n.useState)(!1),[p,m]=Object(n.useState)([]);Object(n.useEffect)((()=>{localStorage.setItem("stop",!0),m([])}),[]);const x=async(e,t)=>{b(e);let n=localStorage.getItem("stop");if(t[e]){if("false"==n){console.log(l);let n=new ja,s={...t[e]};n={...n,...s.customer,login:l.login,password:l.password,phoneNumber:l.phone,email:l.email,groupName:a.name,dateArrival:a.dateArrival.substring(0,10)},console.log(s.customer);let c={...s.customer};n.firstName=c.firstName,n.lastName=c.lastName,n.firstNameAr=c.firstNameAr,n.lastNameAr=c.lastNameAr,n.passportExpirationDate=c.expirationPassportDate.substring(0,10),n.passportDeliveryDate=c.deliveryPassportDate.substring(0,10),n.birthDate=c.birthDate.substring(0,10),n.fatherName=c.fatherName,n.maritalStatusCode=c.status||999,n.birthCountry=c.birthCountry||"216",n.nationality=c.nationality||"216",n.addressCountry=c.city,n.city=c.addressCountry||"216",n.passportDeliveryCountry=c.passportDeliveryCountry||"216",n.passportDeliveryCity=c.passportDeliveryCity,console.log(n);let r=await f.a.post("http://localhost:8733/SetCustomerNusuk",n);200==r.status&&"Success"==r.data.Erreur?(s.codeMoufa=r.data.codeMoufa||"Success",s.errorMessage=""):s.errorMessage="erreur envoie",i((e=>{let t=[...e],a=t.findIndex((e=>e.id==s.id));return t[a]={...s},t})),delete s.client,delete s.disponibility,delete s.packageUmrah,delete s.price,M.a.createAPIEndpoint(be.a.Order+"/Umrah").update2(s).then((a=>{e{console.log("index: ",e),e{M.a.createAPIEndpoint(be.a.Order+"/Umrah",{page:1,take:1e4,groupId:t}).customGet().then((e=>i(e.data.data))),console.log(a)}),[t]);const O=[{value:"codeMoufa",value2:"errorMessage",render:(e,t)=>Object(he.jsx)("span",{style:{content:"",width:"10px",height:"50px",background:e||"Success"==t?"green":t?"red":"orange",display:"block"}})},{value:"index",name:"-",render:e=>Object(he.jsx)("b",{style:{fontSize:"20px"},children:e})},{value:"customer",value2:"id",name:" Nom",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"green",display:"flex",alignItems:"center"},children:[Object(he.jsx)(Gt.a,{onChange:e=>{p.find((e=>e==t))?m((e=>e.filter((e=>e!=t)))):m((e=>[...e,t]))},checked:null!=p.find((e=>e==t))}),Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(he.jsx)("i",{style:{color:"#999",fontSize:"14px",fontWeight:"lighter"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#444"},children:e.firstNameAr+" "+e.lastNameAr})]})]})]})},{value:"codeMoufa",value2:"errorMessage",value3:"visaCode",name:"Resultat",render:(e,t,a)=>Object(he.jsx)("span",{style:{color:a?"white":e||"Success"==t?"green":t?"red":"",padding:"5px 10px",background:a?"blue":"",borderRadius:"5px"},children:a||(e?"Success"==e?"Envoy\xe9 vers wakil":"":t?"erreur envoie":"-")})}];return Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{style:{textAlign:"right",padding:"10px"},children:[Object(he.jsx)(je.a,{appearance:"primary",color:"",onClick:s,children:"retour"})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"orange",onClick:async()=>{localStorage.setItem("stop",!1),u(!0),console.log(p);let e=c.filter((e=>3==e.confirmationStatus&&!e.withoutVisa&&p.find((t=>t==e.id)))).map(((e,t)=>({...e,index:t+1})));console.log(e),await x(0,e)},children:"Envoyer"})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"red",onClick:()=>{d(!0),localStorage.setItem("stop",!0),u(!1)},children:"arr\xe9ter"})]})," ",h&&Object(he.jsxs)("div",{style:{display:"flex ",alignItems:"center",border:"1px solid #eee",padding:"10px",background:"#fff",maxWidth:"800px",margin:"0 auto",marginBottom:"10px",justifyContent:"space-between"},children:[Object(he.jsxs)("div",{children:[" ","En cours :",Object(he.jsxs)("b",{style:{color:"green"},children:[c.filter((e=>3==e.confirmationStatus&&!e.withoutVisa&&p.find((t=>t==e.id))))[j].customer.name||c.filter((e=>3==e.confirmationStatus&&!e.withoutVisa&&p.find((t=>t==e.id))))[j].customer.firsName+" "+c.filter((e=>3==e.confirmationStatus&&!e.withoutVisa&&p.find((t=>t==e.id))))[j].customer.lastName," "]})]}),Object(he.jsx)("img",{alt:"...loading",src:"/svg-loaders/spinning-circles.svg"})]}),Object(he.jsxs)("div",{onClick:e=>m((e=>e.length?[]:c.map((e=>e.id)))),style:{display:"flex",alignItems:"center",padding:"8px",borderRadius:"4px",background:"#fff"},children:[Object(he.jsx)(Gt.a,{checked:p.length==c.length})," ","S\xe9lectionner Tout"]}),Object(he.jsx)(ye.a,{columns:O,rows:c})]})},ua=[{value:"codeMoufa",value2:"errorMessage",render:(e,t)=>Object(he.jsx)("span",{style:{content:"",width:"10px",height:"50px",background:e||"Success"==t?"green":t?"red":"orange",display:"block"}})},{value:"index",name:"-",render:e=>Object(he.jsx)("b",{style:{fontSize:"20px"},children:e})},{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(he.jsx)("i",{style:{color:"#999",fontSize:"14px",fontWeight:"lighter"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#444"},children:e.firstNameAr+" "+e.lastNameAr})]})]})},{value:"codeMoufa",value2:"errorMessage",value3:"visaCode",name:"Resultat",render:(e,t,a)=>Object(he.jsx)("span",{style:{color:a?"white":e||"Success"==t?"green":t?"red":"",padding:"5px 10px",background:a?"blue":"",borderRadius:"5px"},children:a||(e?"Success"==e?"Envoy\xe9 vers wakil":"":t?"erreur envoie":"-")})}];var pa=a(1199);const ma="http://localhost:3003/",xa=f.a.create({baseURL:ma}),Oa=()=>{const e={"Content-Type":"multipart/form-data"};return{generate_invoice:e=>xa.post("invoice/",e),update_agency:t=>xa.put("agency/"+(localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).userName:""),t,{headers:e}),create_agency:t=>(t.append("userName",localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).userName:""),xa.post("agency",t,{headers:e})),get_agency:()=>xa.get("agency/"+(localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).userName:""))}};var ga=function(){const[e,t]=Object(I.c)(w),[a,s]=Object(n.useState)(null),[c,i]=Object(n.useState)(null);return Object(he.jsxs)("div",{style:{padding:"5px",background:"white"},children:[Object(he.jsx)("h5",{children:"Les informations de l'agence pour la facture:"}),Object(he.jsx)("div",{style:{width:"100px",margin:"15px"},children:Object(he.jsx)(vt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:e=>{console.log(e),i(e[e.length-1].blobFile),function(e,t){const a=new FileReader;a.onloadend=()=>{t(a.result)},a.readAsDataURL(e)}(e[e.length-1].blobFile,(e=>{s(e)}))},children:Object(he.jsx)("div",{style:{background:"rgba(200,200,200,0.1)",width:"100px",height:"100px",padding:"0"},children:a?Object(he.jsx)("img",{src:a,width:"100",height:"100",alt:""}):e.logo?Object(he.jsx)("img",{width:"100",height:"100",src:ma+e.logo.substring(7),alt:""}):Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(he.jsx)(ca.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"LOGO"})]})})})}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{value:e.name,onChange:e=>{t((t=>(console.log(t),{...t,name:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Matricule Fiscale :"}),Object(he.jsx)(de.a,{value:e.MF,onChange:e=>{t((t=>({...t,MF:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Addresse :"}),Object(he.jsx)(de.a,{value:e.address,onChange:e=>{t((t=>({...t,address:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Ville:"}),Object(he.jsx)(de.a,{value:e.city,onChange:e=>{t((t=>({...t,city:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2,xl:1,className:"p-10",children:[Object(he.jsx)("label",{children:"Zip Code :"}),Object(he.jsx)(de.a,{value:e.pincode,onChange:e=>{t((t=>({...t,pincode:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{type:"number",block:!0,size:"md",value:e.phone?e.phone.split(","):[],onChange:a=>{let n={...e};n.phone=a.join(","),t(n)}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fax:"}),Object(he.jsx)(pa.a,{type:"number",block:!0,size:"md",value:e.fax?e.fax.split(","):[],onChange:a=>{let n={...e};n.fax=a.join(","),t(n)}})," "]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"emails:"}),Object(he.jsx)(pa.a,{type:"number",block:!0,size:"md",value:e.emails?e.emails.split(","):[],onChange:a=>{let n={...e};n.emails=a.join(","),t(n)}})," "]}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsx)(ze.a,{appearance:"primary",onClick:()=>{let t=new FormData,a={...e};delete a.logo,Object.keys(a).map((e=>{t.append(e,a[e])})),c&&(console.log(c),t.append("logo",c)),a.id?Oa().update_agency(t).then((e=>console.log(e))):Oa().create_agency(t).then((e=>console.log(e)))},color:"blue",icon:Object(he.jsx)(d.a,{}),children:e.id?"modifier":"Ajouter"})})]})};var fa=function(){return Object(he.jsx)("div",{})};function ya(){const[e,t]=Object(n.useState)([]),[a,s]=Object(I.c)(Oe.a),[c,i]=Object(n.useState)(0),[l,r]=Object(n.useState)({page:1,take:20,clientId:0,date:null}),o=()=>{s((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Ledger,{...l,date:l.date?me()(l.date).format("DD MMM YYYY"):null},"/getLedgerProvider").customGet().then((e=>{t(e.data.data),s((e=>({...e,loading:!1}))),i(e.data.totalCount)})).catch((e=>{}))};return Object(n.useEffect)((()=>{o()}),[l.page,l.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>o()}),Object(he.jsx)(ge.a,{nameExcel:"GL",noAdd:!0}),Object(he.jsx)(ye.a,{noAdvancedActions:!0,columns:va,rows:e}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:c,limitOptions:[10,20,50,100],limit:l.take,activePage:l.page,onChangePage:e=>{window.scrollTo(0,0),r((t=>({...t,page:e})))},onChangeLimit:e=>{r((t=>({...t,take:e,page:1})))}})})]})}const va=[{value:"account",name:"Client",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",color:"#4667d1",fontSize:"16px",textTransform:"upperCase",fontWeight:"500"},children:e.name})},{value:"totalCredit",name:"Cr\xe9dit Total",render:e=>Object(he.jsx)("b",{style:{fontSize:"18px"},children:e?Object(Qe.a)(e):0})},{value:"totalDebit",name:"D\xe9bit Total",render:e=>Object(he.jsx)("b",{style:{fontSize:"18px"},children:e?Object(Qe.a)(e):0})},{value:"totalGarantee",name:"Garantie",render:e=>Object(he.jsx)("b",{style:{fontSize:"18px"},children:e?Object(Qe.a)(e)+" ":0})},{value:"totalCredit",value2:"totalDebit",name:"Notre Solde",render:(e,t)=>Object(he.jsx)("b",{style:{color:e-t<0?"#e33":"#53af50",fontSize:"18px"},children:e-t==0?0:Object(Qe.a)(e-t)+" "})}],_a=Object(I.b)({key:"PackageUmrahAtom",default:new K});var Ca=a(1213);var Ia={typeTransfert:{display:"flex",gap:"16px"}};var Na=e=>{let{transfertList:t,handleChange:a,paysData:s}=e;const[c,i]=Object(n.useState)(t.departType||0),[l,r]=Object(n.useState)(t.arrivalType||0),[o,d]=Object(n.useState)({departure:[],arrival:[]}),[j,b]=Object(n.useState)({departure:[],arrival:[]}),h=e=>0===e,u=Object(n.useCallback)((function(e,t,a,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;t&&M.a.createAPIEndpoint(e,{city:t,...null!==s&&{take:s}}).customGet().then((e=>{a((t=>({...t,[n]:e.data.data||e.data.hotels||[]})))}))}),[]);return Object(n.useEffect)((()=>{u(M.a.ENDPOINTS.Airport,t.paysDepartureId,d,"departure",500),u(M.a.ENDPOINTS.Airport,t.paysArrivalId,d,"arrival",500),u(M.a.ENDPOINTS.HotelList+"/HotelsByCity",t.paysDepartureId,b,"departure"),u(M.a.ENDPOINTS.HotelList+"/HotelsByCity",t.paysArrivalId,b,"arrival")}),[t.paysDepartureId,t.paysArrivalId]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.8,children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{block:!0,value:t.name||"",onChange:e=>a("name",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:2,xl:1.8,children:[Object(he.jsx)("label",{children:"Date:"}),Object(he.jsx)(de.a,{type:"date",value:me()(t.date).format("YYYY-MM-DD")||"",onChange:e=>a("date",e)})]}),Object(he.jsxs)("div",{style:Ia.typeTransfert,children:[Object(he.jsxs)(re.a,{className:"p-5",m:4,l:2,xl:1.7,children:[Object(he.jsx)("label",{children:"Type de d\xe9part: "}),Object(he.jsx)(Fe.a,{value:c,data:we.m,block:!0,noSearch:!0,onSelect:e=>{a("departType",e),i(e)}})]}),h(c)?Object(he.jsxs)(re.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(he.jsxs)("label",{children:[z.departureName,":"]}),Object(he.jsx)(de.a,{block:!0,value:t.departName||"",onChange:e=>a("departName",e)})]}):Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsx)("label",{children:"Pays de d\xe9part:"}),Object(he.jsx)(Fe.a,{data:null===s||void 0===s?void 0:s.map((e=>({label:e.nom,value:e.nom}))),block:!0,value:t.paysDepartureId,onSelect:e=>a("paysDepartureId",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(he.jsx)("label",{children:2===c?"h\xf4tel":"A\xe9roport"}),Object(he.jsx)(Fe.a,{value:t.departName||"",data:2===c?j.departure.map((e=>({label:e.name_en,value:e.name_en}))):1===c?o.departure.map((e=>({label:`${e.city} - ${e.name}`,value:e.name}))):[],block:!0,noSearch:!0,onSelect:e=>a("departName",e)})]})]})]}),Object(he.jsxs)("div",{style:Ia.typeTransfert,children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:2,xl:1.7,children:[Object(he.jsx)("label",{children:"Type d'arriv\xe9e: "}),Object(he.jsx)(Fe.a,{value:l,data:we.m,block:!0,noSearch:!0,onSelect:e=>{a("arrivalType",e),r(e)}})]}),h(l)?Object(he.jsxs)(re.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(he.jsxs)("label",{children:[z.arrivalName,":"]}),Object(he.jsx)(de.a,{block:!0,value:t.arrivalName||"",onChange:e=>a("arrivalName",e)})]}):Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsx)("label",{children:"Pays d'arriv\xe9e:"}),Object(he.jsx)(Fe.a,{data:null===s||void 0===s?void 0:s.map((e=>({label:e.nom,value:e.nom}))),block:!0,value:t.paysArrivalId,onSelect:e=>a("paysArrivalId",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:4,xl:3,children:[Object(he.jsx)("label",{children:2===l?"h\xf4tel":"A\xe9roport"}),Object(he.jsx)(Fe.a,{value:t.arrivalName||"",data:2===l?j.arrival.map((e=>({label:e.name_en,value:e.name_en}))):1===l?o.arrival.map((e=>({label:`${e.city} - ${e.name}`,value:e.name}))):[],block:!0,noSearch:!0,onSelect:e=>a("arrivalName",e)})]})]})]})]})};var Ea=e=>{let{mode:t,i:a,addNewTransport:n,modeTransports:s,deleteTransport:c,handleInputChangeTransport:i}=e;return Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{className:"p-5",s:6,m:6,l:3,xl:1.8,children:[Object(he.jsxs)("label",{children:[z.name,":"]}),Object(he.jsx)(Fe.a,{data:we.A,block:!0,noSearch:!0,value:t.name,onChange:e=>i(a,"name",e)})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-5",children:[Object(he.jsx)("label",{children:"Prix:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:t.price||0,onChange:e=>((e,t)=>{const a=parseFloat(t);a>=0&&i(e,"price",a)})(a,e)})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,style:{gap:"8px"},children:[Object(he.jsx)("div",{style:{height:"38px"}}),Object(he.jsx)(ze.a,{onClick:()=>c(a),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),a+1===s.length&&Object(he.jsx)(ze.a,{onClick:n,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]})};var Sa=e=>{let{setModel:t,disponibilitie:a,indexTransfert:s,transfertList:c,indexDisponibilitie:i}=e;const[l,r]=Object(n.useState)(c),[o,d]=Object(n.useState)([]),j=(e,n)=>{const c={...l,[e]:n};r(c);const o=[...a.transfert.transfertLists.slice(0,s),c,...a.transfert.transfertLists.slice(s+1)];t((e=>({...e,disponibilities:e.disponibilities.map(((e,t)=>t===i?{...e,transfert:{...e.transfert,transfertLists:o}}:e))})))},b=()=>{const e=new ne,t={...l,modeTransports:[...l.modeTransports,e]};r(t),j("modeTransports",t.modeTransports)},h=e=>{const t=l.modeTransports.filter(((t,a)=>a!==e));j("modeTransports",t)},u=(e,t,a)=>{const n=[...l.modeTransports];n[e]={...n[e],[t]:a},j("modeTransports",n)},p=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Pays,{}).customGet().then((e=>d(e.data)))}),[]);return Object(n.useEffect)((()=>{p()}),[p]),Object(he.jsxs)("div",{style:{background:"rgb(70, 90, 238, 0.2)",padding:"10px"},className:"p-5",children:[Object(he.jsx)(Na,{transfertList:l,handleChange:j,paysData:o}),Object(he.jsx)("hr",{style:{margin:"10px 0"}}),Object(he.jsx)("h6",{children:"Transport"}),l.modeTransports.map(((e,t)=>Object(he.jsx)(Ea,{mode:e,i:t,addNewTransport:b,modeTransports:l.modeTransports,deleteTransport:h,handleInputChangeTransport:u})))]})};var Da={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"}};var ka={container:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",width:"100%"},label:{display:"flex",gap:"8px",fontSize:"18px",display:"flex",alignItems:"center"}};var Pa=e=>{let{setCaracteristiques:t,caracteristique:a,translations:n}=e;const s=e=>n=>{const s={...a,[e]:n.target.checked};t(s)};return Object(he.jsx)("div",{style:ka.container,children:Object.keys(a).filter((e=>"id"!==e)).map((e=>Object(he.jsx)(re.a,{className:"p-5",m:1,l:1,xl:1,children:Object(he.jsxs)("label",{style:ka.label,children:[n[e]||e,Object(he.jsx)("input",{type:"checkbox",checked:a[e],onChange:s(e)})]})},e)))})};var Aa=e=>{var t,a,n,s;let{setModel:c,disponibilitie:i,index:l}=e;const r=(e,t)=>{c((a=>({...a,disponibilities:a.disponibilities.map(((a,n)=>n===l?{...a,transfert:{...a.transfert,[e]:t}}:a))})))},o=()=>{const e=new ae;c((t=>({...t,disponibilities:t.disponibilities.map(((t,a)=>a===l?{...t,transfert:{...t.transfert,transfertLists:[...t.transfert.transfertLists,e]}}:t))})))};return Object(he.jsxs)("div",{className:"p-5",children:[Object(he.jsx)("h6",{children:"Transfert"}),Object(he.jsxs)("div",{style:Da.mainContainer,children:[Object(he.jsxs)("div",{style:Da.rowContainer,children:[Object(he.jsxs)(re.a,{l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom : "}),Object(he.jsx)(de.a,{block:!0,name:"name",value:(null===i||void 0===i||null===(t=i.transfert)||void 0===t?void 0:t.name)||"",onChange:e=>r("name",e)})]}),Object(he.jsxs)(re.a,{l:5,xl:6.5,className:"p-10",children:[Object(he.jsx)("label",{children:"Description : "}),Object(he.jsx)(de.a,{as:"textarea",rows:3,block:!0,name:"description",value:(null===i||void 0===i||null===(a=i.transfert)||void 0===a?void 0:a.description)||"",onChange:e=>r("description",e)})]})]}),Object(he.jsx)(Pa,{setCaracteristiques:e=>{c((t=>({...t,disponibilities:t.disponibilities.map(((t,a)=>a===l?{...t,transfert:{...t.transfert,caracteristiques:e}}:t))})))},caracteristique:(null===i||void 0===i||null===(n=i.transfert)||void 0===n?void 0:n.caracteristiques)||{},translations:we.e}),null===i||void 0===i||null===(s=i.transfert)||void 0===s?void 0:s.transfertLists.map(((e,t)=>{var a;return Object(he.jsxs)("div",{style:Da.transfertListContainer,children:[Object(he.jsx)("div",{style:{flexGrow:1},children:Object(he.jsx)(Sa,{setModel:c,disponibilitie:i,indexTransfert:t,transfertList:e,indexDisponibilitie:l})}),Object(he.jsxs)(re.a,{s:2,m:2,l:2,xl:2,style:Da.iconContainer,children:[Object(he.jsx)(ze.a,{onClick:()=>{return e=t,void c((t=>({...t,disponibilities:t.disponibilities.map(((t,a)=>a===l?{...t,transfert:{...t.transfert,transfertLists:t.transfert.transfertLists.filter(((t,a)=>a!==e))}}:t))})));var e},color:"violet",icon:Object(he.jsx)(Nt.a,{}),style:Da.iconButton}),t+1===(null===i||void 0===i||null===(a=i.transfert)||void 0===a?void 0:a.transfertLists.length)&&Object(he.jsx)(ze.a,{onClick:o,color:"violet",icon:Object(he.jsx)(Ge.a,{}),style:Da.iconButton})]})]},t)}))]})]})};var Ma={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"}};const Ta=we.v.reduce(((e,t)=>(e[t.value]=t.label,e)),{}),wa=(e,t)=>0!==e?Ta[e]||"":t;var Ba=e=>{let{flight:t,handleChange:a,departureAirportData:s,arrivalAirportData:c,departureCity:i,setDepartureCity:l,arrivalCity:r,setArrivalCity:o,paysData:d,index:j,previousArrivalDate:b}=e;const h=(e,t)=>{a(j,e,t)},[u,p]=Object(n.useState)(""),[m,x]=Object(n.useState)(""),O=/^(\d{0,2})(h)?( ?)?([0-5]?\d{0,1})?(m?)?$/;Object(n.useEffect)((()=>{t.departureAirportId&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Airport).fetchById(t.departureAirportId).then((e=>{p(e.data)}))}),[t.departureAirportId]),Object(n.useEffect)((()=>{t.arrivalAirportId&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Airport).fetchById(t.arrivalAirportId).then((e=>{x(e.data)}))}),[t.arrivalAirportId]);const g=Object(n.useMemo)((()=>(null===d||void 0===d?void 0:d.map((e=>({label:e.nom,value:e.nom}))))||[]),[d]),f=Object(n.useMemo)((()=>(null===s||void 0===s?void 0:s.map((e=>({label:`${e.city} - ${e.name}`,value:e.id}))))||[]),[s]),y=Object(n.useMemo)((()=>(null===c||void 0===c?void 0:c.map((e=>({label:`${e.city} - ${e.name}`,value:e.id}))))||[]),[c]),v=(e,t)=>{const a=parseFloat(t);a>=0&&h(e,a)};return Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{style:Ma.container,children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsxs)("label",{children:[z.name,": "]}),Object(he.jsx)(de.a,{block:!0,value:t.name||"",onChange:e=>h("name",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsxs)("label",{children:[z.flightNumber,": "]}),Object(he.jsx)(de.a,{block:!0,value:t.flightNumber||"",onChange:e=>h("flightNumber",e)})]})]}),Object(he.jsxs)("div",{style:Ma.container,children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(he.jsxs)("label",{children:[z.countryDeparture,":"]}),Object(he.jsx)(Fe.a,{data:g,block:!0,value:i,onSelect:e=>l(e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsx)("label",{children:z.airport}),Object(he.jsx)(Fe.a,{data:f,block:!0,value:t.departureAirportId,onSelect:e=>h("departureAirportId",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsxs)("label",{children:[z.startingName,":"]}),Object(he.jsx)(de.a,{block:!0,value:u.name||"",disabled:!0})]})]}),Object(he.jsxs)("div",{style:Ma.container,children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(he.jsxs)("label",{children:[z.countryArrival,":"]}),Object(he.jsx)(Fe.a,{data:g,block:!0,value:r,onSelect:e=>o(e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsx)("label",{children:z.airport}),Object(he.jsx)(Fe.a,{data:y,block:!0,value:t.arrivalAirportId,onSelect:e=>h("arrivalAirportId",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:2,children:[Object(he.jsxs)("label",{children:[z.arrivalName,":"]}),Object(he.jsx)(de.a,{block:!0,value:m.name||"",disabled:!0})]})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.5,children:[Object(he.jsxs)("label",{children:[z.departureDate," :"]}),Object(he.jsx)(de.a,{min:b?me()(b).format("YYYY-MM-DDTHH:mm"):"",type:"datetime-local",value:me()(t.departDate).format("YYYY-MM-DDTHH:mm")||"",onChange:e=>h("departDate",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.5,children:[Object(he.jsxs)("label",{children:[z.arrivalDate,":"]}),Object(he.jsx)(de.a,{min:me()(t.departDate).format("YYYY-MM-DDTHH:mm"),type:"datetime-local",value:me()(t.arrivalDate).format("YYYY-MM-DDTHH:mm")||"",onChange:e=>h("arrivalDate",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.3,children:[Object(he.jsxs)("label",{children:[z.flightDuration,": "]}),Object(he.jsx)(de.a,{block:!0,value:t.flightDuration||"",placeholder:"1h 00m",onChange:e=>{(""===e||O.test(e))&&h("flightDuration",e)},onBlur:()=>{/^\d{1,2}h [0-5]\d{1}m$/.test(t.flightDuration)||h("flightDuration","")}})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(he.jsxs)("label",{children:[z.class,":"]}),Object(he.jsx)(Fe.a,{data:we.p,block:!0,noSearch:!0,value:t.class,onChange:e=>h("class",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:3.5,l:2.2,xl:1.6,children:[Object(he.jsxs)("label",{children:[z.handLuggage,":"]}),Object(he.jsxs)("div",{style:Ma.baggages,children:[Object(he.jsx)(de.a,{type:"number",step:"1",min:"0",value:t.nbrHandBaggages,onChange:e=>v("nbrHandBaggages",e),style:Ma.baggageInput}),Object(he.jsx)("label",{style:Ma.labelX,children:"x"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:t.handBaggages,onChange:e=>v("handBaggages",e),style:{flex:1}}),Object(he.jsx)("label",{style:Ma.labelKg,children:"Kg"})]})]}),Object(he.jsxs)(re.a,{className:"p-5",m:3,l:2.2,xl:1.6,children:[Object(he.jsxs)("label",{children:[z.luggage,":"]}),Object(he.jsxs)("div",{style:Ma.baggages,children:[Object(he.jsx)(de.a,{type:"number",step:"1",min:"0",value:t.nbrBaggages,onChange:e=>v("nbrBaggages",e),style:Ma.baggageInput}),Object(he.jsx)("label",{style:Ma.labelX,children:"x"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:t.baggages,onChange:e=>v("baggages",e)}),Object(he.jsx)("label",{style:Ma.labelKg,children:"Kg"})]})]}),Object(he.jsxs)(re.a,{className:"p-5",m:8,l:6,xl:6,children:[Object(he.jsxs)("label",{children:[z.description,": "]}),Object(he.jsx)(de.a,{block:!0,value:t.description||"",onChange:e=>h("description",e)})]})]})};var Ra=e=>{let{index:t,flight:a,type:s,setList:c,previousArrivalDate:i}=e;const[l,r]=Object(n.useState)({departure:[],arrival:[]}),[o,d]=Object(n.useState)({departure:"",arrival:""}),[j,b]=Object(n.useState)([]),h=Object(n.useCallback)((e=>{const t=o[e];t&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Airport,{city:t,take:500}).customGet().then((t=>{r((a=>({...a,[e]:t.data.data||[]})))}))}),[o]),u=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Pays,{}).customGet().then((e=>b(e.data)))}),[]);return Object(n.useEffect)((()=>{h("departure"),h("arrival")}),[h]),Object(n.useEffect)((()=>{u()}),[u]),Object(he.jsx)("div",{style:{background:"rgb(70, 90, 238, 0.2)",padding:"10px"},className:"p-5",children:Object(he.jsx)(Ba,{flight:a,handleChange:(e,t,a)=>{c((n=>n.map(((n,s)=>s===e?{...n,[t]:a}:n))))},type:s,index:t,departureAirportData:l.departure,arrivalAirportData:l.arrival,paysData:j,setArrivalCity:e=>d((t=>({...t,arrival:e}))),setDepartureCity:e=>d((t=>({...t,departure:e}))),arrivalCity:o.arrival,departureCity:o.departure,previousArrivalDate:i})})};var Ua=e=>{let{model:t,setModel:a,disponibilitie:s,index:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]);Object(n.useMemo)((()=>{if(s.flights){const e=s.flights;l(e.filter((e=>0===e.type))),o(e.filter((e=>1===e.type)))}}),[]);const d=e=>{const t=new Z(e,s.airlineId);0===e?l((e=>[...e,t])):o((e=>[...e,t]))},j=(e,t)=>{0===e?l((e=>e.filter(((e,a)=>a!==t)))):1===e&&o((e=>e.filter(((e,a)=>a!==t))))};Object(n.useEffect)((()=>{const e=[...i,...r];a((t=>({...t,disponibilities:t.disponibilities.map(((t,a)=>a===c?{...t,flights:e}:t))})))}),[i,r]);return Object(n.useEffect)((()=>{a((e=>({...e,disponibilities:e.disponibilities.map(((e,t)=>{if(t===c){var a,n;const t=[...i,...r],s=(null===(a=t.find((e=>0===e.type)))||void 0===a?void 0:a.departDate)||null,c=(null===(n=t.filter((e=>1===e.type)).sort(((e,t)=>new Date(t.arrivalDate)-new Date(e.arrivalDate)))[0])||void 0===n?void 0:n.arrivalDate)||null;return{...e,date:s,returnDate:c}}return e}))})))}),[i,r,c]),Object(he.jsxs)("div",{className:"p-5",children:[Object(he.jsxs)("div",{style:Ma.section,children:[Object(he.jsx)("h6",{children:"Vols de d\xe9part"}),0===i.length&&Object(he.jsx)(ze.a,{onClick:()=>{d(0)},color:"violet",icon:Object(he.jsx)(Ge.a,{})}),Object(he.jsx)("div",{style:Ma.flightContainer,children:i.map(((e,n)=>Object(he.jsxs)("div",{style:Ma.flightRow,children:[Object(he.jsx)("div",{style:Ma.flightContent,children:Object(he.jsx)(Ra,{model:t,setModel:a,disponibilitie:s,index:n,flight:e,type:0,setList:l,previousArrivalDate:n>0?i[n-1].arrivalDate:null})}),Object(he.jsxs)("div",{style:Ma.buttonGroup,children:[Object(he.jsx)(ze.a,{onClick:()=>{j(0,n)},color:"violet",icon:Object(he.jsx)(Nt.a,{}),style:Ma.iconButton}),n+1===i.length&&Object(he.jsx)(ze.a,{onClick:()=>{d(0)},color:"violet",icon:Object(he.jsx)(Ge.a,{}),style:Ma.iconButton})]})]},n)))})]}),Object(he.jsxs)("div",{children:[Object(he.jsx)("h6",{children:"Vols retour"}),0===r.length&&Object(he.jsx)(ze.a,{onClick:()=>{d(1)},color:"violet",icon:Object(he.jsx)(Ge.a,{})}),Object(he.jsx)("div",{style:Ma.flightContainer,children:r.map(((e,n)=>{const c=((e,t,a)=>{let n=null;if(0===e){const e=t.slice().reverse().find((e=>0===e.type));n=e?e.arrivalDate:null}else n=a[e-1].arrivalDate;return n})(n,i,r);return Object(he.jsxs)("div",{style:Ma.flightRow,children:[Object(he.jsx)("div",{style:Ma.flightContent,children:Object(he.jsx)(Ra,{model:t,setModel:a,disponibilitie:s,index:n,flight:e,type:1,setList:o,previousArrivalDate:c})}),Object(he.jsxs)("div",{style:Ma.buttonGroup,children:[Object(he.jsx)(ze.a,{onClick:()=>{j(1,n)},color:"violet",icon:Object(he.jsx)(Nt.a,{}),style:Ma.iconButton}),n+1===r.length&&Object(he.jsx)(ze.a,{onClick:()=>{d(1)},color:"violet",icon:Object(he.jsx)(Ge.a,{}),style:Ma.iconButton})]})]},n)}))})]})]})};class La{constructor(){this.id=0,this.name=null,this.prices=[],this.note="",this.disponibilities=[new Wa],this.extrats=[new Fa],this.description="",this.caracteristique=new Ga,this.destinations=[],this.images=[],this.imageUrls=[],this.programId=0,this.isDisplayed=!1,this.categoryIds=[]}}class Fa{constructor(){this.id=0,this.providerId=0,this.service=null,this.unitCost=0,this.unitFee=0,this.note="",this.exchange=1}}class za{constructor(){this.id=0,this.name="",this.order=0,this.nbrDay=1,this.hotelsVo=[new Ka],this.excursionDestIds=[]}}class Ka{constructor(e){this.id=0,this.duration=1,this.checkin=new Date,this.exchange=0,this.currencyId=0,this.providerId=0,this.name=e||"",this.hotelListId=0,this.destinationId=0,this.packageMealTypes=[],this.caracteristique=new Q}}class Wa{constructor(){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 Ya,this.flights=[]}}class Ya{constructor(){this.id=0,this.name="",this.description="",this.packageId=0,this.caracteristiqueId=0,this.caracteristiques=new te,this.transfertLists=[new ae]}}class Ga{constructor(){this.hasVol=!1,this.hasTransfert=!1,this.hasHotels=!1,this.hasVisa=!1,this.hasMeal=!1}}var Va=e=>{let{model:t,setModel:a,isUmrah:s}=e;const c=Object(I.d)(R);Object(n.useEffect)((()=>{a((e=>{const t=[...e.disponibilities].sort(((e,t)=>e&&!t?-1:new Date(e.date)>=new Date(t.date)?1:-1));return{...e,disponibilities:t}}))}),[t.id]);const i=(e,t)=>{a((a=>({...a,disponibilities:a.disponibilities.map(((a,n)=>{if(n===e){const e=a.flights.map((e=>({...e,airlineId:t.airlineId})));return{...a,...t,flights:e}}return a}))})))},l=()=>{a((e=>({...e,disponibilities:[...e.disponibilities,s?new q:new Wa]})))},r=(e,t,a)=>{const n=parseFloat(t);n>=0&&i(e,{[a]:n})};return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("h6",{children:"Vols"}),(!t.disponibilities||!t.disponibilities.length)&&Object(he.jsx)("div",{children:Object(he.jsx)(ze.a,{onClick:l,color:"violet",icon:Object(he.jsx)(Ge.a,{}),children:"ajouter"})}),t.disponibilities.map(((e,n)=>{var s;return Object(he.jsxs)("div",{className:"p-10",children:[Object(he.jsxs)(Ie.a,{header:Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(he.jsx)("span",{children:`Disponibilit\xe9 ${n+1}`}),Object(he.jsx)(ze.a,{onClick:()=>{return e=n,void a((t=>({...t,disponibilities:t.disponibilities.filter(((t,a)=>a!==e))})));var e},color:"violet",icon:Object(he.jsx)(Nt.a,{}),style:{marginLeft:"10px"}})]}),bordered:!0,collapsible:!0,bodyFill:!0,children:[Object(he.jsxs)(re.a,{className:"p-10",m:6,l:2,xl:2,children:[Object(he.jsxs)("label",{children:[z.date,":"]}),Object(he.jsx)(de.a,{disabled:!0,type:"datetime-local",value:me()(e.date).format("YYYY-MM-DDTHH:mm")||""})]}),Object(he.jsxs)(re.a,{className:"p-10",m:6,l:2,xl:2,children:[Object(he.jsxs)("label",{children:[z.returnDate,":"]}),Object(he.jsx)(de.a,{type:"datetime-local",value:me()(e.returnDate).format("YYYY-MM-DDTHH:mm")||"",disabled:!0})]}),Object(he.jsx)(re.a,{s:2,m:1,l:.5,xl:.5,className:"p-10",children:e.airlineId&&Object(he.jsx)("img",{alt:"Airline logo",style:{width:"50px"},src:null===(s=c.find((t=>t.id===e.airlineId)))||void 0===s?void 0:s.logo})}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsx)("label",{children:"Airline:"}),Object(he.jsx)(Fe.a,{data:c.map((e=>({label:e.name,value:e.id}))),block:!0,value:e.airlineId,onSelect:e=>i(n,{airlineId:e})})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.number,":"]}),Object(he.jsx)(de.a,{type:"number",step:"1",min:"0",value:e.onStock,onChange:e=>r(n,e,"onStock")})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.cost,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:e=>r(n,e,"cost")})]}),Object(he.jsxs)(re.a,{s:3,m:2,l:1.5,xl:1.5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.commission,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.commission,onChange:e=>r(n,e,"commission")})]}),Object(he.jsxs)(re.a,{s:3,m:2,l:1.5,xl:1.5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.commissionB2B,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.b2BCommission||0,onChange:e=>r(n,e,"b2BCommission")})]}),Object(he.jsx)(Aa,{setModel:a,disponibilitie:e,index:n}),Object(he.jsx)(Ua,{model:t,setModel:a,disponibilitie:e,index:n})]}),Object(he.jsx)("div",{style:Da.addDispo,children:n+1===t.disponibilities.length&&Object(he.jsx)(ze.a,{onClick:l,color:"violet",icon:Object(he.jsx)(Ge.a,{})})})]},n)}))]})};a(181);var Ha=e=>{let{model:t,setModel:a}=e;const n=(e,n,s)=>{const c=t.differentFees.map(((t,a)=>a===e?{...t,[n]:"cost"===n?parseFloat(s):s}:t));a({...t,differentFees:c})},s=()=>{const e=[...t.differentFees,new V];a({...t,differentFees:e})};return Object(he.jsxs)("div",{children:[Object(he.jsxs)("h6",{children:["Autres Frais"," ",0===t.differentFees.length&&Object(he.jsx)(ze.a,{onClick:s,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]}),t.differentFees.map(((e,c)=>Object(he.jsxs)("div",{className:"fee-entry",children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Designation :"}),Object(he.jsx)(de.a,{value:e.designation,onChange:e=>n(c,"designation",e)})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Co\xfbt :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:e=>((e,t)=>{const a=parseFloat(t);a>=0&&n(e,"cost",a)})(c,e)})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:{height:"42px"}}),Object(he.jsx)(ze.a,{onClick:()=>(e=>{const n=t.differentFees.filter(((t,a)=>a!==e));a({...t,differentFees:n})})(c),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),c+1===t.differentFees.length&&Object(he.jsx)(ze.a,{onClick:s,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},e.id||c)))]})},qa=a(1211);var Za={extratsMainContainer:{display:"flex",flexDirection:"column"},conatainer:{display:"flex"},iconButton:{height:"42px"},mainInformations:{display:"flex",flexDirection:"column"},subMain:{display:"flex",flexDirection:"row"}};var Ja=e=>{let{model:t,setModel:a}=e;const s=(e,t,n)=>{a((a=>({...a,[e]:n?n(t):t})))},[c,i]=Object(n.useState)([]),l=(e,t,a)=>{a(t)>=0&&s(e,t,a)};Object(n.useEffect)((()=>{M.a.createAPIEndpoint(`${M.a.ENDPOINTS.Category}/GetFiltreData`,{isUmrah:!0}).fetchAll().then((e=>{i(e.data.categories)})).catch((e=>{console.log("e",e)}))}),[]);return Object(he.jsxs)("div",{style:Za.mainInformations,children:[Object(he.jsxs)("div",{style:Za.subMain,children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom : "}),Object(he.jsx)(de.a,{value:t.name,onChange:e=>s("name",e.toUpperCase())})]}),Object(he.jsxs)(re.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission : "}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:t.commission,onChange:e=>l("commission",e,parseFloat)})]}),Object(he.jsxs)(re.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission B2B : "}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.b2Bcommission,onChange:e=>l("b2Bcommission",e,parseFloat)})]}),Object(he.jsxs)(re.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Nbre pour une gratuit\xe9 : "}),Object(he.jsx)(de.a,{type:"number",step:"1",min:"0",value:t.nbr_for_free_place,onChange:e=>l("nbr_for_free_place",e,parseInt)})]}),Object(he.jsxs)(re.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.categories," :"]}),Object(he.jsx)("div",{className:"p-2 font-sans",children:Object(he.jsx)(qa.a,{value:t.categoryIds||[],data:c.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,onChange:e=>{s("categoryIds",e)},placeholder:z.chooseCategories})})]})]}),Object(he.jsxs)(re.a,{l:12,xl:12,m:12,className:"p-5",children:[Object(he.jsxs)("label",{children:[z.description," : "]}),Object(he.jsx)(de.a,{as:"textarea",rows:4,block:!0,name:"description",value:t.description||"",onChange:e=>s("description",e)})]})]})};var $a=e=>{let{model:t,fetchProviders:a,providers:n,handleUpdateExtrat:s,getCurrencyOptions:c,handleCurrencySelect:i,handleProviderSelect:l,exchange:r,providerId:o,currencyId:d,handleAddExtrats:j,handleRemoveExtrat:b,setModel:h}=e;const u=e=>{const a=p(e).length>0,n=t.extrats.filter(((t,a)=>a!==e)).map((e=>e.service));return we.v.filter((e=>!(0!==e.value||!a)||!n.includes(e.value)))},p=e=>{const a=t.extrats.filter(((t,a)=>a!==e&&0===t.service)).map((e=>e.designation));return we.y.filter((e=>!a.includes(e.value)))};return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("h6",{children:"Extrats"}),0===t.extrats.length?Object(he.jsx)(ze.a,{onClick:j,color:"violet",icon:Object(he.jsx)(Ge.a,{})}):Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("div",{style:Za.extratsMainContainer,children:[Object(he.jsxs)("div",{style:Za.conatainer,children:[Object(he.jsxs)(re.a,{className:"p-10",m:4,l:3,xl:2.5,children:[Object(he.jsxs)("label",{children:[z.supplier,":"]}),Object(he.jsx)(Fe.a,{onSearch:a,data:(e=>e.map((e=>({label:e.name,value:e.id}))))(n),block:!0,noSearch:!0,value:o,onSelect:l})]}),Object(he.jsxs)(re.a,{s:3,m:3,l:2.5,xl:2,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.currency,":"]}),Object(he.jsx)(Fe.a,{data:c(),block:!0,noSearch:!0,value:d,onSelect:i})]}),Object(he.jsxs)(re.a,{s:3,m:3,l:1.5,xl:1,className:"p-10",children:[Object(he.jsx)("label",{children:"Cour:"}),Object(he.jsx)(de.a,{type:"text",value:r,disabled:!0})]})]}),t.extrats.map(((e,a)=>Object(he.jsxs)("div",{className:"fee-entry",style:Za.conatainer,children:[Object(he.jsxs)(re.a,{className:"p-10",m:4,l:2.5,xl:1.8,children:[Object(he.jsxs)("label",{children:[z.service,":"]}),Object(he.jsx)(Fe.a,{data:u(a),block:!0,noSearch:!0,value:e.service,onSelect:e=>{((e,a)=>{const n=t.extrats.map(((t,n)=>n===e?{...t,service:a,designation:wa(a,"")}:t));h((e=>({...e,extrats:n})))})(a,e)}})]}),Object(he.jsxs)(re.a,{m:4,l:3,xl:3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.designation,":"]}),0===e.service?Object(he.jsx)(Fe.a,{data:p(a),block:!0,noSearch:!0,value:e.designation,onSelect:e=>s(a,"designation",e)}):Object(he.jsx)(de.a,{value:wa(e.service,e.designation),disabled:!0})]}),Object(he.jsxs)(re.a,{s:4,m:4,l:1.5,xl:1.5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.cost,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:e=>((e,t)=>{const a=parseFloat(t);a>=0&&s(e,"cost",a)})(a,e)})]}),Object(he.jsxs)(re.a,{s:4,m:4,l:1.3,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.cost," ",z.TND,":"]}),Object(he.jsx)(de.a,{type:"text",value:Object(Qe.a)(e.cost*e.exchange),disabled:!0})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:Za.iconButton}),Object(he.jsx)(ze.a,{onClick:()=>b(a),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),a+1===t.extrats.length&&Object(he.jsx)(ze.a,{onClick:j,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},a)))]})})]})};var Xa=e=>{var t,a,s;let{model:c,setModel:i,fetchProviders:l,exchanges:r,currencies:o,providers:d}=e;const[j,b]=Object(n.useState)((null===c||void 0===c||null===(t=c.extrats[0])||void 0===t?void 0:t.providerId)||0),[h,u]=Object(n.useState)((null===c||void 0===c||null===(a=c.extrats[0])||void 0===a?void 0:a.currencyId)||0),[p,m]=Object(n.useState)((null===c||void 0===c||null===(s=c.extrats[0])||void 0===s?void 0:s.exchange)||1),x=e=>{const t=c.extrats.map((t=>({...t,...e})));i((e=>({...e,extrats:t})))};return Object(he.jsxs)("div",{children:[Object(he.jsx)(Ja,{model:c,setModel:i}),Object(he.jsx)(Pa,{setCaracteristiques:e=>{i((t=>({...t,caracteristique:e})))},caracteristique:c.caracteristique||{},translations:we.c}),Object(he.jsx)(Ha,{model:c,setModel:i}),Object(he.jsx)($a,{model:c,providers:d,fetchProviders:l,handleUpdateExtrat:(e,t,a)=>{const n=c.extrats.map(((n,s)=>s===e?{...n,[t]:"cost"===t?parseFloat(a):a}:n));i((e=>({...e,extrats:n})))},getCurrencyOptions:()=>{var e;const t=d.find((e=>e.id===j));return(null===t||void 0===t||null===(e=t.currencies)||void 0===e?void 0:e.map((e=>{let{currency:t}=e;return{label:t.name,value:t.id}})))||o.map((e=>({label:e.name,value:e.id})))},handleCurrencySelect:e=>{var t;u(e);const a=(null===(t=r.find((t=>t.currencySourceId===e)))||void 0===t?void 0:t.rate)||1;m(a),x({currencyId:e,exchange:a})},handleProviderSelect:e=>{b(e),x({providerId:e})},exchange:p,providerId:j,currencyId:h,handleAddExtrats:()=>{const e=[...c.extrats,new G(j,h,p)];i({...c,extrats:e})},handleRemoveExtrat:e=>{const t=c.extrats.filter(((t,a)=>a!==e));i({...c,extrats:t})},setModel:i})]})};var Qa=e=>{var t;let{index:a,model:n,data:s,keyName:c,setModel:i,grouppedBy:l}=e;return Object(he.jsxs)("tr",{style:{background:a%2?"rgb(244,81,108,0)":"rgb(70,103,209,0.2)",borderBottom:"3px solid #eee"},children:[Object(he.jsx)("td",{children:Object(he.jsx)(Gt.a,{onChange:()=>{let e=[...n.prices];s[c].forEach(((t,a)=>{const n=`${t.hotelMakkahName} - ${t.hotelMadinahName} - ${t.typeTraveler}`,s=e.findIndex((e=>`${e.hotelMakkahName} - ${e.hotelMadinahName} - ${e.typeTraveler}`===n));-1!==s&&(e[s]={...e[s],isHidden:!e[s].isHidden})})),l(e),i((t=>({...t,prices:e})))},checked:!(null===(t=n.prices.filter((e=>s[c].find((t=>JSON.stringify(e)===JSON.stringify(t)))))[0])||void 0===t?void 0:t.isHidden)})}),Object(he.jsx)("td",{children:Object(he.jsx)("h6",{children:c})}),Object(he.jsx)("td",{children:Object(Qe.a)(n.b2Bcommission+n.commission)}),["SIMPLE","DOUBLE","TRIPLE","QUAD","FAMILIALE","SUITE"].map(((e,t)=>{const a=s[c].find((t=>t.arrangementMadinahDesignation.toUpperCase().includes(e)&&t.arrangementMakkahDesignation.toUpperCase().includes(e))),l=null===a||void 0===a?void 0:a.arrangementMadinahDesignation,r=null===a||void 0===a?void 0:a.arrangementMakkahDesignation,o=n.prices.find((e=>e.hotelMakkahName===(null===a||void 0===a?void 0:a.hotelMakkahName)&&e.hotelMadinahName===(null===a||void 0===a?void 0:a.hotelMadinahName)&&e.typeTraveler===(null===a||void 0===a?void 0:a.typeTraveler)&&e.arrangementMadinahDesignation===l&&e.arrangementMakkahDesignation===r)),d=o?o.price:(null===a||void 0===a?void 0:a.baseCost)+n.b2Bcommission+n.commission||0,j=(null===a||void 0===a?void 0:a.baseCost)+(null===n||void 0===n?void 0:n.b2Bcommission)+(null===n||void 0===n?void 0:n.commission);return Object(he.jsx)("td",{children:a?Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("b",{children:Object(Qe.a)(j)}),Object(he.jsx)(de.a,{value:d||0,onChange:e=>{((e,t)=>{const a=[...n.prices],s=a.findIndex((e=>e.hotelMakkahName===t.hotelMakkahName&&e.hotelMadinahName===t.hotelMadinahName&&e.typeTraveler===t.typeTraveler&&e.arrangementMadinahDesignation===t.arrangementMadinahDesignation&&e.arrangementMakkahDesignation===t.arrangementMakkahDesignation));-1!==s&&(a[s]={...a[s],price:parseFloat(e)}),i((e=>({...e,prices:a})))})(e,a)}})]}):0},`${e}-${t}`)}))]})};var en=e=>{let{model:t,data:a,setModel:n,grouppedBy:s}=e;return Object(he.jsxs)("div",{children:[Object(he.jsxs)("table",{children:[Object(he.jsx)("thead",{children:Object(he.jsxs)("tr",{children:[Object(he.jsx)("th",{children:"-"}),Object(he.jsx)("th",{children:"Designation"}),Object(he.jsx)("th",{children:"Commission"}),Object(he.jsx)("th",{children:"SIMPLE"}),Object(he.jsx)("th",{children:"DOUBLE"}),Object(he.jsx)("th",{children:"TRIPLE"}),Object(he.jsx)("th",{children:"QUAD"}),Object(he.jsx)("th",{children:"FAMILIALE"}),Object(he.jsx)("th",{children:"SUITE"})]})}),Object(he.jsx)("tbody",{children:t.destinations&&0!==t.destinations.length&&a&&Object.keys(a).map(((e,c)=>Object(he.jsx)(Qa,{index:c,model:t,data:a,keyName:e,setModel:n,grouppedBy:s},e)))})]}),Object(he.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 "})]})};var tn=e=>{let{model:t,setModel:a}=e;const[s,c]=Object(n.useState)([]),i=Object(n.useRef)(t.prices),l=(e,a,n,s,c,i,l)=>{let r=e+a+c.unitCost*n.duration*n.exchange+i.unitCost*s.duration*s.exchange;return t.nbr_for_free_place&&(r*=1+1/t.nbr_for_free_place),{typeTraveler:i.typeTraveler,baseCost:r,hotelMadinahName:n.name,hotelMakkahName:s.name,arrangementMadinahDesignation:c.designation,arrangementMakkahDesignation:i.designation,price:(null===l||void 0===l?void 0:l.price)||0,id:(null===l||void 0===l?void 0:l.id)||0,packageUmrahId:(null===l||void 0===l?void 0:l.packageUmrahId)||0,hotelMadinahId:(null===l||void 0===l?void 0:l.hotelMadinahId)||0,hotelMakkahId:(null===l||void 0===l?void 0:l.hotelMakkahId)||0}},r=e=>{const t=e.reduce(((e,t)=>{const a=`${t.hotelMakkahName} - ${t.hotelMadinahName} - ${t.typeTraveler}`;return e[a]||(e[a]=[]),e[a].push(t),e}),{});c(t)};return Object(n.useEffect)((()=>{const e=(e=>{const a=(null===(n=t.differentFees)||void 0===n?void 0:n.reduce(((e,t)=>e+t.cost),0))||0;var n;const s=(null===(c=t.packageUmrahCosts)||void 0===c?void 0:c.reduce(((e,t)=>e+t.cost*t.exchange),0))||0;var c;const r=e.filter((e=>"makkah"===e.name)),o=e.filter((e=>"madinah"===e.name)),d=[];return o.forEach((e=>{e.hotelsUmrah.forEach((e=>{e.arrangements.forEach((t=>{r.forEach((n=>{n.hotelsUmrah.forEach((n=>{n.arrangements.forEach((c=>{if(t.designation===c.designation&&t.typeTraveler===c.typeTraveler){const r=i.current.find((a=>a.hotelMadinahName===e.name&&a.hotelMakkahName===n.name&&a.arrangementMadinahDesignation===t.designation&&a.arrangementMakkahDesignation===c.designation&&a.typeTraveler===c.typeTraveler))||null,o=l(a,s,e,n,t,c,r);d.push(o)}}))}))}))}))}))})),d})(t.destinations);e.length&&r(e),a((t=>({...t,prices:e}))),i.current=e}),[t.destinations]),Object(he.jsx)("div",{className:"p-10",children:Object(he.jsx)(en,{model:t,data:s,setModel:a,grouppedBy:r})})};const an=Object(I.b)({key:"hotelAtoms",default:[]});a(531);var nn=a(757);var sn=e=>{let{open:t,selectedFile:a,onClose:s,onUploadInModal:c,crop:i,setCrop:l}=e;const[r,o]=Object(n.useState)(!1),[d,j]=Object(n.useState)(!1);return Object(he.jsxs)(at.a,{open:t,onClose:s,size:"md",children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"T\xe9l\xe9charger le fichier"})}),Object(he.jsx)(at.a.Body,{children:a&&a.blobFile instanceof Blob?Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",position:"relative"},children:[Object(he.jsx)(nn.a,{crop:i,onChange:e=>l(e),keepSelection:!0,locked:!0,children:Object(he.jsx)("img",{src:URL.createObjectURL(a.blobFile),alt:"Selected File",onLoad:e=>{const{naturalWidth:t,naturalHeight:a}=e.target;o(i.height>a),j(i.width>t)},style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}),(r||d)&&Object(he.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:[r&&Object(he.jsx)("div",{children:"La hauteur du recadrage d\xe9passe la hauteur de l'image!"}),d&&Object(he.jsx)("div",{children:"La largeur du recadrage d\xe9passe la largeur de l'image!"})]})]}):Object(he.jsx)("p",{children:"Aucun fichier s\xe9lectionn\xe9"})}),Object(he.jsx)(at.a.Footer,{children:Object(he.jsxs)("div",{style:{display:"flex",gap:2,justifyContent:"center",alignContent:"center",paddingTop:"10px"},children:[Object(he.jsx)(je.a,{onClick:s,appearance:"subtle",children:"Annuler"}),Object(he.jsx)(je.a,{onClick:c,appearance:"primary",children:"Recadrer"})]})})]})};var cn={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"}},ln=a(758),rn=a.n(ln);var on=e=>{let{state:t,handleDelete:a,canDelete:n}=e;return Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("div",{children:[Object(he.jsx)("h5",{children:"Fichiers t\xe9l\xe9charg\xe9s :"}),Object(he.jsx)("br",{}),Object(he.jsx)("div",{style:cn.fileContainer,children:t.map(((e,t)=>{var s;return Object(he.jsxs)("div",{style:cn.filePreviewContainer,children:[Object(he.jsx)("div",{style:cn.filePreview,children:e?(null===(s=e.blobFile)||void 0===s?void 0:s.type.startsWith("video"))?Object(he.jsx)("video",{src:e.url||URL.createObjectURL(e.blobFile),controls:!0,style:cn.file}):Object(he.jsx)("img",{src:e.url||URL.createObjectURL(e.blobFile),alt:"Preview",style:cn.file}):Object(he.jsx)("p",{children:"Pas d'aper\xe7u"})}),!n&&Object(he.jsx)("div",{style:cn.deleteIcon,onClick:()=>a(t),children:Object(he.jsx)(rn.a,{style:{color:"red"}})})]},e.fileKey)}))})]})})};var dn=e=>{let{model:t,setModel:a,hasVideo:s=!1,isProgram:c=!1,index:i,showFileInput:l=!0,program:r,state:o,setState:d}=e;const[j,b]=Object(n.useState)(!1),[h,u]=Object(n.useState)(null),[p,m]=Object(n.useState)(""),x=Object(n.useRef)(null),O=75,g=75,[f,y]=Object(n.useState)({unit:"%",x:25,y:25,width:O,height:g});Object(n.useEffect)((()=>{const e=e=>{d((t=>{const a=new Set(t.map((e=>e.url))),n=e.filter((e=>!a.has(e.url)));return[...t,...n]}))};if(t.imageIds&&0!==t.imageIds.length){e(t.imageIds.map((e=>({id:e,fileKey:null,blobFile:{type:"image"},url:`${De.a}${e}/content`,name:null,status:"finished"}))))}if(t.imageUrls&&0!==t.imageUrls.length){e(t.imageUrls.map((e=>({id:e,fileKey:null,blobFile:{type:"image"},url:`${De.a}${e}/content`,name:null,status:"finished"}))))}if(c&&r&&d([]),c&&t.programsLists&&0!==t.programsLists[i].imageIds){var a;e(null===(a=t.programsLists)||void 0===a?void 0:a[i].imageIds.map((e=>({id:e,fileKey:null,blobFile:{type:"image"},url:`${De.a}${e}/content`,name:null,status:"finished"}))))}if(c&&r&&0!==r.imageIds){e(r.imageIds.map((e=>({id:e,fileKey:null,blobFile:{type:"image"},url:`${De.a}${e}/content`,name:null,status:"finished"}))))}if(s&&t.videoId){e([{id:t.videoId,fileKey:null,blobFile:{type:"video"},url:`${De.a}${t.videoId}/content`,name:null,status:"finished"}])}if(s&&t.videoIds){e(t.videoIds.map((e=>({id:e,fileKey:null,blobFile:{type:"video"},url:`${De.a}${e}/content`,name:null,status:"finished"}))))}}),[t,s,r,c]);const v=Object(n.useCallback)((e=>{if(e<0||e>=o.length)return;const n=o[e],s=[...t.images||[]];if(s.splice(e,1),n.id){let e=t.imageUrls||t.imageIds||[],i=t.videos||[],l=t.videoIds||[];"video"===n.blobFile.type?(i=i.filter((e=>e.id!==n.id)),l=l.filter((e=>e!==n.id))):e=e.filter((e=>e!==n.id)),a((a=>({...a,idsDelete:[...a.idsDelete||[],n.id],images:s,imageUrls:t.imageUrls?e:a.imageUrls,imageIds:t.imageIds?e:a.imageIds,videos:t.videos?i:a.videos,videoIds:t.videoIds?l:a.videoIds,...c&&{programsLists:(a.programsLists||[]).map((e=>({...e,imageIds:e.imageIds.filter((e=>e!==n.id))})))}})))}else a((e=>({...e,images:s})));d((t=>t.filter(((t,a)=>a!==e)))),s.length<5?m("Vous devez t\xe9l\xe9charger au moins 5 images"):m("")}),[t.images,o,t.videos]);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{style:cn.container,children:[l&&Object(he.jsxs)("div",{style:cn.fileUploadWrapper,children:[Object(he.jsx)("input",{type:"file",onChange:e=>{const n=e.target.files[0];if((null===n||void 0===n?void 0:n.size)>1048576&&(null===n||void 0===n?void 0:n.type.startsWith("image")))return void alert("La taille du fichier d\xe9passe la limite de 1 Mo.");if((null===n||void 0===n?void 0:n.size)>10485760&&(null===n||void 0===n?void 0:n.type.startsWith("video")))return void alert("La taille du fichier d\xe9passe la limite de 10 Mo.");const s={id:null,fileKey:Date.now(),blobFile:n,name:null===n||void 0===n?void 0:n.name,status:"pending"};if(null===n||void 0===n?void 0:n.type.startsWith("video")){d((e=>[...e,s]));const e=[...t.videos||[],n];a((t=>({...t,videos:e})))}else(null===n||void 0===n?void 0:n.type.startsWith("image"))&&(u(s),b(!0))},accept:s?"image/*,video/*":"image/*",style:{display:"none"},id:`file-input-${i}`,name:"files",ref:x}),Object(he.jsxs)("label",{htmlFor:`file-input-${i}`,style:cn.fileInputLabel,children:[Object(he.jsx)("div",{style:cn.fileUploadIcon,children:Object(he.jsx)(St.a,{color:"#3598ff"})}),Object(he.jsx)("h4",{style:cn.fileInputText,children:"Cliquez ou Faites glisser les fichiers vers cette zone"})]})]}),Object(he.jsx)(on,{state:o,handleDelete:v,warningMessage:p,canDelete:!!r})]}),Object(he.jsx)(sn,{open:j,selectedFile:h,onClose:()=>{b(!1),u(null),x.current&&(x.current.value="")},onUploadInModal:async()=>{if(h)try{const e=URL.createObjectURL(h.blobFile),n=await(e=>new Promise(((t,a)=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=e=>{a(e)}})))(e),s=await((e,t,a)=>new Promise(((n,s)=>{const c=new Image;c.src=e,c.onload=()=>{const e=document.createElement("canvas"),i=c.naturalWidth/c.width,l=c.naturalHeight/c.height,r={x:t.x/100*a.width,y:t.y/100*a.height,width:t.width/100*a.width,height:t.height/100*a.height};r.x=Math.max(0,Math.min(r.x,a.width-r.width)),r.y=Math.max(0,Math.min(r.y,a.height-r.height)),r.width=Math.min(r.width,a.width-r.x),r.height=Math.min(r.height,a.height-r.y),e.width=r.width,e.height=r.height,e.getContext("2d").drawImage(c,r.x*i,r.y*l,r.width*i,r.height*l,0,0,r.width,r.height),e.toBlob((e=>{e?n(e):s(new Error("Canvas is empty"))}),"image/jpeg",1)},c.onerror=e=>{console.error("Image failed to load:",e),s(e)}})))(e,f,n),l=new File([s],h.name,{type:h.blobFile.type}),r={...h,id:null,blobFile:s,status:"pending"};d((e=>[...e,r]));const o=[...t.images||[],l];if(c){const e={fileName:l.name,day:t.programsLists[i].day};a((t=>({...t,images:o,fileDay:[...t.fileDay||[],e]})))}else a((e=>({...e,images:o})));y({unit:"%",x:25,y:25,width:O,height:g}),b(!1),u(null),o.length>=5?m(""):m("Vous devez t\xe9l\xe9charger au moins 5 images")}catch(e){console.error("Error cropping image:",e)}},crop:f,setCrop:y})]})};var jn=e=>{let{destinations:t,setDestinationModel:a,updateModel:n}=e;return Object(he.jsxs)("table",{className:"table-container",children:[Object(he.jsx)("thead",{children:Object(he.jsxs)("tr",{className:"table-header",children:[Object(he.jsx)("td",{children:"Nom"}),Object(he.jsx)("td",{children:"Actions"})]})}),Object(he.jsx)("tbody",{children:t&&t.map((e=>Object(he.jsxs)("tr",{className:"table-row",children:[Object(he.jsx)("td",{children:e.name}),Object(he.jsxs)("td",{className:"table-actions",children:[Object(he.jsx)(ze.a,{appearance:"subtle",onClick:()=>(e=>{a(e)})(e),icon:Object(he.jsx)(i.b,{}),circle:!0}),Object(he.jsx)(yt.a,{vertical:!0}),Object(he.jsx)(ze.a,{appearance:"subtle",onClick:()=>{return t=e.id,a=e.uuid,void n((e=>({...e,destinations:e.destinations.filter((e=>t&&e.id!==t||a&&e.uuid!==a))})));var t,a},icon:Object(he.jsx)(Nt.a,{}),circle:!0})]})]},e.id||e.uuid)))})]})};var bn=e=>{let{packageMealTypes:t,setPackageMealTypes:a,exchange:n,duration:s}=e;const c=(e,n)=>{const s=[...t],c={...s[e],cost:parseFloat(n)};s[e]=c,a(s)},i=(e,n)=>{const s=[...t];s[e]={...s[e],totalPrice:parseFloat(n)},a(s)},l=()=>{a([...t,new X])},r=e=>{const a=t.filter(((t,a)=>a!==e)).map((e=>e.typeMeal));return we.z.filter((e=>!a.includes(e.value)))},o=(e,t,a)=>{parseFloat(t)>=0&&a(e,t)};return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("h6",{children:["Repas \xe0 l'h\xf4tel :"," ",0===t.length&&Object(he.jsx)(ze.a,{onClick:l,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]}),t.map(((e,d)=>Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{m:4,l:3,xl:3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.meal,":"]}),Object(he.jsx)(Fe.a,{data:r(d),block:!0,value:e.typeMeal,onSelect:e=>((e,n)=>{const s=[...t];s[e]={...s[e],typeMeal:n},a(s)})(d,e)})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.cost," :"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.cost,onChange:e=>o(d,e,c)})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.price," TND:"]}),Object(he.jsx)("h6",{children:Object(Qe.a)(e.cost*s*n||0)})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.totalPrice,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.totalPrice,onChange:e=>o(d,e,i)})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:{height:"42px"}}),Object(he.jsx)(ze.a,{onClick:()=>(e=>{const n=t.filter(((t,a)=>a!==e));a(n)})(d),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),d+1===t.length&&Object(he.jsx)(ze.a,{onClick:l,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},d)))]})};var hn=e=>{let{arrangements:t,setArrangements:a,exchange:n,duration:s}=e;const c=(e,t)=>e/("Chambre quadruple"===t?4:"Chambre triple"===t?3:2),i=()=>{const e=[...t,new $];a(e)},l=(e,n)=>{parseFloat(n)>=0&&((e,n)=>{const s=t.map(((t,a)=>a===e?{...t,cost:n,unitCost:c(n,t.designation)}:t));a(s)})(e,parseFloat(n)||0)};return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("h6",{children:["Arrangements :"," ",0===t.length&&Object(he.jsx)(ze.a,{onClick:i,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]}),t.map(((e,c)=>Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{className:"p-10",m:6,l:4,xl:2,children:[Object(he.jsx)("label",{children:"Type du Chambre:"}),Object(he.jsx)(Fe.a,{data:we.t,block:!0,noSearch:!0,value:e.designation,onChange:e=>{const n=t.map(((t,a)=>a===c?{...t,designation:e}:t));a(n)}})]}),Object(he.jsxs)(re.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(he.jsx)("label",{children:"type voyageur:"}),Object(he.jsx)(Fe.a,{data:we.B,block:!0,noSearch:!0,value:e.typeTraveler,onChange:e=>{const n=t.map(((t,a)=>a===c?{...t,typeTraveler:e}:t));a(n)}})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.cost,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.cost||0,onChange:e=>l(c,e)})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2.5,xl:1.3,className:"p-10",children:[Object(he.jsx)("label",{children:"Co\xfbt Par Personne:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",disabled:!0,value:e.unitCost||0})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:2,xl:1.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Co\xfbt Total TND:"}),Object(he.jsx)("h6",{className:"p-10",children:Object(Qe.a)(e.unitCost*n*s||0)})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:{height:"42px"},children:" "}),Object(he.jsx)(ze.a,{onClick:()=>(e=>{const n=t.filter(((t,a)=>a!==e));a(n)})(c),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),c+1===t.length&&Object(he.jsx)(ze.a,{onClick:i,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},c)))]})};var un=e=>{let{updateHotel:t,hotelData:a,hotel:n,index:s,fetchHotels:c,setPackageMealTypes:i,setCaracteristiques:l,providers:r,currencies:o,exchanges:d,fetchProviders:j,setArrangements:b,isUmrah:h}=e;return Object(he.jsxs)("div",{style:{display:"flex",gap:10,flexDirection:"column"},children:[Object(he.jsxs)("div",{style:{display:"flex",gap:8},children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"H\xf4tel:"}),Object(he.jsx)(Fe.a,{value:n.hotelListId,onSearch:c,data:a.map((e=>({label:e.name_en,value:e.id}))),block:!0,noSearch:!0,onSelect:e=>((e,t,a,n)=>{const s=n.find((t=>t.id===e));a(t,{hotelListId:e,name:(null===s||void 0===s?void 0:s.name_en)||""})})(e,s,t,a)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Fournisseur:"}),Object(he.jsx)(Fe.a,{value:n.providerId,onSearch:j,data:r.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,onSelect:e=>{t(s,{providerId:e})}})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Devise:"}),Object(he.jsx)(Fe.a,{data:(e=>{if(e){const t=r.find((t=>t.id===e));return t?t.currencies.map((e=>({label:e.currency.name,value:e.currency.id}))):[]}return o.map((e=>({label:e.name,value:e.id})))})(),block:!0,noSearch:!0,value:n.currencyId,onSelect:e=>((e,t,a,n)=>{const s=n.find((t=>t.currencySourceId===e));a(t,{currencyId:e}),a(t,{exchange:s?s.rate:1})})(e,s,t,d)})]}),Object(he.jsxs)(re.a,{s:3,m:3,l:1.5,xl:1,className:"p-10",children:[Object(he.jsx)("label",{children:"Cour:"}),Object(he.jsx)("h6",{className:"p-5",children:n.exchange})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:1.5,xl:1,className:"p-10",children:[Object(he.jsx)("label",{children:"Dur\xe9e:"}),Object(he.jsx)(de.a,{type:"number",step:"1",min:"0",value:n.duration,onChange:e=>((e,t,a)=>{if(parseInt(e)>=0){const n=parseInt(e,10);a(t,{duration:isNaN(n)?0:n})}})(e,s,t)})]})]}),Object(he.jsx)(Pa,{setCaracteristiques:e=>l(s,e),caracteristique:n.caracteristique||{},translations:we.b}),h&&Object(he.jsx)(hn,{arrangements:n.arrangements,setArrangements:e=>b(s,e),exchange:n.exchange,duration:n.duration}),Object(he.jsx)(bn,{packageMealTypes:n.packageMealTypes,setPackageMealTypes:e=>i(s,e),exchange:n.exchange,duration:n.duration})]})};var pn={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"}};var mn=e=>{let{hotels:t,updateHotel:a,hotelData:s,addHotel:c,removeHotel:i,setDestinationModel:l,fetchHotels:r,providers:o,currencies:d,exchanges:j,fetchProviders:b,destinationModel:h,isUmrah:u}=e;const p=Object(n.useMemo)((()=>t.reduce(((e,t)=>e+(t.duration||0)),0)),[t]);Object(n.useEffect)((()=>{l((e=>({...e,nbrDay:p})))}),[p]);const m=(e,t)=>{l((a=>({...a,[u?"hotelsUmrah":"hotelsVo"]:(u?a.hotelsUmrah:a.hotelsVo).map(((a,n)=>n===e?{...a,packageMealTypes:t}:a))})))},x=(e,t)=>{l((a=>({...a,[u?"hotelsUmrah":"hotelsVo"]:(u?a.hotelsUmrah:a.hotelsVo).map(((a,n)=>n===e?{...a,caracteristique:t}:a))})))},O=(e,t)=>{l((a=>({...a,hotelsUmrah:a.hotelsUmrah.map(((a,n)=>n===e?{...a,arrangements:t}:a))})))};return Object(he.jsx)("div",{style:pn.mainContainer,children:t.map(((e,n)=>Object(he.jsxs)("div",{style:pn.container,children:[Object(he.jsx)("div",{style:pn.hotel,className:"p-10",children:Object(he.jsx)(un,{fetchHotels:r,hotel:e,updateHotel:a,hotelData:s,index:n,setPackageMealTypes:m,setCaracteristiques:x,providers:o,currencies:d,exchanges:j,fetchProviders:b,setDestinationModel:l,setArrangements:O,isUmrah:u})}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:pn.iconButton}),Object(he.jsx)(ze.a,{onClick:()=>i(n),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),n+1===t.length&&Object(he.jsx)(ze.a,{onClick:()=>c(h.name||""),color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]})))})};var xn=e=>{let{destinationModel:t,setModel:a,setDestinationModel:n}=e;const s=t.id||t.uuid?"modifier":"ajouter";return Object(he.jsx)("div",{className:"button-container",children:Object(he.jsx)("button",{className:"button-primary",onClick:()=>{a((e=>{const a=e.prices.map((a=>{var n;const s=null===(n=e.destinations.flatMap((e=>e.hotelsVo||[])).find((e=>{var a;return null===(a=t.hotelsVo)||void 0===a?void 0:a.some((t=>e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid))})))||void 0===n?void 0:n.name;var c,i;return a.name===s?{...a,name:null===(c=t.hotelsVo)||void 0===c||null===(i=c[0])||void 0===i?void 0:i.name}:a})),n=[...e.destinations],s=n.findIndex((e=>e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid));return-1!==s?n[s]=t:n.push({...t,uuid:Date.now()}),{...e,destinations:n,prices:a}})),n(new za)},children:s})})};var On=e=>{let{destinationModel:t,setDestinationModel:a,excursionData:n,isUmrah:s,setCity:c,city:i,paysData:l}=e;const r=(e,t)=>{a((a=>({...a,[e]:t})))};return Object(he.jsxs)("div",{style:pn.destintaion,children:[!s&&Object(he.jsxs)(re.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(he.jsx)("label",{children:"Pays:"}),Object(he.jsx)(Fe.a,{data:null===l||void 0===l?void 0:l.map((e=>({label:e.nom,value:e.nom}))),block:!0,value:i,onSelect:e=>c(e)})]}),s?Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(he.jsxs)("label",{children:[z.destination,":"]}),Object(he.jsx)(Fe.a,{value:t.name,data:we.r,block:!0,noSearch:!0,onSelect:e=>{r("name",e)}})]}),Object(he.jsxs)("label",{style:pn.label,children:[z.firstDestination,Object(he.jsx)("input",{type:"checkbox",checked:t.isFirst,onChange:e=>r("isFirst",e.target.checked)})]})]}):Object(he.jsxs)(re.a,{className:"p-10",m:6,l:3,xl:1.8,children:[Object(he.jsxs)("label",{children:[z.destination,":"]}),Object(he.jsx)(de.a,{value:t.name,onChange:e=>r("name",e)})]}),Object(he.jsxs)(re.a,{className:"p-10",m:6,l:3,xl:2,children:[Object(he.jsx)("label",{children:"Excursion:"}),Object(he.jsx)(qa.a,{value:t.excursionDestIds||[],data:n.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,onChange:e=>{a((t=>({...t,excursionDestIds:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:1.4,xl:1,className:"p-10",children:[Object(he.jsx)("label",{children:"Dur\xe9e Total:"}),Object(he.jsx)(de.a,{type:"text",value:t.nbrDay,disabled:!0})]})]})};var gn=e=>{let{destinationModel:t,setModel:a,setDestinationModel:n}=e;const s=t.id||t.uuid?"modifier":"ajouter";return Object(he.jsx)("div",{className:"button-container",children:Object(he.jsx)("button",{className:"button-primary",onClick:()=>{a((e=>{const a=(t.hotelsUmrah||[]).map((e=>{var a;return{...e,isMakkah:"makkah"===(null===(a=t.name)||void 0===a?void 0:a.toLowerCase())}})),n={...t,hotelsUmrah:a},s=e.prices.map((t=>{var a;const s=null===(a=e.destinations.flatMap((e=>e.hotelsUmrah||[])).find((e=>{var t;return null===(t=n.hotelsUmrah)||void 0===t?void 0:t.some((t=>e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid))})))||void 0===a?void 0:a.name;var c,i;return t.hotelMakkahName===s?{...t,hotelMakkahName:null===(c=n.hotelsUmrah)||void 0===c||null===(i=c[0])||void 0===i?void 0:i.name}:t})),c=[...e.destinations],i=c.findIndex((e=>e.id&&e.id===t.id||e.uuid&&e.uuid===t.uuid));return-1!==i?c[i]=n:c.push({...n,uuid:Date.now()}),{...e,destinations:c,prices:s}})),n(new H)},children:s})})};var fn=e=>{let{providers:t,currencies:a,exchanges:s,fetchProviders:c,setModel:i,model:l,title:r,fetchPays:o,fetchHotels:d,hotelData:j,excursionData:b,isUmrah:h,paysData:u,city:p,setCity:m}=e;const[x,O]=Object(n.useState)(h?new H:new za);return Object(he.jsxs)("div",{children:[Object(he.jsx)("h3",{children:r}),Object(he.jsxs)("div",{style:{background:"rgb(70,90,238,0.2)"},className:"p-10",children:[Object(he.jsx)(On,{destinationModel:x,setDestinationModel:O,fetchPays:o,excursionData:b,isUmrah:h,paysData:u,city:p,setCity:m}),Object(he.jsx)(mn,{hotels:h?x.hotelsUmrah:x.hotelsVo,updateHotel:(e,t)=>{O((a=>({...a,[h?"hotelsUmrah":"hotelsVo"]:(h?a.hotelsUmrah:a.hotelsVo).map(((a,n)=>n===e?{...a,...t}:a))})))},addHotel:e=>{O((t=>({...t,[h?"hotelsUmrah":"hotelsVo"]:[...h?t.hotelsUmrah:t.hotelsVo,h?new J(e):new Ka(e)]})))},removeHotel:e=>{O((t=>({...t,[h?"hotelsUmrah":"hotelsVo"]:(h?t.hotelsUmrah:t.hotelsVo).filter(((t,a)=>a!==e))})))},hotelData:j,setDestinationModel:O,fetchHotels:d,providers:t,currencies:a,exchanges:s,fetchProviders:c,destinationModel:x,isUmrah:h}),Object(he.jsx)("hr",{}),h?Object(he.jsx)(gn,{destinationModel:x,setModel:i,setDestinationModel:O}):Object(he.jsx)(xn,{destinationModel:x,setModel:i,setDestinationModel:O}),Object(he.jsx)(jn,{destinations:l.destinations,setDestinationModel:O,updateModel:i})]})]})};var yn={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%"}};class vn{constructor(){this.id=0,this.isUmrah=!0,this.images=[],this.programsLists=[new _n],this.fileDay=[],this.name="",this.idsDelete=[]}}class _n{constructor(e){this.name="",this.description="",this.imageIds=[],this.day=e||1}}const Cn=Object(I.b)({key:"ProgramAtom",default:new vn});var In=e=>{let{program:t,setModel:a,model:s,index:c}=e;const[i,l]=Object(n.useState)([]),r=(e,t)=>{a((a=>{const n=[...a.programsLists];return n[c]={...n[c],[e]:t},{...a,programsLists:n}}))};return Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("div",{style:yn.container,children:[Object(he.jsxs)("div",{style:yn.dayLabel,children:["Jour ",t.day]}),Object(he.jsxs)("div",{style:yn.formSection,children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{block:!0,value:t.name||"",onChange:e=>r("name",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:5,xl:9,children:[Object(he.jsx)("label",{children:"Description: "}),Object(he.jsx)(de.a,{as:"textarea",rows:3,block:!0,value:t.description||"",onChange:e=>r("description",e)})]})]}),Object(he.jsx)(dn,{model:s,setModel:a,isProgram:!0,index:c,state:i,setState:l})]})})};var Nn=e=>{let{isLoading:t,error:a}=e;const[n,s]=Object(I.c)(Cn),c=()=>{s((e=>{const t=Math.max(...e.programsLists.map((e=>e.day)),0);return{...e,programsLists:[...e.programsLists,{...new _n,day:t+1}]}}))};return Object(he.jsx)(he.Fragment,{children:t?Object(he.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:Object(he.jsx)(Ca.a,{size:"lg"})}):Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{block:!0,value:n.name||"",onChange:e=>{return t=e,void s((e=>({...e,name:t})));var t}})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Programme type"}),Object(he.jsx)(Fe.a,{data:we.l,block:!0,noSearch:!0,value:n.isUmrah?0:1,onChange:e=>{return t=e,void s((e=>({...e,isUmrah:1!==t})));var t}})]}),n.programsLists.map(((e,t)=>Object(he.jsxs)("div",{style:yn.programList,children:[Object(he.jsx)(In,{index:t,program:e,model:n,setModel:s}),0===n.id&&Object(he.jsxs)(re.a,{s:2,m:2,l:2,xl:2,style:yn.containerButton,children:[0!==t&&Object(he.jsx)(ze.a,{onClick:()=>(e=>{s((t=>({...t,programsLists:t.programsLists.filter(((t,a)=>a!==e))})))})(t),color:"violet",icon:Object(he.jsx)(Nt.a,{}),style:yn.iconButton}),t+1===n.programsLists.length&&Object(he.jsx)(ze.a,{onClick:c,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},t)))]})})};var En={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 Sn(e){let{open:t,handleClose:a,save:n,error:s,isLoading:c}=e;return Object(he.jsx)("div",{style:En.modalContainer,children:Object(he.jsxs)(at.a,{size:"xl",overflow:!1,style:En.modal,open:t,onClose:a,children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"Ajouter un programme"})}),Object(he.jsx)(at.a.Body,{children:Object(he.jsx)("div",{style:En.modalBody,children:Object(he.jsx)(Nn,{isLoading:!1,error:s})})}),Object(he.jsxs)(at.a.Footer,{children:[Object(he.jsx)(je.a,{onClick:n,appearance:"primary",children:c?Object(he.jsx)(Ca.a,{size:"sm"}):"Enregistrer"}),Object(he.jsx)(je.a,{onClick:a,appearance:"subtle",children:"Annuler"})]})]})})}const Dn=(e,t,a)=>{"object"===typeof a&&null!==a?Array.isArray(a)?0===a.length?e.append(`${t}`,"[]"):a.forEach(((a,n)=>{Dn(e,`${t}[${n}]`,a)})):Object.keys(a).forEach((n=>{Dn(e,`${t}[${n}]`,a[n])})):e.append(t,a)};var kn=(e,t)=>{Object.keys(t).forEach((a=>{Array.isArray(t[a])?0===t[a].length?e.append(`${a}`,"[]"):t[a].forEach(((t,n)=>{"object"===typeof t&&null!==t?Object.keys(t).forEach((s=>{Dn(e,`${a}[${n}][${s}]`,t[s])})):e.append(`${a}[${n}]`,t)})):"object"===typeof t[a]&&null!==t[a]?Object.keys(t[a]).forEach((n=>{Dn(e,`${a}[${n}]`,t[a][n])})):e.append(a,t[a])})),t.images&&Array.isArray(t.images)&&t.images.forEach((t=>{t instanceof File&&e.append("images",t)})),t.videos&&Array.isArray(t.videos)&&t.videos.forEach((t=>{t instanceof File&&e.append("videos",t)}))},Pn=a(1212),An=a(1217);var Mn={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"}};var Tn=e=>{let{p:t,index:a,model:s,setModel:c}=e;const[i,l]=Object(n.useState)([]);return Object(he.jsxs)("div",{style:Mn.programContainer,children:[Object(he.jsxs)("div",{style:Mn.dayLabel,children:[z.day," ",t.day]}),Object(he.jsxs)("div",{style:Mn.programContent,children:[Object(he.jsxs)(re.a,{l:5,xl:4,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.name," : "]}),Object(he.jsx)(de.a,{block:!0,value:t.name,disabled:!0})]}),Object(he.jsxs)(re.a,{l:5,xl:5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.description," : "]}),Object(he.jsx)(de.a,{as:"textarea",rows:3,block:!0,value:t.description,disabled:!0})]})]}),Object(he.jsx)(dn,{model:s,setModel:c,isProgram:!0,index:a,showFileInput:!1,program:t,state:i,setState:l})]},a)};var wn=e=>{let{model:t,setModel:a,programs:s,fetchPrograms:c}=e;const[i,l]=Object(n.useState)(),[r,o]=Object(n.useState)(!1),[d,j]=Object(n.useState)(""),[b,h]=Object(I.c)(Cn),[u,p]=Object(n.useState)(!1);Object(n.useEffect)((()=>{const e=null===s||void 0===s?void 0:s.find((e=>e.id===t.programId));e&&l(e)}),[t.programId,s]);const m=()=>{o(!1)};return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:1.6,children:[Object(he.jsx)("label",{children:"Programs: "})," ",Object(he.jsx)(ze.a,{onClick:()=>{o(!0)},color:"violet",icon:Object(he.jsx)(Ge.a,{})}),Object(he.jsx)(Fe.a,{data:null===s||void 0===s?void 0:s.map((e=>({label:e.name,value:e.id}))),block:!0,value:t.programId,onSelect:e=>{const t=null===s||void 0===s?void 0:s.find((t=>t.id===e));t&&(l(t),a((e=>({...e,programId:t.id}))))}})]}),i&&i.programsLists.map(((e,n)=>Object(he.jsx)(Tn,{p:e,index:n,model:t,setModel:a},n)))]}),Object(he.jsx)(Sn,{open:r,handleClose:m,save:()=>{p(!0);let e=b;const t=new FormData;kn(t,e);const a=M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs);(e.id?a.update(e.id,t):a.create(t)).then((()=>{Te.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}),c(),m(),h(new vn),j("")})).catch((e=>{var t,a,n,s;j(e.Message),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})})).finally((()=>{p(!1)}))},error:d,isLoading:u})]})};var Bn={mainConatiner:{padding:"40px 10px"},steps:{verticalAlign:"top"},loader:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},button:{textAlign:"right"},message:{marginTop:"20px"}};var Rn=function(e){let{error:t,providers:a,save:s,fetchProviders:c,isDefault:i=!1,loading:l,isLoading:r}=e;const o=Object(I.d)(F),d=Object(I.d)(ce),[j,b]=Object(I.c)(an),[h,u]=Object(n.useState)([]),[p,m]=Object(I.c)(_a),[x,O]=Object(n.useState)([]),[g,f]=Object(n.useState)(0),[y,v]=Object(n.useState)([]),[_,C]=Object(n.useState)([]),N=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.HotelList+"/HotelsByCity",{city:"Saudi Arabia"}).customGet().then((e=>{b(e.data.hotels)}))}),[]);Object(n.useEffect)((()=>{N()}),[N]),Object(n.useEffect)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Excursion+"/getAll",{find:"Umrah"}).customGet().then((e=>{u(e.data.excursions)}))}),[]);const E=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Pays,{}).customGet().then((e=>v(e.data)))}),[]);Object(n.useEffect)((()=>{E()}),[E]);const S=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs+"/getAll",{isUmrah:!0}).customGet().then((e=>{C(e.data.programs)}))}),[]);Object(n.useEffect)((()=>{S()}),[S]);const D=[Object(he.jsx)(Xa,{model:p,setModel:m,fetchProviders:c,exchanges:d,currencies:o,providers:a,isUmrah:!0}),Object(he.jsx)(Va,{model:p,setModel:m,isUmrah:!0}),Object(he.jsx)(fn,{title:"Destination et H\xf4tels",providers:a,currencies:o,exchanges:d,fetchProviders:c,setModel:m,model:p,fetchPays:E,fetchHotels:N,hotelData:j||[],paysData:y||[],excursionData:h||[],isUmrah:!0}),Object(he.jsx)(wn,{setModel:m,programs:_||[],model:p,fetchPrograms:S}),Object(he.jsx)(tn,{model:p,setModel:m,isUmrah:!0}),Object(he.jsx)(dn,{model:p,setModel:m,state:x,setState:O})];return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{style:Bn.mainConatiner,children:[Object(he.jsx)(ft.a,{current:g,style:Bn.steps,children:we.w.map(((e,t)=>Object(he.jsx)(ft.a.Item,{title:e,onClick:()=>f(t)},t)))}),r?Object(he.jsx)("div",{style:Bn.loader,children:Object(he.jsx)(Ca.a,{size:"lg"})}):D[g]]}),i&&Object(he.jsx)("div",{style:Bn.button,children:Object(he.jsx)("button",{onClick:s,children:l?Object(he.jsx)(Ca.a,{size:"sm"}):"Enregistrer"})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};function Un(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=(Object(I.d)(w),Object(I.c)(se)),[r,o]=Object(n.useState)(0),[d,j]=Object(n.useState)(!1),[b,h]=Object(n.useState)({page:1,take:20,q:"",date:null}),[u,p]=Object(n.useState)(""),[m,x]=Object(I.c)(_a),[O,g]=Object(I.c)(Oe.a),f=()=>{x(i),p("")},y=e=>{("undefined"==typeof e||e.length>0)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>c(e.data)))},v=()=>{g((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah,{...b,date:b.date?me()(b.date).format("DD MMM YYYY"):null}).customGet().then((e=>{a(e.data.data),g((e=>({...e,loading:!1}))),o(e.data.totalCount)})).catch((e=>{p(e.Message),g((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{f(),y(),x(i)}),[]),Object(n.useEffect)((()=>{v()}),[b.page,b.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>v(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"D\xe9signation: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{h((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date : "}),Object(he.jsx)(de.a,{type:"date",value:b.date,onChange:e=>{h((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{ActionOnClose:f,noExport:!0,size:"xl",save:()=>{var e;g((e=>({...e,loading:!0})));let t={...m};const a=new FormData;(null===t||void 0===t||null===(e=t.categoryIds)||void 0===e?void 0:e.length)||delete t.categoryIds,kn(a,t);const n=M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah);(t.id?n.update(t.id,a):n.create(a)).then((()=>{Te.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}),f(),g((e=>({...e,open:!1,loading:!1}))),v()})).catch((e=>{var t,a,n,s;g((e=>({...e,loading:!1}))),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},title:"Ajouter package umrah",AddComponent:Object(he.jsx)(Rn,{providers:s,fetchProviders:y,error:u,loading:O.loading,isLoading:d})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{p(""),j(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah).fetchById(e).then((e=>{let t={...e.data};x(t)})).catch((e=>{console.log(e)})).finally((()=>{j(!1)}))})(e),g((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah).delete(e).then((e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:"",notFromCache:!0}).customGet().then((e=>v())),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>{var t,a,n,s;p(e.Message),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},displayAction:(e,t)=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/UpdateIsDisplayed",{etat:!t}).update3(e,!t).then((e=>{v(),Te.a.fire("Updated !","","success")})).catch((e=>{var t,a,n,s;p(e.Message),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},actionKey:"id",display:"isDisplayed",noAdvancedActions:!0,columns:Ln,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:r,limitOptions:[10,20,50,100],limit:b.take,activePage:b.page,onChangePage:e=>{window.scrollTo(0,0),h((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),h((t=>({...t,take:e,page:1})))}})})]})}const Ln=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e?e.toUpperCase():""})},{value:"commission",name:"Commission",render:e=>Object(he.jsx)("a",{children:Object(Qe.a)(e)})},{value:"b2Bcommission",name:"Commission B2B",render:e=>Object(he.jsx)("a",{children:Object(Qe.a)(e)})}];function Fn(){const[e,t]=Object(n.useState)([]),[a,s]=Object(I.c)(_a),[c,i]=Object(I.c)(se),l=()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getDefault",{}).customGet().then((e=>{let t={...e.data};console.log(e.data),s((e=>t))})).catch((e=>{console.log(e)}))};Object(n.useEffect)((()=>{}),[]);return Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("div",{style:{background:"#fff",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)("h5",{children:"Template"}),Object(he.jsx)(Rn,{providers:e,fetchProviders:e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>t(e.data)))},isDefault:!0,save:()=>{let e={...a,isDefault:!0};e.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah).update(e.id,e).then((e=>{l(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{})):M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah).create(e).then((e=>{l(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{}))}})]})})}var zn=a(84),Kn=a(70);function Wn(){const[e,t]=Object(n.useState)([]),[a,s]=Object(n.useState)({page:1,take:20,q:"",date:null}),[c,i]=Object(n.useState)([]),[l,r]=Object(n.useState)([]),o=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{i(e.data);let t=e.data.reduce(((e,t)=>e.concat(t.disponibilities.map((e=>({packageUmrahId:t.id,...e}))))),[]);console.log(t),r(t.filter((e=>e.onStock)))}))},d=()=>{M.a.createAPIEndpoint(be.a.PackageUmrah+"/getForPrices",a).fetchAll().then((e=>t(e.data)))};return Object(n.useEffect)((()=>{d(),o()}),[]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:d,children:[" ",Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{s((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{onSearch:o,data:c?[{label:"Tout",value:0}].concat(c.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:a.packageUmrahId,onSelect:e=>{s((t=>({...t,packageUmrahId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(l?l.map((e=>({label:Object(he.jsxs)("div",{style:{color:"#232323"},children:[me()(e.date).format("DD MMM YYYY")," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:c&&c.find((t=>t.id==e.packageUmrahId))&&c.find((t=>t.id==e.packageUmrahId)).name}),")"]}),value:e.id}))):[]),block:!0,noSearch:!0,value:a.disponibilityId,onSelect:e=>{s((t=>({...t,disponibilityId:e})))}})]})]}),Object(he.jsx)("div",{className:"p-10",children:e&&e.map((e=>Object(he.jsxs)("div",{children:[Object(he.jsx)("h4",{children:e.name}),Object(he.jsx)(re.a,{m:5.5,l:5.5,xl:5.5,className:"p-10",children:Object(he.jsx)(Yn,{pack:e})})," ",Object(he.jsx)(re.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((e=>Object(he.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(he.jsx)("img",{alt:"",src:e.airline&&e.airline.logo,style:{width:"50px"}})," ",Object(he.jsxs)("div",{style:{padding:"4px"},children:[Object(he.jsx)("h6",{children:e.date.substring(0,10)}),Object(he.jsx)("span",{style:{fontWeight:"lighter",fontSize:"small"},children:"NOMBRE DES PLACES DISPO. :"})," ",Object(he.jsx)("b",{children:e.onStock})]})]})))}),Object(he.jsx)("hr",{})," "]})))}),Object(he.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 "})]})}const Yn=e=>{let{pack:t}=e;const[a,s]=Object(n.useState)(null);return Object(n.useEffect)((()=>{t.prices&&(e=>{e=e.filter((e=>!e.isHidden)).map(((e,t)=>({...e,h:e.hotelMakkahName+" - "+e.hotelMadinahName,index:t})));let t=new Set(e.map((e=>e.h))),a={};t.forEach((t=>{a[t]=e.filter((e=>e.h==t))})),s(a)})(t.prices)}),[t]),Object(he.jsx)(he.Fragment,{children:a&&Object.keys(a).map(((e,n)=>Object(he.jsxs)("div",{style:{marginBottom:"30px",background:"#fff",borderRadius:"5px",boxShadow:"-11px 4px 26px -10px rgba(31,50,150,0.67)"},children:[Object(he.jsxs)("div",{style:{padding:"5px"},children:[" ",Object(he.jsxs)("table",{children:[Object(he.jsx)("thead",{style:{background:n%2?"rgba(236,182,28)":"rgb(31,50,150)",color:n%2?"":"#fff"},children:Object(he.jsxs)("tr",{children:[Object(he.jsx)("th",{children:"Designation"}),Object(he.jsx)("th",{children:"QUAD "}),Object(he.jsx)("th",{children:"TRIPLE "}),Object(he.jsx)("th",{children:"DOUBLE "})]})}),Object(he.jsx)("tbody",{children:Object(he.jsxs)("tr",{children:[Object(he.jsxs)("td",{children:[Object(he.jsx)("span",{style:{color:"#eee"},children:Object(he.jsx)(Kn.c,{})})," ",Object(he.jsxs)("b",{children:[" ",e]})]}),Object(he.jsx)("td",{children:Object(he.jsx)("b",{style:{color:"#53af50",fontSize:"17px"},children:a[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("QUAD")))?Object(Qe.a)(a[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("QUAD"))).price):"-"})}),Object(he.jsx)("td",{children:Object(he.jsx)("b",{style:{color:"#53af50",fontSize:"17px"},children:a[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE")))?Object(Qe.a)(a[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("TRIPLE"))).price):"-"})}),Object(he.jsx)("td",{children:Object(he.jsx)("b",{style:{color:"#53af50",fontSize:"17px"},children:a[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE")))?Object(Qe.a)(a[e].find((e=>e.arrangementMadinahDesignation.toUpperCase().includes("DOUBLE"))).price):"-"})})]})})]})]}),Object(he.jsx)("div",{style:{marginTop:"5px",background:"#fff",padding:"5px",borderRadius:"5px"},children:t.hotels&&t.hotels.filter((t=>t.name==a[e][0].hotelMadinahName||t.name==a[e][0].hotelMakkahName)).map((e=>{if(e.packageUmrahMealTypes)return e.packageUmrahMealTypes.map((t=>Object(he.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"space-between",padding:"5px",border:"1px solid #ddd",borderRadius:"5px",margin:"2px"},children:[Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",marginRight:"10px"},children:[Object(he.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(he.jsx)(zn.d,{})," "]}),Object(he.jsxs)("span",{children:[t.designation,Object(he.jsx)("br",{}),Object(he.jsxs)("span",{style:{textTransform:"uppercase",color:"#888",fontWeight:"lighter"},children:[e.name," ",Object(he.jsx)("span",{style:{fontSize:"0.7em"},children:e.isMakkah?"Makkah":"Madinah"})]})]})]})," ",Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"15px",margin:"3px"},children:[t.totalPrice?Object(Qe.a)(t.totalPrice):Object(Qe.a)(e.duration*e.exchange*t.cost),Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})]})))}))})]})))})},Gn=e=>{let{pack:t,model:a,_setmodel:s,multiple:c=!1,prices:i,visa:l=0,ident:r}=e;const[o,d]=Object(n.useState)(null),[j,b]=Object(n.useState)(null),[h,u]=Object(n.useState)([]);return Object(n.useEffect)((()=>{i&&(e=>{e=e.filter((e=>!e.isHidden)).map(((e,t)=>({...e,h:e.hotelMakkahName+" - "+e.hotelMadinahName,index:t})));let t=new Set(e.map((e=>e.h))),a={};t.forEach((t=>{a[t]=e.filter((e=>e.h==t))})),b(a)})(i)}),[i]),Object(n.useEffect)((()=>{let e=[];t.hotels&&(a.packageUmrahMealTypeMadinahId||a.packageUmrahMealTypeMakkahId)&&t.hotels.map((t=>{let n=t.packageUmrahMealTypes.find((e=>e.id==a.packageUmrahMealTypeMadinahId||e.id==a.packageUmrahMealTypeMakkahId));n&&e.push({...n,k:i.find((e=>e.id==a.priceId)).hotelMakkahName+" - "+i.find((e=>e.id==a.priceId)).hotelMadinahName})})),u(e),console.log(t)}),[a.id]),Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)("label",{children:[" ",Object(he.jsx)(Gt.a,{onChange:e=>{s((e=>({...e,onlyTicket:!0,priceId:null,packageUmrahMealTypeMakkahId:null,packageUmrahMealTypeMadinahId:null,totalPrice:0,withoutTicket:!1,withoutVisa:!1})))},checked:a.onlyTicket})," ","Billet Seulement"," "]}),Object(he.jsx)("hr",{}),j&&Object.keys(j).map(((e,n)=>Object(he.jsxs)("div",{style:{marginBottom:"30px",background:"#fff",borderRadius:"5px",boxShadow:"-11px 4px 26px -10px rgba(31,50,150,0.67)"},children:[Object(he.jsxs)("div",{style:{padding:"5px"},children:[" ",Object(he.jsx)("table",{style:{borderRadius:"5px !important"},children:j[e].filter((e=>!e.isHidden)).map(((t,n)=>Object(he.jsxs)("tr",{style:{padding:"5px",borderRadius:"5px !important",background:n%2?"rgb(70,103,209,0.2)":""},children:[Object(he.jsxs)("td",{style:{padding:"5px"},children:[Object(he.jsx)(Gt.a,{onChange:a=>{c?s((e=>{let a=[...e.prices];return e.prices.find((e=>e.id==t.id))?a=a.filter((e=>e.id!=t.id)):a.push(t),{...e,prices:a}})):(u([]),s((a=>({...a,priceId:t.id,totalPrice:t.price,packageUmrahMealTypeMakkahId:null,packageUmrahMealTypeMadinahId:null,onlyTicket:!1,withoutTicket:!!j[e].find((e=>e.id==a.priceId))&&a.withoutTicket,withoutVisa:!!j[e].find((e=>e.id==a.priceId))&&a.withoutVisa}))))},checked:a.priceId==t.id})," ",Object(he.jsx)(Ae.a,{color:["red","green","yellow"][we.t.findIndex((e=>e.label==t.arrangementMakkahDesignation))],children:t.arrangementMakkahDesignation})]}),Object(he.jsxs)("td",{children:[" ",Object(he.jsx)("img",{alt:"",src:"/makkah.png",style:{width:"40px"}}),t.hotelMakkahName]}),Object(he.jsxs)("td",{children:[" ",Object(he.jsx)("img",{alt:"",src:"/madinah4.png",style:{width:"40px"}}),t.hotelMadinahName]}),Object(he.jsx)("td",{children:Object(he.jsxs)("b",{style:{color:"#232323",fontSize:"17px"},children:[t.price,Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})})]})))})]}),!c&&Object(he.jsxs)("div",{style:{marginTop:"5px",background:"#fff",padding:"5px",borderRadius:"5px"},children:[t.hotels&&t.hotels.filter((t=>t.name==j[e][0].hotelMadinahName||t.name==j[e][0].hotelMakkahName)).map((n=>{if(n.packageUmrahMealTypes)return n.packageUmrahMealTypes.map((c=>Object(he.jsxs)("div",{onClick:()=>{let i=[];a.packageUmrahMealTypeMadinahId&&t.hotels.filter((t=>t.name==j[e][0].hotelMadinahName)).map((t=>i.push({...t.packageUmrahMealTypes.find((e=>e.id===a.packageUmrahMealTypeMadinahId)),k:e}))),a.packageUmrahMealTypeMakkahId&&t.hotels.filter((t=>t.name==j[e][0].hotelMakkahName)).map((t=>i.push({...t.packageUmrahMealTypes.find((e=>e.id===a.packageUmrahMealTypeMakkahId)),k:e}))),console.log(i),i.find((e=>e.id==c.id))?i=i.filter((e=>e.id!==c.id)):i.push({...c,k:e}),j[e].find((e=>e.id==a.priceId))||(i=[]),console.log("meals"),console.log(i),u(i),s((t=>({...t,packageUmrahMealTypeMakkahId:n.isMakkah?i.find((t=>t.id==c.id&&t.k==e))?c.id:null:t.packageUmrahMealTypeMakkahId,packageUmrahMealTypeMadinahId:n.isMakkah?t.packageUmrahMealTypeMadinahId:i.find((t=>t.id==c.id&&t.k==e))?c.id:null,totalPrice:(j[e].find((e=>e.id==t.priceId))?j[e].find((e=>e.id==t.priceId)).price:0)+i.reduce(((e,t)=>e+t.totalPrice),0)})))},style:{display:"inline-flex",alignItems:"center",justifyContent:"space-between",padding:"5px",border:h.find((t=>t.id===c.id&&e===t.k))||j[e].find((e=>e.id==a.priceId))&&(a.packageUmrahMealTypeMakkahId==c.id||a.packageUmrahMealTypeMadinahId==c.id)?"2px solid rgb(70, 103, 209)":"1px solid #ddd",borderRadius:"5px",margin:"2px",cursor:a&&"pointer"},children:[Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",marginRight:"10px"},children:[Object(he.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(he.jsx)(zn.d,{})," "]}),Object(he.jsxs)("span",{children:[c.designation,Object(he.jsx)("br",{}),Object(he.jsxs)("span",{style:{textTransform:"uppercase",color:"#888",fontWeight:"lighter"},children:[n.name," ",Object(he.jsx)("span",{style:{fontSize:"0.7em"},children:n.isMakkah?"Makkah":"Madinah"})]})]})]})," ",Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px",margin:"3px"},children:[c.totalPrice?Object(Qe.a)(c.totalPrice):Object(Qe.a)(n.duration*n.exchange*c.cost),Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})]})))})),Object(he.jsx)("hr",{}),Object(he.jsxs)("label",{children:[" ",Object(he.jsx)(Gt.a,{onChange:e=>{s((e=>({...e,withoutVisa:!e.withoutVisa,totalPrice:e.totalPrice-(e.withoutVisa?0:l)})))},checked:a.withoutVisa&&j[e].find((e=>e.id==a.priceId))})," ","Sans Visa"," ",a.withoutVisa&&j[e].find((e=>e.id==a.priceId))&&Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px",margin:"3px"},children:[Object(Qe.a)(a.totalPrice),Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})]})," ",Object(he.jsxs)("label",{children:[Object(he.jsx)(Gt.a,{onChange:e=>{s((e=>({...e,withoutTicket:!e.withoutTicket})))},checked:a.withoutTicket&&j[e].find((e=>e.id==a.priceId))}),"Sans Billet"]})]})]})))]})},Vn=e=>[{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((e=>[{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((e=>e.name)).join(" , "):"",style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:Object(Qe.a)(e.totatlPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:me()(e.date).format("DD MMM YYYY"),style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.services?we.u.filter((t=>e.services.findIndex((e=>e==t.value))>-1)).map((e=>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"}}}]))}],Hn=Object(I.b)({key:"PackageAtom",default:new La});var qn={extratsMainContainer:{display:"flex",flexDirection:"column"},conatainer:{display:"flex"},iconButton:{height:"42px"}};var Zn=e=>{var t,a,s;let{providers:c,fetchProviders:i,model:l,setModel:r}=e;const o=Object(I.d)(F),d=Object(I.d)(ce),[j,b]=Object(n.useState)((null===l||void 0===l||null===(t=l.extrats[0])||void 0===t?void 0:t.providerId)||0),[h,u]=Object(n.useState)((null===l||void 0===l||null===(a=l.extrats[0])||void 0===a?void 0:a.currencyId)||0),[p,m]=Object(n.useState)((null===l||void 0===l||null===(s=l.extrats[0])||void 0===s?void 0:s.exchange)||1),x=e=>{const t=l.extrats.map((t=>({...t,...e})));r((e=>({...e,extrats:t})))},O=(e,t,a)=>{const n=l.extrats.map(((n,s)=>s===e?{...n,[t]:"cost"===t?parseFloat(a):a}:n));r((e=>({...e,extrats:n})))},g=()=>{r((e=>({...e,extrats:[...e.extrats,new Fa]})))},f=e=>{const t=l.extrats.filter(((t,a)=>a!==e)).map((e=>e.service));return we.v.filter((e=>0===e.value||!t.includes(e.value)))},y=(e,t,a,n)=>{const s=n(a);s>=0&&O(e,t,s)};return Object(he.jsx)(he.Fragment,{children:Object(he.jsxs)("div",{style:qn.extratsMainContainer,children:[Object(he.jsx)("h6",{children:"Extrats"}),Object(he.jsxs)("div",{style:qn.conatainer,children:[Object(he.jsxs)(re.a,{className:"p-10",m:4,l:2.5,xl:1.8,children:[Object(he.jsxs)("label",{children:[z.supplier,":"]}),Object(he.jsx)(Fe.a,{onSearch:i,data:(e=>e.map((e=>({label:e.name,value:e.id}))))(c),block:!0,noSearch:!0,value:j,onSelect:e=>{b(e),x({providerId:e})}})]}),Object(he.jsxs)(re.a,{s:3,m:3,l:1.5,xl:1.5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.currency,":"]}),Object(he.jsx)(Fe.a,{data:(()=>{var e;const t=c.find((e=>e.id===j));return(null===t||void 0===t||null===(e=t.currencies)||void 0===e?void 0:e.map((e=>{let{currency:t}=e;return{label:t.name,value:t.id}})))||o.map((e=>({label:e.name,value:e.id})))})(),block:!0,noSearch:!0,value:h,onSelect:e=>{var t;u(e);const a=(null===(t=d.find((t=>t.currencySourceId===e)))||void 0===t?void 0:t.rate)||1;m(a),x({currencyId:e,exchange:a})}})]}),Object(he.jsxs)(re.a,{s:3,m:3,l:1.5,xl:.8,className:"p-10",children:[Object(he.jsx)("label",{children:"Cour:"}),Object(he.jsx)(de.a,{type:"number",value:p,disabled:!0})]})]}),l.extrats.map(((e,t)=>Object(he.jsxs)("div",{className:"fee-entry",style:{display:"flex"},children:[Object(he.jsxs)(re.a,{className:"p-10",m:4,l:2.5,xl:1.8,children:[Object(he.jsxs)("label",{children:[z.service,":"]}),Object(he.jsx)(Fe.a,{data:f(t),block:!0,noSearch:!0,value:e.service,onSelect:e=>{((e,t)=>{const a=l.extrats.map(((a,n)=>n===e?{...a,service:t,note:wa(t,"")}:a));r((e=>({...e,extrats:a})))})(t,e)}})]}),Object(he.jsxs)(re.a,{m:4,l:3,xl:3,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.designation,":"]}),Object(he.jsx)(de.a,{value:e.note,onChange:e=>O(t,"note",e),disabled:0!==e.service})]}),Object(he.jsxs)(re.a,{s:4,m:4,l:1.5,xl:1.5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.unitCost,":"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.unitCost,onChange:e=>y(t,"unitCost",e,parseFloat)})]}),Object(he.jsxs)(re.a,{s:4,m:4,l:1,xl:1,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.cost," ",z.TND,":"]}),Object(he.jsx)(de.a,{type:"text",value:Object(Qe.a)(e.unitCost*p),disabled:!0})]}),Object(he.jsxs)(re.a,{s:4,m:4,l:1.5,xl:1.5,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.unitCosts," :"]}),Object(he.jsx)(de.a,{type:"number",step:"0.1",min:"0",value:e.unitFee,onChange:e=>y(t,"unitFee",e,parseFloat)})]}),Object(he.jsxs)(re.a,{s:4,m:4,l:1,xl:1,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.costs," ",z.TND,":"]}),Object(he.jsx)(de.a,{type:"text",value:Object(Qe.a)(e.unitFee*p),disabled:!0})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:qn.iconButton,children:" "}),Object(he.jsx)(ze.a,{onClick:()=>(e=>{const t=l.extrats.filter(((t,a)=>a!==e));r((e=>({...e,extrats:t})))})(t),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),t+1===l.extrats.length&&Object(he.jsx)(ze.a,{onClick:g,color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},t)))]})})};var Jn=e=>{let{setModel:t,providers:a,fetchProviders:s,model:c}=e;const[i,l]=Object(n.useState)([]);Object(n.useEffect)((()=>{M.a.createAPIEndpoint(`${M.a.ENDPOINTS.Category}/GetFiltreData`,{isUmrah:!1}).fetchAll().then((e=>{l(e.data.categories)})).catch((e=>{console.log("e",e)}))}),[]);return Object(he.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[Object(he.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom :"}),Object(he.jsx)(de.a,{value:c.name,onChange:e=>t((t=>({...t,name:e.toUpperCase()})))})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Description :"}),Object(he.jsx)(de.a,{value:c.description,onChange:e=>t((t=>({...t,description:e})))})]}),Object(he.jsxs)(re.a,{s:4,m:3,l:2,xl:2,className:"p-10",children:[Object(he.jsxs)("label",{children:[z.categories," :"]}),Object(he.jsx)("div",{className:"p-2 font-sans",children:Object(he.jsx)(qa.a,{value:c.categoryIds||[],data:i.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,onChange:e=>{t((t=>({...t,categoryIds:e})))},placeholder:z.chooseCategories})})]})]}),Object(he.jsx)(Pa,{setCaracteristiques:e=>{t((t=>({...t,caracteristique:e})))},caracteristique:c.caracteristique||{},translations:we.d}),Object(he.jsx)(Zn,{providers:a,fetchProviders:s,model:c,setModel:t})]})};var $n={thead:{background:"rgb(70, 103, 209)",color:"#fff"},th:{padding:"5px 8px",textAlign:"left"},td:{padding:"5px 8px"}};var Xn=e=>{let{onPriceChange:t,onDeletePrice:a,onAddPrice:n,prices:s}=e;return Object(he.jsx)("div",{children:Object(he.jsxs)("table",{children:[Object(he.jsx)("thead",{style:$n.thead,children:Object(he.jsxs)("tr",{children:[Object(he.jsx)("th",{style:$n.th,children:z.hotel}),Object(he.jsx)("th",{style:$n.th,children:"Nom de l'arrangement"}),we.B.map((e=>Object(he.jsx)("th",{style:$n.th,children:e.label},e.value))),Object(he.jsx)("th",{style:$n.th,children:"Actions"})]})}),Object(he.jsx)("tbody",{children:Object.entries(s).map((e=>{let[s,c]=e;return Object.entries(c).map(((e,i)=>{let[l,r]=e;return Object(he.jsxs)("tr",{children:[Object(he.jsx)("td",{style:$n.td,children:Object(he.jsx)("h6",{children:s})}),Object(he.jsx)("td",{style:$n.td,children:Object(he.jsx)(de.a,{disabled:!0,value:l})}),we.B.map((e=>{var a;const n=(null===(a=r.find((t=>t.typeTraveler===e.value)))||void 0===a?void 0:a.price)||0;return Object(he.jsx)("td",{style:$n.td,children:Object(he.jsx)(de.a,{value:n,onChange:a=>t(s,l,e.value,"price",parseFloat(a))})},e.value)})),Object(he.jsxs)("td",{style:$n.td,children:[Object(he.jsx)(ze.a,{onClick:()=>a(s,l),color:"violet",icon:Object(he.jsx)(Nt.a,{})}),i===Object.entries(c).length-1&&Object.entries(c).length<6&&Object(he.jsx)(ze.a,{onClick:()=>n(s),color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]},`${s}-${l}-${i}`)}))}))})]})})};var Qn=e=>{let{model:t,setModel:a}=e;return Object(he.jsx)("div",{className:"p-10",children:Object(he.jsx)(Xn,{prices:(n=t.prices,n.reduce(((e,t)=>{const a=e[t.name]||{};return a[t.arrangementName]=a[t.arrangementName]||[],a[t.arrangementName].push(t),e[t.name]=a,e}),{})),onPriceChange:(e,n,s,c,i)=>{const l=t.prices.map((t=>t.name===e&&t.arrangementName===n&&t.typeTraveler===s?{...t,[c]:i}:t));a((e=>({...e,prices:l})))},onDeletePrice:(e,n)=>{const s=t.prices.filter((t=>!(t.name===e&&t.arrangementName===n)));a((e=>({...e,prices:s})))},onAddPrice:e=>{const n=t.destinations.flatMap((e=>e.hotelsVo)).find((t=>t.name===e));if(!n)return;const s=n.hotelListId,c=t.prices.filter((t=>t.name===e)).map((e=>e.arrangementName)),i=we.t.filter((e=>!c.includes(e.value))).flatMap((t=>we.B.map((a=>({name:e,price:0,typeTraveler:a.value,arrangementName:t.value,hotelListIds:[s],costs:[]})))));a((e=>({...e,prices:[...e.prices,...i]})))}})});var n};var es=e=>{let{error:t,providers:a,fetchProviders:s,isLoading:c}=e;const[i,l]=Object(n.useState)(0),[r,o]=Object(I.c)(Hn),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)([]),u=Object(I.d)(F),p=Object(I.d)(ce),[m,x]=Object(n.useState)([]),[O,g]=Object(n.useState)(""),[f,y]=Object(I.c)(an),[v,_]=Object(n.useState)([]),C=Object(n.useMemo)((()=>{var e;return(null===(e=r.destinations)||void 0===e?void 0:e.reduce(((e,t)=>e+t.nbrDay),0))||0}),[r.destinations]),N=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs+"/getAll",{isUmrah:!1,maxDay:C}).customGet().then((e=>{h(e.data.programs)}))}),[C]);Object(n.useEffect)((()=>{N()}),[N]);const E=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Pays,{}).customGet().then((e=>x(e.data)))}),[]);Object(n.useEffect)((()=>{E()}),[E]);const S=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.HotelList+"/HotelsByCity",{city:O}).customGet().then((e=>{y(e.data.hotels)}))}),[O]);Object(n.useEffect)((()=>{S()}),[S]);const D=Object(n.useCallback)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Excursion+"/getAll",{find:"Vo"}).customGet().then((e=>{_(e.data.excursions)}))}),[]);Object(n.useEffect)((()=>{D()}),[D]);const k=(e,t,a)=>0===a.id?(e=>e&&0!==e.length?e.flatMap((e=>e.hotelsVo.flatMap((e=>{const t=e.name,a=e.hotelListId;return we.t.flatMap((e=>we.B.map((n=>({name:t,price:0,typeTraveler:n.value,arrangementName:e.value,hotelListIds:[a],costs:[]})))))})))):[])(t):e.map((e=>{if(!e.hotelListIds||0===e.hotelListIds.length)return e;const a=t.flatMap((e=>e.hotelsVo)).find((t=>t.hotelListId&&e.hotelListIds.includes(t.hotelListId)));if(a){const t=a.name;return{...e,name:t,price:e.price}}return e}));Object(n.useEffect)((()=>{if(r.destinations&&r.destinations.length>0){const e=k(r.prices,r.destinations,r);o((t=>({...t,prices:e})))}}),[r.destinations]);const P={0:Object(he.jsx)(Jn,{setModel:o,providers:a,fetchProviders:s,model:r}),1:Object(he.jsx)(Va,{model:r,setModel:o,fetchProviders:s,providers:a,isUmrah:!1}),2:Object(he.jsx)(fn,{title:"Destination et H\xf4tels",providers:a,currencies:u,exchanges:p,fetchProviders:s,setModel:o,model:r,fetchPays:E,fetchHotels:S,hotelData:f||[],paysData:m||[],excursionData:v||[],isUmrah:!1,city:O,setCity:g}),3:Object(he.jsx)(wn,{setModel:o,programs:b||[],model:r,fetchPrograms:N}),4:Object(he.jsx)(Qn,{model:r,setModel:o}),5:Object(he.jsx)(dn,{model:r,setModel:o,state:d,setState:j})};return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)(ft.a,{current:i,style:Bn.steps,children:we.w.map(((e,t)=>Object(he.jsx)(ft.a.Item,{title:e,onClick:()=>l(t)},t)))}),c?Object(he.jsx)("div",{style:Bn.loader,children:Object(he.jsx)(Ca.a,{size:"lg"})}):P[i],t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",style:Bn.message,children:t}),Object(he.jsx)(yt.a,{})]})};function ts(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=(Object(I.d)(w),Object(n.useState)(0)),[r,o]=Object(n.useState)(!1),[d,j]=Object(n.useState)({page:1,take:20,date:null}),[b,h]=Object(n.useState)(""),[u,p]=Object(I.c)(Hn),[m,x]=Object(I.c)(Oe.a),O=()=>{p(new La),h("")},g=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>c(e.data)))},f=()=>{x((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Package,{...d,date:d.date?me()(d.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),x((e=>({...e,loading:!1}))),l(e.data.totalCount)})).catch((e=>{h(e.Message),x((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{g()}),[]),Object(n.useEffect)((()=>{f()}),[d.page,d.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>f(),children:Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Date : "}),Object(he.jsx)(de.a,{type:"date",value:d.date,onChange:e=>{j((t=>({...t,date:e})))}})]})}),Object(he.jsx)(ge.a,{ActionOnClose:O,excelData:Vn(t),nameExcel:"packages",size:"xl",save:()=>{var e;x((e=>({...e,loading:!0})));let t={...u};const a=new FormData;(null===t||void 0===t||null===(e=t.categoryIds)||void 0===e?void 0:e.length)||delete t.categoryIds,kn(a,t);const n=M.a.createAPIEndpoint(M.a.ENDPOINTS.Package);(t.id?n.update(t.id,a):n.create(a)).then((()=>{Te.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}),O(),x((e=>({...e,open:!1,loading:!1}))),f()})).catch((e=>{var t,a,n,s;x((e=>({...e,loading:!1}))),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},title:"Ajouter un voyage organis\xe9",AddComponent:Object(he.jsx)(es,{providers:s,fetchProviders:g,error:b,isLoading:r})}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{h(""),o(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.Package).fetchById(e).then((e=>{let t={...e.data};t.disponibilities&&(t.disponibilities=t.disponibilities.map((e=>({...e,date:e.date.substring(0,10)})))),p(t)})).catch((e=>{console.log(e)})).finally((()=>{o(!1)}))})(e),x((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Package).delete(e).then((()=>{f(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>{var t,a,n,s;h(e.Message),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},displayAction:(e,t)=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Package+"/UpdateIsDisplayed",{etat:!t}).update3(e,!t).then((e=>{f(),Te.a.fire("Updated !","","success")})).catch((e=>{var t,a,n,s;h(e.Message),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},actionKey:"id",display:"isDisplayed",noAdvancedActions:!0,columns:as,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:i,limitOptions:[10,20,50,100],limit:d.take,activePage:d.page,onChangePage:e=>{window.scrollTo(0,0),j((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),j((t=>({...t,take:e,page:1})))}})})]})}const as=[{value:"id",name:"Identifiant",render:e=>Object(he.jsx)("h5",{children:e})},{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e?e.toUpperCase():""})},{value:"description",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}];var ns=function(e){let{_setmodel:t,model:a,clients:s,fetchClients:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)(!1),[u,p]=Object(n.useState)(new Ke.a),[m,x]=Object(n.useState)(""),[O,g]=Object(n.useState)([]),[f,y]=Object(n.useState)(!1),v=Object(I.d)(le.a),_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;M.a.createAPIEndpoint(M.a.ENDPOINTS.Check,{q:e,clientId:t||a.clientId},"/autocomplete").customGet().then((e=>l(e.data.map((e=>({value:e.id,label:e.name}))))))},C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>o(e.data.map((e=>({value:e.id,label:e.name}))))))};return Object(n.useEffect)((()=>{_(),C(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>j(e.data.map((e=>({value:e.id,label:e.name}))))))}()}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Point de recouvrement:"}),Object(he.jsx)(Fe.a,{noSearch:!0,data:v,block:!0,value:a.recoveryPointId,onSelect:e=>{t((t=>({...t,recoveryPointId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Service : "}),Object(he.jsx)(Fe.a,{data:we.u,block:!0,noSearch:!0,value:a.service,onSelect:e=>{t((t=>({...t,service:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Client:"}),Object(he.jsx)(Fe.a,{onSearch:e=>c(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:a.clientId,onSelect:e=>{_("",e),t((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:a.amount,onChange:e=>{t((t=>({...t,amount:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Type De Paiment : "}),Object(he.jsx)(Fe.a,{data:we.s,block:!0,noSearch:!0,value:a.type,onSelect:e=>{t((t=>{let a={...t};return 1!=e&&delete a.checkId,2!=e&&delete a.checkoutId,4!=e&&delete a.bankId,{...a,type:e}}))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date:"}),Object(he.jsx)(de.a,{type:"date",value:a.date,onChange:e=>{t((t=>({...t,date:e})))}})]}),Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(he.jsx)(de.a,{value:a.refReglement,onChange:e=>{t((t=>({...t,refReglement:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(he.jsx)("label",{children:"Notes:"}),Object(he.jsx)(de.a,{value:a.notes,onChange:e=>{t((t=>({...t,notes:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:1==a.type?"Ch\xe9que":4==a.type?"Banque":"Caisse"}),Object(he.jsxs)("div",{style:{display:"inline-block",width:1==a.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(he.jsx)(Fe.a,{renderMenuItem:e=>Object(he.jsxs)(he.Fragment,{children:[e.split(" ")[0],Object(he.jsx)("span",{style:{paddingLeft:"8px",color:"#aaa",fontSize:"12px"},children:e.split(" ")[1]})]}),block:!0,data:1==a.type?i:4==a.type?r:d,noSearch:!0,value:a[1==a.type?"checkId":4==a.type?"bankId":"checkoutId"],onSearch:e=>_(e),onSelect:e=>{t((t=>({...t,[1==a.type?"checkId":4==a.type?"bankId":"checkoutId"]:e})))}})]}),1==a.type&&Object(he.jsx)(ze.a,{size:"sm",onClick:()=>h(!0),icon:Object(he.jsx)(Ge.a,{})})]}),4==a.type&&Object(he.jsxs)(re.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(he.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(he.jsx)(de.a,{value:a.EmissionBank,onChange:e=>{t((t=>({...t,EmissionBank:e})))}})]}),b&&1==a.type&&Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)(We.a,{_delete:e=>{let t=O.findIndex((t=>t.fileKey==e));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(O[t].name).then((e=>{g((e=>{let a=[...e];return a.splice(t),a}));let a=[...u.attachments];a.splice(t),p((e=>({...u,attachments:a})))})).catch((e=>{}))},upload:(e,t,a)=>{y(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(t).then((t=>{y(!1);let n=e.findIndex((e=>e.fileKey==a));g((t=>{let a=[...e];return a[n].status="finished",a}));let s=[...u.attachments];s.push(t.data[0].fileName),p((e=>({...u,attachments:s})))})).catch((t=>{y(!1);let n=e.findIndex((e=>e.fileKey==a));g((t=>{let a=[...e];return a[n].status="error",a}))}))},error:m,model:{...u,amount:Number(u.amount),attachments:u.attachments&&u.attachments.join(),clientId:a.clientId,recoveryPointId:a.recoveryPointId},banks:r,fetchBanks:C,_setmodel:p}),Object(he.jsx)(je.a,{onClick:()=>{let e=Object(Be.a)(u,[{number:"Num\xe9ro"},{amount:"Montant"}]);e?x(e):M.a.createAPIEndpoint(M.a.ENDPOINTS.Check+"/CreateFromRecov").create({...u,amount:Number(u.amount),attachments:u.attachments&&u.attachments.join(),clientId:a.clientId}).then((e=>{console.log(e),t((t=>({...t,checkId:e.data.id}))),_(u.number),p(new Ke.a),x(""),h(!1),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{x(e.response.data),console.log(e.response.data)}))},appearance:"primary",children:"Enregistrer"})]})]})};function ss(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)({q:"",page:1,take:20}),[d,j]=Object(n.useState)(""),[b,h]=Object(n.useState)(new Xe),[u,p]=Object(I.c)(Oe.a),m=()=>{h(new Xe),j("")},x=()=>{p((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment,r).fetchAll().then((e=>{a(e.data.data),p((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))}))};Object(n.useEffect)((()=>{x()}),[r.page,r.take]);return Object(n.useEffect)((()=>{x()}),[r.page,r.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>x(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{o((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{nameExcel:"payments",size:"md",save:()=>{let e=Object(Be.a)(b,[{clientId:"Client"},{amount:"Montant"}]);e?j(e):(p((e=>({...e,loading:!0}))),b.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).update(b.id,{...b,amount:Number(b.amount)}).then((e=>{x(),p((e=>({...e,open:!1,loading:!1}))),m(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).create({...b,amount:Number(b.amount)}).then((e=>{x(),m(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),p((e=>({...e,open:!1,loading:!1})))})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})))},ActionOnClose:m,AddComponent:Object(he.jsx)(ns,{clients:i,fetchClients:function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))},error:d,model:b,_setmodel:h})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).fetchById(e).then((e=>{h(e.data),e.data.client&&l([e.data.client])}))})(e),p((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).delete(e).then((e=>{x(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>j(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:cs,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:r.take,activePage:r.page,onChangePage:e=>{window.scrollTo(0,0),o((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),o((t=>({...t,take:e,page:1})))}})})]})}const cs=[{value:"id",name:"Identifiant",render:e=>Object(he.jsx)("h5",{children:e})},{value:"account",name:"Client",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():"-"})},{value:"amount",name:"Montant",render:e=>Object(he.jsx)("b",{children:e.toFixed(3)})},{value:"date",name:"Date de D\xe9p\xf4t",render:e=>Object(he.jsx)("h6",{style:{fontSize:"12px"},children:me()(e).format("DD MMM YYYY")})},{value:"type",name:"Type",render:e=>Object(he.jsx)(Ae.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:we.s.find((t=>t.value==e)).label})},{value:"check",name:"N\xb0 Ch\xe9que",render:e=>Object(he.jsx)("b",{children:e||"-"})},{value:"checkout",name:"Caisse",render:e=>Object(he.jsx)("b",{children:e||"-"})},{name:"Virement",value:"depositBank",value2:"emissionBank",render:(e,t)=>Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("b",{children:t?Object(he.jsxs)(he.Fragment,{children:[" ",t," ",Object(he.jsx)(qe.a,{})]}):"-"})," ",Object(he.jsx)("b",{children:e||"-"})]})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}];var is=function(e){let{_setmodel:t,model:a,providers:s,fetchproviders:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)(!1),[u,p]=Object(n.useState)(new Ke.a),[m,x]=Object(n.useState)(""),[O,g]=Object(n.useState)([]),[f,y]=Object(n.useState)(!1),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;M.a.createAPIEndpoint(M.a.ENDPOINTS.Check,{q:e,providerId:t||a.providerId},"/autocomplete").customGet().then((e=>l(e.data.map((e=>({value:e.id,label:e.name}))))))},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>o(e.data.map((e=>({value:e.id,label:e.name}))))))};return Object(n.useEffect)((()=>{v(),_(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>j(e.data.map((e=>({value:e.id,label:e.name}))))))}()}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Provider:"}),Object(he.jsx)(Fe.a,{onSearch:e=>c(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:a.providerId,onSelect:e=>{v("",e),t((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:a.amount,onChange:e=>{t((t=>({...t,amount:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Type De Paiment : "}),Object(he.jsx)(Fe.a,{data:we.s,block:!0,noSearch:!0,value:a.type,onSelect:e=>{t((t=>{let a={...t};return 1!=e&&delete a.checkId,2!=e&&delete a.checkoutId,4!=e&&delete a.bankId,{...a,type:e}}))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date:"}),Object(he.jsx)(de.a,{type:"date",value:a.date,onChange:e=>{t((t=>({...t,date:e})))}})]}),Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(he.jsx)(de.a,{value:a.refReglement,onChange:e=>{t((t=>({...t,refReglement:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(he.jsx)("label",{children:"Notes:"}),Object(he.jsx)(de.a,{value:a.notes,onChange:e=>{t((t=>({...t,notes:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:1==a.type?"Ch\xe9que":4==a.type?"Banque":"Caisse"}),Object(he.jsxs)("div",{style:{display:"inline-block",width:1==a.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(he.jsx)(Fe.a,{renderMenuItem:e=>Object(he.jsxs)(he.Fragment,{children:[e.split(" ")[0],Object(he.jsx)("span",{style:{paddingLeft:"8px",color:"#aaa",fontSize:"12px"},children:e.split(" ")[1]})]}),block:!0,data:1==a.type?i:4==a.type?r:d,noSearch:!0,value:a[1==a.type?"checkId":4==a.type?"bankId":"checkoutId"],onSearch:e=>v(e),onSelect:e=>{t((t=>({...t,[1==a.type?"checkId":4==a.type?"bankId":"checkoutId"]:e})))}})]}),1==a.type&&Object(he.jsx)(ze.a,{size:"sm",onClick:()=>h(!0),icon:Object(he.jsx)(Ge.a,{})})]}),4==a.type&&Object(he.jsxs)(re.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(he.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(he.jsx)(de.a,{value:a.EmissionBank,onChange:e=>{t((t=>({...t,EmissionBank:e})))}})]}),b&&1==a.type&&Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)(We.a,{_delete:e=>{let t=O.findIndex((t=>t.fileKey==e));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(O[t].name).then((e=>{g((e=>{let a=[...e];return a.splice(t),a}));let a=[...u.attachments];a.splice(t),p((e=>({...u,attachments:a})))})).catch((e=>{}))},upload:(e,t,a)=>{y(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(t).then((t=>{y(!1);let n=e.findIndex((e=>e.fileKey==a));g((t=>{let a=[...e];return a[n].status="finished",a}));let s=[...u.attachments];s.push(t.data[0].fileName),p((e=>({...u,attachments:s})))})).catch((t=>{y(!1);let n=e.findIndex((e=>e.fileKey==a));g((t=>{let a=[...e];return a[n].status="error",a}))}))},error:m,model:u,banks:r,fetchBanks:_,_setmodel:p}),Object(he.jsx)(je.a,{onClick:()=>{let e=Object(Be.a)(u,[{number:"Num\xe9ro"},{amount:"Montant"},{date:"Date de D\xe9p\xf4t"}]);e?x(e):M.a.createAPIEndpoint(M.a.ENDPOINTS.Check).create({...u,amount:parseFloat(u.amount),attachments:u.attachments&&u.attachments.join(),providerId:a.providerId}).then((e=>{console.log(e),t((t=>({...t,checkId:e.data.id}))),v(u.number),p(new Ke.a),x(""),h(!1),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{x(e.response.data),console.log(e.response.data)}))},appearance:"primary",children:"Enregistrer"})]})]})};function ls(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)({q:"",page:1,take:20}),[d,j]=Object(n.useState)(""),[b,h]=Object(n.useState)(new At),[u,p]=Object(I.c)(Oe.a),m=()=>{h(new At),j("")},x=()=>{p((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment,r,"/getPaymentsProvider").customGet().then((e=>{a(e.data.data),p((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{x()}),[r.page,r.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>x(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{o((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{nameExcel:"payments",size:"md",save:()=>{let e=Object(Be.a)(b,[{providerId:"Fournisseur"},{amount:"Montant"}]);e?j(e):(p((e=>({...e,loading:!0}))),b.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).update(b.id,{...b,amount:Number(b.amount)}).then((e=>{x(),p((e=>({...e,open:!1,loading:!1}))),m(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).create({...b,amount:Number(b.amount)}).then((e=>{x(),m(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),p((e=>({...e,open:!1,loading:!1})))})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})))},ActionOnClose:m,AddComponent:Object(he.jsx)(is,{providers:i,fetchproviders:function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))},error:d,model:b,_setmodel:h})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).fetchById(e).then((e=>{h(e.data),e.data.provider&&l([e.data.provider])}))})(e),p((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Payment).delete(e).then((e=>{x(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>j(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:rs,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:r.take,activePage:r.page,onChangePage:e=>{window.scrollTo(0,0),o((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),o((t=>({...t,take:e,page:1})))}})})]})}const rs=[{value:"id",name:"Identifiant",render:e=>Object(he.jsx)("h5",{children:e})},{value:"account",name:"Fournisseur",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():"-"})},{value:"amount",name:"Montant",render:e=>Object(he.jsx)("b",{children:e.toFixed(3)})},{value:"date",name:"Date de D\xe9p\xf4t",render:e=>Object(he.jsx)("h6",{style:{fontSize:"12px"},children:me()(e).format("DD MMM YYYY")})},{value:"type",name:"Type",render:e=>Object(he.jsx)(Ae.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:we.s.find((t=>t.value==e)).label})},{value:"check",name:"N\xb0 Ch\xe9que",render:e=>Object(he.jsx)("b",{children:e||"-"})},{value:"checkout",name:"Caisse",render:e=>Object(he.jsx)("b",{children:e||"-"})},{name:"Virement",value:"depositBank",value2:"emissionBank",render:(e,t)=>Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("b",{children:t?Object(he.jsxs)(he.Fragment,{children:[" ",t," ",Object(he.jsx)(qe.a,{})]}):"-"})," ",Object(he.jsx)("b",{children:e||"-"})]})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}];var os=a(1201);const ds={verticalAlign:"top"};var js=function(e){let{error:t,clients:a,banks:s,fetchBanks:c,fetchClients:i,checkouts:l,fetchCheckouts:r,providers:o,fetchProviders:d,agentBookingFlights:j,fetchTags:b,tags:h}=e;const[u,p]=Object(n.useState)(0);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:u,style:ds,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>p(0)}),Object(he.jsx)(ft.a.Item,{title:"Services Achet\xe9es",onClick:()=>p(1)}),Object(he.jsx)(ft.a.Item,{onClick:()=>p(2),title:"Encaissement"}),Object(he.jsx)(ft.a.Item,{title:"Attachments",onClick:()=>p(3)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:u?1==u?Object(he.jsx)(hs,{agentBookingFlights:j}):2==u?Object(he.jsx)(ms,{}):Object(he.jsx)(xs,{}):Object(he.jsx)(bs,{fetchProviders:d,providers:o,tags:h,fetchTags:b})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const bs=e=>{let{providers:t,fetchProviders:a,tags:s,fetchTags:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(I.c)(Mt),d=Object(I.d)(F);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Fournisseur: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:r.providerId,onSelect:e=>{o((t=>({...t,providerId:e})))}}),Object(he.jsx)("label",{children:"Date D'Achat': "}),Object(he.jsx)(de.a,{type:"date",value:r.date,onChange:e=>{console.log(e),o((t=>({...t,date:e})))}}),Object(he.jsx)("label",{children:"Mots Cl\xe9s: "}),Object(he.jsx)(os.a,{data:s?s.map((e=>({label:e.name,value:e.id}))):[],block:!0,onSearch:c,onSelect:e=>{let t=i.filter((t=>e.find((e=>e==t.id)))),a=s.filter((t=>e.find((e=>e==t.id))&&!i.find((e=>e.id==t.id))));l((e=>[...t,...a])),o((e=>({...e,tags:[...t,...a]})))}}),Object(he.jsx)("label",{children:"Devise: "}),Object(he.jsx)(Fe.a,{data:d.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:r.currencyId,onSelect:e=>{o((t=>({...t,currencyId:e})))}})]})},hs=e=>{let{}=e;const[t,a]=Object(I.c)(Mt),[s,c]=Object(n.useState)(new Pt);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Service : "}),Object(he.jsx)(Fe.a,{data:we.u,block:!0,noSearch:!0,value:s.service,onSelect:e=>{c((t=>({...t,service:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Co\xfbt Unitaire:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:s.unitCost,onChange:e=>{c((t=>({...t,unitCost:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission Unitaire:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:s.unitFee,onChange:e=>{c((t=>({...t,unitFee:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Quantit\xe9:"}),Object(he.jsx)(de.a,{type:"number",step:"1",value:s.qty,onChange:e=>{c((t=>({...t,qty:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission ( % ):"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:s.commission,onChange:e=>{c((t=>({...t,commission:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Co\xfbt Total:"}),Object(he.jsxs)("div",{children:[" ",Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(s.commission)/100)*parseInt(s.qty)*(parseFloat(s.unitFee)+parseFloat(s.unitCost))).toFixed(3)})]})]}),Object(he.jsx)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"D\xe9signation:"}),Object(he.jsx)(de.a,{as:"textarea",rows:2,placeholder:"Notes"})]})}),Object(he.jsx)(yt.a,{}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsx)(ze.a,{onClick:()=>{a((e=>{console.log(e);let t={...e};if("object"!=typeof t.package.packageItems&&(t.package.packageItems=[]),"number"==typeof s.index){let e=[...t.package.packageItems];e[s.index]=s,t.package={...t.package,packageItems:e}}else{let e=[...t.package.packageItems];e.push(s),t.package={...t.package,packageItems:e}}return t})),c(new Pt)},color:"violet",icon:Object(he.jsx)(d.a,{}),children:"Ajouter"})}),Object(he.jsx)(yt.a,{}),Object(he.jsx)(ye.a,{editAction:e=>{c({...t.package.packageItems[e],index:e})},deleteAction:e=>{a((t=>{let a={...t},n=[...a.package.packageItems];return n.splice(e,1),a.package={...a.package,packageItems:n},a}))},actionKey:"index",noAdvancedActions:!0,columns:us,rows:t.package.packageItems.map(((e,t)=>({...e,index:t})))}),Object(he.jsxs)("h5",{children:["Cout Total:"," ",Object(he.jsx)("i",{children:us.reduce(((e,t)=>e+parseInt(t.qty)*(1+parseFloat(t.commission)/100)*(parseFloat(t.unitFee)+parseFloat(t.unitCost))),0)})]})]})},us=[{value:"service",name:"Service",render:e=>Object(he.jsxs)("b",{children:[Object(he.jsx)("a",{children:we.u.find((t=>t.value==e)).label})," ",Object(he.jsx)("br",{})]})},{value:"commission",value2:"unitFee",value3:"unitCost",value4:"qty",name:"Co\xfbt Total",render:(e,t,a,n)=>Object(he.jsx)("b",{children:(parseInt(n)*(1+parseFloat(e)/100)*(parseFloat(t)+parseFloat(a))).toFixed(3)})}],ps=[{value:"amount",name:"Montant",render:e=>Object(he.jsx)("b",{children:e})},{value:"type",name:"Type",render:e=>Object(he.jsx)(Ae.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:we.s.find((t=>t.value==e))&&we.s.find((t=>t.value==e)).label})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e})}],ms=()=>{const[e,t]=Object(n.useState)([]),[a,s]=Object(I.c)(Mt),[c,i]=Object(n.useState)([]),[l,r]=Object(n.useState)([]),[o,j]=Object(n.useState)(!1),[b,h]=Object(n.useState)(new Ke.a),[u,p]=Object(n.useState)(""),[m,x]=Object(n.useState)([]),[O,g]=Object(n.useState)(!1),[f,y]=Object(n.useState)(new At),v=()=>{y(new At)},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>i(e.data.map((e=>({value:e.id,label:e.name}))))))};return Object(n.useEffect)((()=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Check,{q:e},"/autocomplete").customGet().then((e=>t(e.data.map((e=>({value:e.id,label:e.name}))))))}(),_(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>r(e.data.map((e=>({value:e.id,label:e.name}))))))}()}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.02)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:f.amount,onChange:e=>{y((t=>({...t,amount:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Type De Paiment : "}),Object(he.jsx)(Fe.a,{data:we.s,block:!0,noSearch:!0,value:f.type,onSelect:e=>{y((t=>({...t,type:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Date:"}),Object(he.jsx)(de.a,{type:"date",value:a.date,onChange:e=>{y((t=>({...t,date:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"R\xe9f R\xe9glement:"}),Object(he.jsx)(de.a,{value:f.refReglement,onChange:e=>{y((t=>({...t,refReglement:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:9,xl:9,className:"p-10",children:[Object(he.jsx)("label",{children:"Notes:"}),Object(he.jsx)(de.a,{value:f.notes,onChange:e=>{y((t=>({...t,notes:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:1==f.type?"Ch\xe9que":4==f.type?"Banque":"Caisse"}),Object(he.jsxs)("div",{style:{display:"inline-block",width:1==f.type?"calc(100% - 40px)":"100%",paddingRight:"5px"},children:[" ",Object(he.jsx)(Fe.a,{block:!0,data:1==f.type?e:4==f.type?c:l,noSearch:!0,value:f[1==f.type?"checkId":4==f.type?"bankId":"checkoutId"],onSelect:e=>{y((t=>({...t,[1==f.type?"checkId":4==f.type?"bankId":"checkoutId"]:e})))}})]}),1==f.type&&Object(he.jsx)(ze.a,{size:"sm",onClick:()=>j(!0),icon:Object(he.jsx)(Ge.a,{})})]}),4==f.type&&Object(he.jsxs)(re.a,{s:6,m:6,l:10,xl:10,className:"p-10",children:[Object(he.jsx)("label",{children:"Banque d'\xe9mission :"}),Object(he.jsx)(de.a,{value:f.EmissionBank,onChange:e=>{y((t=>({...t,EmissionBank:e})))}})]}),o&&1==f.type&&Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)(We.a,{_delete:e=>{let t=m.findIndex((t=>t.fileKey==e));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(m[t].name).then((e=>{x((e=>{let a=[...e];return a.splice(t),a}));let a=[...b.attachments];a.splice(t),h((e=>({...b,attachments:a})))})).catch((e=>{}))},upload:(e,t,a)=>{g(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(t).then((t=>{g(!1);let n=e.findIndex((e=>e.fileKey==a));x((t=>{let a=[...e];return a[n].status="finished",a}));let s=[...b.attachments];s.push(t.data[0].fileName),h((e=>({...b,attachments:s})))})).catch((t=>{g(!1);let n=e.findIndex((e=>e.fileKey==a));x((t=>{let a=[...e];return a[n].status="error",a}))}))},error:u,model:b,banks:c,fetchBanks:_,_setmodel:h}),Object(he.jsx)(je.a,{onClick:()=>{let e=Object(Be.a)(b,[{number:"Num\xe9ro"},{status:"Status"},{amount:"Montant"},{depositDate:"Date de D\xe9p\xf4t"}]);e?p(e):(t((e=>[{value:-1,label:b.number+"("+(c.find((e=>e.value==b.depositBankId))?c.find((e=>e.value==b.depositBankId)).label:"")+")"},...e])),y((e=>({...e,check:{...b,amount:parseFloat(b.amount),attachments:b.attachments&&b.attachments.join(),clientId:a.clientId},checkId:-1}))),h(new Ke.a),p(""),j(!1))},appearance:"primary",children:"Enregistrer"})]}),Object(he.jsx)(yt.a,{}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsx)(Se.a,{children:Object(he.jsx)(ze.a,{onClick:()=>{s((e=>{console.log(e);let t={...e};if("object"!=typeof t.payments&&(t.payments=[]),"number"==typeof f.index){let e=[...t.payments];e[f.index]=f,t.payments=[...e]}else{let e=[...t.payments];e.push(f),t.payments=[...e]}return t})),v()},appearance:"primary",color:"blue",icon:Object(he.jsx)(d.a,{}),children:"Ajouter"})})})]}),Object(he.jsx)(yt.a,{}),Object(he.jsx)(ye.a,{editAction:e=>{y({...a.payments[e],index:e})},deleteAction:e=>{s((t=>{let a={...t},n=[...a.payments];return n.splice(e,1),a.payments=[...n],a})),v()},actionKey:"index",noAdvancedActions:!0,columns:ps,rows:a.payments?a.payments.map(((e,t)=>({...e,index:t}))):[]})]})},xs=()=>{const[e,t]=Object(I.c)(_t),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(!1);return Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsx)(vt.a,{loading:c,autoUpload:!1,fileList:a,action:"#",draggable:!0,onRemove:n=>(n=>{let c=a.findIndex((e=>e.fileKey==n));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(e.attachments[c].name).then((a=>{s((e=>{let t=[...e];return t.splice(c),t}));let n=[...e.attachments];n.splice(c),t((t=>({...e,attachments:n})))})).catch((e=>{}))})(n.fileKey),onChange:a=>{console.log(a);let n=a.filter((e=>"finished"!=e.status)).reverse()[0];n&&((a,n,c)=>{i(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(n).then((n=>{i(!1);let l=a.findIndex((e=>e.fileKey==c));s((e=>{let t=[...a];return t[l].status="finished",t}));let r=[...e.attachments];r.push({name:n.data[0].fileName}),t((t=>({...e,attachments:r})))})).catch((e=>{i(!1);let t=a.findIndex((e=>e.fileKey==c));s((e=>{let n=[...a];return n[t].status="error",n}))}))})(a,n.blobFile,n.fileKey)},children:Object(he.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(he.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(he.jsx)(St.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),c&&Object(he.jsx)(he.Fragment,{})]})};function Os(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)(0),[u,p]=Object(n.useState)({page:1,take:20,providerId:0,status:0,date:null}),[m,x]=Object(n.useState)(""),[O,g]=Object(I.c)(Mt),[f,y]=Object(I.c)(Oe.a),v=()=>{g(new Dt),x("")},_=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>c(e.data)))},C=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))},N=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete").customGet().then((e=>j(e.data)))},E=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((e=>o(e.data)))},S=()=>{y((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Purchase,{...u,date:u.date?me()(u.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),y((e=>({...e,loading:!1}))),h(e.data.totalCount)})).catch((e=>{x(e.Message),y((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{S(),_(),C(),E(),N()}),[]),Object(n.useEffect)((()=>{S()}),[u.page,u.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>S(),children:[Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Provider: "}),Object(he.jsx)(Fe.a,{onSearch:e=>N(e),data:[{label:"Tout",value:0}].concat(d.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:u.providerId,onSelect:e=>{p((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Status du Paiement: "}),Object(he.jsx)(Fe.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(we.j),block:!0,noSearch:!0,value:u.status,onSelect:e=>{p((t=>({...t,status:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Tags: "}),Object(he.jsx)(Fe.a,{onSearch:E,data:[{label:"Tout",value:0}].concat(r.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:u.tagId,onSelect:e=>{p((t=>({...t,tagId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Date du Vente: "}),Object(he.jsx)(de.a,{type:"date",value:u.date,onChange:e=>{p((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{nameExcel:"sale",size:"lg",save:()=>{console.log(O),y((e=>({...e,loading:!0})));let e={...O,tagPurchases:O.tags.map((e=>({tagId:e.id}))),package:{...O.package,packageItems:O.package.packageItems.map((e=>({...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:[...O.payments.map((e=>({...e,amount:parseFloat(e.amount),date:e.date?e.date:new Date,providerId:O.providerId})))],attachments:O.attachments?O.attachments.map((e=>e.name)).join():""};delete e.tags,O.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Purchase).update(e.id,e).then((e=>{S(),y((e=>({...e,open:!1,loading:!1}))),v(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{x(e.Message),y((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Purchase).create(e).then((e=>{S(),v(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),y((e=>({...e,open:!1,loading:!1})))})).catch((e=>{x(e.Message),y((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(js,{checkouts:i,tags:r,fetchCheckouts:C,fetchTags:E,providers:d,fetchProviders:N,error:m,banks:s,fetchBanks:_})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{x(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Purchase).fetchById(e).then((e=>{g({...e.data,depositDate:new Date(e.data.depositDate)})})).catch((e=>{console.log(e)}))})(e),y((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Purchase).delete(e).then((e=>{S(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>x(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:gs,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:b,limitOptions:[10,20,50,100],limit:u.take,activePage:u.page,onChangePage:e=>{window.scrollTo(0,0),p((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),p((t=>({...t,take:e,page:1})))}})})]})}const gs=[{value:"provider",name:"Fournisseur",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})},{value:"tags",name:"Tags",render:e=>Object(he.jsx)(he.Fragment,{children:e&&e.map((e=>Object(he.jsx)(Ae.a,{children:e.name})))})},{value:"totatlCost",value2:"currency",name:"Prix Total",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})},{value:"date",name:"Date",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}];var fs=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Designation:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,designation:e})))},value:n.designation}),Object(he.jsx)("label",{children:"jours :"}),Object(he.jsx)("input",{style:{display:"block"},value:n.days,onChange:e=>{t((t=>({...t,days:e.target.value})))}}),Object(he.jsx)("br",{}),Object(he.jsx)("label",{htmlFor:"monthSelect",children:" Mois: "}),Object(he.jsxs)("select",{id:"monthSelect",value:n.month,onChange:e=>{t((t=>({...t,month:e.target.value})))},children:[Object(he.jsx)("option",{value:"",children:"Select"}),Object(he.jsx)("option",{value:"0",children:"Ce Mois"}),Object(he.jsx)("option",{value:"1",children:"Mois Prochain"})]}),Object(he.jsx)("br",{}),Object(he.jsxs)("label",{children:[" ","Genre : male",Object(he.jsx)("br",{})," ",Object(he.jsx)("input",{type:"checkbox",onChange:e=>{t((e=>({...e,isMale:!0})))},checked:1==n.isMale})]}),Object(he.jsx)("br",{}),Object(he.jsxs)("label",{children:[" ","Genre female :",Object(he.jsx)("br",{})," ",Object(he.jsx)("input",{type:"checkbox",onChange:e=>{t((e=>({...e,isMale:!1})))},checked:0==n.isMale})]}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};class ys{constructor(){this.date=new Date}}const vs=Object(I.b)({key:"rawdhasAtoms",default:[]});function _s(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(!1),[i,l]=Object(n.useState)(0),[r,o]=Object(I.c)(vs),[d,j]=Object(n.useState)(0),[b,h]=Object(n.useState)(0),[u,p]=Object(n.useState)([]),[m,x]=Object(n.useState)(!1),[O,g]=Object(I.c)(oe),[y,v]=Object(n.useState)({q:"",page:1,take:50,date:null}),[_,C]=Object(n.useState)(""),[N,E]=Object(n.useState)(new ys),[S,D]=Object(n.useState)(0),[k,P]=Object(I.c)(Oe.a),A=()=>{E(new ys),C("")},T=()=>{P((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Rawdha,y).fetchAll().then((e=>{a(e.data.data),P((e=>({...e,loading:!1}))),j(e.data.totalCount)})).catch((e=>{C(e.Message),P((e=>({...e,loading:!1})))})),M.a.createAPIEndpoint(M.a.ENDPOINTS.Rawdha,{page:1,take:1e3,q:""}).fetchAll().then((e=>{o(e.data.data)})).catch((e=>{}))};Object(n.useEffect)((()=>{T()}),[y.page,y.take]),Object(n.useEffect)((()=>{i&&U()}),[i]);const w=[{value:"designation",name:"Designation",render:e=>Object(he.jsx)("b",{style:{fontSize:"18px"},children:e})},{value:"date",name:"DATE",render:e=>Object(he.jsx)("b",{children:e?e.substring(0,10):e})},{value:"date",name:"Temps",render:e=>Object(he.jsx)("b",{children:e?e.substring(11,16):e})},{value:"id",name:"DETAILS",render:e=>Object(he.jsx)(je.a,{appearance:"ghost",color:"blue",onClick:()=>{c(!0),l(e)},children:"D\xe9tails"})},{value:"id",name:"-",render:e=>Object(he.jsx)(je.a,{loading:S==e&&m,appearance:"primary",color:"orange",onClick:()=>{B(e),D(e)},children:"envoyer"})}],B=async e=>{console.log("rawdha"),x(!0);let t=r.find((t=>t.id==e)),a={passportNumbers:""};console.log(a.passportNumbers),a.month=t.month,a.days=t.days,a.isMale=t.isMale,a.designation=t.designation,a.user="nusk1031",a.password="nusk_1031#",f.a.post("http://localhost:8733/rawdha",a).then((t=>{console.log(t),t.data.Erreur?B(e):alert("success")})),x(!1)},R=()=>{p([]),l(0),c(!1)},U=()=>{M.a.createAPIEndpoint(be.a.Order+"/Umrah",{page:1,take:1e4,rawdhaId:i}).customGet().then((e=>p(e.data.data.filter((e=>e)).map(((e,t)=>({...e,index:t+1}))))))};return Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>T(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{v((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"P\xe9riode: "}),Object(he.jsx)(ia.a,{placement:"bottomStart",value:y.date,onChange:e=>v((t=>({...t,date:e}))),onSelect:e=>v((t=>({...t,date:e}))),block:!0})]})]}),Object(he.jsx)(ge.a,{noExport:!0,size:"md",save:()=>{P((e=>({...e,loading:!0}))),N.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Rawdha).update(N.id,N).then((e=>{T(),P((e=>({...e,open:!1,loading:!1}))),A(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{C(e.Message),P((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Rawdha).create(N).then((e=>{T(),A(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),P((e=>({...e,open:!1,loading:!1})))})).catch((e=>{C(e.Message),P((e=>({...e,loading:!1})))}))},AddComponent:Object(he.jsx)(fs,{error:_,model:N,_setmodel:E})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{C(""),E(t.find((t=>t.id==e)))})(e),P((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Rawdha).delete(e).then((e=>{T(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>C(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:w,rows:t}),Object(he.jsxs)("div",{style:{padding:20,background:"#fff"},children:[Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:d,limitOptions:[10,20,50,100],limit:y.take,activePage:y.page,onChangePage:e=>{window.scrollTo(0,0),v((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),v((t=>({...t,take:e,page:1})))}}),Object(he.jsxs)(at.a,{size:"lg",overflow:!1,style:{maxHeight:"calc(100vh - 50px)",overflow:"auto",maxWidth:"100vw"},open:s,onClose:()=>{R()},children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"Rawdha D\xe9tails"})}),Object(he.jsx)(at.a.Body,{children:Object(he.jsx)("div",{style:{maxHeight:"calc(100vh - 240px)",overflow:"auto",maxWidth:"100vw"},children:Object(he.jsx)(ye.a,{columns:Cs,rows:u})})}),Object(he.jsx)(at.a.Footer,{children:Object(he.jsx)(je.a,{onClick:()=>{R()},appearance:"subtle",children:"Annuler"})})]})]})]})}const Cs=[{value:"codeMoufa",value2:"errorMessage",render:(e,t)=>Object(he.jsx)("span",{style:{content:"",width:"10px",height:"50px",background:e||"Success"==t?"green":t?"red":"orange",display:"block"}})},{value:"index",name:"-",render:e=>Object(he.jsx)("b",{style:{fontSize:"20px"},children:e})},{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(he.jsx)("i",{style:{color:"#999",fontSize:"14px",fontWeight:"lighter"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#444"},children:e.firstNameAr+" "+e.lastNameAr})]})]})},{name:"Rawdha",value:"isRawdhaSent",render:e=>Object(he.jsx)(Ae.a,{color:e?"blue":"orange",children:e?"oui":"non"})}];function Is(){const[e,t]=Object(n.useState)([]),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)({disponibilityId:0,page:1,take:1e3}),[l,r]=Object(n.useState)(0),[o,d]=Object(n.useState)([]),[j,b]=Object(n.useState)([]),[h,u]=Object(n.useState)(0),[p,m]=Object(n.useState)(null);function x(e){e.preventDefault()}function O(e,t){e.dataTransfer.setData("pilgrim",t),m(j.find((e=>e.id==t)))}function g(e,t){var n=e.dataTransfer.getData("pilgrim");let s="[data-id='"+n+"']",c=[...j],i=c.findIndex((e=>e.id==p.id)),l={...c[i]},r=e.target.getAttribute("data-id"),o=e.target.getAttribute("data-type");if(r&&c.find((e=>e.id==r))&&!c.find((e=>e.id==r)).roomId){document.querySelector("#__root").appendChild(document.querySelector(s)),l.roomId=0,c[i]=l,b(c)}else{if(r)return!1;if("__root"!=e.target.id||r){if(!(o&&p.price&&o==p.price.arrangementMakkahDesignation&&j.filter((e=>e.roomId==t)).lengthe.id==t)).nbr))return!1;console.log(a.find((e=>e.id==t)).nbr),console.log(j.filter((e=>e.roomId==t)).length),e.target.appendChild(document.querySelector(s)),l.roomId=t,c[i]=l,b(c)}else e.target.appendChild(document.querySelector(s)),l.roomId=0,c[i]=l,b(c)}}Object(n.useEffect)((()=>{var e;("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{let a=e.data.reduce(((e,t)=>e.concat(t.disponibilities)),[]);t(a.filter((e=>e.onStock)))}))}),[]),Object(n.useEffect)((()=>{let e=document.querySelector("#__root");j.filter((e=>e.roomId)).map((t=>{let a="[data-id='"+t.id+"']";e.appendChild(document.querySelector(a))})),c.disponibilityId&&(async()=>{let e=[],t=await Object(rt.a)(be.a.Rooming+"/GetRooming",{disponibilityId:c.disponibilityId}).fetch();u(t.data.id),s(t.data.rooms||[]),e=t.data.rooms?[...t.data.rooms]:[],console.log(t.data);let a=await M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah",{...c}).fetchAll();b(a.data.data.map((t=>{delete t.PackageUmrah;let a=e.find((e=>(console.log(e.orderUmrahIds.split(",").includes(t.id+"")),e.orderUmrahIds&&e.orderUmrahIds.split(",").includes(t.id+"")))),n={...t};return a&&(n.roomId=a.id,console.log(n)),n})))})()}),[c.disponibilityId]),Object(n.useEffect)((()=>{setTimeout((()=>{console.log("tetst"),j.filter((e=>e.roomId)).map((e=>{console.log(e.roomId);let t="[data-roomId='"+e.roomId+"']",a=document.querySelector(t),n="[data-id='"+e.id+"']";a.appendChild(document.querySelector(n))}))}),500)}),[j.length]);return Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{m:4,l:4,xl:4,children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(e?e.map((e=>({label:Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),value:e.id}))):[]),block:!0,noSearch:!0,value:c.disponibilityId,onSelect:e=>{i((t=>({...t,disponibilityId:e})))}}),Object(he.jsx)("div",{style:{borderBottom:"1px solid #eee",textTransform:"uppercase",fontWeight:"lighter",color:"#232323"},className:"p-5",children:"Liste Des P\xe9l\xe9rins :"}),Object(he.jsx)("div",{style:{width:"100%",overflowY:"auto"},children:Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(he.jsx)("button",{onClick:()=>{r(0)},style:{background:l?"#fff":"#232323",color:l?"#232323":"#fff",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Tout"}),Object(he.jsx)("button",{onClick:()=>{r(2)},style:{background:2!=l?"#fff":"#232323",color:2==l?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Double"}),Object(he.jsx)("button",{onClick:()=>{r(3)},style:{background:3!=l?"#fff":"#232323",color:3==l?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Triple"}),Object(he.jsx)("button",{onClick:()=>{r(4)},style:{background:4!=l?"#fff":"#232323",color:4==l?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Quad"})]})}),Object(he.jsx)("div",{id:"__root",onDrop:e=>g(e,null,!0),onDragOver:x,style:{height:"calc(100vh - 100px)",overflowY:"auto",background:"#fff",borderRadius:"5px"},children:j.map(((e,t)=>Object(he.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||!l||e.price&&(4==l&&e.price.arrangementMakkahDesignation.includes("quad")||3==l&&e.price.arrangementMakkahDesignation.includes("triple")||2==l&&e.price.arrangementMakkahDesignation.includes("double"))?"5px":"0",display:"flex",alignItems:"center",height:e.roomId||!l||e.price&&(4==l&&e.price.arrangementMakkahDesignation.includes("quad")||3==l&&e.price.arrangementMakkahDesignation.includes("triple")||2==l&&e.price.arrangementMakkahDesignation.includes("double"))?"unset":"0",overflow:"hidden"},"data-id":e.id,onDragStart:t=>O(t,e.id),onTouchStart:t=>O(t,e.id),children:[e.customer.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{className:"non_drop",style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{className:"non_drop",style:{paddingLeft:"5px",fontSize:"12px"},children:[e?e.customer.name.toUpperCase():"",Object(he.jsx)("br",{}),Object(he.jsx)(Ae.a,{size:"xs",color:1==e.customer.gender?"green":"red",children:Object(he.jsx)("b",{style:{fontSize:"11px",padding:"0 6px"},children:e?e.customer.passportNumber:""})}),Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[Object(he.jsx)(zn.c,{color:"rgb(191,155,48)",fontWeight:"lighter",size:"20px"})," ",Object(he.jsxs)("p",{children:[Object(he.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(he.jsxs)(re.a,{m:8,l:8,xl:8,className:"p-5",children:[Object(he.jsx)("div",{style:{textAlign:"right",padding:"10px"},children:Object(he.jsx)(je.a,{appearance:"primary",color:"blue",onClick:()=>{let e={disponibilityId:c.disponibilityId};e.rooms=a.map((e=>{let t={...e,orderUmrahIds:j.filter((t=>t.roomId==e.id))?j.filter((t=>t.roomId==e.id)).map((e=>e.id)).join(","):""};return delete t.id,t})),console.log(e),h?Object(rt.a)(be.a.Rooming).update2({id:h,...e}).then((e=>console.log(e.data))):Object(rt.a)(be.a.Rooming).create(e).then((e=>console.log(e.data)))},children:"Enregistrer"})}),Object(he.jsxs)("div",{style:{background:"#fff",borderRadius:"10px",border:"1px solid #ddd",minHeight:"500px",maxHeight:"90vh",overflowY:"auto"},className:"p-5",children:[Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-5",children:[a.filter((e=>4==e.nbr)).map((e=>Object(he.jsx)("div",{style:{background:"#fff",minHeight:o.find((t=>t==e.id))?"240px":"60px",maxHeight:o.find((t=>t==e.id))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:j.filter((t=>t.roomId==e.id)).lengtht==e.id))?"50px":"5px"},onDrop:t=>g(t,e.id),onDragOver:x,"data-type":"Chambre quadruple","data-roomId":e.id,children:Object(he.jsxs)("div",{style:{position:"absolute",top:"5px",right:"5px"},children:[Object(he.jsx)(ze.a,{appearance:"primary",color:"red",onClick:()=>{let t=document.querySelector("#__root"),a=[...j];a.map((a=>{if(a.roomId==e.id){let e={...a};a.roomId=0;let n="[data-id='"+a.id+"']";return t.appendChild(document.querySelector(n)),e}return a})),b(a),s((t=>t.filter((t=>t.id!=e.id))))},icon:Object(he.jsx)(Nt.a,{}),circle:!0}),Object(he.jsx)("button",{className:"button_icon",onClick:()=>{let t=[...o];t.find((t=>t==e.id))?d(t.filter((t=>t!=e.id))):d((t=>[...t,e.id]))},children:o.find((t=>t==e.id))?Object(he.jsx)(y.b,{}):Object(he.jsx)(y.a,{})})]})}))),Object(he.jsxs)("button",{onClick:()=>{let e=Date.now();d((t=>[...t,e])),s((t=>t.concat([{nbr:4,id:e,draft:!0}])))},className:"adda_room ",style:{backgroundColor:"rgb(98,118,171)",borderRadius:"5px"},children:[Object(he.jsx)(Ge.a,{}),"Quad"]})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-5",children:[a.filter((e=>3==e.nbr)).map((e=>Object(he.jsxs)("div",{style:{background:"#fff",minHeight:o.find((t=>t==e.id))?"180px":"60px",maxHeight:o.find((t=>t==e.id))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:j.filter((t=>t.roomId==e.id)).lengtht==e.id))?"50px":"5px"},"data-type":"Chambre triple","data-roomId":e.id,onDrop:t=>g(t,e.id),onDragOver:x,children:[" ",Object(he.jsxs)("div",{style:{position:"absolute",top:"5px",right:"5px"},children:[Object(he.jsx)(ze.a,{appearance:"primary",color:"red",onClick:()=>{let t=document.querySelector("#__root"),a=[...j];a.map((a=>{if(a.roomId==e.id){let e={...a};a.roomId=0;let n="[data-id='"+a.id+"']";return t.appendChild(document.querySelector(n)),e}return a})),b(a),s((t=>t.filter((t=>t.id!=e.id))))},icon:Object(he.jsx)(Nt.a,{}),circle:!0}),Object(he.jsx)("button",{className:"button_icon",onClick:()=>{let t=[...o];t.find((t=>t==e.id))?d(t.filter((t=>t!=e.id))):d((t=>[...t,e.id]))},children:o.find((t=>t==e.id))?Object(he.jsx)(y.b,{}):Object(he.jsx)(y.a,{})})]})]}))),Object(he.jsxs)("button",{onClick:()=>{let e=Date.now();d((t=>[...t,e])),s((t=>t.concat([{nbr:3,id:e,draft:!0}])))},className:"adda_room ",style:{backgroundColor:"rgb(252,179,34)",borderRadius:"5px"},children:[Object(he.jsx)(Ge.a,{}),"Triple"]})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-5",children:[a.filter((e=>2==e.nbr)).map((e=>Object(he.jsxs)("div",{style:{background:"#fff",minHeight:o.find((t=>t==e.id))?"120px":"60px",maxHeight:o.find((t=>t==e.id))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:j.filter((t=>t.roomId==e.id)).lengtht==e.id))?"50px":"5px"},onDrop:t=>g(t,e.id),"data-roomId":e.id,"data-type":"Chambre double",onDragOver:x,children:[" ",Object(he.jsxs)("div",{style:{position:"absolute",top:"5px",right:"5px"},children:[Object(he.jsx)(ze.a,{appearance:"primary",color:"red",onClick:()=>{let t=document.querySelector("#__root"),a=[...j];a.map((a=>{if(a.roomId==e.id){let e={...a};a.roomId=0;let n="[data-id='"+a.id+"']";return t.appendChild(document.querySelector(n)),e}return a})),b(a),s((t=>t.filter((t=>t.id!=e.id))))},icon:Object(he.jsx)(Nt.a,{}),circle:!0})," ",Object(he.jsx)("button",{className:"button_icon",onClick:()=>{let t=[...o];t.find((t=>t==e.id))?d(t.filter((t=>t!=e.id))):d((t=>[...t,e.id]))},children:o.find((t=>t==e.id))?Object(he.jsx)(y.b,{}):Object(he.jsx)(y.a,{})})]})]}))),Object(he.jsxs)("button",{onClick:()=>{let e=Date.now();d((t=>[...t,e])),s((t=>t.concat([{nbr:2,id:e,draft:!0}])))},className:"adda_room ",style:{backgroundColor:"green",borderRadius:"5px"},children:[Object(he.jsx)(Ge.a,{}),"double"]})]})]})]}),Object(he.jsx)("style",{jxs:!0,children:"button.adda_room {\n display:flex; align-items:center; justify-content:space-between;\n width:100%; color:#fff\n } "})]})}function Ns(){const[e,t]=Object(n.useState)([]),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)({disponibilityId:0,page:1,take:1e3}),[l,r]=Object(n.useState)(0),[o,d]=Object(n.useState)([]),[j,b]=Object(n.useState)([]),[h,u]=Object(n.useState)(0);Object(n.useEffect)((()=>{var e;("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{let a=e.data.reduce(((e,t)=>e.concat(t.disponibilities)),[]);t(a.filter((e=>e.onStock)))}))}),[]),Object(n.useEffect)((()=>{c.disponibilityId&&(async()=>{let e=[],t=await Object(rt.a)(be.a.Rooming+"/GetRooming",{disponibilityId:c.disponibilityId}).fetch();u(t.data.id),s(t.data.rooms||[]),e=t.data.rooms?[...t.data.rooms]:[],console.log(t.data);let a=await M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah",{...c}).fetchAll();b(a.data.data.map((t=>{delete t.PackageUmrah;let a=e.find((e=>(console.log(e.orderUmrahIds.split(",").includes(t.id+"")),e.orderUmrahIds&&e.orderUmrahIds.split(",").includes(t.id+"")))),n={...t};return a&&(n.roomId=a.id,console.log(n)),n})))})()}),[c.disponibilityId]);const p=(e,t)=>Object(he.jsxs)("div",{style:{width:"calc(100% - 0px)"},children:[" ",Object(he.jsx)(Fe.a,{block:!0,disabled:j.filter((t=>t.roomId==e)).length==t,data:[{label:"S\xe9l\xe9ctionner",value:0}].concat(j?j.filter((e=>!e.roomId&&e.price&&("Chambre quadruple"==e.price.arrangementMakkahDesignation?4:"Chambre triple"==e.price.arrangementMakkahDesignation?3:2)==t)).map((e=>({label:Object(he.jsxs)("div",{style:{color:"#232323",display:"flex"},children:[e.customer.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{className:"non_drop",style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{className:"non_drop",style:{paddingLeft:"5px",fontSize:"12px"},children:[e?e.customer.name.toUpperCase():"",Object(he.jsx)("br",{}),Object(he.jsx)(Ae.a,{size:"xs",color:1==e.customer.gender?"green":"red",children:Object(he.jsx)("b",{style:{fontSize:"11px",padding:"0 6px"},children:e?e.customer.passportNumber:""})}),Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[Object(he.jsx)(zn.c,{color:"rgb(191,155,48)",fontWeight:"lighter",size:"20px"})," ",Object(he.jsxs)("p",{children:[Object(he.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:t=>{b((a=>[...a].map((a=>{let n={...a};return a.id==t&&(n.roomId=e),n}))))}})]}),m=(e,t)=>Object(he.jsx)("div",{style:{paddingTop:t?"50px":"0"},children:e.map(((e,a)=>Object(he.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||!l||e.price&&(4==l&&e.price.arrangementMakkahDesignation.includes("quad")||3==l&&e.price.arrangementMakkahDesignation.includes("triple")||2==l&&e.price.arrangementMakkahDesignation.includes("double"))?"5px":"0",display:"flex",alignItems:"center",position:"relative",height:e.roomId||!l||e.price&&(4==l&&e.price.arrangementMakkahDesignation.includes("quad")||3==l&&e.price.arrangementMakkahDesignation.includes("triple")||2==l&&e.price.arrangementMakkahDesignation.includes("double"))?"unset":"0",overflow:"hidden"},"data-id":e.id,children:[t&&Object(he.jsx)("button",{className:"button_icon",style:{position:"absolute",top:"10px",right:0},onClick:()=>{b((t=>[...t].map((t=>{let a={...t};return t.id==e.id&&(a.roomId=0),a}))))},children:"-"}),e.customer.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{className:"non_drop",style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{className:"non_drop",style:{paddingLeft:"5px",fontSize:"12px"},children:[e?e.customer.name.toUpperCase():"",Object(he.jsx)("br",{}),Object(he.jsx)(Ae.a,{size:"xs",color:1==e.customer.gender?"green":"red",children:Object(he.jsx)("b",{style:{fontSize:"11px",padding:"0 6px"},children:e?e.customer.passportNumber:""})}),Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[Object(he.jsx)(zn.c,{color:"rgb(191,155,48)",fontWeight:"lighter",size:"20px"})," ",Object(he.jsxs)("p",{children:[Object(he.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(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{m:4,l:4,xl:4,children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(e?e.map((e=>({label:Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),value:e.id}))):[]),block:!0,noSearch:!0,value:c.disponibilityId,onSelect:e=>{i((t=>({...t,disponibilityId:e})))}}),Object(he.jsx)("div",{style:{borderBottom:"1px solid #eee",textTransform:"uppercase",fontWeight:"lighter",color:"#232323"},className:"p-5",children:"Liste Des P\xe9l\xe9rins :"}),Object(he.jsx)("div",{style:{width:"100%",overflowY:"auto"},children:Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(he.jsx)("button",{onClick:()=>{r(0)},style:{background:l?"#fff":"#232323",color:l?"#232323":"#fff",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Tout"}),Object(he.jsx)("button",{onClick:()=>{r(2)},style:{background:2!=l?"#fff":"#232323",color:2==l?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Double"}),Object(he.jsx)("button",{onClick:()=>{r(3)},style:{background:3!=l?"#fff":"#232323",color:3==l?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Triple"}),Object(he.jsx)("button",{onClick:()=>{r(4)},style:{background:4!=l?"#fff":"#232323",color:4==l?"#fff":"#232323",border:"1px solid #232323",padding:"4px 15px",borderRadius:"60px",margin:"5px"},children:"Quad"})]})}),Object(he.jsx)("div",{id:"__root",style:{height:"calc(100vh - 100px)",overflowY:"auto",background:"#fff",borderRadius:"5px"},children:m(j.filter((e=>!e.roomId)))})]}),Object(he.jsxs)(re.a,{m:8,l:8,xl:8,className:"p-5",children:[Object(he.jsx)("div",{style:{textAlign:"right",padding:"10px"},children:Object(he.jsx)(je.a,{appearance:"primary",color:"blue",onClick:()=>{let e={disponibilityId:c.disponibilityId};e.rooms=a.map((e=>{let t={...e,orderUmrahIds:j.filter((t=>t.roomId==e.id))?j.filter((t=>t.roomId==e.id)).map((e=>e.id)).join(","):""};return delete t.id,t})),console.log(e),h?Object(rt.a)(be.a.Rooming).update2({id:h,...e}).then((e=>console.log(e.data))):Object(rt.a)(be.a.Rooming).create(e).then((e=>console.log(e.data)))},children:"Enregistrer"})}),Object(he.jsxs)("div",{style:{background:"#fff",borderRadius:"10px",border:"1px solid #ddd",minHeight:"500px",maxHeight:"90vh",overflowY:"auto"},className:"p-5",children:[Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-5",children:[a.filter((e=>4==e.nbr)).map((e=>Object(he.jsxs)("div",{style:{background:"#fff",minHeight:o.find((t=>t==e.id))?"240px":"60px",maxHeight:o.find((t=>t==e.id))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:j.filter((t=>t.roomId==e.id)).lengtht==e.id))?"50px":"5px"},"data-type":"Chambre quadruple","data-roomId":e.id,children:[Object(he.jsxs)("div",{style:{position:"absolute",top:"5px",right:"5px",width:"100%",display:"flex"},children:[p(e.id,4),Object(he.jsx)(ze.a,{appearance:"primary",color:"red",onClick:()=>{let t=[...j];t.map((t=>{if(t.roomId==e.id){let e={...t};return e.roomId=0,e}return t})),b(t),s((t=>t.filter((t=>t.id!=e.id))))},icon:Object(he.jsx)(Nt.a,{}),circle:!0}),Object(he.jsx)("button",{className:"button_icon",onClick:()=>{let t=[...o];t.find((t=>t==e.id))?d(t.filter((t=>t!=e.id))):d((t=>[...t,e.id]))},children:o.find((t=>t==e.id))?Object(he.jsx)(y.b,{}):Object(he.jsx)(y.a,{})})]}),m(j.filter((t=>t.roomId==e.id)),4),Object(he.jsxs)("div",{style:{background:"#b2b2b2",padding:"8px"},children:[Object(he.jsx)("label",{children:"R\xe9ference"}),Object(he.jsx)(de.a,{block:!0,value:e.reference,onChange:t=>{s((a=>[...a].map((a=>{let n={...a};return n.id==e.id&&(n.reference=t),n}))))}})]})]}))),Object(he.jsxs)("button",{onClick:()=>{let e=Date.now();d((t=>[...t,e])),s((t=>t.concat([{nbr:4,id:e,draft:!0}])))},className:"adda_room ",style:{backgroundColor:"rgb(98,118,171)",borderRadius:"5px"},children:[Object(he.jsx)(Ge.a,{}),"Quad"]})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-5",children:[a.filter((e=>3==e.nbr)).map((e=>Object(he.jsxs)("div",{style:{background:"#fff",minHeight:o.find((t=>t==e.id))?"180px":"60px",maxHeight:o.find((t=>t==e.id))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:j.filter((t=>t.roomId==e.id)).lengtht==e.id))?"50px":"5px"},"data-type":"Chambre triple","data-roomId":e.id,children:[Object(he.jsxs)("div",{style:{position:"absolute",top:"5px",right:"5px",width:"100%",display:"flex"},children:[p(e.id,3),Object(he.jsx)(ze.a,{appearance:"primary",color:"red",onClick:()=>{let t=[...j];t.map((t=>{if(t.roomId==e.id){let e={...t};return e.roomId=0,e}return t})),b(t),s((t=>t.filter((t=>t.id!=e.id))))},icon:Object(he.jsx)(Nt.a,{}),circle:!0}),Object(he.jsx)("button",{className:"button_icon",onClick:()=>{let t=[...o];t.find((t=>t==e.id))?d(t.filter((t=>t!=e.id))):d((t=>[...t,e.id]))},children:o.find((t=>t==e.id))?Object(he.jsx)(y.b,{}):Object(he.jsx)(y.a,{})})]}),m(j.filter((t=>t.roomId==e.id)),3),Object(he.jsxs)("div",{style:{background:"#b2b2b2",padding:"8px"},children:[Object(he.jsx)("label",{children:"R\xe9ference"}),Object(he.jsx)(de.a,{block:!0,value:e.reference,onChange:t=>{s((a=>[...a].map((a=>{let n={...a};return n.id==e.id&&(n.reference=t),n}))))}})]})]}))),Object(he.jsxs)("button",{onClick:()=>{let e=Date.now();d((t=>[...t,e])),s((t=>t.concat([{nbr:3,id:e,draft:!0}])))},className:"adda_room ",style:{backgroundColor:"rgb(252,179,34)",borderRadius:"5px"},children:[Object(he.jsx)(Ge.a,{}),"Triple"]})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-5",children:[a.filter((e=>2==e.nbr)).map((e=>Object(he.jsxs)("div",{style:{background:"#fff",minHeight:o.find((t=>t==e.id))?"120px":"60px",maxHeight:o.find((t=>t==e.id))?"":"70px",overflow:"hidden",verticalAlign:"top",borderRadius:"5px",margin:"5px 0",position:"relative",border:"1px dashed rgb(98,118,171)",paddingBottom:j.filter((t=>t.roomId==e.id)).lengtht==e.id))?"50px":"5px"},"data-roomId":e.id,"data-type":"Chambre double",children:[Object(he.jsxs)("div",{style:{position:"absolute",top:"5px",right:"5px",width:"100%",display:"flex"},children:[p(e.id,2),Object(he.jsx)(ze.a,{appearance:"primary",color:"red",onClick:()=>{let t=[...j];t.map((t=>{if(t.roomId==e.id){let e={...t};return e.roomId=0,e}return t})),b(t),s((t=>t.filter((t=>t.id!=e.id))))},icon:Object(he.jsx)(Nt.a,{}),circle:!0}),Object(he.jsx)("button",{className:"button_icon",onClick:()=>{let t=[...o];t.find((t=>t==e.id))?d(t.filter((t=>t!=e.id))):d((t=>[...t,e.id]))},children:o.find((t=>t==e.id))?Object(he.jsx)(y.b,{}):Object(he.jsx)(y.a,{})})]}),m(j.filter((t=>t.roomId==e.id)),2),Object(he.jsxs)("div",{style:{background:"#b2b2b2",padding:"8px"},children:[Object(he.jsx)("label",{children:"R\xe9ference"}),Object(he.jsx)(de.a,{block:!0,value:e.reference,onChange:t=>{s((a=>[...a].map((a=>{let n={...a};return n.id==e.id&&(n.reference=t),n}))))}})]})]}))),Object(he.jsxs)("button",{onClick:()=>{let e=Date.now();d((t=>[...t,e])),s((t=>t.concat([{nbr:2,id:e,draft:!0}])))},className:"adda_room ",style:{backgroundColor:"green",borderRadius:"5px"},children:[Object(he.jsx)(Ge.a,{}),"double"]})]})]})]}),Object(he.jsx)("style",{jxs:!0,children:"button.adda_room {\n display:flex; align-items:center; justify-content:space-between;\n width:100%; color:#fff\n } "})]})}var Es=a(133),Ss=a.n(Es);const Ds={verticalAlign:"top"};var ks=function(e){let{error:t,clients:a,fetchClients:s,providers:c,fetchProviders:i,fetchTags:l,tags:r}=e;const[o,d]=Object(n.useState)(0),[j,b]=Object(I.c)(_t);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:o,style:Ds,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>d(0)}),Object(he.jsx)(ft.a.Item,{title:"D\xe9tails",onClick:()=>d(1)}),Object(he.jsx)(ft.a.Item,{title:"Attachments",onClick:()=>d(2)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:o?1==o?Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fournisseur : "}),Object(he.jsx)(Fe.a,{onSearch:e=>i(e),data:c.map((e=>({label:e.name,value:e.id}))),block:!0,value:j.providerId,noSearch:!0,onSelect:e=>{c.find((t=>t.id==e));b((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Service : "}),Object(he.jsx)(Fe.a,{data:we.u.filter((e=>![1,2,6,7,4].includes(e.value))),block:!0,noSearch:!0,value:j.service,onSelect:e=>{b((t=>({...t,service:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.fare,onChange:e=>{b((t=>({...t,fare:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.commission,onChange:e=>{b((t=>({...t,commission:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix De Vente:"}),Object(he.jsx)("div",{children:Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(j.commissionPercent)/100)*(parseFloat(j.commission)+parseFloat(j.fare))).toFixed(3)})})]}),Object(he.jsxs)("div",{style:{background:"rgba(0,143,150,0.1)",padding:"10px",borderRadius:"5px"},children:[Object(he.jsx)("label",{children:"D\xe9signation:"}),Object(he.jsx)(de.a,{as:"textarea",rows:2,value:j.note,onChange:e=>{b({...j,note:e})},placeholder:"Notes"}),Object(he.jsx)("label",{children:"Client B2C:"}),Object(he.jsxs)(re.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Complet:"}),Object(he.jsx)(de.a,{value:j.customer.name,onChange:e=>{let t={...j.customer};t.name=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Type : "}),Object(he.jsx)(Fe.a,{data:we.a,block:!0,noSearch:!0,value:j.customer.ageType,onChange:e=>{let t={...j.customer};t.ageType=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Genre : "}),Object(he.jsx)(Fe.a,{data:we.h,block:!0,noSearch:!0,value:j.customer.gender,onChange:e=>{let t={...j.customer};t.gender=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:10,m:4.4,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"\xc2ge:"}),Object(he.jsx)(de.a,{type:"number",value:j.customer.age,onChange:e=>{let t={...j.customer};console.log(parseInt(e)),t.age=parseInt(e),b({...j,customer:t})}})]})]})]}):Object(he.jsx)(As,{}):Object(he.jsx)(Ps,{fetchClients:s,clients:a,tags:r,fetchTags:l})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const Ps=e=>{let{clients:t,fetchClients:a,tags:s,fetchTags:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(I.c)(_t),d=Object(I.d)(F);return Object(n.useEffect)((()=>{d&&d.length&&!r.currencyId&&o((e=>({...r,currencyId:d[0].id})))}),[r.clientId]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:r.clientId,onSelect:e=>{o((t=>({...t,clientId:e})))}}),Object(he.jsx)("label",{children:"Date De vente: "}),Object(he.jsx)(de.a,{type:"date",value:r.date,defaultValue:r.date,onChange:e=>{console.log(e),o((t=>({...t,date:e})))}}),Object(he.jsx)("label",{children:"Devise: "}),Object(he.jsx)(Fe.a,{data:d.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:r.currencyId,onSelect:e=>{o((t=>({...t,currencyId:e})))}})]})},As=()=>{const[e,t]=Object(I.c)(_t),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(!1);return Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsx)(vt.a,{loading:c,autoUpload:!1,fileList:a,action:"#",draggable:!0,onRemove:n=>(n=>{let c=a.findIndex((e=>e.fileKey==n));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(e.attachments[c].name).then((a=>{s((e=>{let t=[...e];return t.splice(c),t}));let n=[...e.attachments];n.splice(c),t((t=>({...e,attachments:n})))})).catch((e=>{}))})(n.fileKey),onChange:a=>{console.log(a);let n=a.filter((e=>"finished"!=e.status)).reverse()[0];n&&((a,n,c)=>{i(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(n).then((n=>{i(!1);let l=a.findIndex((e=>e.fileKey==c));s((e=>{let t=[...a];return t[l].status="finished",t}));let r=[...e.attachments];r.push({name:n.data[0].fileName}),t((t=>({...e,attachments:r})))})).catch((e=>{i(!1);let t=a.findIndex((e=>e.fileKey==c));s((e=>{let n=[...a];return n[t].status="error",n}))}))})(a,n.blobFile,n.fileKey)},children:Object(he.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(he.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(he.jsx)(St.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),c&&Object(he.jsx)(he.Fragment,{})]})};function Ms(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=(Object(I.d)(w),Object(n.useState)(0)),[u,p]=Object(n.useState)(0),[m,x]=Object(n.useState)(0),[O,g]=Object(n.useState)(0),[f,y]=Object(n.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),[v,_]=Object(n.useState)([]),[C,N]=Object(n.useState)(""),[E,S]=Object(I.c)(_t),[D,k]=Object(I.c)(Oe.a),P=()=>{S(new $e),N("")},A=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},T=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>j(e.data)))},B=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((e=>o(e.data)))},R=()=>{k((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order,{...f,date:f.date?me()(f.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),k((e=>({...e,loading:!1}))),h(e.data.totalCount),p(e.data.totalSale),x(e.data.totalRefund),g(e.data.totalCommission)})).catch((e=>N(e.Message)))},U=[{value2:"client",value:"id",name:"Client",render:(e,t)=>Object(he.jsx)("b",{children:t?t.name.toUpperCase():""})},{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})]})},{value:"totalPrice",value2:"currency",name:"Prix Total",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e&&e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t&&t.code})]})},{value:"commission",value2:"currency",name:"Commission",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#2f1a4c",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t&&t.code})]})},{value:"date",name:"Date",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})},{value:"note",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}];return Object(n.useEffect)((()=>{R(),A(),B(),T()}),[]),Object(n.useEffect)((()=>{R()}),[f.page,f.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>{R()},children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>A(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:f.clientId,onSelect:e=>{y((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date du Vente: "}),Object(he.jsx)(de.a,{type:"date",value:f.date,onChange:e=>{y((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{nameExcel:"vente",size:"lg",save:()=>{console.log(E),k((e=>({...e,loading:!0})));let e={...E,attachments:E.attachments?E.attachments.map((e=>e.name)).join():"",date:E.date?E.date:new Date};delete e.tags,e.totalPrice=(1+parseFloat(e.commissionPercent)/100)*(parseFloat(e.commission)+parseFloat(e.fare)),E.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).update(e.id,e).then((e=>{R(),k((e=>({...e,open:!1,loading:!1}))),P(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{N(e.Message),k((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).create(e).then((e=>{R(),P(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((e=>({...e,open:!1,loading:!1})))})).catch((e=>{N(e.Message),k((e=>({...e,loading:!1})))})))},ActionOnClose:P,AddComponent:Object(he.jsx)(ks,{tags:r,fetchTags:B,providers:d,fetchProviders:T,error:C,clients:i,fetchClients:e=>A(e,!1)})}),Object(he.jsxs)("div",{children:[Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{icon:Object(he.jsx)(Kn.c,{}),notAmount:!0,text:"Nbre de Vente",color:"245,195,35",amount:b})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Vente",color:"0,169,141",amount:u})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Remboursement",amount:m,color:"229,57,53"})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Commission",amount:O})})]}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{N(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).fetchById(e).then((e=>{if(e.data.client&&!i.find((t=>t.id==e.data.client.id))){let t=[...i];t.unshift({id:e.data.client.id,name:e.data.client.name}),l(t)}S({...e.data,date:e.data.date?e.data.date.substring(0,10):new Date})})).catch((e=>{console.log(e)}))})(e),k((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).delete(e).then((e=>{R(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>N(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:U,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:b,limitOptions:[10,20,50,100],limit:f.take,activePage:f.page,onChangePage:e=>{window.scrollTo(0,0),y((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),y((t=>({...t,take:e,page:1})))}})})]})}class Ts{constructor(){this.date=new Date,this.customer=new Je,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 ws}}class ws{constructor(){this.guests=[new Je],this.hotelName="",this.board="",this.checkIn=new Date,this.checkOut=new Date}}const Bs=Object(I.b)({key:"SaleHostingState",default:new Ts});class Rs{constructor(){this.date=new Date,this.customer=new Je,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 Us}}class Us{constructor(){this.items=[new Ls]}}class Ls{constructor(){this.departDate=new Date,this.arrivalDate=new Date,this.departCity="",this.arrivalCity="",this.driverName=""}}const Fs=new I.b({default:new Rs,key:"SaleBusState"}),zs={verticalAlign:"top"};var Ks=function(e){let{error:t,clients:a,fetchClients:s,providers:c,fetchProviders:i,fetchTags:l,tags:r}=e;const[o,d]=Object(n.useState)(0),[j,b]=Object(I.c)(Fs);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:o,style:zs,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>d(0)}),Object(he.jsx)(ft.a.Item,{title:"D\xe9tails",onClick:()=>d(1)}),Object(he.jsx)(ft.a.Item,{title:"Attachments",onClick:()=>d(3)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:o?1==o?Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fournisseur : "}),Object(he.jsx)(Fe.a,{onSearch:e=>i(e),data:c.map((e=>({label:e.name,value:e.id}))),block:!0,value:j.providerId,noSearch:!0,onSelect:e=>{c.find((t=>t.id==e));b((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.fare,onChange:e=>{b((t=>({...t,fare:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.commission,onChange:e=>{b((t=>({...t,commission:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission ( % ):"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.commissionPercent,onChange:e=>{b((t=>({...t,commissionPercent:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix De Vente:"}),Object(he.jsx)("div",{children:Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(j.commissionPercent)/100)*(parseFloat(j.commission)+parseFloat(j.fare))).toFixed(3)})})]}),Object(he.jsx)("hr",{}),Object(he.jsx)(Ys,{model:j.bus,setModel:e=>b((t=>({...t,bus:e})))})]}):Object(he.jsx)(Gs,{}):Object(he.jsx)(Ws,{fetchClients:s,clients:a,tags:r,fetchTags:l})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const Ws=e=>{let{clients:t,fetchClients:a,tags:s,fetchTags:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(I.c)(Fs),d=Object(I.d)(F);return Object(n.useEffect)((()=>{d&&d.length&&!r.currencyId&&o((e=>({...r,currencyId:d[0].id})))}),[r.clientId]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:r.clientId,onSelect:e=>{o((t=>({...t,clientId:e})))}}),Object(he.jsx)("label",{children:"Date De vente: "}),Object(he.jsx)(de.a,{type:"date",value:r.date,defaultValue:r.date,onChange:e=>{console.log(e),o((t=>({...t,date:e})))}}),Object(he.jsx)("label",{children:"Devise: "}),Object(he.jsx)(Fe.a,{data:d.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:r.currencyId,onSelect:e=>{o((t=>({...t,currencyId:e})))}})]})},Ys=e=>{let{model:t=new Us,setModel:a}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("h5",{children:"Liste Des Voyages"}),t.items.map(((e,n)=>Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:3.8,xl:3.8,className:"p-5",children:[Object(he.jsx)("label",{children:"Nom Du chauffeur:"}),Object(he.jsx)(de.a,{value:t.items[n].driverName,onChange:e=>{let s=[...t.items],c={...s[n]};c.driverName=e,s[n]=c,a({...t,items:s})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(he.jsx)("label",{children:"Date De Depart:"}),Object(he.jsx)(de.a,{type:"datetime-local",value:t.items[n].departDate,onChange:e=>{let s=[...t.items],c={...s[n]};c.departDate=e,s[n]=c,a({...t,items:s})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(he.jsx)("label",{children:"Date De Retour:"}),Object(he.jsx)(de.a,{type:"datetime-local",value:t.items[n].arrivalDate,onChange:e=>{let s=[...t.items],c={...s[n]};c.arrivalDate=e,s[n]=c,a({...t,items:s})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(he.jsx)("label",{children:"Ville De Depart:"}),Object(he.jsx)(de.a,{value:t.items[n].departCity,onChange:e=>{let s=[...t.items],c={...s[n]};c.departCity=e,s[n]=c,a({...t,items:s})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:1.8,xl:1.8,className:"p-5",children:[Object(he.jsx)("label",{children:"Ville D'Arriv\xe9:"}),Object(he.jsx)(de.a,{value:t.items[n].arrivalCity,onChange:e=>{let s=[...t.items],c={...s[n]};c.arrivalCity=e,s[n]=c,a({...t,items:s})}})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:{height:"42px"},children:" "}),n?Object(he.jsx)(ze.a,{onClick:()=>{let e=[...t.items];e.splice(n,1),a({...t,items:e})},color:"violet",icon:Object(he.jsx)(Nt.a,{})}):"",n+1==t.items.length&&Object(he.jsx)(ze.a,{onClick:()=>{let e=[...t.items];e.push(new Ls),a({...t,items:e})},color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]})))]})},Gs=()=>{const[e,t]=Object(I.c)(_t),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(!1);return Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsx)(vt.a,{loading:c,autoUpload:!1,fileList:a,action:"#",draggable:!0,onRemove:n=>(n=>{let c=a.findIndex((e=>e.fileKey==n));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(e.attachments[c].name).then((a=>{s((e=>{let t=[...e];return t.splice(c),t}));let n=[...e.attachments];n.splice(c),t((t=>({...e,attachments:n})))})).catch((e=>{}))})(n.fileKey),onChange:a=>{console.log(a);let n=a.filter((e=>"finished"!=e.status)).reverse()[0];n&&((a,n,c)=>{i(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(n).then((n=>{i(!1);let l=a.findIndex((e=>e.fileKey==c));s((e=>{let t=[...a];return t[l].status="finished",t}));let r=[...e.attachments];r.push({name:n.data[0].fileName}),t((t=>({...e,attachments:r})))})).catch((e=>{i(!1);let t=a.findIndex((e=>e.fileKey==c));s((e=>{let n=[...a];return n[t].status="error",n}))}))})(a,n.blobFile,n.fileKey)},children:Object(he.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(he.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(he.jsx)(St.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),c&&Object(he.jsx)(he.Fragment,{})]})};function Vs(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=(Object(I.d)(w),Object(n.useState)(0)),[u,p]=Object(n.useState)(0),[m,x]=Object(n.useState)(0),[O,g]=Object(n.useState)(0),[f,y]=Object(n.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0,service:4}),[v,_]=Object(n.useState)([]),[C,N]=Object(n.useState)(""),[E,S]=Object(I.c)(Fs),[D,k]=Object(I.c)(Oe.a),P=()=>{S(new Rs),N("")},A=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},T=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>j(e.data)))},B=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((e=>o(e.data)))},R=()=>{k((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Bus",{...f,date:f.date?me()(f.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),k((e=>({...e,loading:!1}))),h(e.data.totalCount),p(e.data.totalSale),x(e.data.totalRefund),g(e.data.totalCommission)})).catch((e=>N(e.Message)))},U=[{value2:"client",value:"id",name:"Client",render:(e,t)=>Object(he.jsx)("div",{children:t?t.name.toUpperCase():""})},{value:"totalPrice",value2:"currency",name:"Prix Total",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t?t.code:""})]})},{value:"date",name:"Date",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})}];return Object(n.useEffect)((()=>{R(),A(),B(),T()}),[]),Object(n.useEffect)((()=>{R()}),[f.page,f.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>{R()},children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>A(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:f.clientId,onSelect:e=>{y((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date du Vente: "}),Object(he.jsx)(de.a,{type:"date",value:f.date,onChange:e=>{y((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{nameExcel:"sale",size:"lg",ActionOnClose:P,save:()=>{console.log(E),k((e=>({...e,loading:!0})));let e={...E};delete e.customer,e.totalPrice=(1+parseFloat(e.commissionPercent)/100)*(parseFloat(e.commission)+parseFloat(e.fare)),E.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).update(e.id,e).then((e=>{R(),k((e=>({...e,open:!1,loading:!1}))),P(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{N(e.Message),k((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).create(e).then((e=>{R(),P(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((e=>({...e,open:!1,loading:!1})))})).catch((e=>{N(e.Message),k((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Ks,{tags:r,fetchTags:B,providers:d,fetchProviders:T,error:C,clients:i,fetchClients:e=>A(e,!1)})}),Object(he.jsxs)("div",{children:[Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{icon:Object(he.jsx)(Kn.c,{}),notAmount:!0,text:"Nbre de Vente",color:"245,195,35",amount:b})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Vente",color:"0,169,141",amount:u})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Remboursement",amount:m,color:"229,57,53"})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Commission",amount:O})})]}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{N(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).fetchById(e).then((e=>{if(e.data.client&&!i.find((t=>t.id==e.data.client.id))){let t=[...i];t.unshift({id:e.data.client.id,name:e.data.client.name}),l(t)}S({...e.data,date:e.data.date?e.data.date.substring(0,10):new Date})})).catch((e=>{console.log(e)}))})(e),k((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).delete(e).then((e=>{R(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>N(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:U,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:b,limitOptions:[10,20,50,100],limit:f.take,activePage:f.page,onChangePage:e=>{window.scrollTo(0,0),y((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),y((t=>({...t,take:e,page:1})))}})})]})}const Hs={verticalAlign:"top"};var qs=function(e){let{error:t,clients:a,fetchClients:s,providers:c,fetchProviders:i,fetchTags:l,tags:r}=e;const[o,d]=Object(n.useState)(0),[j,b]=Object(I.c)(Bs);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:o,style:Hs,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>d(0)}),Object(he.jsx)(ft.a.Item,{title:"D\xe9tails",onClick:()=>d(1)}),Object(he.jsx)(ft.a.Item,{title:"Attachments",onClick:()=>d(3)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:o?1==o?Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fournisseur : "}),Object(he.jsx)(Fe.a,{onSearch:e=>i(e),data:c.map((e=>({label:e.name,value:e.id}))),block:!0,value:j.providerId,noSearch:!0,onSelect:e=>{c.find((t=>t.id==e));b((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.fare,onChange:e=>{b((t=>({...t,fare:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.commission,onChange:e=>{b((t=>({...t,commission:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Commission ( % ):"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:j.commissionPercent,onChange:e=>{b((t=>({...t,commissionPercent:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix De Vente:"}),Object(he.jsx)("div",{children:Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:((1+parseFloat(j.commissionPercent)/100)*(parseFloat(j.commission)+parseFloat(j.fare))).toFixed(3)})})]}),Object(he.jsx)("hr",{}),Object(he.jsx)(Js,{model:j.hotelReservation,setModel:e=>b((t=>({...t,hotelReservation:e})))})]}):Object(he.jsx)($s,{}):Object(he.jsx)(Zs,{fetchClients:s,clients:a,tags:r,fetchTags:l})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const Zs=e=>{let{clients:t,fetchClients:a,tags:s,fetchTags:c}=e;const[i,l]=Object(n.useState)([]),[r,o]=Object(I.c)(Bs),d=Object(I.d)(F);return Object(n.useEffect)((()=>{d&&d.length&&!r.currencyId&&o((e=>({...r,currencyId:d[0].id})))}),[r.clientId]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:r.clientId,onSelect:e=>{o((t=>({...t,clientId:e})))}}),Object(he.jsx)("label",{children:"Date De vente: "}),Object(he.jsx)(de.a,{type:"date",value:r.date,defaultValue:r.date,onChange:e=>{console.log(e),o((t=>({...t,date:e})))}}),Object(he.jsx)("label",{children:"Devise: "}),Object(he.jsx)(Fe.a,{data:d.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:r.currencyId,onSelect:e=>{o((t=>({...t,currencyId:e})))}})]})},Js=e=>{let{model:t=new ws,setModel:a}=e;const[s,c]=Object(n.useState)({arrangement:"",room:""});return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"H\xf4tel : "}),Object(he.jsx)(de.a,{value:t.hotelName,onChange:e=>a({...t,hotelName:e})})]})," ",Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"R\xe9ference : "}),Object(he.jsx)(de.a,{value:t.ref,onChange:e=>a({...t,ref:e})})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Type du Chambre: "}),Object(he.jsx)(Fe.a,{data:we.t,block:!0,noSearch:!0,value:s.room,onChange:e=>{let n=e+" "+s.arrangement;c((t=>({...t,room:e}))),a({...t,board:n})}})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Arrangement : "}),"!",Object(he.jsx)(Fe.a,{data:Ct.map((e=>({label:e.name_fr,value:e.name_fr}))),block:!0,noSearch:!0,value:s.arrangement,onChange:e=>{let n=s.room+" "+e;c((t=>({...t,arrangement:e}))),a({...t,board:n})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date D'arriv\xe9:"}),Object(he.jsx)(de.a,{type:"date",value:t.checkIn,onChange:e=>a({...t,checkIn:e})})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date De Depart:"}),Object(he.jsx)(de.a,{type:"date",value:t.checkOut,onChange:e=>a({...t,checkOut:e})})]}),Object(he.jsx)("h5",{children:"Liste Des R\xe9sidents"}),t.guests&&t.guests.map(((e,n)=>Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Complet:"}),Object(he.jsx)(de.a,{value:t.guests[n].name,onChange:e=>{let s=[...t.guests],c={...s[n]};c.name=e,s[n]=c,a({...t,guests:s})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Type : "}),Object(he.jsx)(Fe.a,{data:we.a,block:!0,noSearch:!0,value:t.guests[n].ageType,onChange:e=>{let s=[...t.guests],c={...s[n]};c.ageType=e,s[n]=c,a({...t,guests:s})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Genre : "}),Object(he.jsx)(Fe.a,{data:we.h,block:!0,noSearch:!0,value:t.guests[n].gender,onChange:e=>{let s=[...t.guests],c={...s[n]};c.gender=e,s[n]=c,a({...t,guests:s})}})]}),Object(he.jsxs)(re.a,{s:2,m:1.6,l:1,xl:1,children:[Object(he.jsx)("div",{style:{height:"42px"},children:" "}),n?Object(he.jsx)(ze.a,{onClick:()=>{let e=[...t.guests];e.splice(n,1),a({...t,guests:e})},color:"violet",icon:Object(he.jsx)(Nt.a,{})}):"",n+1==t.guests.length&&Object(he.jsx)(ze.a,{onClick:()=>{let e=[...t.guests];e.push(new Je),a({...t,guests:e})},color:"violet",icon:Object(he.jsx)(Ge.a,{})})]})]})))]})},$s=()=>{const[e,t]=Object(I.c)(_t),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)(!1);return Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsx)(vt.a,{loading:c,autoUpload:!1,fileList:a,action:"#",draggable:!0,onRemove:n=>(n=>{let c=a.findIndex((e=>e.fileKey==n));M.a.createAPIEndpoint(M.a.ENDPOINTS.File).delete(e.attachments[c].name).then((a=>{s((e=>{let t=[...e];return t.splice(c),t}));let n=[...e.attachments];n.splice(c),t((t=>({...e,attachments:n})))})).catch((e=>{}))})(n.fileKey),onChange:a=>{console.log(a);let n=a.filter((e=>"finished"!=e.status)).reverse()[0];n&&((a,n,c)=>{i(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.File).upload(n).then((n=>{i(!1);let l=a.findIndex((e=>e.fileKey==c));s((e=>{let t=[...a];return t[l].status="finished",t}));let r=[...e.attachments];r.push({name:n.data[0].fileName}),t((t=>({...e,attachments:r})))})).catch((e=>{i(!1);let t=a.findIndex((e=>e.fileKey==c));s((e=>{let n=[...a];return n[t].status="error",n}))}))})(a,n.blobFile,n.fileKey)},children:Object(he.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(he.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(he.jsx)(St.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),c&&Object(he.jsx)(he.Fragment,{})]})};function Xs(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=(Object(I.d)(w),Object(n.useState)(0)),[u,p]=Object(n.useState)(0),[m,x]=Object(n.useState)(0),[O,g]=Object(n.useState)(0),[f,y]=Object(n.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),[v,_]=Object(n.useState)([]),[C,N]=Object(n.useState)(""),[E,S]=Object(I.c)(Bs),[D,k]=Object(I.c)(Oe.a),P=()=>{S(new Ts),N("")},A=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},T=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>j(e.data)))},B=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((e=>o(e.data)))},R=()=>{k((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Hosting",{...f,date:f.date?me()(f.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),k((e=>({...e,loading:!1}))),h(e.data.totalCount),p(e.data.totalSale),x(e.data.totalRefund),g(e.data.totalCommission)})).catch((e=>N(e.Message)))},U=[{value:"ref",name:"R\xe9f\xe9rence",render:e=>Object(he.jsxs)("a",{href:"#",children:[" ",e]})},{value2:"client",value:"id",name:"Client",render:(e,t)=>Object(he.jsx)("div",{children:t?t.name.toUpperCase():""})},{value:"customer",name:"R\xe9sident",render:e=>Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})]})},{value:"totalPrice",value2:"currency",name:"Prix Total",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t?t.code:""})]})},{value:"date",name:"Date",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})},{value:"hotelReservation",name:"D\xe9tails",render:e=>Object(he.jsxs)("strong",{children:[Object(he.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[Object(he.jsx)(Kn.c,{color:"#aaa"}),Object(he.jsxs)("span",{style:{marginLeft:"5px"},children:[" ",e?e.hotelName.toUpperCase():""]})]}),Object(he.jsx)("i",{style:{color:"#4667d1"},children:e?e.board:""})]})},{value:"hotelReservation",name:"Nbre Nuit\xe9es",render:e=>Object(he.jsxs)("strong",{children:[Object(he.jsxs)("span",{style:{display:"",alignItems:"center"},children:["de "," ",Object(he.jsx)("i",{children:me()(e.checkIn).format("DD MMM YYYY")})," "," \xe0 ",Object(he.jsx)("i",{children:me()(e.checkOut).format("DD MMM YYYY")})]}),Object(he.jsx)("br",{}),Object(he.jsxs)(Ae.a,{color:"orange",children:[Object(he.jsx)(Kn.a,{color:"#fff"}),Object(he.jsxs)("span",{style:{marginLeft:"5px"},children:[me()(e.checkOut).diff(me()(e.checkIn),"days")," nuit\xe9e",me()(e.checkOut).diff(me()(e.checkIn),"days")>1?"s":""]})]})]})},{value:"status",name:"Status",render:e=>Object(he.jsx)(Ae.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:we.j.find((t=>t.value==e))&&we.j.find((t=>t.value==e)).label})}];return Object(n.useEffect)((()=>{R(),A(),B(),T()}),[]),Object(n.useEffect)((()=>{R()}),[f.page,f.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>{R()},children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>A(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:f.clientId,onSelect:e=>{y((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date du Vente: "}),Object(he.jsx)(de.a,{type:"date",value:f.date,onChange:e=>{y((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{nameExcel:"sale",size:"lg",save:()=>{console.log(E),k((e=>({...e,loading:!0})));let e={...E};e.customer=e.hotelReservation.guests[0],e.totalPrice=(1+parseFloat(e.commissionPercent)/100)*(parseFloat(e.commission)+parseFloat(e.fare)),E.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Hosting").update(e.id,e).then((e=>{R(),k((e=>({...e,open:!1,loading:!1}))),P(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{N(e.Message),k((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Hosting").create(e).then((e=>{R(),P(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),k((e=>({...e,open:!1,loading:!1})))})).catch((e=>{N(e.Message),k((e=>({...e,loading:!1})))})))},ActionOnClose:P,AddComponent:Object(he.jsx)(qs,{tags:r,fetchTags:B,providers:d,fetchProviders:T,error:C,clients:i,fetchClients:e=>A(e,!1)})}),Object(he.jsxs)("div",{children:[Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{icon:Object(he.jsx)(Kn.c,{}),notAmount:!0,text:"Nbre de Vente",color:"245,195,35",amount:b})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Vente",color:"0,169,141",amount:u})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Remboursement",amount:m,color:"229,57,53"})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Commission",amount:O})})]}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{N(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).fetchById(e).then((e=>{if(e.data.client&&!i.find((t=>t.id==e.data.client.id))){let t=[...i];t.unshift({id:e.data.client.id,name:e.data.client.name}),l(t)}S({...e.data,date:e.data.date?e.data.date.substring(0,10):new Date})})).catch((e=>{console.log(e)}))})(e),k((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Hosting").delete(e).then((e=>{R(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>N(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:U,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:b,limitOptions:[10,20,50,100],limit:f.take,activePage:f.page,onChangePage:e=>{window.scrollTo(0,0),y((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),y((t=>({...t,take:e,page:1})))}})})]})}var Qs=a(513);const ec=Object(I.b)({key:"SaleVoState",default:new Ze});class tc{constructor(){this.customer=new Je,this.withoutVisa=!1,this.onlyTicket=!1}}const ac=Object(I.b)({key:"SaleUmrahAtom",default:new tc});var nc=a(759),sc=a.n(nc);const cc={verticalAlign:"top"};var ic=function(e){let{error:t,clients:a,fetchClients:s,providers:c,fetchProviders:i,vols:l=[],packs:r=[]}=e;const[o,d]=Object(n.useState)(0),[j,b]=Object(n.useState)(null),[h,u]=Object(I.c)(ac),[p,m]=Object(n.useState)(!1),[x,O]=Object(n.useState)(null),[g,y]=Object(n.useState)("");return Object(n.useEffect)((()=>{console.log(h),b(h.package)}),[h.id]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:o,style:cc,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>d(0)}),Object(he.jsx)(ft.a.Item,{title:"P\xe9lerin",onClick:()=>d(1)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:o?1==o?Object(he.jsxs)(he.Fragment,{children:[g&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:g}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsxs)("div",{style:{textAlign:"right"},children:[" ",Object(he.jsx)("input",{id:"hidden3",style:{visibility:"hidden",width:"0",height:0,overflow:"hidden"},type:"file",onChange:async e=>{const t=e.target.files;m(!0);const a=t[0];O(a);const n=new FormData;n.append("File",a,a.name);let s="",c=await M.a.createAPIEndpoint(M.a.ENDPOINTS.File+"/Passport").upload1(a);console.log(s),c&&(s=c.data,u((e=>({...e,customer:{...e.customer,passportPicture:s}})))),f.a.post("https://scan.kounouz.travel/api/Scan/",n,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{u((t=>{let a={...h.customer,passportPicture:s};a.birthDate=e.data.birthDate,a.passportNumber=e.data.passportNumber;let n=oa.find((t=>t.alpha3==e.data.nationalityCountryId||"TN"==t.iso));n&&(console.log(n),a.nationality=n.code,a.addressCountry=n.code,a.birthCountry=n.code,a.passportDeliveryCountry=n.code,a.birthCity=n.country,a.city=n.country,a.passportDeliveryCity=n.country),a.mrz=e.data.mrz,a.expirationPassportDate=e.data.passportExpiryDate,a.lastNameAr=e.data.arlastName,a.firstNameAr=e.data.arfirstName,a.lastName=e.data.lastName,a.firstName=e.data.firstName?e.data.firstName.replace(e.data.lastName,""):"",a.name=e.data.firstName!==e.data.lastName?e.data.firstName+" "+e.data.lastName:e.data.firstName,a.gender=e.data.gender,a.title=e.data.gender,a.picture=e.data.pilgrimPicture,a.job="nothing",a.status=2;try{let t=sc.a.parse(e.data.mrz);a.cin=t.personalNumber.split(" ")[0],console.log(t);let n=new Date(e.data.passportExpiryDate);var c=Date.parse(n);if(!isNaN(c)){var i=new Date(c),l=new Date;l.setDate(l.getDate()+15),l.setMonth(l.getMonth()+6),inew Date?y("Probleme de date d'expiration"):y("")}n.setFullYear(n.getFullYear()-5),a.deliveryPassportDate=n,console.log(me()(a.deliveryPassportDate)),a.deliveryPassportDate=me()(a.deliveryPassportDate).add(1,"days").format("YYYY-MM-DD")}catch{}return{...t,customer:a}})),m(!1)})).catch((e=>m(!1)))},accept:".jpg,.jpeg,.png"}),Object(he.jsx)(ze.a,{loading:p,icon:Object(he.jsx)(zn.b,{}),onClick:()=>{const e=document.querySelector("input#hidden3");console.log(e),e.click()},color:"green",appearance:"primary"}),Object(he.jsx)("br",{}),Object(he.jsxs)("div",{style:{width:"170px",heigth:"90px",display:"inline-block"},children:[" ",(x||h.customer&&h.customer.passportNumber)&&Object(he.jsx)(vt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.File+"/Passport").upload1(e[e.length-1].blobFile).then((e=>u((t=>({...t,customer:{...t.customer,passportPicture:e.data}}))))),Object(Qs.a)(e[e.length-1].blobFile,(e=>{}))},children:Object(he.jsxs)("div",{style:{textAlign:"center",width:"170px",heigth:"90px",display:"inline-block",marginTop:"5px"},children:[" ",h.customer.passportPicture?Object(he.jsx)("img",{alt:"",src:De.d+"Uploads/"+h.customer.passportPicture+"?"+Date.now(),width:"170",height:"90",style:{border:"1px dashed #888",borderRadius:"5px"}}):Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(he.jsx)(ca.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Passport"})]})," "]})}),h.customer.passportPicture?Object(he.jsxs)("a",{download:h.customer.passportPicture,target:"_blank",href:De.d+"Uploads/"+h.customer.passportPicture+"?t="+Date.now(),children:["t\xe9l\xe9charger ",h.customer.passportPicture]}):""]})]}),Object(he.jsx)("div",{style:{textAlign:"center"},children:Object(he.jsx)(vt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.File+"/Customer").upload1(e[e.length-1].blobFile).then((e=>u((t=>({...t,customer:{...t.customer,picture:e.data}})))))},children:Object(he.jsx)("div",{style:{background:"rgba(200,200,200,0.1)",width:"130px",height:"150px",padding:"0",display:"inline-block",borderRadius:"10px",cursor:"pointer"},children:h.customer&&h.customer.picture?Object(he.jsx)("img",{width:"130",height:"150",src:h.customer.picture.includes("base64")?h.customer.picture:De.d+"Uploads/CustomerPictures/"+h.customer.picture+"?"+Date.now(),style:{borderRadius:"10px"},alt:""}):Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(he.jsx)(ca.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Image"})]})})})}),Object(he.jsx)("label",{children:"Type : "}),Object(he.jsx)(Fe.a,{data:we.g,block:!0,noSearch:!0,value:h.customer.customerType,onSelect:e=>{u((t=>({...t,customer:{...t.customer,customerType:e}})))}})," ",Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Arabe:"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer};t.lastNameAr=e,u((e=>({...e,customer:t})))},value:h.customer.lastNameAr})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Pr\xe9nom Arabe:"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer};t.firstNameAr=e,u((e=>({...e,customer:t})))},value:h.customer.firstNameAr})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom :"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer,lastName:e};t.name=t.firstName+" "+e,u((e=>({...e,customer:t})))},value:h.customer.lastName})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Pr\xe9nom:"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer,firstName:e};t.name=e+" "+t.lastName,u((e=>({...e,customer:t})))},value:h.customer.firstName})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Du P\xe9re :"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer,fatherName:e};u((e=>({...e,customer:t})))},value:h.customer.fatherName})]}),Object(he.jsxs)(re.a,{l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"CIN:"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer,cin:e};u((e=>({...e,customer:t})))},value:h.customer.cin})]}),Object(he.jsxs)(re.a,{m:3,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"T\xe9l:"}),Object(he.jsx)(de.a,{type:"phone",value:h.customer.phoneNumber,onChange:e=>{let t={...h.customer,phoneNumber:e};u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{m:3,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Email:"}),Object(he.jsx)(de.a,{type:"email",value:h.customer.email,onChange:e=>{let t={...h.customer,email:e};u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:3,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Type : "}),Object(he.jsx)(Fe.a,{data:we.k,block:!0,noSearch:!0,value:h.customer.title,onChange:e=>{let t={...h.customer,title:e};u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:3,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Genre : "}),Object(he.jsx)(Fe.a,{data:we.h,block:!0,noSearch:!0,value:h.customer.gender,onChange:e=>{let t={...h.customer};t.gender=e,u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Lieu De Naissance:"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer,birthCity:e};u((e=>({...e,customer:t})))},value:h.customer.birthCity})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Pays De Naissance : "}),Object(he.jsx)(Fe.a,{data:oa.map((e=>({label:e.country,value:e.code}))),block:!0,noSearch:!0,value:h.customer.birthCountry,onChange:e=>{let t={...h.customer};t.birthCountry=e,u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Date de naissance :"}),Object(he.jsx)(de.a,{type:"date",value:"string"==typeof h.customer.birthDate?h.customer.birthDate.substring(0,10):h.customer.birthDate,onChange:e=>{let t={...h.customer};t.birthDate=e,u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Lieu De R\xe9sidance:"}),Object(he.jsx)(de.a,{onChange:e=>{let t={...h.customer};t.city=e,u((e=>({...e,customer:t})))},value:h.customer.city})]})," ",Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Pays De Sejour: "}),Object(he.jsx)(Fe.a,{data:oa.map((e=>({label:e.country,value:e.code}))),block:!0,noSearch:!0,value:h.customer.addressCountry,onChange:e=>{let t={...h.customer};t.addressCountry=e,u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Nationalit\xe9: "}),Object(he.jsx)(Fe.a,{data:oa.map((e=>({label:e.country,value:e.code}))),block:!0,noSearch:!0,value:h.customer.nationality,onChange:e=>{let t={...h.customer};t.nationality=e,u({...h,customer:t})}})]}),Object(he.jsx)("hr",{}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Passport:"}),Object(he.jsx)(de.a,{onChange:e=>{u((t=>({...t,customer:{...t.customer,passportNumber:e}})))},value:h.customer.passportNumber})]})," ",Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Pays D'Issuance : "}),Object(he.jsx)(Fe.a,{data:oa.map((e=>({label:e.country,value:e.code}))),block:!0,noSearch:!0,value:h.customer.passportDeliveryCountry,onChange:e=>{let t={...h.customer};t.passportDeliveryCountry=e,u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Ville D'Issuance :"}),Object(he.jsx)(de.a,{onChange:e=>{u((t=>({...t,customer:{...t.customer,passportDeliveryCity:e}})))},block:!0,value:h.customer.passportDeliveryCity})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Date D'Issuance :"}),Object(he.jsx)(de.a,{type:"date",onChange:e=>{u((t=>({...t,customer:{...t.customer,deliveryPassportDate:e}})))},block:!0,value:"string"==typeof h.customer.deliveryPassportDate?h.customer.deliveryPassportDate.substring(0,10):h.customer.deliveryPassportDate})]}),Object(he.jsxs)(re.a,{s:6,m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{style:{color:g?"red":""},children:"Date d'expiration :"}),Object(he.jsx)(de.a,{type:"date",value:"string"==typeof h.customer.expirationPassportDate?h.customer.expirationPassportDate.substring(0,10):h.customer.expirationPassportDate,onChange:e=>{let t={...h.customer};t.expirationPassportDate=e,t.deliveryPassportDate=h.customer.expirationPassportDate.substring(0,10);try{let c=new Date(e);var a=Date.parse(c);if(!isNaN(a)){var n=new Date(a),s=new Date;s.setDate(s.getDate()+15),s.setMonth(s.getMonth()+6),nnew Date?y("Probleme de date d'expiration"):y("")}c.setFullYear(c.getFullYear()-5),t.deliveryPassportDate=c,t.deliveryPassportDate=me()(t.deliveryPassportDate).add(1,"days").format("YYYY-MM-DD")}catch{}u({...h,customer:t})}})]}),Object(he.jsx)("label",{children:"MRZ"}),Object(he.jsx)(de.a,{as:"textarea",rows:3,onChange:e=>{u((t=>({...t,customer:{...t.customer,mrz:e}})))},value:h.customer.mrz}),Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Status : "}),Object(he.jsx)(Fe.a,{data:we.i,noSearch:!0,block:!0,value:h.customer.status,onChange:e=>{let t={...h.customer};t.status=e,u({...h,customer:t})}})]}),Object(he.jsxs)(re.a,{m:4,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"M\xe9tier:"}),Object(he.jsx)(de.a,{onChange:e=>{u((t=>({...t,customer:{...t.customer,job:e}})))},value:h.customer.job})]})]}):Object(he.jsx)(rc,{providers:c,fetchProviders:i}):Object(he.jsx)(lc,{fetchClients:s,clients:a,packs:r,vols:l})}),Object(he.jsx)("br",{}),Object(he.jsx)(yt.a,{})]})};const lc=e=>{let{clients:t,fetchClients:a,packs:s,vols:c}=e;const[i,l]=Object(I.c)(ac),[r,o]=Object(n.useState)([]);return Object(n.useEffect)((()=>{let e=s.find((e=>i.packageUmrahId===e.id));e&&o(e)}),[i.id]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:i.clientId,onSelect:e=>{l((a=>({...a,clientId:e,client:t.find((t=>t.id==e))})))}}),Object(he.jsx)("label",{children:"Vols : "}),Object(he.jsx)(Fe.a,{data:c.map(((e,t)=>({label:Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",background:t%2?"rgb(70,103,209,0.2)":"",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsxs)("div",{style:{color:"#232323"},children:[me()(e.date).format("DD MMM YYYY")," ",me()(e.date).format("DD MMM YYYY")," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:s&&s.find((t=>t.id==e.packageUmrahId))&&s.find((t=>t.id==e.packageUmrahId)).name})," ",")"]}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}),value:e.id}))),block:!0,noSearch:!0,value:i.disponibilityId,onSelect:e=>{let t=s.find((t=>t.disponibilities.find((t=>t.id==e))));o(t),l((a=>({...a,disponibilityId:e,packageUmrahId:t.id})))}})," ",r&&Object(he.jsx)(he.Fragment,{children:Object(he.jsx)(Gn,{pack:r,visa:r.packageUmrahCosts?r.packageUmrahCosts.find((e=>e.designation.toUpperCase().includes("VISA"))).cost*r.packageUmrahCosts.find((e=>e.designation.toUpperCase().includes("VISA"))).exchange:0,prices:r.prices?r.prices.filter((e=>!e.isHidden)).map((e=>{let t=c.find((e=>e.id==i.disponibilityId)),a=0;return t&&(a=t.commission+t.b2Bcommission-(r.commission+r.b2Bcommission)),{...e,price:e.price+a}})):[],model:i,_setmodel:l})}),Object(he.jsx)("br",{}),Object(he.jsx)("label",{children:"Date De vente: "}),Object(he.jsx)(de.a,{type:"date",value:i.date,onChange:e=>{console.log(e),l((t=>({...t,date:e})))}}),Object(he.jsx)("br",{}),Object(he.jsxs)("label",{children:["N'est pas confirm\xe9:"," ",Object(he.jsx)("input",{type:"checkbox",onChange:e=>{l((e=>({...e,confirmationStatus:2==e.confirmationStatus?1:2})))},checked:2==i.confirmationStatus})]}),Object(he.jsx)("br",{}),Object(he.jsx)("label",{children:"Note: "}),Object(he.jsx)(de.a,{as:"textarea",value:i.note,onChange:e=>{console.log(e),l((t=>({...t,note:e})))}}),Object(he.jsx)("br",{}),Object(he.jsxs)("label",{children:["empreinte digitale ",Object(he.jsx)("br",{})," ",Object(he.jsx)("input",{type:"checkbox",onChange:e=>{l((e=>({...e,fingerprint:!e.fingerprint})))},checked:i.fingerprint})]})]})},rc=e=>{let{providers:t,fetchProviders:a}=e;const[s,c]=Object(n.useState)(we.u),[i,l]=Object(I.c)(ec),[r,o]=Object(n.useState)(new Ze);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fournisseur : "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:t.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:r.providerId,onSelect:e=>{let a=t.find((t=>t.id==e));console.log(a),o((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Cout Unitaire:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:r.unitCost,onChange:e=>{o((t=>({...t,unitCost:parseInt(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Frais de service:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:r.unitFee,onChange:e=>{o((t=>({...t,unitFee:parseInt(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix Total:"}),Object(he.jsxs)("div",{children:[" ",Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:(Number(r.unitFee)+Number(r.unitCost)).toFixed(3)})]})]}),Object(he.jsx)("hr",{}),Object(he.jsx)("label",{children:"D\xe9signation:"}),Object(he.jsx)(de.a,{as:"textarea",rows:2,placeholder:"Notes",value:r.note,onChange:e=>{o((t=>({...t,note:e})))}}),Object(he.jsx)(yt.a,{}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsx)(ze.a,{onClick:()=>{l((e=>{console.log(e);let t={...e};if("object"!=typeof t.extrats&&(t.extrats=[]),"number"==typeof r.index){let e=[...t.extrats];e[r.index]=r,t={...t,extrats:e}}else{let e=[...t.extrats];e.push(r),t={...t,extrats:e}}return t})),o(new Fa)},color:"violet",icon:Object(he.jsx)(d.a,{}),children:"Ajouter"})}),Object(he.jsx)(yt.a,{}),Object(he.jsx)(ye.a,{editAction:e=>{o({...i.extrats[e],index:e})},deleteAction:e=>{l((t=>{let a={...t},n=[...a.extrats];return n.splice(e,1),a={...a,extrats:n},a}))},actionKey:"index",noAdvancedActions:!0,columns:oc(t),rows:i.extrats.map(((e,t)=>({...e,index:t})))})]})},oc=e=>[{value:"note",name:"Nom ",render:e=>Object(he.jsx)("b",{children:Object(he.jsx)("i",{children:e})})}],dc=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((e=>[{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?me()(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:we.f.find((t=>null===e.confirmationStatus||t.value===e.confirmationStatus))?we.f.find((t=>null===e.confirmationStatus||t.value===e.confirmationStatus)).label:we.f.find((e=>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(Qe.a)(e.totalPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}}]))}]};var jc=a(116);function bc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)([]),[u,p]=Object(n.useState)(null),[m,x]=Object(n.useState)([]),[O,g]=(Object(I.d)(w),Object(I.c)(ie)),[f,y]=Object(n.useState)([]),[v,_]=Object(n.useState)({disponibilityId:null,orders:[]}),[C,N]=Object(n.useState)(0),[E,S]=Object(n.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),[D,k]=Object(n.useState)(""),[P,A]=Object(I.c)(ac),[T,B]=Object(I.c)(Oe.a),R=()=>{A(new tc),k("")},U=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},L=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>x(e.data)))},F=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{j(e.data);let t=e.data.reduce(((e,t)=>e.concat(t.disponibilities.map((e=>({packageUmrahId:t.id,...e}))))),[]);console.log(t),h(t.filter((e=>e.onStock)))}))},z=()=>{B((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah",{...E,date:E.date?me()(E.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),B((e=>({...e,loading:!1}))),N(e.data.totalCount)})).catch((e=>{k(e.Message),B((e=>({...e,loading:!1})))}))};Object(n.useEffect)((()=>{U(),L(),F()}),[]),Object(n.useEffect)((()=>{z()}),[E.page,E.take]);const K=[{value:"id",name:" ",render:e=>Object(he.jsx)("b",{style:{color:"green",display:"flex",alignItems:"center"},children:Object(he.jsx)(Gt.a,{onChange:t=>{f.find((t=>t==e))?y((t=>t.filter((t=>t!=e)))):y((t=>[...t,e]))},checked:null!=f.find((t=>t==e))})})},{value:"packageUmrah",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Voyage",render:(e,t,a,n)=>Object(he.jsxs)("b",{style:{color:"#549f0a"},children:[e?e.name.toUpperCase():""," ",t?Object(he.jsx)(Ae.a,{color:"blue",children:"Billet"}):""," ",a?Object(he.jsx)(Ae.a,{color:"orange",children:"Sans Visa"}):"",n?Object(he.jsx)(Ae.a,{color:"violet",children:"Sans Billet"}):""]})},{value:"groupId",name:"Groupe",render:e=>Object(he.jsx)("a",{children:Object(he.jsx)("b",{children:e&&O&&O.find((t=>t.id==e))?O.find((t=>t.id==e)).name:""})})},{value:"disponibility",name:"Vol",render:e=>e?Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(he.jsx)("b",{children:"-"})},{value:"confirmationStatus",name:"Etat",render:e=>Object(he.jsx)(Ae.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:we.f.find((t=>null===e||t.value===e))?we.f.find((t=>null===e||t.value===e)).label:we.f.find((e=>1===e.value)).label})},{value:"fingerprint",name:"Empreinte",render:e=>e?Object(he.jsx)(jc.a,{color:"green"}):Object(he.jsx)("b",{children:"-"})},{value:"client",name:"Client B2B",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})},{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[e.firstName+" "+e.lastName," ",Object(he.jsx)("b",{style:{color:"#111",fontSize:"15px"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{}),Object(he.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr})]})]})},{value:"totalPrice",name:"Prix Total",render:e=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e&&e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})},{value:"disponibility",value2:"onlyTicket",name:"Commission B2B",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[!t&&e&&e.b2Bcommission.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:!t&&"TND "})]})},{value:"date",name:"Date De Vente",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})}];return Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>z(),children:[Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Recherche: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{S((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>U(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:E.clientId,onSelect:e=>{S((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Status : "}),Object(he.jsx)(Fe.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(we.f),block:!0,noSearch:!0,value:E.status,onSelect:e=>{S((t=>({...t,status:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{onSearch:F,data:d?[{label:"Tout",value:0}].concat(d.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:E.packageUmrahId,onSelect:e=>{S((t=>({...t,packageUmrahId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(b?b.map((e=>({label:Object(he.jsxs)("div",{style:{color:"#232323"},children:[me()(e.date).format("DD MMM YYYY")," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:d&&d.find((t=>t.id==e.packageUmrahId))&&d.find((t=>t.id==e.packageUmrahId)).name}),")"]}),value:e.id}))):[]),block:!0,noSearch:!0,value:E.disponibilityId,onSelect:e=>{Object(rt.a)(be.a.Disponibility).fetchById(e).then((e=>{console.log(e.data),p(e.data)})),S((t=>({...t,disponibilityId:e})))}})]})]}),Object(he.jsx)(ge.a,{excelData:dc(t),ActionOnClose:R,nameExcel:"saleUmrah",size:"lg",save:()=>{console.log(P),B((e=>({...e,loading:!0})));let e={...P};delete e.client,delete e.disponibility,delete e.packageUmrah,delete e.price,e.id?(k(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah").update2(e).then((e=>{z(),R(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),B((e=>({...e,open:!1,loading:!1})))})).catch((e=>{e.response&&(k(e.response.data),Te.a.fire({position:"top-center",icon:"warning",title:e.response.data,showConfirmButton:!1,timer:1500})),B((e=>({...e,loading:!1})))}))):(k(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah").create(e).then((e=>{z(),R(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),B((e=>({...e,open:!1,loading:!1})))})).catch((e=>{e.response&&(k(e.response.data),Te.a.fire({position:"top-center",icon:"warning",title:e.response.data,showConfirmButton:!1,timer:1500})),B((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(ic,{tags:r,providers:m,fetchProviders:L,error:D,clients:i,fetchClients:e=>U(e,!1),vols:b,packs:d})})," ",Object(he.jsxs)("div",{onClick:e=>y((e=>e.length?[]:t.map((e=>e.id)))),style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(he.jsx)(Gt.a,{checked:f.length>0})," S\xe9lectionner Tout"]}),Object(he.jsxs)("div",{className:"p-10",children:[Object(he.jsx)(re.a,{s:6,m:6,l:4,xl:3,children:Object(he.jsx)(Fe.a,{data:[{label:"Selectionner",value:0}].concat(b.map((e=>({label:Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}),value:e.id})))),block:!0,noSearch:!0,value:v.disponibilityId,onSelect:e=>{_((t=>({...t,disponibilityId:e})))}})})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"blue",onClick:()=>{console.log(f),M.a.createAPIEndpoint(be.a.Order+"/changeDisponibility").create({...v,orders:f}).then((e=>{z(),alert("success")}))},children:"changer"})]}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{k(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah").fetchById(e).then((e=>{if(e.data.client&&!i.find((t=>t.id==e.data.client.id))){let t=[...i];t.unshift({id:e.data.client.id,name:e.data.client.name}),l(t)}A((t=>{let a={...e.data};a.date=a.date.substring(0,10);let n={...a.customer};return{...a,customer:n}}))})).catch((e=>{console.log(e)}))})(e),B((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah").delete(e).then((e=>{z(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>k(e.Message)))},actionKey:"id",actions:[{label:"Confirmer",action:e=>{M.a.createAPIEndpoint(be.a.Order+"/Umrah/confirm/"+e,{}).customGet().then((e=>z()))},render:(e,t)=>Object(he.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:e=>{M.a.createAPIEndpoint(be.a.Order+"/Umrah/revoke/"+e,{}).customGet().then((e=>z()))},render:(e,t)=>Object(he.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:e=>{M.a.createAPIEndpoint(be.a.Order+"/Umrah/pending/"+e,{}).customGet().then((e=>z()))},render:(e,t)=>Object(he.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:K,rows:t}),Object(he.jsxs)("div",{style:{padding:20,background:"#fff"},children:[Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:C,limitOptions:[10,20,50,100],limit:E.take,activePage:E.page,onChangePage:e=>{window.scrollTo(0,0),S((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),S((t=>({...t,take:e,page:1})))}}),u&&E.disponibilityId&&Object(he.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"2px"},children:[Object(he.jsx)(de.a,{type:"number",value:u.adddedNumber,width:120,onChange:e=>p((t=>({...t,adddedNumber:parseInt(e)})))}),Object(he.jsx)(je.a,{style:{width:"120px"},onClick:e=>Object(rt.a)(be.a.Disponibility).update(u.id,u).then((e=>alert("Enregistr\xe9"))),appearance:"primary",color:"yellow",children:"Enregistrer"})]})]})]})}const hc=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((e=>[{value:e.packageUmrah?e.packageUmrah.name:"-",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.disponibility?me()(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:we.f.find((t=>null===e.confirmationStatus||t.value===e.confirmationStatus))?we.f.find((t=>null===e.confirmationStatus||t.value===e.confirmationStatus)).label:we.f.find((e=>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(Qe.a)(e.totalPrice),style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2f1a4c"}},alignment:{horizontal:"center"}}}]))}]};function uc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)(null),[u,p]=Object(n.useState)([]),[m,x]=(Object(I.d)(w),Object(n.useState)([])),[O,g]=Object(n.useState)(Date.now()),[f,y]=Object(n.useState)(0),[v,_]=Object(n.useState)(!1),C=()=>{y((e=>e+1))},[N,E]=Object(n.useState)(0),[S,D]=Object(n.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),[k,P]=Object(I.c)(Oe.a),A=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},T=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{o(e.data);let t=e.data.reduce(((e,t)=>e.concat(t.disponibilities.map((e=>({packageUmrahId:t.id,...e}))))),[]);console.log(t),j(t.filter((e=>e.onStock)))}))},B=()=>{P((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah",{...S,date:S.date?me()(S.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),P((e=>({...e,loading:!1}))),E(e.data.totalCount)})).catch((e=>{P((e=>({...e,loading:!1})))}))};Object(n.useEffect)((()=>{var e;A(),("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>p(e.data))),T()}),[]),Object(n.useEffect)((()=>{B()}),[S.page,S.take]);const R=[{value:"id",value2:"hasVisa",value3:"withoutVisa",name:" ",render:(e,t,a)=>Object(he.jsx)("b",{style:{color:"green",display:"flex",alignItems:"center"},children:Object(he.jsx)(Gt.a,{disabled:!t||a,onChange:a=>{g(Date.now()),m.find((t=>t==e))?x((t=>t.filter((t=>t!=e)))):x((a=>t?[...a,e]:a))},checked:null!=m.find((t=>t==e))})})},{value:"packageUmrah",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Voyage",render:(e,t,a,n)=>Object(he.jsxs)("b",{style:{color:"#549f0a"},children:[e?e.name.toUpperCase():""," ",t?Object(he.jsx)(Ae.a,{color:"blue",children:"Billet"}):""," ",a?Object(he.jsx)(Ae.a,{color:"orange",children:"Sans Visa"}):"",n?Object(he.jsx)(Ae.a,{color:"violet",children:"Sans Billet"}):""]})},{value:"coupon",name:"Coupon Utilis\xe9",render:e=>Object(he.jsx)("b",{children:e||"---"})},{value:"disponibility",name:"Vol",render:e=>e?Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(he.jsx)("b",{children:"-"})},{value:"confirmationStatus",name:"Etat",render:e=>Object(he.jsx)(Ae.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:we.f.find((t=>null===e||t.value===e))?we.f.find((t=>null===e||t.value===e)).label:we.f.find((e=>1===e.value)).label})},{value:"client",name:"Client B2B",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})},{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e.firstName+" "+e.lastName," ",Object(he.jsx)("b",{style:{color:"#111",fontSize:"14px"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{})," ",Object(he.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr})]})]})},{value:"wakil",name:"Wakil",render:e=>Object(he.jsx)("strong",{children:e?e.toUpperCase():""})},{value:"totalPrice",name:"Prix Total",render:e=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e&&e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:"TND"})]})},{value:"disponibility",value2:"onlyTicket",name:"Commission B2B",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[!t&&e&&e.b2Bcommission.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:!t&&"TND "})]})},{value:"date",name:"Date De Vente",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})}];function U(){const e=t.filter((e=>m.find((t=>t==e.id)))).map((e=>e.customer)).map(((e,t)=>` \n \n `)).join("");return`\n \n \n \n \n \n ${Date.now()}\n \n \n ${e}\n \n \n `}return Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{style:{overflow:"hidden",height:0},children:[Object(he.jsx)("iframe",{id:"iframe",title:"printFrame",width:"100%"}),t.filter((e=>m.find((t=>t==e.id)))).map((e=>e.customer)).map((e=>Object(he.jsx)("img",{onLoad:C,onError:C,src:De.d+"Uploads/Visas/"+e.passportNumber+".png?t="+O,alt:""},e.id)))]}),Object(he.jsxs)(fe.a,{search:()=>B(),children:[Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Recherche: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{D((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>A(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:S.clientId,onSelect:e=>{D((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Status : "}),Object(he.jsx)(Fe.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(we.f),block:!0,noSearch:!0,value:S.status,onSelect:e=>{D((t=>({...t,status:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{onSearch:T,data:r?[{label:"Tout",value:0}].concat(r.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:S.packageUmrahId,onSelect:e=>{D((t=>({...t,packageUmrahId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(d?d.map((e=>({label:Object(he.jsxs)("div",{style:{color:"#232323"},children:[me()(e.date).format("DD MMM YYYY")," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:r&&r.find((t=>t.id==e.packageUmrahId))&&r.find((t=>t.id==e.packageUmrahId)).name}),")"]}),value:e.id}))):[]),block:!0,noSearch:!0,value:S.disponibilityId,onSelect:e=>{Object(rt.a)(be.a.Disponibility).fetchById(e).then((e=>{console.log(e.data),h(e.data)})),D((t=>({...t,disponibilityId:e})))}})]})]}),Object(he.jsx)(ge.a,{excelData:hc(t),nameExcel:"saleUmrah",size:"lg",noAdd:!0})," ",Object(he.jsxs)("div",{onClick:e=>{g(Date.now()),x((e=>e.length?[]:t.filter((e=>e.hasVisa&&!e.withoutVisa)).map((e=>e.id))))},style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(he.jsx)(Gt.a,{checked:m.length>0})," S\xe9lectionner Tout"]}),Object(he.jsxs)("div",{style:{textAlign:"right",padding:"10px"},children:[Object(he.jsx)(je.a,{loading:v,appearance:"primary",color:"blue",onClick:()=>{_(!0);const e=document.getElementById("iframe");if(m.length&&f===m.length){e.contentDocument.body.innerHTML="";const t=U();e.contentDocument.write(t),e.contentWindow.print(),_(!1),y(0)}else setTimeout((()=>{if(m.length&&f===m.length){e.contentDocument.body.innerHTML="";const t=U();e.contentDocument.write(t),e.contentWindow.print(),_(!1),y(0)}else setTimeout((()=>{e.contentDocument.body.innerHTML="";const t=U();e.contentDocument.write(t),e.contentWindow.print(),_(!1),y(0)}),5e3)}),1e4)},children:"imprimer visas"})," "]}),Object(he.jsx)(ye.a,{columns:R,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:N,limitOptions:[10,20,50,100,200,500],limit:S.take,activePage:S.page,onChangePage:e=>{window.scrollTo(0,0),D((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),D((t=>({...t,take:e,page:1})))}})})]})}const pc={verticalAlign:"top"};var mc=function(e){let{error:t,clients:a,fetchClients:s,providers:c,fetchProviders:i}=e;const[l,r]=Object(n.useState)(0),[o,d]=Object(n.useState)(null),[j,b]=Object(I.c)(ec);return Object(n.useEffect)((()=>{console.log(j),d(j.package)}),[j.id]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:l,style:pc,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>r(0)}),Object(he.jsx)(ft.a.Item,{title:"Voyageur",onClick:()=>r(1)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:l?1==l?Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Complet:"}),Object(he.jsx)(de.a,{value:j.customer.name,onChange:e=>{let t={...j.customer};t.name=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"T\xe9l:"}),Object(he.jsx)(de.a,{type:"phone",value:j.customer.phoneNumber,onChange:e=>{let t={...j.customer};t.phoneNumber=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"N\xb0 Passport:"}),Object(he.jsx)(de.a,{value:j.customer.passportNumber,onChange:e=>{let t={...j.customer};t.passportNumber=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:10,m:4.4,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Date d'expiration :"}),Object(he.jsx)(de.a,{type:"date",value:j.customer.expirationPassportDate,onChange:e=>{let t={...j.customer};t.expirationPassportDate=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Type : "}),Object(he.jsx)(Fe.a,{data:we.a,block:!0,noSearch:!0,value:j.customer.ageType,onChange:e=>{let t={...j.customer};t.ageType=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Genre : "}),Object(he.jsx)(Fe.a,{data:we.h,block:!0,noSearch:!0,value:j.customer.gender,onChange:e=>{let t={...j.customer};t.gender=e,b({...j,customer:t})}})]}),Object(he.jsxs)(re.a,{s:10,m:4.4,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Date de naissance :"}),Object(he.jsx)(de.a,{type:"date",value:j.customer.birthDate,onChange:e=>{let t={...j.customer};t.birthDate=e,b({...j,customer:t})}})]})]}):Object(he.jsx)(Oc,{providers:c,fetchProviders:i}):Object(he.jsx)(xc,{fetchClients:s,clients:a,setPack:d,pack:o})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const xc=e=>{let{clients:t,fetchClients:a,setPack:s,pack:c}=e;const[i,l]=Object(I.c)(ec),[r,o]=Object(n.useState)([]),d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Object(rt.a)(be.a.Package+"/GetForSale",{q:e,page:1,take:1e3}).fetchAll().then((e=>o(e.data.data)))};return Object(n.useEffect)((()=>{d()}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:i.clientId,onSelect:e=>{l((t=>({...t,clientId:e})))}}),i.clientId&&Object(he.jsxs)("div",{style:{background:"rgb(107,121,196)",color:"white",padding:"10px",borderRadius:"5px",margin:"10px"},children:[Object(he.jsxs)("b",{children:["Commission:"," ",t.find((e=>e.id==i.clientId))&&t.find((e=>e.id==i.clientId)).voCommission]}),Object(he.jsx)("br",{}),Object(he.jsx)("label",{children:"Remise/addition"}),Object(he.jsx)(de.a,{type:"number",value:i.regulated_value,onChange:e=>{console.log(e),l((t=>({...t,regulated_value:parseFloat(e)})))},block:!0})]}),Object(he.jsx)("label",{children:"Voyage Organis\xe9: "}),Object(he.jsx)(Fe.a,{onSearch:e=>d(e),data:[{label:"Tout",value:0}].concat(r.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:i.packageId,onSelect:e=>{s(r.find((t=>t.id==e))),console.log(r.find((t=>t.id==e))),l((t=>({...t,packageId:e})))}})," ",c&&Object(he.jsxs)("div",{style:{background:"rgb(107,121,196)",color:"white",padding:"10px",borderRadius:"5px",margin:"10px"},children:[Object(he.jsx)("label",{children:"Choir parmi les vols: "}),Object(he.jsx)(Fe.a,{data:c.disponibilities.map((e=>({label:me()(e.date).format("DD MMM YYYY"),value:e.id}))),block:!0,noSearch:!0,value:i.disponibilityId,onSelect:e=>{l((t=>({...t,disponibilityId:e})))}}),c.packageProviders&&c.packageProviders.find((e=>e.hotels))?c.packageProviders.filter((e=>e.hotels)).map(((e,t)=>Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)("label",{children:["Choir Hotel N\xb0 ",t+1,": "]}),Object(he.jsx)(Fe.a,{data:e.hotels.split(",").map((e=>({label:e,value:e}))),block:!0,noSearch:!0,value:i["hotelName"+(t+1)],onSelect:e=>{l((a=>({...a,["hotelName"+(t+1)]:e})))}})]}))):Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Hotel: "}),Object(he.jsx)(de.a,{value:i.hotelName1,onChange:e=>{console.log(e),l((t=>({...t,hotelName1:e})))},block:!0})]}),Object(he.jsx)("label",{children:"Choir parmi les arrangements: "}),Object(he.jsx)(Fe.a,{data:c.prices.map((e=>({label:e.name+" --- "+e.price+"TND",value:e.name}))),block:!0,noSearch:!0,value:i.arrangement,onSelect:e=>{l((t=>({...t,arrangement:e,totalPrice:c.prices.find((t=>t.name==e)).price})))}})," "]}),Object(he.jsx)("br",{}),Object(he.jsx)("label",{children:"Date De vente: "}),Object(he.jsx)(de.a,{type:"date",value:i.date,onChange:e=>{console.log(e),l((t=>({...t,date:e})))}}),Object(he.jsx)("label",{children:"Note: "}),Object(he.jsx)(de.a,{as:"textarea",value:i.note,onChange:e=>{console.log(e),l((t=>({...t,note:e})))}}),Object(he.jsx)("br",{}),Object(he.jsxs)("label",{children:["N'est pas confirm\xe9:"," ",Object(he.jsx)("input",{type:"checkbox",onChange:e=>{l((e=>({...e,confirmationStatus:2==e.confirmationStatus?1:2})))},checked:2==i.confirmationStatus})]})]})},Oc=e=>{let{providers:t,fetchProviders:a}=e;const[s,c]=Object(n.useState)(we.u),[i,l]=Object(I.c)(ec),[r,o]=Object(n.useState)(new Ze);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fournisseur : "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:t.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:r.providerId,onSelect:e=>{let a=t.find((t=>t.id==e));console.log(a),o((t=>({...t,providerId:e})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Cout Unitaire:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:r.unitCost,onChange:e=>{o((t=>({...t,unitCost:parseInt(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Frais de service:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:r.unitFee,onChange:e=>{o((t=>({...t,unitFee:parseInt(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix Total:"}),Object(he.jsxs)("div",{children:[" ",Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:(Number(r.unitFee)+Number(r.unitCost)).toFixed(3)})]})]}),Object(he.jsx)("hr",{}),Object(he.jsx)("label",{children:"D\xe9signation:"}),Object(he.jsx)(de.a,{as:"textarea",rows:2,placeholder:"Notes",value:r.note,onChange:e=>{o((t=>({...t,note:e})))}}),Object(he.jsx)(yt.a,{}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsx)(ze.a,{onClick:()=>{l((e=>{console.log(e);let t={...e};if("object"!=typeof t.extrats&&(t.extrats=[]),"number"==typeof r.index){let e=[...t.extrats];e[r.index]=r,t={...t,extrats:e}}else{let e=[...t.extrats];e.push(r),t={...t,extrats:e}}return t})),o(new Fa)},color:"violet",icon:Object(he.jsx)(d.a,{}),children:"Ajouter"})}),Object(he.jsx)(yt.a,{}),Object(he.jsx)(ye.a,{editAction:e=>{o({...i.extrats[e],index:e})},deleteAction:e=>{l((t=>{let a={...t},n=[...a.extrats];return n.splice(e,1),a={...a,extrats:n},a}))},actionKey:"index",noAdvancedActions:!0,columns:gc(t),rows:i.extrats.map(((e,t)=>({...e,index:t})))})]})},gc=e=>[{value:"note",name:"Nom ",render:e=>Object(he.jsx)("b",{children:Object(he.jsx)("i",{children:e})})}],fc=e=>{if(e&&e.length)return[{columns:[{title:"Voyage",width:{wpx:120}},...e[0].costs.map((e=>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(((e,t)=>[...e,...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((e=>[{value:e.packageName,style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},...e.costs.map((e=>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(((e,t)=>[...e,...t]),[]),{value:parseFloat(e.costs.reduce(((e,t)=>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(((e,t)=>e+t.cost),0)),style:{font:{sz:"16",color:{rgb:"ffffff"}},fill:{fgColor:{rgb:"0b9666"}},alignment:{horizontal:"center"}}}]))}]};function yc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)([]),[u,p]=Object(n.useState)([]),[m,x]=Object(n.useState)([]),[O,g]=Object(n.useState)([]),[f,v]=(Object(I.d)(w),Object(n.useState)([])),[_,C]=Object(n.useState)([]),[N,E]=Object(n.useState)(0),[S,D]=Object(n.useState)({page:1,take:20,clientId:0,status:0,date:null,tagId:0}),[k,P]=Object(n.useState)(""),[A,T]=Object(I.c)(ec),[B,R]=Object(I.c)(Oe.a),U=()=>{T(new Ze),P("")},L=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?l(e.data):o(e.data)))},F=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>j(e.data)))},z=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight,{q:e},"/autocomplete").customGet().then((e=>p(e.data)))},K=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,{q:e},"/autocomplete").customGet().then((e=>h(e.data)))},W=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,{q:e},"/autocomplete2").customGet().then((e=>g(e.data)))},Y=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((e=>x(e.data)))},G=e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/VO",{...S,date:S.date?me()(S.date).format("DD MMM YYYY"):null,page:e||S.page}).fetchAll().then((e=>{a(e.data.data),R((e=>({...e,loading:!1}))),E(e.data.totalCount)})).catch((e=>{P(e.Message),R((e=>({...e,loading:!1})))}))},V=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Package,{q:e},"").customGet().then((e=>{v(e.data.data);let t=e.data.data.reduce(((e,t)=>e.concat(t.disponibilities.map((e=>({packageId:t.id,...e}))))),[]);console.log(t),C(t.filter((e=>e.onStock)))}))};return Object(n.useEffect)((()=>{G(),L(),F(),K(),Y(),W(),z(),V()}),[]),Object(n.useEffect)((()=>{G()}),[S.page,S.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>G(),children:[Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Recherche: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{D((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>L(e),data:[{label:"Tout",value:0}].concat(i.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:S.clientId,onSelect:e=>{D((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Voyage: "}),Object(he.jsx)(Fe.a,{onSearch:V,data:[{label:"Tout",value:0}].concat(f.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:S.packageId,onSelect:e=>{D((t=>({...t,packageId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(_?_.map((e=>({label:Object(he.jsxs)("div",{style:{color:"#232323"},children:[me()(e.date).format("DD MMM YYYY")," ("," ",Object(he.jsx)("i",{style:{color:"#999"},children:f&&f.find((t=>t.id==e.packageId))&&f.find((t=>t.id==e.packageId)).name}),")"]}),value:e.id}))):[]),block:!0,noSearch:!0,value:S.disponibilityId,onSelect:e=>{D((t=>({...t,disponibilityId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Date du Vente: "}),Object(he.jsx)(de.a,{type:"date",value:S.date,onChange:e=>{D((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{excelData:fc(s),ActionOnClose:U,nameExcel:"saleVo",size:"lg",save:()=>{console.log(A),R((e=>({...e,loading:!0})));let e={...A};delete e.client,delete e.disponibility,delete e.package,console.log(e),A.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/VO").update(e.id,e).then((e=>{G(),R((e=>({...e,open:!1,loading:!1}))),U(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{P(e.Message),R((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/VO").create(e).then((e=>{G(),U(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),R((e=>({...e,open:!1,loading:!1})))})).catch((e=>{P(e.Message),R((e=>({...e,loading:!1})))}))},handleExport:()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/GetOrerVosForExcel",{...S,date:S.date?me()(S.date).format("DD MMM YYYY"):null,take:N+10,page:1}).fetchAll().then((e=>{c(e.data.data)})).catch((e=>P(e.Message)))},AddComponent:Object(he.jsx)(mc,{checkouts:b,tags:m,fetchCheckouts:K,fetchTags:Y,providers:O,fetchProviders:W,error:k,banks:d,fetchBanks:F,clients:r,fetchClients:e=>L(e,!1),fetchAgentBookingFlights:z,agentBookingFlights:u})}),Object(he.jsxs)("div",{children:[Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{icon:Object(he.jsx)(y.e,{}),notAmount:!0,text:"Total Voyages",color:"245,195,35",amount:N})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Vente",color:"0,169,141"})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Remboursement",color:"229,57,53"})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Commission"})})]}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{P(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/VO").fetchById(e).then((e=>{if(e.data.client&&!r.find((t=>t.id==e.data.client.id))){let t=[...r];t.unshift({id:e.data.client.id,name:e.data.client.name}),o(t)}T((t=>{let a={...e.data};a.date=a.date.substring(0,10);let n={...a.customer};return{...a,customer:n}}))})).catch((e=>{console.log(e)}))})(e),R((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/VO").delete(e).then((e=>{G(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>P(e.Message)))},actionKey:"id",actions:[{label:"Confirmer",action:e=>{M.a.createAPIEndpoint(be.a.Order+"/VO/confirm/"+e,{}).customGet().then((e=>G()))},render:(e,t)=>Object(he.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:e=>{M.a.createAPIEndpoint(be.a.Order+"/VO/revoke/"+e,{}).customGet().then((e=>G()))},render:(e,t)=>Object(he.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:e=>{M.a.createAPIEndpoint(be.a.Order+"/Vo/pending/"+e,{}).customGet().then((e=>G()))},render:(e,t)=>Object(he.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:vc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:N,limitOptions:[10,20,50,100],limit:S.take,activePage:S.page,onChangePage:e=>{window.scrollTo(0,0),D((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),D((t=>({...t,take:e,page:1})))}})})]})}const vc=[{value:"package",name:"Voyage",render:e=>Object(he.jsx)("b",{style:{color:"#549f0a"},children:e?e.name.toUpperCase():""})},{value:"client",name:"Client B2B",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})},{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("a",{children:[e?e.name.toUpperCase():"",Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#aaa"},children:e?e.passportNumber:""})]})},{value:"disponibility",name:"Vol",render:e=>e?Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(he.jsx)("b",{children:"-"})},{value:"confirmationStatus",name:"Etat",render:e=>Object(he.jsx)(Ae.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:we.f.find((t=>null===e||t.value===e))?we.f.find((t=>null===e||t.value===e)).label:we.f.find((e=>1===e.value)).label})},{value2:"currency",value:"commission",name:"Commission B2B",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#333",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})},{value:"totalPrice",value2:"currency",name:"Prix Total",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t})]})},{value:"date",name:"Date",render:e=>Object(he.jsx)("strong",{children:me()(e).format("DD MMM YYYY")})},{value:"notes",name:"Notes",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",padding:"10px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:e})}];var _c=a(360),Cc=a.n(_c);function Ic(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(I.c)(ie),[b,h]=Object(n.useState)(Date.now()),[u,p]=Object(n.useState)(0),[m,x]=Object(n.useState)(!1),[O,g]=Object(n.useState)([]),[f,y]=Object(I.c)(L),[v,_]=Object(n.useState)(0),[C,N]=Object(n.useState)(!1),[E,S]=Object(n.useState)({page:1,take:100,clientId:0,status:3,date:null,tagId:0}),[D,k]=Object(n.useState)({groupId:null,orders:[]}),[P,A]=Object(n.useState)(""),T=function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>c(e.data)))},w=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{l(e.data);let t=e.data.reduce(((e,t)=>e.concat(t.disponibilities)),[]);console.log(t),g(t.filter((e=>e.onStock)))}))},B=()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah",{...E,date:E.date?me()(E.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),o([]),_(e.data.totalCount)})).catch((e=>{}))};Object(n.useEffect)((()=>{T(),w()}),[]),Object(n.useEffect)((()=>{B()}),[E.page,E.take]);const R=[{value:"id",name:"-",render:e=>Object(he.jsx)(Gt.a,{onChange:t=>{r.find((t=>t==e))?o((t=>t.filter((t=>t!=e)))):o((t=>[...t,e]))},checked:null!=r.find((t=>t==e))})},{value:"groupId",name:"Groupe",render:e=>Object(he.jsx)("a",{children:Object(he.jsx)("b",{children:e&&d.find((t=>t.id==e))?d.find((t=>t.id==e)).name:""})})},{value:"customer",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Client B2C",render:(e,t,a,n)=>Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[e.firstName+" "+e.lastName," ",Object(he.jsx)("b",{style:{color:"#111",fontSize:"15px"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{}),Object(he.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr}),t?Object(he.jsx)(Ae.a,{color:"blue",children:"Billet"}):""," ",a?Object(he.jsx)(Ae.a,{color:"orange",children:"sans visa"}):"",n?Object(he.jsx)(Ae.a,{color:"violet",children:"Sans Billet"}):""]})]})},{value:"disponibility",name:"Vol",render:e=>e?Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(he.jsx)("b",{children:"-"})},{value:"fingerprint",name:"Empreinte",render:e=>e?Object(he.jsx)(jc.a,{color:"green"}):Object(he.jsx)("b",{children:"-"})},{value:"client",name:"Client B2B",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})},{value:"codeMoufa",name:"Code Wakil",render:(e,t)=>Object(he.jsx)("span",{style:{color:e?"green":t?"red":""},children:e?"Envoy\xe9 vers wakil":"-"})},{value:"errorMessage",value2:"codeMoufa",name:"Erreur",render:(e,t)=>Object(he.jsx)("span",{style:{color:e?"green":e?"red":""},children:e?t?"":"Probl\xe9me envoie":"-"})},{value:"visaCode",name:"Visa",render:e=>Object(he.jsx)("b",{style:{color:e?"white":"",padding:"5px 10px",background:e?"blue":"",borderRadius:"5px"},children:e||"-"})}],U=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"exportPictures";try{const t=await fetch(`https://financeapi.kounouz.travel/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),a=await t.blob(),n=window.URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download="exportPictures"==e?"pictures.zip":"passports.zip",document.body.appendChild(s),s.click(),document.body.removeChild(s)}catch(P){console.error("Error downloading ZIP file:",P)}};Object(n.useEffect)((()=>{k((e=>({...e,orders:r})))}),[r.length]);function F(){const e=t.filter((e=>r.find((t=>t==e.id)))).map((e=>e.customer)).map(((e,t)=>` \n \n `)).join("");return`\n \n \n \n \n \n ${Date.now()}\n \n \n ${e}\n \n \n `}return Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{style:{overflow:"hidden",height:0},children:[Object(he.jsx)("iframe",{id:"iframe",title:"printFrame",width:"100%"}),t.filter((e=>r.find((t=>t==e.id)))).map((e=>e.customer)).map((e=>Object(he.jsx)("img",{onLoad:()=>p((e=>e+1)),onError:()=>p((e=>e+1)),src:De.d+"Uploads/"+e.passportPicture+"?t="+b,alt:""},e.id)))]}),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>B(),children:[Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Recherche: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{S((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Group: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(d.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:E.groupId,onSelect:e=>{S((t=>({...t,groupId:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>T(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:E.clientId,onSelect:e=>{S((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{onSearch:w,data:i?[{label:"Tout",value:0}].concat(i.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:E.packageUmrahId,onSelect:e=>{S((t=>({...t,packageUmrahId:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(O?O.map((e=>({label:Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),value:e.id}))):[]),block:!0,noSearch:!0,value:E.disponibilityId,onSelect:e=>{S((t=>({...t,disponibilityId:e})))}})]})]}),Object(he.jsx)(ge.a,{nameExcel:"saleUmrah",size:"lg",noAdd:!0,additionalBtn:Object(he.jsx)("div",{className:"p-5",children:Object(he.jsx)(je.a,{color:"blue",appearance:"primary",onClick:()=>{(async()=>{await fetch("http://localhost:8733/getImages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})&&alert("succ\xe9s")})()},children:"t\xe9l\xe9chargement auto"})})}),Object(he.jsxs)("div",{children:[Object(he.jsxs)(ze.a,{icon:Object(he.jsx)(Cc.a,{}),onClick:()=>U(),appearance:"primary",children:["Images"," "]})," ",Object(he.jsxs)(ze.a,{icon:Object(he.jsx)(Ss.a,{}),appearance:"primary",onClick:()=>U("exportPassportPictures"),children:["Passports"," "]}),Object(he.jsxs)(je.a,{onClick:()=>{(()=>{if(r&&r.length){let e=t.filter((e=>r.some((t=>t==e.id)))).map((e=>({...e,_name:`${e.customer.lastName.trim().toUpperCase()}-${e.customer.firstName.trim().toUpperCase()}`}))).sort(((e,t)=>(""+e._name).localeCompare(t._name)));const a=document.createElement("a");let n="",s="";e.map(((t,a)=>{n+=`${!a||a%5?"":"\n"}SRDOCS ${t.disponibility.airline.logo.replace("https://images.kiwi.com/airlines/64/","").substring(0,2)} HK1-P-TUN-${t.customer.passportNumber}-TUN-${me()(t.customer.birthDate).format("DDMMMYY").toUpperCase()}-${1==t.customer.gender?"M":"F"}-${me()(t.customer.expirationPassportDate).format("DDMMMYY").toUpperCase()}-${t.customer.lastName.trim().toUpperCase()}-${t.customer.firstName.trim().toUpperCase()}/P${a+1};\n`,s=s+(a%10?"":"\nNM1 ")+`${t.customer.lastName.trim().toUpperCase()}/${t.customer.firstName.trim().toUpperCase()} ${2==t.customer.title?"MRS":3==t.customer.title?"MSS":"MR"}${a%10<9&&a{x(!0);const e=document.getElementById("iframe");if(r.length&&u===r.length){e.contentDocument.body.innerHTML="";const t=F();e.contentDocument.write(t),e.contentWindow.print(),x(!1),p(0)}else setTimeout((()=>{if(r.length&&u===r.length){e.contentDocument.body.innerHTML="";const t=F();e.contentDocument.write(t),e.contentWindow.print(),x(!1),p(0)}else setTimeout((()=>{e.contentDocument.body.innerHTML="";const t=F();e.contentDocument.write(t),e.contentWindow.print(),x(!1),p(0)}),5e3)}),1e4)},children:"imprimer passports"})]}),Object(he.jsxs)("div",{onClick:e=>o((e=>e.length?[]:t.map((e=>e.id)))),style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(he.jsx)(Gt.a,{checked:r.length>0})," S\xe9lectionner Tout"]}),Object(he.jsxs)("div",{className:"p-10",children:[Object(he.jsx)(re.a,{s:6,m:6,l:4,xl:3,children:Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(d.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:D.groupId,onSelect:e=>{k((t=>({...t,groupId:e})))}})})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"blue",onClick:()=>{M.a.createAPIEndpoint(be.a.Order+"/changGgroup").create(D).then((e=>{B(),alert("success")}))},children:"changer"})]}),Object(he.jsx)(ye.a,{columns:R,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.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,200,250,500,1e3],limit:E.take,activePage:E.page,onChangePage:e=>{window.scrollTo(0,0),S((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),S((t=>({...t,take:e,page:1})))}})})]})," "]})}var Nc=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code Agent:"}),Object(he.jsx)(de.a,{value:n.agentCode,onChange:e=>{t((t=>({...t,agentCode:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Ec(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:"",agentCode:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:"",agentCode:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>p()),[]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{agentCode:"Code Agent"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Nc,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),j(t.find((t=>t.id==e)))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Sc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Sc=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"agentCode",name:"Code",render:e=>Object(he.jsx)("b",{children:e})}];var Dc=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Iso Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function kc(e){const[t,a]=Object(I.c)(F),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:"",code:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:"",code:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Currency,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>p()),[]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{code:"Iso Code"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Currency).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Currency).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Dc,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),j(t.find((t=>t.id==e)))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Currency).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Pc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Pc=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})}];var Ac=function(e){let{_setmodel:t,error:a,model:n={},Positions:s,fetchPositions:c}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Adresse"}),Object(he.jsx)(de.a,{value:n.address,onChange:e=>{t((t=>({...t,address:e})))}}),Object(he.jsx)("label",{children:"Email"}),Object(he.jsx)(de.a,{block:!0,placeholder:"example@cc.ccc ",value:n.email,onChange:e=>{let a={...n,email:e};t(a)}}),Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.phones?n.phones.split(","):[],onChange:e=>{n.phones=e.join(",");let a={...n};t(a)}}),Object(he.jsx)("label",{children:"position"}),Object(he.jsx)(Fe.a,{onSearch:e=>c(e),data:[{label:"Tout",value:null}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:n.positionId,onSelect:e=>{t((t=>({...t,positionId:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Mc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)({q:"",page:1,take:50,clientType:1,isCCA:!1}),[d,j]=Object(n.useState)(""),[b,h]=Object(n.useState)({phones:"",emails:"",name:"",address:""}),[u,p]=Object(I.c)(Oe.a),m=()=>{h({phones:"",emails:"",name:"",address:""}),j("")},x=()=>{p((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Employee,r).fetchAll().then((e=>{a(e.data.data),p((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))}))},O=function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.EmployeePosition,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))};return Object(n.useEffect)((()=>{x(),O()}),[r.page,r.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>x(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{o((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{ActionOnClose:m,noExport:!0,size:"md",save:()=>{let e=Object(Be.a)(b,[{name:"Nom"}]);e?j(e):(p((e=>({...e,loading:!0}))),b.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Employee).update(b.id,b).then((e=>{x(),p((e=>({...e,open:!1,loading:!1}))),m(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Employee).create(b).then((e=>{console.log(e),x(),m(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),p((e=>({...e,open:!1,loading:!1})))})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Ac,{error:d,model:b,_setmodel:h,Positions:i,fetchPositions:e=>O(e,!1)})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(""),h(t.find((t=>t.id==e)))})(e),p((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Employee).delete(e).then((e=>{x(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>j(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Tc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:r.take,activePage:r.page,onChangePage:e=>{window.scrollTo(0,0),o((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),o((t=>({...t,take:e,page:1})))}})})]})}const Tc=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"position",name:"Position",render:e=>Object(he.jsx)("b",{children:e&&e.name})},{value:"address",name:"Adresse",render:e=>Object(he.jsx)("i",{style:{color:"#232323"},children:e})},{value:"email",name:"Email",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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 wc=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Bc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.EmployeePosition,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>p()),[]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.EmployeePosition).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.EmployeePosition).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(wc,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(t.find((t=>t.id==e))),o("")})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.EmployeePosition).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Rc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Rc=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})}];var Uc=function(e){let{_setmodel:t,error:a,model:n}=e;const s=Object(I.d)(F);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{s:3,m:3,l:3,xl:3,className:"p-10",children:[" ",Object(he.jsx)("label",{children:"Source:"}),Object(he.jsx)(Fe.a,{data:s.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:n.currencySourceId,onSelect:e=>{t((t=>({...n,currencySourceId:e})))}})]}),Object(he.jsxs)(re.a,{s:3,m:3,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Rate"}),Object(he.jsx)(de.a,{type:"number",step:"0.001",value:n.rate,onChange:e=>{t((t=>({...t,rate:e})))}})," "]}),Object(he.jsxs)(re.a,{s:3,m:3,l:3,xl:3,className:"p-10",children:[" ",Object(he.jsx)("label",{children:"Currency:"}),Object(he.jsx)(Fe.a,{data:s.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:n.currencyId,onSelect:e=>{t((t=>({...n,currencyId:e})))}})]}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Lc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),i=Object(I.d)(F),[l,r]=Object(n.useState)(""),[o,d]=Object(n.useState)({rate:1,currencySourceId:0,currencyId:0}),[j,b]=Object(I.c)(Oe.a),h=()=>{d((e=>({rate:1,currencySourceId:0,currencyId:0}))),r("")},u=()=>{b((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Exchange,{}).fetchAll().then((e=>{a(e.data.map(((e,t)=>({...e,id:t+1}))))})).catch((e=>r(e.Message)))},p=[{value:"currencySourceId",name:"Source",render:e=>Object(he.jsx)("a",{children:i.find((t=>t.id==e))?i.find((t=>t.id==e)).name:"-"})},{value:"rate",name:"Code",render:e=>Object(he.jsx)("b",{children:e})},{value:"currencyId",name:"---",render:e=>Object(he.jsx)("a",{children:i.find((t=>t.id==e))?i.find((t=>t.id==e)).name:"-"})}];return Object(n.useEffect)((()=>u()),[]),Object(he.jsxs)("div",{children:[Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(o,[{name:"Nom"},{code:"Iso Code"}])&&!1;e?r(e):(b((e=>({...e,loading:!0}))),o.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Exchange+"/update").create({...o,rate:Number(o.rate)}).then((e=>{u(),b((e=>({...e,open:!1,loading:!1}))),h(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{r(e.Message),b((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Exchange).create({...o,rate:Number(o.rate)}).then((e=>{u(),h(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),b((e=>({...e,open:!1,loading:!1})))})).catch((e=>{r(e.Message),b((e=>({...e,loading:!1})))})),h())},AddComponent:Object(he.jsx)(Uc,{error:l,model:o,_setmodel:d})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{r(""),console.log(e),d(t.find((t=>t.id===e)))})(e),console.log(t),b((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Exchange).delete(e).then((e=>{u(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>r(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:p,rows:t})]})}function Fc(){const e=Object(I.d)(F),[t,a]=Object(n.useState)(0);return Object(he.jsx)("div",{children:Object(he.jsxs)(re.a,{xl:6,l:6,children:[Object(he.jsx)("h4",{children:"Devise Par defaut :"}),Object(he.jsx)(Fe.a,{data:e.map((e=>({label:e.name,value:e.id}))),block:!0,noSearch:!0,value:t,onSelect:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Currency,{id:e},"/SetDefault").customGet().then((e=>alert("suvagard\xe9"))),a(e)}})]})})}var zc=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Kc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.ServiceType,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>p()),[]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.ServiceType).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.ServiceType).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(zc,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(t.find((t=>t.id==e))),o("")})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.ServiceType).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Wc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Wc=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})}];var Yc=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Gc(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>p()),[]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Yc,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(t.find((t=>t.id==e))),o("")})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Vc,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Vc=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})}];class Hc{constructor(){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=[]}}const qc=Object(I.b)({key:"ticketSate",default:new Hc});var Zc=[{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"}];class Jc extends class{constructor(e,t,a,n,s,c,i,l,r,o,d,j){this.tags=[],this.paxName=e,this.status=t,this.ticketNumber=a,this.emmissionDate=n,this.clientId=s,this.pnr=c,this.paxType=i,this.priceTicket=l,this.emd=r,this.agencyCommission=o,this.totalTTC=d,this.totalRefund=j}}{constructor(){super(...arguments),this.client={id:0,name:"",taxCode:"",emails:[],phones:[],address:""}}}class $c{}class Xc{constructor(e,t,a){this.country=new Qc(e),this.name=t,this.city=a}}class Qc{constructor(e){if(this.name="",this.code="",this.logo="",this.code=e,e){let t=Zc.find((t=>t.id===e));this.name=t.name,this.logo=t.name+".png"}}}let ei=new Jc;ei.agencyCommission=20,ei.id=11245,ei.client={name:"Oh Voyage",id:1,taxCode:"testcode",address:"Kasserine , Immeuble, El Baraka 1200"},ei.emmissionDate=new Date(2022,6,12),ei.paxName="Alwani Anis",ei.paxType="ADT",ei.pnr="AZE125",ei.priceTicket=1e3,ei.status="TKTT",ei.ticketNumber="112525821",ei.totalTTC=1020,ei.currency="TND",ei.tags=[{name:"Vol Istanbul",id:1}];let ti=new class extends Jc{constructor(){super(...arguments),this.segments=[new $c],this.docName=""}};ti={...ei};let ai=new $c;ai.arrivalDate=new Date(2022,6,12),ai.departDate=new Date(2022,6,12),ai.arrivalTime=new Date(2022,6,12,12,50,0).getTime(),ai.bagages=!0,ai.class="Economic",ai.departAirport=new Xc("TN","Carthage","Tunis"),ai.destinationAirport=new Xc("FR","Charles de Guaule","Paris"),ai.airline=new class{constructor(e,t){this.code=e,this.logo=e+".jpg",this.name=t}}("TU","Tunisair"),ti.segments=[ai],ti.docName="AIR114156.txt";const ni={verticalAlign:"top"};var si=function(e){let{error:t,clients:a,fetchClients:s,airlines:c,fetchAirlines:i,fetchAgentBookingFlights:l,agentBookingFlights:r,fetchTags:o,tags:d}=e;const[j,b]=Object(n.useState)(0),[h,u]=Object(I.c)(qc);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(ft.a,{current:j,style:ni,children:[Object(he.jsx)(ft.a.Item,{title:"Infos G\xe9nerales",onClick:()=>b(0)}),Object(he.jsx)(ft.a.Item,{title:"Voyageur",onClick:()=>b(1)}),Object(he.jsx)(ft.a.Item,{title:"Infos Ticket",onClick:()=>b(2)})]}),Object(he.jsx)("div",{style:{padding:"40px 10px"},children:j?1==j?Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)(re.a,{m:6,l:5,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Complet:"}),Object(he.jsx)(de.a,{value:h.paxName,onChange:e=>{u({...h,paxName:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Type : "}),Object(he.jsx)(Fe.a,{data:we.a,block:!0,noSearch:!0,value:h.paxType,onChange:e=>{u({...h,paxType:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"N\xb0 Passport : "}),Object(he.jsx)(de.a,{value:h.passportNbr,onChange:e=>{u({...h,passportNbr:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date D'expiration:"}),Object(he.jsx)(de.a,{type:"date",value:h.passportExpiration,onChange:e=>u({...h,passportExpiration:e})})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Genre : "}),Object(he.jsx)(Fe.a,{data:we.h.map((e=>({...e,value:e.label}))),block:!0,noSearch:!0,value:h.gender,onChange:e=>{u({...h,gender:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date de naissance:"}),Object(he.jsx)(de.a,{type:"date",value:h.dateOfBirth,onChange:e=>u({...h,dateOfBirth:e})})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nationalit\xe9:"}),Object(he.jsx)(Fe.a,{data:Zc.map((e=>({label:e.name,value:e.name}))),block:!0,noSearch:!0,value:h.nationality,onChange:e=>{u({...h,nationality:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Address : "}),Object(he.jsx)(de.a,{type:"address",value:h.adress,onChange:e=>{u({...h,adress:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"Email : "}),Object(he.jsx)(de.a,{type:"email",value:h.email,onChange:e=>{u({...h,email:e})}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"T\xe9l : "}),Object(he.jsx)(de.a,{type:"phone",value:h.phone,onChange:e=>{u({...h,phone:e})}})]})]}):Object(he.jsx)("div",{children:Object(he.jsx)(ii,{setmodel:u,model:{...h}})}):Object(he.jsx)(ci,{fetchClients:s,clients:a,tags:d,fetchTags:o,airlines:c,fetchAirlines:i,fetchAgentBookingFlights:l,agentBookingFlights:r})}),Object(he.jsx)("br",{}),t&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:t}),Object(he.jsx)(yt.a,{})]})};const ci=e=>{let{clients:t,fetchClients:a,tags:s,fetchTags:c,airlines:i,fetchAirlines:l,fetchAgentBookingFlights:r,agentBookingFlights:o}=e;const[d,j]=Object(n.useState)([]),[b,h]=Object(I.c)(qc);return Object(n.useEffect)((()=>{}),[]),Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>a(e),data:[{label:"Tout",value:0}].concat(t.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:b.clientId,onSelect:e=>{h((t=>({...t,clientId:e})))}}),Object(he.jsx)("label",{children:"Airline : "}),Object(he.jsx)(Fe.a,{onSearch:e=>l(e),data:[{label:"Tout",value:0}].concat(i.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:b.airlineId,onSelect:e=>{h((t=>({...t,airlineId:e})))}}),Object(he.jsx)("label",{children:"Note"}),Object(he.jsx)(de.a,{value:b.note,onChange:e=>{h((t=>({...t,note:e})))}})]})},ii=e=>{let{model:t=new Hc,setmodel:a,agents:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsxs)(re.a,{m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"N Ticket : "}),Object(he.jsx)(de.a,{type:"number",value:t.docNumber,onChange:e=>a({...t,docNumber:e})})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:2,xl:2,className:"p-10",children:[Object(he.jsx)("label",{children:"PNR:"}),Object(he.jsx)(de.a,{value:t.pnr,onChange:e=>a({...t,pnr:e})})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date D'emmisssion:"}),Object(he.jsx)(de.a,{type:"date",value:t.doEmmission,onChange:e=>a({...t,doEmmission:e})})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Status:"}),Object(he.jsx)(Fe.a,{data:we.x.filter((e=>"TKTT"==e.value||"EMDS"==e.value)),block:!0,noSearch:!0,value:t.tranc,onChange:e=>a({...t,tranc:e,totalTTC:0,emd:0,serviceFees:0,servideFeesTVA:0,fare:0})})]}),Object(he.jsx)("h4",{children:"Prix"}),"EMDS"==t.tranc?Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant Total EMD:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.totalTTC,onChange:e=>{a((t=>({...t,totalTTC:parseFloat(e)})))}})]}):Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Prix de base:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.fare,onChange:e=>{a((t=>({...t,fare:parseFloat(e),totalTTC:parseFloat(e)+parseFloat(t.emd)+parseFloat(t.tax)+parseFloat(t.serviceFees)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Frais de service :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.serviceFees,onChange:e=>{a((t=>({...t,serviceFees:parseFloat(e),serviceFeesTVA:parseFloat(.19*e),totalTTC:parseFloat(t.fare)+parseFloat(t.emd)+parseFloat(t.tax)+parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"EMD :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.emd,onChange:e=>{a((t=>({...t,emd:parseFloat(e),totalTTC:parseFloat(t.fare)+parseFloat(e)+parseFloat(t.tax)+parseFloat(t.serviceFees)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"TVA (Frais de service) :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.serviceFeesTVA,disabled:!0})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Taxes :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:t.tax,onChange:e=>{a((t=>({...t,tax:parseFloat(e),totalTTC:parseFloat(t.fare)+parseFloat(t.emd)+parseFloat(t.serviceFees)+parseFloat(t.serviceFeesTVA)+parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Prix Total:"}),Object(he.jsxs)("div",{children:[" ",Object(he.jsx)("b",{style:{color:"darkcyan",fontSize:"25px"},children:t.totalTTC?t.totalTTC.toFixed(3):0})]})]})]})]})},li=e=>[{columns:[{title:"N\xb0 Billet",width:{wpx:120}},{title:"Client",width:{wpx:120}},{title:"Voyageur",width:{wpx:150}},{title:"Prix Total",width:{wpx:100}},{title:"Montant Rembours\xe9",width:{wpx:100}},{title:"date",width:{wpx:100}},{title:"Status",width:{wpx:100}},{title:"agent Amadeus",width:{wpx:100}}],data:e.map((e=>[{value:e.ticket?e.ticket.ticketNumber:"",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.client&&e.client.name?e.client.name:"-",style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.customer.name?e.customer.name:"",style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}},{value:e.totalPrice?Object(Qe.a)(e.totalPrice):"",style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:e.totalRefund?Object(Qe.a)(e.totalRefund):"",style:{fill:{fgColor:{rgb:"eeeeee"}},alignment:{horizontal:"center"}}},{value:e.ticket?e.ticket.emissionDate?me()(e.ticket.emissionDate).format("DD MMM YYYY"):"-":"",style:{font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}},{value:e.ticket&&!e.ticket.tranc?"TKTT":e.ticket?e.ticket.tranc:"",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:e.ticket?"EMDS"==e.ticket.tranc?"blue":"RFND"==e.ticket.tranc||"RFBSP"==e.ticket.tranc?"green":"EMDA"==e.ticket.tranc?"violet":"ADM"==e.ticket.tranc?"orange":"CANX"==e.ticket.tranc?"red":"yellow":"yellow"}},alignment:{horizontal:"center"}}},{value:e.ticket&&e.ticket.agent&&e.ticket.agent.name?e.ticket.agent.name:"",style:{font:{sz:"14",color:{rgb:"4c67c2"}},alignment:{horizontal:"center"}}}]))}];a(326);var ri=a(153),oi=a(163),di=a.n(oi),ji=a(361);const bi=e=>{let{airlineCode:t="TU",AgentName:a,isRoundTrip:s,segments:c=[{departAirport:"TUN",departTime:"11:00",departDate:"2023-01-19",arrivalAirport:"IST",arrivalDate:"2023-01-19",arrivalTime:"13:00",flightNumber:"125",class:"ECO",bagages:"2PCS",duration:"2H00"},{departAirport:"IST",departTime:"11:00",departDate:"2023-01-21",arrivalAirport:"IST",arrivalDate:"2023-01-21",arrivalTime:"13:30",flightNumber:"125",class:"ECO",bagages:"2PCS",duration:"2H30"}],...i}=e;const[l,r]=Object(n.useState)([]);return Object(he.jsx)("div",{className:di.a.ticket,children:Object(he.jsxs)("div",{className:di.a.itineraries,children:[Object(he.jsxs)("div",{children:[c[0]&&Object(he.jsx)("img",{alt:c[0].airCode,src:"https://daisycon.io/images/airline/?width=300&height=150&color=ffffff&iata="+c[0].airCode}),Object(he.jsxs)("span",{children:["Agent : ",a]})]}),c.map(((e,t)=>Object(he.jsxs)("div",{className:di.a.itinerary,children:[Object(he.jsxs)("div",{children:[Object(he.jsxs)("b",{children:[e.departAirport,Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#888",fontSize:"12px"},children:e.departCity})]}),Object(he.jsx)(Ae.a,{color:"green",children:e.class}),Object(he.jsx)("span",{className:di.a.duration,children:e.duration}),Object(he.jsx)(Ae.a,{color:"orange",children:"Bagages :"+e.bagages}),Object(he.jsxs)("b",{children:[e.arrivalAirport," ",Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#888",fontSize:"12px"},children:e.arrivalCity})]})]}),Object(he.jsxs)("div",{className:di.a.duration,children:[" ",Object(he.jsx)("div",{style:{textAlign:"center",flexGrow:2,color:"rgb(70,103,209,1)",position:"relative",top:"-15px"},children:Object(he.jsx)(ji.a,{size:"30px"})})]}),Object(he.jsxs)("div",{style:{padding:"0 10px"},children:[Object(he.jsxs)("b",{children:[e.departDate?e.departDate.substring(0,10):"",Object(he.jsx)("br",{})," ",e.departTime]}),Object(he.jsxs)("b",{style:{textAlign:"right"},children:[e.arrivalDate?e.arrivalDate.substring(0,10):"",Object(he.jsx)("br",{})," ",e.arrivalTime]})]})]})))]})})};function hi(e){let{_model:t}=e;const[a,s]=Object(n.useState)({});return Object(n.useEffect)((()=>{s((e=>t))}),[t.id]),a.id?Object(he.jsxs)("div",{children:[Object(he.jsxs)(re.a,{l:5.5,margin:"5px 2%",xl:5.5,className:"p-5",style:{borderRadius:"5px"},children:[Object(he.jsxs)("div",{children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"N\xb0Ticket : "})," ",a.ticket.ticketNumber," "]}),Object(he.jsxs)("div",{children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"PNR : "})," ",a.ticket.pnr," "]}),Object(he.jsxs)("div",{children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"Statut : "})," ",Object(he.jsx)(Ae.a,{color:"EMDS"==a.ticket.tranc?"blue":"RFND"==a.ticket.tranc?"green":"AMDA"==a.ticket.tranc?"violet":"CANX"==a.ticket.tranc?"black":"yellow",children:a.ticket.tranc})," "]}),Object(he.jsxs)("div",{children:[Object(he.jsxs)("strong",{style:{color:"rgb(70,103,209,1)"},children:["Date d'emission :"," "]})," ",me()(a.ticket.doEmmission).format("DD MMM YYYY")," "]}),Object(he.jsxs)("div",{children:[Object(he.jsxs)("strong",{style:{color:"rgb(70,103,209,1)"},children:["Date de remboursement :"," "]})," ",a.ticket.refundDate?me()(a.ticket.refundDate).format("DD MMM YYYY"):" - "," "]}),Object(he.jsx)("hr",{}),Object(he.jsxs)("div",{children:[Object(he.jsxs)("strong",{style:{color:"rgb(70,103,209,1)"},children:["Nom Voyageur :"," "]}),a.customer.name," "]})]}),Object(he.jsxs)(re.a,{margin:"5px 2%",l:5.5,xl:5.5,className:"p-5",style:{borderRadius:"5px"},children:[Object(he.jsx)("h4",{children:"D\xe9tails Du Prix "}),Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"Fare : "}),Object(he.jsx)("b",{children:a.ticket.fare})]})," ",Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"EMD : "}),Object(he.jsxs)("b",{children:[" ",a.ticket.emd]})]}),Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"Taxes : "}),Object(he.jsxs)("b",{children:[" ",a.ticket.tax]})]}),Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",borderTop:"1px dashed #eee",marginTop:"5px"},children:[Object(he.jsxs)("strong",{style:{color:"rgb(70,103,209,1)"},children:["Prix De Billet :"," "]}),Object(he.jsxs)("b",{children:[" ",a.fare]})]}),Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(he.jsx)("strong",{style:{color:"rgb(70,103,209,1)"},children:"Commission : "}),Object(he.jsx)("b",{children:a.ticket.commission})]}),Object(he.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",borderTop:"1px dashed #eee",marginTop:"17px"},children:[Object(he.jsx)("strong",{children:"Prix De Vente : "}),Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"18px"},children:[a.totalPrice.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:a.currency?a.currency.code:"TND"})]})]})]}),Object(he.jsx)(bi,{airlineCode:a.ticket.airlineCode,segments:a.ticket.segments,AgentName:a.ticket.agent?a.ticket.agent.name:""})]}):Object(he.jsx)(he.Fragment,{children:"... loading "})}var ui=e=>{let{size:t,open:a,handleClose:n,model:s}=e;return Object(he.jsxs)(at.a,{size:t||"lg",overflow:!1,open:a,onClose:n,children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"D\xe9tails Ticket"})}),Object(he.jsx)(at.a.Body,{children:Object(he.jsx)(hi,{_model:s})}),Object(he.jsx)(at.a.Footer,{children:Object(he.jsx)(je.a,{onClick:n,appearance:"subtle",children:"fermer"})})]})};class pi{constructor(){this.date=new Date,this.customer=new Je,this.totalPrice=0,this.totalRefund=0,this.commission=0,this.fare=0,this.note="",this.ref="",this.ticket=new mi}}class mi{constructor(){this.ticketNumber="",this.pnr="",this.note="",this.tranc="TKTT",this.totalDoc=0,this.refundTax=0,this.commission=0,this.emd=0,this.serviceFeesTVA=0,this.serviceFees=0,this.riz="",this.totalRefund=0,this.taxRefund=0,this.commissionRefund=0,this.refundPenalty=0,this.segments=[]}}const xi=Object(I.b)({key:"ticketingSate",default:new pi});function Oi(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)([]),[b,h]=Object(n.useState)([]),[u,p]=Object(n.useState)(0),[m,x]=(Object(I.d)(w),Object(n.useState)([])),[O,g]=Object(n.useState)(null),[f,y]=Object(n.useState)(null),[v,_]=Object(n.useState)(0),[C,N]=Object(n.useState)(0),[E,S]=Object(n.useState)(0),[D,k]=Object(n.useState)(0),[P,A]=Object(n.useState)(0),T=Object(I.d)(B),[R,U]=Object(n.useState)({page:1,take:20,clientId:0,tranc:"All",date:null,dateTo:null,dateFrom:null}),[L,F]=Object(n.useState)(""),[z,K]=Object(I.c)(xi),[W,Y]=Object(n.useState)([]),[G,V]=Object(I.c)(Oe.a),H=()=>{K(new pi),F("")},q=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?c(e.data):l(e.data)))},Z=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight,{q:e},"/autocomplete").customGet().then((e=>j(e.data)))},J=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Tag,{q:e},"/autocomplete").customGet().then((e=>h(e.data)))},$=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Common,{q:e},"/autocompleteAirlines").customGet().then((e=>Y(e.data)))},X=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;V((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/ticket",{...R,date:R.date?me()(R.date).format("DD MMM YYYY"):null,page:e||R.page}).fetchAll().then((e=>{V((e=>({...e,loading:!1}))),x([]),console.log(e.data.data.filter((e=>e.ticket.emd))),a(e.data.data),V((e=>({...e,loading:!1}))),_(e.data.totalCount),N(e.data.totalSale),S(e.data.totalRefund),k(e.data.totalCommission),V((e=>({...e,loading:!1})))})).catch((e=>F(e.Message)))},Q=e=>{F(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order).fetchById(e).then((e=>{K({...e.data})})).catch((e=>{console.log(e)}))};Object(n.useEffect)((()=>{q(),$(),J(),Z()}),[]),Object(n.useEffect)((()=>{X()}),[R.page,R.take]);const ee=[{value:"ticket",value2:"tag",value3:"id",name:"N\xb0",render:(e,t,a)=>Object(he.jsxs)("b",{style:{fontSize:"14px"},children:[Object(he.jsx)("img",{alt:"",src:e&&e.airlineCode&&W.find((t=>t.id==e.airlineCode))?W.find((t=>t.id==e.airlineCode)).logo:""}),Object(he.jsx)(Gt.a,{onChange:e=>{m.find((e=>e==a))?x((e=>e.filter((e=>e!=a)))):x((e=>[...e,a]))},checked:null!=m.find((e=>e==a))}),Object(he.jsx)("a",{style:{color:"#232323"},onClick:e=>{p(a),Q(a)},children:e?e.ticketNumber:""}),Object(he.jsx)("br",{}),t&&Object(he.jsxs)(Ae.a,{color:e?"blue":"black",children:["#",t]})]})},{value:"client",name:"Client",render:e=>Object(he.jsx)("a",{children:e&&e.name?e.name.toUpperCase():""})},{value:"ticket",name:"PNR",render:e=>Object(he.jsx)("b",{style:{color:"#5a2c3e",fontSize:"13px"},children:e?e.pnr:""})},{value:"customer",value2:"tag",name:"Voyageur",render:(e,t)=>Object(he.jsxs)("a",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",width:"100px"},children:[e?e.name.toUpperCase():"",Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#aaa"},children:e?e.passportNumber:""})]})},{value:"totalPrice",value2:"currency",value3:"status",name:"Prix",render:(e,t,a)=>Object(he.jsxs)("b",{style:{color:"#53af50",fontSize:"16px",textDecoration:5==a?"line-through":""},children:[e.toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t.code})]})},{value:"commission",value3:"commissionRefund",value2:"currency",name:"Com.",render:(e,t,a)=>Object(he.jsxs)("b",{style:{color:"#5a2c3e",fontSize:"15px"},children:[(e+a).toFixed(3)+" ",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:t.code})]})},{value:"ticket",name:"Statut",render:e=>Object(he.jsx)(he.Fragment,{children:Object(he.jsx)(Ae.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:e=>Object(he.jsx)(he.Fragment,{children:e&&Object(he.jsx)(Ae.a,{color:"violet",children:e&&e.emdNumber})})},{value:"ticket",value2:"currency",name:"EMD",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"rgb(67,55,160)",fontSize:"16px"},children:[e?e.emd.toFixed(3):"-",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:e?t.code:""})]})},{value:"totalRefund",value2:"currency",name:"M.Remb.",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"rgb(67,55,160)",fontSize:"16px"},children:[e?e.toFixed(3):"-",Object(he.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:e?t.code:""})]})},{value:"ticket",name:"Date",render:e=>Object(he.jsx)("strong",{children:e?me()(e.emissionDate).format("DD MMM YYYY"):"-"})},{name:"d\xe9tails",value:"id",render:e=>Object(he.jsx)("button",{onClick:t=>{p(e),Q(e)},style:{color:"rgba(67,55,160,1)",padding:"6px 10px",fontSize:"12px",background:"rgba(67,55,160,0.1)",borderRadius:"4px"},children:Object(he.jsx)(bt.a,{})})}],te=e=>{let t=new Date(2e3+parseInt(e.slice(-2)),(a=e.slice(2,5),["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].findIndex((e=>e.toUpperCase()==a))),e.slice(0,2));var a;return me()(t).format("YYYY-MM-DDTHH:mm:ss")};const ae=(e,t)=>{M.a.createAPIEndpoint(be.a.Order+"/Ticket").create(t[e]).then((a=>{e{console.log(a),console.log("index: ",e),eX(1),children:[Object(he.jsxs)(re.a,{m:6,l:3,xl:2.5,className:"p-5",children:[Object(he.jsx)("label",{children:"Recherche Multiple "}),Object(he.jsx)(de.a,{placeholder:"voyageur / pnr / n\xb0 ticket",value:R.q,onChange:e=>{U((t=>({...t,q:e.trim()})))}})]}),Object(he.jsxs)(re.a,{m:6,l:3,xl:2.5,className:"p-5",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>q(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:R.clientId,onSelect:e=>{U((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2,xl:1.5,className:"p-5",children:[Object(he.jsx)("label",{children:"Status: "}),Object(he.jsx)(Fe.a,{searchable:!1,data:we.x,block:!0,noSearch:!0,value:R.tranc,onSelect:e=>{U((t=>({...t,tranc:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2.5,xl:2,className:"p-5",children:[Object(he.jsx)("label",{children:"Dates: "}),Object(he.jsx)(Fe.a,{data:we.q,block:!0,noSearch:!0,value:R.dateType,onSelect:e=>{let t=new Date(me()(Date.now()).format("yyyy-MM-DD"));console.log(t),U((a=>({...a,dateType:e,date:7==e||1==e?t:2==e?me()(me()(Date.now()).add(-1,"d")).format("yyyy-MM-DD"):null,dateFrom:6==e?t:3==e?me()().startOf("month").format("yyyy-MM-DD"):4==e?me()(Date.now()).subtract(1,"months").startOf("month").format("yyyy-MM-DD"):5==e?me()().startOf("year").format("yyyy-MM-DD"):null,dateTo:6==e?new Date(me()(me()(Date.now()).add(1,"d")).format("yyyy-MM-DD")):3==e?t:4==e?me()(Date.now()).subtract(1,"months").endOf("month").format("yyyy-MM-DD"):null})))}})]}),7==R.dateType&&Object(he.jsxs)(re.a,{m:6,l:3,xl:2,className:"p-5",children:[Object(he.jsx)("label",{children:"Date: "}),Object(he.jsx)(de.a,{type:"date",value:R.date,onChange:e=>{U((t=>({...t,date:e})))}})]}),6==R.dateType&&Object(he.jsxs)(re.a,{m:6,l:3,xl:3,className:"p-5",children:[Object(he.jsx)("label",{children:"Plage du temps: "}),Object(he.jsx)(nt.a,{block:!0,value:[R.dateFrom,R.dateTo],onChange:e=>{U((t=>({...t,dateFrom:e[0],dateTo:e[1]})))}})]})]}),Object(he.jsx)(ge.a,{excelData:li(t),nameExcel:"sale",additionalBtn:Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("input",{id:"hidden",style:{visibility:"hidden",width:"0",height:0,overflow:"hidden"},type:"file",onChange:e=>{ri.utils.book_new();const t=e.target.files;if(t.length){const e=t[0],a=new FileReader;a.onload=e=>{const t=Object(ri.read)(e.target.result,{cellDates:!0,dateNF:"YYYY-MM-DD",type:"array"}),a=t.SheetNames;if(console.log(t.Sheets[a[0]]),a.length){console.log(t.Sheets[a[0]]);let e=ri.utils.sheet_to_json(t.Sheets[a[0]],{blankrows:!1,raw:!0});console.log(e.length);let n=e.map(((e,t)=>{let a=new pi;a.clientName=e["Nom Agence"],a.tag=e["Nom Agence"].startsWith("UMRAH ")||e["Nom Agence"].startsWith("VO ")?e["Nom Agence"]:"";let n=new Je;a.totalPrice=e["Prix vente"],n.birthDate=e.birthdate?te(e.birthdate):null,n.name=e["Nom Client"],n.passportNumber=e.passportNumber,n.expirationPassportDate=e.passportExpirationDate?te(e.passportExpirationDate):null,n.gender="M"==e.gender?1:2,a.customer=n;let s=new mi;return s.ticketNumber=e["Numero ticket"],s.commission=e.Commissions,a.commission=e.Commissions,s.pnr=e.PNR,s.tranc=e.Statut,s.emissionDate=e["Date Emission"],s.totalRefund=e["Montant Rembours\xe9"],a.totalRefund=e["Montant Rembours\xe9"],s.tax=e.Tax,s.fare=e.Fare,a.fare=e["Prix billet"],s.totalDoc=e["Prix billet"],s.airlineCode=e.Airline,s.refundDate=e["Date de Remboursement"],a.dateRefund=e["Date de Remboursement"],e["Agent Amadeus"]&&e["Agent Amadeus"].length>2&&T.find((t=>t.name==e["Agent Amadeus"].trim()))&&(s.agentId=T.find((t=>t.name==e["Agent Amadeus"])).id),a.ticket=s,a}));console.log(n.length),ae(0,n)}},a.readAsArrayBuffer(e)}},accept:".xlsx,.xls"}),Object(he.jsx)("div",{style:{textAlign:"right"},children:Object(he.jsxs)("button",{onClick:()=>{const 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:()=>{console.log(z),V((e=>({...e,loading:!0})));let e={...z};delete e.tags,z.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/ticket").update(e.id,e).then((e=>{X(),V((e=>({...e,open:!1,loading:!1}))),H(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{F(e.Message),V((e=>({...e,loading:!1})))})):(console.log(e),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/ticket").create(e).then((e=>{X(),H(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),V((e=>({...e,open:!1,loading:!1})))})).catch((e=>{F(e.Message),V((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(si,{tags:b,fetchTags:J,error:L,clients:s,airlines:W,fetchAirlines:$,fetchClients:e=>q(e,!1),fetchAgentBookingFlights:Z,agentBookingFlights:d})}),Object(he.jsxs)("div",{children:[Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{icon:Object(he.jsx)(zn.a,{}),notAmount:!0,text:"Total Billets",color:"245,195,35",amount:v})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Vente",color:"0,169,141",amount:C})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Remboursement",amount:E,color:"229,57,53"})}),Object(he.jsx)(re.a,{className:"p-10",xs:6,s:6,m:6,l:3,xl:3,children:Object(he.jsx)(lt.a,{text:"Total Commission",amount:D})})]}),Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{onClick:e=>x((e=>e.length?[]:t.map((e=>e.id)))),style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(he.jsx)(Gt.a,{checked:m.length>0})," S\xe9lectionner Tout"]}),m.length?Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)(re.a,{m:6,l:3,xl:3,className:"p-10",children:Object(he.jsx)(Fe.a,{searchable:!1,data:s.map((e=>({value:e.id,label:e.name}))),block:!0,noSearch:!0,value:O,onSelect:e=>{g(e),alert(e)}})})," ",Object(he.jsxs)("button",{onClick:()=>{m.map(((e,t)=>M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/ChangeClient").create({id:e,clientId:O}).then((e=>{t==m.length-1&&X()})).catch((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(he.jsx)(Ss.a,{})," "," ","enregistrer"]})]}):""]}),Object(he.jsx)(ye.a,{loading:G.loading,actionKey:"id",actions:[{label:"rembourser",action:e=>{"TKTT"===t.find((t=>t.id===e)).ticket.tranc&&y(e)},render:(e,a)=>Object(he.jsx)("button",{disabled:!["TKTT","EMDS"].includes(t.find((e=>e.id===a)).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:e=>{var a;"TKTT"===t.find((t=>t.id===e)).ticket.tranc&&(a=e,F(""),M.a.createAPIEndpoint(M.a.ENDPOINTS.Order,{},"/Cancel/"+a).customGet().then((e=>{X()})).catch((e=>{console.log(e)})))},render:(e,a)=>Object(he.jsx)("button",{disabled:!["TKTT","EMDS"].includes(t.find((e=>e.id===a)).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:e=>{A(e)},render:(e,a)=>Object(he.jsx)("button",{disabled:["CANX"].includes(t.find((e=>e.id===a)).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:ee,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.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:R.take,activePage:R.page,onChangePage:e=>{window.scrollTo(0,0),U((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),U((t=>({...t,take:e})))}})}),Object(he.jsx)(ui,{model:z,open:0!=u,handleClose:()=>p(0)}),Object(he.jsx)(gi,{refresh:X,open:f,handleClose:()=>{y(null),X()}}),Object(he.jsx)(fi,{clientId:t.find((e=>e.id==P))&&t.find((e=>e.id==P)).clientId,id:P,open:0!=P,handleClose:()=>A(0),refresh:X})]})}const gi=e=>{let{size:t,open:a,handleClose:s,clientId:c,refresh:i}=e;const[l,r]=Object(n.useState)({id:0,date:"2022-08-11T10:06:09.649Z",totalRefund:0,commissionRefund:0});Object(n.useEffect)((()=>{r((e=>({date:"2022-08-11T10:06:09.649Z",totalRefund:0,commissionRefund:0,id:a})))}),[a]);return Object(he.jsxs)(at.a,{size:t||"lg",overflow:!1,open:a,onClose:s,children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"Rembourser Ticket"})}),Object(he.jsxs)(at.a.Body,{children:[Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date de remboursement:"}),Object(he.jsx)(de.a,{type:"date",value:l.date,onChange:e=>r({...l,date:e})})]}),Object(he.jsx)("h6",{children:"Remboursement"}),Object(he.jsxs)(re.a,{s:6,m:6,l:3,xl:3,className:"p-10",children:[Object(he.jsx)("label",{children:"Frais de service :"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:l.commissionRefund,onChange:e=>{r((t=>({...t,commissionRefund:parseFloat(e)})))}})]}),Object(he.jsxs)(re.a,{s:6,m:6,l:4,xl:4,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant Total \xe0 rembourser:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:l.totalRefund,onChange:e=>{r((t=>({...t,totalRefund:parseFloat(e)})))}})]})]}),Object(he.jsxs)(at.a.Footer,{children:[Object(he.jsx)(je.a,{onClick:()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/RFND").create(l).then((e=>{s(),i()})).catch((e=>{console.log(e)}))},appearance:"primary",children:"rembourser"})," ",Object(he.jsx)(je.a,{onClick:s,appearance:"subtle",children:"fermer"})]})]})},fi=e=>{let{open:t,handleClose:a,id:s,clientId:c,refresh:i}=e;const[l,r]=Object(n.useState)(0);return Object(n.useEffect)((()=>{r(0)}),[s]),Object(he.jsxs)(at.a,{size:"sm",overflow:!1,open:t,onClose:a,children:[Object(he.jsx)(at.a.Header,{children:Object(he.jsx)(at.a.Title,{children:"Changer Commission Ticket"})}),Object(he.jsx)(at.a.Body,{children:Object(he.jsxs)(re.a,{s:6,m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Montant :"}),Object(he.jsx)(de.a,{type:"number",value:l,onChange:e=>r(parseFloat(e))})]})}),Object(he.jsxs)(at.a.Footer,{children:[Object(he.jsx)(je.a,{onClick:()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/CommissionClient").create({id:s,commission:l,clientId:c}).then((e=>{a(),i()})).catch((e=>{console.log(e)}))},appearance:"primary",children:"modifier"})," ",Object(he.jsx)(je.a,{onClick:a,appearance:"subtle",children:"fermer"})]})]})};var yi=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}}),Object(he.jsx)("label",{children:"Ville"}),Object(he.jsx)(de.a,{value:n.city,onChange:e=>{t((t=>({...t,city:e})))}}),Object(he.jsx)("label",{children:"Adresse"}),Object(he.jsx)(de.a,{value:n.address,onChange:e=>{t((t=>({...t,address:e})))}}),Object(he.jsx)("label",{children:"Emails"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.emails?n.emails.split(","):[],onChange:e=>{let a={...n};a.emails=e.join(","),t(a)}}),Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.phones?n.phones.split(","):[],onChange:e=>{n.phones=e.join(",");let a={...n};t(a)}}),Object(he.jsx)("label",{children:"Code Tax "}),Object(he.jsx)(de.a,{value:n.taxCode,onChange:e=>{t((t=>({...t,taxCode:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};const vi=e=>(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((e=>[{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 _i(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20,clientType:1,isCCA:!0}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)(new Ue(1,!0)),[b,h]=Object(I.c)(Oe.a),u=()=>{j(new Ue(1,!0)),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>p()),[]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>p(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{excelData:vi(t),nameExcel:"client",size:"md",save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{code:"Code"},{taxCode:"Tax Code"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(yi,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),j(t.find((t=>t.id==e)))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Ci,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Ci=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})},{value:"taxCode",name:"Code Tax",render:e=>Object(he.jsx)("b",{style:{color:"green"},children:e})},{value:"address",name:"Adresse",render:e=>Object(he.jsx)("i",{style:{color:"#232323"},children:e})},{value:"emails",name:"Emails",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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 Ii=function(e){let{_setmodel:t,error:a,model:n,clients:s,fetchClients:c}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}}),Object(he.jsx)("label",{children:"Ville"}),Object(he.jsx)(de.a,{value:n.city,onChange:e=>{t((t=>({...t,city:e})))}}),Object(he.jsx)("label",{children:"Adresse"}),Object(he.jsx)(de.a,{value:n.address,onChange:e=>{t((t=>({...t,address:e})))}}),Object(he.jsx)("label",{children:"Emails"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.emails?n.emails.split(","):[],onChange:e=>{let a={...n};a.emails=e.join(","),t(a)}}),Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.phones?n.phones.split(","):[],onChange:e=>{n.phones=e.join(",");let a={...n};t(a)}}),Object(he.jsx)("label",{children:"Code Tax "}),Object(he.jsx)(de.a,{value:n.taxCode,onChange:e=>{t((t=>({...t,taxCode:e})))}}),Object(he.jsx)("label",{children:"Commission Voyage Organis\xe9:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:n.voCommission,onChange:e=>{t((t=>({...t,voCommission:parseFloat(e)})))}}),Object(he.jsx)("label",{children:"Commission Omrah:"}),Object(he.jsx)(de.a,{type:"number",step:"0.1",value:n.umrahCommission,onChange:e=>{t((t=>({...t,umrahCommission:parseFloat(e)})))}}),Object(he.jsx)("label",{children:"Appartient Au Client"}),Object(he.jsx)(Fe.a,{onSearch:e=>c(e),data:[{label:"Tout",value:null}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:n.belongsToClientId,onSelect:e=>{t((t=>({...t,belongsToClientId:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};const Ni=e=>(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((e=>[{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 Ei(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)({q:"",page:1,take:50,clientType:1,isCCA:!1}),[d,j]=Object(n.useState)(""),[b,h]=Object(n.useState)(new Ue),[u,p]=Object(I.c)(Oe.a),m=()=>{h(new Ue),j("")},x=()=>{p((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,r).fetchAll().then((e=>{a(e.data.data),p((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))}))},O=function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>l(e.data)))};return Object(n.useEffect)((()=>{x(),O()}),[r.page,r.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>x(),children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{o((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{ActionOnClose:m,excelData:Ni(t),nameExcel:"client",size:"md",save:()=>{let e=Object(Be.a)(b,[{name:"Nom"},{taxCode:"Tax Code"}]);e?j(e):(p((e=>({...e,loading:!0}))),b.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).update(b.id,b).then((e=>{x(),p((e=>({...e,open:!1,loading:!1}))),m(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).create(b).then((e=>{console.log(e),x(),m(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),p((e=>({...e,open:!1,loading:!1})))})).catch((e=>{j(e.Message),p((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Ii,{error:d,model:b,_setmodel:h,clients:i,fetchClients:e=>O(e,!1)})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(""),h(t.find((t=>t.id==e)))})(e),p((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).delete(e).then((e=>{x(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>j(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Si,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:r.take,activePage:r.page,onChangePage:e=>{window.scrollTo(0,0),o((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),o((t=>({...t,take:e,page:1})))}})}),Object(he.jsx)("button",{onClick:()=>{let e=i.filter((e=>!e[1].includes("VO ")&&!e[1].includes("UMRA ")&&!e[1].includes("KOUNOUZ ")));e.map((e=>{let t=new Ue;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((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Client).create(t).then((e=>{})).catch((e=>{}))}),2e3)})),console.log(e)},children:"setClients"})]})}const Si=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})},{value:"taxCode",name:"Code Tax",render:e=>Object(he.jsx)("b",{style:{color:"green"},children:e})},{value:"address",name:"Adresse",render:e=>Object(he.jsx)("i",{style:{color:"#232323"},children:e})},{value:"emails",name:"Emails",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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 Di=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}}),Object(he.jsx)("label",{children:"Ville"}),Object(he.jsx)(de.a,{value:n.city,onChange:e=>{t((t=>({...t,city:e})))}}),Object(he.jsx)("label",{children:"Adresse"}),Object(he.jsx)(de.a,{value:n.address,onChange:e=>{t((t=>({...t,address:e})))}}),Object(he.jsx)("label",{children:"Emails"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.emails?n.emails.split(","):[],onChange:e=>{let a={...n};a.emails=e.join(","),t(a)}}),Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.phones?n.phones.split(","):[],onChange:e=>{n.phones=e.join(",");let a={...n};t(a)}}),Object(he.jsx)("label",{children:"Code Tax "}),Object(he.jsx)(de.a,{value:n.taxCode,onChange:e=>{t((t=>({...t,taxCode:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};const ki=e=>(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((e=>[{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?we.u.filter((t=>e.serviceTypes.includes(t.value))).map((e=>e.label)).join():"",style:{fill:{fgColor:{rgb:"eeeeee"}},font:{sz:"13",color:{rgb:"2590b5"}},alignment:{horizontal:"center"}}}]))}]);function Pi(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)(new Re),[b,h]=Object(I.c)(Oe.a),u=()=>{j(new Re),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Creditor,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{p()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>p(),children:Object(he.jsxs)("div",{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{code:"Code"},{taxCode:"Tax Code"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Creditor).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Creditor).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Di,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),j(t.find((t=>t.id==e)))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Creditor).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Ai,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e})))}})})]})}const Ai=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})},{value:"taxCode",name:"Code Tax",render:e=>Object(he.jsx)("b",{style:{color:"green"},children:e})},{value:"address",name:"Adresse",render:e=>Object(he.jsx)("i",{style:{color:"#232323"},children:e})},{value:"emails",name:"Emails",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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 Mi=function(e){let{_setmodel:t,error:a,model:n}=e;const s=Object(I.d)(F);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Services Fournies "}),Object(he.jsx)(os.a,{data:we.u,block:!0,onSelect:e=>{console.log(e),t((t=>({...t,serviceTypes:e.join()})))},onChange:e=>{console.log(e),t((t=>({...t,serviceTypes:e.join()})))},value:n.serviceTypes?n.serviceTypes.split(",").map((e=>parseInt(e))):null}),Object(he.jsx)("label",{children:"Devis "}),Object(he.jsx)(os.a,{data:s.map((e=>({label:e.name,value:e.id}))),block:!0,onSelect:e=>{console.log(e),t((t=>({...t,currencies:e.map((e=>({currencyId:e})))})))},onChange:e=>{console.log(e),t((t=>({...t,currencies:e.map((e=>({currencyId:e})))})))},value:n.currencies?n.currencies.map((e=>e.currencyId)):null}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}}),Object(he.jsx)("label",{children:"Type"}),Object(he.jsx)(Fe.a,{block:!0,data:[{label:"Terrestre",value:1},{label:"Aerien",value:2}],searchable:!1,style:{width:224},value:n.type,onChange:e=>{t((t=>({...t,type:e})))}}),Object(he.jsx)("label",{children:"Ville"}),Object(he.jsx)(de.a,{value:n.city,onChange:e=>{t((t=>({...t,city:e})))}}),Object(he.jsx)("label",{children:"Adresse"}),Object(he.jsx)(de.a,{value:n.address,onChange:e=>{t((t=>({...t,address:e})))}}),Object(he.jsx)("label",{children:"Emails"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.emails?n.emails.split(","):[],onChange:e=>{let a={...n};a.emails=e.join(","),t(a)}}),Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{block:!0,size:"md",value:n.phones?n.phones.split(","):[],onChange:e=>{n.phones=e.join(",");let a={...n};t(a)}}),Object(he.jsx)("label",{children:"Code Tax "}),Object(he.jsx)(de.a,{value:n.taxCode,onChange:e=>{t((t=>({...t,taxCode:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Ti(e){const[t,a]=Object(n.useState)(Bi),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20,serviceType:0}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)(new Le),[b,h]=Object(I.c)(Oe.a),u=()=>{j(new Le),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{p()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Services Fournies :"}),Object(he.jsx)(Fe.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(we.u),block:!0,noSearch:!0,value:i.serviceType,onSelect:e=>{l((t=>({...t,serviceType:e})))}})]})]}),Object(he.jsx)(ge.a,{ActionOnClose:u,size:"md",excelData:ki(t),save:()=>{let e=Object(Be.a)(d,[{name:"Nom"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider).update(d.id,{...d}).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider).create({...d}).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Mi,{error:r,model:d,_setmodel:j,serviceTypes:we.u})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),j(t.find((t=>t.id==e)))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Provider).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:wi,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e,page:1})))}})})]})}const wi=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})},{value:"taxCode",name:"Code Tax",render:e=>Object(he.jsx)("b",{style:{color:"green"},children:e})},{value:"address",name:"Adresse",render:e=>Object(he.jsx)("i",{style:{color:"#232323"},children:e})},{value:"emails",name:"Emails",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&we.u.filter((t=>e.includes(t.value))).map(((e,t)=>Object(he.jsx)(Ae.a,{color:"violet",children:e.label})))})}],Bi=[{id:1,code:"TND",name:"Dinar"}];var Ri=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}})," ",Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Ui(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:"",code:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:"",code:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{p()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{code:"Code"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Ri,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(t.find((t=>t.id==e))),o("")})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Bank).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Li,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e,page:1})))}})})]})}const Li=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})}];var Fi=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}})," ",Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function zi(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:"",code:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:"",code:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{p()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{code:"Code"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Fi,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(t.find((t=>t.id==e))),o("")})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Checkout).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Ki,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e,page:1})))}})})]})}const Ki=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},,{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})}];var Wi=function(e){let{_setmodel:t,error:a,model:n}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,name:e})))},value:n.name}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}})," ",Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function Yi(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({name:"",code:""}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({name:"",code:""}),o("")},p=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.RecoveryPoint,i).fetchAll().then((e=>{a(e.data.data),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{p()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>p(),children:[" ",Object(he.jsxs)("div",{className:"p-10",children:[" ",Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]})]}),Object(he.jsx)(ge.a,{size:"md",noExport:!0,save:()=>{let e=Object(Be.a)(d,[{name:"Nom"},{code:"Code"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.RecoveryPoint).update(d.id,d).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.RecoveryPoint).create(d).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},AddComponent:Object(he.jsx)(Wi,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(t.find((t=>t.id==e))),o("")})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.RecoveryPoint).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Gi,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),l((t=>({...t,take:e,page:1})))}})})]})}const Gi=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"code",name:"Code",render:e=>Object(he.jsx)("b",{children:e})}];class Vi{constructor(){this.userName="",this.email="",this.phoneNumber="",this.firstName="",this.lastName="",this.position="SimpleUser",this.password=""}}var Hi=function(e){let{_setmodel:t,error:a,model:n,clients:s,fetchClients:c}=e;return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,lastName:e})))},value:n.lastName}),Object(he.jsx)("label",{children:"Pr\xe9nom:"}),Object(he.jsx)(de.a,{onChange:e=>{t((t=>({...t,firstName:e})))},value:n.firstName}),Object(he.jsx)("label",{children:"Code"}),Object(he.jsx)(de.a,{value:n.code,onChange:e=>{t((t=>({...t,code:e})))}}),Object(he.jsx)("label",{children:"T\xe9lephone"}),Object(he.jsx)(de.a,{value:n.phoneNumber,onChange:e=>{t((t=>({...t,phoneNumber:e})))}}),Object(he.jsx)("label",{children:"Email"}),Object(he.jsx)(de.a,{type:"email",value:n.email,onChange:e=>{t((t=>({...t,email:e,userName:e})))}}),Object(he.jsx)("label",{children:"Mot de passe"}),Object(he.jsx)(de.a,{type:"password",value:n.password,onChange:e=>{t((t=>({...t,password:e})))}}),Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>c(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:n.clientId,onSelect:e=>{t((t=>({...t,clientId:e})))}}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function qi(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(I.c)(Oe.a),[r,o]=Object(n.useState)([]),[d,j]=Object(n.useState)(""),[b,h]=Object(n.useState)(new Vi),u=()=>{h(new Vi),j("")},p=()=>{l((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Accounts,{page:1,take:1e3}).fetchAll().then((e=>{a(e.data.filter((e=>"admin"!=e.userName)))})).catch((e=>j(e.Message)))},m=function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>o(e.data)))};return Object(n.useEffect)((()=>{p(),m()}),[]),Object(he.jsxs)("div",{children:[Object(he.jsx)(ge.a,{noExport:!0,size:"md",save:()=>{b.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Accounts).update(b.id,b).then((e=>{p(),l((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message)})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Accounts).create(b).then((e=>{p(),u(),l((e=>({...e,open:!1,loading:!1}))),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{j(e.Message)}))},AddComponent:Object(he.jsx)(Hi,{clients:r,fetchClients:e=>m(e,!1),error:d,model:b,_setmodel:h})}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{j(""),h(t.find((t=>t.id==e)))})(e),l((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Accounts).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>j(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:Zi,rows:t})]})}const Zi=[{value:"firstName",value2:"lastName",name:"Nom",render:(e,t)=>Object(he.jsx)("a",{children:e+" "+t})},{value:"email",name:"Email",render:e=>Object(he.jsx)("b",{children:e})},{value:"phoneNumber",name:"T\xe9l",render:e=>Object(he.jsx)("b",{style:{color:"green"},children:e})}];function Ji(){const[e,t]=Object(n.useState)({items:[]}),[a,s]=Object(n.useState)([]),[c,i]=Object(n.useState)({packageUmrahId:0}),l=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{s(e.data)}))};return Object(n.useEffect)((()=>{l()}),[]),Object(he.jsxs)("div",{children:[Object(he.jsx)(fe.a,{search:()=>{M.a.createAPIEndpoint(be.a.Order,c,"/GetUmrahsStatistics").fetchAll().then((e=>t(e.data)))},children:Object(he.jsxs)(re.a,{className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{onSearch:l,data:[{label:"Tout",value:0}].concat(a.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:c.packageUmrahId,onSelect:e=>{i((t=>({...t,packageUmrahId:e})))}})]})}),Object(he.jsx)("div",{children:e.items.map((e=>Object(he.jsx)($i,{d:e})))})]})}const $i=e=>{let{d:t}=e;const[a,s]=Object(n.useState)(!1),[c,i]=Object(n.useState)(-1);return Object(he.jsxs)("div",{style:{padding:"5px",background:"#fff",borderRadius:"5px",margin:"10px 4px",position:"relative"},children:[Object(he.jsx)("button",{style:{position:"absolute",right:"6px",top:"5px"},onClick:()=>s((e=>!e)),children:"d\xe9tails"}),Object(he.jsxs)("b",{style:{display:"inline-flex",alignItems:"center",padding:"3px",borderRadius:"5px",marginBottom:"15px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:t.disponibility.airline?t.disponibility.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(t.disponibility.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",t.disponibility.airline?t.disponibility.airline.name:""]})]})]}),Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(he.jsx)("i",{children:"Total:"})," ",Object(he.jsx)("b",{style:{fontSize:"20px",margin:"0 4px"},children:t.total})," ",Object(he.jsxs)("div",{style:{display:"inline-flex",flex:1,height:"25px",background:"#f1f1f1",border:"1px solid #eee",marginLeft:"5px",borderRadius:"5px",overflow:"hidden"},children:[Object(he.jsxs)("div",{style:{display:"inline-block",width:(t.visasNumber+3)/t.total*100+"%",background:"rgb(76,103,194)",height:"25px",textAlign:"center",color:"#fff"},children:[t.visasNumber," visas"]}),Object(he.jsxs)("div",{style:{display:"inline-block",width:(t.sendedNumber+2)/t.total*100+"%",background:"#334455",height:"25px",textAlign:"center",color:"#fff"},children:[t.sendedNumber," envoy\xe9s"]}),Object(he.jsxs)("div",{style:{display:"inline-block",width:(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"]})]})]}),a&&Object(he.jsx)("div",{style:{paddingLeft:"2%"},children:t.items.map(((e,t)=>Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(he.jsxs)("a",{href:"#",onClick:()=>i((e=>e==t?-1:t)),style:{fontWeight:"bold"},children:[e.client.name,":"]})," ",Object(he.jsx)("b",{style:{fontSize:"20px",margin:"0 4px"},children:e.orders.length})," ",Object(he.jsxs)("div",{style:{display:"inline-flex",flex:1,height:"22px",background:"#f1f1f1",border:"1px solid #eee",marginLeft:"5px",borderRadius:"5px",overflow:"hidden"},children:[Object(he.jsxs)("div",{style:{display:"inline-block",width:(e.visasNumber+1)/e.orders.length*100+"%",background:"rgb(76,103,194)",height:"22px",textAlign:"center",color:"#fff"},children:[e.visasNumber," visas"]}),Object(he.jsxs)("div",{style:{display:"inline-block",width:(e.sendedNumber+1)/e.orders.length*100+"%",background:"#334455",height:"22px",textAlign:"center",color:"#fff"},children:[e.sendedNumber," envoy\xe9s"]}),Object(he.jsxs)("div",{style:{display:"inline-block",width:(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"]})]})]}),c==t&&Object(he.jsx)(ye.a,{columns:Xi,rows:e.orders})]})))})]})},Xi=[{value:"customer",name:"Client B2C",render:e=>Object(he.jsxs)("a",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[" ",e?e.name.toUpperCase():"",Object(he.jsx)("br",{})," ",Object(he.jsx)("i",{style:{color:"#aaa"},children:e?e.passportNumber:""})]})]})},{value:"gender",name:"Genre",render:e=>Object(he.jsx)(Ae.a,{color:1===e?"violet":"red",children:1===e?"male":"female"})},{value:"onlyTicket",value2:"withoutVisa",name:"Type",render:(e,t)=>Object(he.jsxs)("b",{style:{color:"#549f0a"},children:[e?Object(he.jsx)(Ae.a,{color:"blue",children:"Billet"}):""," ",t?Object(he.jsx)(Ae.a,{color:"orange",children:"sans visa"}):""]})},{value:"confirmationStatus",name:"Etat",render:e=>Object(he.jsx)(Ae.a,{color:2===e?"violet":3===e?"green":4===e?"red":"yellow",children:we.f.find((t=>null===e||t.value===e))?we.f.find((t=>null===e||t.value===e)).label:we.f.find((e=>1===e.value)).label})},{value:"fingerprint",name:"Empreinte",render:e=>e?Object(he.jsx)(jc.a,{color:"green"}):Object(he.jsx)("b",{children:"-"})}];var Qi=function(e){let{_setmodel:t,error:a,model:s}=e;const[c,i]=Object(n.useState)(null),[l,r]=Object(n.useState)(null);return Object(he.jsxs)(he.Fragment,{children:[Object(he.jsx)("h5",{children:"Les informations de l'agence pour la facture:"}),Object(he.jsx)("div",{style:{width:"100px",margin:"15px"},children:Object(he.jsx)(vt.a,{autoUpload:!1,action:"#",draggable:!0,fileListVisible:!1,onChange:e=>{console.log(e),r(e[e.length-1].blobFile),function(e,t){const a=new FileReader;a.onloadend=()=>{t(a.result)},a.readAsDataURL(e)}(e[e.length-1].blobFile,(e=>{t((t=>({...t,logo:e}))),i(e)}))},children:Object(he.jsx)("div",{style:{background:"rgba(200,200,200,0.1)",width:"100px",height:"100px",padding:"0"},children:c?Object(he.jsx)("img",{src:c,width:"100",height:"100",alt:""}):s.logo?Object(he.jsx)("img",{width:"100",height:"100",src:s.logo,alt:""}):Object(he.jsxs)(he.Fragment,{children:[" ",Object(he.jsxs)("div",{style:{fontSize:"40px"},children:[" ",Object(he.jsx)(ca.a,{color:"#3598ff"})]}),Object(he.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"LOGO"})]})})})}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom:"}),Object(he.jsx)(de.a,{value:s.name,onChange:e=>{t((t=>(console.log(t),{...t,name:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Matricule Fiscale :"}),Object(he.jsx)(de.a,{value:s.taxCode,onChange:e=>{t((t=>({...t,taxCode:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Addresse :"}),Object(he.jsx)(de.a,{value:s.address,onChange:e=>{t((t=>({...t,address:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:4,xl:5,className:"p-10",children:[Object(he.jsx)("label",{children:"Ville:"}),Object(he.jsx)(de.a,{value:s.city,onChange:e=>{t((t=>({...t,city:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:2,xl:1,className:"p-10",children:[Object(he.jsx)("label",{children:"Zip Code :"}),Object(he.jsx)(de.a,{value:s.zipCode,onChange:e=>{t((t=>({...t,zipCode:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"T\xe9lephones"}),Object(he.jsx)(pa.a,{type:"number",block:!0,size:"md",value:s.phones?s.phones.split(","):[],onChange:e=>{let a={...s};a.phones=e.join(","),t(a)}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Fax:"}),Object(he.jsx)(pa.a,{type:"number",block:!0,size:"md",value:s.fax?s.fax.split(","):[],onChange:e=>{let a={...s};a.fax=e.join(","),t(a)}})," "]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"emails:"}),Object(he.jsx)(pa.a,{type:"number",block:!0,size:"md",value:s.emails?s.emails.split(","):[],onChange:e=>{let a={...s};a.emails=e.join(","),t(a)}})," "]}),Object(he.jsx)("br",{}),a&&Object(he.jsx)(Ee.a,{showIcon:!0,type:"error",children:a})]})};function el(e){const[t,a]=Object(I.c)(T),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({q:"",page:1,take:20,serviceType:0}),[r,o]=Object(n.useState)(""),[d,j]=Object(n.useState)({}),[b,h]=Object(I.c)(Oe.a),u=()=>{j({}),o("")},p=()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Agency+"/getAll",{}).fetchAll().then((e=>{a(e.data)})).catch((e=>o(e.Message)))};return Object(n.useEffect)((()=>{p()}),[]),Object(he.jsxs)("div",{children:[Object(he.jsx)(ge.a,{size:"md",save:()=>{let e=Object(Be.a)(d,[{name:"Nom"}]);e?o(e):(h((e=>({...e,loading:!0}))),d.id?M.a.createAPIEndpoint(M.a.ENDPOINTS.Agency).update(d.id,{...d}).then((e=>{p(),h((e=>({...e,open:!1,loading:!1}))),u(),Te.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})):M.a.createAPIEndpoint(M.a.ENDPOINTS.Agency).create({...d}).then((e=>{p(),u(),Te.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),h((e=>({...e,open:!1,loading:!1})))})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))})))},noExport:!0,AddComponent:Object(he.jsx)(Qi,{error:r,model:d,_setmodel:j})})," ",Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),j(t.find((t=>t.id==e)))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Agency).delete(e).then((e=>{p(),Te.a.fire("Supprim\xe9 !","","success")})).catch((e=>o(e.Message)))},actionKey:"id",noAdvancedActions:!0,columns:tl,rows:t})]})}const tl=[{value:"name",value2:"logo",name:"Nom",render:(e,t)=>Object(he.jsxs)("a",{children:[" ",Object(he.jsx)("img",{src:t,height:"30",alt:""}),e]})},{value:"taxCode",name:"Code Tax",render:e=>Object(he.jsx)("b",{style:{color:"green"},children:e})},{value:"address",name:"Adresse",render:e=>Object(he.jsx)("i",{style:{color:"#232323"},children:e})},{value:"emails",name:"Emails",render:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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:e=>Object(he.jsx)("div",{style:{maxWidth:"260px",overflow:"auto"},children:e&&e.split(",").map(((e,t)=>Object(he.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 al(e){const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)([]),[i,l]=Object(n.useState)([]),[r,o]=Object(n.useState)([]),[d,j]=Object(I.c)(vs),[b,h]=Object(n.useState)([]),[u,p]=Object(I.c)(L),[m,x]=Object(n.useState)(0),[O,g]=Object(n.useState)(!1),[f,y]=Object(n.useState)({page:1,take:100,clientId:0,status:3,date:null,tagId:0}),[v,_]=Object(n.useState)({rawdhaId:null,orders:[]}),[C,N]=Object(n.useState)(""),E=function(e){("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>c(e.data)))},S=e=>{("undefined"==typeof e||e.length>2)&&M.a.createAPIEndpoint(M.a.ENDPOINTS.PackageUmrah+"/getForPrices",{q:e}).customGet().then((e=>{l(e.data);let t=e.data.reduce(((e,t)=>e.concat(t.disponibilities)),[]);console.log(t),h(t.filter((e=>e.onStock)))}))},D=()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Order+"/Umrah",{...f,date:f.date?me()(f.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{a(e.data.data),o([]),x(e.data.totalCount)})).catch((e=>{}))};Object(n.useEffect)((()=>{E(),S()}),[]),Object(n.useEffect)((()=>{D()}),[f.page,f.take]);const k=[{value:"id",name:"-",render:e=>Object(he.jsx)(Gt.a,{onChange:t=>{r.find((t=>t==e))?o((t=>t.filter((t=>t!=e)))):o((t=>[...t,e]))},checked:null!=r.find((t=>t==e))})},{value:"rawdhaId",name:"Rawdha",render:e=>Object(he.jsx)("a",{children:Object(he.jsx)("b",{children:e&&d.find((t=>t.id==e))?d.find((t=>t.id==e)).designation:""})})},{name:"Rawdha",value:"isRawdhaSent",render:e=>Object(he.jsx)(Ae.a,{color:e?"blue":"orange",children:e?"oui":"non"})},{value:"customer",value2:"onlyTicket",value3:"withoutVisa",value4:"withoutTicket",name:"Client B2C",render:(e,t,a,n)=>Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center"},children:[e.picture?Object(he.jsx)("img",{alt:"",src:De.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(he.jsx)("div",{style:{fontSize:"15px",border:"1px dashed #888",borderRadius:"50%",width:"43px",height:"43px",textAlign:"center",lineHeight:"42px"},children:Object(he.jsx)(ca.a,{color:"#3598ff"})}),Object(he.jsxs)("div",{style:{padding:"0 5px"},children:[e.firstName+" "+e.lastName," ",Object(he.jsx)("b",{style:{color:"#111",fontSize:"15px"},children:e?e.passportNumber:""}),Object(he.jsx)("br",{}),Object(he.jsx)("b",{style:{color:"#330033"},children:e.firstNameAr+" "+e.lastNameAr}),t?Object(he.jsx)(Ae.a,{color:"blue",children:"Billet"}):""," ",a?Object(he.jsx)(Ae.a,{color:"orange",children:"sans visa"}):"",n?Object(he.jsx)(Ae.a,{color:"violet",children:"Sans Billet"}):""]})]})},{value:"disponibility",name:"Vol",render:e=>e?Object(he.jsxs)("b",{style:{display:"flex",alignItems:"center",padding:"3px",borderRadius:"5px"},children:[Object(he.jsx)("img",{alt:"",style:{width:"30px",height:"30px",margin:"0 6px"},src:e.airline?e.airline.logo:""}),Object(he.jsxs)("b",{children:[" ",Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),Object(he.jsxs)("b",{style:{color:"#888",fontWeight:"lighter"},children:[" ",e.airline?e.airline.name:""]})]})]}):Object(he.jsx)("b",{children:"-"})},{value:"client",name:"Client B2B",render:e=>Object(he.jsx)("a",{children:e?e.name.toUpperCase():""})}];return Object(n.useEffect)((()=>{_((e=>({...e,orders:r})))}),[r.length]),Object(he.jsxs)("div",{children:[Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>D(),children:[Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Recherche: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{y((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Rawdha: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(d.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:f.rawdhaId,onSelect:e=>{y((t=>({...t,rawdhaId:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Client: "}),Object(he.jsx)(Fe.a,{onSearch:e=>E(e),data:[{label:"Tout",value:0}].concat(s.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:f.clientId,onSelect:e=>{y((t=>({...t,clientId:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Nom Omrah: "}),Object(he.jsx)(Fe.a,{onSearch:S,data:i?[{label:"Tout",value:0}].concat(i.map((e=>({label:e.name,value:e.id})))):[{label:"Tout",value:0}],block:!0,noSearch:!0,value:f.packageUmrahId,onSelect:e=>{y((t=>({...t,packageUmrahId:e})))}})]}),Object(he.jsxs)(re.a,{m:3,l:2.4,xl:2.4,className:"p-10",children:[Object(he.jsx)("label",{children:"Vol: "}),Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(b?b.map((e=>({label:Object(he.jsx)("div",{style:{color:"#232323"},children:me()(e.date).format("DD MMM YYYY")}),value:e.id}))):[]),block:!0,noSearch:!0,value:f.disponibilityId,onSelect:e=>{y((t=>({...t,disponibilityId:e})))}})]})]}),Object(he.jsxs)("div",{onClick:e=>o((e=>e.length?[]:t.map((e=>e.id)))),style:{display:"inline-block",padding:"8px",borderRadius:"4px"},children:[Object(he.jsx)(Gt.a,{checked:r.length>0})," S\xe9lectionner Tout"]}),Object(he.jsxs)("div",{className:"p-10",children:[Object(he.jsx)(re.a,{s:6,m:6,l:4,xl:3,children:Object(he.jsx)(Fe.a,{data:[{label:"Tout",value:0}].concat(d.map((e=>({label:e.designation,value:e.id})))),block:!0,noSearch:!0,value:v.rawdhaId,onSelect:e=>{_((t=>({...t,rawdhaId:e})))}})})," ",Object(he.jsx)(je.a,{appearance:"primary",color:"blue",onClick:()=>{M.a.createAPIEndpoint(be.a.Order+"/changeRawdha").create(v).then((e=>{D(),alert("success")}))},children:"changer"})]}),Object(he.jsx)(ye.a,{columns:k,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.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,200,250,500,1e3],limit:f.take,activePage:f.page,onChangePage:e=>{window.scrollTo(0,0),y((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),y((t=>({...t,take:e,page:1})))}})})]})," "]})}var nl=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--ai",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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 sl=function(e){return Object(he.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:Object(he.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 cl=function(e){return Object(he.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:Object(he.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 il=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--doc",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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 ll=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--jpg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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(he.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 rl=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--pdf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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 ol=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--png",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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 dl=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--psd",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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(he.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 jl=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--xls",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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(he.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 bl=function(e){return Object(he.jsxs)("svg",{className:"icon file-icon file-icon--unknown",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 19.607 24",...e,children:[Object(he.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(he.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"})]})};function hl(e){let{name:t,...a}=e;switch(t){case"AI":return Object(he.jsx)(nl,{...a});case"CHECK":return Object(he.jsx)(sl,{...a});case"CLOSE":return Object(he.jsx)(cl,{...a});case"DOC":case"DOCX":return Object(he.jsx)(il,{...a});case"JPG":case"JPEG":return Object(he.jsx)(ll,{...a});case"PDF":return Object(he.jsx)(rl,{...a});case"PNG":return Object(he.jsx)(ol,{...a});case"PSD":return Object(he.jsx)(dl,{...a});case"XLS":return Object(he.jsx)(jl,{...a});default:return Object(he.jsx)(bl,{...a})}}a(1172);function ul(e){let{icon:t,name:a,uploaded:s}=e;const[c,i]=Object(n.useState)(!1),[l,r]=Object(n.useState)(0),[o,d]=Object(n.useState)("#ed665f");return Object(n.useEffect)((()=>{if(a){let e=setInterval((()=>{r((e=>90!=e||s?e<100?e+1:void 0:e))}),50);return()=>clearInterval(e)}}),[a]),Object(n.useEffect)((()=>{s&&(i(!0),d("#6cc08a"),r(100))}),[s]),Object(he.jsxs)("div",{className:"progress",children:[Object(he.jsx)("div",{className:"progress__icon",children:Object(he.jsx)(hl,{name:t,width:"50px",height:"50px",opacity:c?1:.5})}),Object(he.jsxs)("div",{className:"progress__content",children:[Object(he.jsxs)("div",{className:"progress__content__1",children:[Object(he.jsx)("p",{className:"progress__content__1__filename",children:a}),Object(he.jsx)(hl,{className:c?"check":"close",name:c?"CHECK":"CLOSE",width:"20px",height:"20px"})]}),Object(he.jsx)("div",{className:"progress__content__2",children:Object(he.jsx)("div",{className:"progress__content__2__bar",style:{width:`${l}%`,background:o}})})]})]})}var pl=a(760);a(1173),a(1174);function ml(){return Object(he.jsx)("div",{children:Object(he.jsxs)("div",{children:[" ",Object(he.jsx)(xl,{refresh:()=>{}})]})})}function xl(e){let{refresh:t,single:a=!0}=e;const s=Object(n.useRef)(),[c,i]=Object(n.useState)([]),[l,r]=Object(n.useState)(""),o=async e=>{var t;const a=null===(t=e[0].name.split(".")[1])||void 0===t?void 0:t.toLowerCase();if(console.log(e),void 0!==a){const t=Object.keys(e).map((t=>{var a;return{name:e[t].name,icon:null===(a=e[t].name.split(".")[1])||void 0===a?void 0:a.toUpperCase().trim(),newName:""}}));let a=[...c,...t];i((e=>[...a]));let s=Array.from(e);for(let e=0;ee.name==t.data));console.log(e);let n={...a[e]};n.newName=t.data,a[e]=n,console.log("a")}}catch(n){}i((e=>[...a])),console.log(a)}else alert("file type not supported")};return Object(n.useEffect)((()=>{}),[c]),Object(he.jsxs)("div",{className:"container",children:[Object(he.jsx)("h3",{children:"UPLOAD FILES"}),Object(he.jsx)("div",{className:"progressContainer",children:c&&c.map(((e,t)=>Object(he.jsx)(ul,{name:e.name,icon:e.icon,uploaded:c[t].newName},t)))}),Object(he.jsxs)(pl.FileDrop,{onTargetClick:()=>{s.current.click()},onDrop:e=>o(e),children:[Object(he.jsxs)("p",{className:"placeholder",children:["DRAG FILE HERE ",Object(he.jsx)("br",{})," OR ",Object(he.jsx)("span",{children:"BROWSE"})]}),Object(he.jsx)("input",{accept:" .png, .jpg, .jpeg",value:"",style:{visibility:"hidden",opacity:0},ref:s,multiple:"multiple",type:"file",onChange:e=>o(e.target.files)})]})]})}var Ol=a(255);class gl{constructor(){this.name="",this.latitude=0,this.typeExcursion=0,this.longitude=0,this.description="",this.caracteristique=new fl,this.images=[],this.ImageIds=[],this.videos=[],this.videoIds=[]}}class fl{constructor(){this.hasVol=!1,this.hasTransfert=!1,this.hasWifi=!1,this.hasBreakfast=!1,this.hasBus=!1}}const yl=Object(I.b)({key:"ExcursionAtom",default:new gl});var vl={container:{padding:"40px 10px"},wrapper:{display:"flex",flexDirection:"column"},header:{display:"flex",gap:"16px",marginBottom:"16px",background:"rgb(70,90,238,0.2)"},formSection:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"16px",padding:"16px",width:"100%"},formRow:{display:"flex",flexDirection:"row",justifyContent:"space-evenly",alignItems:"center"},formInputWrapper:{flex:2,display:"flex",flexDirection:"column"},mapWrapper:{flex:2,display:"flex",justifyContent:"center",alignItems:"center"},mapContainer:{width:"100%",height:"47vh",borderRadius:"8px"},loader:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"}};var _l=e=>{let{isLoading:t}=e;const[a,s]=Object(I.c)(yl),[c,i]=Object(n.useState)([]),l=(e,t)=>{s((a=>({...a,[e]:t})))};return Object(he.jsx)(he.Fragment,{children:t?Object(he.jsx)("div",{style:vl.loader,children:Object(he.jsx)(Ca.a,{size:"lg"})}):Object(he.jsx)("div",{style:vl.container,children:Object(he.jsx)(Ol.b,{googleMapsApiKey:De.b,children:Object(he.jsxs)("div",{style:vl.wrapper,children:[Object(he.jsx)("div",{style:vl.header,children:Object(he.jsxs)("div",{style:vl.formSection,children:[Object(he.jsxs)("div",{style:vl.formRow,children:[Object(he.jsxs)("div",{style:vl.formInputWrapper,children:[Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Nom: "}),Object(he.jsx)(de.a,{block:!0,value:a.name||"",onChange:e=>l("name",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsx)("label",{children:"Type Excursion"}),Object(he.jsx)(Fe.a,{data:we.l,block:!0,noSearch:!0,value:a.typeExcursion,onChange:e=>l("typeExcursion",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsxs)("label",{children:[z.latitude,": "]}),Object(he.jsx)(de.a,{block:!0,value:a.latitude||"",onChange:e=>l("latitude",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:3,xl:3,children:[Object(he.jsxs)("label",{children:[z.longitude,": "]}),Object(he.jsx)(de.a,{block:!0,value:a.longitude||"",onChange:e=>l("longitude",e)})]}),Object(he.jsxs)(re.a,{className:"p-5",m:6,l:5,xl:9,children:[Object(he.jsx)("label",{children:"Description: "}),Object(he.jsx)(de.a,{as:"textarea",rows:3,block:!0,value:a.description||"",onChange:e=>l("description",e)})]})]}),Object(he.jsx)("div",{style:vl.mapWrapper,children:Object(he.jsx)(Ol.a,{mapContainerStyle:vl.mapContainer,center:{lat:24.7136,lng:46.6753},zoom:6,onClick:e=>(e=>{const{latLng:t}=e,a={lat:t.lat(),lng:t.lng()};s((e=>({...e,latitude:a.lat,longitude:a.lng})))})(e),children:Object(he.jsx)(Ol.c,{position:{lat:a.latitude,lng:a.longitude}})})})]}),Object(he.jsx)(Pa,{setCaracteristiques:e=>{s((t=>({...t,caracteristique:e})))},caracteristique:a.caracteristique||{},translations:we.e})]})}),Object(he.jsx)(dn,{model:a,setModel:s,state:c,setState:i,hasVideo:!0})]})})})})};const Cl=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e?e.toUpperCase():""})},{value:"typeExcursion",name:"Type excursion",render:e=>Object(he.jsx)("a",{children:1===e?z.trip:z.umrah})},{value:"latitude",name:"Latitude",render:e=>Object(he.jsx)("a",{children:e})},{value:"longitude",name:"Longitude",render:e=>Object(he.jsx)("a",{children:e})}];var Il=e=>{const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({page:1,take:20,q:"",date:null}),[r,o]=Object(n.useState)(""),[d,j]=Object(I.c)(yl),[b,h]=Object(I.c)(Oe.a),[u,p]=Object(n.useState)(!1),m=()=>{j(new gl),o("")},x=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Excursion+"/getAll",{...i,date:i.date?me()(i.date).format("DD MMM YYYY"):null}).customGet().then((e=>{a(e.data.excursions),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{m()}),[]),Object(n.useEffect)((()=>{x()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>x(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"D\xe9signation: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date : "}),Object(he.jsx)(de.a,{type:"date",value:i.date,onChange:e=>{l((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{ActionOnClose:m,noExport:!0,size:"xl",save:()=>{h((e=>({...e,loading:!0})));let e=d;const t=new FormData,a=(e,n)=>{"object"===typeof n&&null!==n?Array.isArray(n)?n.forEach(((t,n)=>{a(`${e}[${n}]`,t)})):Object.keys(n).forEach((t=>{a(`${e}[${t}]`,n[t])})):t.append(e,n)};Object.keys(e).forEach((n=>{Array.isArray(e[n])?e[n].forEach(((e,s)=>{"object"===typeof e&&null!==e?Object.keys(e).forEach((t=>{a(`${n}[${s}][${t}]`,e[t])})):t.append(`${n}[${s}]`,e)})):"object"===typeof e[n]&&null!==e[n]?Object.keys(e[n]).forEach((t=>{a(`${n}[${t}]`,e[n][t])})):t.append(n,e[n])})),e.images&&Array.isArray(e.images)&&e.images.forEach((e=>{e instanceof File&&t.append("images",e)})),e.videos&&Array.isArray(e.videos)&&e.videos.forEach((e=>{e instanceof File&&t.append("videos",e)}));const n=M.a.createAPIEndpoint(M.a.ENDPOINTS.Excursion);(e.id?n.update(e.id,t):n.create(t)).then((()=>{Te.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}),m(),h((e=>({...e,open:!1,loading:!1}))),x()})).catch((e=>{var t,a,n,s;o(e.Message),h((e=>({...e,loading:!1}))),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},title:"Ajouter excursion",AddComponent:Object(he.jsx)(_l,{isLoading:u,error:r})}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),p(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.Excursion).fetchById(e).then((e=>{let t={...e.data};j(t)})).catch((e=>{console.log(e)})).finally((()=>{p(!1)}))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Excursion).delete(e).then((e=>{Te.a.fire("Supprim\xe9 !","","success"),x()})).catch((e=>{var t,a,n,s;o(e.Message),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},actionKey:"id",noAdvancedActions:!0,columns:Cl,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{l((t=>({...t,take:e,page:1})))}})})]})};const Nl=[{value:"name",name:"Nom",render:e=>Object(he.jsx)("a",{children:e})},{value:"isUmrah",name:"Type",render:e=>Object(he.jsx)("a",{children:e?z.umrah:z.trip})}];var El=e=>{const[t,a]=Object(n.useState)([]),[s,c]=Object(n.useState)(0),[i,l]=Object(n.useState)({page:1,take:20,q:"",date:null}),[r,o]=Object(n.useState)(""),[d,j]=Object(I.c)(Cn),[b,h]=Object(I.c)(Oe.a),[u,p]=Object(n.useState)(!1),m=()=>{j(new vn),o("")},x=()=>{h((e=>({...e,loading:!0}))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs+"/getAll",{...i,date:i.date?me()(i.date).format("DD MMM YYYY"):null}).customGet().then((e=>{a(e.data.programs),h((e=>({...e,loading:!1}))),c(e.data.totalCount)})).catch((e=>{o(e.Message),h((e=>({...e,loading:!1})))}))};return Object(n.useEffect)((()=>{m()}),[]),Object(n.useEffect)((()=>{x()}),[i.page,i.take]),Object(he.jsxs)("div",{children:[Object(he.jsxs)(fe.a,{search:()=>x(),children:[Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"D\xe9signation: "}),Object(he.jsx)(de.a,{placeholder:"recherche",onChange:e=>{l((t=>({...t,q:e})))}})]}),Object(he.jsxs)(re.a,{m:6,l:6,xl:6,className:"p-10",children:[Object(he.jsx)("label",{children:"Date : "}),Object(he.jsx)(de.a,{type:"date",value:i.date,onChange:e=>{l((t=>({...t,date:e})))}})]})]}),Object(he.jsx)(ge.a,{ActionOnClose:m,noExport:!0,size:"xl",save:()=>{h((e=>({...e,loading:!0})));let e=d;const t=new FormData;kn(t,e);const a=M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs);(e.id?a.update(e.id,t):a.create(t)).then((()=>{Te.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}),m(),h((e=>({...e,open:!1,loading:!1}))),x()})).catch((e=>{var t,a,n,s;o(e.Message),h((e=>({...e,loading:!1}))),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},title:"Ajouter programme",AddComponent:Object(he.jsx)(Nn,{isLoading:u,error:r})}),Object(he.jsx)(ye.a,{editAction:e=>{(e=>{o(""),p(!0),M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs).fetchById(e).then((e=>{let t={...e.data};j(t)})).catch((e=>{console.log(e)})).finally((()=>{p(!1)}))})(e),h((e=>({...e,open:!0})))},deleteAction:e=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Programs).delete(e).then((e=>{Te.a.fire("Supprim\xe9 !","","success"),x()})).catch((e=>{var t,a,n,s;o(e.Message),console.log(e.response,"error.response"),Pn.a.push(Object(he.jsx)(An.a,{type:"error",header:z.errorHeader,closable:!0,children:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.title)||(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||z.error}),{placement:"topEnd"})}))},actionKey:"id",noAdvancedActions:!0,columns:Nl,rows:t}),Object(he.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(he.jsx)(xe.a,{prev:!0,next:!0,first:!0,last:!0,ellipsis:!0,boundaryLinks:!0,maxButtons:5,size:"md",layout:["total","-","limit","|","pager","skip"],total:s,limitOptions:[10,20,50,100],limit:i.take,activePage:i.page,onChangePage:e=>{window.scrollTo(0,0),l((t=>({...t,page:e})))},onChangeLimit:e=>{l((t=>({...t,take:e,page:1})))}})})]})};const Sl={width:56,height:56,padding:18,lineHeight:"56px",textAlign:"center"};var Dl=e=>{const[t,a]=Object(I.c)(L),[s,c]=Object(I.c)(T),[l,o]=(Object(I.e)(se),Object(n.useState)(!1)),[j,h]=Object(n.useState)(!1),[p,x]=Object(n.useState)(1),[g,z]=Object(I.c)(U),K=Object(I.e)(F),W=Object(I.e)(ce),Y=Object(I.e)(R),G=Object(I.e)(le.a),V=Object(I.e)(B),[H,q]=(Object(I.e)(w),Object(I.c)(ie)),[Z,J]=Object(n.useState)("Dashboard"),$=Object(_.f)();Object(n.useEffect)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Group,{page:1,take:1e3,q:""}).fetchAll().then((e=>{q(e.data.data)})).catch((e=>{})),M.a.createAPIEndpoint(M.a.ENDPOINTS.Agency+"/getAll",{}).fetchAll().then((e=>{c(e.data)})).catch((e=>console.log(e.Message))),M.a.createAPIEndpoint(M.a.ENDPOINTS.AgentBookingFlight,{page:1,take:1e3}).fetchAll().then((e=>V(e.data.data))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Currency,{page:1,take:1e3}).fetchAll().then((e=>K(e.data.data))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Airline,{page:1,take:1e4}).fetchAll().then((e=>Y(e.data))),M.a.createAPIEndpoint(M.a.ENDPOINTS.RecoveryPoint,{q:""},"/autocomplete").customGet().then((e=>G(e.data.map((e=>({value:e.id,label:e.name})))))),M.a.createAPIEndpoint(M.a.ENDPOINTS.Exchange,{page:1,take:1e3}).fetchAll().then((e=>W(e.data)));let e=!0;localStorage.getItem("auth")&&JSON.parse(localStorage.getItem("auth")).token||(e=!1),z(e),setTimeout((()=>{h(!0),J(kl[$.pathname])}),1e3)}),[g]),Object(n.useEffect)((()=>{o(!1)}),[Z]);const X=e=>g?e:Object(he.jsx)(ke,{});return Object(n.useEffect)((()=>{M.a.createAPIEndpoint(M.a.ENDPOINTS.Config).fetchAll().then((e=>a(e.data.length?e.data[0]:{})))}),[]),Object(n.useEffect)((()=>{f.a.get("https://rboisapi.a2development.org/api/Store/getDefault/")}),[]),Object(he.jsx)("div",{className:"app",children:Object(he.jsxs)(N.a,{children:[g&&Object(he.jsxs)(E.a,{className:"app-sidebar "+(l?"show":""),children:[Object(he.jsx)(S.a.Header,{children:Object(he.jsxs)("div",{className:"app-sidebar-header",children:[Object(he.jsx)("div",{children:Object(he.jsxs)("b",{style:{marginLeft:12,fontSize:"large"},children:["UMRAH MANAGEMENT"," "]})}),Object(he.jsx)("button",{className:"close_menu_btn",onClick:e=>o((e=>!e)),children:"x"})]})}),Object(he.jsx)(S.a,{defaultOpenKeys:["1"],appearance:"subtle",children:Object(he.jsx)(S.a.Body,{children:Object(he.jsxs)(D.a,{children:[Object(he.jsx)(D.a.Item,{eventKey:"1",onClick:()=>{x("1"),J("Dashboard")},active:"1"==p,icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(i.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/",children:"Dashboard"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(y.e,{})}),eventKey:"9-59999",onClick:()=>{x("9-59999"),J("Template Omrah")},active:"9-59999"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/template_umrah",children:"Template Omrah"})}),Object(he.jsx)(D.a.Item,{icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(y.e,{})}),eventKey:"9-5",onClick:()=>{x("9-5"),J("Packs Omrah")},active:"9-5"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/packages_umrah",children:"Packs Omrah"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("2222"),J("Ventes Umrah")},active:"2222"==p,eventKey:"2222",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/sales_umrah",children:"Ventes Umrah"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("Consultation Ventes Umrah"),J("Consultation Ventes Umrah")},active:"Consultation Ventes Umrah"==p,eventKey:"Consultation Ventes Umrah",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/consult_sales_umrah",children:"Consultation Ventes Umrah"})}),Object(he.jsx)(D.a.Item,{icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(y.e,{})}),eventKey:"9-66",onClick:()=>{x("9-66"),J("Prix Omrah")},active:"9-66"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/prices_umrah",children:"Prix Omrah"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("2228882"),J("Pr\xe9visions")},active:"2228882"==p,eventKey:"2228882",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/forcast",children:"Pr\xe9visions"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("rooming"),J("Rooming")},active:"rooming"==p,eventKey:"rooming",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/rooming",children:"Rooming"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("rooming2"),J("Rooming 2")},active:"rooming2"==p,eventKey:"rooming2",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/rooming2",children:"Rooming 2"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("vol_statistics"),J("Vols Statistiques")},active:"vol_statistics"==p,eventKey:"vol_statistics",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/vol_statistics",children:"Vols Statistique"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),eventKey:"excursion",onClick:()=>{x("excursion"),J("Excursion")},active:"excursion"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/excursion",children:"Excursion"})}),Object(he.jsx)(D.a.Item,{icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),eventKey:"program",onClick:()=>{x("program"),J("Program")},active:"program"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/program",children:"Programme"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("groups"),J("Groupes")},active:"groups"==p,eventKey:"groups",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/groups",children:"Groupes"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("send_to_wakil"),J("Opertaions")},active:"send_to_wakil"==p,eventKey:"send_to_wakil",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/send_to_wakil",children:"Opertaions"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("upload_visas"),J("Upload Visas")},active:"upload_visas"==p,eventKey:"upload_visas",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/upload_visas",children:"Upload Visas"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("configs"),J("Config Wakil")},active:"configs"==p,eventKey:"configs",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/configs",children:"Config Wakil"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("rawdhas"),J("Rawdha")},active:"rawdhas"==p,eventKey:"rawdhas",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/rawdhas",children:"Rawdha"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("rawdhas_operations"),J("Operations Rawdha")},active:"rawdhas_operations"==p,eventKey:"rawdhas_operations",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/rawdhas_operations",children:"Operations Rawdha"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(y.e,{})}),eventKey:"9-51",onClick:()=>{x("9-51"),J("Voyages Organis\xe9s")},active:"9-51"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/packages",children:"Voyages Organis\xe9s"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("22"),J("Ventes Voyages Organis\xe9es")},active:"22"==p,eventKey:"22",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/sales_vo",children:"Ventes VOs"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("22288825"),J("Pr\xe9visions VOs")},active:"22288825"==p,eventKey:"22288825",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(d.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/forcastvo",children:"Pr\xe9visions VOs"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{eventKey:"3",onClick:()=>{x("3"),J("D\xe9penses")},active:"3"==p,icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(r.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/expense",children:"D\xe9penses"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("9"),J("Achats")},active:"9"==p,eventKey:"9",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(r.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/purchases",children:"Achats"})}),Object(he.jsx)(D.a.Item,{eventKey:"13",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(u.a,{})}),onClick:()=>{x("13"),J("Paiements Fournisseurs")},active:"13"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/payments_providers",children:"Paiements Fournisseurs"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("12"),J("Grand Livre Fournisseurs")},active:"12"==p,eventKey:"12",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(r.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/accounts_receivable_ledger",children:"Grand Livre Fournisseurs"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{eventKey:"5",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(u.a,{})}),onClick:()=>{x("5"),J(" Gestion des ch\xe9ques")},active:"5"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/checks",children:"Gestion des ch\xe8ques"})}),Object(he.jsx)("hr",{}),Object(he.jsx)(D.a.Item,{eventKey:"10",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(u.a,{})}),onClick:()=>{x("10"),J(" Gestion des recouvrements")},active:"10"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/payments",children:"Gestion des recouvrements"})}),Object(he.jsx)(D.a.Item,{eventKey:"14",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(u.a,{})}),onClick:()=>{x("14"),J("Garanties Clients")},active:"14"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/guarantee_clients",children:"Garanties Clients"})}),Object(he.jsx)(D.a.Item,{onClick:()=>{x("11"),J("Grand Livre Clients")},active:"11"==p,eventKey:"11",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(r.a,{})}),children:Object(he.jsx)(C.b,{className:"side_link ",to:"/accounts_payable_ledger",children:"Grand Livre Clients"})}),Object(he.jsx)(D.a.Item,{eventKey:"15",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(u.a,{})}),onClick:()=>{x("15"),J("Suivie Clients")},active:"15"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/follow_up_clients",children:"Suivie Clients"})}),Object(he.jsx)("hr",{}),Object(he.jsxs)(k.a,{eventKey:"4",trigger:"hover",title:"Tiers",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(O.a,{})}),placement:"rightStart",children:[Object(he.jsx)(k.a.Item,{eventKey:"4-1",onClick:()=>{x("4-1"),J(" Clients")},active:"4-1"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/tiers/clients",children:"Clients"})}),Object(he.jsx)(k.a.Item,{eventKey:"4-2",onClick:()=>{x("4-2"),J(" Fournisseurs")},active:"4-2"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/tiers/providers",children:"Fournisseurs"})})]}),Object(he.jsxs)(k.a,{eventKey:"6",trigger:"hover",title:"Tr\xe9sorerie",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(m.a,{})}),placement:"rightStart",children:[Object(he.jsx)(k.a.Item,{eventKey:"6-1",onClick:()=>{x("6-1"),J("Banques")},active:"6-1"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/treasory/banks",children:"Banques"})}),Object(he.jsx)(k.a.Item,{eventKey:"6-2",onClick:()=>{x("6-2"),J(" Caisses")},active:"6-2"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/treasory/checkouts",children:"Caisses"})}),Object(he.jsx)(k.a.Item,{eventKey:"6-3",onClick:()=>{x("6-3"),J("Points De Recouvrements")},active:"6-3"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/treasory/recovery_points",children:"Points De Recouvrements"})})]}),Object(he.jsxs)(k.a,{eventKey:"8",trigger:"hover",title:"Param\xe9trage",icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(b.a,{})}),placement:"rightStart",children:[Object(he.jsx)(k.a.Item,{eventKey:"8-1",onClick:()=>{x("8-1"),J("Agents de Bill\xe9terie")},active:"8-1"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/flight_booking_agents",children:"Agents de Bill\xe9terie"})}),Object(he.jsx)(k.a.Item,{eventKey:"8-2",onClick:()=>{x("8-2"),J("Devises")},active:"8-2"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/currencies",children:"Devises"})}),Object(he.jsx)(k.a.Item,{eventKey:"8-3",onClick:()=>{x("8-3"),J("Postes des employ\xe9s")},active:"8-3"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/employee_position",children:"Postes des employ\xe9s"})}),Object(he.jsx)(k.a.Item,{eventKey:"Liste des employ\xe9s",onClick:()=>{x("Liste des employ\xe9s"),J("Liste des employ\xe9s")},active:"Liste des employ\xe9s"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/employee",children:"Liste des employ\xe9s"})}),Object(he.jsx)(k.a.Item,{eventKey:"8-4",onClick:()=>{x("8-4"),J("Tags")},active:"8-4"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/tags",children:"Tags"})}),Object(he.jsx)(k.a.Item,{eventKey:"8-5",onClick:()=>{x("8-5"),J("Pr\xe9f\xe9rences")},active:"8-5"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/preference",children:"Pr\xe9f\xe9rences"})}),Object(he.jsx)(k.a.Item,{eventKey:"9-6",onClick:()=>{x("9-6"),J("Echanges")},active:"9-6"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/settings/exchanges",children:"Echanges"})})]}),Object(he.jsx)(D.a.Item,{eventKey:"55-1",onClick:()=>{x("55-1"),J(" Utilisateurs")},icon:Object(he.jsx)("span",{className:"side-span",children:Object(he.jsx)(i.a,{})}),active:"55-1"==p,children:Object(he.jsx)(C.b,{className:"side_link ",to:"/users",children:"Utilisateurs"})})]})})})]}),Object(he.jsxs)(N.a,{className:"hole-container",children:[g&&Object(he.jsxs)(P.a,{className:"page-header",children:[Object(he.jsx)("h4",{children:Z}),Object(he.jsxs)("div",{style:{display:"inline-flex"},children:[Object(he.jsx)("button",{className:"menu_btn",onClick:e=>o((e=>!e)),children:Object(he.jsx)(v.b,{})}),Object(he.jsx)(D.a,{children:Object(he.jsx)(k.a,{placement:"bottomEnd",trigger:"click",icon:Object(he.jsx)(b.a,{size:"3em"}),renderTitle:e=>Object(he.jsx)(b.a,{style:Sl}),children:Object(he.jsx)(k.a.Item,{onClick:()=>{localStorage.removeItem("auth"),z(!1)},children:"Sign out"})})})]})]}),Object(he.jsx)(A.a,{className:"app-content "+(g?"logged":""),children:Object(he.jsxs)(_.c,{children:[Object(he.jsx)(_.a,{path:"/sales",render:e=>X(Object(he.jsx)(Ms,{...e}))}),Object(he.jsx)(_.a,{path:"/hosting",render:e=>X(Object(he.jsx)(Xs,{...e}))}),Object(he.jsx)(_.a,{path:"/sales_vo",render:e=>X(Object(he.jsx)(yc,{...e}))}),Object(he.jsx)(_.a,{path:"/sales_bus",render:e=>X(Object(he.jsx)(Vs,{...e}))}),Object(he.jsx)(_.a,{path:"/agencies",render:e=>X(Object(he.jsx)(el,{...e}))}),Object(he.jsx)(_.a,{path:"/sales_umrah",render:e=>X(Object(he.jsx)(bc,{...e}))}),Object(he.jsx)(_.a,{path:"/consult_sales_umrah",render:e=>X(Object(he.jsx)(uc,{...e}))}),Object(he.jsx)(_.a,{path:"/expense",render:e=>X(Object(he.jsx)(Wt,{...e}))}),Object(he.jsx)(_.a,{path:"/users",render:e=>X(Object(he.jsx)(qi,{...e}))}),Object(he.jsx)(_.a,{path:"/groups",render:e=>X(Object(he.jsx)(ba,{...e}))}),Object(he.jsx)(_.a,{path:"/excursion",render:e=>X(Object(he.jsx)(Il,{...e}))}),Object(he.jsx)(_.a,{path:"/program",render:e=>X(Object(he.jsx)(El,{...e}))}),Object(he.jsx)(_.a,{path:"/upload_visas",render:e=>X(Object(he.jsx)(ml,{...e}))}),Object(he.jsx)(_.a,{path:"/rawdhas",render:e=>X(Object(he.jsx)(_s,{...e}))}),Object(he.jsx)(_.a,{path:"/payments",render:e=>X(Object(he.jsx)(ss,{...e}))}),Object(he.jsx)(_.a,{path:"/payments_providers",render:e=>X(Object(he.jsx)(ls,{...e}))}),Object(he.jsx)(_.a,{path:"/rawdhas_operations",render:e=>X(Object(he.jsx)(al,{...e}))}),Object(he.jsx)(_.a,{path:"/guarantee_clients",render:e=>X(Object(he.jsx)(et,{...e}))}),Object(he.jsx)(_.a,{path:"/purchases",render:e=>X(Object(he.jsx)(Os,{...e}))}),Object(he.jsx)(_.a,{path:"/tiers/creditors",render:e=>X(Object(he.jsx)(Pi,{...e}))}),Object(he.jsx)(_.a,{path:"/tiers/providers",render:e=>X(Object(he.jsx)(Ti,{...e}))}),Object(he.jsx)(_.a,{path:"/rooming",render:e=>X(Object(he.jsx)(Is,{...e}))})," ",Object(he.jsx)(_.a,{path:"/rooming2",render:e=>X(Object(he.jsx)(Ns,{...e}))}),Object(he.jsx)(_.a,{path:"/follow_up_clients",render:e=>X(Object(he.jsx)(ve,{...e}))}),Object(he.jsx)(_.a,{path:"/accounts_payable_ledger",render:e=>X(Object(he.jsx)(ht,{...e}))}),Object(he.jsx)(_.a,{path:"/vol_statistics",render:e=>X(Object(he.jsx)(Ji,{...e}))}),Object(he.jsx)(_.a,{path:"/send_to_wakil",render:e=>X(Object(he.jsx)(Ic,{...e}))}),Object(he.jsx)(_.a,{path:"/accounts_receivable_ledger",render:e=>X(Object(he.jsx)(ya,{...e}))}),Object(he.jsx)(_.a,{path:"/tiers/cca",render:e=>X(Object(he.jsx)(_i,{...e}))}),Object(he.jsx)(_.a,{path:"/tiers/clients",render:e=>X(Object(he.jsx)(Ei,{...e}))}),Object(he.jsx)(_.a,{path:"/checks",render:e=>X(Object(he.jsx)(Pe.a,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/employee_position",render:e=>X(Object(he.jsx)(Bc,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/employee",render:e=>X(Object(he.jsx)(Mc,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/services",render:e=>X(Object(he.jsx)(Kc,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/preference",render:e=>X(Object(he.jsx)(Fc,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/currencies",render:e=>X(Object(he.jsx)(kc,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/flight_booking_agents",render:e=>X(Object(he.jsx)(Ec,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/tags",render:e=>X(Object(he.jsx)(Gc,{...e}))}),Object(he.jsx)(_.a,{path:"/treasory/banks",render:e=>X(Object(he.jsx)(Ui,{...e}))}),Object(he.jsx)(_.a,{path:"/treasory/checkouts",render:e=>X(Object(he.jsx)(zi,{...e}))}),Object(he.jsx)(_.a,{path:"/treasory/recovery_points",render:e=>X(Object(he.jsx)(Yi,{...e}))}),Object(he.jsx)(_.a,{path:"/invoices",render:e=>X(Object(he.jsx)(ga,{...e}))}),Object(he.jsx)(_.a,{path:"/invoices/settings",render:e=>X(Object(he.jsx)(fa,{...e}))}),Object(he.jsx)(_.a,{path:"/settings/exchanges",render:e=>X(Object(he.jsx)(Lc,{...e}))}),Object(he.jsx)(_.a,{path:"/packages",render:e=>X(Object(he.jsx)(ts,{...e}))}),Object(he.jsx)(_.a,{path:"/ticketing",render:e=>X(Object(he.jsx)(Oi,{...e}))}),Object(he.jsx)(_.a,{path:"/packages_umrah",render:e=>X(Object(he.jsx)(Un,{...e}))}),Object(he.jsx)(_.a,{path:"/prices_umrah",render:e=>X(Object(he.jsx)(Wn,{...e}))}),Object(he.jsx)(_.a,{path:"/forcast",render:e=>X(Object(he.jsx)(Qt,{...e}))}),Object(he.jsx)(_.a,{path:"/forcastvo",render:e=>X(Object(he.jsx)(na,{...e}))}),Object(he.jsx)(_.a,{path:"/template_umrah",render:e=>X(Object(he.jsx)(Fn,{...e}))}),Object(he.jsx)(_.a,{path:"/configs",render:e=>X(Object(he.jsx)(ue,{...e}))}),Object(he.jsx)(_.a,{path:"/*",render:e=>X(Object(he.jsx)(gt,{...e}))})]})})]})]})})};const kl={"/sales":"Ventes","/expense":"D\xe9penses","/tiers/creditors":"Cr\xe9diteurs","/tiers/providers":"Fournisseurs","/tiers/clients":"Clients","/checks":" Gestion des ch\xe9ques","/settings/employee_position":" Postes des employ\xe9s","/settings/services":" Types Des Services","/settings/currencies":"Devises","/treasory/banks":"Banques","/treasory/checkouts":"Caisses","/invoices":"Factures","/invoices/settings":"Param\xe9trage Facture"};var Pl=e=>{e&&e instanceof Function&&a.e(6).then(a.bind(null,1226)).then((t=>{let{getCLS:a,getFID:n,getFCP:s,getLCP:c,getTTFB:i}=t;a(e),n(e),s(e),c(e),i(e)}))};a(1180);c.a.render(Object(he.jsx)(I.a,{children:Object(he.jsx)(C.a,{children:Object(he.jsx)(Dl,{})})}),document.getElementById("root")),Pl()},15:function(e,t,a){"use strict";var n=a(2),s=a.n(n),c=(a(1062),a(721)),i=a.n(c),l=a(121),r=a(1214),o=a(763),d=a(85),j=a(186),b=a(245),h=a(32),u=a.n(h),p=a(12),m=a.n(p),x=a(1);function O(e){let{absolute:t}=e;return Object(x.jsx)("div",{style:{zIndex:9999999,position:t?"absolute":"fixed",top:0,left:0,right:0,backgroundColor:"rgba(255,255,255,0.85)",height:t?"100%":"100vh"},children:Object(x.jsx)("img",{alt:"... loading",style:{position:"absolute",top:t?"30vh":"50%",left:"50%",transform:"translate(-50%, -50%)",width:"60px",height:"60px"},src:"\\svg-loaders\\rings.svg"})})}var g=a(154),f=a.n(g),y=a(722),v=a.n(y);class _ extends s.a.Component{constructor(e){super(e),this.handleEvent2=(e,t)=>{var a=this.state.rows,n=a[a.findIndex((e=>e.id==this.state.index))].order,s=a[a.findIndex((e=>e.id==t))].order;a[a.findIndex((e=>e.id==t))].order=n,a[a.findIndex((e=>e.id==this.state.index))].order=s,a.sort(((e,t)=>e.order-t.order)),this.setState({rows:a,style:!1})},this.onChange=(e,t)=>{this.props.paginate(this.props.filter,e,t)},this.state={index:0,rows:[],pageSize:this.props.itemsPerPage}}componentDidMount(){}render(){let e=this.props.columns;this.state.rows=this.props.rows;const t=this.props;this.state.locale;return Object(x.jsx)(x.Fragment,{children:Object(x.jsxs)("div",{id:"custom-table-container",children:[this.props.loading&&Object(x.jsx)(O,{absolute:!0}),Object(x.jsx)("table",{id:"custom-table",children:Object(x.jsxs)("tbody",{children:[Object(x.jsxs)("tr",{className:"top-table-row ",children:[e&&e.map(((e,t)=>Object(x.jsx)("td",{children:Object(x.jsx)("span",{className:e.class,children:e.name})},t))),t.actionKey&&Object(x.jsx)("td",{style:{textAlign:"right",paddingRight:"30px"},children:"Actions"})]}),e&&this.state.rows&&this.state.rows.map(((a,n)=>Object(x.jsxs)("tr",{style:{direction:this.props.rtl?"rtl":"",cursor:"pointer"},className:"hovred-tr border-bottom body-table-row",children:[this.props.draggable?Object(x.jsx)("div",{style:this.props.draggable?{display:"none"}:{display:""},children:Object(x.jsx)("div",{style:0==this.props.draggable?{display:"none"}:{display:""},onDragOver:()=>{console.log(this.props.draggable),console.log(a.id),this.setState({index:a.id})},onDragEnd:e=>{this.handleEvent2(e,a.id)},children:Object(x.jsx)("span",{style:{cursor:"pointer"},draggable:!0,children:Object(x.jsx)(i.a,{size:"18px"})})})}):"",e.map(((e,t)=>Object(x.jsx)("td",{style:{direction:this.props.rtl?"rtl":""},className:e.tdClass,onClick:()=>e.click?e.click(a[e.value]):e.deleteLocal?e.deleteLocal(n):e.editLocal?e.editLocal(n):"",children:e.value4?e.render(a[e.value],a[e.value2],a[e.value3],a[e.value4]):e.value3?e.render(a[e.value],a[e.value2],a[e.value3]):e.value2?e.render(a[e.value],a[e.value2]):e.render(a[e.value])},t))),t.actionKey&&Object(x.jsx)("td",{style:{textAlign:"right"},children:C({dataKey:a[t.actionKey],noAdvancedActions:t.noAdvancedActions,editAction:t.editAction,deleteAction:t.deleteAction,displayAction:t.displayAction,display:a[t.display],actions:t.actions})})]},n)))]})}),(!this.props.rows||!this.props.rows.length)&&Object(x.jsx)("div",{style:{height:"400px",textAlign:"center",paddingTop:"140px",width:"100%",fontSize:"18px",textTransform:"uppercase"},children:"Il n'y a pas des donn\xe9es !"})]})})}}t.a=_;const C=e=>{let{dataKey:t,noAdvancedActions:a,editAction:n,deleteAction:s,displayAction:c,actions:i,display:h,...p}=e;return Object(x.jsxs)("div",{children:[n&&Object(x.jsx)(d.a,{appearance:"subtle",onClick:()=>n(t),icon:Object(x.jsx)(l.b,{}),circle:!0}),c&&Object(x.jsx)(d.a,{appearance:"subtle",onClick:function(){m.a.fire({title:"Etes-vous s\xfbr de vouloir modifier l'\xe9tat de ce package ! ",text:"",icon:"info",showCancelButton:!0,confirmButtonColor:"rgb(93,120,255)",cancelButtonColor:"#d33",confirmButtonText:"Oui!"}).then((e=>{e.isConfirmed&&c(t,h)}))},icon:h?Object(x.jsx)(f.a,{}):Object(x.jsx)(v.a,{}),circle:!0}),Object(x.jsx)(j.a,{vertical:!0})," ",s&&Object(x.jsx)(d.a,{appearance:"subtle",onClick:function(){m.a.fire({title:"Voulez-vous vraiment supprimer cet element ! ",text:"",icon:"warning",showCancelButton:!0,confirmButtonColor:"rgb(93,120,255)",cancelButtonColor:"#d33",confirmButtonText:"Oui, Supprimer!"}).then((e=>{e.isConfirmed&&s(t)}))},icon:Object(x.jsx)(u.a,{}),circle:!0}),!a&&Object(x.jsxs)(x.Fragment,{children:[Object(x.jsx)(j.a,{vertical:!0}),Object(x.jsx)(b.a,{placement:"autoVerticalEnd",trigger:"click",speaker:(e,a)=>function(e,t){let{onClose:a,left:n,top:s,className:c}=e,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3?arguments[3]:void 0;const d=e=>{a(),i[e].action(l)};return Object(x.jsx)(r.a,{ref:t,className:c,style:{left:n,top:s},full:!0,children:Object(x.jsx)(o.a.Menu,{onSelect:d,children:i.map(((e,t)=>Object(x.jsx)(o.a.Item,{eventKey:t,children:e.render?e.render(e.label,l):e.label})))})})}(e,a,i,t),children:Object(x.jsx)(d.a,{appearance:"subtle",icon:Object(x.jsx)(l.c,{}),circle:!0})})]})]})}},163:function(e,t,a){e.exports={products_page:"flights_products_page__1zF9T",conatiner:"flights_conatiner__2pfkv",data_part:"flights_data_part__3e-Gz",search_container:"flights_search_container__2wFnR",box_search_mobile:"flights_box_search_mobile__3F6kY",btn_search_btn:"flights_btn_search_btn__1cQ_2",box_search:"flights_box_search__2oVr9",filter_btn:"flights_filter_btn__AMdCS",results_number:"flights_results_number__3N-zB",products:"flights_products__3LccJ",load_more:"flights_load_more__1WnPK",map_container:"flights_map_container__2m7bk",fixed:"flights_fixed__jyQ97",product:"flights_product__gxIeN",intro:"flights_intro__3G7ds",custom_carousel_image:"flights_custom_carousel_image__rN_iA",gallery_container:"flights_gallery_container__2gJnh",model_img_container:"flights_model_img_container__3rwqZ",container:"flights_container__2qtQW",description:"flights_description__3O-ut",title:"flights_title__13gw8",tags:"flights_tags__xuhoN",p_container:"flights_p_container__2X4gc",hide_btn:"flights_hide_btn__2bh-5",short:"flights_short__3cxjm",white_bg:"flights_white_bg__19QjM",reviews:"flights_reviews__jO30e",reserve_card:"flights_reserve_card__3uw5F",results:"flights_results__2Isab",price:"flights_price__1F3Yu",result_item:"flights_result_item__3EtZp",date:"flights_date__1NsVT",timeline:"flights_timeline__zI_vg",travelers_container:"flights_travelers_container__FKmbc",filter_container:"flights_filter_container__2WxCy",mobile:"flights_mobile__3Hr_t",slider_container:"flights_slider_container__39of1",btns:"flights_btns__1cVF7",price_item:"flights_price_item__21-jn",option:"flights_option__17166",centerd:"flights_centerd__5QaYu",ticket:"flights_ticket__12hmN",itineraries:"flights_itineraries__3Tble",itinerary:"flights_itinerary__O9IQZ",duration:"flights_duration__2RE2b",details_btn:"flights_details_btn__qhRxW",segments:"flights_segments__gCQHK",segment:"flights_segment__31RAP",dots:"flights_dots__IEQaH",details:"flights_details__2tQSL",numberOfBookableSeats:"flights_numberOfBookableSeats__-wkTJ",btn:"flights_btn__m6h0H","btn-white":"flights_btn-white__1HrL6","btn-bottom-animation-1":"flights_btn-bottom-animation-1__2O3vK",comeFromBottom:"flights_comeFromBottom__1eaQu","btn-animation-1":"flights_btn-animation-1__2ZmRP",get_the_best:"flights_get_the_best__PA-4t",btns_oneWay:"flights_btns_oneWay__2QJNj",active:"flights_active__1GtEG"}},17:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(64),s=a(85),c=(a(2),a(717)),i=a.n(c),l=a(718),r=a.n(l),o=a(719),d=a.n(o),j=a(720),b=a.n(j),h=(a(5),a(1));function u(e){let{advanced:t,search:a,loading:c,...l}=e;return Object(h.jsxs)("div",{className:i.a.container,children:[Object(h.jsx)("div",{children:l.children}),Object(h.jsxs)("div",{className:"p-10",children:[Object(h.jsx)(n.a,{appearance:"ghost",onClick:()=>a(),children:c?Object(h.jsx)(r.a,{pulse:!0,style:{fontSize:"2em"}}):Object(h.jsxs)(h.Fragment,{children:[" ",Object(h.jsx)(d.a,{})," Recherche"]})})," ",t&&Object(h.jsx)(s.a,{icon:Object(h.jsx)(b.a,{})})]})]})}},18:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(7);const s=Object(n.b)({key:"exportAddAtom",default:{loading:!1,error:"",open:!1}})},181:function(e,t,a){},19:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));a(2);var n=a(64),s=a(85),c=a(138),i=a(1213),l=a(226),r=a.n(l),o=a(24),d=a.n(o),j=a(186),b=a(18),h=a(7),u=a(362),p=a.n(u),m=a(1);var x=function(e){let{name:t,data:a,...n}=e;const s=p.a.ExcelFile,c=p.a.ExcelFile.ExcelSheet;return Object(m.jsx)(s,{filename:t||"file",element:Object(m.jsx)("button",{style:{width:"0",height:"0",opacity:0,overflow:"hidden"},type:"button",id:"hidden-btn-export",children:"download"}),children:Object(m.jsx)(c,{dataSet:a,name:t||"file"})})};function O(e){let{AddComponent:t,excelData:a,nameExcel:l,noExport:o,save:u,noAdd:p,ActionOnClose:O,handleExport:g,size:f,additionalBtn:y,title:v}=e;const[_,C]=Object(h.c)(b.a),I=()=>C((e=>({...e,open:!1})));return Object(m.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"15px 0",zIndex:"1",maxWidth:"100vw"},children:[!o&&Object(m.jsxs)(n.a,{color:"green",onClick:async()=>{g&&await g(),document.querySelector("#hidden-btn-export").click()},appearance:"primary",children:[Object(m.jsx)(r.a,{})," Export"]}),y||"",!p&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(j.a,{vertical:!0}),Object(m.jsx)(s.a,{onClick:()=>C((e=>({...e,open:!0}))),appearance:"primary",icon:Object(m.jsx)(d.a,{}),children:"Ajout"}),Object(m.jsxs)(c.a,{size:f||"lg",overflow:!1,style:{maxHeight:"calc(100vh - 50px)",overflow:"auto",maxWidth:"100vw"},open:_.open,onClose:()=>{I(),O&&O()},children:[Object(m.jsx)(c.a.Header,{children:Object(m.jsx)(c.a.Title,{children:v||"Modal Title"})}),Object(m.jsx)(c.a.Body,{children:Object(m.jsx)("div",{style:{maxHeight:"calc(100vh - 240px)",overflow:"auto",maxWidth:"100vw"},children:t})}),Object(m.jsxs)(c.a.Footer,{children:[Object(m.jsx)(n.a,{onClick:u,appearance:"primary",children:_.loading?Object(m.jsx)(i.a,{size:"sm"}):"Enregistrer"}),Object(m.jsx)(n.a,{onClick:()=>{I(),O&&O()},appearance:"subtle",children:"Annuler"})]})]})]}),Object(m.jsx)(x,{data:a,name:l})]})}},20:function(e,t,a){"use strict";function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.toFixed(3).toString(),a=t.split(".")[0],n=t.split(".")[1],s="",c=a.split("").reverse().join("");if(a.length>3){for(let e=0;e{let n=Object.keys(t)[0];e[n]||a.push(t[n])})),a.length?1==a.length?"le champ : "+a[0]+" est obligatoire":"les champs : "+a.join(" , ")+" sont obligatoires":""}},29:function(e,t,a){"use strict";a.d(t,"d",(function(){return s})),a.d(t,"c",(function(){return c})),a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return l}));var n=a(62);const s="https://kounouz-managment.wind-erp.com/",c=a.n(n).a.create({baseURL:s+"api/"}),i="AIzaSyCRI2KNgo32guiF5X08xRJtMhe_rtJFRyA",l="http://51.77.116.35:8095/share/proxy/alfresco-noauth/api/internal/shared/node/"},31:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n={Accounts:"Accounts",Attachment:"Attachment",Agency:"Agency",Auth:"Auth",Bank:"Bank",Check:"Check",Checkout:"Checkout",Client:"Client",Creditor:"Creditor",Currency:"Currency",Expense:"Expense",Package:"Package",PackageItem:"PackageItem",Provider:"Provider",Role:"Role",Sale:"Sale",Order:"Order",ServiceType:"ServiceType",Tag:"Tag",Ticket:"Ticket",Transaction:"Transaction",Employee:"Employee",Payment:"Payment",EmployeePosition:"EmployeePosition",AgentBookingFlight:"AgentBookingFlight",File:"file",Purchase:"Purchase",Ledger:"Ledger",Exchange:"Exchange",RecoveryPoint:"RecoveryPoint",PackageUmrah:"PackageUmrah",Airline:"Airline",Forcast:"ForcastUmrah",Config:"Config",ExportImportTY:"ExportImportTY",Group:"Group",Rooming:"Rooming",Disponibility:"Disponibility",Rawdha:"Rawdha",ForcastVo:"ForcastVo",HotelList:"HotelList",Pays:"Pays",Airport:"Airport",Excursion:"Excursion",Programs:"Programs",Category:"Category"}},326:function(e){e.exports=JSON.parse("{}")},39:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));a(2);var n=a(46),s=a(748),c=a(20),i=a(1);function l(e){let{color:t="70,103,209",text:a="",currency:l="TND",amount:r=0,notAmount:o,icon:d,action:j,radius:b=50}=e;return Object(i.jsxs)("div",{className:"card-resume"+(j?" with-action":""),onClick:j||(()=>{}),children:[Object(i.jsx)("span",{style:{color:`rgba(${t})`,background:`rgba(${t},0.3)`,borderRadius:b+"%",width:"50px",height:"50px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"20px",marginRight:"10px"},children:d||Object(i.jsx)(n.c,{fontSize:"30px"})}),Object(i.jsxs)("div",{children:[Object(i.jsx)("b",{children:a})," ",Object(i.jsx)("br",{}),Object(i.jsx)("strong",{children:o?r:Object(c.a)(r)})," ",o?"":Object(i.jsx)("span",{style:{color:"#888",fontSize:"11px",fontWeight:"400"},children:l})]}),Object(i.jsx)("button",{children:Object(i.jsx)(s.a,{})}),Object(i.jsx)("style",{jsx:!0,children:"\n .card-resume button {\n display: none;\n }\n .card-resume {\n padding: 10px;\n box-shadow: 0 0.46875rem 2.1875rem rgb(4 9 20 / 3%),\n 0 0.9375rem 1.40625rem rgb(4 9 20 / 3%),\n 0 0.25rem 0.53125rem rgb(4 9 20 / 5%),\n 0 0.125rem 0.1875rem rgb(4 9 20 / 3%);\n position: relative;\n border-radius: 8px;\n background: #fff;\n display: flex;\n box-sizing: border-box;\n }\n .with-action {\n cursor: pointer;\n }\n .with-action:hover button {\n background: #444;\n color: #fff;\n position: absolute;\n right: 8px;\n bottom: 8px;\n display: inline-flex;\n border-radius: 4px;\n height: 30px;\n align-items: center;\n font-size: 20px;\n }\n\n .card-resume strong {\n font-weight: 700;\n color: rgb(73, 80, 87);\n }\n .card-resume b {\n color: #888;\n font-size: 15px;\n text-transform: uppercase;\n font-weight: 400;\n }\n "})]})}},4:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(31),s=a(56);const c={ENDPOINTS:n.a,createAPIEndpoint:s.a}},5:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(2),s=a(1);function c(e){const[t,a]=Object(n.useState)("");function c(){window.innerWidth<=576&&e.xs?a("xs"):window.innerWidth>576&&window.innerWidth<=768&&e.s?a("s"):window.innerWidth>768&&window.innerWidth<=992&&e.m?a("m"):window.innerWidth>992&&window.innerWidth<=1200&&e.l?a("l"):window.innerWidth>1200&&e.xl?a("xl"):a("")}return Object(n.useEffect)((()=>(window.innerWidth<=576&&e.xs?a("xs"):window.innerWidth>576&&window.innerWidth<=768&&e.s?a("s"):window.innerWidth>768&&window.innerWidth<=992&&e.m?a("m"):window.innerWidth>992&&window.innerWidth<=1200&&e.l?a("l"):window.innerWidth>1200&&e.xl?a("xl"):a(""),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[t,e]),Object(s.jsx)("div",{style:{display:"inline-block",width:"xs"==t?e.xs*(100/12)+"%":"s"==t?e.s*(100/12)+"%":"m"==t?e.m*(100/12)+"%":"l"==t?e.l*(100/12)+"%":"xl"==t?e.xl*(100/12)+"%":"100%",...e.style,verticalAlign:"top",margin:e.margin?e.margin:0,boxSizing:"border-box"},className:e.className,children:e.children})}},50:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));class n{constructor(){this.number=0,this.status=1,this.amount=0,this.depositDate=new Date,this.dueDate=new Date,this.depositBankId=null,this.emmissionBankId=null,this.notes="",this.CheckPurpose=1,this.clientId=null,this.providerId=null,this.PaymentEventType=1,this.attachments=[],this.recoveryPointId=null}}},56:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(29);const s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=e+a+"/",c=e;const i={Authorization:"Bearer "+(localStorage.getItem("auth")?JSON.parse(localStorage.getItem("auth")).token:"")};let l={headers:i,params:t};return{fetchAll:()=>n.c.get(s,l),fetch:()=>n.c.get(c,l),customGet:()=>n.c.get(s,l),customPost:e=>n.c.get(s,e,l),fetchById:e=>n.c.get(s+e,{headers:i}),create:e=>n.c.post(s,e,{headers:i}),update:(e,t)=>n.c.put(s+e,t,l),update2:e=>n.c.put(s,e,{headers:i}),delete:e=>n.c.delete(s+e,{headers:i}),update3:(e,t)=>{const a=`${s+e}?etat=${t}`;return n.c.put(a,l)},upload:e=>{let t=new FormData;return t.append("files",e),n.c.post(s,t,{headers:i})},upload1:e=>{let t=new FormData;return t.append("File",e),n.c.post(s,t,{headers:i})}}}},61:function(e,t,a){"use strict";var n=a(94),s=a(68),c=a(85),i=a(1183),l=a(1185),r=a(11),o=a(65),d=a.n(o),j=a(10),b=a.n(j),h=(a(2),a(7)),u=a(117),p=a(5),m=a(24),x=a.n(m),O=a(32),g=a.n(O),f=a(1);t.a=function(e){let{_setmodel:t,error:a,model:o,clients:j,banks:m,fetchBanks:O,fetchClients:y,loadingAttach:v,attachments:_,_delete:C,upload:I,inset:N}=e;const E=Object(h.d)(u.a);return Object(f.jsxs)(f.Fragment,{children:["undefined"!=typeof j&&Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Point de recouvrement:"}),Object(f.jsx)(n.a,{noSearch:!0,data:E,block:!0,value:o.recoveryPointId,onSelect:e=>{t((t=>({...t,recoveryPointId:e})))}})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Num\xe9ro:"}),Object(f.jsx)(s.a,{maxlength:"7",onChange:e=>{t((t=>({...t,number:e})))},value:o.number})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Status"}),Object(f.jsx)(n.a,{disabled:!o.id,searchable:!1,data:r.o,block:!0,noSearch:!0,value:o.status,onSelect:e=>{console.log(e),t((t=>(console.log(t.status),{...t,status:e,checkPartialPayments:8!=t.status&&8==e?[{amount:0,date:new Date}]:[]})))}})]}),8==o.status&&Object(f.jsx)("div",{style:{background:"rgba(76,103,194,0.3)",borderRadius:"5px"},children:o.checkPartialPayments&&o.checkPartialPayments.map(((e,a)=>Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)(p.a,{m:4,l:4,xl:4,className:"p-5",children:[Object(f.jsx)("label",{children:"Montant:"}),Object(f.jsx)(s.a,{value:o.checkPartialPayments[a].amount,onChange:e=>{let n=[...o.checkPartialPayments],s={...n[a]};s.amount=parseFloat(e),n[a]=s,t({...o,checkPartialPayments:n})}})]}),Object(f.jsxs)(p.a,{m:4,l:4,xl:4,className:"p-5",children:[Object(f.jsx)("label",{children:"Date:"}),Object(f.jsx)(s.a,{type:"date",value:"string"==typeof o.checkPartialPayments[a].date?o.checkPartialPayments[a].date.substring(0,10):o.checkPartialPayments[a].date,onChange:e=>{let n=[...o.checkPartialPayments],s={...n[a]};s.date=e,n[a]=s,t({...o,checkPartialPayments:n})}})]}),Object(f.jsxs)(p.a,{s:2,m:3,l:3,xl:3,className:"p-5",children:[Object(f.jsx)("label",{}),Object(f.jsxs)("div",{className:"p-5",children:[a?Object(f.jsx)(c.a,{onClick:()=>{let e=[...o.checkPartialPayments];e.splice(a,1),t({...o,checkPartialPayments:e})},color:"violet",icon:Object(f.jsx)(g.a,{})}):"",a+1==o.checkPartialPayments.length&&Object(f.jsx)(c.a,{onClick:()=>{let e=[...o.checkPartialPayments];e.push({amount:0,date:new Date}),t({...o,checkPartialPayments:e})},color:"violet",icon:Object(f.jsx)(x.a,{})})]})]})]})))}),1!=o.status&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Date De Changement: "}),Object(f.jsx)(s.a,{defaultValue:b()(o.changeDate).format("YYYY-MM-DD"),type:"date",value:b()(o.changeDate).format("YYYY-MM-DD"),onChange:e=>t((t=>({...t,changeDate:e}))),block:!0})," "]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Num\xe9ro de bordereau: "}),Object(f.jsx)(s.a,{value:o.payingInSlip,onChange:e=>t((t=>({...t,payingInSlip:e}))),block:!0})," "]})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Montant"}),Object(f.jsx)(s.a,{type:"number",disabled:N,step:"0.1",value:o.amount,onChange:e=>{t((t=>({...t,amount:e})))}})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Tireur / Proprietaire"}),Object(f.jsx)(s.a,{value:o.owner,onChange:e=>{t((t=>({...t,owner:e})))}})]}),"undefined"!=typeof j&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Client: "}),Object(f.jsx)(n.a,{onSearch:e=>y(e),data:[{label:"Tout",value:0}].concat(j.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:o.clientId,onSelect:e=>{t((t=>({...t,clientId:e})))}})]}),j.find((e=>e.name.includes("(B2C)")))&&Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Client B2C"}),Object(f.jsx)(s.a,{value:o.b2CName,onChange:e=>{t((t=>({...t,b2CName:e})))}})]})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[" ",Object(f.jsx)("label",{children:"Banque d'Emission: "}),Object(f.jsx)(n.a,{onSearch:e=>O(e),data:[{label:"Tout",value:0}].concat(m),block:!0,noSearch:!0,value:o.emmissionBankId,onSelect:e=>{t((t=>({...t,emmissionBankId:e})))}})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Banque de D\xe9p\xf4t: "}),Object(f.jsx)(n.a,{onSearch:e=>O(e),data:[{label:"Tout",value:0}].concat(m),block:!0,noSearch:!0,value:o.depositBankId,onSelect:e=>{t((t=>({...t,depositBankId:e})))}})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Date De D\xe9p\xf4t: "}),Object(f.jsx)(s.a,{type:"date",defaultValue:b()(o.date).format("YYYY-MM-DD"),value:b()(o.date).format("YYYY-MM-DD"),onChange:e=>t((t=>({...t,date:e}))),block:!0})]}),Object(f.jsxs)(p.a,{l:6,xl:6,className:"p-5",children:[Object(f.jsx)("label",{children:"Date D'\xe9ch\xe8ance: "}),Object(f.jsx)(s.a,{type:"date",defaultValue:b()(o.dueDate).format("YYYY-MM-DD"),value:b()(o.dueDate).format("YYYY-MM-DD"),onChange:e=>t((t=>({...t,dueDate:e}))),block:!0})]}),Object(f.jsx)(p.a,{l:6,xl:6,className:"p-5",children:"undefined"!=typeof j&&Object(f.jsxs)(f.Fragment,{children:[Object(f.jsx)("label",{children:"Type "}),Object(f.jsx)(n.a,{searchable:!1,data:r.n,block:!0,noSearch:!0,value:o.checkPurpose,onSelect:e=>{t((t=>({...t,checkPurpose:e})))}})]})}),Object(f.jsx)("label",{children:"Notes:"}),Object(f.jsx)(s.a,{as:"textarea",rows:3,placeholder:"Textarea",value:o.notes,onChange:e=>{t((t=>({...t,notes:e})))}}),Object(f.jsx)("label",{children:"Attachement:"}),Object(f.jsx)(i.a,{loading:v,autoUpload:!1,fileList:_,action:"#",draggable:!0,onRemove:e=>C(e.fileKey),onChange:e=>{console.log(e);let t=e.filter((e=>"finished"!=e.status)).reverse()[0];t&&I(e,t.blobFile,t.fileKey)},children:Object(f.jsxs)("div",{style:{background:"rgba(200,200,200,0.1)"},children:[Object(f.jsxs)("div",{style:{fontSize:"50px"},children:[" ",Object(f.jsx)(d.a,{color:"#3598ff"})]}),Object(f.jsx)("h4",{style:{color:"#bbb",fontWeight:"400"},children:"Clicker ou Faites glisser les fichiers vers cette zone"})]})}),Object(f.jsx)("br",{}),a&&Object(f.jsx)(l.a,{showIcon:!0,type:"error",children:a})]})}},717:function(e,t,a){e.exports={container:"filter_container__3aI47"}},742:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Check}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),recoil__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7),rsuite__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(164),rsuite__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(64),rsuite__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(68),rsuite__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1184),rsuite__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(94),rsuite__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(138),rsuite_Pagination__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(21),sweetalert2__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(12),sweetalert2__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_9__),_Api___WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(4),_Atoms_exportAdd_atom__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(18),_Components_Common_ExportAdd__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(19),_Components_Common_Filter__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(17),_Components_Grid__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(15),_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(5),_Constants_types__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(11),_Helpers_validate__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(25),_Models_CheckModel__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(50),_AddEdit_component__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(61),_excel_data__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(745),moment__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(10),moment__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_21__),_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(226),_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_22__),_CheckHistoric__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(746),_Helpers_number_formatter__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(20),_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(39),react_icons_ai__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(751),_Atoms_recoveryPoints_atom__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(117),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(1),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__);function Check(props){const[data,setdata]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[summary,setsummary]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[clients,setclients]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[clients2,setclients2]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[banks,setbanks]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[files,setfiles]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[loading,setloading]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[loadingsummary,setloadingsummary]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[color,setcolor]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),[summary2,setsummary2]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),[open,setopen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[historic,sethistoric]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),[date,setdate]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),[totalCount,settotalCount]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),[filterModel,setfilterModel]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)({page:1,take:20,clientId:0,status:0,type:0,date:null}),[error,setError]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),[model,setmodel]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(new _Models_CheckModel__WEBPACK_IMPORTED_MODULE_18__.a),[state,setstate]=Object(recoil__WEBPACK_IMPORTED_MODULE_1__.c)(_Atoms_exportAdd_atom__WEBPACK_IMPORTED_MODULE_11__.a),reset=()=>{setmodel(new _Models_CheckModel__WEBPACK_IMPORTED_MODULE_18__.a),setError("")},fetchClients=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];("undefined"==typeof e||e.length>2)&&_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Client,{q:e},"/autocomplete").customGet().then((e=>t?setclients(e.data):setclients2(e.data)))},fetchBanks=e=>{("undefined"==typeof e||e.length>2)&&_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Bank,{q:e},"/autocomplete").customGet().then((e=>setbanks(e.data)))},fetch=()=>{setstate((e=>({...e,loading:!0}))),setstate((e=>({...e,loading:!0}))),_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check,{...filterModel,date:filterModel.date?moment__WEBPACK_IMPORTED_MODULE_21___default()(filterModel.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{setstate((e=>({...e,loading:!1}))),setdata(e.data.data),setstate((e=>({...e,loading:!1}))),settotalCount(e.data.totalCount)})).catch((e=>{setError(e.Message),setstate((e=>({...e,loading:!1})))}))},fetchSummary=()=>{_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check+"/Summary",{...filterModel,date:filterModel.date?moment__WEBPACK_IMPORTED_MODULE_21___default()(filterModel.date).format("DD MMM YYYY"):null}).fetchAll().then((e=>{setsummary(e.data)})).catch((e=>setError(e.Message)))},fetchSummary2=e=>{setloadingsummary(!0),_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check+"/Summary1",{...filterModel,date:filterModel.date?moment__WEBPACK_IMPORTED_MODULE_21___default()(filterModel.date).format("DD MMM YYYY"):null,status:e}).fetchAll().then((e=>{setloadingsummary(!1),setsummary2(e.data)})).catch((e=>setloadingsummary(!1)))},save=()=>{let msg=Object(_Helpers_validate__WEBPACK_IMPORTED_MODULE_17__.a)(model,[{number:"Num\xe9ro"},{status:"Status"},{amount:"Montant"},{checkPurpose:"Type de Ch\xe9que"},{clientId:"Client"}]);msg?setError(msg):(setstate((e=>({...e,loading:!0}))),model.id?(delete model.client,delete model.depositBank,delete model.emmissionBank,_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check).update(model.id,{...model,amount:Number(model.amount),attachments:model.attachments?model.attachments.join():"",historic:1==model.status||model.historic&&eval("{data:["+model.historic+"]}").find((e=>e.status==model.status))?model.historic:(model.historic?model.historic+",":"")+"{status:"+model.status+',Date:"'+moment__WEBPACK_IMPORTED_MODULE_21___default()(model.changeDate).format("DD/MM/yyyy")+'"}',checkPartialPayments:model.checkPartialPayments?model.checkPartialPayments.map((e=>(delete e.id,e))):[]}).then((e=>{fetch(),reset(),setstate((e=>({...e,open:!1,loading:!1}))),reset(),sweetalert2__WEBPACK_IMPORTED_MODULE_9___default.a.fire({position:"top-end",icon:"success",title:"\xc9l\xe9ment a \xe9t\xe9 bien modifi\xe9 !",showConfirmButton:!1,timer:1500})})).catch((e=>{setError(e.Message),setstate((e=>({...e,loading:!1})))}))):_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check).create({...model,amount:Number(model.amount),attachments:model.attachments.join()}).then((e=>{fetch(),reset(),sweetalert2__WEBPACK_IMPORTED_MODULE_9___default.a.fire({position:"top-end",icon:"success",title:"Element a \xe9t\xe9 bien ajout\xe9 !",showConfirmButton:!1,timer:1500}),setstate((e=>({...e,open:!1,loading:!1})))})).catch((e=>{setError(e.Message),setstate((e=>({...e,loading:!1})))})))},deleteAction=e=>{_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check).delete(e).then((e=>{fetch(),sweetalert2__WEBPACK_IMPORTED_MODULE_9___default.a.fire("Supprim\xe9 !","","success")})).catch((e=>setError(e.Message)))},getBYId=e=>{setError(""),_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.Check).fetchById(e).then((e=>{if(e.data.client&&!clients2.find((t=>t.id==e.data.client.id))){let t=[...clients2];t.unshift({id:e.data.client.id,name:e.data.client.name}),setclients2(t)}setmodel({...e.data})})).catch((e=>{console.log(e)}))};Object(react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{fetchClients(),fetchBanks(),fetchSummary()}),[]),Object(react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{fetch()}),[filterModel.page,filterModel.take]);const upload=(e,t,a)=>{files.length||(setloading(!0),_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.File).upload(t).then((t=>{setloading(!1);let n=e.findIndex((e=>e.fileKey==a));setfiles((t=>{let a=[...e];return a[n].status="finished",a})),setmodel((e=>({...model,attachments:t.data[0].name})))})).catch((t=>{setloading(!1);let n=e.findIndex((e=>e.fileKey==a));setfiles((t=>{let a=[...e];return a[n].status="error",a}))})))},_delete=e=>{let t=files.findIndex((t=>t.fileKey==e));_Api___WEBPACK_IMPORTED_MODULE_10__.a.createAPIEndpoint(_Api___WEBPACK_IMPORTED_MODULE_10__.a.ENDPOINTS.File).delete(files[t].name).then((e=>{setfiles((e=>{let a=[...e];return a.splice(t),a}));let a=[...model.attachments];a.splice(t),setmodel((e=>({...model,attachments:a})))})).catch((e=>{}))},columns=[{value:"number",name:"Num\xe9ro",value2:"id",render:(e,t)=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("b",{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("a",{onClick:()=>{getBYId(t),setstate((e=>({...e,open:!0})))},children:e})})},{value:"client",value2:"b2CName",name:"Client",render:(e,t)=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)("a",{children:[e?e.name:"-",t?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("br",{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("i",{style:{color:"#777"},children:t})]}):""," "]})},{value:"owner",name:"Tireur / Proprietaire",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("a",{style:{fontSize:"14px"},children:e||"-"})},{value:"amount",name:"Montant",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("b",{style:{fontSize:"14px"},children:Object(_Helpers_number_formatter__WEBPACK_IMPORTED_MODULE_24__.a)(e)})},{value:"depositBank",name:"Banque de D\xe9p\xf4t",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("b",{style:{fontSize:"13px"},children:e?e.name:""})},{value:"depositDate",name:"Date De D\xe9p\xf4t",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_2__.a,{children:moment__WEBPACK_IMPORTED_MODULE_21___default()(e).format("DD MMM YYYY")})},{value:"emmissionBank",name:"Banque d'Emission",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("b",{style:{color:"green",fontSize:"13px"},children:e?e.name:""})},{value:"status",name:"Status",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_2__.a,{color:1==e?"blue":2==e?"green":3==e?"violet":4==e?"black":"yellow",children:_Constants_types__WEBPACK_IMPORTED_MODULE_16__.o.find((t=>t.value==e)).label})},{value:"checkPurpose",name:"Type",render:e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_2__.a,{color:1==e?"":2==e?"green":"",children:_Constants_types__WEBPACK_IMPORTED_MODULE_16__.n.find((t=>t.value==e)).label})},{value:"historic",value2:"depositDate",name:"",render:(e,t)=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_3__.a,{disabled:!e,onClick:()=>{setopen(!0),sethistoric(e),setdate(t)},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_rsuite_icons_ChangeList__WEBPACK_IMPORTED_MODULE_22___default.a,{})})})}];return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)("div",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(_Components_Common_Filter__WEBPACK_IMPORTED_MODULE_13__.a,{search:()=>{fetch(),fetchSummary()},children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("label",{children:"Num\xe9ro: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_4__.a,{placeholder:"recherche",onChange:e=>{setfilterModel((t=>({...t,q:e})))}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("label",{children:"Date De D\xe9p\xf4t: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_5__.a,{placement:"bottomStart",value:filterModel.date,onChange:e=>setfilterModel((t=>({...t,date:e}))),onSelect:e=>setfilterModel((t=>({...t,date:e}))),block:!0})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("label",{children:"Client: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_6__.a,{onSearch:e=>fetchClients(e),data:[{label:"Tout",value:0}].concat(clients.map((e=>({label:e.name,value:e.id})))),block:!0,noSearch:!0,value:filterModel.clientId,onSelect:e=>{setfilterModel((t=>({...t,clientId:e})))}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("label",{children:"Status: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_6__.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(_Constants_types__WEBPACK_IMPORTED_MODULE_16__.o),block:!0,noSearch:!0,value:filterModel.status,onSelect:e=>{setfilterModel((t=>({...t,status:e})))}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{m:6,l:2.4,xl:2.4,className:"p-10",children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("label",{children:"Type: "}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_6__.a,{searchable:!1,data:[{label:"Tout",value:0}].concat(_Constants_types__WEBPACK_IMPORTED_MODULE_16__.n),block:!0,noSearch:!0,value:filterModel.type,onSelect:e=>{setfilterModel((t=>({...t,type:e})))}})]})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Common_ExportAdd__WEBPACK_IMPORTED_MODULE_12__.a,{excelData:Object(_excel_data__WEBPACK_IMPORTED_MODULE_20__.a)(data),nameExcel:"check",size:"md",save:save,AddComponent:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_AddEdit_component__WEBPACK_IMPORTED_MODULE_19__.a,{upload:upload,error:error,model:model,banks:banks.map((e=>({label:e.name,value:e.id}))),_delete:_delete,fetchBanks:fetchBanks,clients:clients2,fetchClients:e=>fetchClients(e,!1),_setmodel:setmodel})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)("div",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__.a,{action:()=>{fetchSummary2(),setcolor("0,169,141")},text:"Total",color:"0,169,141",amount:summary.length&&summary.find((e=>e.id<0)).amount})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__.a,{action:()=>{fetchSummary2(8),setcolor("245,195,35")},text:"Total Pay\xe9 En \xe9speces",color:"245,195,35",amount:summary.length&&summary.find((e=>8==e.id))&&summary.find((e=>8==e.id)).amount})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__.a,{action:()=>{fetchSummary2(1),setcolor("229,57,53")},text:"Total En Coffre",amount:summary.length&&summary.find((e=>1==e.id))&&summary.find((e=>1==e.id)).amount,color:"229,57,53"})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__.a,{action:()=>{fetchSummary2(2),setcolor("84,159,10")},text:"Total Remis \xe0 l'Encaissement",amount:summary.length&&summary.find((e=>2==e.id))&&summary.find((e=>2==e.id)).amount,color:"84,159,10"})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Responsive__WEBPACK_IMPORTED_MODULE_15__.a,{className:"p-10",xs:6,s:6,m:6,l:2.4,xl:2.4,children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__.a,{action:()=>{fetchSummary2(3),setcolor("70,103,209")},text:"Total Encaiss\xe9",amount:summary.length&&summary.find((e=>3==e.id))&&summary.find((e=>3==e.id)).amount})})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_Grid__WEBPACK_IMPORTED_MODULE_14__.a,{loading:state.loading,editAction:e=>{getBYId(e),setstate((e=>({...e,open:!0})))},deleteAction:deleteAction,actionKey:"id",noAdvancedActions:!0,columns:columns,rows:data}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("div",{style:{padding:20,background:"#fff"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite_Pagination__WEBPACK_IMPORTED_MODULE_8__.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:e=>{window.scrollTo(0,0),setfilterModel((t=>({...t,page:e})))},onChangeLimit:e=>{console.log(e),setfilterModel((t=>({...t,take:e,page:1})))}})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_CheckHistoric__WEBPACK_IMPORTED_MODULE_23__.a,{open:open,date:date,historic:historic,handleClose:()=>{reset(),setopen(!1)}}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(Resume,{data:summary2,color:color,open:color.length>0,handleClose:()=>setcolor("")})]})}const Resume=e=>{let{color:t="70,103,209",open:a,handleClose:n,data:s=[]}=e;const c=Object(recoil__WEBPACK_IMPORTED_MODULE_1__.d)(_Atoms_recoveryPoints_atom__WEBPACK_IMPORTED_MODULE_27__.a);return Object(react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{console.log(c)}),[c]),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsxs)(rsuite__WEBPACK_IMPORTED_MODULE_7__.a,{size:"md",overflow:!1,open:a,onClose:n,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_7__.a.Header,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_7__.a.Title,{children:"D\xe9tails"})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_7__.a.Body,{children:c.map(((e,a)=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)("div",{className:"p-5",children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(_Components_ResumeCard__WEBPACK_IMPORTED_MODULE_25__.a,{radius:4,icon:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_28__.jsx)(react_icons_ai__WEBPACK_IMPORTED_MODULE_26__.a,{}),text:e.label,color:t,amount:s.find((t=>t.id==e.value))?s.find((t=>t.id==e.value)).amount:0},a)})))})]})}},745:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(11),s=a(10),c=a.n(s);const i=e=>[{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((e=>[{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:c()(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:n.o.find((t=>t.value==e.status)).label,style:{font:{sz:"14",color:{rgb:"5a2c3e"}},alignment:{horizontal:"center"}}},{value:n.n.find((t=>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"}}}]))}]},746:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return CheckHistoric}));var moment__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(10),moment__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2),react__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__),rsuite__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(138),rsuite__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(186),rsuite__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(765),rsuite__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(164),_Constants_types__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(11),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);function CheckHistoric(_ref){let{open:open,handleClose:handleClose,historic:historic,date:date}=_ref;const[state,setstate]=Object(react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);return Object(react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((()=>{setstate([{status:1,Date:moment__WEBPACK_IMPORTED_MODULE_0___default()(date).format("DD/MM/yyyy")},...eval("{data:["+historic+"]}")])}),[open]),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(rsuite__WEBPACK_IMPORTED_MODULE_2__.a,{size:"md",overflow:!1,open:open,onClose:handleClose,children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_2__.a.Title,{children:"Historique des etats:"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_3__.a,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_2__.a.Body,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_4__.a,{align:"vertical",children:state.map((e=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_4__.a.Item,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div",{style:{padding:"0 20px"},children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(rsuite__WEBPACK_IMPORTED_MODULE_5__.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_6__.o.find((t=>t.value==e.status)).label})," ",Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong",{children:e.Date})]})})))})})]})})}const A=()=>Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment,{children:"test"})},759:function(e,t,a){"use strict";e.exports={parse:function(e){if(null==e||88!=e.length)throw new Error("Invalid MRZ length");var t=c(e.substring(0,1));if("P"!=t)throw new Error("Not a passport MRZ, only passport MRZ currently supported!");var a=c(e.substring(1,2));""==a&&(a=null);try{var n=c(e.substring(2,5)),s=i(e.substring(5,44)),j=e.substring(44,53),b=c(j),h=e.substring(53,54),u=d(j,h),p=o(c(e.substring(54,57))),m=e.substring(57,63),x=l(c(m)),O=e.substring(63,64),g=d(m,O),f=r(c(e.substring(64,65))),y=e.substring(65,71),v=l(c(y)),_=c(e.substring(71,72)),C=d(y,_),I=e.substring(72,86),N=c(I),E=e.substring(86,87),S=d(I,E),D=e.substring(87,88),k=d(j+h+m+O+y+_+I+E,D);return{documentCode:t,documentType:"PASSPORT",documentTypeCode:a,issuer:n,names:s,documentNumber:b,nationality:p,dob:x,sex:f,checkDigit:{documentNumber:{value:h,valid:u},dob:{value:O,valid:g},expiry:{value:_,valid:C},personalNumber:{value:E,valid:S},finalCheck:{value:D,valid:k},valid:u&&g&&C&&S&&k},expiry:v,personalNumber:N}}catch(P){throw P}}};var n=[];n.AFG="Afghanistan",n.ALB="Albania",n.DZA="Algeria",n.ASM="American Samoa",n.AND="Andorra",n.AGO="Angola",n.AIA="Anguilla",n.ATA="Antarctica",n.ATG="Antigua and Barbuda",n.ARG="Argentina",n.ARM="Armenia",n.ABW="Aruba",n.AUS="Australia",n.AUT="Austria",n.AZE="Azerbaijan",n.BHS="Bahamas",n.BHR="Bahrain",n.BGD="Bangladesh",n.BRB="Barbados",n.BLR="Belarus",n.BEL="Belgium",n.BLZ="Belize",n.BEN="Benin",n.BMU="Bermuda",n.BTN="Bhutan",n.BOL="Bolivia",n.BIH="Bosnia and Herzegovina",n.BWA="Botswana",n.BVT="Bouvet Island",n.BRA="Brazil",n.IOT="British Indian Ocean Territory",n.BRN="Brunei Darussalam",n.BGR="Bulgaria",n.BFA="Burkina Faso",n.BDI="Burundi",n.KHM="Cambodia",n.CMR="Cameroon",n.CAN="Canada",n.CPV="Cape Verde",n.CYM="Cayman Islands",n.CAF="Central African Republic",n.TCD="Chad",n.CHL="Chile",n.CHN="China",n.CXR="Christmas Island",n.CCK="Cocos (Keeling) Islands",n.COL="Colombia",n.COM="Comoros",n.COG="Congo",n.COK="Cook Islands",n.CRI="Costa Rica",n.CIV="C\xf4te d'Ivoire",n.HRV="Croatia",n.CUB="Cuba",n.CYP="Cyprus",n.CZE="Czech Republic",n.PRK="Democratic People's Republic of Korea",n.COD="Democratic Republic of the Congo",n.DNK="Denmark",n.DJI="Djibouti",n.DMA="Dominica",n.DOM="Dominican Republic",n.TMP="East Timor",n.ECU="Ecuador",n.EGY="Egypt",n.SLV="El Salvador",n.GNQ="Equatorial Guinea",n.ERI="Eritrea",n.EST="Estonia",n.ETH="Ethiopia",n.FLK="Falkland Islands (Malvinas)",n.FRO="Faeroe Islands",n.FJI="Fiji",n.FIN="Finland",n.FRA="France",n.FXX="France, Metropolitan",n.GUF="French Guiana",n.PYF="French Polynesia",n.GAB="Gabon",n.GMB="Gambia",n.GEO="Georgia",n.D="Germany",n.GHA="Ghana",n.GIB="Gibraltar",n.GRC="Greece",n.GRL="Greenland",n.GRD="Grenada",n.GLP="Guadeloupe",n.GUM="Guam",n.GTM="Guatemala",n.GIN="Guinea",n.GNB="Guinea-Bissau",n.GUY="Guyana",n.HTI="Haiti",n.HMD="Heard and McDonald Islands",n.VAT="Holy See (Vatican City State)",n.HND="Honduras",n.HKG="Hong Kong",n.HUN="Hungary",n.ISL="Iceland",n.IND="India",n.IDN="Indonesia",n.IRN="Iran, Islamic Republic of",n.IRQ="Iraq",n.IRL="Ireland",n.ISR="Israel",n.ITA="Italy",n.JAM="Jamaica",n.JPN="Japan",n.JOR="Jordan",n.KAZ="Kazakhstan",n.KEN="Kenya",n.KIR="Kiribati",n.KWT="Kuwait",n.KGZ="Kyrgyzstan",n.LAO="Lao People's Democratic Republic",n.LVA="Latvia",n.LBN="Lebanon",n.LSO="Lesotho",n.LBR="Liberia",n.LBY="Libyan Arab Jamahiriya",n.LIE="Liechtenstein",n.LTU="Lithuania",n.LUX="Luxembourg",n.MDG="Madagascar",n.MWI="Malawi",n.MYS="Malaysia",n.MDV="Maldives",n.MLI="Mali",n.MLT="Malta",n.MHL="Marshall Islands",n.MTQ="Martinique",n.MRT="Mauritania",n.MUS="Mauritius",n.MYT="Mayotte",n.MEX="Mexico",n.FSM="Micronesia, Federated States of",n.MCO="Monaco",n.MNG="Mongolia",n.MNE="Montenegro",n.MSR="Montserrat",n.MAR="Morocco",n.MOZ="Mozambique",n.MMR="Myanmar",n.NAM="Namibia",n.NRU="Nauru",n.NPL="Nepal",n.NLD="Netherlands, Kingdom of the",n.ANT="Netherlands Antilles",n.NTZ="Neutral Zone",n.NCL="New Caledonia",n.NZL="New Zealand",n.NIC="Nicaragua",n.NER="Niger",n.NGA="Nigeria",n.NIU="Niue",n.NFK="Norfolk Island",n.MNP="Northern Mariana Islands",n.NOR="Norway",n.OMN="Oman",n.PAK="Pakistan",n.PLW="Palau",n.PSE="Palestine",n.PAN="Panama",n.PNG="Papua New Guinea",n.PRY="Paraguay",n.PER="Peru",n.PHL="Philippines",n.PCN="Pitcairn",n.POL="Poland",n.PRT="Portugal",n.PRI="Puerto Rico",n.QAT="Qatar",n.KOR="Republic of Korea",n.MDA="Republic of Moldova",n.REU="R\xe9union",n.ROU="Romania",n.RUS="Russian Federation",n.RWA="Rwanda",n.SHN="Saint Helena",n.KNA="Saint Kitts and Nevis",n.LCA="Saint Lucia",n.SPM="Saint Pierre and Miquelon",n.VCT="Saint Vincent and the Grenadines",n.WSM="Samoa",n.SMR="San Marino",n.STP="Sao Tome and Principe",n.SAU="Saudi Arabia",n.SRB="Serbia",n.SEN="Senegal",n.SYC="Seychelles",n.SLE="Sierra Leone",n.SGP="Singapore",n.SVK="Slovakia",n.SVN="Slovenia",n.SLB="Solomon Islands",n.SOM="Somalia",n.ZAF="South Africa",n.SGS="South Georgia and the South Sandwich Island",n.SSD="South Sudan",n.ESP="Spain",n.LKA="Sri Lanka",n.SDN="Sudan",n.SUR="Suriname",n.SJM="Svalbard and Jan Mayen Islands",n.SWZ="Swaziland",n.SWE="Sweden",n.CHE="Switzerland",n.SYR="Syrian Arab Republic",n.TWN="Taiwan Province of China",n.TJK="Tajikistan",n.TLS="Timor Leste",n.THA="Thailand",n.MKD="The former Yugoslav Republic of Macedonia",n.TGO="Togo",n.TKL="Tokelau",n.TON="Tonga",n.TTO="Trinidad and Tobago",n.TUN="Tunisia",n.TUR="Turkey",n.TKM="Turkmenistan",n.TCA="Turks and Caicos Islands",n.TUV="Tuvalu",n.UGA="Uganda",n.UKR="Ukraine",n.ARE="United Arab Emirates",n.GBR="United Kingdom of Great Britain and Northern Ireland Citizen",n.GBD="United Kingdom of Great Britain and Northern Ireland Dependent Territories Citizen",n.GBN="United Kingdom of Great Britain and Northern Ireland National (oversees)",n.GBO="United Kingdom of Great Britain and Northern Ireland Oversees Citizen",n.GBP="United Kingdom of Great Britain and Northern Ireland Protected Person",n.GBS="United Kingdom of Great Britain and Northern Ireland Subject",n.TZA="United Republic of Tanzania",n.USA="United States of America",n.UMI="United States of America Minor Outlying Islands",n.URY="Uruguay",n.UZB="Uzbekistan",n.VUT="Vanuatu",n.VEN="Venezuela",n.VNM="Viet Nam",n.VGB="Virgin Islands (Great Britian)",n.VIR="Virgin Islands (United States)",n.WLF="Wallis and Futuna Islands",n.ESH="Western Sahara",n.YEM="Yemen",n.ZAR="Zaire",n.ZMB="Zambia",n.ZWE="Zimbabwe",n.UNO="United Nations Organization Official",n.UNA="United Nations Organization Specialized Agency Official",n.XAA="Stateless (per Article 1 of 1954 convention)",n.XXB="Refugee (per Article 1 of 1951 convention, amended by 1967 protocol)",n.XXC="Refugee (non-convention)",n.XXX="Unspecified / Unknown";var s=[];s["<"]=0,s.A=10,s.B=11,s.C=12,s.D=13,s.E=14,s.F=15,s.G=16,s.H=17,s.I=18,s.J=19,s.K=20,s.L=21,s.M=22,s.N=23,s.O=24,s.P=25,s.Q=26,s.R=27,s.S=28,s.T=29,s.U=30,s.V=31,s.W=32,s.X=33,s.Y=34,s.Z=35;var c=function e(t){if(!t||"undefined"===typeof t|null==t)return t;if(t instanceof Array){for(var a=0;aa?"19"+e.substring(0,2):"20"+e.substring(0,2),month:e.substring(2,4),day:e.substring(4,6),original:e}},r=function(e){var t=void 0,a=void 0;return"M"==e?(t="M",a="Male"):"F"==e?(t="F",a="Female"):(t="X",a="Unspecified"),{abbr:t,full:a}},o=function(e){var t=n[e];if(!t)throw new Error("Invalid region");return{abbr:e,full:t}},d=function(e,t){for(var a=[],n=[7,3,1],c=0;c