PageSourceSearch

https://blabber.ai/_next/static/chunks/703-b25e03a190c1094e.js

js blabber.ai collected 2026-10-05 12:55:16 UTC 17,390 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:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];if(null!=a)for(var r in a)a.hasOwnProperty(r)&&(e[r]=a[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:blabber-web":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="625b4ac6-ab09-4cd3-87ab-8e82e176eadb",e._sentryDebugIdIdentifier="sentry-dbid-625b4ac6-ab09-4cd3-87ab-8e82e176eadb")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[703],{28338:(e,t,a)=>{a.d(t,{W:()=>b});var r=a(95155),l=a(12115),n=a(66766),i=a(52866),o=a(54165),s=a(30285),c=a(83438),d=a(7383),u=a(59434),m=a(99186),f=a(35169),p=a(14395),h=a(51154),g=a(41066),v=a(27213);function b(e){let{open:t,onOpenChange:a,profileId:b,onSelect:x,mediaFilter:y="all",title:w}=e,_=(0,d.k)(),j=(0,i.createClient)(),[N,k]=(0,l.useState)([]),[C,E]=(0,l.useState)([]),[I,P]=(0,l.useState)(null),[U,L]=(0,l.useState)(!1),[S,T]=(0,l.useState)(!1),[q,z]=(0,l.useState)(null),R=(0,l.useCallback)(async()=>{if(b){L(!0);try{let{data:e,error:t}=await j.from("vault_collections").select("*").eq("creator_profile_id",b).order("sort_order",{ascending:!0}).order("created_at",{ascending:!1});if(t)throw(0,m.i)(t,"Failed to load collections");k(null!=e?e:[])}catch(e){console.error(e),k([])}finally{L(!1)}}},[b,j]),M=(0,l.useCallback)(async e=>{T(!0);try{let t=j.from("vault_media").select("*").eq("collection_id",e).eq("creator_profile_id",b).order("sort_order",{ascending:!0}).order("created_at",{ascending:!1});"image"===y&&(t=t.eq("media_type","image")),"video"===y&&(t=t.eq("media_type","video"));let{data:a,error:r}=await t;if(r)throw(0,m.i)(r,"Failed to load media");E(null!=a?a:[])}catch(e){console.error(e),E([])}finally{T(!1)}},[b,j,y]);(0,l.useEffect)(()=>{if(!t){P(null),E([]);return}R()},[t,R]),(0,l.useEffect)(()=>{I?M(I):E([])},[I,M]);let A=N.find(e=>e.id===I),D=async e=>{z(e.id);try{await x(e),a(!1)}catch(e){}finally{z(null)}};return(0,r.jsx)(o.lG,{open:t,onOpenChange:a,children:(0,r.jsxs)(o.Cf,{className:"max-w-2xl max-h-[85vh] flex flex-col gap-0 p-0 overflow-hidden",children:[(0,r.jsx)(o.c7,{className:"px-5 pt-5 pb-3 border-b border-border shrink-0",children:(0,r.jsxs)(o.L3,{className:"flex items-center gap-2",children:[A?(0,r.jsx)("button",{type:"button",className:"p-1 -ml-1 rounded-md hover:bg-muted",onClick:()=>P(null),"aria-label":_("vault.backToCollections"),children:(0,r.jsx)(f.A,{size:18})}):(0,r.jsx)(p.A,{size:18,className:"text-pink-500"}),null!=w?w:_("vault.pickerTitle"),A?(0,r.jsxs)("span",{className:"text-muted-foreground font-normal text-sm truncate",children:["— ",A.name]}):null]})}),(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-5",children:I?S?(0,r.jsx)("div",{className:"flex justify-center py-16",children:(0,r.jsx)(h.A,{className:"animate-spin text-muted-foreground",size:28})}):0===C.length?(0,r.jsx)("div",{className:"text-center py-16 text-muted-foreground text-sm",children:_("vault.noMediaInCollection")}):(0,r.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-2",children:C.map(e=>{let t=(0,c.Lp)(j,e.storage_path),a=q===e.id;return(0,r.jsxs)("button",{type:"button",disabled:!!q,onClick:()=>void D(e),className:(0,u.cn)("relative aspect-square rounded-lg overflow-hidden border border-border bg-muted group",a&&"ring-2 ring-pink-500"),children:["image"===e.media_type?(0,r.jsx)(n.default,{src:t,alt:"",fill:!0,sizes:"120px",className:"object-cover"}):(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:(0,r.jsx)(g.A,{size:28,className:"text-white/80"})}),(0,r.jsxs)("div",{className:"absolute bottom-1 left-1 flex items-center gap-1 rounded bg-black/60 px-1.5 py-0.5 text-[10px] text-white",children:["image"===e.media_type?(0,r.jsx)(v.A,{size:10}):(0,r.jsx)(g.A,{size:10}),e.media_type]}),a?(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:(0,r.jsx)(h.A,{size:22,className:"animate-spin text-white"})}):null]},e.id)})}):U?(0,r.jsx)("div",{className:"flex justify-center py-16",children:(0,r.jsx)(h.A,{className:"animate-spin text-muted-foreground",size:28})}):0===N.length?(0,r.jsxs)("div",{className:"text-center py-16 text-muted-foreground text-sm",children:[(0,r.jsx)(p.A,{size:32,className:"mx-auto mb-3 opacity-40"}),(0,r.jsx)("p",{children:_("vault.noCollections")}),(0,r.jsx)(s.$,{variant:"link",className:"mt-2 text-pink-500",onClick:()=>{a(!1),window.location.href="/creator-vault"},children:_("vault.openVault")})]}):(0,r.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:N.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>P(e.id),className:"flex items-start gap-3 p-4 rounded-xl border border-border bg-card hover:bg-muted/50 text-left transition",children:[(0,r.jsx)(p.A,{size:20,className:"text-pink-500 shrink-0 mt-0.5"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"font-semibold text-sm truncate",children:e.name}),e.description?(0,r.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-2 mt-0.5",children:e.description}):null]})]},e.id))})})]})})}},56063:(e,t,a)=>{a.d(t,{BG:()=>i,xG:()=>n,xZ:()=>o});let r={local:new Map,session:new Map};function l(e){try{return"local"===e?window.localStorage:window.sessionStorage}catch(e){return null}}function n(e,t){var a,n,i,o;let s=r[e],c=l(e);if(!c)return null!=(a=s.get(t))?a:null;try{return null!=(i=null!=(n=c.getItem(t))?n:s.get(t))?i:null}catch(e){return null!=(o=s.get(t))?o:null}}function i(e,t,a){r[e].set(t,a);let n=l(e);if(n)try{n.setItem(t,a)}catch(e){}}function o(e,t){r[e].delete(t);let a=l(e);if(a)try{a.removeItem(t)}catch(e){}}},75902:(e,t,a)=>{a.d(t,{So:()=>i,eM:()=>c,gT:()=>o,oy:()=>d,yR:()=>s});var r=a(95155),l=a(54165),n=a(59434);let i="h-11 rounded-full px-5 text-sm font-semibold text-[var(--brand-on-accent)] [background:var(--brand-grad)] [box-shadow:var(--brand-ring-money)] hover:brightness-110 disabled:opacity-50",o="h-11 rounded-full px-5",s="h-11 rounded-full px-5 text-sm font-semibold text-white bg-destructive hover:bg-destructive/90 disabled:opacity-50";function c(e){let{open:t,onOpenChange:a,icon:i,title:o,description:s,children:c,footer:d,className:u,size:m="default"}=e;return(0,r.jsx)(l.lG,{open:t,onOpenChange:a,children:(0,r.jsxs)(l.Cf,{className:(0,n.cn)("gap-0 overflow-hidden rounded-2xl border-border/80 p-0 [box-shadow:var(--brand-ring-money)]","wide"===m?"sm:max-w-[440px]":"sm:max-w-[400px]",u),children:[(0,r.jsx)("div",{className:"px-6 pt-6 pb-4",style:{background:"var(--brand-grad-soft)"},children:(0,r.jsxs)("div",{className:"flex items-start gap-3.5",children:[(0,r.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-[var(--brand-on-accent)]",style:{background:"var(--brand-grad)",boxShadow:"var(--brand-ring-money)"},children:(0,r.jsx)(i,{className:"h-5 w-5","aria-hidden":!0})}),(0,r.jsxs)(l.c7,{className:"space-y-1.5 p-0 text-left",children:[(0,r.jsx)(l.L3,{className:"text-lg font-semibold tracking-tight",children:o}),s?(0,r.jsx)(l.rr,{className:"text-sm leading-relaxed text-muted-foreground",children:s}):(0,r.jsx)(l.rr,{className:"sr-only",children:o})]})]})}),(0,r.jsx)("div",{className:"space-y-4 px-6 py-5",children:c}),d?(0,r.jsx)(l.Es,{className:"gap-2 border-t border-border/60 bg-muted/20 px-6 py-4 sm:justify-end",children:d}):null]})})}function d(e){let{icon:t,children:a,accent:l="var(--brand-pink)"}=e;return(0,r.jsxs)("li",{className:"flex gap-3 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/80 bg-card",style:{color:l},children:(0,r.jsx)(t,{className:"h-3.5 w-3.5","aria-hidden":!0})}),(0,r.jsx)("span",{className:"pt-0.5 leading-snug",children:a})]})}},79185:(e,t,a)=>{a.d(t,{PulseUIProvider:()=>m,x:()=>f,T:()=>p});var r=a(95155),l=a(12115),n=a(52866),i=a(71167),o=a(56063),s=a(87358);let c="blabber_pulse_ui";function d(){return"false"===s.env.NEXT_PUBLIC_BLABBER_PULSE_UI?"classic":"pulse"}let u=(0,l.createContext)(null);function m(e){var t;let{children:a}=e,{profile:s,session:m,creator:f}=(0,i.J)(),[p,h]=(0,l.useState)(()=>d()),[g,v]=(0,l.useState)(!1),b=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{let e=function(){let e=(0,o.xG)("local",c);return"classic"===e||"pulse"===e?e:null}();e?h(e):h(d())},[]),(0,l.useEffect)(()=>{document.documentElement.dataset.pulseUi="pulse"===p?"true":"false"},[p]);let x=(0,l.useCallback)(e=>{h(e),(0,o.BG)("local",c,e)},[]),y=!!f,w=(0,l.useCallback)(()=>{v(!0),clearTimeout(b.current),b.current=setTimeout(()=>v(!1),1e4)},[]);(0,l.useEffect)(()=>{var e;if(!(null==m||null==(e=m.user)?void 0:e.id)||!(null==s?void 0:s.id)||!y)return;let t=(0,n.createClient)(),a=s.id,r=t.channel("pulse-earning-".concat(a));return r.on("postgres_changes",{event:"INSERT",schema:"public",table:"tip_transactions",filter:"creator_id=eq.".concat(a)},w),r.on("postgres_changes",{event:"INSERT",schema:"public",table:"subscription_payments",filter:"creator_profile_id=eq.".concat(a)},w),r.on("postgres_changes",{event:"INSERT",schema:"public",table:"call_transactions",filter:"creator_profile_id=eq.".concat(a)},w),r.on("postgres_changes",{event:"UPDATE",schema:"public",table:"call_transactions",filter:"creator_profile_id=eq.".concat(a)},w),r.on("postgres_changes",{event:"INSERT",schema:"public",table:"creator_product_transactions"},async e=>{let r=e.new;if(!(null==r?void 0:r.creator_product_id))return;let{data:l}=await t.from("creator_products").select("creator_profile_id").eq("id",r.creator_product_id).maybeSingle();(null==l?void 0:l.creator_profile_id)===a&&w()}),r.on("postgres_changes",{event:"INSERT",schema:"public",table:"ppv_transactions"},async e=>{let r=e.new;if(!(null==r?void 0:r.post_id))return;let{data:l}=await t.from("posts").select("profile_id").eq("id",r.post_id).maybeSingle();(null==l?void 0:l.profile_id)===a&&w()}),r.subscribe(),()=>{t.removeChannel(r)}},[null==m||null==(t=m.user)?void 0:t.id,null==s?void 0:s.id,y,w]);let _=(0,l.useMemo)(()=>({mode:p,pulseEnabled:"pulse"===p,setMode:x,isEarningLive:g}),[p,x,g]);return(0,r.jsx)(u.Provider,{value:_,children:a})}function f(){let e=(0,l.useContext)(u);if(!e)throw Error("usePulseUI must be used within PulseUIProvider");return e}function p(){return(0,l.useContext)(u)}},83438:(e,t,a)=>{a.d(t,{Gh:()=>h,KD:()=>g,Lp:()=>i,Ps:()=>o,i3:()=>p,my:()=>f});var r=a(87660),l=a(99186);let n="creator-content";function i(e,t){return e.storage.from(n).getPublicUrl(t).data.publicUrl}async function o(e,t,a,r){let{data:n,error:i}=await e.from("vault_collections").insert({creator_profile_id:t,name:a.trim(),description:(null==r?void 0:r.trim())||null}).select("*").single();if(i)throw(0,l.i)(i,"Failed to create vault collection");return n}function s(e){return e&&"object"==typeof e&&"message"in e?String(e.message):String(null!=e?e:"Upload failed")}async function c(e,t,a){let r;try{return await Promise.race([e,new Promise((e,l)=>{r=setTimeout(()=>l(Error("".concat(a," timed out after ").concat(Math.round(t/1e3),"s"))),t)})])}finally{r&&clearTimeout(r)}}async function d(e,t){let a;for(let r=0;r<=t;r++)try{return await e()}catch(e){if(a=e,r>=t||!function(e){let t=s(e).toLowerCase();return t.includes("network")||t.includes("timeout")||t.includes("rate")||t.includes("429")||t.includes("503")||t.includes("fetch")}(e))break;await new Promise(e=>setTimeout(e,400*(r+1)))}throw(0,l.i)(a,"Operation failed after retries")}async function u(e,t,a,i,o,s){var c,d,u;let m=await (0,r.Dq)(i,{forceJpeg:s}),{file:f,mediaType:p,wasNormalized:h}=m,g=crypto.randomUUID(),v=(0,r.Jz)(f,p,h),b="vault/".concat(t,"/").concat(a,"/").concat(g,".").concat(v),x=(0,r.rC)(f,p,h),{error:y}
1=await e.storage.from(n).upload(b,f,{contentType:x,cacheControl:"3600",upsert:!1});if(y)throw(0,l.i)(y,"Storage upload failed");let w=null!=(c=m.width)?c:null,_=null!=(d=m.height)?d:null;if("image"===p&&!o&&!h&&(null==w||null==_))try{let e=await (u=f,new Promise((e,t)=>{let a=URL.createObjectURL(u),r=new Image;r.onload=()=>{URL.revokeObjectURL(a),e({width:r.width,height:r.height})},r.onerror=()=>{URL.revokeObjectURL(a),t(Error("Invalid image"))},r.src=a}));w=e.width,_=e.height}catch(e){}let{data:j,error:N}=await e.from("vault_media").insert({id:g,collection_id:a,creator_profile_id:t,media_type:p,storage_path:b,width:w,height:_}).select("*").single();if(N)throw await e.storage.from(n).remove([b]),(0,l.i)(N,"Failed to insert vault media record");return j}async function m(e,t,a,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},{skipDimensions:o=!1,retries:s=2}=i;return d(()=>c((async()=>{try{return await u(e,t,a,n,o,!1)}catch(i){if("image"!==(0,r.XE)(n))throw(0,l.i)(i);return u(e,t,a,n,o,!0)}})(),18e4,n.name),s)}async function f(e,t,a,l,n){var i,o,c;let d=null!=(i=null==n?void 0:n.concurrency)?i:"undefined"!=typeof navigator&&(0,r.U1)()?1:3,u=null!=(o=null==n?void 0:n.skipDimensions)?o:l.length>1,f=null!=(c=null==n?void 0:n.retries)?c:2,p=[],h=[],g=0,v=()=>{var e;null==n||null==(e=n.onProgress)||e.call(n,{total:l.length,completed:g,succeeded:p.length,failed:h.length})};v();let b=0;async function x(){for(;;){let r=b++;if(r>=l.length)return;let n=l[r];try{let r=await m(e,t,a,n,{skipDimensions:u,retries:f});p.push(r)}catch(e){h.push({name:n.name,message:s(e)})}finally{g++,v()}}}return await Promise.all(Array.from({length:Math.min(d,l.length)},()=>x())),{succeeded:p,failed:h}}async function p(e,t,a){let r=[a.storage_path,a.thumbnail_path].filter(Boolean);r.length&&await e.storage.from(n).remove(r);let{error:i}=await e.from("vault_media").delete().eq("id",a.id).eq("creator_profile_id",t);if(i)throw(0,l.i)(i,"Failed to delete vault media")}async function h(e,t,a){var r;let{data:i,error:o}=await e.from("vault_media").select("id, storage_path, thumbnail_path").eq("collection_id",a).eq("creator_profile_id",t);if(o)throw(0,l.i)(o,"Failed to fetch vault media");let s=null!=(r=null==i?void 0:i.flatMap(e=>[e.storage_path,e.thumbnail_path].filter(Boolean)))?r:[];s.length&&await e.storage.from(n).remove(s);let{error:c}=await e.from("vault_collections").delete().eq("id",a).eq("creator_profile_id",t);if(c)throw(0,l.i)(c,"Failed to delete vault collection")}async function g(e,t){let a=t.storage_path.split(".").pop()||("video"===t.media_type?"mp4":"jpg"),r="video"===t.media_type?"video/mp4":"image/jpeg",{data:l,error:o}=await e.storage.from(n).download(t.storage_path);if(!o&&l){let e=l.type||r;return new File([l],"vault-".concat(t.id,".").concat(a),{type:e})}let s=i(e,t.storage_path),c=await fetch(s);if(!c.ok)throw Error((null==o?void 0:o.message)||"Failed to fetch vault media (".concat(c.status,")"));let d=await c.blob();return new File([d],"vault-".concat(t.id,".").concat(a),{type:d.type||r})}},87660:(e,t,a)=>{a.d(t,{D0:()=>n,Dq:()=>s,Jz:()=>c,U1:()=>u,XE:()=>i,ZH:()=>m,rC:()=>d});let r=/\.(jpe?g|png|gif|webp|heic|heif)$/i,l=/\.(mp4|mov|webm|m4v)$/i;function n(e){let t=(e.type||"").toLowerCase();return!!(t.startsWith("image/")||t.startsWith("video/")||r.test(e.name)||l.test(e.name)||!t&&/^img[_-]/i.test(e.name))}function i(e){return e.type.startsWith("video/")||l.test(e.name)?"video":"image"}async function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.9;if("undefined"==typeof document)return null;let a=URL.createObjectURL(e);try{let r=await new Promise((e,t)=>{let r=new window.Image;r.onload=()=>e(r),r.onerror=()=>t(Error("Image decode failed")),r.src=a}),l=r.naturalWidth||r.width,n=r.naturalHeight||r.height;if(!l||!n)return null;let i=document.createElement("canvas");i.width=l,i.height=n;let o=i.getContext("2d");if(!o)return null;o.drawImage(r,0,0,l,n);let s=await new Promise(e=>{i.toBlob(t=>e(t),"image/jpeg",t)});if(!s)return null;return{file:new File([s],"".concat(e.name.replace(/\.[^.]+$/,"").trim()||"image",".jpg"),{type:"image/jpeg"}),width:l,height:n}}catch(e){return null}finally{URL.revokeObjectURL(a)}}async function s(e,t){if("video"===i(e))return{file:e,mediaType:"video",wasNormalized:!1};if((null==t?void 0:t.forceJpeg)===!0||function(e){if("image/gif"===e.type)return!1;if(function(e){let t=(e.type||"").toLowerCase();return!!("image/heic"===t||"image/heif"===t||/\.hei[cf]$/i.test(e.name))}(e))return!0;let t=(e.type||"").toLowerCase();return!!(!t&&/^img[_-]/i.test(e.name))||"application/octet-stream"
1===t&&"image"===i(e)}(e)){let a=await o(e);if(a)return{file:a.file,mediaType:"image",width:a.width,height:a.height,wasNormalized:!0};if(null==t?void 0:t.forceJpeg)throw Error("Could not convert image to JPEG")}return{file:e,mediaType:"image",wasNormalized:!1}}function c(e,t,a){var r,l,n;if(a)return"jpg";let i=null==(r=e.name.split(".").pop())?void 0:r.toLowerCase();if(i&&/^[a-z0-9]{1,8}$/.test(i))return i;let o=null==(n=e.type.split("/")[1])||null==(l=n.split(";")[0])?void 0:l.trim().toLowerCase();return o&&/^[a-z0-9]{1,8}$/.test(o)?"heic"===o||"heif"===o?"jpg":o:"video"===t?"mp4":"jpg"}function d(e,t,a){return a?"image/jpeg":e.type?e.type:"video"===t?"video/mp4":"image/jpeg"}function u(){return"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)}let m=15}}]);

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.