PageSourceSearch

https://app.avance.ai/_next/static/chunks/f84c4b4fc3e638d2.js

js avance.ai collected 2026-10-05 13:29:48 UTC 14,011 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,765032,e=>{"use strict";var l=e.i(435564);let i=(0,e.i(439205).default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);var t=e.i(318869),a=e.i(466780);let s="flex flex-col gap-2 rounded-md border bg-card p-2 shadow-sm transition hover:border-primary/60";function o({label:e,previewSrc:s,icon:o,loading:r,failed:n,failedLabel:c,fit:d}){return s?(0,l.jsx)("img",{src:s,alt:e,className:(0,t.cn)("h-full w-full","cover"===d?"object-cover":"object-contain")}):n?(0,l.jsx)(i,{className:"h-8 w-8 text-muted-foreground","aria-label":c,"aria-hidden":!c||void 0}):o?(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 px-3 py-3",children:[o,(0,l.jsx)("p",{className:"line-clamp-2 w-full text-center text-xs font-medium text-foreground",children:e})]}):r?(0,l.jsx)(a.Skeleton,{className:"h-full w-full rounded-none"}):null}function r({label:e,previewSrc:i,icon:a,caption:r,badge:n,loading:c,failed:d,failedLabel:u,onClick:m,title:p,aspect:x,fit:h,className:g,children:f}){let y=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:(0,t.cn)("relative flex items-center justify-center overflow-hidden rounded-md border bg-background","square"===x?"aspect-square":"aspect-video"),children:[(0,l.jsx)(o,{label:e,previewSrc:i,icon:a,loading:c,failed:d,failedLabel:u,fit:h}),n?(0,l.jsx)("span",{className:"absolute left-2 top-2",children:n}):null]}),r,f]});return m?(0,l.jsx)("button",{type:"button","aria-label":e,title:p,onClick:m,className:(0,t.cn)(s,"text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",g),children:y}):(0,l.jsx)("div",{className:(0,t.cn)(s,g),title:p,children:y})}e.s(["MediaTile",()=>r],765032)},289064,e=>{"use strict";let l=(0,e.i(439205).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",()=>l],289064)},270746,e=>{"use strict";let l=(0,e.i(439205).default)("file-spreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);e.s(["FileSpreadsheet",()=>l],270746)},66434,260218,e=>{"use strict";e.i(131854);var l=e.i(657230);function i(e,i){let t=[{slug:void 0,label:e.modal.collections.all},{slug:l.MediaCollectionSlug.BRAND,label:e.modal.collections.brand},{slug:l.MediaCollectionSlug.MARKETING,label:e.modal.collections.marketing},{slug:l.MediaCollectionSlug.PROMOTIONAL,label:e.modal.collections.promotional},{slug:l.MediaCollectionSlug.DOCUMENTS,label:e.modal.collections.documents},{slug:l.MediaCollectionSlug.STICKER,label:e.modal.collections.stickers}];return i?t.filter(e=>void 0!==e.slug&&i.includes(e.slug)):t}e.s(["buildCollectionOptions",()=>i],66434);var t=e.i(435564),a=e.i(202054),a=a,s=e.i(270746),o=e.i(454994),r=e.i(289064),n=e.i(965957),c=e.i(318869),d=e.i(70392);e.i(2532);var u=e.i(627026),m=e.i(109584),p=e.i(471135),x=e.i(765032);function h(e){return e.includes("spreadsheet")||e.includes("excel")||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===e||"application/vnd.ms-excel"===e?(0,t.jsx)(s.FileSpreadsheet,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0}):e.startsWith("application/")||e.startsWith("text/")?(0,t.jsx)(o.FileText,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0}):(0,t.jsx)(a.default,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0})}e.s(["MediaGalleryAssetCard",0,({asset:e,selected:i=!1,onSelect:a,text:s,className:o})=>{var g,f,y;
1let v,j,{locale:b,timeZone:M}=(0,d.useDisplayPreferences)(),S=e.mimeType??"",C=function(e){let l=e.metadata?.fileName;if("string"==typeof l&&l.length>0)return l;try{let l=new URL(e.publicUrl).pathname.split("/").pop();if(l)return decodeURIComponent(l)}catch{}return`Asset ${e.assetId}`}(e),k=function(e,i){let a=e.type;return a===l.MediaAssetType.IMAGE?{kind:"image"}:a===l.MediaAssetType.VIDEO?{kind:"icon",icon:(0,t.jsx)(n.Video,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0})}:a===l.MediaAssetType.AUDIO?{kind:"icon",icon:(0,t.jsx)(r.Music,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0})}:a===l.MediaAssetType.DOCUMENT?{kind:"icon",icon:h(i)}:i.startsWith("image/")?{kind:"image"}:i.startsWith("video/")?{kind:"icon",icon:(0,t.jsx)(n.Video,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0})}:i.startsWith("audio/")?{kind:"icon",icon:(0,t.jsx)(r.Music,{className:"h-14 w-14 text-muted-foreground","aria-hidden":!0})}:{kind:"icon",icon:h(i)}}(e,S);return(0,t.jsxs)(x.MediaTile,{label:C,previewSrc:"image"===k.kind?e.publicUrl:void 0,icon:"icon"===k.kind?k.icon:void 0,badge:i?(0,t.jsx)(m.Badge,{variant:"default",children:s.selected}):void 0,aspect:"video",fit:"contain",className:(0,c.cn)(i&&"border-primary bg-primary/5",o),caption:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground line-clamp-1",children:C}),(0,t.jsxs)("p",{className:"text-2xs text-muted-foreground",children:[s.uploadedLabel,":"," ",(v=e.dateAdded,j={userTz:M,locale:b},(0,u.formatDateInputToLocalizedDate)(v,{...j,fallback:"--",formatOptions:{month:"short",day:"numeric"}}))]})]}),children:[(0,t.jsxs)("dl",{className:"grid grid-cols-2 gap-2 text-2xs text-muted-foreground",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("dt",{className:"font-medium",children:s.aspectRatioLabel}),(0,t.jsx)("dd",{children:(g=e.aspectRatio,f=e.width,y=e.height,g?`${g.toFixed(2)} : 1`:f&&y?`${f}:${y}`:"--")})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("dt",{className:"font-medium",children:s.fileSizeLabel}),(0,t.jsx)("dd",{children:(e=>{if(!e||e<=0)return"--";let l=["B","KB","MB","GB"],i=e,t=0;for(;i>=1024&&t<l.length-1;)i/=1024,t+=1;return`${i.toFixed(i>=10?0:1)} ${l[t]}`})(e.fileSizeBytes)})]})]}),(0,t.jsx)(p.Button,{variant:i?"secondary":"outline",size:"sm",onClick:()=>a(e),children:i?s.selected:s.select})]})}],260218)},709587,419411,e=>{"use strict";let{Provider:l,useTranslations:i}=(0,e.i(213182).createModuleTranslationContext)("MediaGallery");e.s(["MediaGalleryTranslationProvider",()=>l,"useMediaGalleryTranslations",()=>i],709587),e.i(131854);var t=e.i(657230),a=e.i(17460),s=e.i(948263),o=e.i(668886),r=e.i(312667);let n=e=>e.mediaGallery.collections,c=(0,o.createSelector)([n,(e,l)=>l],(e,l)=>{let i=e[l];return i?i.order.map(e=>i.items[e]).filter(e=>!!e):[]});var d=e.i(31499);function u({accountId:e,collectionSlug:l,autoFetch:i=!0,search:o,visibleStickersScope:u,callerLocationId:m,callerUserId:p}){let x=(0,s.useKernelDispatch)(),h=(0,r.resolveFetchCollectionKey)({accountId:e??"",collectionSlug:l,search:o,visibleStickersScope:u,callerLocationId:m,callerUserId:p}),g=(0,s.useKernelSelector)(e=>n(e)[h]??(0,r.createCollectionState)()),f=(0,s.useKernelSelector)(e=>c(e,h)),y=(0,a.useCallback)(i=>{e&&x((0,d.fetchMediaCollection)({accountId:e,collectionSlug:l,cursor:i,search:o,visibleStickersScope:l===t.MediaCollectionSlug.STICKER?u:void 0,callerLocationId:l===t.MediaCollectionSlug.STICKER?m:void 0,callerUserId:l===t.MediaCollectionSlug.STICKER?p:void 0}))},[e,m,p,l,x,o,u]),v=(0,a.useCallback)(()=>{g.nextCursor&&!g.loading&&y(g.nextCursor)},[g.loading,g.nextCursor,y]);(0,a.useEffect)(()=>{!i||g.loading||g.initialized||y()},[i,g.initialized,g.loading,y]);let j=(0,a.useRef)(o);(0,a.useEffect)(()=>{j.current!==o&&(j.current=o,e&&(x(d.mediaGalleryActions.resetCollection(h)),y()))},[o,e,h,x,y]);let b=(0,a.useRef)(l);return(0,a.useEffect)(()=>{b.current!==l&&(b.current=l,e&&(x(d.mediaGalleryActions.resetCollection(h)),y()))},[l,e,h,x,y]),{items:f,loading:g.loading,error:g.error,hasMore:!!g.nextCursor,initialized:g.initialized,refresh:()=>
1y(),loadMore:v}}e.s(["useMediaGallery",()=>u],419411)},294005,e=>{"use strict";var l=e.i(435564);e.i(131854);var i=e.i(657230),t=e.i(721749),a=e.i(17460),s=e.i(975031),o=e.i(948263),r=e.i(239553),n=e.i(66434),c=e.i(260218);e.i(202469);var d=e.i(877138),u=e.i(709587);e.i(450946);var m=e.i(188575),p=e.i(659921),x=e.i(581509),h=e.i(419411),g=e.i(883700),f=e.i(471135),y=e.i(396725),v=e.i(539946),j=e.i(466780),b=e.i(837169);let M=()=>{},S="__all__";function C(){let e=(0,u.useMediaGalleryTranslations)(),C=(0,s.useTranslations)(),k=(0,r.useAuth)(),T=(0,o.useKernelSelector)(e=>e.account.currentAccount?.accountId??null),N=(0,a.useRef)(null),[A,w]=(0,a.useState)(void 0),[I,R]=(0,a.useState)("account"),[U,B]=(0,a.useState)(""),[E,z]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=window.setTimeout(()=>z(U),300);return()=>window.clearTimeout(e)},[U]);let G=E.trim()||void 0,{items:K,loading:O,error:P,hasMore:L,loadMore:D,refresh:V,initialized:F}=(0,h.useMediaGallery)({accountId:T,collectionSlug:A,search:G,visibleStickersScope:A===i.MediaCollectionSlug.STICKER?I:void 0,callerLocationId:A===i.MediaCollectionSlug.STICKER?k.locationId:void 0,callerUserId:A===i.MediaCollectionSlug.STICKER?k.userId:void 0}),$=A??i.MediaCollectionSlug.BRAND,q="location"===I||"onlyMe"===I?k.locationId:void 0,_="onlyMe"===I?k.userId:void 0,W=(0,n.buildCollectionOptions)(e),H=F&&!O&&0===K.length&&!P,Y=(0,a.useMemo)(()=>({...e.item,select:e.page.viewAsset,selected:e.page.viewAsset}),[e.item,e.page.viewAsset]),Z=(0,a.useCallback)(()=>{let e=N.current?.querySelector('input[type="file"]');e?.click()},[]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.PageHeader,{title:e.page.title,actions:(0,l.jsxs)(f.Button,{type:"button",className:"shrink-0 sm:w-auto",onClick:Z,disabled:!T,children:[(0,l.jsx)(t.Upload,{className:"mr-2 size-4","aria-hidden":!0}),e.page.upload]})}),(0,l.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:T?(0,l.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,l.jsx)(p.AppPanel,{ref:N,className:"shrink-0",children:(0,l.jsx)(p.AppPanelBody,{children:A===i.MediaCollectionSlug.STICKER?(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)(b.ToggleGroup,{type:"single",value:I,onValueChange:e=>{("account"===e||"location"===e||"onlyMe"===e)&&R(e)},size:"sm",className:"w-fit",children:[(0,l.jsx)(b.ToggleGroupItem,{value:"account","aria-label":C.composeText.stickerScopeAccount,children:C.composeText.stickerScopeAccount}),(0,l.jsx)(b.ToggleGroupItem,{value:"location","aria-label":C.composeText.stickerScopeThisLocation,children:C.composeText.stickerScopeThisLocation}),(0,l.jsx)(b.ToggleGroupItem,{value:"onlyMe","aria-label":C.composeText.stickerScopeOnlyMe,children:C.composeText.stickerScopeOnlyMe})]}),(0,l.jsx)(d.MediaUploader,{compact:!0,accountId:T,purpose:i.MediaUploadPurpose.STICKER,collectionSlug:i.MediaCollectionSlug.STICKER,accept:"image/webp,image/png",maxSizeBytes:512e3,locationId:q,scopeUserId:_,onUploadComplete:()=>{V()}})]}):(0,l.jsx)(d.MediaUploader,{compact:!0,accountId:T,purpose:i.MediaUploadPurpose.MEDIA_LIBRARY,collectionSlug:$,onUploadComplete:()=>{V()}})})}),(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsxs)(v.Select,{value:A??S,onValueChange:e=>w(W.find(l=>(l.slug??S)===e)?.slug),children:[(0,l.jsx)(v.SelectTrigger,{controlSize:"sm",className:"w-32 shrink-0 sm:hidden","aria-label":e.page.title,children:(0,l.jsx)(v.SelectValue,{})}),(0,l.jsx)(v.SelectContent,{children:W.map(e=>(0,l.jsx)(v.SelectItem,{value:e.slug??S,children:e.label},e.slug??S))})]}),(0,l.jsx)("div",{className:"hidden flex-wrap gap-2 sm:flex",children:W.map(e=>(0,l.jsx)(f.Button,{type:"button",variant:A===e.slug?"default":"outline",size:"sm",onClick:()=>w(e.slug),children:e.label},e.slug??"all"))}),(0,l.jsx)(y.Input,{placeholder:e.modal.searchPlaceholder,value:U,onChange:e=>B(e.target.value),className:"min-w-0 flex-1 sm:min-w-48 sm:max-w-sm"})]}),P?(0,l.jsxs)(g.Alert,{variant:"destructive",children:[(0,l.jsx)(g.AlertTitle,{children:e.error.title}),(0,l.jsxs)(g.AlertDescription,{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsx)("span",{children:e.error.description}),(0,l.jsx)(f.Button,{size:"sm",type:"button",onClick:()=>void V(),children:e.error.retry})]})]}):null,H?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-md border border-dashed bg-muted/40 px-4 py-6 text-center",children:[(0,l.jsx)("p",{className:"text-sm font-semibold",children:e.empty.title}),(0,l.jsx)("p",{className:"mt-2 max-w-md text-sm text-muted-foreground",children:e.empty.description}),(0,l.jsx)(f.Button,{type:"button",className:"mt-3",onClick:Z,children:e.empty.ctaUpload})]}):(0,l.jsxs)("div",{className:`${m.APP_LAYOUT.workspaceCollectionBody} space-y-3 pb-2`,children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[K.map(e=>(0,l.jsx)(c.MediaGalleryAssetCard,{asset:e,selected:!1,onSelect:M,text:Y},e.assetId)),O?Array.from({length:4}).map((e,i)=>(0,l.jsx)(j.Skeleton,{className:"h-72 w-full rounded-md"},`sk-${i}`)):null]}),L?(0,l.jsx)("div",{className:"flex justify-center pt-2",children:(0,l.jsx)(f.Button,{type:"button",onClick:D,disabled:O,children:O?e.status.loadingMore:e.modal.loadMore})}):null]})]}):(0,l.jsxs)(g.Alert,{children:[(0,l.jsx)(g.AlertTitle,{children:e.error.title}),(0,l.jsx)(g.AlertDescription,{children:e.page.noAccountAlert})]})})]})}function k({galleryLocale:e,text:i}){return(0,l.jsx)(u.MediaGalleryTranslationProvider,{locale:e,text:i,children:(0,l.jsx)(C,{})})}e.s(["MediaLibraryPage",()=>k])}]);

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.