import{j as s,r as u}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b.js";import{u as f}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b27.js";import{u as N}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b20.js";import{p as k}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b24.js";import{_ as v,Q as w,bm as y,al as P,aF as C,a2 as L,U as $,ar as B,bo as E,I as m}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b11.js";import{a as A}from"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b107.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b8.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b19.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b7.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b9.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b6.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b4.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b3.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b2.js";import"./v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b10.js";const M=u.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_25_48461181-0d14-4d2a-b9c3-5de50369a90b182.js")),[]));function h({userID:a,onBackBtnClickHnd:i,create:l,product:d}){return s.jsx(u.Suspense,{fallback:s.jsx(s.Fragment,{}),children:s.jsx(M,{userID:a,onBackBtnClickHnd:i,create:l,product:d})})}function x({userID:a}){const{getProduct:i,openLink:l,removeProduct:d}=f(),{language:e}=N(),{open:c}=k(),j=t=>{c(s.jsx(h,{userID:a,create:!1,product:t,onBackBtnClickHnd:()=>c(s.jsx(x,{userID:a}))}))},g=t=>{d(a,t),m({type:"Success",message:e.encomendas_Notif_success_remove,position:"top-right"})},_=async t=>{const o=n.find(p=>p.id===t);let r="";switch(o.transportadora){case"Correios":r=`https://www.linkcorreios.com.br/?id=${o.codigo}`;break;case"Jadlog":r=`https://t.17track.net/pt#nums=${o.codigo}`;break;case"Shopee":case"Aliexpress":case"Gear Best":case"China Post":r=`https://www.muambator.com.br/pacotes/${o.codigo}/detalhes/`;break;case"Loggi":r=`https://www.loggi.com/rastreador/${o.codigo}`;break;default:r=`https://parcelsapp.com/pt/tracking/${o.codigo}`;break}try{await navigator.clipboard.writeText(r),m({type:"Success",message:e.encomendas_Notif_copyLink_sucess,position:"top-right"})}catch(p){console.error(`Error copying message: ${p}`)}},n=i(a),b=()=>n.map(t=>s.jsxs("tr",{className:"hover:bg-base-200 cursor-pointer",children:[s.jsx("td",{className:"rounded-l-lg",children:s.jsx("div",{className:"flex justify-center",children:s.jsx("span",{className:"block max-w-[130px]",children:`${t.nome}`})})}),s.jsx("td",{children:$.converterData(t.date)}),s.jsx("td",{children:`${t.transportadora}`}),s.jsx("td",{children:`${t.codigo}`}),s.jsx("td",{children:`${t.orderID}`}),s.jsx("td",{className:"h-full",children:s.jsx("button",{className:"pulse bg-[var(--button-round-background)] uppercase text-xs hover:bg-[var(--button-secondary-hover)] text-white font-bold py-1 px-3 rounded",onClick:()=>l(t),children:e.modal_table_rastrear})}),s.jsx("td",{className:"rounded-r-lg",children:s.jsxs("div",{className:"flex justify-center gap-2",children:[s.jsx("span",{className:"pulse",onClick:()=>j(t),children:s.jsx(B,{className:"h-5 w-5"})}),s.jsx("span",{className:"pulse",onClick:()=>g(t.id),children:s.jsx(A,{className:"h-5 w-5"})}),s.jsx("span",{className:"pulse",onClick:()=>_(t.id),children:s.jsx(E,{className:"h-5 w-5"})})]})})]},t.id));return s.jsxs("div",{className:"w-auto min-w-[600px] grid gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(w,{children:e.modal_orders_title}),s.jsx("div",{className:"cursor-pointer lg:tooltip lg:tooltip-bottom","data-tip":e.cadastreEncomentasParaAcompanhar,children:s.jsx("span",{className:"pulse",children:s.jsx(y,{className:"h-5 w-5"})})})]}),s.jsx("div",{className:"overflow-auto",style:{maxHeight:"calc(100vh - 300px)"},children:n.length>0?s.jsxs("table",{className:"table text-center",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:e.modal_table_name}),s.jsx("th",{children:e.modal_table_data}),s.jsx("th",{children:e.modal_table_transport}),s.jsx("th",{children:e.modal_table_code}),s.jsx("th",{children:"ID"}),s.jsx("th",{children:e.modal_table_link}),s.jsx("th",{children:e.modal_table_acoes})]})}),s.jsx("tbody",{children:b()})]}):s.jsx(P,{title:e.no_orders_added_title,description:e.no_orders_added_desc,icon:s.jsx(C,{className:"w-7 h-7 text-[var(--primaria)]"})})}),s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(L,{name:e.modal_add,funcao:()=>c(s.jsx(h,{userID:a,create:!0,onBackBtnClickHnd:()=>c(s.jsx(x,{userID:a}))}))})})]})}export{x as default};
