import{a as P,C as R,b as v,m as _,g as S,p as f,P as p,q as j,D as y}from"./convert-case-to-camel-case.utils-DDUpNI96.js";const T={class:"ccb-pdf-layout__item--wrapper order_id_and_date","data-id":"order_id_and_date"},Y={key:0,class:"ccb-pdf-item-info--item id"},$={key:1,class:"ccb-pdf-item-info--item date"},J=P({__name:"OrderIdAndDate",props:{pdf:{},item:{},content:{}},setup(z){const B=z,{pdf:h,item:l,content:g}=R(B),F=v(()=>{var a,s,o,d,n,r,u,c,i;const e={},t=(a=h.value.document)==null?void 0:a.tabs;return(d=(o=(s=t==null?void 0:t.body)==null?void 0:s.data)==null?void 0:o.backgroundColor)!=null&&d.value&&(e.backgroundColor=t.body.data.backgroundColor.value),(i=(c=(u=(r=(n=l.value.tabs)==null?void 0:n.design)==null?void 0:r.data)==null?void 0:u.backgroundColor)==null?void 0:c.data)!=null&&i.status?e.backgroundColor=l.value.tabs.design.data.backgroundColor.value:e.backgroundColor="transparent",e}),b=v(()=>{var a,s,o,d,n,r,u,c,i,m,C,D,k,w,A,I,O;const e={},t=(a=h.value.document)==null?void 0:a.tabs;return(d=(o=(s=t==null?void 0:t.body)==null?void 0:s.data)==null?void 0:o.textColor)!=null&&d.value&&(e.color=t.body.data.textColor.value),(i=(c=(u=(r=(n=l.value.tabs)==null?void 0:n.design)==null?void 0:r.data)==null?void 0:u.textColor)==null?void 0:c.data)!=null&&i.status&&(e.color=l.value.tabs.design.data.textColor.value),(k=(D=(C=(m=l.value.tabs)==null?void 0:m.design)==null?void 0:C.data)==null?void 0:D.textAlign)!=null&&k.value&&(e.textAlign=l.value.tabs.design.data.textAlign.value==="justified"?"justify":l.value.tabs.design.data.textAlign.value),(O=(I=(A=(w=l.value.tabs)==null?void 0:w.design)==null?void 0:A.data)==null?void 0:I.fontSize)!=null&&O.value&&(e.fontSize=`${l.value.tabs.design.data.fontSize.value}px`),e}),L=v(()=>{const e={left:"start",right:"end",center:"center",justify:"start"},t=b.value.textAlign||"left";return{justifyContent:e[t]}}),M=v(()=>{var e,t,a,s,o,d;return(d=(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.id)==null?void 0:a.data)==null?void 0:s.showOrderId)==null?void 0:o.data)==null?void 0:d.status}),x=v(()=>{var e;return((e=g.value)==null?void 0:e.id)||""}),N=v(()=>{var e,t,a,s,o;return(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.id)==null?void 0:a.data)==null?void 0:s.showOrderId)==null?void 0:o.value}),V=v(()=>{var e,t,a,s,o,d;return(d=(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.date)==null?void 0:a.data)==null?void 0:s.showDate)==null?void 0:o.data)==null?void 0:d.status}),q=v(()=>{var e,t,a,s,o;return(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.date)==null?void 0:a.data)==null?void 0:s.showDate)==null?void 0:o.value}),E=v(()=>{var d,n,r,u,c,i,m;const e=((i=(c=(u=(r=(n=(d=l.value.tabs)==null?void 0:d.date)==null?void 0:n.data)==null?void 0:r.format)==null?void 0:u.data)==null?void 0:c.dateFormat)==null?void 0:i.value)||"dd/mm/yyyy";let t=new Date;(m=g.value)!=null&&m.date&&(t=new Date(g.value.date));const a=String(t.getDate()).padStart(2,"0"),s=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getFullYear());return e.replace("dd",a).replace("mm",s).replace("yyyy",o)}),H=v(()=>{var d,n,r,u,c,i,m;const e=((i=(c=(u=(r=(n=(d=l.value.tabs)==null?void 0:d.date)==null?void 0:n.data)==null?void 0:r.format)==null?void 0:u.data)==null?void 0:c.timeFormat)==null?void 0:i.value)||"hh:mm:ss";let t=new Date;(m=g.value)!=null&&m.date&&(t=new Date(g.value.date));const a=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return e.replace("hh",a).replace("mm",s).replace("ss",o)});return(e,t)=>(S(),_("div",{class:"ccb-pdf-layout__item",style:p(F.value)},[f("div",T,[f("span",{class:"ccb-pdf-item-info",style:p(L.value)},[M.value&&x.value?(S(),_("span",Y,[f("span",{class:"ccb-pdf-item-info--item-label",style:p(b.value)},y(N.value),5),f("span",{class:"ccb-pdf-item-info--item-value",style:p(b.value)},y(x.value),5)])):j("",!0),V.value?(S(),_("span",$,[f("span",{class:"ccb-pdf-item-info--item-label",style:p(b.value)},y(q.value),5),f("span",{class:"ccb-pdf-item-info--item-value",style:p(b.value)},y(E.value)+" "+y(H.value),5)])):j("",!0)],4)])],4))}});export{J as default};
//# sourceMappingURL=OrderIdAndDate-DNxF1tnx.js.map
