PageSourceSearch

https://popcornstudio.ai/_next/static/chunks/81491-4ea51bbfd7455310.js?dpl=dpl_4mCD9FgfEt4MbNMpBNfGdxpV5TZf

js popcornstudio.ai collected 2026-10-05 14:22:20 UTC 24,515 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[81491],{42165:()=>{},81491:(e,l,r)=>{"use strict";r.d(l,{A:()=>g});var t=r(95155),n=r(12115),s=r(74437),i=r(85870),o=r(28262),a=r(25075),d=r(97080),u=r(67608),c=r(34557),m=r(87901),y=r(75098),h=r(25234),f=r(58717);r(42165),r(87848);var p=r(95003);let b=c.ls,j=()=>"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches;function v(e){let{title:l,body:r,action:n}=e;return(0,t.jsxs)("div",{className:"slm-centre",children:[(0,t.jsx)("p",{className:"slm-centre-title",children:l}),r&&(0,t.jsx)("p",{className:"slm-centre-body",children:r}),n]})}let g=function(e){var l,r,g,x,w,k,N,I;let{open:S,onClose:C,library:R,attached:F,budget:q,engineLabel:L,engineSwitchable:M=!0,onDone:E,signInHref:A,initialView:P,initialQuery:T}=e,{t:z}=(0,s.s)(),D=(0,c.sK)(z),U=(e,l)=>(0,c.lR)(D,e,l),O=(0,n.useRef)(null),Y=(0,n.useRef)(null),Q=(0,n.useRef)(null),_=(0,n.useRef)(null),B=(0,n.useRef)(null),K=(0,n.useRef)(null),G=(0,n.useRef)(null),H=(0,n.useRef)(null),J=(0,n.useRef)(null),W=(0,n.useRef)(!1),X=(0,n.useRef)(0),V=(0,n.useRef)(0),Z=(0,n.useRef)(new Set),$=(0,n.useRef)(new Set),ee=(0,n.useRef)(new Set),el=(0,n.useRef)(null),er=(0,n.useRef)(S);er.current=S;let et=(0,n.useRef)({mounted:!1,open:!1,generation:R.generation,ownerId:R.ownerId,session:0,requests:new Map}),[en,es]=(0,n.useState)({kind:"all"}),ei=(0,n.useRef)(en),[eo,ea]=(0,n.useState)(""),[ed,eu]=(0,n.use
1State)([]),ec=(0,n.useRef)([]);ec.current=ed;let[em,ey]=(0,n.useState)(null),[eh,ef]=(0,n.useState)(!1),[ep,eb]=(0,n.useState)(null),[ej,ev]=(0,n.useState)({}),[eg,ex]=(0,n.useState)(!1),[ew,ek]=(0,n.useState)(!1),[eN,eI]=(0,n.useState)(null),[eS,eC]=(0,n.useState)(null),eR=(0,n.useRef)(null),[eF,eq]=(0,n.useState)(!1),[eL,eM]=(0,n.useState)(!1);S!==eL&&(V.current+=1,eR.current=null,eq(!1),eM(S),S||(el.current=null),S&&(null!==R.ownerId&&0===Z.current.size?eu([...F]):eu(null===R.ownerId?[]:F.filter(e=>!Z.current.has(e.url))),es((null==P?void 0:P.kind)==="project"&&ee.current.has(P.project.id)?{kind:"all"}:null!=P?P:{kind:"all"}),ea(null===R.ownerId||T&&$.current.has(T)?"":null!=T?T:""),ey(null),ef(!1),eb(null),eI(null),eC(null),ex(!1),ev({})));let[eE,eA]=(0,n.useState)(R.generation);R.generation!==eE&&(eA(R.generation),ev({}));let[eP,eT]=(0,n.useState)(R.ownerId);if(R.ownerId!==eP){X.current+=1,eR.current=null,eq(!1),eT(R.ownerId),ev({});let e=[...new Set([...F,...ed].map(e=>e.url))],l=[...new Set([T,eo].filter(e=>!!e))],r=[...new Set([(null==P?void 0:P.kind)==="project"?P.project.id:null,"project"===en.kind?en.project.id:null].filter(e=>!!e))];"string"==typeof eP&&null===R.ownerId&&S&&(el.current={ownerId:eP,visitRevision:V.current,selection:ed,view:en,query:eo,notice:em,sheetOpen:eh,showAllProjects:eg,folderDraft:eN,folderError:eS,blockedUrls:e,blockedQueries:l,blockedProjectIds:r});let t=el.current,n=S&&"string"==typeof R.ownerId&&(null==t?void 0:t.visitRevision)===V.current&&(null==t?void 0:t.ownerId)===R.ownerId?t:null;if(n){for(let e of n.blockedUrls)Z.current.delete(e);for(let e of n.blockedQueries)$.current.delete(e);for(let e of n.blockedProjectIds)ee.current.delete(e);eu(n.selection),es(n.view),ea(n.query),ey(n.notice),ef(n.sheetOpen),eI(n.folderDraft),eC(n.folderError),ex(n.showAllProjects)}else{for(let l of e)Z.current.add(l);for(let e of l)$.current.add(e);for(let e of r)ee.current.add(e);eu([]),es({kind:"all"}),ea(""),ey(null),ef(!1),eI(null),eC(null),ex(!1),W.current=S}eb(null),null===R.ownerId&&S||(el.current=null)}(0,n.useLayoutEffect)(()=>{let e=et.current;return e.mounted=!0,e.open=S,e.generation=R.generation,e.ownerId=R.ownerId,e.session+=1,e.requests.clear(),()=>{e.mounted=!1,e.open=!1,e.session+=1,e.requests.clear()}},[S,R.generation,R.ownerId]),(0,n.useLayoutEffect)(()=>{ei.current=en},[en]),(0,n.useEffect)(()=>{let e=O.current;if(e)if(S&&!e.open){var l,r;e.showModal(),j()?null===(l=_.current)||void 0===l||l.focus():null===(r=Q.current)||void 0===r||r.focus()}else!S&&e.open&&e.close()},[S]);let ez=null===R.ownerId&&"ready"===R.state.status?{status:"loading"}:R.state,eD="ready"===ez.status?ez.items:[],eU="ready"!==ez.status||ez.projectsFailed||null===R.ownerId?null:ez.projects,eO="ready"===ez.status&&null!==(l=ez.failed)&&void 0!==l?l:[],eY="project"===en.kind?null==eU?void 0:eU.find(e=>e.id===en.project.id):void 0,eQ=(0,f.hO)(R,{lazy:!0}),e_=eQ.request;(0,n.useEffect)(()=>{S&&e_()},[S,e_]);let eB=eQ.folders,eK=eB?(0,h.XL)(eB,{kind:"library"}):[],eG="folder"===en.kind&&null!==(r=null==eB?void 0:eB.find(e=>e.id===en.folder.id))&&void 0!==r?r:null,eH=(0,f.OC)(R,eQ,S&&eG?eG.id:null),eJ=eH.load;(0,n.useEffect)(()=>{S&&"folder"===en.kind&&eQ.load&&"loading"!==eQ.load.status&&!eG&&es({kind:"all"})},[S,en,eQ.load,eG]);let eW=(0,n.useRef)({ownerId:R.ownerId,ids:new Set});eW.current={ownerId:R.ownerId,ids:new Set(null!==(g=null==eU?void 0:eU.map(e=>e.id))&&void 0!==g?g:[])};let eX=X.current,eV=V.current,eZ=e=>{er.current&&null!==R.ownerId&&X.current===eX&&V.current===eV&&eW.current.ownerId===R.ownerId&&E(e)};if(S&&"ready"===ez.status&&"project"===en.kind&&!eY){let e="undefined"==typeof document?null:document.activeElement,l=J.current;W.current||(W.current=!!e&&(e===H.current||e===l||null!==l&&"function"==typeof l.contains&&l.contains(e)||"function"==typeof e.closest&&!!e.closest(".slm-rail-projects, .slm-crumbs"))),es({kind:"all"}),ev({})}(0,n.useLayoutEffect)(()=>{var e;S&&"all"===en.kind&&W.current&&(null===(e=_.current)||void 0===e||e.focus()),W.current=!1},[S,en]);let e$=eY&&R.ownerId===eP?ej[eY.id]:void 0,e0=async function(e){var l,r,t;let n,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!er.current||X.current!==eX||V.current!==eV||eW.current.ownerId!==R.ownerId)return;if(!eW.current.ids.has(e.id)){"error"===R.state.status&&R.refresh();return}let i=ej[e.id];if(!s&&(null==i?void 0:i.status)==="loading"&&i.retrying)return;let o=(null==i?void 0:i.status)==="error"||(null==i?void 0:i.status)==="loading"&&!!i.retrying,a=o&&document.activeElement===H.current?H.current:null,d=et.current,u=d.session,c=d.generation,m=d.ownerId,y=(null!==(l=d.requests.get(e.id))&&void 0!==l?l:0)+1;d.requests.set(e.id,y),s&&(null==i?void 0:i.status)==="ready"||ev(l=>({...l,[e.id]:{status:"loading",retrying:o}}));try{n=await R.loadProject(e.id)}catch(e){n=null}let h=et.current;if(!h.mounted||!h.open||h.session!==u||h.generation!==c||h.ownerId!==m||h.requests.get(e.id)!==y||eW.current.ownerId!==m||!eW.current.ids.has(e.id))return;let f=ei.current,p=null!==a&&H.current===a&&document.activeElement===a&&"project"===f.kind&&f.project.id===e.id;ev(l=>({...l,[e.id]:null!==n?{status:"ready",items:n}:s&&(null==i?void 0:i.status)==="ready"?{...i,stale:!0}:{status:"error"}})),p&&(null===n?null===(r=H.current)||void 0===r||r.focus():null===(t=J.current)||void 0===t||t.focus())},e1=e=>{var l;X.current===eX&&V.current===eV&&eW.current.ownerId===R.ownerId&&eW.current.ids.has(e.id)&&(ee.current.delete(e.id),es({kind:"project",project:e}),(null===(l=ej[e.id])||void 0===l?void 0:l.status)!=="ready"&&e0(e))};(0,n.useEffect)(()=>{S&&eY&&!ej[eY.id]&&e0(eY)},[S,en,ej,eY]);let e8=(0,n.useRef)(R.freshness);(0,n.useEffect)(()=>{e8.current!==R.freshness&&(e8.current=R.freshness,S&&void 0!==R.freshness&&(et.current.session+=1,ev(e=>eY&&e[eY.id]?{[eY.id]:e[eY.id]}:{}),eY&&e0(eY,!0)))},[R.freshness]);let e5="project"===en.kind&&eY&&(null==e$?void 0:e$.status)==="ready"?(0,d.rF)([...R.sessionUploads.filter(e=>e.projectId===en.project.id&&!e$.items.some(l=>l.url===e.url)),...e$.items],eD):null,e7="ready"!==ez.status?null:"all"===en.kind?eD:"pool"===en.kind?eD.filter(e=>e.pool===en.pool):"folder"===en.kind?(null==eJ?void 0:eJ.status)==="ready"?eJ.items:null:e5,e2=(0,n.useMemo)(()=>e7?(0,d.Ow)(e7,eo):[],[e7,eo]),e6=(0,n.useMemo)(()=>new Set(ed.map(e=>e.url)),[ed]),e4="pool"===en.kind&&m.qB[en.pool].some(e=>eO.includes(e)),e9="all"===en.kind&&eO.length>0||e4&&(null!==(x=null==e7?void 0:e7.length)&&void 0!==x?x:0)>0||"project"===en.kind&&((null==e$?void 0:e$.status)==="ready"&&e$.stale||"ready"===ez.status&&!!ez.projectsStale)||"folder"===en.kind&&(null==eJ?void 0:eJ.status)==="ready"&&!!eJ.stale,e3="ready"===ez.status&&null!==R.ownerId&&R.loadOlder?(0,d.NY)(ez.older,R.older,en,eo):null,le=(0,u.e)(R,e3),ll=e=>
1D(e.key,e.fallback,void 0!==e.query?{query:e.query}:void 0),lr=(null==e3?void 0:e3.action)?(0,t.jsx)("button",{ref:le.buttonRef,type:"button",className:"slm-tool slm-older-action","aria-disabled":e3.busy||void 0,onClick:le.run,children:ll(e3.action)}):null,lt=(e,l)=>(0,c.TY)(D,L,e,l,M,!!q.videoIncludesAudio&&q.audio>0),ln=e=>{if(X.current!==eX||V.current!==eV||eW.current.ownerId!==R.ownerId||null===R.ownerId||void 0!==e.uploading)return;if(e6.has(e.url)){eu(l=>l.filter(l=>l.url!==e.url)),ey(null);return}let l=(0,d.Q7)(ed,e.media,q);if(!l.ok){ey(lt(l.reason,l.cap));return}Z.current.delete(e.url),eu(l=>[...l,e]),ey(null)},ls=(e,l)=>{let r=X.current,t=V.current,n=ec.current,s=e.map(e=>({item:e,index:n.findIndex(l=>l.url===e.url)})).filter(e=>e.index>=0);if(!s.length)return;let i=new Set(s.map(e=>e.item.url));eu(n.filter(e=>!i.has(e.url))),ey(null),eb({message:l,undo:()=>{if(X.current!==r||V.current!==t)return;let{next:e,dropped:l}=(0,d.DG)(ec.current,s,q);if(eu(e),l.length){let r=(0,d.Q7)(e,l[0].media,q);r.ok||ey(lt(r.reason,r.cap))}}})},li=e=>{var l;ls([e],D("studio.library.toast.removed","“{name}” removed from your selection",{name:e.name})),null===(l=B.current)||void 0===l||l.focus()},lo=()=>{var e;let l=ed.length;l&&(ls(ed,D("studio.library.toast.cleared","{count} references cleared",{count:l})),ef(!1),null===(e=B.current)||void 0===e||e.focus())},la=e=>(0,c.J6)(D,e),ld=async e=>{var l;if(X.current!==eX||V.current!==eV||null===R.ownerId)return;let r=e?Array.from(e):[];if(Y.current&&(Y.current.value=""),!r.length)return;let t=eG?eG.projectId:null!==(l=null==eY?void 0:eY.id)&&void 0!==l?l:null,n=X.current,s=V.current,{done:i,failed:o,unfiled:a=[]}=await R.upload(r,t),u=eG&&i.length?await eQ.add(eG,i):200;if(!er.current||X.current!==n||V.current!==s||eW.current.ownerId!==R.ownerId)return;let c=[...ec.current],m=null;for(let e of i){if(c.some(l=>l.url===e.url))continue;let l=(0,d.Q7)(c,e.media,q);if(!l.ok){null!=m||(m=lt(l.reason,l.cap));continue}Z.current.delete(e.url),c.push(e)}eu(c),ey(o.length?la(o):a.length&&eY?D("studio.library.notFiled","Saved to My Library, but not added to {project}: {names}. Use Add to folder… on it to try again.",{project:eY.name,names:a.map(e=>e.name).join(", ")}):eG&&(u<200||u>=300)?D("studio.library.notFiled","Saved to My Library, but not added to {project}: {names}. Use Add to folder… on it to try again.",{project:eG.name,names:i.map(e=>e.name).join(", ")}):m)},lu=async()=>{var e;let l;if(X.current!==eX||V.current!==eV||null===R.ownerId||null===eN||eR.current)return;let r={};eR.current=r,eq(!0),eC(null);let t=X.current,n=V.current,s=!1;try{l=await R.createProject(eN)}catch(e){l=null}finally{(s=eR.current===r)&&(eR.current=null,eq(!1))}if(s&&er.current&&X.current===t&&V.current===n&&eW.current.ownerId===R.ownerId){if("cap"===l){eC(D("studio.library.folder.cap","You have the most projects allowed, counting those in Trash. A project leaves Trash 30 days after it goes in."));return}if(!l){eC(D("studio.library.folder.failed","That didn't save. Try again."));return}eI(null),eC(null),ev(e=>({...e,[l.id]:{status:"ready",items:[]}})),es({kind:"project",project:l}),null===(e=G.current)||void 0===e||e.focus()}},lc=()=>{var e,l;if(eo&&document.activeElement===Q.current){ea("");return}if(eh){ef(!1),null===(e=K.current)||void 0===e||e.focus();return}if(null!==eN){eR.current=null,eq(!1),eI(null),eC(null),null===(l=G.current)||void 0===l||l.focus();return}C()},lm=(0,y.k)(C),ly="ready"===ez.status,lh=null!==(k=null!==(w=null==eY?void 0:eY.name)&&void 0!==w?w:null==eG?void 0:eG.name)&&void 0!==k?k:null,lf=ed.slice(0,4),lp=ed.length-lf.length,lb="project"===en.kind&&(null==e$?void 0:e$.status)==="loading"&&!0===e$.retrying,lj=()=>{"project"===en.kind?e0(en.project):"folder"===en.kind?eH.retry():R.refresh()},lv=(e,l,r,n,s,o)=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:"slm-rail-item","data-tone":o,"aria-current":r?"true":void 0,onClick:n,children:[s&&(0,t.jsx)(i.w,{name:s,size:16}),(0,t.jsx)("span",{className:"slm-rail-label",children:l})]})},e),lg=eU?eg?eU:eU.slice(0,6):[],lx=e2.length,lw=eo.trim()&&e7?lh?D(1===lx?"studio.library.resultIn":"studio.library.resultsIn",1===lx?"1 result in {place}":"{count} results in {place}",{count:lx,place:lh}):D(1===lx?"studio.library.result":"studio.library.results",1===lx?"1 result in My Library":"{count} results in My Library",{count:lx}):"",lk=null!==(N=null==e5?void 0:e5.length)&&void 0!==N?N:0,lN="project"!==en.kind?"":e$&&"loading"!==e$.status?"error"===e$.status?D("studio.library.error.title","Your library didn't load"):0===lk?D("studio.library.project.empty","Nothing in this project yet"):D(1===lk?"studio.library.resultIn":"studio.library.resultsIn",1===lk?"1 result in {place}":"{count} results in {place}",{count:lk,place:null!==(I=null==eY?void 0:eY.name)&&void 0!==I?I:""}):D("studio.library.loading","Loading your library…");return(0,t.jsx)("dialog",{ref:O,className:"slm","aria-labelledby":"slm-title",onCancel:e=>{e.preventDefault(),lc()},onKeyDown:e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),lc())},onClose:e=>{S&&!e.currentTarget.open&&C()},onPointerDown:lm.onPointerDown,onClick:lm.onClick,children:S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"slm-panel liquid-glass",children:[(0,t.jsxs)("header",{className:"slm-head",children:[(0,t.jsx)("h2",{ref:_,tabIndex:-1,
1className:"slm-title",id:"slm-title",children:D("studio.library.title","My Library")}),(0,t.jsx)("button",{type:"button",className:"slm-close",onClick:C,"aria-label":D("studio.library.close","Close My Library"),children:(0,t.jsx)(i.w,{name:"close-line",size:20})})]}),(0,t.jsxs)("div",{className:"slm-body",children:[(0,t.jsxs)("nav",{className:"slm-rail","aria-label":D("studio.library.title","My Library"),children:[(0,t.jsx)("ul",{role:"list",children:lv("all",D("studio.library.all","All assets"),"all"===en.kind,()=>es({kind:"all"}))}),(0,t.jsx)("p",{className:"slm-rail-head",children:D("studio.library.group.library","Library")}),(0,t.jsx)("ul",{role:"list",children:d.yi.map(e=>lv(e,U(e,"rail"),"pool"===en.kind&&en.pool===e,()=>es({kind:"pool",pool:e}),c.PH[e]))}),null!==eU&&eU.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"slm-rail-head",children:D("studio.library.group.projects","Projects")}),(0,t.jsxs)("ul",{role:"list",className:"slm-rail-projects","data-open":eg||void 0,children:[lg.map(e=>lv(e.id,e.name,"project"===en.kind&&en.project.id===e.id,()=>e1(e))),eU.length>6&&lv("more",eg?D("studio.library.fewer","Show fewer"):D("studio.library.allProjects","All projects ({count})",{count:eU.length}),!1,()=>ex(e=>!e),void 0,"quiet")]})]}),"ready"===ez.status&&ez.projectsFailed&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"slm-rail-head",children:D("studio.library.group.projects","Projects")}),(0,t.jsx)("ul",{role:"list",children:lv("projects-retry",D("studio.library.projectsFailed","Projects didn't load \xb7 Try again"),!1,()=>void R.refresh(),void 0,"quiet")})]}),"ready"===ez.status&&eK.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"slm-rail-head",children:D("studio.library.page.folders","Folders")}),(0,t.jsxs)("ul",{role:"list",className:"slm-rail-projects","data-open":ew||void 0,children:[(ew?eK:eK.slice(0,6)).map(e=>lv(e.id,e.name,"folder"===en.kind&&en.folder.id===e.id,()=>es({kind:"folder",folder:e}),"folder-line")),eK.length>6&&lv("more-folders",ew?D("studio.library.fewer","Show fewer"):D("studio.library.page.allFolders","All folders ({count})",{count:eK.length}),!1,()=>ek(e=>!e),void 0,"quiet")]})]})]}),(0,t.jsxs)("div",{className:"slm-main",children:[(0,t.jsxs)("div",{className:"slm-top",children:[(0,t.jsxs)("label",{className:"slm-search",children:[(0,t.jsx)(i.w,{name:"search-line",size:18}),(0,t.jsx)("span",{className:"sr-only",children:D("studio.library.search","Search My Library")}),(0,t.jsx)("input",{ref:Q,type:"search",value:eo,dir:"auto",onChange:e=>{$.current.delete(e.target.value),ea(e.target.value)},placeholder:D("studio.library.search","Search My Library")})]}),ly&&null!==eU&&(0,t.jsxs)("div",{className:"slm-folder",children:[(0,t.jsxs)("button",{ref:G,type:"button",className:"slm-tool","aria-expanded":null!==eN,onClick:()=>{eR.current=null,eq(!1),eI(e=>null===e?"":null),eC(null)},children:[(0,t.jsx)(i.w,{name:"folder-add-line",size:18}),D("studio.library.newFolder","New folder")]}),null!==eN&&(0,t.jsxs)("form",{className:"slm-folder-pop liquid-glass","aria-busy":eF,onSubmit:e=>{e.preventDefault(),lu()},children:[(0,t.jsx)("label",{className:"sr-only",htmlFor:"slm-folder-name",children:D("studio.library.folder.name","Folder name")}),(0,t.jsx)("input",{id:"slm-folder-name",autoFocus:!0,value:eN,maxLength:60,dir:"auto",readOnly:eF,onChange:e=>eI(e.target.value),placeholder:D("studio.library.folder.name","Folder name")}),(0,t.jsx)("button",{type:"submit",className:"slm-done",disabled:eF||!eN.trim(),children:D("studio.library.folder.create","Create")}),eS&&(0,t.jsx)("p",{className:"slm-folder-error",role:"alert",children:eS})]})]}),ly&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"slm-tool",onClick:()=>{var e;return null===(e=Y.current)||void 0===e?void 0:e.click()},children:[(0,t.jsx)(i.w,{name:"mac-line",size:18}),D("studio.library.upload","Upload")]}),(0,t.jsx)("input",{ref:Y,type:"file",multiple:!0,accept:b,hidden:!0,onChange:e=>void ld(e.target.files)})]})]}),(0,t.jsx)("p",{className:"slm-notice",role:"status",children:null!=em?em:e9?D("studio.library.partial","Some of your library didn't load, so this list may be incomplete."):""}),lh&&(0,t.jsxs)("nav",{className:"slm-crumbs","aria-label":D("studio.library.breadcrumb","Breadcrumb"),children:[(0,t.jsx)("button",{type:"button",onClick:()=>es({kind:"all"}),children:D("studio.library.title","My Library")}),(0,t.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,t.jsx)("span",{"aria-current":"page",children:lh})]}),(0,t.jsx)("p",{className:"slm-results","aria-live":"polite",children:lw}),(0,t.jsx)("p",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:lN}),(0,t.jsx)("p",{className:"sr-only",role:"status",children:e3?ll(e3.line):""}),(0,t.jsx)("div",{ref:J,className:"slm-grid-wrap",role:"project"===en.kind?"regi
1on":void 0,"aria-label":null!=lh?lh:void 0,tabIndex:"project"===en.kind?-1:void 0,children:lb?(0,t.jsx)(v,{title:D("studio.library.loading","Loading your library…"),body:D("studio.library.error.body","Nothing was lost. Check your connection and try again."),action:(0,t.jsx)("button",{ref:H,type:"button",className:"slm-tool slm-project-retry","aria-busy":"true","aria-disabled":"true",onClick:lj,children:D("studio.library.retry","Try again")})}):"loading"!==ez.status&&(null==e$?void 0:e$.status)!=="loading"&&("project"!==en.kind||e$)&&("folder"!==en.kind||eJ&&"loading"!==eJ.status)?"signed-out"===ez.status?(0,t.jsx)(v,{title:D("studio.library.signedOut.title","Sign in to see your library"),body:D("studio.library.signedOut.body","Your characters, locations, voices and renders live here once you're signed in."),action:(0,t.jsx)("a",{className:"slm-tool",href:A,onClick:e=>{(0,p.WP)(e,A)},children:D("studio.nav.signin","Sign in")})}):"error"===ez.status||(null==e$?void 0:e$.status)==="error"||"folder"===en.kind&&(null==eJ?void 0:eJ.status)==="error"||e4&&(null==e7?void 0:e7.length)===0?(0,t.jsx)(v,{title:D("studio.library.error.title","Your library didn't load"),body:D("studio.library.error.body","Nothing was lost. Check your connection and try again."),action:(0,t.jsx)("button",{ref:"project"===en.kind?H:void 0,type:"button",className:"project"===en.kind?"slm-tool slm-project-retry":"slm-tool",onClick:lj,children:D("studio.library.retry","Try again")})}):e7&&0===e7.length?(0,t.jsx)(v,{title:"pool"===en.kind?U(en.pool,"empty"):"project"===en.kind?D("studio.library.project.empty","Nothing in this project yet"):"folder"===en.kind?D("studio.library.folder.empty","Nothing in this folder yet"):D("studio.library.empty.title","Your library is empty"),body:D("studio.library.empty.body","Everything you generate in the studios lands here automatically.")}):0===e2.length?(0,t.jsx)(v,{title:D("studio.library.notFound.title","Nothing here matches “{query}”",{query:eo.trim()}),body:(null==e3?void 0:e3.action)?void 0:D("studio.library.notFound.body","Upload one from your device and it will be saved to My Library."),action:ly||e3?(0,t.jsxs)(t.Fragment,{children:[e3&&(0,t.jsx)("p",{ref:le.lineRef,tabIndex:-1,className:"slm-centre-body",children:ll(e3.line)}),lr,ly&&!(null==e3?void 0:e3.action)&&(0,t.jsxs)("button",{type:"button",className:"slm-tool",onClick:()=>{var e;return null===(e=Y.current)||void 0===e?void 0:e.click()},children:[(0,t.jsx)(i.w,{name:"mac-line",size:18}),D("studio.library.upload","Upload")]})]}):void 0}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{className:"slm-grid",role:"list",children:e2.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(a.A,{item:e,attached:e6.has(e.url),onToggle:()=>ln(e),typeLabel:U(e.pool,"type"),busyLabel:D("studio.library.uploading","Uploading")})},e.id))}),e3&&(0,t.jsxs)("div",{className:"slm-older",children:[(0,t.jsx)("span",{ref:le.lineRef,tabIndex:-1,children:ll(e3.line)}),lr]})]}):(0,t.jsx)(v,{title:D("studio.library.loading","Loading your library…")})}),(0,t.jsxs)("div",{className:"slm-tray",children:[(0,t.jsx)("div",{className:"slm-tray-lead",children:0===ed.length?(0,t.jsx)("p",{className:"slm-tray-hint",children:D("studio.library.tray.hint","Nothing attached yet — pick anything and it lands here")}):(0,t.jsxs)(t.Fragment,{children:[lf.map(e=>(0,t.jsx)(o.cd,{item:e,onRemove:()=>li(e)},e.url)),lp>0&&(0,t.jsx)(o.ft,{count:lp,onClick:()=>ef(!0),label:D("studio.library.tray.more","Show all {count} selected",{count:ed.length})})]})}),(0,t.jsxs)("div",{className:"slm-tray-trail",children:[ed.length>0&&(0,t.jsx)("button",{type:"button",className:"slm-clear",onClick:lo,children:D("studio.library.clear","Clear all")}),(0,t.jsxs)("button",{ref:K,type:"button",className:"slm-count",onClick:()=>ef(e=>!e),disabled:!ed.length,"aria-expanded":eh,"aria-label":D("studio.library.tray.count","{count} of {total} references selected",{count:ed.length,total:q.total}),children:[ed.length," / ",q.total]}),(0,t.jsx)("button",{ref:B,type:"button",className:"slm-done","data-empty":0===ed.length||void 0,onClick:()=>eZ(ed),children:D("studio.library.done","Attach")})]}),eh&&ed.length>0&&(0,t.jsxs)("div",{className:"slm-sheet liquid-glass",role:"region","aria-label":D("studio.library.sheet","Selected references"),children:[(0,t.jsxs)("div",{className:"slm-sheet-head",children:[(0,t.jsx)("span",{children:D("studio.library.selected","{count} selected",{count:ed.length})}),(0,t.jsx)("button",{type:"button",className:"slm-clear",onClick:lo,children:D("studio.library.clear","Clear all")})]}),(0,t.jsx)("ul",{className:"slm-sheet-list",role:"list",children:ed.map((e,l)=>(0,t.jsxs)("li",{className:"slm-sheet-row",children:[(0,t.jsx)("span",{className:"slm-sheet-thumb","data-media":e.media,children:(0,t.jsx)(o.tu,{item:e,width:180})}),(0,t.jsxs)("span",{className:"slm-sheet-text",children:[(0,t.jsx)("span",{className:"slm-sheet-name",children:e.name}),(0,t.jsx)("span",{className:"slm-sheet-type",children:U(e.pool,"type")})]}),(0,t.jsx)("button",{type:"button",className:"slm-sheet-remove",onClick:r=>{let t=r.currentTarget.closest("ul");ls([e],D("studio.library.toast.removed","“{name}” removed from your selection",{name:e.name})),requestAnimationFrame(()=>{var e,r;let n=null==t?void 0:t.querySelectorAll(".slm-sheet-remove"),s=null==n?void 0:n[Math.min(l,(null!==(r=null==n?void 0:n.length)&&void 0!==r?r:1)-1)];s?s.focus():null===(e=K.current)||void 0===e||e.focus()})},"aria-label":D("studio.ref.remove","Remove {name}",{name:e.name}),children:(0,t.jsx)(i.w,{name:"close-circle-fill",size:20})})]},e.url))})]})]})]})]})]}),(0,t.jsx)("div",{className:"slm-toast-region","aria-live":"polite",children:ep&&(0,t.jsxs)("div",{className:"slm-toast liquid-glass",children:[(0,t.jsx)("span",{children:ep.message}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;ep.undo(),eb(null),null===(e=B.current)||void 0===e||e.focus()}
1,children:D("studio.library.undo","Undo")})]})})]})})}}}]);

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.