import{bz as j,j as e,bE as b,y as N,H as w,bF as y,Q as h}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b10.js";import{u as g}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b19.js";import{C as k}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b118.js";import{a as _}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b111.js";import{a as C}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b4.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b18.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b8.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b5.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b7.js";var D=function(c){var a=c.base64,r;switch(a.split(";")[0].split(":")[1].split("/")[0]){case"image":r=e.jsx("img",{src:a,className:"w-[150px] max-h-[180px]"});break;case"video":r=e.jsx("video",{src:a,className:"w-[150px] max-h-[180px]",controls:!0});break;case"audio":r=e.jsx("audio",{src:a,className:"w-full",controls:!0});break;default:r=e.jsx("div",{className:"animate__animated animate__zoomIn",children:e.jsx("div",{className:"tvf2evcx m0h2a7mj lb5m6g5c j7l1k36l ktfrpxia nu7pwgvd p357zi0d dnb887gk gjuq5ydh i2cterl7 ac2vgrno f8m0rgwh gndfcl4n cm280p3y jmly3brn qqs366u4 ikqdvm1y m3qqxsiz r1ncx0sg mmj7r7ye py-2",children:e.jsxs("div",{className:"du8bjn1j px-2 !m-0",children:[e.jsx("span",{"data-icon":"preview-generic",className:"flex justify-center",children:e.jsxs("svg",{viewBox:"0 0 88 110",height:"110",width:"88",preserveAspectRatio:"xMidYMid meet",children:[e.jsx("g",{transform:"translate(4 3)",children:e.jsx("path",{"stroke-opacity":"0.08",stroke:"#000",d:"M3-.5h56.929a5.5 5.5 0 0 1 3.889 1.61l15.071 15.072a5.5 5.5 0 0 1 1.611 3.89V101a3.5 3.5 0 0 1-3.5 3.5H3A3.5 3.5 0 0 1-.5 101V3A3.5 3.5 0 0 1 3-.5z",fill:"#FFF","fill-rule":"evenodd"})}),e.jsx("path",{d:"M65.5 3.5v15a3 3 0 0 0 3 3h15","stroke-opacity":"0.12",stroke:"#000",fill:"#FFF"})]})}),e.jsx("span",{className:"pt-1 text-center font-semibold w-full block uppercase",children:"documento"})]})})});break}return r};function M(c){var a,r=c.id,n=g().language,s=j().getContainer,o=s(r)(),l=o.note,d=o.setNote,m=function(t){var i=new FileReader;i.onloadend=function(){var v=i.result;d("base64",v)},i.readAsDataURL(t)},x=function(t){t.preventDefault();var i=t.dataTransfer.files[0];i&&m(i)},p=e.jsxs("div",{className:"flex gap-2 items-center justify-center h-24 w-full",children:[e.jsxs("label",{className:"m-auto p-2 border-base-200 hover:border-[var(--primaria)] border border-solid rounded-lg h-24 w-20 pulse flex justify-center items-center flex-col shadow-lg cursor-pointer",children:[e.jsx(k,{className:"h-6 w-6 text-[var(--primaria)]",strokeWidth:1}),e.jsx("strong",{className:"text-[var(--primaria)]",children:n.importar}),e.jsx("input",{type:"file",className:"hidden",onChange:function(t){return m(t.target.files[0])}})]}),e.jsx("div",{className:"border-dashed border-2 border-[var(--primaria)] rounded-lg h-full w-full flex justify-center items-center",onDrop:x,onDragOver:function(t){return t.preventDefault()},children:n.arrasteOArquivoAqui})]}),u=e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"flex justify-end w-full",children:e.jsx("span",{className:"cursor-pointer pulse",onClick:function(){return d("base64","")},children:e.jsx(_,{className:"w-5 h-5 text-red-500"})})}),e.jsx(D,{base64:l.base64})]}),f=e.jsxs("div",{children:[e.jsx("p",{className:"pb-2",children:n.note_midia_desc}),!l.base64||((a=l.base64)===null||a===void 0?void 0:a.length)===0?p:u]});return f}function L(c){var a=c.id,r=g().language,n=j().getContainer,s=n(a)(),o=s.renderView,l=s.viwerModel,d=s.setRenderView,m=s.note,x=s.setNote,p=s.userID,u=b(),f=u.createNote,t=u.editNote;C.useEffect(function(){return o==="create"&&n(a).setState({note:{id:Date.now(),userID:p,text:"",base64:""}}),function(){n(a).setState({note:{id:NaN,userID:"",text:"",base64:""}})}},[]);var i=e.jsxs("div",{className:(l==="modal"?"w-[600px]":"p-2")+" grid gap-4",children:[l==="modal"?e.jsx(N,{children:o==="create"?r.note_title:r.editarAnotacao}):e.jsx("div",{className:"text-center",children:e.jsx(w,{weight:"600",children:o==="create"?r.note_title:r.editarAnotacao})}),e.jsx(M,{id:a}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"pb-2",children:r.note_insert_desc}),e.jsx(y,{id:a,type:"textarea",className:"w-full",position:"right",placeholder:r.note_place,text:m.text,setText:function(v){return x("text",v)},heightCamp:110})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(h,{name:r.cancel,funcao:function(){return d("list")}}),e.jsx(h,{name:r.save,funcao:function(){return o==="create"?f(a):t(a)}})]})]});return i}export{L as default};
