${(function(){
let infoData = [];
let orderInfoArr = [];
let shippingInfoArr = [];
let finishOrderInfoArr = [];
let tracking_destination_country = '';
const mapList = {
create_fulfillment:"Votre commande est compl\u00e8te.",
finish_fulfillment:"La commande est en cours de traitement.",
order_payment:"Votre paiement a \u00e9t\u00e9 effectu\u00e9 avec succ\u00e8s.",
created_order:"Votre commande a \u00e9t\u00e9 cr\u00e9\u00e9e."
};
if (!data[0]){
oderInfoArr = data.time_line.map((e)=>({...e,uniteTime:e.created_at,message:mapList[e.event_type]}));
}else{
if(data[1]){
tracking_destination_country = data[1].data.tracking_destination_country;
}
let shipping_array = data[1]?.data?.checkpoints || [];
oderInfoArr = data[0].time_line.map((e)=>({...e,uniteTime:e.created_at,message:mapList[e.event_type]}));
shippingInfoArr = shipping_array.map((e)=>({...e,uniteTime:e.checkpoint_time,message:e.message}));
};
infoData = [...oderInfoArr,...shippingInfoArr].sort((a,b)=>new Date(b.uniteTime).getTime()-new Date(a.uniteTime).getTime());
const checkpoints = infoData;
return `
${tracking_destination_country ? `
` })()}
Destination: ${tracking_destination_country}
` : ''} ${checkpoints.map((item)=>{ return` ` }).join(' ')}