PageSourceSearch

https://cdn.virse.ai/_next/static/chunks/175.a98dbc8b44ce6443.js

js virse.ai collected 2026-10-05 13:17:14 UTC 15,498 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[175,5968],{4439:(e,t,r)=>{r.d(t,{j:()=>d});var n=r(56919),i=r(93270),o=r(31912),a=r(55112),s=r(65348),l=r(43321),u=r(80458);let c=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d=e=>{let t=(0,o.useOverlayStore)(e=>e.spaceCoverImageCacheRevision),r=(0,s.k)(e=>e.userId),d=(0,a.useOrganizationStore)(e=>e.currentOrganization),h=(0,n.useMemo)(()=>r&&(null==d?void 0:d.id)&&d.org_type?{userId:r,organizationId:d.id,organizationType:d.org_type}:null,[null==d?void 0:d.id,null==d?void 0:d.org_type,r]),m=h?"".concat(h.userId,":").concat(h.organizationId,":").concat(h.organizationType):"anonymous",p=(0,n.useMemo)(()=>JSON.stringify(Array.from(new Set(e.filter(e=>!(0,l.ES)(e.id,e.name,e.spaceType)).map(e=>e.id))).sort()),[e]),g=(0,n.useMemo)(()=>JSON.parse(p),[p]),v=(0,n.useMemo)(()=>{let e=o.useOverlayStore.getState();if(e.spaceCoverImageCacheRevision!==t)return{};let r=e.spaceCoverImageCache;return g.reduce((e,t)=>(c(r,t)&&(e[t]=r[t]),e),{})},[t,g]),f=(0,n.useMemo)(()=>{var e,t;if(!h)return{};let r=null!=(t=null==(e=(0,u.C3)(h))?void 0:e.data)?t:{};return g.reduce((e,t)=>{if(!c(r,t))return e;let n=r[t];return e[t]=n?function(e){return{id:e.id,artifact_version_id:null,description:null,resolution:null,origin_url:null,virse_url:e.imageUrl,embedding:null,aesthetic_score:null,status:"snapshot",ref_source:null,created_at:"",modified_at:"",imageUrl:e.imageUrl,title:"",...e.dominantColor?{dominantColor:e.dominantColor}:{}}}(n):null,e},{})},[h,g]),[y,b]=(0,n.useState)(()=>({scopeKey:m,images:{...f,...v}})),[x,w]=(0,n.useState)({}),j=y.scopeKey===m?y.images:f,S=(0,n.useMemo)(()=>g.reduce((e,t)=>(c(v,t)?e[t]=v[t]:c(j,t)?e[t]=j[t]:c(f,t)&&(e[t]=f[t]),e),{}),[v,j,f,g]),C=(0,n.useRef)(S);C.current=S;let I=(0,n.useMemo)(()=>g.reduce((e,t)=>{var r;return e[t]=!c(f,t)&&(null!=(r=x[t])?r:!c(S,t)),e},{}),[x,f,g,S]);return(0,n.useEffect)(()=>{if(0===g.length)return;let e=!1,t=o.useOverlayStore.getState(),r=t.spaceCoverImageCache,n=g.filter(e=>!c(r,e)),a=new Set(n);if(w(e=>{let t=!1,r={...e};return g.forEach(n=>{let i=a.has(n);i&&!0!==e[n]?(r[n]=!0,t=!0):i||!0!==e[n]||(r[n]=!1,t=!0)}),t?r:e}),0!==n.length)return(async()=>{try{let r=await i.ZL.getSpaceCoverImages(n);if(e)return;let a=o.useOverlayStore.getState().spaceCoverImageCache,s=n.reduce((e,n)=>{var i;if(c(a,n))return e[n]=a[n],e;let o=null!=(i=r[n])?i:null;return t.setCoverImageCache(n,o),e[n]=o,e},{});b(e=>({scopeKey:m,images:{...e.scopeKey===m?e.images:f,...s}})),h&&(0,u.ro)(h,s)}catch(s){if(e)return;let r=C.current,i=o.useOverlayStore.getState().spaceCoverImageCache,a={};n.forEach(e=>{if(c(i,e)){a[e]=i[e];return}c(r,e)?t.setCoverImageCache(e,r[e]):a[e]=null}),Object.keys(a).length>0&&b(e=>({scopeKey:m,images:{...e.scopeKey===m?e.images:f,...a}}))}finally{e||w(e=>{let t={...e};return n.forEach(e=>{t[e]=!1}),t})}})(),()=>{e=!0}},[f,h,m,t,g]),(0,n.useMemo)(()=>({coverImages:S,loadingStates:I}),[S,I])}},38984:(e,t,r)=>{r.d(t,{n:()=>c});var n=r(56919),i=r(49120),o=r(80349),a=r(42838),s=r(2772),l=class extends a.Q{#e;#t=void 0;#r;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,s.f8)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.EN)(t.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#o(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#o()}mutate(e,t){return this.#n=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#i(){let e=this.#r?.state??(0,i.$)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#o(e){o.jG.batch(()=>
1{if(this.#n&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context;e?.type==="success"?(this.#n.onSuccess?.(e.data,t,r),this.#n.onSettled?.(e.data,null,t,r)):e?.type==="error"&&(this.#n.onError?.(e.error,t,r),this.#n.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach(e=>{e(this.#t)})})}},u=r(31219);function c(e,t){let r=(0,u.jE)(t),[i]=n.useState(()=>new l(r,e));n.useEffect(()=>{i.setOptions(e)},[i,e]);let a=n.useSyncExternalStore(n.useCallback(e=>i.subscribe(o.jG.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=n.useCallback((e,t)=>{i.mutate(e,t).catch(s.lQ)},[i]);if(a.error&&(0,s.GU)(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:c,mutateAsync:a.mutate}}},54542:(e,t,r)=>{r.d(t,{w:()=>a});var n=r(8223),i=r(31579),o=r(32313);function a(e){let{title:t,sourceLabel:r,busy:a=!1,onCreate:s,className:l}=e;return(0,n.jsx)(o.e,{title:t,disabled:a,onSelect:s,onActivate:s,className:l,cover:(0,n.jsx)("div",{"data-testid":"project-create-cover",className:"grid h-full w-full place-items-center bg-black transition-[background-color] duration-150 group-hover:bg-surface-1",children:(0,n.jsx)(i.A,{"data-testid":"project-create-plus",className:"h-8 w-8 text-icon-tertiary transition-colors group-hover:text-icon-primary",strokeWidth:1.1})}),metadata:(0,n.jsx)("span",{"data-testid":"project-source",className:"flex min-w-0 items-center",children:r})})}},69087:(e,t,r)=>{function n(e,t){var r,n,i,o;let a=(null==(r=e.tutorial)?void 0:r.unopened)?e.tutorial:null,s=(null==(n=t.tutorial)?void 0:n.unopened)?t.tutorial:null;return Number(!!s)-Number(!!a)||(null!=(i=null==s?void 0:s.priority)?i:0)-(null!=(o=null==a?void 0:a.priority)?o:0)}function i(e){if(!e.modifiedAt)return 0;let t=Date.parse(e.modifiedAt);return Number.isFinite(t)?t:0}function o(e,t,r,o){return n(e,t)||("name"===r?e.name.localeCompare(t.name,"zh-CN")*o:(i(e)-i(t))*o)}r.d(t,{M:()=>n,R:()=>o})},73544:(e,t,r)=>{r.d(t,{y8:()=>k,xg:()=>M,px:()=>N});var n=r(8223),i=r(38335),o=r(56919),a=r(32313),s=r(54912),l=r(99847),u=r(27105),c=r(3191),d=r(94692),h=r(27207),m=r(51030),p=r(48921),g=r(62484),v=r(13276),f=r(31219),y=r(80534),b=r(38984),x=r(55112),w=r(65348),j=r(36282),S=r(87934),C=r(92714),I=r(85968);function O(e){let{tutorialId:t,resourceDentryId:r,canDelete:i=!0,className:s,...l}=e,c=(0,h.Ym)(),d=(0,h.c3)(),{tutorial:m,isLoading:O,deleting:k,deleteTutorial:M}=function(e,t){let r=(0,w.k)(e=>e.userId),n=(0,x.useOrganizationStore)(e=>{var t;return null==(t=e.currentOrganization)?void 0:t.id}),i=(0,f.jE)(),o=(0,h.c3)(),a=(0,j.r)(e=>e.showSuccess),s=(0,j.r)(e=>e.showError),{data:l,isLoading:u}=(0,y.I)({queryKey:["tutorials","catalog",r,n],queryFn:()=>I.tutorialApi.catalog(n),enabled:!!(r&&n),staleTime:6e4}),c=(0,b.n)({mutationFn:async()=>{if(!t)throw Error(o("home.projects.resourceInfoSyncing"));await (0,S.$B)(t)},onSuccess:()=>{i.invalidateQueries({queryKey:["workspace","spaces","canvas"]}),i.invalidateQueries({queryKey:["home","recent-canvases"]}),i.invalidateQueries({queryKey:["tutorials","catalog",r,n]}),(0,C.Te)(),a(o("onboardingTutorial.entryDeleted"))},onError:e=>s((0,S.j5)(e))});return{tutorial:null==l?void 0:l.items.find(t=>t.id===e),isLoading:u,deleting:c.isPending,deleteTutorial:()=>{c.isPending||c.mutate()}}}(t,r),[N,_]=(0,o.useState)(null),E=("en"===c&&(null==m?void 0:m.description_en)?m.description_en:null==m?void 0:m.description)||d("onboardingTutorial.catalog.description");return(0,n.jsx)(a.e,{...l,disabled:l.disabled||k,menuOpen:null!==N,onContextMenu:e=>_({position:{x:e.clientX,y:e.clientY}}),onToggleMenu:e=>_(t=>t?null:{anchorElement:e,position:{x:0,y:0,side:"right"}}),menu:N&&(0,n.jsx)(v._,{ariaLabel:d("resourceDrive.aria.moreForItem",{title:l.title}),position:N.position,anchorElement:N.anchorElement,groups:[[{id:"enter",label:d("onboardingTutorial.enterTutorial"),icon:p.A},{id:"delete",label:d("onboardingTutorial.deleteTutorial"),icon:g.A,destructive:!0,disabled:k||!r||!i,disabledReason:d(i?"home.projects.resourceInfoSyncing":"home.projects.permissionDenied")}]],onAction:e=>{"enter"===e.id&&l.onActivate(),"delete"===e.id&&M()},onClose:()=>_(null)}),metadata:O?(0,n.jsx)("span",{className:"block h-3 w-3/4 animate-pulse rounded bg-interaction-hover","aria-hidden":"true"}):(0,n.jsx)("span",{className:"min-w-0 truncate",title:E,children:E}),className:(0,u.cn)(s,"border-accent hover:border-accent",(l.batchMode?l.batchSelected:l.selected)&&"bg-accent-soft ring-accent")})}function k(e){var t,r,i,o;let{space:s,teamPublic:l,coverImage:p,coverLoading:g=!1,coverPriority:v=!1,quickAccess:f=!1,onToggleQu
1ickAccess:y,onImageError:b,coverOverlay:x,...w}=e,j=(0,h.c3)(),S=(0,m._)(s.name,j),C=null!=l?l:(null==(t=s.extraParams)?void 0:t.resource_org_visible)===!0||(null==(r=s.extraParams)?void 0:r.resource_visibility_summary)==="org",I=(0,n.jsx)(_,{space:s,coverImage:p,loading:g,priority:v,onImageError:b}),k=(0,n.jsxs)(n.Fragment,{children:[x,!s.tutorial&&y&&(0,n.jsx)(d.P,{starred:f,label:j(f?"resourceDrive.aria.removeQuickAccessFor":"resourceDrive.aria.addQuickAccessFor",{name:S}),onToggle:y,className:(0,u.cn)("absolute right-[7px] top-[7px] z-10",w.selected&&"opacity-100")}),(0,n.jsx)(c.uh,{visible:C})]});return s.tutorial?(0,n.jsx)(O,{...w,tutorialId:s.tutorial.id,resourceDentryId:"string"==typeof(null==(i=s.extraParams)?void 0:i.resource_dentry_id)?s.extraParams.resource_dentry_id:void 0,canDelete:(null==(o=s.extraParams)?void 0:o.resource_allow_trash)!==!1,title:S,cover:I,coverOverlay:k}):(0,n.jsx)(a.e,{...w,title:S,cover:I,coverOverlay:k})}function M(e){let{sourceLabel:t,permissionLabel:r,assetCountLabel:i}=e;return(0,n.jsxs)("div",{className:"flex w-full min-w-0 items-center justify-between gap-2",children:[(0,n.jsx)("span",{"data-testid":"project-source",className:"min-w-0 truncate",children:t}),(0,n.jsxs)("span",{className:"flex min-w-0 shrink items-center gap-1.5",children:[r&&(0,n.jsx)("span",{className:"card-permission-only-roomy shrink-0 text-content-secondary",children:r}),r&&(0,n.jsx)("span",{className:"card-permission-only-roomy shrink-0 text-content-disabled","aria-hidden":"true",children:"\xb7"}),(0,n.jsx)("span",{className:"min-w-0 truncate",children:i})]})]})}function N(e){let{className:t}=e;return(0,n.jsxs)("div",{className:(0,u.cn)("flex aspect-square flex-col overflow-hidden rounded-[8px] border border-line-subtle bg-surface-1",t),children:[(0,n.jsx)("div",{className:"aspect-[4/3] skeleton-shimmer bg-interaction-neutral"}),(0,n.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col justify-center gap-0.5 px-3",children:[(0,n.jsx)("div",{className:"h-3 w-2/3 rounded bg-interaction-hover skeleton-shimmer [--skeleton-highlight-strength:24%]"}),(0,n.jsx)("div",{className:"h-2.5 w-1/2 rounded bg-interaction-hover-subtle skeleton-shimmer [--skeleton-highlight-strength:24%]"})]})]})}function _(e){let{space:t,coverImage:r,loading:i,priority:o,onImageError:a}=e;return i?(0,n.jsx)("div",{className:"h-full w-full skeleton-shimmer bg-interaction-hover"}):(null==r?void 0:r.imageUrl)?(0,n.jsx)(E,{source:r.imageUrl,dominantColor:r.dominantColor,priority:o,onImageError:a},r.imageUrl):t.coverIcon&&"default-space-cover"!==t.coverIcon?(0,n.jsx)(E,{source:t.coverIcon,priority:o,onImageError:a},t.coverIcon):(0,n.jsx)(s.U,{})}function E(e){let{source:t,dominantColor:r,priority:a=!1,onImageError:c}=e,d=(0,l.R9)(t,640).src,h=/^https?:\/\//.test(t)&&t!==d?t:null,[m,p]=(0,o.useState)(d),g=m===d&&m.startsWith("https://storage.googleapis.com/"),[v,f]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1);return v?(0,n.jsx)(s.U,{}):(0,n.jsx)("div",{className:"relative h-full w-full overflow-hidden bg-interaction-neutral",style:r?{backgroundColor:r}:void 0,children:(0,n.jsx)(i.default,{src:m,alt:"",fill:!0,unoptimized:!g,quality:g?90:void 0,priority:a,loading:a?"eager":"lazy",fetchPriority:a?"high":"auto",sizes:"(min-width: 1280px) 240px, 30vw","data-loaded":y?"true":"false",className:(0,u.cn)("object-cover transition-opacity duration-200 motion-reduce:transition-none",y?"opacity-100":"opacity-0"),onLoad:()=>b(!0),onError:e=>{if(h&&m!==h){b(!1),p(h);return}f(!0),null==c||c(e)}})})}},85968:(e,t,r)=>{r.r(t),r.d(t,{ensureTutorialRecords:()=>d,safeTutorialRoute:()=>s,tutorialApi:()=>h});var n=r(26856);async function i(e){let t="virse:onboarding:entry-hidden:".concat(e),r=!1;try{r="true"===localStorage.getItem(t)}catch(e){return}if(r){await n.api.post("/tutorials/import-legacy-deletion",{});try{localStorage.removeItem(t)}catch(e){}}}var o=r(65348),a=r(55112);function s(e){if(!/^\/onboarding\/[a-z0-9]+(?:[-/][a-z0-9]+)*$/.test(e))throw Error("Invalid tutorial route");return e}function l(){var e;let t=null==(e=a.useOrganizationStore.getState().currentOrganization)?void 0:e.id;if(!t)throw Error("Workspace unavailable");return t}function u(e,t){return"".concat(e,"?org_id=").concat(encodeURIComponent(t))}let c=null;function d(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null==(e=a.useOrganizationStore.getState().currentOrganization)?void 0:e.id,r=o.k.getState().userId;if(!r||!t)return Promise.resolve();if((null==c?void 0:c.userId)===r&&c.orgId===t&&Date.now()-c.at<6e4)return c.promise;let s={userId:r,orgId:t,at:Date.now(),promise:Promise.resolve()};return s.promise=i(r).then(()=>
1{if(o.k.getState().userId!==r)throw Error("Tutorial session changed");return n.api.post(u("/tutorials/bootstrap",t),{})}).then(()=>void 0).catch(e=>{throw c===s&&(c=null),e}),c=s,s.promise}let h={catalog:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l();return n.api.get(u("/tutorials",e))},restore:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l();return n.api.post(u("/tutorials/".concat(encodeURIComponent(e),"/restore"),t),{})},resolve:e=>n.api.get("/tutorials/records/".concat(encodeURIComponent(e))),open:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l();return s((await n.api.post(u("/tutorials/".concat(encodeURIComponent(e),"/open"),t),{})).route)},adminList:()=>n.api.get("/admin/tutorials"),save:e=>n.api.put("/admin/tutorials/".concat(encodeURIComponent(e.id)),e),retry:e=>n.api.post("/admin/tutorials/".concat(encodeURIComponent(e),"/retry"),{})}},86223:(e,t,r)=>{r.d(t,{uT:()=>l,LL:()=>u,aw:()=>i,s2:()=>o});let n=(0,r(25105).jf)("/onboarding/purple_storm.png");function i(e,t){let{allowFallback:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){let t=null==e?void 0:e.trim();if(!t||t.startsWith("//"))return null;if(t.startsWith("/"))return t;try{let e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol?t:null}catch(e){return null}}(e);return i||r?{type:"image",src:null!=i?i:n,alt:t,aspectRatio:3.67}:null}function o(e){return(null==e?void 0:e.src)===n}var a=r(1811),s=r(38149);let l=1e3;async function u(e,t){if(!e)return{canvases:[],truncated:!1};let r=[],n=1,i=!0;for(;i;){let o=await s.hI.getMemberCanvases(e.orgId,{page:n,pageSize:100,keyword:e.keyword||void 0,accessScope:e.accessScope});if(t.aborted)throw new DOMException("Aborted","AbortError");if(r.push(...o.canvases),i=o.has_more,n+=1,r.length>=l&&i)return a.default.warn({msg:"HomeView: member canvas cap reached, remaining pages skipped",loaded:r.length}),{canvases:r,truncated:!0}}return{canvases:r,truncated:!1}}}}]);

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.