import{k as z,e as c,o as n,b as i,a as s,t as a,i as m,m as r}from"./vendor-1-1-44.js";import{_ as S}from"./ShipmentInfoModal-1-1-44.js";import{u as U}from"./ResourceStore-1-1-44.js";import{u as B}from"./ApiRequestStore-1-1-44.js";import{c as C,s as V}from"./UiStore-1-1-44.js";const $={class:"flex flex-col gap-4 py-4"},q={class:"flex gap-4 items-center w-full"},M=["src"],A={class:"flex flex-col gap-1 w-full"},D={key:0,class:"bg-gray-100 text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded w-fit"},E={key:1},G={class:"font-bold"},N={class:"flex gap-4 cursor-pointer justify-between"},I={class:"col-span-2 flex flex-col text-xs"},O={class:"font-bold"},P=["href"],R={key:1,class:"text-xs"},T={class:"flex items-center justify-end gap-4"},Y={class:"relative group"},H={key:0,class:"relative group"},L={key:1,class:"relative group"},X={__name:"ShipmentListItem",props:{shipment:{type:Object,required:!0},modals:{type:Object,required:!0},pdfUrlModal:{type:Boolean,required:!0},pdfUrl:{type:String,required:!0}},emits:["update:pdfUrlModal","update:pdfUrl"],setup(e,{emit:h}){const{t:l}=z(),{destroy:x}=U(),{getPdf:g}=B(),p=h,b=async o=>{const t=await g({data:{shipments:[o]}});p("update:pdfUrl",t),p("update:pdfUrlModal",!0)},v=async o=>{C({title:l("cancel_title"),message:l("cancel_shipment"),onConfirm:async()=>{await x({data:{resource:"shipments",id:o}}),V({message:l("resource_deleted",[l("shipment")])}),window.location.reload()}})},u={non_processed:"Gönderime Hazır",shipped:"Yola Çıktı",on_transit:"Taşıma Sürecinde",at_delivery_center:"Dağıtım Merkezinde",in_courier:"Dağıtıma Çıktı",delivered:"Teslim Edildi"};return(o,t)=>{var f,y;const k=c("time-format"),w=c("information-circle-icon"),_=c("printer-icon"),j=c("trash-icon");return n(),i("div",$,[s("div",q,[s("img",{src:(f=e.shipment.cargo_company)==null?void 0:f.logo,class:"object-contain w-16"},null,8,M),s("div",A,[u[e.shipment.status]?(n(),i("span",D,a(u[e.shipment.status]),1)):m("",!0),(y=e.shipment.cargo_company)!=null&&y.title?(n(),i("span",E,a(e.shipment.cargo_company.title)+" ile gönderildi ",1)):m("",!0),s("span",G,[r(k,{date:e.shipment.created_at},null,8,["date"])])])]),s("div",N,[s("div",I,[s("span",O,a(o.$t("tracking_number")),1),e.shipment.tracking_number?(n(),i("a",{key:0,href:e.shipment.tracking_link,target:"_blank",class:"text-primary-600 underline text-xs"},a(e.shipment.tracking_number),9,P)):(n(),i("span",R,a(o.$t("not_yet_formed")),1))]),s("div",T,[s("div",Y,[s("div",{class:"flex items-center justify-center rounded-full size-8 py-2 border text-primary-600 border-primary-600",onClick:t[0]||(t[0]=d=>e.modals[e.shipment.id]=!e.modals[e.shipment.id])},[r(w,{class:"size-5"})]),t[4]||(t[4]=s("span",{class:"absolute -top-8 left-1/2 transform -translate-x-1/2 whitespace-nowrap bg-gray-800 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition"}," Gönderi Bilgisi ",-1))]),e.shipment.status==="non_processed"?(n(),i("div",H,[s("div",{class:"flex items-center justify-center rounded-full size-8 py-2 border text-primary-600 border-primary-600",onClick:t[1]||(t[1]=d=>b(e.shipment.id))},[r(_,{class:"size-5"})]),t[5]||(t[5]=s("span",{class:"absolute -top-8 left-1/2 transform -translate-x-1/2 whitespace-nowrap bg-gray-800 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition"}," Barkod Yazdır ",-1))])):m("",!0),e.shipment.status==="non_processed"?(n(),i("div",L,[s("button",{type:"button",class:"flex items-center justify-center rounded-full py-2 size-8 border text-red-600 border-red-600",onClick:t[2]||(t[2]=d=>v(e.shipment.id))},[r(j,{class:"w-5"})]),t[6]||(t[6]=s("span",{class:"absolute -top-8 left-1/2 transform -translate-x-1/2 whitespace-nowrap bg-gray-800 text-white text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition"}," Gönderiyi İptal Et ",-1))])):m("",!0)])]),r(S,{modelValue:e.modals[e.shipment.id],"onUpdate:modelValue":t[3]||(t[3]=d=>e.modals[e.shipment.id]=d),shipment:e.shipment},null,8,["modelValue","shipment"])])}}};export{X as _};
