1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[540,4703],{5081:(e,t,s)=>{"use strict";var l=s(88997);s.o(l,"useParams")&&s.d(t,{useParams:function(){return l.useParams}}),s.o(l,"usePathname")&&s.d(t,{usePathname:function(){return l.usePathname}}),s.o(l,"useRouter")&&s.d(t,{useRouter:function(){return l.useRouter}}),s.o(l,"useSearchParams")&&s.d(t,{useSearchParams:function(){return l.useSearchParams}})},10858:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var l=s(88392),r=s(80244),n=s.n(r),o=s(47940),a=s(5081),i=s(58907),d=s(82013),c=s(68978),u=s(80453),m=s(16313),p=s.n(m);function h(e){if(null==e||""===e)return null;if("number"==typeof e)return e>1e12?e:1e3*e;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.getTime()}let x=Object.keys(c.br).sort((e,t)=>t.length-e.length);function f(e){let t=String(e||"").trim().toLowerCase().replace(/-/g,"_").replace(/\s+/g,"_");return t&&c.br[t]?t:null}function g(e){return String(e||"").toLowerCase().replace(/\\/g,"-").replace(/\//g,"-").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function v(){var e,t;arguments.length>0&&void 0!==arguments[0]&&arguments[0];let s=(0,a.useRouter)(),r=(0,a.usePathname)(),m=(0,a.useParams)(),v=(0,a.useSearchParams)(),b={path:r,params:m,query:Object.fromEntries((null==v||null==(e=v.entries)?void 0:e.call(v))||[])},[j,k]=(0,o.useState)(!0),[w,y]=(0,o.useState)(null),[N,_]=(0,o.useState)([]),[L,C]=(0,o.useState)([]),[S,M]=(0,o.useState)(!1);(0,o.useEffect)(()=>{N.length&&(ed={ts:Date.now(),files:N})},[N]);let[V,B]=(0,o.useState)({}),[D,W]=(0,o.useState)(null),[z,I]=(0,o.useState)(!1),[T,R]=(0,o.useState)("all"),[H,A]=(0,o.useState)(""),[E,P]=(0,o.useState)(!1),[F,U]=(0,o.useState)(!1),[O,G]=(0,o.useState)(null),[K,q]=(0,o.useState)(()=>"undefined"!=typeof localStorage&&localStorage.getItem("library_files_view")||"grid");(0,o.useEffect)(()=>{localStorage.setItem("library_files_view",K)},[K]);let[J,Y]=(0,o.useState)(null),[$,Z]=(0,o.useState)(!1),[Q,X]=(0,o.useState)(new Set);function ee(e){Q.has(e)?Q.delete(e):Q.add(e),X(new Set(Q))}async function et(e){Z(!0);try{var t;let{data:s}=await i.I8.getDirectoryTree(e);Y(s.tree),(null==(t=s.tree)?void 0:t.children)&&X(new Set(s.tree.children.filter(e=>"directory"===e.type).map(e=>e.path)))}catch(e){console.error("Failed to load tree:",e),Y(null)}finally{Z(!1)}}async function es(e){let t=e.path||e.key;if(t){P(!0),U(!0),G(null);try{let{data:e}=await i.I8.getFileContent(t);G(e)}catch(r){var s,l;G({name:e.name||t.split("/").pop(),path:t,extension:(e.extension||t.split(".").pop()).toLowerCase(),content:"Error loading file: ".concat((null==(l=r.response)||null==(s=l.data)?void 0:s.detail)||r.message),parsed:null,size:0,line_count:0})}finally{U(!1)}}}function el(){P(!1),G(null)}function er(e){if(!e)return"0 B";let t=["B","KB","MB","GB"],s=0,l=e;for(;l>=1024&&s<t.length-1;)l/=1024,s++;return"".concat(l.toFixed(+(s>0))," ").concat(t[s])}function en(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}let eo=["agent-assets/"];function ea(){let e=(0,u.ey)()||"anon";return"wdv_s3_files_v3_".concat(e)}function ei(e){try{sessionStorage.setItem(ea(),JSON.stringify({ts:Date.now(),files:e}))}catch(e){}}let ed=null,[ec,eu]=(0,o.useState)("types"),[em,ep]=(0,o.useState)(null),[eh,ex]=(0,o.useState)(null),ef="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname,[eg,ev]=(0,o.useState)(ef?"local":"cloud"),[eb,ej]=(0,o.useState)(!1),[ek,ew]=(0,o.useState)(null),[ey,eN]=(0,o.useState)(0),[e_,eL]=(0,o.useState)(null),[eC,eS]=(0,o.useState)("intelli-verse-x-media"),[eM,eV]=(0,o.useState)("working_dir/"),[eB,eD]=(0,o.useState)({bucket:"intelli-verse-x-media",prefix:"working_dir/"}),eW="localhost"!==window.location.hostname&&"127.0.0.1"!==window.location.hostname?"/app/.working_dir":".working_dir",[ez,eI]=(0,o.useState)(()=>"undefined"!=typeof localStorage&&localStorage.getItem("library_local_path")||eW);function eT(e){let t=e.split(".").pop().toLowerCase();return["mp4","mov","avi","mkv","webm"].includes(t)?"video":["jpg","jpeg","png","gif","webp"].includes(t)?"image":["mp3","wav","aac","ogg","m4a"].includes(t)?"audio":["json","txt","md","yaml","yml","csv","log","edl","srt","vtt"].includes(t)?"document":"other"}(0,o.useEffect)(()=>{localStorage.setItem("library_local_path",ez)},[ez]);let eR="data:image/svg+xml,"+encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" width="400" height="225" viewB
1ox="0 0 400 225">\n <defs>\n <linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#f0e6ff"/>\n <stop offset="50%" style="stop-color:#e0e7ff"/>\n <stop offset="100%" style="stop-color:#dbeafe"/>\n </linearGradient>\n </defs>\n <rect fill="url(#g)" width="400" height="225" rx="12"/>\n <circle cx="200" cy="100" r="28" fill="none" stroke="#8b5cf6" stroke-width="2" opacity="0.3"/>\n <polygon points="192,88 192,112 212,100" fill="#8b5cf6" opacity="0.3"/>\n <text x="200" y="145" text-anchor="middle" font-family="system-ui" font-size="11" fill="#8b5cf6" opacity="0.5">No preview</text>\n</svg>\n'),[eH,eA]=(0,o.useState)({}),eE=(0,o.useRef)(new Set),eP=(0,o.useCallback)(async(e,t)=>{if("cloud"===eg)return;let s="".concat(e,":").concat(t);if(!eE.current.has(s)){eE.current.add(s);try{let s=(0,i.Gi)(),l=await fetch("".concat(s,"/local/run-thumbnail?run_path=").concat(encodeURIComponent(t))).then(e=>e.json()),r=(null==l?void 0:l.data)||l;if(null==r?void 0:r.thumbnail){let t,l=r.thumbnail,n=r.media_type||"image";t=l.startsWith("http")?l:l.startsWith("/api/")||l.startsWith("/local/")?"".concat(s).concat(l.startsWith("/api")?l.replace("/api",""):l):"".concat(s,"/local/file?path=").concat(encodeURIComponent(l)),eA(s=>({...s,[e]:{url:t,mediaType:n}}))}}catch(e){}}},[eg]);function eF(){for(let l of eG){var e,t,s;if(null==(e=eH[l.runId])?void 0:e.url)continue;if(null==(t=l.thumbnail)?void 0:t.url){let e="video"===l.thumbnail.type?"video":"image";eH[l.runId]={url:l.thumbnail.url,mediaType:e};continue}let r=null==(s=l.files)?void 0:s.find(e=>"image"===e.type||"video"===e.type);(null==r?void 0:r.url)&&(eH[l.runId]={url:r.url,mediaType:r.type||"image"})}}function eU(e){var t;if(!(null==e||null==(t=e.runs)?void 0:t.length))return null;for(let t of e.runs)if(t._previewUrl)return{kind:t._previewKind||"image",url:t._previewUrl};return null}function eO(e){return(null==e?void 0:e._previewUrl)?{kind:e._previewKind||"image",url:e._previewUrl}:null}let eG=(0,o.useMemo)(()=>{let e={};N.forEach(t=>{let s=String(t.key||"").replace(/\\/g,"/"),l=function(e){let t=String(e||"").replace(/\\/g,"/").split("/").filter(Boolean);t[0]&&/^[a-zA-Z]:$/.test(t[0])&&t.shift();let s=/(?:run_)?(\d{8}_\d{6})(?:_([a-f0-9]{8}))?/i,l=-1,r="",n="";for(let e=0;e<t.length;e++){let o=t[e].match(s);if(o){l=e,r=o[1],n=o[2]||"";break}}let o=null,a=l>=0?l:t.length-1;for(let e=a;e>=0&&!(o=f(t[e]));e--);if(!o&&l>=0&&(o=function(e){let t=f(e);
1if(t)return t;let s=String(e||"").toLowerCase().replace(/-/g,"_");for(let e of x)if(s.startsWith(e+"_"))return e;return null}(t[l])),!o)return{runId:"",rawType:"",pipelineId:null,pipelineType:"",date:null,dateStr:"",shortDate:"",hash:"",folderPath:""};let i=l>=0?t[l]:t[t.length-1]||o,d=null,u="Date not available",m="â";if(r.length>=13){let e=r.substring(0,4),t=r.substring(4,6),s=r.substring(6,8),l=r.substring(9,11),n=r.substring(11,13);u=(d=new Date("".concat(e,"-").concat(t,"-").concat(s,"T").concat(l,":").concat(n,":00"))).toLocaleString(),m="".concat(t,"/").concat(s," ").concat(l,":").concat(n)}return{runId:i,rawType:o,pipelineId:o,pipelineType:(0,c.cb)(o),date:d,dateStr:u,shortDate:m,hash:n,folderPath:(l>=0?t.slice(0,l+1):t).join("/")}}(s);if(!l.pipelineId)return;let r=l.runId;e[r]||(e[r]={...l,files:[],videos:0,images:0,audios:0,documents:0,thumbnail:null});let n=eT(s);if(t.type=n,e[r].files.push(t),"video"===n)e[r].videos++,e[r].thumbnail||(e[r].thumbnail=t);else if("image"===n){e[r].images++;let l=s.split("/").pop(),n=s.toLowerCase(),o=n.includes("first_frame")&&!n.includes("debug"),a=n.includes("/production/")&&o,i=function(e){let t=e.toLowerCase();return t.includes("first_frame")||t.includes("thumb")||t.includes("cover")||t.includes("poster")||t.includes("preview")||t.includes("hero")}(l),d=a&&n.includes("scene_0"),c=e[r].thumbnail;c&&!d&&(!a||c._isScene0)&&(!o||c._isProduction||c._isScene0)&&(!i||c._isFirstFrame||c._isProduction)&&("image"===c.type||c._isFirstFrame)||(e[r].thumbnail={...t,_isScene0:d,_isProduction:a,_isFirstFrame:o})}else"audio"===n?e[r].audios++:"document"===n&&e[r].documents++});let t=Object.values(e);return t.forEach(e=>{var t;if(null==(t=e.thumbnail)?void 0:t.url)e._previewUrl=e.thumbnail.url,e._previewKind=e.thumbnail.type||"image";else{let t=e.files.find(e=>"image"===e.type||"video"===e.type);(null==t?void 0:t.url)&&(e._previewUrl=t.url,e._previewKind=t.type||"image")}}),t.sort((e,t)=>e.date&&t.date?t.date.getTime()-e.date.getTime():e.date?-1:t.date?1:e.runId.localeCompare(t.runId))},[N]);(0,o.useEffect)(()=>{if(null==eG?void 0:eG.length)for(let t of eG){let s;if(void 0===eH[t.runId]){if("cloud"===eg&&t.folderPath)s=t.folderPath.startsWith("working_dir")?"."+t.folderPath:".working_dir/"+t.folderPath;else if(t.folderPath)s=t.folderPath.startsWith("/")?t.folderPath:ez+"/"+t.folderPath;else{var e;let l=t.rawType||(null==(e=t.pipelineType)?void 0:e.toLowerCase().replace(/ /g,"_")),r="cloud"===eg?".working_dir":ez;s="".concat(r,"/").concat(l,"/").concat(t.runId)}eP(t.runId,s)}}},[eG,eg,ez,eH,eP]);let eK=(0,o.useMemo)(()=>{let e={};return eG.forEach(t=>{let s=t.pipelineType;e[s]||(e[s]={name:s,runs:[],totalFiles:0,totalVideos:0,totalImages:0,totalAudios:0,totalDocuments:0,thumbnail:null,latestDate:null}),e[s].runs.push(t),e[s].totalFiles+=t.files.length,e[s].totalVideos+=t.videos,e[s].totalImages+=t.images,e[s].totalAudios+=t.audios,e[s].totalDocuments+=t.documents||0,!e[s].thumbnail&&t.thumbnail&&(e[s].thumbnail=t.thumbnail),t.date&&(!e[s].latestDate||t.date>e[s].latestDate)&&(e[s].latestDate=t.date)}),Object.values(e).sort((e,t)=>e.latestDate&&t.latestDate?t.latestDate.getTime()-e.latestDate.getTime():e.latestDate?-1:t.latestDate?1:e.name.localeCompare(t.name))},[eG]);(0,o.useEffect)(()=>{if(j||eK.length)return;let e=!1;return M(!0),(async()=>{try{let t=await i.aW.listTasks({limit:100}).catch(()=>null),s=(null==t?void 0:t.data)||{},l=(0,u.ed)(Object.entries(s).map(e=>{let[t,s]=e;return{...s,id:String((null==s?void 0:s.id)||(null==s?void 0:s.task_id)||t)}}),{requireUserStamp:!0});l.sort((e,t)=>(h(t.created_at)||0)-(h(e.created_at)||0)),e||C(l)}finally{e||M(!1)}})(),()=>{e=!0}},[j,eK.length]);let eq=(0,o.useMemo)(()=>{if(!em)return[];let e=eK.find(e=>e.name===em);return e?e.runs:[]},[em,eK]),eJ=(0,o.useMemo)(()=>{if(!eh)return[];let e=eG.find(e=>e.runId===eh);if(!e)return[];let t=e.files;if("all"!==T&&(t=t.filter(e=>e.type===T)),H.trim()){let e=H.trim().toLowerCase();t=t.filter(t=>{let s=(t.key||"").split("/").pop().toLowerCase(),l=(t.key||"").toLowerCase();return s.includes(e)||l.includes(e)})}return t},[eh,eG,T,H]),eY=(0,o.useMemo)(()=>
1{if(!eh)return[];let e=eG.find(e=>e.runId===eh);return e?e.files:[]},[eh,eG]),[e$,eZ]=(0,o.useState)(""),[eQ,eX]=(0,o.useState)(""),[e0,e2]=(0,o.useState)(()=>"undefined"!=typeof localStorage&&"true"===localStorage.getItem("library_flat_view"));(0,o.useEffect)(()=>{localStorage.setItem("library_flat_view",e0?"true":"false")},[e0]);let e1=(0,o.useMemo)(()=>eK.map(e=>e.name).sort(),[eK]),e4=(0,o.useMemo)(()=>{let e=eK;if(eQ&&(e=e.filter(e=>e.name===eQ)),e$.trim()){let t=e$.trim().toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t))}return e},[eK,eQ,e$]),e5=(0,o.useMemo)(()=>{let e=eG;if(eQ&&(e=e.filter(e=>e.pipelineType===eQ)),e$.trim()){let t=e$.trim().toLowerCase();e=e.filter(e=>e.pipelineType.toLowerCase().includes(t)||e.runId.toLowerCase().includes(t))}return e},[eG,eQ,e$]),e3=(0,o.useMemo)(()=>eK.length,[eK]),e6=(0,o.useMemo)(()=>eG.length,[eG]),e8=(0,o.useMemo)(()=>N.length,[N]),e7=(0,o.useMemo)(()=>N.filter(e=>"video"===eT(e.key)).length,[N]),e9={"Short Movies":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>',"Shortmovie video":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>',Movies:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z"/>',Videos:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>',Ads:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/>',"Ad Banners":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>',Documentaries:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>',Songs:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"/>',"Music Videos":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"/>',"Kids Movies":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>',"Learning Series":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 14l9-5-9-5-9 5 9 5z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"/>',Lyrics:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>',Podcasts:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"/>',"TV Series":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>',"YouTube Shorts":'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10 11l4-2v4l-4-2z"/>',Other:'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>'},te=(0,o.useCallback)(()=>{ep(null),ex(null),eu("types"),window.history.replaceState({libraryShelf:"types"},"","/contentx/working-dir")},[]),tt=(0,o.useCallback)(()=>{R("all"),A(""),ex(null),eu("runs");let e=g(em||"");window.history.replaceState({libraryShelf:e},"","/contentx/working-dir#".concat(e))},[em]),ts=(0,o.useCallback)(()=>{let e=(null==v?void 0:v.get("type"))||"",t=(null==v?void 0:v.get("run"))||"",s=Array.isArray(m.type)?m.type[0]:m.type||"",l=Array.isArray(m.runId)?m.runId[0]:m.runId||"",r=e||s,n=t||l;if(r&&n){let e=eK.find(e=>g(e.name)===g(String(r)));e&&(ep(e.name),ex(String(n)),eu("files"))}else if(r){let e=eK.find(e=>g(e.name)===g(String(r)));e&&(ep(e.name),ex(null),eu("runs"))}else e||s||window.location.hash||(ep(null),ex(null),eu("types"))},[m.type,m.runId,v,eK]);(0,o.useEffect)(()=>{ts()},[ts]),(0,o.useEffect)(()=>{let e=()=>{let e=window.location.hash.replace(/^#/,"");if("/contentx/working-dir"!==window.location.pathname.replace(/\/$/,""))return;if(!e){ep(null),ex(null),eu("types");return}let t=eK.find(t=>g(t.name)===g(decodeURIComponent(e)));t&&(ep(t.name),ex(null),eu("runs"))};return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[eK]);let tl=(0,o.useMemo)(()=>{let e=[{label:"Library",action:te}];if(em&&e.push({label:em,action:tt}),eh){let t=eG.find(e=>e.runId===eh);e.push({label:(null==t?void 0:t.shortDate)||eh,action:null})}return e},[em,eh,eG,tt,te]);async function tr(){try{let{data:e}=await i.I8.getS3Config();eD(e||eB),eC||eS(e.bucket||"intelli-verse-x-media"),eM||eV(e.working_dir_prefix||"working_dir/")}catch(e){console.error("Failed to load S3 config:",e),eC||eS("intelli-verse-x-media"),eM||eV("working_dir/")}}async function tn(){var e,t,s,l,r;let n=!(arguments.length>0)||void 0===arguments[0]||arguments[0];y(null);let o=(null==(e=b.query)?void 0:e.type)||(null==(t=b.params)?void 0:t.type);n&&!o&&(eu("types"),ep(null),ex(null));let a="cloud"===eg?function(){try{let e=sessionStorage.getItem(ea());if(!e)return null;let{ts:t,files:s}=JSON.parse(e);if(Date.now()-t>3e5)return sessionStorage.removeItem(ea()),null;return{ts:t,files:s}}catch(e){return null}}():ed&&Date.now()-ed.ts<3e5?ed:null;if(a&&(null==(s=a.files)?void 0:s.length)){_(a.files),W(a.ts),k(!1),"cloud"===eg&&(queueMicrotask(eF),to());return}k(!0);try{"cloud"===eg?await tc():await tu()}catch(e){y((null==(r=e.response)||null==(l=r.data)?void 0:l.detail)||e.message||String(e))}finally{k(!1)}}async function to(){try{"cloud"===eg?await tc():await tu()}catch(e){}}async function ta(){sessionStorage.removeItem(ea()),ed=null,W(null),k(!0),y(null);try{"cloud"===eg?await tc():await tu()}catch(s){var e,t;y((null==(t=s.response)||null==(e=t.data)?void 0:e.detail)||s.message||String(s))}finally{k(!1)}}function ti(){let e=(eM||"working_dir/").replace(/\/?$/,"/"),t=eo.map(e=>e.replace(/\/?$/,"/")).filter(t=>t!==e);return[e,...t]}async function td(e,t){let{data:s}
1=await i.I8.listS3({prefix:e,max_keys:5e3,absolute:!0,media_only:!0,presign:t,presign_expires:7200});return s.objects||s.files||[]}async function tc(){let e=(0,i.Gi)();try{let{data:t}=await i.aW.listMyWorkingDir({max_tasks:80,max_objects:2e3,presign_expires:7200}),s=(null==t?void 0:t.objects)||(null==t?void 0:t.files)||[];if(Array.isArray(s)){let t=new Set,l=[];for(let r of s)!(null==r?void 0:r.key)||t.has(r.key)||(t.add(r.key),l.push({...r,key:r.key,source:"cloud",url:r.url||"".concat(e,"/s3-proxy/").concat(r.key)}));_(l),W(Date.now()),ei(l),console.log("Loaded ".concat(l.length," media files from my-working-dir (user-scoped)")),queueMicrotask(eF);return}}catch(e){console.warn("my-working-dir unavailable; falling back to prefix list",e)}let t=ti(),s=await Promise.all(t.map(e=>td(e,!1).catch(()=>[]))),l=new Set,r=[];for(let t of s)for(let s of t)!(null==s?void 0:s.key)||l.has(s.key)||(l.add(s.key),r.push({...s,key:s.key,source:"cloud",url:s.url||"".concat(e,"/s3-proxy/").concat(s.key)}));_(r),W(Date.now()),ei(r),console.log("Loaded ".concat(r.length," media files from S3 (").concat(t.join(", "),")")),Promise.all(ti().map(e=>td(e,!0).catch(()=>[]))).then(e=>{let t=(0,i.Gi)(),s={};for(let t of e)for(let e of t)(null==e?void 0:e.key)&&e.url&&(s[e.key]=e.url);_(e=>{let l=e.map(e=>({...e,url:s[e.key]||e.url||"".concat(t,"/s3-proxy/").concat(e.key)}));return ei(l),l}),queueMicrotask(eF)}).catch(()=>{})}async function tu(){var e,t,s,l;try{let{data:t}=await i.I8.listLocal({path:ez}),s=null;try{let t=await i.aW.listMyWorkingDir({max_tasks:80,max_objects:1,presign_expires:600}),l=null==t||null==(e=t.data)?void 0:e.task_ids;Array.isArray(l)&&l.length&&(s=new Set(l.map(e=>String(e))))}catch(e){}if(t.files&&t.files.length>0){let e=t.files.map(e=>({...e,key:e.key||e.name||e.path,source:"local",url:"".concat((0,i.Gi)(),"/local/file?path=").concat(encodeURIComponent(e.path))}));s&&(e=e.filter(e=>{let t=String(e.key||e.path||"");for(let e of s)if(t.includes(e))return!0;return!1})),_(e),ed={ts:Date.now(),files:e}}else _([]),ed=null;W(Date.now())}catch(e){console.log("Local file listing failed:",e.message),(null==ed||null==(t=ed.files)?void 0:t.length)||(y("Local listing failed: ".concat((null==(l=e.response)||null==(s=l.data)?void 0:s.detail)||e.message,". Make sure the working_dir is mounted.")),_([]))}}let[tm,tp]=(0,o.useState)({});async function th(e){var t,l,r,n;let o=e.key;V[o]="importing",tm[o]=0,y(null);try{if("cloud"===e.source){tm[o]=30;let{data:e}=await d.s3.import({bucket:eC,s3_keys:[o],collection_id:"default"});if(tm[o]=100,e.imported&&e.imported.length>0)V[o]="success",setTimeout(()=>{s.push("/director?video_id=".concat(encodeURIComponent(e.imported[0].videodb_id)))},500);else throw Error((null==(l=e.failed)||null==(t=l[0])?void 0:t.error)||"Import failed")}else{let t=o.split("/").pop();tm[o]=10;let l=await fetch(e.url);if(!l.ok)throw Error("Failed to fetch local file");tm[o]=30;let r=await l.blob(),n=new File([r],t,{type:r.type||"video/mp4"});tm[o]=40;let{data:a}=await d.Gh.upload("default",{file:n},e=>{tm[o]=40+Math.round(.5*e)});if(tm[o]=100,a.id)V[o]="success",setTimeout(()=>{s.push("/director?video_id=".concat(encodeURIComponent(a.id)))},500);else throw Error("Upload succeeded but no video ID returned")}}catch(t){V[o]="failed",tm[o]=0;let e=(null==(n=t.response)||null==(r=n.data)?void 0:r.message)||t.message||String(t);e.includes("VIDEO_DB")||e.includes("videodb")||e.includes("not configured")?y("VideoDB not configured. Add VIDEO_DB_API_KEY to your .env file (get key from videodb.io)"):y(e),console.error("Failed to import file:",t)}}return(0,o.useEffect)(()=>{(async()=>{tr(),await tn()})()},[]),(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:p().page,children:[(0,l.jsxs)("div",{className:p().header,children:["types"!==ec?(0,l.jsx)("nav",{className:p().crumbs,children:tl.map((e,t)=>(0,l.jsxs)("span",{className:p().crumb,children:[t>0?(0,l.jsx)("span",{className:p().crumbSep,"aria-hidden":"true",children:"/"}):null,e.action&&t<tl.length-1?(0,l.jsx)("button",{type:"button",onClick:()=>{var t;null==(t=e.action)||t.call(e)},className:p().crumbBtn,children:e.label}):(0,l.jsx)("span",{className:p().crumbNow,children:e.label})]},e.label+t))}):null,(0,l.jsxs)("div",{className:p().titleRow,children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:p().title,children:"runs"===ec?em||"Runs":"files"===ec?(null==(t=eG.find(e=>e.runId===eh))?void 0:t.shortDate)||"Run":"Library"}),(0,l.jsx)("p",{className:p().subtitle,children:"runs"===ec?"".concat(eq.length," pi
1peline runs"):"files"===ec?"".concat(eY.length," files"):"Browse your projects by type"}),"files"===ec&&eh?(0,l.jsxs)("div",{className:p().runId,children:[(0,l.jsx)("span",{className:p().runIdLabel,children:"Run ID"}),(0,l.jsx)("code",{className:p().runIdCode,children:eh}),(0,l.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(eh),I(!0),setTimeout(()=>I(!1),2e3)},className:p().iconBtn,title:"Copy Run ID",children:z?(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}):(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}):null]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[D&&!j?(0,l.jsx)("span",{className:"text-[11px] font-medium text-[#7a766b] hidden sm:inline",children:function(e){if(!e)return"";let t=Math.floor((Date.now()-e)/1e3);if(t<5)return"just now";if(t<60)return"".concat(t,"s ago");let s=Math.floor(t/60);return s<60?"".concat(s,"m ago"):"".concat(Math.floor(s/60),"h ago")}(D)}):null,(0,l.jsx)("button",{type:"button",onClick:ta,disabled:j,className:p().iconBtn,title:"Refresh",children:(0,l.jsx)("svg",{className:["w-5 h-5",j?"animate-spin":""].filter(Boolean).join(" "),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),(0,l.jsxs)("div",{className:p().stats,children:[(0,l.jsxs)("div",{className:p().stat,children:[(0,l.jsx)("div",{className:p().statLabel,children:"Content Types"}),(0,l.jsx)("div",{className:p().statValue,children:e3})]}),(0,l.jsxs)("div",{className:p().stat,children:[(0,l.jsx)("div",{className:p().statLabel,children:"Runs"}),(0,l.jsx)("div",{className:p().statValue,children:e6})]}),(0,l.jsxs)("div",{className:p().stat,children:[(0,l.jsx)("div",{className:p().statLabel,children:"Videos"}),(0,l.jsx)("div",{className:p().statValue,children:e7})]}),(0,l.jsxs)("div",{className:p().stat,children:[(0,l.jsx)("div",{className:p().statLabel,children:"Total Files"}),(0,l.jsx)("div",{className:p().statValue,children:e8})]})]})]}),(0,l.jsxs)("div",{className:p().body,children:[eb&&e_?(0,l.jsxs)("div",{className:"mb-6 p-5 bg-gradient-to-r from-violet-50 via-purple-50 to-fuchsia-50 border border-purple-200/60 rounded-2xl shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,l.jsxs)("span",{className:"font-bold text-purple-800 flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-pulse"}),"Syncing to S3..."]}),(0,l.jsxs)("span",{className:"text-sm font-bold text-purple-600 bg-purple-100 px-3 py-1 rounded-full",children:[ey,"%"]})]}),(0,l.jsx)("div",{className:"w-full bg-purple-200/50 rounded-full h-2 mb-3 overflow-hidden",children:(0,l.jsx)("div",{className:"bg-gradient-to-r from-violet-500 via-purple-500 to-fuchsia-500 h-2 rounded-full transition-all duration-500 ease-out",style:{width:ey+"%"}})}),(0,l.jsxs)("div",{className:"flex items-center gap-4 text-xs text-purple-700 font-medium",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),e_.uploaded," uploaded"]}),(0,l.jsxs)("span",{children:[e_.skipped," skipped"]}),e_.failed?(0,l.jsxs)("span",{className:"text-red-600",children:[e_.failed," failed"]}):null,(0,l.jsx)("span",{className:"text-purple-400 truncate flex-1 font-mono text-[11px]",children:e_.current})]})]}):null,(0,l.jsxs)("details",{className:"bg-white rounded-2xl border border-slate-200/60 mb-6 shadow-sm",children:[(0,l.jsxs)("summary",{className:"p-3 sm:p-4 cursor-pointer flex items-center justify-between hover:bg-slate-50/50 rounded-2xl transition-colors gap-2 min-h-[44px]",children:[(0,l.jsxs)("span",{className:"text-sm font-semibold text-slate-700 flex items-center gap-2 min-w-0",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-slate-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,l.jsxs)("span",{className:"flex-shrink-0",children:["cloud"===eg?"S3 Path":"Local Path",":"]}
1),(0,l.jsx)("code",{className:"text-xs bg-slate-100 text-slate-600 px-2 sm:px-3 py-1 rounded-lg font-mono border border-slate-200 truncate max-w-[140px] sm:max-w-xs lg:max-w-none",children:"cloud"===eg?"s3://".concat(eC,"/").concat(eM):ez})]}),(0,l.jsx)("svg",{className:"w-4 h-4 text-slate-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),(0,l.jsxs)("div",{className:"p-3 sm:p-4 pt-0 border-t border-slate-100",children:["cloud"===eg?(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,l.jsxs)("span",{className:"text-xs sm:text-sm text-slate-500 bg-slate-50 px-3 py-2 rounded-xl border border-slate-200 font-mono truncate",children:["s3://",eC,"/"]}),(0,l.jsx)("input",{className:"flex-1 rounded-xl border border-slate-200 px-3 sm:px-4 py-2.5 text-sm focus:border-purple-400 focus:ring-2 focus:ring-purple-100 focus:outline-none font-mono transition-all min-h-[44px]",placeholder:"working_dir/",onKeyDown:e=>{"Enter"===e.key&&tn()},value:null!=eM?eM:"",onChange:e=>eV(e.target.value)})]}):null,(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsx)("input",{className:"flex-1 rounded-xl border border-slate-200 px-3 sm:px-4 py-2.5 text-sm focus:border-purple-400 focus:ring-2 focus:ring-purple-100 focus:outline-none font-mono transition-all min-h-[44px]",placeholder:"/path/to/working_dir",onKeyDown:e=>{"Enter"===e.key&&tn()},value:null!=ez?ez:"",onChange:e=>eI(e.target.value)})})]})]}),w?(0,l.jsxs)("div",{className:"mb-6 p-4 bg-gradient-to-r from-red-50 to-rose-50 border border-red-200/60 rounded-2xl text-red-700 flex items-center justify-between shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-xl bg-red-100 flex items-center justify-center flex-shrink-0",children:(0,l.jsx)("svg",{className:"w-5 h-5 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsx)("span",{className:"font-medium text-sm",children:w})]}),(0,l.jsx)("button",{onClick:e=>{y(null)},className:"w-8 h-8 rounded-lg hover:bg-red-100 flex items-center justify-center text-red-400 hover:text-red-600 transition-colors text-lg font-bold",children:"\xd7"})]}):null,j?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-24",children:[(0,l.jsx)("div",{className:p().spinner}),(0,l.jsxs)("p",{className:"mt-6 text-[#7a766b] font-medium",children:["Scanning ","cloud"===eg?"cloud storage":"local directory","..."]})]}):null,"types"===ec&&eK.length?(0,l.jsx)("div",{className:p().filterBar,children:(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0
1w-full sm:w-auto sm:min-w-[180px] relative group",children:[(0,l.jsx)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#7a766b] group-focus-within:text-[#C8720E] transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,l.jsx)("input",{type:"text",className:"w-full rounded-xl border border-[#d8d3c6] pl-10 pr-3 py-2.5 text-sm text-[#15140f] placeholder-[#7a766b] focus:border-[#C8720E] focus:ring-2 focus:ring-[#FCE9CC] focus:outline-none transition-all",placeholder:"Search library...",value:null!=e$?e$:"",onChange:e=>eZ(e.target.value)})]}),(0,l.jsxs)("select",{className:"rounded-xl border border-[#d8d3c6] px-3 py-2.5 text-sm text-[#15140f] bg-white focus:border-[#C8720E] focus:ring-2 focus:ring-[#FCE9CC] focus:outline-none min-w-[150px]",value:null!=eQ?eQ:"",onChange:e=>eX(e.target.value),children:[(0,l.jsx)("option",{value:"",children:"All Pipeline Types"}),e1.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]}),(0,l.jsxs)("div",{className:"flex items-center gap-1 bg-[#f1eee6] rounded-xl p-1",children:[(0,l.jsx)("button",{type:"button",onClick:e=>{e2(!1)},className:["px-3 py-2 rounded-lg text-xs font-semibold transition-all",!e0?"bg-white text-[#C8720E] shadow-sm":"text-[#7a766b] hover:text-[#15140f]"].filter(Boolean).join(" "),children:"By Type"}),(0,l.jsx)("button",{type:"button",onClick:e=>{e2(!0)},className:["px-3 py-2 rounded-lg text-xs font-semibold transition-all",e0?"bg-white text-[#C8720E] shadow-sm":"text-[#7a766b] hover:text-[#15140f]"].filter(Boolean).join(" "),children:"All Runs"})]}),e$||eQ?(0,l.jsx)("button",{onClick:()=>{eZ(""),eX("")},className:"px-3 py-2 rounded-xl text-xs font-semibold text-rose-600 bg-rose-50 hover:bg-rose-100 transition-colors",children:"Clear"}):null]})}):null,"types"===ec&&e0&&e5.length?(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-5 lg:grid-cols-3",children:e5.map((e,t)=>{var r,n;return(0,l.jsxs)("div",{onClick:t=>{s.push("/contentx/run/".concat(encodeURIComponent(e.rawType||e.pipelineType.toLowerCase().replace(/ /g,"_")),"/").concat(encodeURIComponent(e.runId)))},onMouseEnter:t=>{(0,i.ze)(e.runId)},className:"group "+p().card,style:{animationDelay:30*t+"ms"},children:[(0,l.jsxs)("div",{className:"relative aspect-video overflow-hidden "+p().thumb,children:[(0,l.jsx)("img",{alt:"",src:(null==(r=eO(e))?void 0:r.url)||eR,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy",onError:e=>{e.currentTarget.src=eR}}),(0,l.jsx)("video",{src:(null==(n=eO(e))?void 0:n.url)||eR,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",preload:"metadata",muted:!0,onLoadedData:e=>{e.currentTarget.currentTime=1},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,l.jsx)("img",{alt:"",src:eR,className:"w-full h-full object-cover"})}),(0,l.jsx)("div",{className:"absolute top-3 left-3 px-2.5 py-1 bg-black/50 backdrop-blur-md text-white text-[11px] rounded-full font-bold border border-white/10",children:e.pipelineType}),(0,l.jsxs)("div",{className:"absolute bottom-3 right-3 flex gap-1.5",children:[e.videos?(0,l.jsxs)("span",{className:"px-2 py-1 bg-blue-500/90 backdrop-blur-sm text-white text-[10px] rounded-full font-bold",children:[e.videos," vid"]}):null,e.images?(0,l.jsxs)("span",{className:"px-2 py-1 bg-emerald-500/90 backdrop-blur-sm text-white text-[10px] rounded-full font-bold",children:[e.images," img"]}):null,e.audios?(0,l.jsxs)("span",{className:"px-2 py-1 bg-violet-500/90 backdrop-blur-sm text-white text-[10px] rounded-full font-bold",children:[e.audios," aud"]}):null]})]}),(0,l.jsxs)("div",{className:"p-3 sm:p-4",children:[(0,l.jsx)("h3",{className:"font-bold text-slate-900 text-xs sm:text-sm",children:e.dateStr}),(0,l.jsxs)("p",{className:"text-[10px] sm:text-[11px] text-slate-400 truncate font-mono mt-1",title:e.runId,children:[e.runId.slice(0,30),"..."]}),(0,l.jsxs)("span",{className:"text-[10px] sm:text-xs font-bold text-slate-500 bg-slate-100 px-2 py-0.5 rounded-full mt-2 inline-block",children:[e.files.length," files"]})]})]},e.runId)})}):null,!j&&"types"===ec&&e0&&eK.length>0&&!e5.length?(0,l.jsxs)("div",{className:p().empty,children:[(0,l.jsx)("p",{className:"text-lg font-semibold text-[#15140f]",children:"No runs match your filters"}),(0,l.jsx)("p",{className:"text-sm mt-1",children:"Try adjusting your search or pipeline type filter"})]}):null,"types"!==ec||e0?null:(0,l.jsx)("div",{className:p().grid+" "+p().gridWide,children:e4.map((e,t)=>{var s,r;return(0,l.jsxs)("div",{onClick:t=>{var s=e.name;ep(s),ex(null),eu("runs");let l=g(s);window.history.pushState({libraryShelf:l},"","/contentx/working-dir#".concat(l))},className:"group "+p().card,style:{animationDelay:50*t+"ms"},children:[(0,l.jsxs)("div",{className:"relative aspect-[16/10] overflow-hidden "+p().thumb,children:[(0,l.jsx)("img",{alt:"",src:(null==(s=eU(e))?void 0:s.url)||eR,className:"pointer-events-none w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy",onError:e=>{e.currentTarget.src=eR}}),(0,l.jsx)("video",{src:(null==(r=eU(e))?void 0:r.url)||eR,className:"pointer-events-none w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",preload:"metadata",muted:!0,onLoadedData:e=>{e.currentTarget.currentTime=1},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,l.jsx)("img",{alt:"",src:eR,className:"w-full h-full object-cover"})}),(0,l.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 via-trans
1parent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),(0,l.jsxs)("div",{className:"absolute top-3 right-3 px-3 py-1.5 bg-black/50 backdrop-blur-md text-white text-xs rounded-full font-bold border border-white/10",children:[e.runs.length," ",1===e.runs.length?"run":"runs"]}),(0,l.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all duration-300",children:(0,l.jsx)("span",{className:p().browse,children:"Browse â"})})]}),(0,l.jsx)("div",{className:"p-3 sm:p-5",children:(0,l.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,l.jsx)("div",{className:p().typeIcon,children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",dangerouslySetInnerHTML:{__html:e9[e.name]||'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>'}})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h3",{className:"font-bold text-slate-900 text-sm sm:text-base truncate",children:e.name}),(0,l.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 mt-1 sm:mt-1.5 flex-wrap",children:[e.totalVideos?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-semibold text-blue-600 bg-blue-50 px-2 py-0.5 rounded-full",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),e.totalVideos]}):null,e.totalImages?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-semibold text-emerald-600 bg-emerald-50 px-2 py-0.5 rounded-full",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),e.totalImages]}):null,e.totalAudios?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-semibold text-violet-600 bg-violet-50 px-2 py-0.5 rounded-full",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})}),e.totalAudios]}):null,e.totalDocuments?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-semibold text-amber-600 bg-amber-50 px-2 py-0.5 rounded-full",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),e.totalDocuments]}):null]})]})]})})]},e.name)})}),j||"types"!==ec||e0||!(eK.length>0)||e4.length?null:(0,l.jsxs)("div",{className:p().empty,children:[(0,l.jsx)("p",{className:"text-lg font-semibold text-[#15140f]",children:"No content types match your filters"}),(0,l.jsx)("p",{className:"text-sm mt-1",children:"Try adjusting your search or pipeline type filter"})]}),"runs"===ec?(0,l.jsx)("div",{className:p().grid,children:eq.map((e,t)=>{var r,n;return(0,l.jsxs)("div",{onClick:t=>{s.push("/contentx/run/".concat(encodeURIComponent(e.rawType||e.pipelineType.toLowerCase().replace(/ /g,"_")),"/").concat(encodeURIComponent(e.runId)))},onMouseEnter:t=>{(0,i.ze)(e.runId)},className:"group "+p().card,style:{animationDelay:50*t+"ms"},children:[(0,l.jsxs)("div",{className:"relative aspect-video overflow-hidden "+p().thumb,children:[(0,l.jsx)("img",{alt:"",src:(null==(r=eO(e))?void 0:r.url)||eR,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy",onError:e=>{e.currentTarget.src=eR}}),(0,l.jsx)("video",{src:(null==(n=eO(e))?void 0:n.url)||eR,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",preload:"metadata",muted:!0,onLoadedData:e=>{e.currentTarget.currentTime=1},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,l.jsx)("img",{alt:"",src:eR,className:"w-full h-full object-cover"})}),(0,l.jsxs)("div",{className:"absolute bottom-3 right-3 flex gap-1.5",children:[e.videos?(0,l.jsxs)("span",{className:"px-2.5 py-1 bg-blue-500/90 backdrop-blur-sm text-white text-[11px] rounded-full font-bold flex items-center gap-1",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),e.videos]}):null,e.images?(0,l.jsxs)("span",{className:"px-2.5 py-1 bg-emerald-500/90 backdrop-blur-sm text-white text-[11px] rounded-full font-bold flex items-center gap-1",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),e.images]}):null,e.audios?(0,l.jsxs)("span",{className:"px-2.5 py-1 bg-violet-500/90 backdrop-blur-sm text-white text-[11px] rounded-full font-bold flex items-center gap-1",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19V6l12-3v13"})}),e.audios]}):null,e.documents?(0,l.jsxs)("span",{className:"px-2.5 py-1 bg-amber-500/90 backdrop-blur-sm text-white text-[11px] rounded-full font-bold flex items-center gap-1",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),e.documents]}):null]}),(0,l.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 via-trans
1parent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center",children:(0,l.jsx)("span",{className:p().browse,children:"View Run Details â"})})]}),(0,l.jsxs)("div",{className:"p-3 sm:p-5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2 sm:mb-3",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h3",{className:"font-bold text-slate-900 text-xs sm:text-sm",children:e.dateStr}),(0,l.jsxs)("p",{className:"text-[10px] sm:text-[11px] text-slate-400 truncate font-mono mt-1",title:e.runId,children:[e.runId.slice(0,30),"..."]})]}),(0,l.jsx)("div",{className:"text-right flex-shrink-0 ml-2 sm:ml-3",children:(0,l.jsxs)("span",{className:"text-[10px] sm:text-xs font-bold text-slate-500 bg-slate-100 px-2 sm:px-3 py-1 rounded-full",children:[e.files.length," files"]})})]}),(0,l.jsxs)("div",{className:"flex gap-1.5 sm:gap-2",children:[(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation();var l=e.runId;s.push("/contentx/working-dir/".concat(g(em||""),"/").concat(encodeURIComponent(l)));let r=eG.find(e=>e.runId===l);(null==r?void 0:r.folderPath)&&"local"===eg&&et(ez+"/"+r.folderPath)},className:"flex-1 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] text-[11px] sm:text-xs font-bold bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-xl transition-all duration-200 flex items-center justify-center gap-1 sm:gap-1.5",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),"Files"]}),(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),s.push("/contentx/run/".concat(encodeURIComponent(e.rawType||e.pipelineType.toLowerCase().replace(/ /g,"_")),"/").concat(encodeURIComponent(e.runId)))},className:"flex-1 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] text-[11px] sm:text-xs font-bold bg-[#FCE9CC] hover:bg-[#f6d7a8] text-[#C8720E] rounded-xl transition-all duration-200 flex items-center justify-center gap-1 sm:gap-1.5",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Details"]})]})]})]},e.runId)})}):null,"files"===ec?(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 sm:gap-4 mb-5",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2 sm:gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,l.jsx)("span",{className:"text-sm font-semibold text-slate-500 hidden sm:inline",children:"View:"}),(0,l.jsxs)("div",{className:"flex items-center bg-slate-100 rounded-xl p-1",children:[(0,l.jsxs)("button",{onClick:e=>{q("grid")},className:["flex items-center gap-1.5 px-3 py-2 sm:py-1.5 rounded-lg text-xs font-bold transition-all min-h-10 sm:min-h-0","grid"===K?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"].filter(Boolean).join(" "),children:[(0,l.jsx)("svg",{className:"w-4 h-4 sm:w-3.5 sm:h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})}),"Grid"]}),(0,l.jsxs)("button",{onClick:e=>{q("tree")},className:["flex items-center gap-1.5 px-3 py-2 sm:py-1.5 rounded-lg text-xs font-bold transition-all min-h-10 sm:min-h-0","tree"===K?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"].filter(
1Boolean).join(" "),children:[(0,l.jsx)("svg",{className:"w-4 h-4 sm:w-3.5 sm:h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),"Tree"]})]})]}),(0,l.jsxs)("div",{className:"relative flex-1 sm:max-w-md",children:[(0,l.jsx)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,l.jsx)("input",{type:"text",placeholder:"Search files...",className:"w-full pl-10 pr-9 py-2.5 text-sm rounded-xl border border-slate-200 bg-white focus:border-purple-400 focus:ring-2 focus:ring-purple-100 focus:outline-none transition-all placeholder:text-slate-400 min-h-[44px]",value:null!=H?H:"",onChange:e=>A(e.target.value)}),H?(0,l.jsx)("button",{onClick:e=>{A("")},className:"absolute right-2.5 top-1/2 -translate-y-1/2 w-5 h-5 rounded-full bg-slate-200 hover:bg-slate-300 flex items-center justify-center text-slate-500 transition-colors",children:(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M6 18L18 6M6 6l12 12"})})}):null]}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0 overflow-x-auto scrollbar-none pb-1 sm:pb-0 whitespace-nowrap",children:[(0,l.jsxs)("button",{onClick:e=>{R("all")},className:["px-3 py-2 sm:py-1.5 rounded-xl text-xs font-bold transition-all border min-h-[44px] sm:min-h-0 flex items-center","all"===T?"bg-slate-900 text-white border-slate-900 shadow-sm":"bg-white text-slate-500 border-slate-200 hover:border-slate-300 hover:text-slate-700"].filter(Boolean).join(" "),children:["All",(0,l.jsx)("span",{className:"ml-1 opacity-70",children:eY.length})]}),eY.filter(e=>"video"===e.type).length?(0,l.jsxs)("button",{onClick:e=>{R("video"===T?"all":"video")},className:["flex items-center gap-1 px-3 py-2 sm:py-1.5 rounded-xl text-xs font-bold transition-all border min-h-[44px] sm:min-h-0","video"===T?"bg-blue-500 text-white border-blue-500 shadow-sm shadow-blue-500/25":"bg-white text-blue-600 border-blue-200 hover:border-blue-300 hover:bg-blue-50"].filter(Boolean).join(" "),children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),eY.filter(e=>"video"===e.type).length]}):null,eY.filter(e=>"image"===e.type).length?(0,l.jsxs)("button",{onClick:e=>{R("image"===T?"all":"image")},className:["flex items-center gap-1 px-3 py-2 sm:py-1.5 rounded-xl text-xs font-bold transition-all border min-h-[44px] sm:min-h-0","image"===T?"bg-emerald-500 text-white border-emerald-500 shadow-sm shadow-emerald-500/25":"bg-white text-emerald-600 border-emerald-200 hover:border-emerald-300 hover:bg-emerald-50"].filter(Boolean).join(" "),children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),eY.filter(e=>"image"===e.type).length]}):null,eY.filter(e=>"audio"===e.type).length?(0,l.jsxs)("button",{onClick:e=>{R("audio"===T?"all":"audio")},className:["flex items-center gap-1 px-3 py-2 sm:py-1.5 rounded-xl text-xs font-bold transition-all border min-h-[44px] sm:min-h-0","audio"===T?"bg-violet-500 text-white border-violet-500 shadow-sm shadow-violet-500/25":"bg-white text-violet-600 border-violet-200 hover:border-violet-300 hover:bg-violet-50"].filter(
1Boolean).join(" "),children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})}),eY.filter(e=>"audio"===e.type).length]}):null,eY.filter(e=>"document"===e.type).length?(0,l.jsxs)("button",{onClick:e=>{R("document"===T?"all":"document")},className:["flex items-center gap-1 px-3 py-2 sm:py-1.5 rounded-xl text-xs font-bold transition-all border min-h-[44px] sm:min-h-0","document"===T?"bg-amber-500 text-white border-amber-500 shadow-sm shadow-amber-500/25":"bg-white text-amber-600 border-amber-200 hover:border-amber-300 hover:bg-amber-50"].filter(Boolean).join(" "),children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),eY.filter(e=>"document"===e.type).length]}):null]})]}),"all"!==T||H?(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,l.jsx)("span",{className:"text-slate-400",children:"Showing"}),(0,l.jsx)("span",{className:"font-bold text-slate-700",children:eJ.length}),(0,l.jsx)("span",{className:"text-slate-400",children:"of"}),(0,l.jsx)("span",{className:"font-bold text-slate-700",children:eY.length}),(0,l.jsx)("span",{className:"text-slate-400",children:"files"}),"all"!==T?(0,l.jsxs)("span",{className:["video"===T?"bg-blue-100 text-blue-700":"","image"===T?"bg-emerald-100 text-emerald-700":"","audio"===T?"bg-violet-100 text-violet-700":"","document"===T?"bg-amber-100 text-amber-700":""].filter(Boolean).join(" "),children:[T,(0,l.jsx)("button",{onClick:e=>{R("all")},className:"ml-0.5 hover:opacity-70",children:"\xd7"})]}):null,H?(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-purple-100 text-purple-700 text-[11px] font-bold",children:['"',H,'"',(0,l.jsx)("button",{onClick:e=>{A("")},className:"ml-0.5 hover:opacity-70",children:"\xd7"})]}):null,(0,l.jsx)("button",{onClick:e=>{R("all"),A("")},className:"text-slate-400 hover:text-slate-600 underline ml-1",children:"Clear all"})]}):null]}),eY.length>0&&!eJ.length?(0,l.jsxs)("div",{className:p().emptyCard,children:[(0,l.jsx)("div",{className:p().emptyIcon,children:(0,l.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,l.jsx)("h3",{className:p().emptyTitle,children:"No files match"}),(0,l.jsx)("p",{className:"text-[#7a766b] text-sm mb-4",children:H&&"all"!==T?(0,l.jsxs)(l.Fragment,{children:["No ",T,' files matching "',H,'"']}):H?(0,l.jsxs)(l.Fragment,{children:['No files matching "',H,'"']}):(0,l.jsxs)(l.Fragment,{children:["No ",T," files in this run"]})}),(0,l.jsx)("button",{type:"button",onClick:()=>{R("all"),A("")},className:p().ghostBtn,children:"Clear filters"})]}):null,"tree"===K?(0,l.jsxs)("div",{className:"bg-white rounded-2xl border border-slate-200/60 overflow-hidden shadow-sm",children:[$?(0,l.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,l.jsx)("div",{className:"w-8 h-8 border-3 border-purple-200 border-t-purple-500 rounded-full animate-spin"}),(0,l.jsx)("span",{className:"ml-3 text-sm text-slate-500",children:"Loading folder structure..."})]}):null,(0,l.jsx)("div",{className:"divide-y divide-slate-100",children:J.children.map(e=>{var t,s,r,n;return(0,l.jsxs)("div",{className:"contents",children:["directory"===e.type?(0,l.jsxs)("div",{children:[(0,l.jsxs)("button",{onClick:t=>{ee(e.path)},className:"w-full flex items-center gap-2 sm:gap-3 px-3 sm:px-5 py-3 hover:bg-slate-50 transition-colors text-left min-h-[44px]",children:[(0,l.jsx)("svg",{className:["w-4 h-4 text-slate-400 transition-transform flex-shrink-0",Q.has(e.path)?"rotate-90":""].filter(
1Boolean).join(" "),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),(0,l.jsx)("svg",{className:"w-5 h-5 text-amber-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})}),(0,l.jsx)("span",{className:"font-semibold text-sm text-slate-800 truncate min-w-0",children:e.name}),(0,l.jsxs)("span",{className:"text-[11px] text-slate-400 ml-auto font-medium flex-shrink-0",children:[e.file_count," files"]}),(0,l.jsxs)("div",{className:"flex gap-1",children:[(null==(t=e.summary)?void 0:t.video)?(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-400",title:e.summary.video+" videos"}):null,(null==(s=e.summary)?void 0:s.image)?(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-400",title:e.summary.image+" images"}):null,(null==(r=e.summary)?void 0:r.audio)?(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-violet-400",title:e.summary.audio+" audio"}):null,(null==(n=e.summary)?void 0:n.document)?(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-amber-400",title:e.summary.document+" docs"}):null]})]}),Q.has(e.path)?(0,l.jsx)("div",{className:"bg-slate-50/50",children:e.children.map(e=>{var t;return(0,l.jsxs)("div",{className:"contents",children:["directory"===e.type?(0,l.jsxs)("div",{children:[(0,l.jsxs)("button",{onClick:t=>{ee(e.path)},className:"w-full flex items-center gap-2 sm:gap-3 pl-8 sm:pl-12 pr-3 sm:pr-5 py-2.5 hover:bg-slate-100 transition-colors text-left min-h-[44px]",children:[(0,l.jsx)("svg",{className:["w-3.5 h-3.5 text-slate-400 transition-transform flex-shrink-0",Q.has(e.path)?"rotate-90":""].filter(Boolean).join(" "),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-300 flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})}),(0,l.jsx)("span",{className:"font-medium text-xs text-slate-700 truncate min-w-0",children:e.name}),(0,l.jsxs)("span",{className:"text-[10px] text-slate-400 ml-auto flex-shrink-0",children:[e.file_count," files"]})]}),Q.has(e.path)?(0,l.jsx)("div",{children:null==(t=e.children)?void 0:t.filter(e=>"directory"!==e.type).map(e=>(0,l.jsx)("div",{className:"contents",children:(0,l.jsxs)("button",{onClick:t=>{"document"===e.type&&es(e)},className:["w-full flex items-center gap-2 sm:gap-3 pl-12 sm:pl-20 pr-3 sm:pr-5 py-2.5 hover:bg-slate-100 transition-colors text-left min-h-[44px]","document"===e.type?"cursor-pointer":"cursor-default"].filter(Boolean).join(" "),children:["document"===e.type?(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}):null,(0,l.jsx)("svg",{className:"w-4 h-4 text-blue-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-emerald-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-violet-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 19V6l12-3v13"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-slate-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),(0,l.jsx)("span",{className:"text-xs text-slate-700 truncate flex-1",children:e.name}),(0,l.jsx)("span",{className:"text-[10px] text-slate-400 font-mono flex-shrink-0",children:er(e.size)}),"document"!==e.type?(0,l.jsx)("a",{href:e.url,target:"_blank",onClick:e=>e.stopPropagation(),className:"text-slate-400 hover:text-purple-500 transition-colors flex-shrink-0",children:(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}):null]})},e.path))}):null]}):null,(0,l.jsxs)("button",{onClick:t=>{"document"===e.type&&es(e)},className:["w-full flex items-center gap-2 sm:gap-3 pl-8 sm:pl-12 pr-3 sm:pr-5 py-2.5 hover:bg-slate-100 transition-colors text-left min-h-[44px]","document"===e.type?"cursor-pointer":"cursor-default"].filter(
1Boolean).join(" "),children:["document"===e.type?(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}):null,(0,l.jsx)("svg",{className:"w-4 h-4 text-blue-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-emerald-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-violet-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 19V6l12-3v13"})}),(0,l.jsx)("svg",{className:"w-4 h-4 text-slate-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),(0,l.jsx)("span",{className:"text-xs text-slate-700 truncate flex-1",children:e.name}),(0,l.jsx)("span",{className:"text-[10px] text-slate-400 font-mono flex-shrink-0",children:er(e.size)}),"document"!==e.type?(0,l.jsx)("a",{href:e.url,target:"_blank",onClick:e=>e.stopPropagation(),className:"text-slate-400 hover:text-purple-500 transition-colors flex-shrink-0",children:(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}):null]})]},e.path)})}):null]}):null,(0,l.jsxs)("button",{onClick:t=>{"document"===e.type&&es(e)},className:["w-full flex items-center gap-2 sm:gap-3 px-3 sm:px-5 py-3 hover:bg-slate-50 transition-colors text-left min-h-[44px]","document"===e.type?"cursor-pointer":"cursor-default"].filter(Boolean).join(" "),children:["document"===e.type?(0,l.jsx)("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}):null,(0,l.jsx)("svg",{className:"w-5 h-5 text-blue-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),(0,l.jsx)("svg",{className:"w-5 h-5 text-emerald-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,l.jsx)("svg",{className:"w-5 h-5 text-violet-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 19V6l12-3v13"})}),(0,l.jsx)("svg",{className:"w-5 h-5 text-slate-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)("span",{className:"text-sm font-medium text-slate-800 truncate block",children:e.name})}),(0,l.jsx)("span",{className:"text-[11px] text-slate-400 font-mono flex-shrink-0",children:er(e.size)}),"document"!==e.type?(0,l.jsx)("a",{href:e.url,target:"_blank",onClick:e=>e.stopPropagation(),className:"text-slate-400 hover:text-purple-500 transition-colors flex-shrink-0 ml-2",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}):null]})]},e.path)})}),J&&J.children&&J.children.length?null:(0,l.jsx)("div",{className:"text-center py-12 text-[#7a766b]",children:(0,l.jsx)("p",{className:"text-sm",children:"Tree view not available. Try switching to Grid view."})})]}):null,"grid"===K?(0,l.jsx)("div",{className:"grid grid-cols-2 gap-2.5 sm:gap-5 lg:grid-cols-3 xl:grid-cols-4",children:eJ.map(e=>(0,l.jsxs)("div",{className:"group "+p().card,children:[(0,l.jsxs)("div",{className:"relative aspect-video bg-slate-100 overflow-hidden",children:["video"===e.type?(0,l.jsx)("video",{src:e.url,className:"w-full h-full object-contain bg-black",controls:!0,preload:"metadata"}):null,(0,l.jsx)("img",{alt:"",src:e.url,className:"w-full h-full object-contain",loading:"lazy"}),(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full bg-gradient-to-br from-violet-50 to-purple-50",children:[(0,l.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-red-500 to-rose-500 flex items-center justify-center mb-3 shadow-lg",children:(0,l.jsx)("svg",{className:"w-8 h-8 text-white",f
1ill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})})}),(0,l.jsx)("audio",{src:e.url,controls:!0,className:"w-full px-4"})]}),(0,l.jsxs)("div",{onClick:t=>{es(e)},className:"flex flex-col items-center justify-center h-full bg-gradient-to-br from-amber-50 to-orange-50 cursor-pointer group-hover:from-amber-100 group-hover:to-orange-100 transition-colors",children:[(0,l.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center mb-3 shadow-lg",children:(0,l.jsx)("svg",{className:"w-8 h-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,l.jsxs)("span",{className:"text-xs font-bold text-amber-700 uppercase tracking-wider",children:[".",e.extension||e.key.split(".").pop()]}),(0,l.jsx)("span",{className:"text-[10px] text-amber-500 mt-1",children:"Click to view"})]}),(0,l.jsx)("div",{className:"flex items-center justify-center h-full text-slate-300",children:(0,l.jsx)("svg",{className:"w-16 h-16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,l.jsx)("span",{className:["video"===e.type?"bg-blue-500/90 text-white":"","image"===e.type?"bg-emerald-500/90 text-white":"","audio"===e.type?"bg-violet-500/90 text-white":"","document"===e.type?"bg-amber-500/90 text-white":"","other"===e.type?"bg-slate-500/90 text-white":""].filter(Boolean).join(" "),children:e.type})]}),(0,l.jsxs)("div",{className:"p-3 sm:p-4",children:[(0,l.jsx)("h3",{className:"font-bold text-slate-900 truncate text-xs sm:text-sm",title:e.key.split("/").pop(),children:e.key.split("/").pop()}),(0,l.jsx)("p",{className:"text-[10px] sm:text-[11px] text-slate-400 truncate font-mono mt-1",title:e.key,children:e.key}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1.5 sm:gap-2 mt-2 sm:mt-3",children:["video"===e.type?(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),th(e)},disabled:"importing"===V[e.key],className:"flex-1 flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] bg-gradient-to-r from-red-500 to-rose-500 text-white rounded-xl text-[11px] sm:text-xs font-bold hover:shadow-lg hover:shadow-red-500/25 transition-all duration-200 disabled:opacity-70 relative overflow-hidden",children:["importing"===V[e.key]?(0,l.jsx)("div",{className:"absolute inset-0 bg-white/20",style:{width:(tm[e.key]||0)+"%"}}):null,(0,l.jsxs)("span",{className:"relative z-10 flex items-center gap-1.5",children:["importing"===V[e.key]?(0,l.jsxs)("div",{className:"contents",children:[(0,l.jsx)("div",{className:"w-3 h-3 border-2 border-white border-t-transparent rounded-full animate-spin"}),tm[e.key]||0,"%"]}):null,(0,l.jsxs)("div",{className:"contents",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})}),"Ready"]}),(0,l.jsxs)("div",{className:"contents",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),"AI Chat"]})]})]}):null,"video"===e.type?(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),s.push("/contentx/editor?s3Key=".concat(encodeURIComponent(e.key)))},className:"flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] bg-gradient-to-r from-sky-500 to-cyan-500 text-white rounded-xl text-[11px] sm:text-xs font-bold hover:shadow-lg hover:shadow-sky-500/25 transition-all duration-200",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}),"Edit"]}):null,"document"===e.type?(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation(),es(e)},className:"flex-1 flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] bg-gradient-to-r from-amber-400 to-orange-500 text-white rounded-xl text-[11px] sm:text-xs font-bold hover:shadow-lg hover:shadow-amber-500/25 transition-all duration-200",children:[(0,l.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),"View"]}
1):null,(0,l.jsxs)("button",{onClick:t=>{t.stopPropagation();let s=e.url,l=(e.key||"").split("/").pop()||"download",r=document.createElement("a");r.href=s,r.download=l,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)},className:"flex-1 flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] bg-slate-100 text-slate-700 rounded-xl text-[11px] sm:text-xs font-bold hover:bg-slate-200 transition-all duration-200",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}),(0,l.jsxs)("a",{href:e.url,target:"_blank",onClick:e=>e.stopPropagation(),className:"flex items-center justify-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 sm:py-2.5 min-h-[44px] border border-slate-200 text-slate-600 rounded-xl text-[11px] sm:text-xs font-bold hover:bg-slate-50 hover:border-slate-300 transition-all duration-200",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),"Open"]})]})]})]},e.key))}):null]}):null,j||"files"!==ec||eY.length?null:(0,l.jsxs)("div",{className:p().emptyCard,children:[(0,l.jsx)("div",{className:p().emptyIcon,children:(0,l.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),(0,l.jsx)("h3",{className:p().emptyTitle,children:"No files in this run"}),(0,l.jsx)("p",{className:"text-[#7a766b] mb-6",children:"This run doesn't have any files yet."}),(0,l.jsx)("button",{type:"button",onClick:tt,className:p().ghostBtn,children:"â Back to Runs"})]}),j||"runs"!==ec||eq.length?null:(0,l.jsxs)("div",{className:p().emptyCard,children:[(0,l.jsx)("div",{className:p().emptyIcon,children:(0,l.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),(0,l.jsx)("h3",{className:p().emptyTitle,children:"No runs found"}),(0,l.jsxs)("p",{className:"text-[#7a766b] mb-6",children:['No runs in "',em,'" yet.']}),(0,l.jsx)("button",{type:"button",onClick:te,className:p().ghostBtn,children:"â Back to Library"})]}),j||"types"!==ec||eK.length?null:S?(0,l.jsx)("div",{className:p().emptyCard,children:(0,l.jsx)("p",{className:p().subtitle,children:"Looking up your projects???"})}):L.length?(0,l.jsxs)("div",{className:p().jobList,children:[(0,l.jsx)("p",{className:p().jobHint,children:"These jobs did not save a finished file, so the file shelf is empty."}),L.map(e=>{let t=function(e){let t=(e||"").toLowerCase();return"completed"===t||"done"===t||"success"===t?{label:"DONE",tone:"done"}:"failed"===t||"error"===t?{label:"FAILED",tone:"fail"}:"processing"===t||"pending"===t||"retrying"===t||"queued"===t?{label:"PENDING",tone:"run"}:{label:(e||"DRAFT").toUpperCase(),tone:"draft"}}(e.status),r="done"===t.tone?p().badgeDone:"run"===t.tone?p().badgeRun:"fail"===t.tone?p().badgeFail:p().badgeDraft;return(0,l.jsxs)("button",{type:"button",className:p().jobRow,onClick:()=>{let t=e.pipeline||"video";e.id&&(0,i.ze)(e.id,e),s.push("/contentx/run/".concat(t,"/").concat(e.id))},children:[(0,l.jsxs)("div",{className:p().jobBody,children:[(0,l.jsx)("p",{className:p().jobTitle,children:function(e){let t=e.input||{},s="string"==typeof t.script_text?t.script_text:"",l="string"==typeof t.script?t.script:"",r=(e.title||("string"==typeof t.idea?t.idea:"")||("string"==typeof t.premise?t.premise:"")||("string"==typeof t.topic?t.topic:"")||("string"==typeof t.prompt?t.prompt:"")||(s?s.slice(0,80):"")||(l?l.slice(0,80):"")||(e.message||"").replace(/^Starting\s+/,"").replace(/\s+generation\.{0,3}$/,"")).trim();return r?r.length>80?"".concat(r.slice(0,77),"..."):r:(0,c.cb)(e.pipeline)}(e)}),(0,l.jsxs)("p",{className:p().jobMeta,children:[(0,c.cb)(e.pipeline),e.created_at?" ?? ".concat(function(e){let t=h(e);if(!t)return"";let s=Math.floor((Date.now()-t)/6e4);if(s<1)return"just now";if(s<60)return"".concat(s," mins ago");let l=Math.floor(s/60);if(l<24)return 1===l?"1 hour ago":"".concat(l," hours ago");let r=Math.floor(l/24);return 1===r?"1 day ago":"".concat(r," days ago")}(e.created_at)):""]})]}),(0,l.jsx)("span",{className:"".concat(p().jobBadge," ").concat(r),children:t.label})]},e.id)})]}):(0,l.jsxs)("div",{className:p().emptyCard,children:[(0,l.jsx)("div",{className:p().emptyIcon,
1children:(0,l.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),(0,l.jsx)("h3",{className:p().emptyTitle,children:"No content found"}),(0,l.jsx)("p",{className:"text-[#7a766b] mb-6 max-w-md mx-auto",children:"cloud"===eg?"No content in this S3 path. Try a different prefix.":"No content in this local directory. Generate some content first!"}),(0,l.jsxs)(n(),{href:"/contentx/home",className:p().primaryBtn,children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M12 4v16m8-8H4"})}),"Create Content"]})]})]}),E?(0,l.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-end sm:items-center justify-center sm:p-4",onClick:el,children:[(0,l.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:el}),(0,l.jsxs)("div",{className:"relative w-full sm:max-w-4xl max-h-[95vh] sm:max-h-[90vh] bg-white rounded-t-3xl sm:rounded-3xl shadow-2xl overflow-hidden flex flex-col z-10 animate-slide-up sm:animate-fade-in",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-slate-200 bg-gradient-to-r from-slate-50 to-white flex-shrink-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center flex-shrink-0",children:(0,l.jsx)("svg",{className:"w-5 h-5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"font-bold text-slate-900 text-base truncate",children:(null==O?void 0:O.name)||"Loading..."}),(0,l.jsxs)("div",{className:"flex items-center gap-3 mt-0.5",children:[(null==O?void 0:O.extension)?(0,l.jsxs)("span",{className:"text-[10px] uppercase font-bold text-amber-600 bg-amber-50 px-2 py-0.5 rounded-full",children:[".",O.extension]}):null,(null==O?void 0:O.size)?(0,l.jsx)("span",{className:"text-[10px] text-slate-400 font-mono",children:er(O.size)}):null,(null==O?void 0:O.line_count)?(0,l.jsxs)("span",{className:"text-[10px] text-slate-400",children:[O.line_count," lines"]}):null]})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[(null==O?void 0:O.content)?(0,l.jsxs)("button",{onClick:e=>{var t;t=O.parsed?en(O.parsed):O.content,navigator.clipboard.writeText(t)},className:"flex items-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 text-xs font-bold text-slate-600 bg-slate-100 hover:bg-slate-200 rounded-xl transition-colors min-h-[44px]",children:[(0,l.jsx)("svg",{className:"w-4 h-4 sm:w-3.5 sm:h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),(0,l.jsx)("span",{className:"hidden sm:inline",children:"Copy"})]}):null,(null==O?void 0:O.path)?(0,l.jsxs)("a",{href:"".concat((0,i.Gi)(),"/local/file?path=").concat(encodeURIComponent(O.path)),target:"_blank",className:"flex items-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-2 text-xs font-bold text-slate-600 bg-slate-100 hover:bg-slate-200 rounded-xl transition-colors min-h-[44px]",children:[(0,l.jsx)("svg",{className:"w-4 h-4 sm:w-3.5 sm:h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),(0,l.jsx)("span",{className:"hidden sm:inline",children:"Download"})]}):null,(0,l.jsx)("button",{onClick:el,className:"w-10 h-10 rounded-xl hover:bg-slate-100 flex items-center justify-center text-slate-400 hover:text-slate-600 transition-colors min-h-[44px]",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto",children:[F?(0,l.jsxs)("div",{className:"flex items-center justify-center py-20",children:[(0,l.jsx)("div",{className:"w-10 h-10 border-3 border-purple-200 border-t-purple-500 rounded-full animate-spin"}),(0,l.jsx)("span",{className:"ml-3 text-sm text-slate-500",children:"Loading file content..."})]}):null,(0,l.jsx)("div",{className:"p-3 sm:p-6",children:(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsx)("table",{className:"w-full text-xs sm:text-sm border-collapse",children:(0,l.jsx)("tbody",{children:O.parsed.map((e,t)=>(0,l.jsxs)("tr",{className:"border-b border-slate-100 hover:bg-slate-50",children:[(0,l.jsx)("td",{className:"py-2 sm:py-3 px-2 sm:px-4 text-slate-500 capitalize font-semibold w-28 sm:w-56 align-top text-xs sm:text-sm",children:String(t).replace(/_/g," ")}),(0,l.jsxs)("td",{className:"py-3 px-4 text-slate-800",children:[null==e?(0,l.jsx)("div",{className:"contents",children:(0,l.jsx)("span",{className:"text-slate-300 italic",children:"â"})}):null,(0,l.jsx)("div",{className:"contents",children:(0,l.jsx)("span",{className:e?"text-green-600 font-semibold":"text-red-500 font-semibold",children:e?"Yes":"No"})}),(0,l.jsx)("div",{className:"contents",children:(0,l.jsx)("span",{className:"font-bold text-slate-900",children:e})}),(0,l.jsx)("div",{className:"contents",children:e}),(0,l.jsx)("div",{className:"contents",children:(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map((e,t)=>(0,l.jsx)("span",{className:"px-2.5 py-1 bg-slate-100 rounded-lg text-xs font-medium text-slate-700",children:e},t))})}),(0,l.jsx)("div",{className:"contents",children:(0,l.jsxs)("details",{className:"group",children:[(0,l.jsxs)("summary",{className:"cursor-pointer text-xs text-purple-600 font-semibold hover:text-purple-800 select-none",children:[e.length," items â click to expand"]}),(0,l.jsx)("pre",{className:"text-xs bg-slate-50 rounded-xl p-3 mt-2 overflow-x-auto max-h-60 overflow-y-auto border border-slate-200 font-mono",children:JSON.stringify(e,null,2)})]})}),(0,l.jsx)("div",{className:"contents",children:(0,l.jsx)("div",{className:"space-y-1",children:e.map((e,t)=>(0,l.jsxs)("div",{className:"flex gap-2 text-xs",children:[(0,l.jsxs)("span",{className:"text-slate-400 capitalize font-medium shrink-0 min-w-20",children:[String(t).replace(/_/g," "),":"]}),(0,l.jsx)("span",{className:"text-slate-700",children:"object"==typeof e?JSON.stringify(e):e})]},t))})}),(0,l.jsx)("div",{className:"contents",children:e})]})]},t))})})})}),(0,l.jsxs)("div",{className:"p-3 sm:p-6",children:[O.parsed.length&&"object"==typeof O.parsed[0]?(0,l.jsxs)("div",{className:"overflow-x-auto",children:[(0,l.jsxs)("table",{className:"w-full text-sm border-collapse",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b-2 border-slate-200 bg-slate-50",children:[(0,l.jsx)("th",{className:"py-2 px-3 text-left text-slate-500 font-semibold text-xs uppercase tracking-wider",children:"#"}),Object.keys(O.parsed[0]).slice(0,8).map(e=>(0,l.jsx)("th",{className:"py-2 px-3 text-left text-slate-500 font-semibold text-xs uppercase tracking-wider capitalize",children:e.replace(/_/g," ")},e))]})}),(0,l.jsx)("tbody",{children:O.parsed.slice(0,100).map((e,t)=>(0,l.jsxs)("tr",{className:"border-b border-slate-100 hover:bg-slate-50",children:[(0,l.jsx)("td",{className:"py-2 px-3 text-slate-400 font-mono text-xs",children:t+1}),Object.keys(O.parsed[0]).slice(0,8).map(t=>(0,l.jsx)("td",{className:"py-2 px-3 text-slate-700 text-xs max-w-xs truncate",children:"object"==typeof e[t]?JSON.stringify(e[t]):e[t]},t))]},t))})]}),O.parsed.length>100?(0,l.jsxs)("div",{className:"text-center py-3 text-xs text-slate-400",children:["Showing 100 of ",O.parsed.length," items"]}):null]}):null,(0,l.jsx)("pre",{className:"text-sm font-mono text-slate-700 leading-relaxed whitespace-pre-wrap break-words bg-slate-50 rounded-2xl p-5 border border-slate-200 max-h-[65vh] overflow-auto",children:(0,l.jsx)("code",{children:en(O.parsed)})})]}),(0,l.jsx)("div",{className:"p-3 sm:p-6",children:(0,l.jsx)("pre",{className:"text-xs sm:text-sm font-mono text-slate-700 leading-relaxed whitespace-pre-wrap break-words bg-slate-50 rounded-xl sm:rounded-2xl p-3 sm:p-5 border border-slate-200 max-h-[65vh] overflow-auto",children:(0,l.jsx)("code",{children:O.content})})})]})]})]}):null]})})}},16313:e=>{e.exports={"slide-down-enter-active":"WorkingDirView_slide-down-enter-active__4VltH","slide-down-leave-active":"WorkingDirView_slide-down-leave-active__dR2ja","slide-down-enter-from":"WorkingDirView_slide-down-enter-from__Pkk70","slide-down-leave-to":"WorkingDirView_slide-down-leave-to__pVwXz","modal
1-fade-enter-active":"WorkingDirView_modal-fade-enter-active__pifJk","modal-fade-leave-active":"WorkingDirView_modal-fade-leave-active__DXdl7","modal-fade-enter-from":"WorkingDirView_modal-fade-enter-from__oRreY","modal-fade-leave-to":"WorkingDirView_modal-fade-leave-to__ZRtRE","scrollbar-none":"WorkingDirView_scrollbar-none__eaF5F",page:"WorkingDirView_page__kJ_PG",header:"WorkingDirView_header__bS3FZ",crumbs:"WorkingDirView_crumbs__838jX",crumb:"WorkingDirView_crumb__mKDpq",crumbSep:"WorkingDirView_crumbSep____ppZ",crumbBtn:"WorkingDirView_crumbBtn__2N4Td",crumbNow:"WorkingDirView_crumbNow__reYL9",titleRow:"WorkingDirView_titleRow__F0dB3",title:"WorkingDirView_title__3SOXo",subtitle:"WorkingDirView_subtitle__iwmVJ",runId:"WorkingDirView_runId__YMlBw",runIdLabel:"WorkingDirView_runIdLabel__IJbwG",runIdCode:"WorkingDirView_runIdCode___RzOH",iconBtn:"WorkingDirView_iconBtn__uvcgj",stats:"WorkingDirView_stats__EG1Hf",stat:"WorkingDirView_stat__Z_YYZ",statLabel:"WorkingDirView_statLabel___ZzcV",statValue:"WorkingDirView_statValue__Ln7AV",body:"WorkingDirView_body__jj9mB",filterBar:"WorkingDirView_filterBar__SuOEI",grid:"WorkingDirView_grid__jFV48",gridWide:"WorkingDirView_gridWide__xNpeN",card:"WorkingDirView_card__II_hW",thumb:"WorkingDirView_thumb__Rpw5a",browse:"WorkingDirView_browse__8OO4f",typeIcon:"WorkingDirView_typeIcon__UhiXk",count:"WorkingDirView_count__IAHeW",empty:"WorkingDirView_empty__CCyq8",emptyCard:"WorkingDirView_emptyCard__0z5Vm",emptyIcon:"WorkingDirView_emptyIcon__WTRgL",emptyTitle:"WorkingDirView_emptyTitle___Dr8b",primaryBtn:"WorkingDirView_primaryBtn__tMlpn",jobList:"WorkingDirView_jobList__tTqGt",jobHint:"WorkingDirView_jobHint__U9SYs",jobRow:"WorkingDirView_jobRow__qBu5s",jobBody:"WorkingDirView_jobBody__V_FPJ",jobTitle:"WorkingDirView_jobTitle__xAhNm",jobMeta:"WorkingDirView_jobMeta__mtwn4",jobBadge:"WorkingDirView_jobBadge__7dtLx",badgeDone:"WorkingDirView_badgeDone__PmEAR",badgeRun:"WorkingDirView_badgeRun__aEgeA",badgeFail:"WorkingDirView_badgeFail__bJUzV",badgeDraft:"WorkingDirView_badgeDraft__5PP3J",ghostBtn:"WorkingDirView_ghostBtn__QG9iJ",spinner:"WorkingDirView_spinner__cOPy0","library-spin":"WorkingDirView_library-spin__mvRrz"}},28219:(e,t,s)=>{"use strict";function l(e){if(!function(e){if("string"!=typeof e)return!1;try{let t=e.split(".");if(3!==t.length||!t[2])return!1;let s=JSON.parse(atob(t[1].replace(/-/g,"+").replace(/_/g,"/")));return!!s.sub&&Number(s.exp)>Date.now()/1e3}catch(e){return!1}}(e))throw Object.assign(Error("Please sign in to build your website."),{response:{status:401}});return{Authorization:"Bearer ".concat(e)}}s.d(t,{V:()=>l})},68978:(e,t,s)=>{"use strict";s.d(t,{br:()=>l,cb:()=>r});let l={game_marketing_audit:"GameAudit",game_visuals:"GameSkin",legal_gen:"LegalGen",app_catalog_enricher:"CatalogBoost",aso_keywords:"KeyBoost",event_promo:"EventBlast",app_store_deployer:"StoreLaunch",screenshot_localizer:"ShotLocal",app_growth_council:"GrowthHub",onboarding_council:"OnboardHub",identity_onboard:"IDOnboard",content_week_calendar:"WeekPlan",interactive_avatar:"AvatarLive",interactive_story:"StoryPath",audiobook:"AudioStudio",concept_to_audiobook:"AudioStudio",repurpose:"Remix",rewrite:"Reword",research:"DeepDig",viral_shorts:"ShortBlast",video_shorts:"ShortBlast",quick_video:"QuickSnap",social_carousel:"SwipeDeck",social_post:"PostZap",video:"VidCore",script2video:"ScriptReel",script2image:"ScriptFrame",viral_lesson_short:"LessonBlast",long_form_video:"DeepReel",longs:"DeepReel",nl_editor:"TalkEdit",movie:"MovieForge",short_movie:"FilmScript",shortmovie:"FilmScript",short_video:"FilmReel",short_movie_video:"FilmReel",shortmovie_video:"FilmReel",kids_movie:"KidFlix",kidsmovie:"KidFlix",kids:"KidFlix",short_drama:"DramaBite",short_movie_series:"SeriesBite",documentary:"DocForge",tv_series:"SeasonForge",tvseries:"SeasonForge",weekly_series:"WeeklyDrop",guided_learning:"LearnGuide",ad:"AdReel",ad_banners:"BannerBlast",adbanners:"BannerBlast",banners:"BannerBlast",playable_ad:"TapAd",app_ad_campaigns:"AppBlast",app_preview_video:"AppReel",quizverse_app_preview:"QuizReel",quizverse_app_preview_showcase:"QuizShowcase",hyperframes_app_preview:"HyperReel",hyperframes_brand_video:"HyperReel",brand_video:"BrandReel",marketing_
1kit:"MarketKit",song:"SongForge",ad_jingle:"JingleForge",lyrics:"LyricDrop",song_to_video:"SongReel",song2musicvideo:"SongReel",music_video:"MusicReel",musicvideo:"MusicReel",learning_series:"LearnSeries",learningseries:"LearnSeries",learning:"LearnSeries",concept_to_curriculum:"CurricuForge",concept_to_mindmap:"MapForge",playable_flashcard_deck:"CardTap",exam_prep_bundle:"ExamPack",daily_quiz_factory:"QuizDaily",podcast2video:"PodReel",podcast:"PodReel",podcast_series:"PodSeries",podcast_photoreal:"PodStudio",comic:"PanelForge",blog:"BlogDrop",character_2d:"Char2D",character_3d:"Char3D",motion_library:"MoveVault",character_studio:"CharStudio",ivx_full_game:"GameForge",threejs_game:"Three.js Game",img2threejs:"Image to 3D",world_scene:"WorldForge",game_sound:"GameBeat",landing_page:"LandDrop",screenshot_localize:"ShotLocal",asc_release:"StoreLaunch"};function r(e){let t=String(e||"").trim().toLowerCase().replace(/-/g,"_");return t?l[t]?l[t]:t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"Content"}},80453:(e,t,s)=>{"use strict";s.d(t,{OV:()=>u,d3:()=>p,ed:()=>h,ey:()=>a,qD:()=>f,tx:()=>v,uL:()=>x,zA:()=>g});var l=s(21903),r=s(58907);function n(e){if(!e)return"â";let t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,16)||"â":t.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"})}function o(){return(0,l.HW)()}function a(){var e;let t=String((null==(e=o())?void 0:e.sub)||"").trim().toLowerCase();return t||(function(e){let t=String(e||"").trim().split(".");if(3!==t.length)return"";try{let e=t[1].replace(/-/g,"+").replace(/_/g,"/"),s=e.length%4==0?"":"=".repeat(4-e.length%4),l=JSON.parse(atob(e+s));return String((null==l?void 0:l.sub)||"").trim()}catch(e){return""}})(String((0,l.iD)()||"").trim()).toLowerCase()}function i(){let e=o();return String((null==e?void 0:e.email)||(null==e?void 0:e.userName)||(null==e?void 0:e.id)||(null==e?void 0:e.sub)||"").trim().toLowerCase()}function d(){var e;let t=o();return String((null==t?void 0:t.userName)||(null==t?void 0:t.username)||(null==t||null==(e=t.email)?void 0:e.split("@")[0])||"").trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[-._]+|[-._]+$/g,"").slice(0,128)}function c(e,t){let s=String(e||"").trim().toLowerCase();if(!s)return!0;let l=String(t.ownerSub||"").trim().toLowerCase();if(l&&s===l)return!0;let r=String(t.pipelineSlug||"").trim().toLowerCase();if(r&&s===r)return!0;let n=String(t.emailKey||"").trim().toLowerCase();return!!(n&&s===n||n.includes("@")&&s===n.split("@")[0])}function u(e){let t=a(),s=d(),l=i();return!t&&!s&&!l||c(e,{ownerSub:t,pipelineSlug:s,emailKey:l})}function m(e){return String(e||"").trim().toLowerCase().replace(/^pipelinestatus\./,"")}function p(e){let t=m(e);return"processing"===t||"pending"===t||"retrying"===t||"queued"===t||"running"===t}function h(e,t){let s=a(),l=d(),r=i(),n=!!(s||l||r),o=[];for(let a of e){let e=(null==a?void 0:a.input)||{},i=String((null==a?void 0:a.user_id)||e.user_id||e.userId||"").trim().toLowerCase();(null==t||!t.requireUserStamp||i)&&(!n||c(i,{ownerSub:s,pipelineSlug:l,emailKey:r}))&&o.push(a)}return o}function x(e){let t=0,s=0,l=0,r=0;for(let n of e)!function(e){let t=m(e);return t.includes("awaiting")||t.includes("approval")||"parked"===t||"interrupted"===t||"waiting"===t}(n.status)?p(n.status)?s+=1:function(e){let t=m(e);return"completed"===t||"success"===t||"done"===t}(n.status)?t+=1:function(e){let t=m(e);return"failed"===t||"error"===t||"cancelled"===t||"canceled"===t}(n.status)&&(l+=1):r+=1;return{total:e.length,completed:t,processing:s,failed:l,awaitingApproval:r}}function f(e){let t=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(s>4||null==e)return"";if("string"==typeof e&&/^https?:\/\//i.test(e.trim()))return e.trim();if(Array.isArray(e)){for(let l of e){let e=t(l,s+1);if(e)return e}return""}if("object"==typeof e)for(let l of["url","path","src","thumbnail"]){let r=t(e[l],s+1);if(r)return r}return""};for(let s of["image","thumbnail","media","mediaUrl","video"]){let l=t(e[s]);if(l)return l}let s=t(e.releaseURL);return s&&/\.(mp4|mov|webm|m4v|png|jpe?g|gif|webp)(\?|$)/i.test(s)?s:""}function g(e){let t=f(e);
1if(!t)return null;let s=/\.(mp4|mov|webm|m4v)(\?|$)/i.test(t),l=(t.split("?")[0].split(".").pop()||(s?"mp4":"img")).slice(0,5),r=String(e.content||e.title||e.name||"Social post").trim(),o=String(e.publishDate||e.scheduled_at||e.date||e.created_at||"");return{id:"social-".concat(String(e.id||t)),taskId:"",pipeline:"",name:r.slice(0,80)||"Social post",title:r.slice(0,80)||"Social post",kind:s?"video":"image",ext:l,specs:"Social post",status:"Approved",source:"social",date:n(o),thumb:s?void 0:t,url:t}}async function v(e){let t=String(e||"").trim();if(!t)return[];let s={max_tasks:30,max_items:100},l=a();l&&(s.user_id=l);let{data:o}=await r.I8.listBrandMedia(t,s),i=Array.isArray(null==o?void 0:o.items)?o.items:[],d=[];for(let e of i){if(!e||"object"!=typeof e)continue;let t=function(e){let t=String(e.url||"").trim(),s=String(e.name||"media"),l=String(e.id||"".concat(e.task_id||"t",":").concat(s));if(!t&&!s)return null;let r=Number(e.size||0),o=function(e){let t=String(e||"").toLowerCase();return"video"===t||"audio"===t||"model"===t?t:"image"}(e.kind);return{id:l,taskId:String(e.task_id||""),pipeline:String(e.pipeline||"video"),name:s,kind:o,ext:String(e.ext||s.split(".").pop()||"FILE").toUpperCase(),specs:r&&!(r<=0)?r<1024?"".concat(r," B"):r<1048576?"".concat((r/1024).toFixed(1)," KB"):"".concat((r/1048576).toFixed(1)," MB"):"â",status:"Approved",source:"uploaded"===String(e.source||"ai").toLowerCase()?"uploaded":"ai",date:n(String(e.last_modified||"")),thumb:t||void 0,url:t||void 0,title:String(e.title||"")}}(e);t&&d.push(t)}return d}},82013:(e,t,s)=>{"use strict";s.d(t,{Gh:()=>n,s3:()=>r});let l=s(66436).A.create({baseURL:"https://content-factory.intelli-verse-x.ai/director".replace(/\/$/,"")||"http://127.0.0.1:8000",headers:{"Content-Type":"application/json"},timeout:12e4});l.interceptors.response.use(e=>e,async e=>{var t;let s=e.config;if(!s)return Promise.reject(e);s.__retryCount=s.__retryCount||0;let r=null==(t=e.response)?void 0:t.status;if((!r||502===r||503===r||504===r||"ECONNABORTED"===e.code||"ERR_NETWORK"===e.code)&&s.__retryCount<3){s.__retryCount+=1;let e=1e3*Math.pow(2,s.__retryCount-1);return await new Promise(t=>setTimeout(t,e)),l(s)}return Promise.reject(e)});let r={config:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l.get("/s3/config",{params:e})},buckets:()=>l.get("/s3/buckets"),folders:e=>l.get("/s3/folders",{params:e}),scan:e=>{let t={...e};return Array.isArray(t.media_types)&&t.media_types.length&&(t.media_types=t.media_types.join(",")),l.get("/s3/scan",{params:t})},videos:e=>l.get("/s3/videos",{params:e}),media:(e,t)=>l.get("/s3/media/".concat(encodeURIComponent(e)),{params:t}),mediaUrl:(e,t)=>l.get("/s3/media/".concat(encodeURIComponent(e),"/url"),{params:t}),import:e=>l.post("/s3/import",e),health:e=>l.get("/s3/health",{params:e})},n={getCollections:()=>l.get("/videodb/collection"),getCollection:e=>l.get("/videodb/collection/".concat(e)),createCollection:(e,t)=>l.post("/videodb/collection",{name:e,description:t}),deleteCollection:e=>l.delete("/videodb/collection/".concat(e)),getVideos:e=>l.get("/videodb/collection/".concat(e,"/video")),getVideo:(e,t)=>l.get("/videodb/collection/".concat(e,"/video/").concat(t)),deleteVideo:(e,t)=>l.delete("/videodb/collection/".concat(e,"/video/").concat(t)),upload:async(e,t,s)=>{let{file:r,url:n,sourceType:o}=t;if(r){let t=new FormData;return t.append("file",r),l.post("/videodb/collection/".concat(e,"/upload"),t,{headers:{"Content-Type":"multipart/form-data"},timeout:6e5,onUploadProgress:s?e=>{s(Math.round(100*e.loaded/e.total))}:void 0})}if(n)return l.post("/videodb/collection/".concat(e,"/upload"),{source:n,source_type:o||"url"},{timeout:6e5});throw Error("Either file or url must be provided")},uploadFromUrl:(e,t)=>l.post("/videodb/collection/".concat(e,"/upload"),{source:t,source_type:"url"})}}}]);
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.