1 line
39 KiB
JavaScript
1 line
39 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4156],{96224:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)([(0,l.jsx)("path",{d:"m16 7.58-5.5-2.4L5 7.58v3.6c0 3.5 2.33 6.74 5.5 7.74.25-.08.49-.2.73-.3-.15-.51-.23-1.06-.23-1.62 0-2.97 2.16-5.43 5-5.91V7.58z",opacity:".3"},"0"),(0,l.jsx)("path",{d:"M17 13c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1.38c.62 0 1.12.51 1.12 1.12s-.51 1.12-1.12 1.12-1.12-.51-1.12-1.12.5-1.12 1.12-1.12zm0 5.37c-.93 0-1.74-.46-2.24-1.17.05-.72 1.51-1.08 2.24-1.08s2.19.36 2.24 1.08c-.5.71-1.31 1.17-2.24 1.17z",opacity:".3"},"1"),(0,l.jsx)("circle",{cx:"17",cy:"15.5",r:"1.12"},"2"),(0,l.jsx)("path",{d:"M18 11.09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55C13.18 21.99 14.97 23 17 23c3.31 0 6-2.69 6-6 0-2.97-2.16-5.43-5-5.91zM11 17c0 .56.08 1.11.23 1.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4 5.5 2.4v3.51c-2.84.48-5 2.94-5 5.91zm6 4c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"},"3"),(0,l.jsx)("path",{d:"M17 17.5c-.73 0-2.19.36-2.24 1.08.5.71 1.32 1.17 2.24 1.17s1.74-.46 2.24-1.17c-.05-.72-1.51-1.08-2.24-1.08z"},"4")],"AdminPanelSettingsTwoTone");t.Z=o},47381:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)([(0,l.jsx)("path",{d:"M5 5v14h14V5H5zm9 12H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z",opacity:".3"},"0"),(0,l.jsx)("path",{d:"M7 15h7v2H7zm0-4h10v2H7zm0-4h10v2H7zm12-4h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64S3 4.72 3 5v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7-.25c.41 0 .75.34.75.75s-.34.75-.75.75-.75-.34-.75-.75.34-.75.75-.75zM19 19H5V5h14v14z"},"1")],"AssignmentTwoTone");t.Z=o},88518:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)([(0,l.jsx)("path",{d:"M22 15c0-1.66-1.34-3-3-3h-1.5v-.5C17.5 8.46 15.04 6 12 6c-.77 0-1.49.17-2.16.46L20.79 17.4c.73-.55 1.21-1.41 1.21-2.4zM2 14c0 2.21 1.79 4 4 4h9.73l-8-8H6c-2.21 0-4 1.79-4 4z",opacity:".3"},"0"),(0,l.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.33 0-2.57.36-3.65.97l1.49 1.49C10.51 6.17 11.23 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 .99-.48 1.85-1.21 2.4l1.41 1.41c1.09-.92 1.8-2.27 1.8-3.81 0-2.64-2.05-4.78-4.65-4.96zM3 5.27l2.77 2.77h-.42C2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h11.73l2 2 1.41-1.41L4.41 3.86 3 5.27zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73z"},"1")],"CloudOffTwoTone");t.Z=o},52778:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)((0,l.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4h-3.5z"}),"DeleteOutlineOutlined");t.Z=o},30212:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)([(0,l.jsx)("path",{d:"M11.17 4H7v11h14V6h-7.83z",opacity:".3"},"0"),(0,l.jsx)("path",{d:"M21 4h-7l-2-2H7c-1.1 0-1.99.9-1.99 2L5 15c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 11H7V4h4.17l2 2H21v9z"},"1"),(0,l.jsx)("path",{d:"M3 6H1v13c0 1.1.9 2 2 2h17v-2H3V6z"},"2")],"FolderCopyTwoTone");t.Z=o},73340:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)((0,l.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOpenOutlined");t.Z=o},95808:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)([(0,l.jsx)("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6z"},"0"),(0,l.jsx)("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32z"},"1")],"LockPersonRounded");t.Z=o},99152:function(e,t,a){var n=a(64836);t.Z=void 0;var i=n(a(64938)),l=a(85893),o=(0,i.default)([(0,l.jsx)("path",{d:"m13.17 6-.59-.59L11.17 4H6v12h16V6h-8.83zm4.33 4.5L21 15H7l4.5-6 3.5 4.51 2.5-3.01z",opacity:".3"},"0"),(0,l.jsx)("path",{d:"M2 6H0v5h.01L0 20c0 1.1.9 2 2 2h18v-2H2V6zm5 9h14l-3.5-4.5-2.5 3.01L11.5 9zM22 4h-8l-2-2H6c-1.1 0-1.99.9-1.99 2L4 16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 12H6V4h5.17l1.41 1.41.59.59H22v10z"},"1")],"PermMediaTwoTone");t.Z=o},57150:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path",{d:"M8 7h6",key:"1f0q6e"}],["path",{d:"M8 11h8",key:"vwpz6n"}]])},64998:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},33587:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},3848:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("FileKey2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]])},4844:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},68599:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},78107:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]])},62888:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},49525:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},41352:function(e,t,a){a.d(t,{Z:function(){return n}});const n=(0,a(45711).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},62588:function(e,t,a){a.d(t,{Z:function(){return s}});var n=a(85893),i=(a(67294),a(25472)),l=a(78107),o=a(45711);const r=(0,o.Z)("Files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]),c=(0,o.Z)("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);function s(e){var t=e.user;return(0,n.jsx)(i.ZP,{title:"choose-media-type-popoup",noContainer:!0,wrapperClasses:"items-center",wrapperStyle:{alignItems:"center"},children:(0,n.jsxs)("div",{className:"paper items-center max-w-2xl m-auto z-50 p-4 xl:p-10",children:[(0,n.jsxs)("h4",{className:"m-0 text-center text-lg leading-tight",children:["What kind of Media do you",(0,n.jsx)("br",{}),"want to upload?"]}),(0,n.jsx)("span",{children:"Please Select the media type to upload."}),(0,n.jsxs)("div",{className:"w-full grid grid-cols-1 lg:grid-cols-2 gap-6 items-stretch",children:[(0,n.jsxs)("div",{className:"card cursor-pointer",onClick:function(e){var a;if(null===t||void 0===t||null===(a=t.verification_status)||void 0===a?void 0:a.toString().match(/1/)){var n=document.getElementById("upload_image_input");null===n||void 0===n||n.click()}else alert("Please Verify to Add Media");setTimeout((function(){(0,i.j4)()}),500)},children:[(0,n.jsx)(l.Z,{size:50,className:"text-primary"}),(0,n.jsxs)("div",{className:"content",children:[(0,n.jsx)("span",{className:"title",children:"Images"}),(0,n.jsx)("span",{className:"text-sm",children:"General image formats like JPEG, PNG, SVG, WEBP, etc."})]})]}),(0,n.jsxs)("div",{className:"card cursor-pointer",onClick:function(e){var a,n;(null===t||void 0===t||null===(a=t.verification_status)||void 0===a?void 0:a.toString().match(/1/))?null===(n=document.getElementById("upload_file_input"))||void 0===n||n.click():alert("Please Verify to Add Media");(0,i.j4)()},children:[(0,n.jsx)(r,{size:50,className:"text-secondary"}),(0,n.jsxs)("div",{className:"content",children:[(0,n.jsx)("span",{className:"title",children:"Files"}),(0,n.jsx)("span",{className:"text-sm",children:"Other documents type. Like PDF, XLSX, CSV, etc."})]})]})]}),(0,n.jsx)("div",{className:"w-full grid grid-cols-1 lg:grid-cols-2 gap-6 items-stretch",children:(0,n.jsxs)("div",{className:"card cursor-pointer",onClick:function(e){var a,n;(null===t||void 0===t||null===(a=t.verification_status)||void 0===a?void 0:a.toString().match(/1/))?null===(n=document.getElementById("upload_video_input"))||void 0===n||n.click():alert("Please Verify to Add Media");(0,i.j4)()},children:[(0,n.jsx)(c,{size:55,className:"text-slate-600"}),(0,n.jsxs)("div",{className:"content",children:[(0,n.jsx)("span",{className:"title",children:"Videos"}),(0,n.jsxs)("span",{className:"text-sm",children:["Video Files. ",(0,n.jsx)("b",{children:"MP4"})," for now. These files can be streamed. Max 200mb"]})]})]})})]})})}},17244:function(e,t,a){a.d(t,{Z:function(){return M}});var n=a(85893),i=a(67294),l=a(828),o=a(86729),r=a(30212),c=a(52778),s=a(95264);function d(e){var t=e.folderName,a=e.folder,d=e.user,u="".concat(a?a+"/":"").concat(t),m=(0,l.Z)(i.useState(!1),2),h=m[0],f=m[1];return(0,n.jsxs)("a",{href:"/admin/".concat(null===d||void 0===d?void 0:d.id,"/media/").concat(u),className:"card col items-center justify-center",onClick:function(e){if(e.target.closest("button"))return e.preventDefault()},children:[h&&(0,n.jsx)(s.Z,{}),(0,n.jsx)(r.Z,{sx:{fontSize:100},className:"opacity-20"}),(0,n.jsx)("span",{className:"absolute top-4 left-4 text-xs bg-slate-200 dark:bg-slate-700 px-2 py-0.5 rounded-full",children:"Folder"}),(0,n.jsx)("span",{className:"",children:t}),(0,n.jsx)("button",{className:"plain-text absolute top-2 right-2",onClick:function(e){window.confirm("Delete this Folder and all its contents?")&&(f(!0),window.confirm("NOTE: this folder and all its contents will be permanently lost. Continue?")?(0,o.Z)("/api/deleteMediaFolder",{method:"post",body:{folder:u}},!0).then((function(e){e.success&&window.location.reload()})):f(!1))},children:(0,n.jsx)(c.Z,{className:"opacity-30"})})]},t)}var u=a(26042),m=a(69396),h=a(25472),f=a(45449),p=a(18826),v=a(47381);function x(e){var t,a,l=e.mediaObject,r=e.staticHost,c=l.media_thumbnail_path?(null===l||void 0===l?void 0:l.private)?l.media_thumbnail_url:"".concat(r).concat(l.media_thumbnail_path):l.media_thumbnail_url,s=l.media_path?(null===l||void 0===l?void 0:l.private)?l.media_url:"".concat(r).concat(l.media_path):l.media_url;return(0,n.jsx)(i.Fragment,{children:(null===(t=l.media_type)||void 0===t?void 0:t.match(/file/i))?(0,n.jsxs)("div",{className:"cursor-pointer hover:opacity-80",children:[(0,n.jsx)(v.Z,{sx:{fontSize:100},className:"opacity-10"}),(0,n.jsx)("span",{className:"info w-auto small gray absolute top-4 right-4",children:l.media_type.replace(/.*\//,"").toUpperCase()})]}):(null===(a=l.media_type)||void 0===a?void 0:a.match(/video/i))?(0,n.jsx)("video",{src:s,className:"w-full h-60 object-cover",controls:!0,muted:!0,autoPlay:!0,loop:!0}):(0,n.jsx)("img",{src:c,alt:l.media_name,className:"w-full h-60 object-cover bg-slate-200 rounded",onError:function(e){(null===l||void 0===l?void 0:l.private)||(0,o.Z)("/api/purgeDb",{method:"post",body:{paradigm:"user_media",payload:l}},!0).then((function(e){e.success?window.location.reload():(console.log(e),console.log(c),console.log(s))}))}})})}var g=a(34642);function y(e){var t,a=e.mediaObject,l=e.staticHost;a.media_thumbnail_path?"".concat(l,"/").concat(a.media_thumbnail_path):a.media_thumbnail_url,a.media_path?"".concat(l,"/").concat(a.media_path):a.media_url;return(null===a||void 0===a?void 0:a.private)?(0,n.jsx)(i.Fragment,{}):(0,n.jsxs)("div",{className:"dropdown-wrapper w-full xl:w-auto",children:[(0,n.jsx)("button",{className:"outlined secondary small-text w-full hidden xl:flex bg-secondary/10",children:"Copy Link"}),(0,n.jsx)("div",{className:"dropdown mobile-transform gap-2 w-full",children:(0,n.jsxs)(f.Z,{column:!0,className:"w-full mb-2 xl:mb-0",children:[(0,n.jsx)("button",{className:"gray outlined normal-weight more-padding",onClick:function(e){navigator.clipboard.writeText(a.media_url||"").then((function(){alert("Media url ".concat(a.media_url," Copied to clipboard"))}))},children:"Copy Full Link"}),!(null===a||void 0===a||null===(t=a.media_type)||void 0===t?void 0:t.match(/file|video/i))&&(0,n.jsx)("button",{className:"gray outlined normal-weight more-padding",onClick:function(e){navigator.clipboard.writeText(a.media_thumbnail_url||"").then((function(){alert("Media url ".concat(a.media_thumbnail_url," Copied to clipboard"))}))},children:"Copy Thumbnail Link"})]})})]})}var w=a(45711);const b=(0,w.Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),j=(0,w.Z)("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);function N(e){var t,a=e.mediaObject,r=e.setLoading,c=(0,l.Z)(i.useState(!1),2);c[0],c[1];return(null===a||void 0===a||null===(t=a.media_type)||void 0===t?void 0:t.match(/video/i))?null:(0,n.jsx)("button",{className:"light-gray p-2 w-8 h-8 rounded-full absolute top-4 left-4 bg-white"+((null===a||void 0===a?void 0:a.private)?" ":" text-slate-400 fill-slate-400"),style:{backgroundColor:"white"},onClick:function(e){var t=a.private?"This media is private: Make it public?":"Make this media Private?";window.confirm(t)&&(r(!0),(0,o.Z)("/api/media/addPrivateMedia",{method:"post",body:(0,u.Z)({},a)},!0).then((function(e){e.success?window.location.reload():window.alert("Action Failed!"),setTimeout((function(){r(!1)}),1e3)})).catch((function(e){console.log(e)})))},children:(null===a||void 0===a?void 0:a.private)?(0,n.jsx)(b,{size:20,color:"green"}):(0,n.jsx)(j,{color:"black",size:20})})}var Z=a(58436);function _(e){var t=e.mediaObject,a=e.setTargetMedia,o=(e.folder,e.staticHost),r=(0,l.Z)(i.useState(!!(null===t||void 0===t?void 0:t.private)),2),c=r[0],d=r[1],v=(0,l.Z)(i.useState(t),2),w=v[0],b=v[1];i.useEffect((function(){var e;(null===t||void 0===t?void 0:t.private)&&t.media_thumbnail_url&&!(null===(e=w.media_type)||void 0===e?void 0:e.match(/file/i))?(0,Z.Z)({url:t.media_thumbnail_url}).then((function(e){b((0,m.Z)((0,u.Z)({},t),{media_thumbnail_url:e})),d(!1)})).catch((function(e){console.log(e.message)})):c&&d(!1)}),[]);w.media_thumbnail_path?"".concat(o,"/").concat(w.media_thumbnail_path):w.media_thumbnail_url;var j=w.media_path?"".concat(o,"/").concat(w.media_path):w.media_url;return(0,n.jsxs)("div",{className:"media-card card col",onClick:function(e){var t,n;if(!e.target.closest("button")&&!e.target.closest(".button"))if(!(null===(t=w.media_type)||void 0===t?void 0:t.match(/file/i))||w.private)(null===(n=w.media_type)||void 0===n?void 0:n.match(/file/i))&&w.private||(a(w),(0,h.Mw)("target-media-popup"));else{var i=j;window.open(i,"__blank")}},onMouseEnter:function(e){e.target.closest(".media-card").style.zIndex="10"},onMouseLeave:function(e){e.target.closest(".media-card").style.zIndex="0"},style:(null===w||void 0===w?void 0:w.private)?{outline:"5px solid var(--sec-color-light)",borderColor:"var(--sec-color-lighter)"}:{},children:[c&&(0,n.jsx)(s.Z,{}),(0,n.jsx)(x,{mediaObject:w,staticHost:o}),(0,n.jsxs)("div",{className:"flex-col items-center xl:items-start flex-wrap w-full mt-auto",children:[(0,n.jsx)("span",{className:"w-full",style:{wordBreak:"break-all"},children:w.media_name}),(0,n.jsx)("div",{className:"flex-wrap w-full",children:(0,n.jsxs)(f.Z,{className:"flex-wrap w-full items-stretch",children:[(0,n.jsx)("button",{className:"secondary small-text relative w-full xl:w-auto mb-2 xl:mb-0",onClick:function(e){var t;(0,p.Z)({mediaObject:w,fileName:(null===(t=null===j||void 0===j?void 0:j.match(/[^\/]+$/))||void 0===t?void 0:t[0])||"",setLoading:d})},children:(0,n.jsx)("span",{children:"Download"})}),(0,n.jsx)(y,{mediaObject:w,staticHost:o}),(0,n.jsx)(g.Z,{mediaObject:w,setLoading:d})]})})]}),(0,n.jsx)(N,{mediaObject:w,setLoading:d})]})}var k=a(99152);function M(e){var t=e.media,a=e.setTargetMedia,l=e.folders,o=e.folder,r=e.staticHost,c=e.user;return(0,n.jsx)(i.Fragment,{children:(0,n.jsxs)("section",{className:"paper overflow-visible",children:[(0,n.jsx)("h2",{className:"text-xl m-0",children:"Media List"}),(0,n.jsxs)("div",{className:"w-full gap-4 grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 items-stretch",children:[l&&l[0]&&l.map((function(e){return(0,n.jsx)(d,{folder:o,folderName:e,user:c},e)})),t&&t[0]&&t.map((function(e){return(0,n.jsx)(_,{mediaObject:e,setTargetMedia:a,folder:o,staticHost:r},e.id)}))]}),!(null===t||void 0===t?void 0:t[0])&&(0,n.jsx)(z,{})]})})}function z(){return(0,n.jsxs)("div",{className:"button outlined gray dashed w-full p-10 flex-col",onClick:function(e){(0,h.Mw)("choose-media-type-popoup")},children:[(0,n.jsx)("span",{className:"text-slate-400",children:"No Media Added."}),(0,n.jsx)(k.Z,{color:"inherit",sx:{fontSize:80},className:"opacity-40 text-gray-500"}),(0,n.jsx)("span",{className:"",children:"Add Media"})]})}},81597:function(e,t,a){a.d(t,{Z:function(){return d}});var n,i=a(828),l=a(85893),o=a(67294),r=a(86729),c=a(25472),s=a(95264);function d(e){var t=e.folder,a=(0,i.Z)(o.useState(!1),2),d=a[0],u=a[1],m=(0,i.Z)(o.useState(!1),2),h=m[0],f=m[1];return(0,l.jsxs)(c.ZP,{title:"add-folder-popoup",children:[(0,l.jsx)("h4",{className:"m-0",children:"Add A New Folder"}),(0,l.jsxs)("div",{className:"flex-col w-full relative",children:[d&&(0,l.jsx)(s.Z,{}),(0,l.jsxs)("form",{onSubmit:function(e){e.preventDefault(),window.clearTimeout(n),u(!0);var a=e.target;(0,r.Z)("/api/addNewMediaFolder",{method:"post",body:{name:(t?"".concat(t,"/"):"")+a["new-folder-name"].value}},!0).then((function(e){e.success?window.location.reload():u(!1)}))},className:"w-full flex flex-col items-stretch gap-2",children:[h&&(0,l.jsx)("span",{className:"text-xs text-orange-700 bg-orange-100 flex items-center justify-center rounded px-2 py-1",children:"Folder Already Exists. Please Change the name."}),(0,l.jsx)("input",{type:"text",name:"new-folder-name",id:"new-folder-name",placeholder:"New Folder Name",className:"w-full"+(h?" warning":""),onChange:function(e){e.target.value=e.target.value.toLocaleLowerCase().replace(/ /g,"-"),window.clearTimeout(n),n=setTimeout((function(){(0,r.Z)("/api/checkExistingFolder?name=".concat(e.target.value).concat(t?"&folder="+t:"")).then((function(t){var a;(null===(a=e.target.value)||void 0===a?void 0:a.match(/./))&&(null===t||void 0===t?void 0:t.success)?(f(!0),alert("Folder Already Exists")):f(!1)}))}),500)}}),(0,l.jsx)("button",{children:"Add New Folder"})]})]})]})}},94891:function(e,t,a){a.d(t,{Z:function(){return x}});var n=a(828),i=a(85893),l=a(67294),o=a(86729),r=a(81069),c=a(25472),s=a(95264),d=a(29815),u=a(73340),m=a(95808);function h(e){var t=e.mediaObject,a=(0,n.Z)(l.useState(!1),2),o=a[0],r=a[1];return l.useEffect((function(){t.private=o}),[o]),(0,i.jsx)("button",{className:"light-gray p-2 w-8 h-8 rounded-full absolute top-2 left-2 bg-white"+(o?" ":" text-slate-400 fill-slate-400"),style:{backgroundColor:"white"},onClick:function(e){r((function(e){return!e}))},children:o?(0,i.jsx)(m.Z,{fontSize:"small",color:"secondary"}):(0,i.jsx)(u.Z,{fontSize:"small",className:"fill-inherit text-inherit"})})}function f(e){var t=e.imageObject,a=e.newMedia,n=e.setNewMedia,l=e.video,o=t,r=o.imageBase64Full||o.fileBase64Full,c=o.imageName||o.fileName;return(0,i.jsxs)("div",{className:"border border-slate-300 rounded max-h-44 flex-col w-full overflow-hidden h-full bg-slate-200 relative p-2",children:[l?(0,i.jsx)("video",{src:r,className:"w-full h-full object-contain",muted:!0,autoPlay:!0,controls:!0}):(0,i.jsx)("img",{src:r,alt:c,className:"w-full h-full object-contain"}),(0,i.jsx)("input",{type:"text",defaultValue:c,onInput:function(e){var a,n=null===(a=e.target.value)||void 0===a?void 0:a.replace(/ /g,"-");t.fileName&&(t.fileName=n),t.imageName&&(t.imageName=n)},className:"absolute bottom-1 text-sm left-2 px-2 py-1",style:{width:"calc(100% - 15px)"}}),(0,i.jsx)("button",{className:"outlined bg-white absolute top-2 right-2 p-1 w-8 h-8 rounded-full",style:{backgroundColor:"white",borderColor:"var(--slate-200)"},onClick:function(e){var i=a.findIndex((function(e){return e.imageBase64===t.imageBase64||e.fileBase64===t.fileBase64})),l=a;l.splice(i,1),n((0,d.Z)(l))},children:"\u2716"}),!l&&(0,i.jsx)(h,{mediaObject:t})]})}var p=a(47381);function v(e){var t=e.fileObject,a=e.newFile,n=e.setNewFile;return(0,i.jsxs)("div",{className:"border border-slate-300 rounded max-h-44 flex-col w-full overflow-hidden h-full bg-slate-200 relative p-2",children:[(0,i.jsx)(p.Z,{sx:{fontSize:100},className:"opacity-20"}),(0,i.jsx)("input",{type:"text",defaultValue:t.fileName,onInput:function(e){var a;t.fileName=null===(a=e.target.value)||void 0===a?void 0:a.replace(/ /g,"-")},className:"absolute bottom-1 text-sm left-2 px-2 py-1",style:{width:"calc(100% - 15px)"}}),(0,i.jsx)("button",{className:"outlined bg-white absolute top-2 right-2 p-1 w-8 h-8 rounded-full",style:{backgroundColor:"white",borderColor:"var(--slate-200)"},onClick:function(e){var i=a.findIndex((function(e){return e.fileBase64===t.fileBase64})),l=a;l.splice(i,1),n((0,d.Z)(l))},children:"\u2716"}),(0,i.jsx)(h,{mediaObject:t})]})}function x(e){var t=e.newMedia,a=e.setNewMedia,d=e.newFile,u=e.setNewFile,m=e.newVideo,h=e.setNewVideo,p=e.folder,x=(null===t||void 0===t?void 0:t[0])?"images":(null===d||void 0===d?void 0:d[0])?"files":"videos",g=(null===x||void 0===x?void 0:x.match(/image/i))?t:(null===x||void 0===x?void 0:x.match(/file/i))?d:m,y=(null===x||void 0===x?void 0:x.match(/image/i))?a:(null===x||void 0===x?void 0:x.match(/file/i))?u:h,w=(0,n.Z)(l.useState(!1),2),b=w[0],j=w[1];return l.useEffect((function(){g&&g[0]&&(0,c.Mw)("new-media-popup")}),[t,d,m]),(0,i.jsxs)(c.ZP,{title:"new-media-popup",closePopupDispatch:function(){a(null),u(null),h(null)},children:[b&&(0,i.jsx)(s.Z,{screen:!0}),(0,i.jsx)("h4",{className:"m-0",children:"Upload New Media"}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-4 w-full",children:g&&g[0]&&g.map((function(e,t){return(null===x||void 0===x?void 0:x.match(/image/i))?(0,i.jsx)(f,{imageObject:e,newMedia:g,setNewMedia:y},t+1):(null===x||void 0===x?void 0:x.match(/video/i))?(0,i.jsx)(f,{imageObject:e,newMedia:g,setNewMedia:y,video:!0},t+1):(0,i.jsx)(v,{fileObject:e,newFile:g,setNewFile:y},t+1)}))}),g&&g[0]&&(0,i.jsx)("button",{className:"py-3 w-full relative z-50"+(b?" pointer-events-none opacity-40":""),onClick:function(e){j(!0);var t=(null===x||void 0===x?void 0:x.match(/image/i))?{type:x,folder:p,media:g.map((function(e){return{imageBase64:e.imageBase64,imageName:e.imageName,imageSize:e.imageSize,private:e.private}}))}:{type:x,folder:p,media:g.map((function(e){return{fileBase64:e.fileBase64,fileName:e.fileName,fileSize:e.fileSize,fileType:e.fileType,private:e.private,video:Boolean(null===x||void 0===x?void 0:x.match(/video/i))}}))};(0,o.Z)("/api/addUserMedia",{method:"post",body:t},!0).then((function(e){e.success?(0,r.Z)().then((function(){window.location.reload()})):(alert("Image Upload Failed"),console.log(e),setTimeout((function(){j(!1)}),1e3))}))},children:"Upload Media"})]})}},1347:function(e,t,a){a.d(t,{Z:function(){return v}});var n=a(828),i=a(85893),l=a(67294),o=a(86729),r=a(81069),c=a(25472),s=a(95264),d=a(45449),u=a(18826),m=a(58436);const h=(0,a(45711).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var f=a(64998),p=a(34642);function v(e){var t,a,v=e.targetMedia,x=e.staticHost,g=e.setTargetMedia,y=e.media,w=((null===v||void 0===v?void 0:v.media_thumbnail_path)?"".concat(x,"/").concat(null===v||void 0===v?void 0:v.media_thumbnail_path):null===v||void 0===v||v.media_thumbnail_url,(null===v||void 0===v?void 0:v.media_path)?"".concat(x,"/").concat(null===v||void 0===v?void 0:v.media_path):null===v||void 0===v?void 0:v.media_url),b=Boolean(null===v||void 0===v||null===(t=v.media_type)||void 0===t?void 0:t.match(/video/i)),j=v?y.findIndex((function(e){return e.id==v.id})):null,N="number"==typeof j&&j>=0,Z=function(){var e;if(!N)return null;var t=y[j+1];if(!t)return null;if(!(null===t||void 0===t||null===(e=t.media_type)||void 0===e?void 0:e.match(/image/i))){var a=y.slice(j+1).find((function(e){var t;return!!(null===(t=e.media_type)||void 0===t?void 0:t.match(/image/i))}));return a||null}return t}(),_=function(){var e;if(!N)return null;var t=y[j-1];if(!t)return null;if(!(null===t||void 0===t||null===(e=t.media_type)||void 0===e?void 0:e.match(/image/i))){var a=y.slice(0,j-1).findLast((function(e){var t;return!!(null===(t=e.media_type)||void 0===t?void 0:t.match(/image/i))}));return a||null}return t}(),k=(0,n.Z)(l.useState(!!(null===v||void 0===v?void 0:v.private)),2),M=k[0],z=k[1],C=(0,n.Z)(l.useState(!1),2),L=C[0],H=C[1],F=(0,n.Z)(l.useState(w),2),S=F[0],O=F[1],V=l.useRef();return l.useEffect((function(){(null===v||void 0===v?void 0:v.private)?(0,m.Z)({url:v.media_url||""}).then((function(e){e&&(O(e),z(!1))})).catch((function(e){console.log(e.message)})):O((null===v||void 0===v?void 0:v.media_url)||"")}),[v]),(0,i.jsxs)(c.ZP,{title:"target-media-popup",noContainer:!0,fullPage:!0,closePopupDispatch:function(){H(!1),g(null)},children:[M&&(0,i.jsx)(s.Z,{}),!L&&(0,i.jsx)(s.Z,{}),v&&(0,i.jsxs)(l.Fragment,{children:[(0,i.jsxs)("div",{className:"self-center h-screen py-4",children:[S?b?(0,i.jsx)("video",{src:S,className:"w-full h-full object-cover",controls:!0,muted:!0,autoPlay:!0,loop:!0,onCanPlay:function(){H(!0)},style:L?void 0:{display:"none"}}):(0,i.jsx)("img",{src:S,alt:v.media_name,className:"bg-slate-200 rounded w-full h-full object-contain",ref:V,onLoad:function(e){H(!0)},style:L?void 0:{display:"none"}}):(0,i.jsx)(i.Fragment,{}),_&&(0,i.jsx)("div",{className:"absolute left-5 md:left-10 z-[100] cursor-pointer p-5 bg-slate-800/40 rounded-full",onClick:function(e){g(null),g(_)},children:(0,i.jsx)(h,{color:"white"})}),Z&&(0,i.jsx)("div",{className:"absolute right-5 md:right-10 z-[100] cursor-pointer p-5 bg-slate-800/40 rounded-full",onClick:function(e){g(null),g(Z)},children:(0,i.jsx)(f.Z,{color:"white"})})]}),(0,i.jsx)("span",{className:"info gray absolute top-5 left-5 w-auto mr-5",style:{backgroundColor:"white"},children:null===(a=v.media_path)||void 0===a?void 0:a.replace(/.*\//,"")}),(0,i.jsx)("div",{className:"absolute bottom-6 left-6 p-2 bg-white dark:bg-slate-900 rounded z-20 hidden lg:flex flex-col items-stretch",children:(0,i.jsxs)(d.Z,{column:!0,children:[(0,i.jsx)(p._,{mediaObject:v,setLoading:z}),(0,i.jsx)("button",{className:"outlined secondary more-padding",onClick:function(e){var t,a;(0,u.Z)({mediaObject:v,fileName:(null===(a=null===(t=v.media_url)||void 0===t?void 0:t.match(/[^\/]+$/))||void 0===a?void 0:a[0])||"",setLoading:z})},children:"Download"}),(0,i.jsx)("button",{onClick:function(e){window.confirm("Delete this media?")&&(0,o.Z)("/api/deleteUserMedia",{method:"post",body:v},!0).then((function(e){e.success?(0,r.Z)().then((function(){window.location.reload()})):alert("Media deletion Failed! Please try again.")}))},className:"more-padding",children:"Delete"}),(0,i.jsx)("button",{className:"outlined gray w-full bg-white more-padding",onClick:function(e){navigator.clipboard.writeText(v.media_url||"").then((function(){alert("Media url ".concat(v.media_url," Copied to clipboard"))}))},children:"Copy Full Image Link"}),(0,i.jsx)("button",{className:"outlined gray w-full more-padding",onClick:function(e){navigator.clipboard.writeText(v.media_thumbnail_url||"").then((function(){alert("Media url ".concat(v.media_thumbnail_url," Copied to clipboard"))}))},style:{borderTop:"1px solid #0b8862"},children:"Copy Image Thumbnail Link"})]})})]})]})}},34642:function(e,t,a){a.d(t,{Z:function(){return r},_:function(){return c}});var n=a(85893),i=(a(67294),a(86729)),l=a(81069),o=a(45449);function r(e){var t=e.mediaObject,a=e.setLoading;return(0,n.jsxs)("div",{className:"dropdown-wrapper w-full xl:w-auto",children:[(0,n.jsx)("button",{className:"outlined gray small-text hidden xl:flex",children:"More"}),(0,n.jsx)("div",{className:"dropdown mobile-transform gap-2 w-full",children:(0,n.jsxs)(o.Z,{column:!0,className:"w-full mb-2 xl:mb-0",children:[(0,n.jsx)(c,{mediaObject:t,setLoading:a}),(0,n.jsx)("button",{className:"outlined gray normal-weight more-padding w-full xl:w-auto",onClick:function(e){window.confirm("Delete this media?")&&(0,i.Z)("/api/deleteUserMedia",{method:"post",body:t},!0).then((function(e){e.success?(0,l.Z)().then((function(){window.location.reload()})):alert("Media deletion Failed! Please try again.")}))},children:"Delete"})]})})]})}function c(e){var t=e.mediaObject,a=e.setLoading;return(0,n.jsx)("button",{onClick:function(e){var n=window.prompt("Rename media",t.media_name);n&&window.confirm('Rename "'.concat(t.media_name,'" to "').concat(n,'"'))&&(a(!0),(0,i.Z)("/api/renameMedia",{method:"post",body:{mediaObject:t,newName:n.replace(/ /g,"-"),newThumbnailName:n.replace(/ /g,"-")+"_thumbnail"}},!0).then((function(e){e.success?window.location.reload():(window.alert(e.msg),setTimeout((function(){a(!1)}),1e3))})))},className:"outlined gray normal-weight more-padding",children:"Rename"})}},25472:function(e,t,a){a.d(t,{Mw:function(){return r},ZP:function(){return o},j4:function(){return c}});var n=a(85893),i=a(41352),l=a(67294);function o(e){var t=e.children,a=e.title,o=e.data,r=e.fullPage,s=e.wrapperClasses,d=e.closePopupDispatch,u=e.wrapperStyle,m=e.noContainer;return r?(0,n.jsxs)("div",{className:"popup-bg overflow-hidden "+(s||""),"data-popupid":a||null,style:u,children:[m?(0,n.jsx)(l.Fragment,{children:t}):(0,n.jsx)("div",{className:"relative w-full h-full z-50","data-data":o?JSON.stringify(o):"",children:t}),(0,n.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:function(e){c(),d&&d()},children:(0,n.jsx)(i.Z,{color:"white",size:20})}),(0,n.jsx)("div",{className:"popup-canceller",onClick:function(e){c(),d&&d()}})]}):(0,n.jsxs)("div",{className:"popup-bg","data-popupid":a||null,children:[m?(0,n.jsx)(l.Fragment,{children:t}):(0,n.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":o?JSON.stringify(o):"",children:[t,(0,n.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:function(e){c(),d&&d()},children:(0,n.jsx)("span",{className:"font-normal",children:"\u2716"})})]}),m&&(0,n.jsx)("button",{className:"gray popup-cancel-button",onClick:function(e){c(),d&&d()},children:(0,n.jsx)("span",{className:"font-normal",children:"\u2716"})}),(0,n.jsx)("div",{className:"popup-canceller",onClick:function(e){c(),d&&d()}})]})}function r(e,t){var a=document.querySelector("[data-popupid='".concat(e,"']"));a&&(a.style.display="flex",t&&t(a))}function c(e){document.querySelectorAll("[data-popupid]").forEach((function(e){e.style.display="none"})),e&&e()}},98916:function(e,t,a){a.d(t,{Z:function(){return r}});var n=a(47568),i=a(97582),l=a(85893),o=(a(67294),a(53314));function r(e){var t=e.setNewFile,a=e.setLoading;return(0,l.jsx)("div",{children:(0,l.jsx)("input",{type:"file",name:"upload_file_input",id:"upload_file_input",className:"hidden",accept:".xlsx,.pdf,.csv,.json",multiple:!0,onChange:function(){var e=(0,n.Z)((function(e){var n,l,r,c,s,d,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(a&&a(!0),n=[],!(null===(l=e.target.files)||void 0===l?void 0:l.length))return[3,6];r=0,i.label=1;case 1:return r<l.length?(s=l[r],(null===(c=s.type)||void 0===c?void 0:c.match(/sheet/))?(d=URL.createObjectURL(s),console.log(d),[3,4]):[3,2]):[3,5];case 2:return[4,(0,o.Z)({inputFile:s})];case 3:u=i.sent(),n.push(u),i.label=4;case 4:return r++,[3,1];case 5:return t(n),setTimeout((function(){a&&a(!1)}),200),[3,7];case 6:window.alert("No Files selected"),i.label=7;case 7:return[2]}}))}));return function(t){return e.apply(this,arguments)}}()})})}},73770:function(e,t,a){a.d(t,{Z:function(){return r}});var n=a(47568),i=a(97582),l=a(85893),o=(a(67294),a(36718));function r(e){var t=e.setNewMedia,a=e.setLoading;return(0,l.jsx)("div",{children:(0,l.jsx)("input",{type:"file",name:"upload_image_input",id:"upload_image_input",className:"hidden",accept:"image/*",multiple:!0,onChange:function(){var e=(0,n.Z)((function(e){var n,l,r,c,s,d,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(a&&a(!0),n=[],!(null===(l=e.target.files)||void 0===l?void 0:l.length))return[3,6];r=0,i.label=1;case 1:return r<l.length?(s=l[r],(null===(c=s.type)||void 0===c?void 0:c.match(/sheet/))?(d=URL.createObjectURL(s),console.log(d),[3,4]):[3,2]):[3,5];case 2:return[4,(0,o.Z)({imageInputFile:s,maxWidth:1800})];case 3:u=i.sent(),n.push(u),i.label=4;case 4:return r++,[3,1];case 5:return t(n),setTimeout((function(){a&&a(!1)}),200),[3,7];case 6:window.alert("No Files selected"),i.label=7;case 7:return[2]}}))}));return function(t){return e.apply(this,arguments)}}()})})}},37525:function(e,t,a){a.d(t,{Z:function(){return r}});var n=a(47568),i=a(97582),l=a(85893),o=(a(67294),a(53314));function r(e){var t=e.setNewVideo,a=e.setLoading;return(0,l.jsx)("div",{children:(0,l.jsx)("input",{type:"file",name:"upload_video_input",id:"upload_video_input",className:"hidden",accept:".mp4",multiple:!0,onChange:function(){var e=(0,n.Z)((function(e){var n,l,r,c,s,d,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(a&&a(!0),n=[],!(null===(l=e.target.files)||void 0===l?void 0:l.length))return[3,6];r=0,i.label=1;case 1:return r<l.length?(s=l[r],(null===(c=s.type)||void 0===c?void 0:c.match(/sheet/))?(d=URL.createObjectURL(s),console.log(d),[3,4]):[3,2]):[3,5];case 2:return[4,(0,o.Z)({inputFile:s})];case 3:u=i.sent(),n.push(u),i.label=4;case 4:return r++,[3,1];case 5:return t(n),setTimeout((function(){a&&a(!1)}),200),[3,7];case 6:window.alert("No Videos selected"),i.label=7;case 7:return[2]}}))}));return function(t){return e.apply(this,arguments)}}()})})}},97946:function(e,t,a){a.d(t,{Z:function(){return i}});var n=a(85893);a(67294);function i(e){return(0,n.jsxs)("a",{href:"/email-verification",className:"card w-full items-center justify-center py-4 gap-2",children:[(0,n.jsx)("img",{src:"/images/warning.png",alt:"Down Arrow",width:25,className:""}),(0,n.jsx)("span",{children:"Your Account is not verified. Please verify your account."})]})}},18826:function(e,t,a){a.d(t,{Z:function(){return o}});var n=a(47568),i=a(97582),l=a(58436);function o(e){return r.apply(this,arguments)}function r(){return(r=(0,n.Z)((function(e){var t,a,n,o,r,c,s,d,u,m;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return t=e.mediaObject,a=e.fileName,(n=e.setLoading)&&n(!0),(c=Boolean((null===t||void 0===t?void 0:t.private)||(null===t||void 0===t||null===(o=t.media_url)||void 0===o?void 0:o.match(/^\@/))))?[4,(0,l.Z)({url:t.media_url||""})]:[3,2];case 1:return r=i.sent(),[3,4];case 2:return[4,fetch(t.media_url||"")];case 3:r=i.sent(),i.label=4;case 4:return c?(d=r,[3,7]):[3,5];case 5:return[4,r.blob()];case 6:d=i.sent(),i.label=7;case 7:return s=d,u=c?r:URL.createObjectURL(s),(m=document.createElement("a")).href=u,m.download=a,m.style.display="none",document.body.appendChild(m),m.click(),URL.revokeObjectURL(u),document.body.removeChild(m),setTimeout((function(){n&&n(!1)}),500),[2]}}))}))).apply(this,arguments)}},58436:function(e,t,a){a.d(t,{Z:function(){return l}});var n=a(47568),i=a(97582);function l(e){return o.apply(this,arguments)}function o(){return(o=(0,n.Z)((function(e){var t;return(0,i.__generator)(this,(function(a){return t=e.url,[2,new Promise((function(e,a){fetch("/api/media/getPrivateMedia",{method:"POST",body:JSON.stringify({path:t}),headers:{"x-csrf-auth":localStorage.getItem("csrf")}}).then((function(e){return e.blob()})).then((function(t){var a=URL.createObjectURL(t);e(a)}))}))]}))}))).apply(this,arguments)}},36718:function(e,t,a){a.d(t,{Z:function(){return l}});var n=a(47568),i=a(97582);function l(e){return o.apply(this,arguments)}function o(){return(o=(0,n.Z)((function(e){var t,a,n,l,o,r,c,s,d,u,m,h,f;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return t=e.imageInputFile,a=e.maxWidth,n=document.querySelector("[data-imagepreview='image']"),l=t.name.replace(/\..*/,""),c=document.createElement("canvas"),s=t.type,d=.95,u=a||null,null,m=t,h=URL.createObjectURL(m),(f=new Image).src=h,[4,new Promise((function(e,t){f.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},f.onload=function(){if(URL.revokeObjectURL(this.src),u){var t=u/f.naturalWidth;c.width=f.naturalWidth<u?f.naturalWidth:u,c.height=f.naturalWidth<u?f.naturalHeight:f.naturalHeight*t}else c.width=f.naturalWidth,c.height=f.naturalHeight;var a=c.getContext("2d");null===a||void 0===a||a.drawImage(f,0,0,c.width,c.height);var i=c.toDataURL(s,d);n&&document.querySelectorAll("[data-imagepreview='image']").forEach((function(e){e.src=i})),e(i)}}))];case 1:return o=i.sent(),[4,new Promise((function(e,t){c.toBlob((function(t){e(null===t||void 0===t?void 0:t.size)}),s,d)}))];case 2:return r=i.sent(),[2,{imageBase64:o.replace(/.*?base64,/,""),imageBase64Full:o,imageName:l,imageSize:r}]}}))}))).apply(this,arguments)}},53314:function(e,t,a){a.d(t,{Z:function(){return l}});var n=a(47568),i=a(97582);function l(e){return o.apply(this,arguments)}function o(){return(o=(0,n.Z)((function(e){var t,a,n,l;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:t=e.inputFile,i.label=1;case 1:return i.trys.push([1,3,,4]),a=t.name.replace(/\..*/,""),[4,new Promise((function(e,a){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e(n.result)},n.onerror=function(e){console.log("Error: ",e.message)}}))];case 2:return[2,{fileBase64:(n=i.sent()).replace(/.*?base64,/,""),fileBase64Full:n,fileName:a,fileSize:t.size,fileType:t.type}];case 3:return l=i.sent(),console.log("Image Processing Error! =>",l.message),[2,{fileBase64:null,fileBase64Full:null,fileName:t.name,fileSize:null,fileType:null}];case 4:return[2]}}))}))).apply(this,arguments)}},29815:function(e,t,a){a.d(t,{Z:function(){return o}});var n=a(20943);var i=a(13375);var l=a(91566);function o(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||(0,i.Z)(e)||(0,l.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}}]); |