PageSourceSearch

https://www.mindomax.com/_next/static/chunks/pages/home/folders-822210a56abcd2d4.js

js mindomax.com collected 2026-09-24 13:28:31 UTC 58,599 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[423],{14248:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/home/folders",function(){return n(38949)}])},38949:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__N_SSP:()=>et,default:()=>en});var r=n(37876),i=n(21816),l=n(16927),s=n(67684),o=n(62701),a=n(20294),c=n(85993),u=n(95531),d=n(14232),f=n(14664),m=n(91040),x=n(34550),p=n(97685),h=n(2425),g=n(57293),v=new Set(["audio","mp3","wav","m4a","aac","ogg","oga","flac","wma","opus","amr","aiff","aif"]),b=new Set(["video","mp4","mov","m4v","avi","mkv","webm","wmv","flv","3gp","mpg","mpeg","ts","m2ts","vob"]),y=new Set(["image","jpg","jpeg","png","gif","webp","heic","bmp"]),j=new Set(["text","txt","md"]),w=new Set(["doc","docx","odt","rtf","pages"]),_=new Set(["ppt","pptx","key"]),N=new Set(["xls","xlsx","csv","numbers"]),k=new Set(["zip","rar","7z"]);function C(e){var t=((null==e?void 0:e.file_type)||"").toLowerCase();return"pdf"===t?"pdf":v.has(t)?"audio":b.has(t)?"video":y.has(t)?"image":j.has(t)?"text":w.has(t)?"doc":_.has(t)?"slides":N.has(t)?"sheet":k.has(t)?"archive":t}var S=n(98778),z=n(89099);function A(e){var t=e.folder,n=e.onClick,i=e.onContextMenu,l=e.onMenuClick,s=(0,f.zM)({id:"folder-".concat(t.folder_ugid),data:{type:"folder",folder:t}}),o=s.setNodeRef,a=s.isOver,c=(0,d.useRef)(null),u=function(){c.current&&clearTimeout(c.current)},m=t.folder_color||"#6366f1";return(0,r.jsxs)("div",{ref:o,onClick:function(){return n(t)},onContextMenu:function(e){e.preventDefault(),e.stopPropagation(),i(e,t,"folder")},onTouchStart:function(){c.current=setTimeout(function(){null==l||l(t)},500)},onTouchEnd:u,onTouchMove:u,className:"group relative rounded-lg p-2 pt-2.5 cursor-pointer transition-all duration-200 hover:bg-white/5 ".concat(a?"ring-2 ring-blue-400 bg-blue-500/10":""),children:[(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),null==l||l(t)},className:"absolute top-2 right-2 p-1.5 md:p-1 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-all opacity-100 md:opacity-0 md:group-hover:opacity-100 z-10",children:(0,r.jsx)(S.a95,{size:22,className:"md:w-[18px] md:h-[18px]"})}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsx)("div",{className:"w-11 h-10 mb-1",children:(0,r.jsxs)("svg",{viewBox:"0 0 64 56",className:"w-full h-full drop-shadow-md",children:[(0,r.jsx)("path",{d:"M2 8 L2 4 Q2 2 4 2 L22 2 Q24 2 25 4 L28 8 L60 8 Q62 8 62 10 L62 52 Q62 54 60 54 L4 54 Q2 54 2 52 Z",fill:m,opacity:"0.85"}),(0,r.jsx)("path",{d:"M2 12 L62 12 L62 52 Q62 54 60 54 L4 54 Q2 54 2 52 Z",fill:m}),(0,r.jsx)("path",{d:"M4 12 L60 12 L60 16 L4 16 Z",fill:"rgba(255,255,255,0.15)"})]})}),(0,r.jsx)("p",{className:"text-xs text-gray-200 truncate w-full px-0.5 leading-tight",children:t.folder_name}),(t.files_count>0||t.child_folder_count>0)&&(0,r.jsxs)("span",{className:"text-xs text-gray-500 mt-0.5",children:[t.files_count||0," files"]})]})]})}function T(e){var t=e.file,n=e.onRename,i=e.onContextMenu,l=e.triggerRename,c=e.onDownload,u=e.onOpen,m=(0,h.B)().t,x=(0,a._)((0,d.useState)(!1),2),p=x[0],g=x[1],v=(0,a._)((0,d.useState)(t.original_filename),2),b=v[0],y=v[1];(0,d.useEffect)(function(){l&&(y(t.original_filename),g(!0))},[l]);var j=(0,f.PM)({id:"file-".concat(t.file_ugid),data:{type:"file",file:t}}),w=j.attributes,_=j.listeners,N=j.setNodeRef,k=j.transform,z=j.isDragging,A=k?{transform:"translate3d(".concat(k.x,"px, ").concat(k.y,"px, 0)")}:void 0,T=function(e){switch(C(e)){case"pdf":return{Icon:S.XtN,color:"text-red-400"};case"image":return{Icon:S.TbK,color:"text-blue-400"};case"audio":return{Icon:S.I5y,color:"text-purple-400"};case"video":return{Icon:S.tO7,color:"text-cyan-400"};case"doc":return{Icon:S.ith,color:"text-sky-500"};case"slides":return{Icon:S.a4Q,color:"text-orange-500"};case"sheet":return{Icon:S.lKL,color:"text-green-600"};case"archive":return{Icon:S.h57,color:"text-amber-600"};case"text":return{Icon:S.n$u,color:"text-yellow-400"};default:return{Icon:S.n$u,color:"text-gray-400"}}}(t),B=T.Icon,E=T.color,F="processing"===t.transcode_status,M=function(){b.trim()&&b!==t.original_filename&&n(t.file_ugid,b.trim(),t.source),g(!1)};return(0,r.jsxs)("div",(0,o._)((0,s._)({ref:N,style:A},_,w),{onContextMenu:function(e){e.preventDefault(),e.stopPropagation(),i(e,t,"file")},className:"group relative rounded-lg p-2 pt-2.5 cursor-pointer transition-all duration-200 hover:bg-white/5 ".concat(z?"opacity-50 scale-95":""),children:[(0,r.jsxs)("div",{className:"absolute top-2 right-2 flex gap-0.5 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity z-[5]",children:[(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),null==c||c(t)},className:"p-1.5 md:p-1 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-colors",title:m("folders.download"),children:(0,r.jsx)(S.E5v,{size:20,className:"md:w-4 md:h-4"})}),(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),i(e,t,"file")},className:"p-1.5 md:p-1 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-colors",children:(0,r.jsx)(S.a95,{size:20,className:"md:w-4 md:h-4"})})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsxs)("div",{className:"relative w-11 h-11 mb-1 flex items-center justify-center",onClick:function(){return null==u?void 0:u(t)},children:[(0,r.jsx)(B,{size:26,className:E}),F&&(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 bg-gray-900/90 rounded-full p-0.5",children:(0,r.jsx)(S.h2e,{size:14,className:"text-amber-400 animate-pulse"})})]}),p?(0,r.jsx)("input",{type:"text",value:b,onChange:function(e){return y(e.target.value)},onBlur:M,onKeyDown:function(e){"Enter"===e.key&&M(),"Escape"===e.key&&(y(t.original_filename),g(!1))},autoFocus:!0,className:"w-full bg-gray-700 text-white text-xs rounded px-2 py-1 outline-none focus:ring-1 focus:ring-blue-500 text-center"}):(0,r.jsx)("p",{className:"text-xs text-gray-200 truncate w-full px-0.5 leading-tight hover:text-white",onClick:function(){return null==u?void 0:u(t)},title:t.original_filename,children:t.original_filename}),(0,r.jsx)("span",{className:"text-[10px] text-gray-500 mt-0.5",children:function(e){if(!e)return"0 B";var t=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return(e/Math.pow(1024,n)).toFixed(+(n>1))+" "+t[n]}(t.file_size_bytes)})]})]}))}var B=n(98477);function E(e){var t=e.children;if("undefined"==typeof document)return null;var n=document.querySelector("main")||document.body;return(0,B.createPortal)(t,n)}function F(e){var t=e.visible,n=e.position,i=e.items,l=e.onClose,s=(0,d.useRef)(null),o=(0,z.useRouter)(),a="fa"===o.locale||"ar"===o.locale,c=window.innerWidth<=768;return((0,d.useEffect)(function(){if(t&&!c&&s.current){var e=s.current.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;e.right>n&&(s.current.style.left="".concat(n-e.width-8,"px")),e.left<0&&(s.current.style.left="8px"),e.bottom>r&&(s.current.style.top="".concat(r-e.height-8,"px"))}},[t,n,c]),t)?c?(0,r.jsxs)(E,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-[9998] bg-black bg-opacity-30",onClick:l}),(0,r.jsx)("div",{className:"fixed bottom-0 left-0 right-0 z-[9999] bg-gray-800 border-t border-gray-600 rounded-t-2xl py-2 pb-6 font-exo fadeIn-bottom",dir:a?"rtl":"ltr",children:i.map(function(e,t){return e.divider?(0,r.jsx)("div",{className:"border-t border-gray-700 my-1"},t):(0,r.jsxs)("button",{onClick:function(){e.onClick(),l()},className:"w-full flex items-center gap-3 px-5 py-3 text-sm transition-colors ".concat(e.className||"text-gray-300 hover:bg-gray-700"),children:[e.icon&&(0,r.jsx)(e.icon,{size:18}),e.label]},t)})})]}):(0,r.jsxs)(E,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-[9998]",onClick:l}),(0,r.jsx)("div",{ref:s,className:"fixed z-[9999] w-48 bg-gray-800 border border-gray-600 rounded-lg shadow-xl py-1 font-exo",style:{to
1p:n.y,left:n.x},dir:a?"rtl":"ltr",children:i.map(function(e,t){return e.divider?(0,r.jsx)("div",{className:"border-t border-gray-700 my-1"},t):(0,r.jsxs)("button",{onClick:function(){e.onClick(),l()},className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors ".concat(e.className||"text-gray-300 hover:bg-gray-700"),children:[e.icon&&(0,r.jsx)(e.icon,{size:16}),e.label]},t)})})]}):null}function M(e){var t=e.items,n=e.onClose,i=e.title,l=(0,z.useRouter)(),s="fa"===l.locale||"ar"===l.locale,o=(0,a._)((0,d.useState)(!1),2),c=o[0],u=o[1],f=(0,d.useRef)(null);(0,d.useEffect)(function(){return document.body.style.overflow="hidden",function(){document.body.style.overflow=""}},[]),(0,d.useEffect)(function(){var e=function(e){f.current&&!f.current.contains(e.target)&&m()};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var m=function(){u(!0),setTimeout(n,280)},x=function(e){m(),setTimeout(function(){return e.onClick()},280)},p=(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end justify-center font-exo",dir:s?"rtl":"ltr",children:[(0,r.jsx)("style",{children:"\n        @keyframes actionsSheetUp   { from { transform: translateY(100%); } to { transform: translateY(0); } }\n        @keyframes actionsSheetDown { from { transform: translateY(0); }   to { transform: translateY(100%); } }\n      "}),(0,r.jsx)("div",{className:"fixed inset-0 bg-[#0A192F]/80 backdrop-blur-sm"}),(0,r.jsxs)("div",{ref:f,className:"relative w-[92%] md:w-4/5 lg:w-full lg:max-w-[1024px] bg-[#0A192F] rounded-t-[24px] border border-white/10",style:{animation:c?"actionsSheetDown 0.28s ease-in forwards":"actionsSheetUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards"},children:[(0,r.jsx)("div",{className:"flex justify-center pt-3 pb-2",children:(0,r.jsx)("div",{className:"w-12 h-1 rounded-full cursor-pointer",style:{backgroundColor:"rgba(255,255,255,0.15)"},onClick:m})}),i&&(0,r.jsx)("h2",{className:"text-white text-center text-base font-semibold px-6 pt-1 pb-4",children:i}),(0,r.jsx)("div",{className:"px-4 pb-8 flex flex-col gap-2",children:t.map(function(e,t){return e.divider?(0,r.jsx)("div",{className:"border-t border-white/10 my-1"},t):(0,r.jsxs)("button",{onClick:function(){return x(e)},className:"w-full flex items-center gap-4 px-4 py-3.5 rounded-2xl border transition-all active:scale-[0.98] ".concat(e.className||"text-gray-200"),style:{backgroundColor:"rgba(255,255,255,0.03)",borderColor:"rgba(255,255,255,0.08)"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="rgba(255,255,255,0.08)",e.currentTarget.style.borderColor="rgba(255,255,255,0.15)"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="rgba(255,255,255,0.03)",e.currentTarget.style.borderColor="rgba(255,255,255,0.08)"},children:[e.icon&&(0,r.jsx)("div",{className:"w-10 h-10 rounded-xl shrink-0 flex items-center justify-center border",style:{backgroundColor:"rgba(255,255,255,0.05)",borderColor:"rgba(255,255,255,0.1)"},children:(0,r.jsx)(e.icon,{size:20})}),(0,r.jsx)("span",{className:"text-sm font-medium",children:e.label})]},t)})})]})]});if("undefined"==typeof document)return null;var h=document.querySelector("main")||document.body;return B.createPortal(p,h)}function P(e){if(!e)return"0 B";var t=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return(e/Math.pow(1024,n)).toFixed(+(n>1))+" "+t[n]}function Y(e){var t=e.usedBytes,n=void 0===t?0:t,i=e.limitBytes,l=void 0===i?0:i,s=e.isPremium,o=e.compact,a=(0,h.B)().t,c=l>0?Math.min(100,Math.round(n/l*100)):0,u="bg-emerald-500";return(c>=80?u="bg-red-500":c>=60&&(u="bg-amber-500"),o)?(0,r.jsxs)("div",{className:"flex items-center gap-2",dir:"ltr",children:[(0,r.jsx)("div",{className:"w-24 h-1.5 bg-gray-700 rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-300 ".concat(u),style:{width:"".concat(c,"%")}})}),(0,r.jsxs)("span",{className:"text-xs text-gray-400 whitespace-nowrap",children:[P(n)," / ",P(l)]})]}):(0,r.jsxs)("div",{className:"px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-gray-400 mb-1",children:[(0,r.jsx)("span",{children:a("folders.storage")}),(0,r.jsxs)("span",{dir:"ltr",children:[P(n)," / ",P(l)]})]}),(0,r.jsx)("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",dir:"ltr",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-300 ".concat(u),style:{width:"".concat(c,"%")}})}),!s&&c>=60&&(0,r.jsx)("p",{className:"text-xs text-amber-400 mt-1",children:a("folders.upgradeStorage")})]})}var R=n(23063),H=n(83212),L=n(18847),O=n.n(L),D=n(75876),U=O()(function(){return Promise.all([n.e(1062),n.e(2333),n.e(8785),n.e(3233)]).then(n.bind(n,63233))},{loadableGenerated:{webpack:function(){return[63233]}},ssr:!1});function I(e){var t=e.mime_type||"";return t.startsWith("image/")?"image":"application/pdf"===t?"pdf":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":"text/plain"===t||"txt"===e.file_type?"text":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"===t||"docx"===e.file_type?"docx":"unsupported"}function K(e){var t=e.file,i=e.isOpen,s=e.onClose,o=e.onDownload,c=e.onEditText,f=e.docPreview,m=void 0!==f&&f,x=(0,h.B)().t,p=(0,a._)((0,d.useState)(null),2),g=p[0],v=p[1],b=(0,a._)((0,d.useState)(""),2),y=b[0],j=b[1],w=(0,a._)((0,d.useState)(""),2),_=w[0],N=w[1],k=(0,a._)((0,d.useState)(!1),2),C=k[0],z=k[1],A=(0,a._)((0,d.useState)(null),2),T=A[0],B=A[1];if((0,d.useEffect)(function(){if(i&&t){var e,r,s=null;z(!0),B(null),v(null),j(""),N("");var o=m?"pdf":I(t);if("unsupported"===o||"pdf"===o)return void z(!1);var a=(e=t.file_ugid,"".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(e,"/proxy")),c=(r=localStorage.getItem("Mindo_Tok"),{Authorization:"Bearer ".concat(r)});return"text"===o?void fetch(a,{headers:c}).then(function(e){if(!e.ok)throw Error("Failed to load file");return e.text()}).then(function(e){return j(e)}).catch(function(e){return B(e.message)}).finally(function(){return z(!1)}):"docx"===o?void fetch(a,{headers:c}).then(function(e){if(!e.ok)throw Error("Failed to load file");return e.arrayBuffer()}).then(function(e){return(0,l._)(function(){var t;return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,n.e(5542).then(n.t.bind(n,25542,19))];case 1:return[4,r.sent().default.convertToHtml({arrayBuffer:e})];case 2:return t=r.sent(),N((0,D.b3)(t.value)),[2]}})})()}).catch(function(e){return B(e.message)}).finally(function(){return z(!1)}):(fetch(a,{headers:c}).then(function(e){if(!e.ok)throw Error("Failed to load file");return e.blob()}).then(function(e){var t=URL.createObjectURL(e);s=t,v(t)}).catch(function(e){return B(e.message)}).finally(function(){return z(!1)}),function(){s&&URL.revokeObjectURL(s)})}},[i,t]),!i||!t)return null;var E=m?"pdf":I(t),F=function(){return C?(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-gray-600 border-t-blue-500 rounded-full animate-spin"})}):T?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-gray-400",children:[(0,r.jsx)("p",{children:T}),(0,r.jsx)("button",{onClick:function(){return null==o?void 0:o(t)},className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:x("folders.download")})]}):"image"===E&&g?(0,r.jsx)("div",{className:"flex items-center justify-center h-full p-4 overflow-auto",children:(0,r.jsx)("img",{src:g,alt:t.original_filename,className:"max-w-full max-h-full object-contain"})}):"pdf"===E?(0,r.jsx)(U,{file:t,docPreview:m,onClose:s,onDownload:function(){return null==o?void 0:o(t)}}):"video"===E&&g?(0,r.jsx)("div",{className:"flex items-center justify-center h-full p-4",children:(0,r.jsx)("video",{controls:!0,src:g,className:"max-w-full max-h-full"})}):"audio"===E&&g?(0,r.jsx)("div",{className:"flex items-center justify-center h-full p-4",children:(0,r.jsx)("audio",{controls:!0,src:g,className:"w-full max-w-lg"})}):"text"===E?(0,r.jsx)("div",{className:"h-full overflow-auto p-4",children:(0,r.jsx)("pre",{className:"text-sm text-gray-300 whitespace-pre-wrap font-mono",children:y})}):"docx"===E?(0,r.jsx)("div",{className:"h-full overflow-auto p-4",children:(0,r.jsx)("div",{className:"prose prose-invert max-w-none text-sm",dangerouslySetInnerHTML:{__html:_}})}):(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-gray-400",children:[(0,r.jsx)("p",{children:x("folders.previewUnsupported")}),(0,r.jsx)("button",{onClick:function(){return null==o?void 0:o(t)},className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:x("folders.download")})]})},M={height:"100dvh",paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)"};return"pdf"===E?(0,r.jsx)("div",{className:"fixed inset-0 z-[9999] flex flex-col bg-gray-900",style:M,children:F()}):(0,r.jsxs)("div",{className:"fixed inset-0 z-[9999] flex flex-col bg-gray-900/95",style:M,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gray-800 border-b border-gray-700",children:[(0,r.jsx)("h3",{className:"text-sm text-gray-200 truncate flex-1 mr-4",children:t.original_filename}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["text"===E&&!C&&(0,r.jsx)("button",{onClick:function(){return null==c?void 0:c(t,y)},className:"p-2 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-colors",title:x("folders.editText"),children:(0,r.jsx)(S.Yvo,{size:20})}),(0,r.jsx)("button",{onClick:function(){return null==o?void 0:o(t)},className:"p-2 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-colors",title:x("folders.download"),children:(0,r.jsx)(S.E5v,{size:20})}),(0,r.jsx)("button",{onClick:s,className:"p-2 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-colors",children:(0,r.jsx)(S.m6K,{size:20})})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden",children:F()})]})}function Q(e){var t=e.isOpen,n=e.onClose,i=e.onSave,l=e.initialContent,s=e.initialFilename,o=(0,h.B)().t,c=(0,z.useRouter)(),u="fa"===c.locale||"ar"===c.locale,f=(0,a._)((0,d.useState)(s||"untitled.txt"),2),m=f[0],x=f[1],p=(0,a._)((0,d.useState)(l||""),2),g=p[0],v=p[1];return((0,d.useEffect)(function(){t&&(x(s||"untitled.txt"),v(l||""))},[t,s,l]),t)?(0,r.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 font-exo",dir:u?"rtl":"ltr",children:(0,r.jsxs)("div",{className:"bg-gray-800 border border-gray-700 rounded-xl w-full max-w-2xl mx-4 flex flex-col max-h-[80vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-700",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-gray-200",children:o("folders.newText")}),(0,r.jsx)("button",{onClick:n,className:"p-1 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200 transition-colors",children:(0,r.jsx)(S.m6K,{size:20})})]}),(0,r.jsxs)("div",{className:"p-4 flex flex-col gap-3 flex-1 overflow-hidden",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-gray-400 mb-1 block",children:o("folders.textFileName")}
1),(0,r.jsx)("input",{type:"text",value:m,onChange:function(e){return x(e.target.value)},className:"w-full bg-gray-700 text-white text-sm rounded-lg px-3 py-2 outline-none focus:ring-1 focus:ring-blue-500"})]}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,r.jsx)("label",{className:"text-xs text-gray-400 mb-1 block",children:o("folders.textContent")}),(0,r.jsx)("textarea",{value:g,onChange:function(e){return v(e.target.value)},className:"flex-1 w-full bg-gray-700 text-white text-sm rounded-lg px-3 py-2 outline-none focus:ring-1 focus:ring-blue-500 font-mono resize-none min-h-[200px]"})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-700",children:[(0,r.jsx)("button",{onClick:n,className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors",children:o("folders.cancel")}),(0,r.jsx)("button",{onClick:function(){var e=m.trim()||"untitled.txt";i(e.endsWith(".txt")?e:"".concat(e,".txt"),g)},className:"px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:o("folders.saveText")})]})]})}):null}var W=function(e){return(e/1024/1024).toFixed(1)};function X(e){var t=e.upload,n=e.isRTL,i=e.label;if(!t)return null;var l=t.speedBps>0?(t.speedBps/1024/1024).toFixed(1):null;return(0,r.jsx)("div",{className:"fixed bottom-3 inset-x-3 sm:inset-x-auto sm:right-4 sm:w-[340px] z-[95]",style:{direction:n?"rtl":"ltr",marginBottom:"env(safe-area-inset-bottom, 0px)"},children:(0,r.jsxs)("div",{className:"bg-[#0A192F]/95 backdrop-blur-xl rounded-2xl ring-1 ring-white/10 shadow-2xl p-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 transition-colors ".concat(t.done?"bg-green-500/20":"bg-gradient-to-br from-blue-500 to-cyan-500 shadow-lg shadow-blue-500/25"),children:t.done?(0,r.jsx)(S.g9_,{size:20,className:"text-green-400"}):(0,r.jsx)(S.E10,{size:20,className:"text-white animate-pulse"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-xs text-white/50",children:i}),(0,r.jsxs)("p",{className:"text-sm text-white/90 truncate",style:{direction:"ltr",textAlign:n?"right":"left"},children:[t.firstName,t.fileCount>1?"  (+".concat(t.fileCount-1,")"):""]})]}),(0,r.jsxs)("span",{className:"text-base font-bold flex-shrink-0 ".concat(t.done?"text-green-400":"text-cyan-300"),children:[t.percent,"%"]})]}),(0,r.jsx)("div",{className:"h-2 rounded-full bg-white/10 overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-300 ease-out ".concat(t.done?"bg-green-400":"bg-gradient-to-r from-blue-500 to-cyan-400"),style:{width:"".concat(t.percent,"%")}})}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2 text-[11px] text-white/40",style:{direction:"ltr"},children:[(0,r.jsxs)("span",{children:[W(t.loaded)," / ",W(t.total)," MB"]}),l&&!t.done?(0,r.jsxs)("span",{className:"text-cyan-300/70",children:[l," MB/s"]}):(0,r.jsx)("span",{})]})]})})}var q=function(){return"".concat("https://api.mindomax.com/v1","/file-folder/playlists")};function Z(){return(0,l._)(function(){var e,t,n;return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,(0,x.A)(q(),{method:"get"})];case 1:return[2,(null==(n=r.sent().response)||null==(t=n.data)||null==(e=t.data)?void 0:e.playlists)||[]]}})})()}function G(e){return(0,l._)(function(){var t,n,r;return(0,u.YH)(this,function(i){switch(i.label){case 0:return[4,(0,x.A)("".concat(q(),"/").concat(e,"/items"),{method:"get"})];case 1:return[2,(null==(r=i.sent().response)||null==(n=r.data)||null==(t=n.data)?void 0:t.files)||[]]}})})()}function V(e){var t=e.isOpen,n=e.onClose,i=(0,h.B)().t,f=(0,g.RN)(),m=(0,a._)((0,d.useState)([]),2),v=m[0],b=m[1],y=(0,a._)((0,d.useState)(null),2),j=y[0],w=y[1],_=(0,a._)((0,d.useState)([]),2),N=_[0],k=_[1],C=(0,a._)((0,d.useState)(!1),2),z=C[0],A=C[1],T=(0,a._)((0,d.useState)(!1),2),B=T[0],E=T[1],F=(0,d.useCallback)(function(){return(0,l._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:A(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Z()];case 2:return b.apply(void 0,[e.sent()]),[3,4];case 3:return e.sent(),[3,4];case 4:return A(!1),[2]}})})()},[]);(0,d.useEffect)(function(){t&&(w(null),F())},[t,F]);var M=function(e){return(0,l._)(function(){return(0,u.YH)(this,function(t){switch(t.label){case 0:return w(e),[4,G(e.playlist_ugid)];case 1:return k.apply(void 0,[t.sent()]),[2]}})})()},P=function(e,t){return(0,l._)(function(){var n,r,i;return(0,u.YH)(this,function(l){switch(l.label){case 0:if(n=(0,c._)(N),(r=e+t)<0||r>=n.length)return[2];return i=[n[r],n[e]],n[e]=i[0],n[r]=i[1],k(n),[4,(0,x.A)("".concat(q(),"/").concat(j.playlist_ugid,"/items"),{method:"put",body:{order:n.map(function(e){return e.file_ugid})}})];case 1:return l.sent(),[2]}})})()};return t?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:(0,r.jsxs)("div",{className:"w-[92%] max-w-md max-h-[80vh] flex flex-col rounded-2xl bg-gray-900 border border-indigo-400/40 shadow-2xl",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-white/10",children:[(0,r.jsx)(S.oEj,{size:20,className:"text-indigo-400"}),(0,r.jsx)("span",{className:"flex-1 font-semibold text-gray-100 truncate",children:j?j.name:i("folders.playlists")}
1),j&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:function(){return(0,l._)(function(){var e;return(0,u.YH)(this,function(t){switch(t.label){case 0:if(!(null==(e=window.prompt(i("folders.playlistName"),j.name))?void 0:e.trim())||e.trim()===j.name)return[2];return[4,(0,x.A)("".concat(q(),"/").concat(j.playlist_ugid),{method:"put",body:{name:e.trim()}})];case 1:return t.sent(),w((0,o._)((0,s._)({},j),{name:e.trim()})),F(),[2]}})})()},className:"text-xs text-indigo-300 hover:text-indigo-200 px-2",children:i("folders.renameFile")}),(0,r.jsx)("button",{onClick:function(){return(0,l._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:if(!window.confirm(i("folders.playlistDeleteConfirm")))return[2];return[4,(0,x.A)("".concat(q(),"/").concat(j.playlist_ugid),{method:"delete"})];case 1:return e.sent(),w(null),F(),[2]}})})()},className:"p-1.5 rounded-lg hover:bg-red-500/20 text-red-400",children:(0,r.jsx)(S.b6i,{size:18})})]}),(0,r.jsx)("button",{onClick:j?function(){return w(null)}:n,className:"p-1.5 rounded-lg hover:bg-white/10 text-gray-300",children:(0,r.jsx)(S.m6K,{size:18})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:z?(0,r.jsx)("div",{className:"py-10 text-center text-gray-400 text-sm",children:"…"}):j?(0,r.jsxs)(r.Fragment,{children:[0===N.length&&(0,r.jsx)("div",{className:"py-8 text-center text-gray-500 text-sm",children:i("folders.playlistEmpty")}),N.map(function(e,t){return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/5 group",children:[(0,r.jsx)(S.I5y,{size:18,className:"text-purple-400 shrink-0"}),(0,r.jsx)("span",{className:"flex-1 min-w-0 truncate text-sm text-gray-200",children:e.original_filename}),(0,r.jsx)("button",{onClick:function(){return P(t,-1)},disabled:0===t,className:"p-1 text-gray-500 hover:text-white disabled:opacity-20",children:(0,r.jsx)(S.Awo,{size:15})}),(0,r.jsx)("button",{onClick:function(){return P(t,1)},disabled:t===N.length-1,className:"p-1 text-gray-500 hover:text-white disabled:opacity-20",children:(0,r.jsx)(S.TYx,{size:15})}),(0,r.jsx)("button",{onClick:function(){var t;return t=e.file_ugid,(0,l._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:return[4,(0,x.A)("".concat(q(),"/").concat(j.playlist_ugid,"/items/").concat(t),{method:"delete"})];case 1:return e.sent(),k(function(e){return e.filter(function(e){return e.file_ugid!==t})}),[2]}})})()},className:"p-1 text-gray-500 hover:text-red-400",children:(0,r.jsx)(S.m6K,{size:15})})]},e.file_ugid)}),(0,r.jsx)(J,{t:i,open:B,setOpen:E,playlistUgid:j.playlist_ugid,existing:N,onAdded:function(){return M(j)}})]}):(0,r.jsxs)(r.Fragment,{children:[0===v.length&&(0,r.jsx)("div",{className:"py-8 text-center text-gray-500 text-sm",children:i("folders.playlistEmpty")}),v.map(function(e){return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 py-2 rounded-lg hover:bg-white/5 cursor-pointer",onClick:function(){return M(e)},children:[(0,r.jsx)("button",{onClick:function(t){t.stopPropagation(),(0,l._)(function(){var t;return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,G(e.playlist_ugid)];case 1:if(0===(t=r.sent()).length)return(0,p.Ay)(i("folders.playlistEmpty"),{icon:"\uD83C\uDFB5"}),[2];return null==f||f.playQueue(t,0),n(),[2]}})})()},className:"w-9 h-9 rounded-full bg-gradient-to-br from-indigo-400 to-indigo-600 flex items-center justify-center text-white shrink-0 hover:scale-105 transition-transform",children:(0,r.jsx)(S.XKH,{size:20})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"truncate text-sm font-medium text-gray-100",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-gray-500",children:e.track_count})]}),(0,r.jsx)(S.xVu,{size:18,className:"text-gray-600"})]},e.playlist_ugid)})]})}),!j&&(0,r.jsxs)("button",{onClick:function(){return(0,l._)(function(){var e;return(0,u.YH)(this,function(t){switch(t.label){case 0:if(!(null==(e=window.prompt(i("folders.playlistName")))?void 0:e.trim()))return[2];return[4,(0,x.A)(q(),{method:"post",body:{name:e.trim()}})];case 1:return t.sent(),F(),[2]}})})()},className:"m-3 flex items-center justify-center gap-1.5 rounded-xl border border-indigo-400/50 py-2 text-sm font-semibold text-indigo-300 hover:bg-indigo-400/10",children:[(0,r.jsx)(S.jgn,{size:18})," ",i("folders.playlistNew")]})]})}):null}function J(e){var t=e.t,n=e.open,i=e.setOpen,s=e.playlistUgid,o=e.existing,f=e.onAdded,m=(0,a._)((0,d.useState)([]),2),h=m[0],g=m[1],v=(0,a._)((0,d.useState)(""),2),b=v[0],y=v[1],j=(0,a._)((0,d.useState)([]),2),w=j[0],_=j[1],N=(0,a._)((0,d.useState)(new Set),2),k=N[0],z=N[1];return((0,d.useEffect)(function(){n&&(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder"),{method:"get"}).then(function(e){var t,n,r=e.response;return g((null==r||null==(n=r.data)||null==(t=n.data)?void 0:t.folders)||[])})},[n]),(0,d.useEffect)(function(){if(n){var e=b?"".concat("https://api.mindomax.com/v1","/file-folder/files?folderUgid=").concat(b):"".concat("https://api.mindomax.com/v1","/file-folder/files");(0,x.A)(e,{method:"get"}).then(function(e){var t,n,r=e.response,i=(null==r||null==(n=r.data)||null==(t=n.data)?void 0:t.files)||[],l=new Set(o.map(function(e){return e.file_ugid}));
1_(i.filter(function(e){return"audio"===C(e)&&!l.has(e.file_ugid)})),z(new Set)})}},[n,b,o]),n)?(0,r.jsxs)("div",{className:"mt-2 rounded-xl border border-white/10 p-2",children:[(0,r.jsxs)("select",{value:b,onChange:function(e){return y(e.target.value)},className:"w-full mb-2 rounded-lg bg-gray-800 text-gray-200 text-sm px-2 py-1.5 outline-none",children:[(0,r.jsx)("option",{value:"",children:t("folders.pageTitle")}),h.map(function(e){return(0,r.jsx)("option",{value:e.folder_ugid,children:e.folder_name},e.folder_ugid)})]}),(0,r.jsxs)("div",{className:"max-h-40 overflow-y-auto",children:[0===w.length&&(0,r.jsx)("div",{className:"py-3 text-center text-gray-500 text-xs",children:"—"}),w.map(function(e){return(0,r.jsxs)("label",{className:"flex items-center gap-2 px-1 py-1 text-sm text-gray-200 cursor-pointer hover:bg-white/5 rounded",children:[(0,r.jsx)("input",{type:"checkbox",checked:k.has(e.file_ugid),onChange:function(t){var n=new Set(k);t.target.checked?n.add(e.file_ugid):n.delete(e.file_ugid),z(n)},className:"accent-indigo-400"}),(0,r.jsx)("span",{className:"truncate",children:e.original_filename})]},e.file_ugid)})]}),(0,r.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,r.jsx)("button",{onClick:function(){return i(!1)},className:"flex-1 rounded-lg border border-white/15 py-1.5 text-xs text-gray-300 hover:bg-white/5",children:(0,r.jsx)(S.m6K,{size:14,className:"inline"})}),(0,r.jsxs)("button",{onClick:function(){return(0,l._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:if(0===k.size)return[2];return[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/playlists/").concat(s,"/items"),{method:"post",body:{file_ugids:(0,c._)(k)}})];case 1:return e.sent(),p.Ay.success(t("folders.playlistAdded")),i(!1),f(),[2]}})})()},disabled:0===k.size,className:"flex-1 rounded-lg bg-indigo-500 py-1.5 text-xs font-semibold text-white disabled:opacity-40 hover:bg-indigo-400",children:[t("folders.playlistAddTracks")," (",k.size,")"]})]})]}):(0,r.jsxs)("button",{onClick:function(){return i(!0)},className:"mt-2 w-full flex items-center justify-center gap-1.5 rounded-xl border border-indigo-400/50 py-2 text-sm font-semibold text-indigo-300 hover:bg-indigo-400/10",children:[(0,r.jsx)(S.jgn,{size:18})," ",t("folders.playlistAddTracks")]})}function $(e){var t=e.file,n=e.onClose,i=(0,h.B)().t,s=(0,a._)((0,d.useState)([]),2),o=s[0],c=s[1];(0,d.useEffect)(function(){Z().then(c)},[]);var f=function(e){return(0,l._)(function(){return(0,u.YH)(this,function(r){switch(r.label){case 0:return[4,(0,x.A)("".concat(q(),"/").concat(e,"/items"),{method:"post",body:{file_ugids:[t.file_ugid]}})];case 1:return r.sent(),p.Ay.success(i("folders.playlistAdded")),n(),[2]}})})()};return(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:(0,r.jsxs)("div",{className:"w-[92%] max-w-xs rounded-2xl bg-gray-900 border border-indigo-400/40 shadow-2xl p-3",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2 px-1",children:[(0,r.jsx)(S.oEj,{size:18,className:"text-indigo-400"}),(0,r.jsx)("span",{className:"flex-1 text-sm font-semibold text-gray-100",children:i("folders.playlistAddToPlaylist")}),(0,r.jsx)("button",{onClick:n,className:"p-1 rounded hover:bg-white/10 text-gray-400",children:(0,r.jsx)(S.m6K,{size:16})})]}),(0,r.jsx)("div",{className:"max-h-56 overflow-y-auto",children:o.map(function(e){return(0,r.jsxs)("button",{onClick:function(){return f(e.playlist_ugid)},className:"w-full flex items-center gap-2 px-2 py-2 rounded-lg hover:bg-white/5 text-left",children:[(0,r.jsx)(S.oEj,{size:16,className:"text-indigo-400 shrink-0"}),(0,r.jsx)("span",{className:"flex-1 truncate text-sm text-gray-200",children:e.name}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:e.track_count})]},e.playlist_ugid)})}),(0,r.jsxs)("button",{onClick:function(){return(0,l._)(function(){var e,t,n,r,l;return(0,u.YH)(this,function(s){switch(s.label){case 0:if(!(null==(n=window.prompt(i("folders.playlistName")))?void 0:n.trim()))return[2];return[4,(0,x.A)(q(),{method:"post",body:{name:n.trim()}})];case 1:if(!(l=null==(r=s.sent().response)||null==(t=r.data)||null==(e=t.data)?void 0:e.playlist_ugid))return[3,3];return[4,f(l)];case 2:s.sent(),s.label=3;case 3:return[2]}})})()},className:"mt-2 w-full flex items-center justify-center gap-1.5 rounded-xl border border-indigo-400/50 py-2 text-sm font-semibold text-indigo-300 hover:bg-indigo-400/10",children:[(0,r.jsx)(S.jgn,{size:16})," ",i("folders.playlistNew")]})]})})}function ee(){var e,t=(0,h.B)().t,n=(0,z.useRouter)(),i="fa"===n.locale||"ar"===n.locale,v=(0,a._)((0,d.useState)([]),2),b=v[0],y=v[1],j=(0,a._)((0,d.useState)([]),2),w=j[0],_=j[1],N=(0,a._)((0,d.useState)({usedBytes:0,limitBytes:0,isPremium:!1}),2),k=N[0],B=N[1],E=(0,a._)((0,d.useState)(!0),2),P=E[0],L=E[1],O=(0,a._)((0,d.useState)([{ugid:null,name:t("folders.pageTitle")}]),2),D=O[0],U=O[1],I=D[D.length-1].ugid,W=(0,a._)((0,d.useState)({visible:!1,position:{x:0,y:0}}),2),q=W[0],Z=W[1],G=(0,a._)((0,d.useState)({visible:!1,position:{x:0,y:0},item:null,type:null}),2),J=G[0],ee=G[1],et=(0,a._)((0,d.useState)("date"),2),en=et[0],er=et[1],ei=(0,a._)((0,d.useState)(!1),2),el=ei[0],es=ei[1],eo=(0,a._)((0,d.useState)(!1),2),ea=eo[0],ec=eo[1],eu=(0,d.useRef)(null),ed=(0,d.useRef)(0),ef=(0,a._)((0,d.useState)(null),2),em=ef[0],ex=ef[1],ep=(0,d.useRef)({time:0,loaded:0,speedBps:0}),eh=(0,a._)((0,d.useState)(!1),2),eg=eh[0],ev=eh[1],eb=(0,a._)((0,d.useState)(null),2),ey=eb[0],ej=eb[1],ew=(0,a._)((0,d.useState)({isOpen:!1,title:"",message:"",onConfirm:null,type:"default"}),2),e_=ew[0],eN=ew[1],ek=(0,a._)((0,d.useState)(null),2),eC=ek[0],eS=ek[1],ez=(0,a._)((0,d.useState)(null),2),eA=ez[0],eT=ez[1],eB=(0,a._)((0,d.useState)(!1),2),eE=eB[0],eF=eB[1],eM=(0,a._)((0,d.useState)(!1),2),eP=eM[0],eY=eM[1],eR=(0,a._)((0,d.useState)(null),2),eH=eR[0],eL=eR[1],eO=(0,g.RN)(),eD=(0,a._)((0,d.useState)(!1),2),eU=eD[0],eI=eD[1],eK=(0,a._)((0,d.useState)(null),2),eQ=eK[0],eW=eK[1],eX=(0,a._)((0,d.useState)(!1),2),eq=eX[0],eZ=eX[1],eG=(0,a._)((0,d.useState)({open:!1,folder:null}),2),eV=eG[0],eJ=eG[1],e$=(0,f.FR)((0,f.MS)(f.cA,{activationConstraint:{distance:8}}),(0,f.MS)(f.IG,{activationConstraint:{delay:200,tolerance:5}})),e0=function(){return(0,l._)(function(){var e;return(0,u.YH)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder"),{method:"get"})];case 1:return(null==(e=t.sent().response)?void 0:e.status)===200&&y(e.data.data.folders||[]),[3,3];case 2:return console.error("Failed to fetch folders:",t.sent()),[3,3];case 3:return[2]}})})()},e1=function(e){return(0,l._)(function(){var t,n;return(0,u.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t="".concat("https://api.mindomax.com/v1","/file-folder/files"),e&&(t+="?folderUgid=".concat(e)),[4,(0,x.A)(t,{method:"get"})];case 1:return(null==(n=r.sent().response)?void 0:n.status)===200&&_(n.data.data.files||[]),[3,3];case 2:return console.error("Failed to fetch files:",r.sent()),[3,3];case 3:return[2]}})})()},e2=function(){return(0,l._)(function(){var e;return(0,u.YH)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/storage"),{method:"get"})];case 1:return(null==(e=t.sent().response)?void 0:e.status)===200&&B(e.data.data),[3,3];case 2:return console.error("Failed to fetch storage:",t.sent()),[3,3];case 3:return[2]}})})()};(0,d.useEffect)(function(){(0,l._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:return L(!0),[4,Promise.all([e0(),e1(I),e2()])];case 1:return e.sent(),L(!1),[2]}})})()},[]),(0,d.useEffect)(function(){e1(I)},[I]);var e4=function(e){U(function(t){return(0,c._)(t).concat([{ugid:e.folder_ugid,name:e.folder_name}])})},e5=function(e){U(function(t){return t.slice(0,e+1)})},e3=b.filter(function(e){return e.parent_folder_ugid===I}),e6=(0,c._)(w).sort(function(e,t){switch(en){case"name":return(e.original_filename||"").localeCompare(t.original_filename||"");case"size":return(t.file_size_bytes||0)-(e.file_size_bytes||0);default:return new Date(t.time_uploaded)-new Date(e.time_uploaded)}}),e9=function(e,t,n){e.preventDefault(),ee({visible:!0,position:{x:e.clientX,y:e.clientY},item:t,type:n}),Z(function(e){return(0,o._)((0,s._)({},e),{visible:!1})})},e8=[{label:t("folders.newFolder"),icon:S.KrV,onClick:function(){ej(null),ev(!0)}},{label:t("folders.uploadFiles"),icon:S.E10,onClick:function(){return setTimeout(function(){var e;return null==(e=eu.current)?void 0:e.click()},0)}},{label:t("folders.newText"),icon:S.ruO,onClick:function(){return eI(!0)}}],e7=(0,a._)((0,d.useState)(null),2),te=e7[0],tt=e7[1],tn=function(e){tt(e.file_ugid)},tr=function(e){eJ({open:!0,folder:e})},ti=function(e){eN({isOpen:!0,title:t("folders.deleteFolder"),message:t("folders.deleteFolderConfirm"),type:"delete",onConfirm:function(){return(0,l._)(function(){return(0,u.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/").concat(e.folder_ugid),{method:"delete"})];case 1:return n.sent(),D.some(function(t){return t.ugid===e.folder_ugid})&&U([{ugid:null,name:t("folders.pageTitle")}]),[4,Promise.all([e0(),e1(I)])];case 2:return n.sent(),[3,4];case 3:return n.sent(),p.Ay.error("Failed to delete folder"),[3,4];case 4:return eN(function(e){return(0,o._)((0,s._)({},e),{isOpen:!1})}),[2]}})})()}})},tl=function(e){return(0,l._)(function(){var n,r,i,l,a,c,d,f,x,h,g,v,b,y,j,w,_;return(0,u.YH)(this,function(u){switch(u.label){case 0:if(em&&!em.done||0===(n=Array.from(e)).length)return[2];r=new FormData,i=!0,l=!1,a=void 0;try{for(c=n[Symbol.iterator]();!(i=(d=c.next()).done);i=!0)f=d.value,r.append("files",f)}catch(e){l=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(l)throw a}}I&&r.append("folderUgid",I),x=n.reduce(function(e,t){return e+t.size},0),ep.current={time:Date.now(),loaded:0,speedBps:0},ex({percent:0,loaded:0,total:x,speedBps:0,fileCount:n.length,firstName:n[0].name,done:!1}),u.label=1;case 1:return u.trys.push([1,4,,5]),g=localStorage.getItem("Mindo_Tok"),[4,m.A.post("".concat("https://api.mindomax.com/v1","/file-folder/files"),r,{headers:{Authorization:"Bearer ".concat(g)},onUploadProgress:function(e){var t=e.total||x||1,n=Date.now(),r=ep.current,i=(n-r.time)/1e3,l=r.speedBps;i>=.3&&(l=Math.max(0,(e.loaded-r.loaded)/i),ep.current={time:n,loaded:e.loaded,speedBps:l}),ex(function(n){return n?(0,o._)((0,s._)({},n),{percent:Math.min(100,Math.round(e.loaded/t*100)),loaded:e.loaded,total:t,speedBps:l}):n})}})];case 2:return v=u.sent(),ex(function(e){return e?(0,o._)((0,s._)({},e),{percent:100,loaded:e.total,done:!0}):e}),[4,Promise.all([e1(I),e2()])];case 3:return u.sent(),p.Ay.success(null==(h=v.data)?void 0:h.message),setTimeout(function(){return ex(null)},1500),[3,5];case 4:var N,k;if(b=u.sent(),ex(null),(null==(y=b.response)?void 0:y.status)===413)return p.Ay.error(t("folders.quotaExceeded")),[2];return _=null==(w=b.response)||null==(j=w.data)?void 0:j.message,p.Ay.error(_?(k=(N=String(_||"").trim()).match(/^"(.+)" has an unsupported file type/))?t("folders.errUnsupported").replace("{name}",k[1]):(k=N.match(/^"(.+)" exceeds the (\d+) MB .* limit/))?t("folders.errTooLarge").replace("{name}",k[1]).replace("{mb}",k[2]):N.startsWith("Storage quota exceeded")?t("folders.quotaExceeded"):N:"Upload failed"),[3,5];case 5:return[2]}})})()},ts=function(e){var n,r=C(e);if("audio"===r){var i=e6.filter(function(e){return"audio"===C(e)}),l=i.findIndex(function(t){return t.file_ugid===e.file_ugid});null==eO||eO.playQueue(i,Math.max(l,0));return}if("archive"===r)return void tu(e);
1if("processing"===e.transcode_status){(0,p.Ay)(t("folders.preparing"),{icon:"⏳"}),e1(I);return}if("doc"===(n=C(e))||"slides"===n||"sheet"===n)return void("ready"===e.transcode_status?(eF(!0),eT(e)):tu(e));eF(!1),eT(e)},to=function(e,t,n){return(0,l._)(function(){return(0,u.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(e,"/rename"),{method:"put",body:{newFilename:t,source:n}})];case 1:return r.sent(),[4,e1(I)];case 2:return r.sent(),[3,4];case 3:return r.sent(),p.Ay.error("Failed to rename file"),[3,4];case 4:return tt(null),[2]}})})()},ta=function(e){eN({isOpen:!0,title:t("folders.deleteFile"),message:t("folders.deleteFileConfirm"),type:"delete",onConfirm:function(){return(0,l._)(function(){return(0,u.YH)(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(e.file_ugid),{method:"delete"})];case 1:return t.sent(),[4,Promise.all([e1(I),e2()])];case 2:return t.sent(),[3,4];case 3:return t.sent(),p.Ay.error("Failed to delete file"),[3,4];case 4:return eN(function(e){return(0,o._)((0,s._)({},e),{isOpen:!1})}),[2]}})})()}})},tc=function(e,t){return(0,l._)(function(){return(0,u.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(e.file_ugid,"/move"),{method:"put",body:{folderUgid:t||null,source:e.source}})];case 1:return n.sent(),[4,Promise.all([e1(I),e0()])];case 2:return n.sent(),eS(null),[3,4];case 3:return n.sent(),p.Ay.error("Failed to move file"),[3,4];case 4:return[2]}})})()},tu=function(e){var t=localStorage.getItem("Mindo_Tok");fetch("".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(e.file_ugid,"/proxy?download=true"),{headers:{Authorization:"Bearer ".concat(t)}}).then(function(e){return e.blob()}).then(function(t){var n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e.original_filename,r.click(),URL.revokeObjectURL(n)}).catch(function(){return p.Ay.error("Download failed")})};if(P)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-blue-400 border-t-transparent rounded-full animate-spin"})});var td=0===e3.length&&0===e6.length;return(0,r.jsxs)(f.Mp,{sensors:e$,collisionDetection:f.fp,onDragEnd:function(e){var t,n,r,i,l=e.active,s=e.over;if(s&&l){var o=null==(n=l.data)||null==(t=n.current)?void 0:t.file,a=null==(i=s.data)||null==(r=i.current)?void 0:r.folder;o&&a&&tc(o,a.folder_ugid)}},children:[(0,r.jsxs)("div",{className:"flex flex-col h-full ".concat(ea?"ring-2 ring-blue-400 ring-inset bg-blue-500/5":""),onDragEnter:function(e){e.dataTransfer.types.includes("Files")&&(e.preventDefault(),ed.current++,ec(!0))},onDragOver:function(e){e.dataTransfer.types.includes("Files")&&e.preventDefault()},onDragLeave:function(e){e.preventDefault(),ed.current--,ed.current<=0&&(ed.current=0,ec(!1))},onDrop:function(e){return(0,l._)(function(){var t;return(0,u.YH)(this,function(n){switch(n.label){case 0:if(e.preventDefault(),ed.current=0,ec(!1),!((t=Array.from(e.dataTransfer.files)).length>0))return[3,2];return[4,tl(t)];case 1:n.sent(),n.label=2;case 2:return[2]}})})()},onContextMenu:function(e){e.preventDefault(),Z({visible:!0,position:{x:e.clientX,y:e.clientY}}),ee(function(e){return(0,o._)((0,s._)({},e),{visible:!1})})},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-700 gap-3",dir:i?"rtl":"ltr",children:[(0,r.jsx)("div",{className:"flex items-center gap-1 min-w-0 flex-1 overflow-x-auto",children:D.map(function(e,t){return(0,r.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[t>0&&(i?(0,r.jsx)(S.E_E,{size:16,className:"text-gray-500"}):(0,r.jsx)(S.xVu,{size:16,className:"text-gray-500"})),(0,r.jsx)("button",{onClick:function(){return e5(t)},className:"text-sm px-1.5 py-0.5 rounded hover:bg-gray-700 transition-colors whitespace-nowrap ".concat(t===D.length-1?"text-gray-200 font-medium":"text-gray-400"),children:e.name})]},t)})}),(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,r.jsx)("button",{onClick:function(){return eY(!0)},title:t("folders.playlists"),className:"flex items-center justify-center w-10 h-10 rounded-lg text-indigo-300 hover:bg-gray-700 hover:text-indigo-200 transition-colors",children:(0,r.jsx)(S.oEj,{size:22})}),(0,r.jsx)("div",{className:"hidden sm:block",children:(0,r.jsx)(Y,{usedBytes:k.usedBytes,limitBytes:k.limitBytes,isPremium:k.isPremium,compact:!0})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{onClick:function(){return es(!el)},className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg text-sm text-gray-400 hover:bg-gray-700 transition-colors",children:(0,r.jsx)(S.SEk,{size:18})}),el&&(0,r.jsx)("div",{className:"absolute ".concat(i?"left-0":"right-0"," top-10 z-20 w-40 bg-gray-800 border border-gray-600 rounded-lg shadow-xl py-1"),onMouseLeave:function(){return es(!1)},children:[{key:"date",icon:S.Hvs,label:"Date"},{key:"name",icon:S.hlZ,label:"Name"},{key:"size",icon:S.rrw,label:"Size"}].map(function(e){var t=e.key,n=e.icon,i=e.label;return(0,r.jsxs)("button",{onClick:function(){er(t),es(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors ".concat(en===t?"text-blue-400 bg-blue-500/10":"text-gray-300 hover:bg-gray-700"),children:[(0,r.jsx)(n,{size:16})," ",i]},t)})})]})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-4 pb-32 md:pb-8",children:td?(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center border-2 border-dashed border-gray-600 rounded-2xl px-12 py-10 cursor-pointer transition-colors hover:border-gray-400 hover:bg-white/5",onClick:function(){var e;return null==(e=eu.current)?void 0:e.click()},children:[(0,r.jsx)(S.E10,{size:48,className:"text-white mb-3"}),(0,r.jsx)("p",{className:"text-gray-200 text-sm",children:t("folders.emptyFolder")}),(0,r.jsx)("p",{className:"text-gray-400 text-xs mt-1",children:t("folders.dropFilesHere")}
1)]})}):(0,r.jsxs)("div",{className:"grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10 gap-1",children:[e3.map(function(e){return(0,r.jsx)(A,{folder:e,onClick:e4,onContextMenu:e9,onMenuClick:tr},e.folder_ugid)}),e6.map(function(e){return(0,r.jsx)(T,{file:e,onRename:to,onContextMenu:e9,triggerRename:te===e.file_ugid,onDownload:tu,onOpen:ts},e.file_ugid)})]})}),(0,r.jsx)("input",{ref:eu,type:"file",multiple:!0,className:"hidden",onChange:function(e){return(0,l._)(function(){var t;return(0,u.YH)(this,function(n){switch(n.label){case 0:if(!((t=Array.from(e.target.files)).length>0))return[3,2];return[4,tl(t)];case 1:n.sent(),e.target.value="",n.label=2;case 2:return[2]}})})()},accept:".pdf,.jpg,.jpeg,.png,.gif,.webp,.heic,.bmp,.mp3,.m4a,.aac,.wav,.flac,.ogg,.oga,.opus,.wma,.amr,.aiff,.aif,.mp4,.mov,.m4v,.mkv,.avi,.wmv,.flv,.webm,.3gp,.mpg,.mpeg,.ts,.m2ts,.vob,.txt,.md,.doc,.docx,.odt,.rtf,.ppt,.pptx,.key,.xls,.xlsx,.csv,.numbers,.pages,.zip,.rar,.7z"})]}),(0,r.jsx)(F,{visible:q.visible,position:q.position,items:e8,onClose:function(){return Z(function(e){return(0,o._)((0,s._)({},e),{visible:!1})})}}),(0,r.jsx)(F,{visible:J.visible,position:J.position,items:function(){if(!J.item)return[];if("folder"===J.type)return[{label:t("folders.renameFile"),icon:S.Yvo,onClick:function(){ej(J.item),ev(!0)}},{divider:!0},{label:t("folders.deleteFolder"),icon:S.b6i,className:"text-red-400 hover:bg-gray-700",onClick:function(){return ti(J.item)}}];var e="text/plain"===J.item.mime_type||"txt"===J.item.file_type;return[{label:t("folders.openFile"),icon:S.JvP,onClick:function(){return ts(J.item)}}].concat((0,c._)("audio"===C(J.item)?[{label:t("folders.playlistAddToPlaylist"),icon:S.oEj,onClick:function(){return eL(J.item)}}]:[]),(0,c._)(e?[{label:t("folders.editText"),icon:S.Yvo,onClick:function(){eW(J.item),eI(!0)}}]:[]),[{label:t("folders.renameFile"),icon:S.Yvo,onClick:function(){return tn(J.item)}},{label:t("folders.moveToFolder"),icon:S.JBX,onClick:function(){return eS(J.item)}},{label:t("folders.download"),icon:S.E5v,onClick:function(){return tu(J.item)}},{divider:!0},{label:t("folders.deleteFile"),icon:S.b6i,className:"text-red-400 hover:bg-gray-700",onClick:function(){return ta(J.item)}}])}(),onClose:function(){return ee(function(e){return(0,o._)((0,s._)({},e),{visible:!1})})}}),(0,r.jsx)(R.A,{isOpen:eg,onClose:function(){return ev(!1)},onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,l._)(function(){var e,n,r,i,l,s,o;return(0,u.YH)(this,function(c){switch(c.label){case 0:if(c.trys.push([0,6,,7]),!ey)return[3,2];return n=(e=(0,a._)(t,3))[0],r=e[1],i=e[2],[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/").concat(n),{method:"put",body:{folderName:r,folderColor:i}})];case 1:return c.sent(),[3,4];case 2:return s=(l=(0,a._)(t,2))[0],o=l[1],[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder"),{method:"post",body:{folderName:s,folderColor:o,parentFolderUgid:I||null}})];case 3:c.sent(),c.label=4;case 4:return ev(!1),[4,e0()];case 5:return c.sent(),[3,7];case 6:return c.sent(),p.Ay.error("Failed to save folder"),[3,7];case 7:return[2]}})})()},folder:ey}),(0,r.jsx)(H.A,{isOpen:e_.isOpen,onClose:function(){return eN(function(e){return(0,o._)((0,s._)({},e),{isOpen:!1})})},onConfirm:e_.onConfirm,title:e_.title,message:e_.message,confirmText:t("common.buttons.delete"),cancelText:t("common.buttons.cancel"),type:e_.type}),eC?(0,r.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/50",onClick:function(){return eS(null)},children:(0,r.jsxs)("div",{className:"bg-gray-800 border border-gray-600 rounded-xl p-4 w-full max-w-sm",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("h3",{className:"text-lg text-gray-200 mb-3",children:t("folders.moveToFolder")}),(0,r.jsxs)("div",{className:"space-y-1 max-h-60 overflow-y-auto",children:[(0,r.jsx)("button",{onClick:function(){return tc(eC,null)},className:"w-full text-left px-3 py-2 rounded-lg text-sm text-gray-300 hover:bg-gray-700",children:t("folders.removeFromFolder")}),b.map(function(e){return(0,r.jsxs)("button",{onClick:function(){return tc(eC,e.folder_ugid)},className:"w-full text-left flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-gray-300 hover:bg-gray-700",children:[(0,r.jsx)("span",{className:"w-3 h-3 rounded-sm",style:{background:e.folder_color||"#6366f1"}}),e.folder_name]},e.folder_ugid)})]})]})}):null,(0,r.jsxs)("div",{className:"fixed bottom-24 md:bottom-6 right-4 md:right-6 z-20 flex flex-col items-center gap-2.5",children:[(0,r.jsx)("button",{onClick:function(){return(0,l._)(function(){return(0,u.YH)(this,function(e){switch(e.label){case 0:return L(!0),[4,Promise.all([e0(),e1(I),e2()])];case 1:return e.sent(),L(!1),[2]}})})()},title:t("folders.pageTitle"),className:"w-10 h-10 rounded-full bg-gray-800/90 border border-indigo-400/40 text-indigo-300 flex items-center justify-center shadow-lg hover:bg-gray-700 backdrop-blur transition-colors",children:(0,r.jsx)(S.joZ,{size:20,className:P?"animate-spin":""})}),(0,r.jsx)("button",{onClick:function(){return eZ(!0)},className:"w-12 h-12 rounded-full bg-gradient-to-br from-indigo-400 to-indigo-600 text-white flex items-center justify-center shadow-xl hover:scale-105 transition-transform",children:(0,r.jsx)(S.jgn,{size:26})})]}),(0,r.jsx)(V,{isOpen:eP,onClose:function(){return eY(!1)}}),eH&&(0,r.jsx)($,{file:eH,onClose:function(){return eL(null)}}),(0,r.jsx)(K,{file:eA,docPreview:eE,isOpen:!!eA,onClose:function(){eT(null),eF(!1)},onDownload:tu,onEditText:function(e,t){eT(null),eW((0,o._)((0,s._)({},e),{_textContent:t})),eI(!0)}}),(0,r.jsx)(Q,{isOpen:eU,onClose:function(){eI(!1),eW(null)},initialFilename:(null==eQ?void 0:eQ.original_filename)||"untitled.txt",initialContent:(null==eQ?void 0:eQ._textContent)||"",onSave:function(e,t){return(0,l._)(function(){var n;return(0,u.YH)(this,function(r){switch(r.label){case 0:if(n=new File([new Blob([t],{type:"text/plain"})],e,{type:"text/plain"}),!(null==eQ?void 0:eQ.file_ugid))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,x.A)("".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(eQ.file_ugid),{method:"delete"})];case 2:case 3:return r.sent(),[3,4];case 4:return[4,tl([n])];case 5:return r.sent(),eI(!1),eW(null),[2]}})})()}}),eq&&(0,r.jsx)(M,{items:e8,title:t("folders.pageTitle"),onClose:function(){return eZ(!1)}}),eV.open&&eV.folder&&(0,r.jsx)(M,{items:(e=eV.folder,[{label:t("folders.renameFile"),icon:S.Yvo,onClick:function(){ej(e),ev(!0)}},{divider:!0},{label:t("folders.deleteFolder"),icon:S.b6i,className:"text-red-400 hover:bg-gray-700",onClick:function(){return ti(e)}}]),title:eV.folder.folder_name,onClose:function(){return eJ({open:!1,folder:null})}}),(0,r.jsx)(X,{upload:em,isRTL:i,label:t("folders.uploading")})]})}var et=!0;function en(e){var t=(0,h.B)().t;return(0,r.jsxs)("div",{className:"h-full",children:[(0,r.jsx)(i.A,{title:t("pageTitles.folders"),noindex:!0}),(0,r.jsx)(ee,{themeProfile:e.themeProfile})]})}}
1,57293:(e,t,n)=>{"use strict";n.d(t,{RN:()=>d,Vw:()=>u});var r=n(16927),i=n(20294),l=n(95531),s=n(37876),o=n(14232),a=(0,o.createContext)(null),c=[.5,.75,1,1.25,1.5,2];function u(e){var t=e.children,n=(0,o.useRef)(null),u=(0,o.useRef)(null),d=(0,o.useRef)(0),f=(0,i._)((0,o.useState)([]),2),m=f[0],x=f[1],p=(0,i._)((0,o.useState)(0),2),h=p[0],g=p[1],v=(0,i._)((0,o.useState)(!1),2),b=v[0],y=v[1],j=(0,i._)((0,o.useState)(!1),2),w=j[0],_=j[1],N=(0,i._)((0,o.useState)(0),2),k=N[0],C=N[1],S=(0,i._)((0,o.useState)(0),2),z=S[0],A=S[1],T=(0,i._)((0,o.useState)(1),2),B=T[0],E=T[1],F=m[h]||null,M=function(){u.current&&(URL.revokeObjectURL(u.current),u.current=null)},P=(0,o.useCallback)(function(e,t){var i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,r._)(function(){var r,s,o,a,c,f;return(0,l.YH)(this,function(l){switch(l.label){case 0:if(r=e[t],s=n.current,!r||!s)return[2];o=++d.current,_(!0),C(0),A(0),l.label=1;case 1:return l.trys.push([1,6,7,8]),a=localStorage.getItem("Mindo_Tok"),[4,fetch("".concat("https://api.mindomax.com/v1","/file-folder/files/").concat(r.file_ugid,"/proxy"),{headers:{Authorization:"Bearer ".concat(a)}})];case 2:if(!(c=l.sent()).ok)throw Error("HTTP ".concat(c.status));return[4,c.blob()];case 3:if(f=l.sent(),o!==d.current)return[2];if(M(),u.current=URL.createObjectURL(f),s.src=u.current,s.playbackRate=B,!i)return[3,5];return[4,s.play()];case 4:l.sent(),l.label=5;case 5:return[3,8];case 6:return console.error("[AudioPlayer] load failed:",l.sent()),[3,8];case 7:return o===d.current&&_(!1),[7];case 8:return[2]}})})()},[B]),Y=(0,o.useCallback)(function(e){var t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=e||[];if(0!==l.length){var s=Math.min(Math.max(i,0),l.length-1);if(F&&(null==(t=l[s])?void 0:t.file_ugid)===F.file_ugid&&(null==(r=n.current)?void 0:r.src))return void n.current.play();x(l),g(s),P(l,s)}},[F,P]),R=(0,o.useCallback)(function(){h+1<m.length&&(g(h+1),P(m,h+1))},[h,m,P]),H=(0,o.useCallback)(function(){h>0&&(g(h-1),P(m,h-1))},[h,m,P]),L=(0,o.useCallback)(function(){var e=n.current;e&&e.src&&(e.paused?e.play():e.pause())},[]),O=(0,o.useCallback)(function(){var e;return null==(e=n.current)?void 0:e.pause()},[]),D=(0,o.useCallback)(function(e){var t=n.current;t&&isFinite(e)&&(t.currentTime=e)},[]),U=(0,o.useCallback)(function(e){var t=n.current;t&&(t.currentTime=Math.min(Math.max(t.currentTime+e,0),t.duration||0))},[]),I=(0,o.useCallback)(function(){E(function(e){var t=c[(c.indexOf(e)+1)%c.length];return n.current&&(n.current.playbackRate=t),t})},[]),K=(0,o.useCallback)(function(){d.current++;var e=n.current;e&&(e.pause(),e.removeAttribute("src"),e.load()),M(),x([]),g(0),y(!1),C(0),A(0)},[]);(0,o.useEffect)(function(){return function(){return M()}},[]);var Q={current:F,queue:m,index:h,playing:b,loading:w,position:k,duration:z,speed:B,hasNext:h+1<m.length,hasPrev:h>0,playQueue:Y,toggle:L,pause:O,next:R,prev:H,seekTo:D,seekBy:U,cycleSpeed:I,stop:K};return(0,s.jsxs)(a.Provider,{value:Q,children:[t,(0,s.jsx)("audio",{ref:n,className:"hidden",onPlay:function(){return y(!0)},onPause:function(){return y(!1)},onTimeUpdate:function(e){return C(e.target.currentTime||0)},onLoadedMetadata:function(e){return A(e.target.duration||0)},onEnded:function(){h+1<m.length?(g(h+1),P(m,h+1)):y(!1)}})]})}function d(){return(0,o.useContext)(a)}}},e=>{e.O(0,[9196,1167,1040,4471,2227,4533,2782,3310,636,6593,8792],()=>e(e.s=14248)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.