const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/index.CvdgrPfB.js","assets/js/65317f9b-7a7b-494a-99cc-5698347a8052.k3JKT82G.js","index.js"])))=>i.map(i=>d[i]);
import{j as e,r as v}from"./65317f9b-7a7b-494a-99cc-5698347a8052.k3JKT82G.js";import{c as y,_ as j,G as N,O as _,x as w,S as k,U as C,v as M,Q as L,E as R,W as T,X as I}from"../../index.js";var S=function(r,s){var t=r.match(/^data:(.*?);base64,/),o=t?t[1]:null;if(!o){console.error("MIME type inválido!");return}for(var c=r.replace(/^data:(.*?);base64,/,""),n=atob(c),d=new Uint8Array(n.length),l=0;l<n.length;l++)d[l]=n.charCodeAt(l);var u=new Blob([d],{type:o}),i=document.createElement("a");i.href=URL.createObjectURL(u),i.download=s,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(i.href)},z=function(r){var s=r.icon,t=r.title,o=r.description;return e.jsx("div",{className:"max-w-sm mx-auto overflow-hidden",children:e.jsxs("div",{className:"p-4 flex flex-col items-center text-center",children:[s&&e.jsx("div",{className:"mb-2",children:s}),e.jsx("h2",{className:"text-lg font-semibold mb-1",children:t}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:o})]})})};const E=y("ClipboardPenLine",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",key:"1oijnt"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.5",key:"1but9f"}],["path",{d:"M16 4h2a2 2 0 0 1 1.73 1",key:"1p8n7l"}],["path",{d:"M8 18h1",key:"13wk12"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}]]);var D=v.lazy(function(){return j(()=>import("./index.CvdgrPfB.js"),__vite__mapDeps([0,1,2]))});function O(r){var s=r.base64;return e.jsx(v.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(D,{base64:s})})}var U=function(r){var s=r.base64,t=s.split(";")[0].split(":")[1].split("/")[0];return e.jsx(I,{type:t!=="image"&&t!=="video"&&t!=="audio"?"doc":t,style:"w-4 h-4 text-[var(--icon)]"})};function B(r){var s=r.id,t=N().language,o=_(),c=o.getNotes,n=o.deleteNote,d=w().getContainer,l=d(s)(),u=l.userID,i=l.viwerModel,b=l.setRenderView,x=k.useModalOptions().open,p=["video","image","audio"],h=function(a){R({type:"Success",message:t.note_copy,position:"top-right"}),T(a)},g=function(a){b("edit"),d(s).setState({note:a})},m=e.jsx("div",{className:(i==="modal"?"my-4":"")+" flex flex-col gap-4 overflow-auto p-2",style:{maxHeight:"calc(100vh - 167px)"},children:c(u).map(function(a){return e.jsx("div",{className:"card shadow-sm bg-[var(--background-default-active)]",children:e.jsxs("div",{className:"card-body px-4 pt-2 pb-4",children:[e.jsxs("h2",{className:"card-title text-base",children:[C.MillisToFormattedDate(a.id),a.base64&&a.base64.length!==0&&e.jsx(U,{base64:a.base64})]}),e.jsx("p",{dangerouslySetInnerHTML:{__html:a.text.replace(/\*\_(.*?)\_\*/g,'<strong class="italic">$1</strong>').replace(/\*(.*?)\*/g,"<strong>$1</strong>").replace(/\n/g,"<br>")}}),e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[a.text&&a.text.length!==0&&e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-success hover:!bg-[oklch(var(--su))] hover:!text-[var(--letra)]",onClick:function(){return h(a.text)},children:t.copiar}),e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-warning hover:bg-warning hover:!text-[var(--letra)]",onClick:function(){return g(a)},children:t.edit}),e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-error hover:bg-error hover:!text-[var(--letra)]",onClick:function(){return n(a.id)},children:t.Deletar}),a.base64&&a.base64.length!==0&&p.includes(a.base64.split(";")[0].split(":")[1].split("/")[0])&&e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-primary hover:!bg-[oklch(var(--p))] hover:!text-[var(--letra)]",onClick:function(f){return x(e.jsx(O,{base64:a.base64}),{placement:"left-end"},f.target)},children:t.visualizarMidia}),a.base64&&a.base64.length!==0&&!p.includes(a.base64.split(";")[0].split(":")[1].split("/")[0])&&e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-primary hover:!bg-[oklch(var(--p))] hover:!text-[var(--letra)]",onClick:function(){return S(a.base64,Date.now().toString())},children:t.baixar})]})]})})})});return e.jsxs("div",{className:i==="modal"?"w-[800px]":"",children:[i==="modal"&&e.jsx(M,{children:t.note_list_title}),c(u).length===0?e.jsx(z,{title:t.note_empty_title,description:t.note_empty_desc,icon:e.jsx(E,{size:28,className:"text-[var(--primaria)]"})}):m,e.jsx("div",{className:"flex justify-center mt-1",children:e.jsx(L,{name:t.note_create,funcao:function(){return b("create")}})})]})}const A=Object.freeze(Object.defineProperty({__proto__:null,default:B},Symbol.toStringTag,{value:"Module"}));export{S as B,A as i};
