${(function(){
let infoData = [];
let orderInfoArr = [];
let shippingInfoArr = [];
let finishOrderInfoArr = [];
let tracking_destination_country = '';
const mapList = {
create_fulfillment:"Ihre Bestellung ist abgeschlossen.",
finish_fulfillment:"Die Bestellung wird bearbeitet.",
order_payment:"Ihre Zahlung war erfolgreich.",
created_order:"Ihre Bestellung wurde erstellt."
};
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}));
};
console.log('oderInfoArr',oderInfoArr)
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(' ')}