PageSourceSearch

https://www.idcolab.com/_next/static/chunks/87365-b5cde1e48172ab66.js

js idcolab.com collected 2026-09-24 11:06:39 UTC 12,849 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c1baf8c2-ae95-4b1f-acb9-814420db1eee",e._sentryDebugIdIdentifier="sentry-dbid-c1baf8c2-ae95-4b1f-acb9-814420db1eee")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87365],{87365:(e,t,r)=>{r.r(t),r.d(t,{default:()=>z});var n=r(95155),i=r(12115),l=r(67909);r(68080);var a=r(5223),s=r(1213),u=r(48242),c=r(9084),d=r(11929),o=r(97412),f=r(28079),p=r(17815),b=r(74923),m=r(21980),g=r(51047),h=r(51575),I=r(98659),w=r(94637),v=r(66121),S=r(26860),y=r(30646),j=r(97250),x=r(5016),E=r(52106),R=r(42878),k=r(6092),N=r(57830);let A=(0,l.default)(async()=>(await Promise.resolve().then(r.bind(r,5223))).Excalidraw,{loadableGenerated:{webpack:()=>[5223]},ssr:!1}),z=e=>{let{isViewer:t=!1}=e,r=(0,s.wA)(),{isDemo:l}=(0,g.z)(),{successNotify:z,errorNotify:P}=(0,f.A)(),{userDetails:T}=(0,p.A)(),{isWhiteboardModalOpen:D,selectedFileOrFolder:C,isCommentSectionExpanded:F,viewerModal:$}=(0,s.d4)(e=>e.contextMenu),{selectedProject:B}=(0,s.d4)(e=>e.project),{activeCategory:L}=(0,s.d4)(e=>e.fileExplorer),{refetch:M}=(0,h.A)(L??""),[O]=(0,c.U5)(),[U]=(0,c.fY)(),[_,G]=(0,i.useState)(!0),[W,J]=(0,i.useState)("idle"),[V,H]=(0,i.useState)(""),[K,Y]=(0,i.useState)(!1),[q,Q]=(0,i.useState)(180),X=(0,i.useRef)(""),Z=(0,i.useRef)(!1),ee=(0,i.useRef)(null),et=(0,i.useRef)(!1),er=(0,i.useRef)(!1),en=(0,i.useRef)(null),ei=(0,i.useRef)(null),el=(0,i.useRef)(!0),ea=(0,i.useRef)(""),es=(0,i.useRef)(!1),eu=(0,i.useRef)(null),ec=(0,i.useRef)(!1),ed=(0,i.useRef)(!1),eo=(0,i.useRef)(!1),ef=(0,i.useRef)(""),ep=(0,i.useRef)(""),eb=(0,i.useRef)({elements:[],appState:{...w.B},files:{}}),em=(0,i.useRef)(""),eg=(0,i.useRef)(null),eh=(0,i.useRef)(null),eI=(0,i.useRef)(null);(0,i.useEffect)(()=>{X.current=V},[V]),(0,i.useEffect)(()=>{eh.current&&Q(Math.min(eh.current.offsetWidth+32,420))},[V,_]),(0,i.useEffect)(()=>{ee.current=C},[C]);let{canEdit:ew}=(0,b.A)(C?.projectId||B?.guid),ev=!!C?.userId&&!!T?.id&&C.userId===T.id,eS=(0,i.useRef)(!1);(0,i.useEffect)(()=>{eS.current=K},[K]);let ey=(0,i.useRef)(null),ej=(0,I.A)({enabled:!l&&(t?!!$:D)&&!!C?.fileId&&!_,fileId:C?.fileId,projectId:C?.projectId||B?.guid,initialIsPublic:C?.isPublished===!0,excalidrawAPIRef:en,onPersisted:e=>{let{fileS3Id:t,thumbnailS3Id:n}=e,i=ee.current;if(!i?.fileId||er.current)return;et.current=!0;let l={...i,fileS3Id:t,...n?{thumbnailS3Id:n}:{}};ee.current=l,r((0,u.$j)(l));let a=en.current;if(a){let e=eN(a.getSceneElementsIncludingDeleted());ef.current=e,ep.current=e}Z.current=!1,J("saved")},onTitle:e=>{eS.current||(H(e),X.current=e,Z.current=!0,eF())},onPeerJoined:()=>{!er.current&&ee.current?.fileId&&(Z.current=!0,eA(),ey.current?.(!1))}}),ex=()=>ej.presenceKnownRef.current?!ej.othersPresentRef.current||ej.isLeaderRef.current:!ej.everHadOthersRef.current,eE=!l&&(!C?.fileId||ew||ej.isPublicLive),eR=!C?.fileId||ew,ek=(0,i.useRef)(!1);(0,i.useEffect)(()=>{let e=ex(),r=t?!!$:D;e&&r&&!ek.current&&Z.current&&ee.current?.fileId&&!er.current&&(eA(),ey.current?.(!1)),ek.current=e},[ej.isLeader,ej.othersPresent]),(0,i.useEffect)(()=>{let e=()=>{!er.current&&Z.current&&ex()&&ey.current?.(!1)},t=e=>{!er.current&&Z.current&&ex()&&(ey.current?.(!1),e.preventDefault(),e.returnValue="")};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",t),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",t)}},[]);let eN=e=>JSON.stringify((e||[]).filter(e=>!e.isDeleted)),eA=()=>{ei.current&&(clearTimeout(ei.current),ei.current=null)},ez=()=>{eA(),en.current=null,el.current=!0,es.current=!1,eu.current=null,ec.current=!1,ed.current=!1,eo.current=!1,Z.current=!1,eb.current={elements:[],appState:{...w.B},files:{}},ea.current="",ef.current="",ep.current=""};(0,i.useEffect)(()=>{if(!t&&D&&(er.current=!1,!ee.current?.fileId)){ez(),em.current=`new-${(0,d.A)()}`;let e="Untitled Mood Board";H(e),X.current=e,J("idle"),Y(!1),G(!1)}},[D,t]),(0,i.useEffect)(()=>
1{if(et.current){et.current=!1,ee.current=C;return}async function e(e){let t,r=await fetch((0,m.dE)(e));if(!r.ok){let e=Error(`Whiteboard scene fetch failed: ${r.status}`);throw e.gone=403===r.status||404===r.status,e}let n=(t=await r.json(),{elements:t?.elements||[],appState:{...t?.appState,...w.B,collaborators:t?.appState?.collaborators instanceof Map?t.appState.collaborators:new Map(Object.entries(t?.appState?.collaborators||{}))},files:t?.files||{}});eb.current=n,(n.elements||[]).some(e=>!e.isDeleted)&&(ed.current=!0);let i=eN(n.elements);ea.current=i,ef.current=i,J("saved")}async function n(t){try{let n=await M(),i=(0,v.iu)(n?.data,C?.fileId);if(i?.fileS3Id&&i.fileS3Id!==C?.fileS3Id){await e(i.fileS3Id),et.current=!0;let t={...C,fileS3Id:i.fileS3Id,...i.thumbnailS3Id?{thumbnailS3Id:i.thumbnailS3Id}:{}};return ee.current=t,r((0,u.$j)(t)),{loaded:!0,contentGone:!1}}return{loaded:!1,contentGone:t?.gone===!0}}catch(e){return{loaded:!1,contentGone:e?.gone===!0}}}async function i(){try{let t=C?.fileName||"Untitled Mood Board";if(H(t),X.current=t,!C?.fileS3Id)return;let n=C.fileS3Id;if(C?.fileId)try{let e=await (0,v.CO)(C.fileId);e?.fileS3Id&&(n=e.fileS3Id)}catch(e){console.log("Whiteboard record lookup failed:",e)}if(await e(n),n!==C.fileS3Id){et.current=!0;let e={...C,fileS3Id:n};ee.current=e,r((0,u.$j)(e))}}catch(t){console.log("Whiteboard Load Error:",t);let e=await n(t);if(e.loaded)return;e.contentGone?P("Couldn't load the previous mood board content"):(ec.current=!0,J("failed"),P("Failed to load mood board content"))}finally{G(!1)}}!er.current&&(t||D)&&(!t||C?.fileType!=="application/json"||C?.thumbnailS3Id)&&(el.current=!0,em.current=C?.fileId||`new-${(0,d.A)()}`,ec.current=!1,ed.current=!1,eo.current=!1,G(!0),J("idle"),Y(!1),i())},[C]);let[eP,eT]=(0,i.useState)("light");(0,i.useEffect)(()=>{let e=()=>eT(document.documentElement.classList.contains("dark")?"dark":"light");e();let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]});let r=t=>{"theme"===t.key&&e()};return window.addEventListener("storage",r),()=>{t.disconnect(),window.removeEventListener("storage",r)}},[]),(0,i.useEffect)(()=>{if(t)if($)er.current=!1;else{let e=()=>{er.current=!0,ez(),H(""),X.current="",J("idle"),G(!0),r((0,u.$j)(null))};if(es.current&&eu.current)return void eu.current.finally(e);if(Z.current&&!es.current&&ex()){eA();let t=ey.current?.(!1);if(t)return void t.finally(e)}e()}},[$,t]),(0,i.useEffect)(()=>()=>{er.current=!0,ez()},[]);let eD=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(es.current)return eu.current??Promise.resolve();if(er.current||!eE||ec.current||!ex()||!Z.current&&!e&&ee.current?.fileId)return Promise.resolve();let t=eC(e);return eu.current=t,t},eC=async e=>{es.current=!0,eA(),J("saving"),await new Promise(e=>setTimeout(e,0));let t=Date.now();try{let n=en.current;if(!n)return void J("unsaved");let i=n.getSceneElements().filter(e=>!e.isDeleted),l=n.getAppState(),s=n.getFiles(),c=X.current,f=ee.current,p=new Blob([JSON.stringify({elements:i,appState:l,files:s})],{type:"application/json"}),b=!!f?.fileId,m=ed.current||(Number(f?.fileSize)||0)>4096;if(b&&0===i.length&&m){if(!(!eo.current&&window.confirm("This canvas is empty but the saved Mood Board has content. Replace the saved Mood Board with an empty one?"))){eo.current=!0,J("unsaved");return}ed.current=!1}let g=(0,d.A)(),h=(0,d.A)(),I=new File([p],`${c}.json`,{type:"application/json"}),w=await (0,a.exportToBlob)({elements:i,appState:l,files:s,mimeType:"image/png",quality:.8}),v=new File([w],`${c}.png`,{type:"image/png"}),S=[{originalFile:{file:I,fileName:g,fileType:"application/json"},thumbnail:{file:v,fileName:h,fileType:"image/png"}}];if(b){let t=I.size||0,n=v.size||0,i=ej.peekSidecarCleanup(),l={...i.length>0?{cleanupS3Ids:i}:{},fileId:f.fileId,postId:f.postId,projectId:f.projectId,fileDescription:c,fileS3Id:g,thumbnailS3Id:h,fileSize:t,thumbnailSize:n,sizeStats:{category:o.b7.MOODBOARD,totalSizeFiles:t,totalFilesCount:1,totalThumbnailSize:n,totalThumbnailCount:1,totalSize:t+n,totalCount:2},oldFileS3Id:f.fileS3Id,oldThumbnailS3Id:f.thumbnailS3Id,fileName:c};await U({updateData:l,presignedUploadData:S}).unwrap(),ej.clearSidecarCleanup(i),ej.broadcastPersisted({fileS3Id:g,thumbnailS3Id:h}),et.current=!0,r((0,u.$j)({...f,fileS3Id:g,thumbnailS3Id:h,fileName:c,fileSize:t,thumbnailSize:n})),e&&z("Mood Board Saved")}else{let e={userId:T?.id,projectId:B?.guid,category:f?.category||o.b7.MOODBOARD,fileCategory:o.NL.FILES,postId:(0,d.A)(),postDescription:"",isBlocker:0,isFeed:0,taggedUser:[],parentFolderId:f?.parentFolderId||"ROOT",posts:[{fileDescription:c,fileName:c,fileType:"application/json",fileS3Id:g,thumbnailS3Id:h,newPost:!0,fileSize:I.size,thumbnailSize:v.size}]},t=await O({uploadData:e,presignedUploadData:S}
1).unwrap(),n=t?.fileIds?.[0]??t?.data?.fileIds?.[0];if(!n)throw Error("Whiteboard create response missing fileId");let i={...f,fileId:n,postId:e.postId,fileName:c,fileS3Id:g,thumbnailS3Id:h,userId:T?.id,projectId:B?.guid};ee.current=i,et.current=!0,r((0,u.$j)(i)),z("Mood Board Created")}let y=Date.now()-t;y<600&&await new Promise(e=>setTimeout(e,600-y));let j=eN(i);ea.current=j,ef.current=j,ep.current=j;let x=en.current,E=x?eN(x.getSceneElements()):j;E!==j?(Z.current=!0,ep.current=E,J("unsaved"),eF()):(Z.current=!1,J("saved")),M()}catch(e){console.log("Auto Save Error:",e),er.current||(J("failed"),P("Failed to save mood board"))}finally{es.current=!1}};ey.current=eD;let eF=()=>{eA(),ei.current=setTimeout(()=>eD(!1),2e3)},e$=async()=>{eA(),es.current&&eu.current&&await eu.current,Z.current&&!es.current&&eE&&ex()&&await eD(!1),er.current=!0,ez(),r((0,u.$j)(null)),r((0,u.L$)(!1))};if(!D&&!t)return null;let eB={saving:{icon:(0,n.jsx)(k.Kh2,{className:"animate-pulse",size:15}),label:"Saving...",cls:"text-dark-2 dark:text-light-5"},saved:{icon:(0,n.jsx)(k.HVJ,{size:15}),label:"Saved",cls:"text-green-1"},unsaved:{icon:(0,n.jsx)(k.dtz,{size:15}),label:"Unsaved changes",cls:"text-yellow"},failed:{icon:(0,n.jsx)(k.YPd,{size:15}),label:"Save failed",cls:"text-red-1"}},eL="idle"!==W?eB[W]:null,eM=(0,n.jsxs)("div",{ref:eI,className:`idc-whiteboard bg-light-0 dark:bg-dark-2 overflow-hidden relative h-full w-full ${t&&F?"lg:w-[calc(100%-min(20vw,26.25rem))]":""}`,style:{transition:"width 0.3s ease-in-out"},children:[!_&&(0,n.jsxs)("div",{className:"absolute top-3 left-4 z-10 flex max-w-[min(45vw,320px)] items-center gap-1",children:[(0,n.jsx)("span",{ref:eh,"aria-hidden":!0,className:"pointer-events-none invisible absolute text-sm font-medium px-2.5 whitespace-pre",children:V||"Untitled"}),(0,n.jsx)("input",{ref:eg,value:V||"",disabled:!eR,style:{width:Math.max(80,q)},onFocus:()=>{eR&&Y(!0)},onChange:e=>{if(!eR)return;let t=e.target.value;H(t),X.current=t,Z.current=!0,J("unsaved"),ej.broadcastTitle(t),ex()&&eF()},onBlur:()=>{Y(!1),eR&&Z.current&&(eA(),eD(!1))},className:(0,E.jp)("default","sm",`backdrop-blur bg-light-0/80 dark:bg-dark-2/80 ${eR?"cursor-text":"border-transparent bg-transparent dark:bg-transparent cursor-default"}`)}),eR&&!K&&(0,n.jsx)(x.Ay,{variant:"ghost",size:"sm","aria-label":"Edit title",icon:(0,n.jsx)(N._51,{size:15}),onClick:()=>{Y(!0),eg.current?.focus()},className:"shrink-0 px-2! py-2!"})]}),(0,n.jsx)(j.A,{containerRef:eI,excalidrawAPIRef:en,enabled:!_&&eE,projectId:C?.projectId||B?.guid,userId:T?.id,currentUserAccess:B?.currentUserAccess,onError:P}),(0,n.jsx)("div",{className:"h-full",children:!_&&(0,n.jsx)(A,{viewModeEnabled:!eE,isCollaborating:ej.othersPresent,onPointerUpdate:ej.handlePointerUpdate,excalidrawAPI:e=>{en.current=e,ej.seedFromCanvas()},initialData:eb.current,theme:eP,renderTopRightUI:()=>(0,n.jsxs)("div",{className:`flex items-center gap-2 ${t?F?"mr-4":"mr-22":""}`,children:[eL&&(0,n.jsxs)("div",{className:`flex items-center gap-1.5 text-xs whitespace-nowrap ${eL.cls}`,children:[eL.icon,(0,n.jsx)("span",{className:"hidden sm:inline",children:eL.label})]}),(0,n.jsx)(S.A,{users:ej.activeUsers,currentUserId:T?.id}),ev&&ew&&!!C?.fileId&&(0,n.jsx)(y.A,{isPublic:ej.isPublicLive,disabled:!ej.connected,onToggle:ej.toggleVisibility}),!t&&(0,n.jsx)(x.Ay,{variant:"outline",size:"sm","aria-label":"Close mood board",icon:(0,n.jsx)(R.$8F,{size:20}),onClick:e$,className:"px-2! py-2!"})]}),onChange:e=>{if(!eE)return;if(e.some(e=>!e.isDeleted)&&(ed.current=!0,eo.current=!1),el.current){el.current=!1;return}let t=eN(e);if(t!==ea.current&&t!==ef.current)ej.broadcastSceneChange(),Z.current=!0,!es.current&&t!==ep.current&&(ep.current=t,J("unsaved"),ex()&&eF())}},em.current)})]});return t?eM:(0,n.jsx)("div",{className:"fixed inset-0 z-9999 bg-light-0 dark:bg-dark-2",children:eM})}}}]);

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.