PageSourceSearch

https://www.instaloops.com/_next/static/chunks/21213-d062b91311a1f8e6.js?dpl=dpl_7CPoWkAiPqTovoki6vBoTDFPVrWX

js instaloops.com collected 2026-10-09 22:41:35 UTC 57,095 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21213],{5277:function(e,t,n){n.d(t,{Z:function(){return ew}});var r=n(65724),i=n(78095),a=n(78883),s=n(92169),l=n(34102),o=n(2512),d=n(42494),c=n(4156),u=n(64376);let m={id:"draft",label:"Write a first draft",instruction:"Write a first draft of a short social post on the topic the person gives you. Match how they'd actually talk.",needsTopic:!0},h={id:"sharpen",label:"Sharpen it",instruction:"Tighten this draft. Keep the person's voice, their point and their facts. Cut padding, not substance."},p={id:"shorten",label:"Make it shorter",instruction:"Cut this draft down substantially while keeping its point and its voice."},x={id:"hook",label:"Stronger opening",instruction:"Rewrite only the opening line so it earns attention, then leave the rest of the draft as it is. Return the whole post."},g={id:"expand",label:"Say more",instruction:"Develop this draft a little further in the same voice — one or two more sentences of substance, not padding."};var b=n(76205),v=n(24026),f=n(87846),y=e=>{var t;let{draft:n,onApply:i,disabled:a}=e,[s,l]=(0,o.useState)(!1),[d,c]=(0,o.useState)(""),[y,w]=(0,o.useState)(null),[j,N]=(0,o.useState)(""),[k,C]=(0,o.useState)(!1),[_,S]=(0,o.useState)(null),[A,I]=(0,o.useState)(null),M=(0,o.useRef)(null),E=(0,o.useRef)(null),L=function(e){let t=e.trim();if(t.length<12)return[m];let n=[h,x];return t.length>=180?n.push(p):n.push(g),n}(n),R=null!==y,T=(0,o.useCallback)(()=>{var e;null===(e=E.current)||void 0===e||e.abort(),E.current=null,l(!1),w(null),N(""),C(!1),S(null),c("")},[]);(0,o.useEffect)(()=>{if(!s)return;let e=e=>{"Escape"===e.key&&T()},t=e=>{var t;(null===(t=M.current)||void 0===t?void 0:t.contains(e.target))||T()};return document.addEventListener("keydown",e),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t)}},[s,T]);let D=(0,o.useCallback)(async e=>{if(E.current)return;w(e),N(""),C(!1),S(null);let t=new AbortController;E.current=t;let r=await (0,f.a)({body:{question:function(e,t,n){let r=t.trim();if(e.needsTopic){let t=null==n?void 0:n.trim();return t?"".concat(e.instruction,"\n\nTopic:\n<topic>\n").concat(t,"\n</topic>"):"".concat(e.instruction,"\n\nThe person hasn't said what it should be about yet. Ask them, in one short line.")}return"".concat(e.instruction,"\n\n<draft>\n").concat(r,"\n</draft>")}(e,n,d),intent:"compose"},signal:t.signal,onChunk:N});if(E.current=null,w(null),"failed"===r.status){S({reason:r.reason,message:u.I[r.reason]}),N("");return}C("interrupted"===r.status),N(r.text)},[n,d]),F=(0,o.useCallback)(()=>{I(n),i(j.trim()),l(!1),N(""),C(!1)},[n,i,j]),Z=(0,o.useCallback)(()=>{null!==A&&(i(A),I(null))},[i,A]);return(0,r.jsxs)("div",{ref:M,className:"relative",children:[(0,r.jsx)("button",{type:"button",onClick:()=>s?T():l(!0),disabled:a,"aria-label":"Write with Clarua","aria-haspopup":"dialog","aria-expanded":s,title:"Write with Clarua",className:(0,b.cn)("rounded-md p-2 text-gray-500 transition-colors","hover:bg-[#db1802]/10 hover:text-[#db1802]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand","disabled:cursor-not-allowed disabled:opacity-50",s&&"bg-[#db1802]/10 text-[#db1802]"),children:(0,r.jsx)(v.Z,{className:"h-5 w-5"})}),null!==A&&!s&&(0,r.jsx)("button",{type:"button",onClick:Z,className:"absolute bottom-full left-0 mb-1 whitespace-nowrap rounded-md bg-[rgb(15,20,25)] px-2.5 py-1 text-[12px] font-medium text-white",children:"Undo Clarua's edit"}),s&&(0,r.jsxs)("div",{role:"dialog","aria-label":"Write with Clarua",className:"absolute bottom-full left-0 z-50 mb-2 w-[min(88vw,420px)] rounded-xl border border-gray-200 bg-white p-3 shadow-xl",children:[!j&&!R&&!_&&(0,r.jsxs)(r.Fragment,{children:[(null===(t=L[0])||void 0===t?void 0:t.needsTopic)&&(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{htmlFor:"clarua-topic",className:"mb-1 block text-[12px] font-medium text-[rgb(83,100,113)]",children:"What should the post be about?"}),(0,r.jsx)("input",{id:"clarua-topic",value:d,onChange:e=>c(e.target.value),placeholder:"shipping on Fridays",className:"w-full rounded-lg bg-[rgb(247,249,249)] px-3 py-2 text-[14px] text-[rgb(15,20,25)] placeholder:text-[rgb(83,100,113)] focus:outline-none focus:ring-2 focus:ring-[#db1802]/40"})]}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:L.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>void D(e),className:"rounded-lg px-3 py-2 text-left text-[14px] font-medium text-[rgb(15,20,25)] transition-colors hover:bg-[#db1802]/[0.06] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#db1802]",children:e.label},e.id))}),(0,r.jsx)("p",{className:"mt-2 border-t border-gray-100 pt-2 text-[11px] leading-snug text-[rgb(83,100,113)]",children:"Your draft is sent to Clarua to work on. Nothing is posted until you post it."})]}),(R||j)&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-1.5 text-[12px] font-semibold text-[rgb(83,100,113)]",children:R?"Clarua is writing…":"Clarua suggests"}),(0,r.jsx)("div",{"aria-live":"polite","aria-busy":R,className:"max-h-56 overflow-y-auto whitespace-pre-wrap break-words rounded-lg bg-[rgb(247,249,249)] px-3 py-2 text-[14px] leading-normal text-[rgb(15,20,25)]",children:j||"…"}),k&&(0,r.jsx)("p",{className:"mt-1 text-[12px] text-[rgb(83,100,113)]",children:"Clarua stopped early — this suggestion is unfinished."}),!R&&j&&(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:F,className:"rounded-full bg-[#db1802] px-3.5 py-1.5 text-[13px] font-semibold text-white transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#db1802] focus-visible:ring-offset-2",children:"Use this"}),(0,r.jsx)("button",{type:"button",onClick:T,className:"rounded-full px-3 py-1.5 text-[13px] font-medium text-[rgb(83,100,113)] transition-colors hover:bg-[rgb(247,249,249)] focu
1s-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#db1802]",children:"Keep mine"})]})]}),_&&(0,r.jsx)("div",{role:"alert",className:"text-[13px] leading-normal text-[rgb(83,100,113)]",children:_.message})]})]})},w=n(27802),j=n(11528),N=n(74046),k=n(21361);let C=e=>e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>{var t,n;return null!==(n=null===(t=e[0])||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:""}).join("")||"?";var _=function(e){let{isOpen:t,suggestions:n,activeIndex:i,listboxId:l,onSelect:o,onHover:d,placement:c="bottom",className:u}=e;return(0,r.jsx)(a.M,{children:t&&(0,r.jsx)(s.E.ul,{id:l,role:"listbox","aria-label":"People you can mention",initial:{opacity:0,y:"top"===c?4:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:"top"===c?4:-4},transition:{duration:.12},className:(0,b.cn)("absolute left-0 z-50 max-h-72 w-full min-w-[260px] max-w-sm overflow-y-auto","rounded-xl border border-gray-200 bg-white py-1 shadow-xl","top"===c?"bottom-full mb-2":"top-full mt-2",u),children:n.map((e,t)=>{let n=t===i;return(0,r.jsx)("li",{id:"".concat(l,"-option-").concat(t),role:"option","aria-selected":n,children:(0,r.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),o(e)},onMouseEnter:()=>d(t),className:(0,b.cn)("flex w-full items-center gap-3 px-3 py-2 text-left transition-colors",n?"bg-sky-50":"hover:bg-gray-50"),children:[(0,r.jsxs)(N.Avatar,{className:"h-9 w-9 shrink-0",children:[(0,r.jsx)(N.AvatarImage,{src:(0,k.J)(e.profile_image)||"",alt:""}),(0,r.jsx)(N.AvatarFallback,{className:"bg-gradient-to-br from-sky-400 to-blue-600 text-xs font-semibold text-white",children:C(e.display_name)})]}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"truncate text-[15px] font-semibold text-gray-900",children:e.display_name}),e.is_following&&(0,r.jsx)("span",{className:"shrink-0 rounded-full bg-gray-100 px-1.5 py-0.5 text-[11px] font-medium text-gray-600",children:"Following"})]}),(0,r.jsxs)("span",{className:"block truncate text-[13px] text-gray-500",children:["@",e.user_name,e.tagline?" \xb7 ".concat(e.tagline):""]})]})]})},e.community_user_id)})})})},S=n(54211);let A=[{label:"5 minutes",minutes:5},{label:"1 hour",minutes:60},{label:"6 hours",minutes:360},{label:"1 day",minutes:1440},{label:"3 days",minutes:4320},{label:"7 days",minutes:10080}],I=()=>({options:["",""],durationMinutes:1440});var M=function(e){let{value:t,onChange:n,onRemove:i,disabled:a=!1}=e,s=(0,o.useId)(),{errors:l}=(0,S.SG)({options:t.options,durationMinutes:t.durationMinutes}),d=t.options.some(e=>e.trim().length>0)?l:[],c=(e,r)=>{let i=[...t.options];i[e]=r,n({...t,options:i})},u=e=>
1{t.options.length<=S.Ei||n({...t,options:t.options.filter((t,n)=>n!==e)})};return(0,r.jsxs)("div",{className:"mt-3 rounded-xl border border-gray-200 p-3",children:[(0,r.jsx)("div",{className:"flex flex-col gap-2",children:t.options.map((e,n)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"text",value:e,disabled:a,maxLength:S.M2,onChange:e=>c(n,e.target.value),placeholder:"Choice ".concat(n+1),"aria-label":"Poll choice ".concat(n+1),className:(0,b.cn)("w-full rounded-lg border border-gray-200 px-3 py-2","text-[14px] text-gray-900 placeholder:text-gray-400","focus:border-gray-300 focus:outline-none focus:ring-2 focus:ring-sky-200")}),t.options.length>S.Ei&&(0,r.jsx)("button",{type:"button",onClick:()=>u(n),disabled:a,"aria-label":"Remove choice ".concat(n+1),className:"shrink-0 rounded-full p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M18 6 6 18M6 6l12 12"})})})]},n))}),t.options.length<S.wj&&(0,r.jsx)("button",{type:"button",onClick:()=>{t.options.length>=S.wj||n({...t,options:[...t.options,""]})},disabled:a,className:"mt-2 rounded-full px-3 py-1 text-[13px] font-semibold text-sky-600 transition-colors hover:bg-sky-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400",children:"Add choice"}),d.length>0&&(0,r.jsx)("ul",{role:"alert",className:"mt-2 space-y-0.5",children:d.map(e=>(0,r.jsx)("li",{className:"text-[13px] text-red-600",children:(0,S.y6)(e)},e))}),(0,r.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-3 border-t border-gray-100 pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("label",{htmlFor:s,className:"text-[13px] font-medium text-gray-700",children:"Poll length"}),(0,r.jsx)("select",{id:s,value:t.durationMinutes,disabled:a,onChange:e=>n({...t,durationMinutes:Number(e.target.value)}),className:"rounded-lg border border-gray-200 px-2 py-1 text-[13px] text-gray-900 focus:outline-none focus:ring-2 focus:ring-sky-200",children:A.map(e=>(0,r.jsx)("option",{value:e.minutes,children:e.label},e.minutes))})]}),(0,r.jsx)("button",{type:"button",onClick:i,disabled:a,className:"rounded-full px-3 py-1 text-[13px] font-semibold text-red-600 transition-colors hover:bg-red-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-400",children:"Remove poll"})]})]})},E=n(74575);let L=e=>{let t=e=>String(e).padStart(2,"0");return"".concat(e.getFullYear(),"-").concat(t(e.getMonth()+1),"-").concat(t(e.getDate()))+"T".concat(t(e.getHours()),":").concat(t(e.getMinutes()))},R=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return L(new Date(e.getTime()+6e4*E._G))};var D=function(e){let{value:t,onChange:n,onClear:i,disabled:a=!1}=e,s=(0,o.useId)(),l=R(t),d=t?(0,E.jr)(l):null;return(0,r.jsxs)("div",{className:"mt-3 rounded-xl border border-gray-200 p-3",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)("label",{htmlFor:s,className:"text-[13px] font-medium text-gray-700",children:"Send at"}),(0,r.jsx)("input",{id:s,type:"datetime-local",value:t,disabled:a,min:T(),onChange:e=>n(e.target.value),className:(0,b.cn)("rounded-lg border px-2 py-1 text-[13px] text-gray-900","focus:outline-none focus:ring-2 focus:ring-sky-200",d?"border-red-300":"border-gray-200")}),(0,r.jsx)("button",{type:"button",onClick:i,disabled:a,className:"rounded-full px-3 py-1 text-[13px] font-semibold text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400",children:"Don't schedule"})]}),d?(0,r.jsx)("p",{role:"alert",className:"mt-2 text-[13px] text-red-600",children:(0,E.Kw)(d)}):l&&(0,r.jsxs)("p",{className:"mt-2 text-[13px] text-gray-500",children:["Goes out"," ",l.toLocaleStr
1ing(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"})," ","your time."]})]})};n(1702);let F=/@([A-Za-z0-9_.]{0,30})$/,Z=e=>!e||/[\s([{<"'“”‘’\-–—/]/.test(e),O=e=>e.replace(/^@/,"").toLowerCase(),P=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(t!==n||t<0||t>e.length)return null;let r=F.exec(e.slice(0,t));if(!r)return null;let i=t-r[0].length;return Z(e[i-1])?{query:r[1],start:i,end:t}:null},U=(e,t,n)=>{let r="@".concat(O(n)),i=" "!==e[t.end]?" ":"";return{text:"".concat(e.slice(0,t.start)).concat(r).concat(i).concat(e.slice(t.end)),caretIndex:t.start+r.length+i.length}},W=0;var z=n(25999),B=n(10387),q=n(49159),V=n(60997),K=n(25539),G=n(17985),Y=n(29787);let Q=["all-feeds"];var $=(e,t)=>{let n=(0,K.NL)();return(0,G.D)({mutationFn:Y.qb,onMutate:async t=>{await n.cancelQueries({queryKey:Q});let r=n.getQueryData(Q),i=(null==r?void 0:r.data)||[],a={...t,community_id:"TEMP_ID",created_at:new Date().toISOString(),updated_at:new Date().toISOStr
1ing(),posted_by:{first_name:null==e?void 0:e.first_name,last_name:null==e?void 0:e.last_name,profile_image:null==e?void 0:e.last_name,user_name:null==e?void 0:e.user_name}};return n.setQueryData(Q,e=>{var t,n,r;return{...e,data:[a,...(null==e?void 0:e.data)||[]],statusCode:null!==(t=null==e?void 0:e.statusCode)&&void 0!==t?t:200,success:null===(n=null==e?void 0:e.success)||void 0===n||n,message:null!==(r=null==e?void 0:e.message)&&void 0!==r?r:"",error:null==e?void 0:e.error}}),{previousCommunities:i}},onSuccess:(e,r)=>{n.setQueryData(Q,t=>{var n,i,a;if(!t||!t.data)return t;let s=t.data.findIndex(e=>e.title===r.title);if(-1===s)return t;let l=[...t.data];return l[s]={...l[s],...e.data},{...t,data:l,statusCode:null!==(n=null==t?void 0:t.statusCode)&&void 0!==n?n:200,success:null===(i=null==t?void 0:t.success)||void 0===i||i,message:null!==(a=null==t?void 0:t.message)&&void 0!==a?a:"",error:null==t?void 0:t.error}}),null==t||t()},onError:(e,t,r)=>{r&&n.setQueryData(Q,e=>{var t,n,i;return{...e,data:r.previousCommunities,statusCode:null!==(t=null==e?void 0:e.statusCode)&&void 0!==t?t:200,success:null===(n=null==e?void 0:e.success)||void 0===n||n,message:null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"",error:null==e?void 0:e.error}})}})},H=n(40614),X=n(2026),J=n(49283),ee=n(19257),et=n(52596),en=n(49260),er=n(62684),ei=n(44971),ea=n(22273),es=n(80710),el=n(59406),eo=n(56167),ed=n(97159),ec=n(97454),eu=n(18811),em=n(66066),eh=n(20687),ep=n(81230),ex=n(6749),eg=n(89282);let eb=e=>"".concat(Math.floor(e/60),":").concat((e%60).toString().padStart(2,"0"));var ev=e=>{let{open:t,onOpenChange:n,onComplete:i,maxDurationSec:a=120}=e,s=(0,o.useRef)(null),l=(0,o.useRef)(null),d=(0,o.useRef)(null),c=(0,o.useRef)([]),u=(0,o.useRef)(null),[m,h]=(0,o.useState)("idle"),[p,x]=(0,o.useState)(null),[g,v]=(0,o.useState)(0),[f,y]=(0,o.useState)(null),[w,j]=(0,o.useState)(null),[N,k]=(0,o.useState)("user"),C=(0,o.useCallback)(async()=>{h("initializing"),x(null);try{d.current&&d.current.getTracks().forEach(e=>e.stop());let e=await navigator.mediaDevices.getUserMedia({video:{facingMode:N,width:{ideal:1280},height:{ideal:720}},audio:!0});d.current=e,s.current&&(s.current.srcObject=e,s.current.muted=!0,await s.current.play()),h("ready")}catch(e){console.error("Camera access error:",e),x("Camera access denied. Please enable camera permissions in your browser settings."),h("error")}},[N]),_=(0,o.useCallback)(()=>{u.current&&(clearInterval(u.current),u.current=null),d.current&&(d.current.getTracks().forEach(e=>e.stop()),d.current=null),w&&URL.revokeObjectURL(w),l.current=null,c.current=[]},[w]);(0,o.useEffect)(()=>(t?C():(_(),h("idle"),v(0),y(null),j(null),x(null)),_),[t]),(0,o.useEffect)(()=>{t&&"ready"===m&&C()},[N]);let S=(0,o.useCallback)(()=>{if(!d.current)return;c.current=[],v(0);let e=new MediaRecorder(d.current,{mimeType:"video/webm;codecs=vp9,opus"});e.ondataavailable=e=>{e.data.size>0&&c.current.push(e.data)},e.onstop=()=>{let e=new Blob(c.current,{type:"video/webm"});y(e);let t=URL.createObjectURL(e);j(t),s.current&&(s.current.srcObject=null,s.current.src=t,s.current.muted=!1,s.current.controls=!0,s.current.play().catch(()=>void 0)),h("preview")},l.current=e,e.start(1e3),h("recording"),u.current=setInterval(()=>{v(e=>e>=a?(A(),e):e+1)},1e3)},[a]),A=(0,o.useCallback)(()=>{var e,t;u.current&&(clearInterval(u.current),u.current=null),(null===(e=l.current)||void 0===e?void 0:e.state)!=="inactive"&&(null===(t=l.current)||void 0===t||t.stop())},[]),I=(0,o.useCallback)(()=>{var e;(null===(e=l.current)||void 0===e?void 0:e.state)==="recording"&&(l.current.pause(),u.current&&clearInterval(u.current),h("paused"))},[]),M=(0,o.useCallback)(()=>{var e;(null===(e=l.current)||void 0===e?void 0:e.state)==="paused"&&(l.current.resume(),u.current=setInterval(()=>{v(e=>e>=a?(A(),e):e+1)},1e3),h("recording"))},[a,A]),E=(0,o.useCallback)(()=>{w&&URL.revokeObjectURL(w),y(null),j(null),v(0),C()},[w,C]),L=(0,o.useCallback)(()=>{f&&(i(new File([f],"video-".concat(Date.now(),".webm"),{type:"video/webm"})),n(!1))},[f,i,n]),R=(0,o.useCallback)(()=>{_(),n(!1)},[_,n]),T=(0,o.useCallback)(()=>{k(e=>"user"===e?"environment":"user")},[]),D="recording"===m,F="paused"===m,Z="preview"===m,O="ready"===m,P="initializing"===m,U="error"===m;return(0,r.jsx)(eg.Vq,{open:t,onOpenChange:n,children:(0,r.jsxs)(eg.cZ,{className:"max-h-[90vh] overflow-hidden rounded-2xl border border-gray-200 bg-white p-0 sm:max-w-lg",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-gray-200 px-4 py-3",children:[(0,r.jsx)(eg.$N,{className:"text-base font-semibold text-gray-900",children:"Record Video"}),(0,r.jsx)("button",{onClick:R,"aria-label":"Close video recorder",className:"rounded-full p-1 transition-colors hover:bg-gray-100",children:(0,r.jsx)(ea.Z,{className:"h-5 w-5 text-gray-500"})})]}),(0,r.jsxs)("div",{className:"relative aspect-video bg-gray-900",children:[P&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center text-white",children:[(0,r.jsx)(es.Z,{className:"mx-auto mb-3 h-10 w-10 animate-spin text-gray-400"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Initializing camera..."})]})}),U&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:(0,r.jsxs)("div",{className:"text-center text-white",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-500/20",children:(0,r.jsx)(el.Z,{className:"h-8 w-8 text-red-400"})}),(0,r.jsx)("p",{className:"mb-4 text-sm text-gray-300",children:p}),(0,r.jsx)(ex.z,{onClick:C,variant:"outline",size:"sm",className:"border-white/30 text-white hover:bg-white/10",children:"Try Again"})]})}),(0,r.jsx)("video",{ref:s,className:(0,b.cn)("h-full w-full object-cover","user"===N&&!Z&&"scale-x-[-1]",(P||U)&&"invisible"),playsInl
1ine:!0}),(D||F)&&(0,r.jsx)("div",{className:"absolute left-3 top-3 flex items-center gap-2",children:(0,r.jsxs)("div",{className:(0,b.cn)("inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium text-white",D?"bg-red-600":"bg-yellow-500"),children:[D&&(0,r.jsx)("span",{className:"h-2 w-2 animate-pulse rounded-full bg-white"}),D?"Recording":"Paused"]})}),(O||D||F)&&(0,r.jsx)("div",{className:"absolute right-3 top-3 rounded-full bg-black/60 px-3 py-1 font-mono text-sm text-white",children:eb(g)}),O&&(0,r.jsx)("button",{onClick:T,"aria-label":"Switch camera",className:"absolute bottom-3 right-3 rounded-full bg-black/50 p-2 text-white transition-colors hover:bg-black/70",children:(0,r.jsx)(eo.Z,{className:"h-5 w-5"})})]}),(0,r.jsxs)("div",{className:"border-t border-gray-200 bg-gray-50 px-4 py-4",children:[Z?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-4",children:[(0,r.jsxs)(ex.z,{type:"button",variant:"outline",onClick:E,className:"flex items-center gap-2",children:[(0,r.jsx)(eh.Z,{className:"h-4 w-4"}),"Retake"]}),(0,r.jsxs)(ex.z,{type:"button",onClick:L,className:"flex items-center gap-2 bg-blue-600 text-white hover:bg-blue-700",children:[(0,r.jsx)(ep.Z,{className:"h-4 w-4"}),"Use Video"]})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center gap-4",children:[(0,r.jsx)(ex.z,{type:"button",variant:"ghost",onClick:R,className:"text-gray-600",children:"Cancel"}),(D||F)&&(0,r.jsx)("button",{onClick:F?M:I,className:"rounded-full bg-gray-200 p-3 transition-colors hover:bg-gray-300",children:F?(0,r.jsx)(ed.Z,{className:"h-5 w-5 text-gray-700"}):(0,r.jsx)(ec.Z,{className:"h-5 w-5 text-gray-700"})}),(0,r.jsx)("button",{onClick:()=>{D||F?A():O&&S()},disabled:P||U,className:(0,b.cn)("flex h-16 w-16 items-center justify-center rounded-full border-4 border-white transition-all","shadow-lg",D||F?"bg-white":"bg-red-500 hover:bg-red-600",(P||U)&&"cursor-not-allowed opacity-50"),children:D||F?(0,r.jsx)(eu.Z,{className:"h-6 w-6 fill-red-500 text-red-500"}):(0,r.jsx)(em.Z,{className:"h-10 w-10 fill-white text-white"})}),(0,r.jsx)("div",{className:"w-[72px]"})]}),!Z&&(0,r.jsxs)("p",{className:"mt-3 text-center text-xs text-gray-500",children:["Max ",Math.floor(a/60),":",(a%60).toString().padStart(2,"0")," minutes"]})]})]})})};let ef={Image:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,r.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,r.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})},Video:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[(0,r.jsx)("path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"}),(0,r.jsx)("rect",{x:"2",y:"6",width:"14",height:"12",rx:"2"})]})},Ellipsis:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,r.jsx)("circle",{cx:"19",cy:"12",r:"1"}),(0,r.jsx)("circle",{cx:"5",cy:"12",r:"1"})]})},X:e=>{let{className:t="w-4 h-4"}=e;return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:t,children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M18 6 6 18M6 6l12 12"})})},Loader:e=>{let{className:t="w-5 h-5"}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:(0,b.cn)(t,"animate-spin"),children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeOpacity:"0.25"}),(0,r.jsx)("path",{fill:"currentColor",d:"M12 2a10 10 0 0 1 10 10h-2.5a7.5 7.5 0 0 0-7.5-7.5V2z"})]})},ArrowDown:e=>{let{className:t="w-8 h-8"}=e;return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 8v8"}),(0,r.jsx)("path",{d:"m8 12 4 4 4-4"})]})}},ey=e=>{e.startsWith("blob:")&&URL.revokeObjectURL(e)};var ew=(0,o.memo)(e=>{var t,n;let{onClose:u,initialCommunityId:m}=e,{posts:h,setPosts:p}=(0,V.Z)(),{communityUser:x}=(0,z.Z)(),{data:g}=(0,B.Z)(),{data:v}=(0,q.Z)(),[f,k]=(0,o.useState)(m||""),[C,A]=(0,o.useState)(!1),[L,F]=(0,o.useState)(null),[Z,O]=(0,o.useState)(""),[K,G]=(0,o.useState)(null),[Y,Q]=(0,o.useState)(""),[ea,es]=(0,o.useState)(null),[el,eo]=(0,o.useState)(""),[ed,ec]=(0,o.useState)(""),[eu,em]=(0,o.useState)(!1),[eh,ep]=(0,o.useState)(0),[ex,eg]=(0,o.useState)(!1),[eb,ew]=(0,o.useState)(!1),[ej,eN]=(0,o.useState)(!1),[ek,eC]=(0,o.useState)(!1),[e_,eS]=(0,o.useState)(!1),[eA,eI]=(0,o.useState)(!0),[eM,eE]=(0,o.useState)(!0),eL=(0,o.useRef)(null),eR=(0,o.useRef)(null),{register:eT,handleSubmit:eD,watch:eF,reset:eZ,setValue:eO,formState:{errors:eP}}=(0,c.cI)({resolver:(0,i.F)(H.zk),mode:"onChange"}),eU=eF("title")||"",{mutateAsync:eW,isPending:ez}=(0,J.Z)(),{mutateAsync:eB,isPending:eq}=$(x,function(){eZ(),es(null),eo(""),k(m||""),eG(),u&&u()}),eV=eq||ez||ex,eK=function(e){var t;let{text:n,setText:r,textareaRef:i,enabled:a=!0}=e,[s,l]=(0,o.useState)(null),[d,c]=(0,o.useState)([]),[u,m]=(0,o.useState)(0),[h,p]=(0,o.useState)(!1),[x,g]=(0,o.useState)(null),b=(0,o.useMemo)(()=>(W+=1,"mention-listbox-".concat(W)),[]),v=(0,o.useRef)(new Map),f=(0,o.useRef)(null),y=(0,o.useRef)(null),w=(0,o.useCallback)(()=>{l(null),c([]),m(0)},[]),j=(0,o.useCallback)(()=>{var e,t,r;if(!a){w();return}let s=i.current;if(!s)return;let o=P(n,null!==(e=s.selectionStart)&&void 0!==e?e:0,null!==(r=null!==(t=s.selectionEnd)&&void 0!==t?t:s.selectionStart)&&void 0!==r?r:0);l(e=>(null==e?void 0:e.start)===(null==o?void 0:o.start)&&(null==e?void 0:e.query)===(null==o?void 0:o.query)?e:o),o?null!==x&&o.start!==x&&g(null):g(null)},[w,x,a,n,i]);(0,o.useEffect)(()=>{j()},[j]),(0,o.useEffect)(()=>{let e=y.current;if(null===e)return;y.current=null;let t=i.current;t&&(t.focus(),t.setSelectionRange(e,e))},[n,i]);let N=null!==s&&x===s.start;(0,o.useEffect)(()=>{var e,t;if(!a||!s||N){null===(t=f.current)||void 0===t||t.abort(),f.current=null,p(!1),c([]);return}let n=s.query.toLowerCase(),r=v.current.get(n);if(r){c(r),m(0),p(!1);return}p(!0);let i=new AbortController;null===(e=f.current)||void 0===e||e.abort(),f.current=i;let l=setTimeout(async()=>{try{let e=await fetch("/api/v2/users/mentions?q=".concat(encodeURIComponent(n)),{signal:i.signal,cache:"no-store"});if(!e.ok)throw Error("Request failed (".concat(e.status,")"));let t=await e.json(),r=(null==t?void 0:t.success)&&t.data||[];v.current.set(n,r),i.signal.aborted||(c(r),m(0))}catch(e){(null==e?void 0:e.name)!=="AbortError"&&c([])}finally{i.signal.aborted||p(!1)}},140);return()=>{clearTimeout(l),i.abort()}},[a,N,s]),(0,o.useEffect)(()=>()=>{var e;return null===(e=f.current)||void 0===e?void 0:e.abort()},[]);let k=!!(a&&s&&!N&&d.length>0),C=(0,o.useCallback)(e=>{if(!s)return;let t=U(n,s,e.user_name);y.current=t.caretIndex,r(t.text),w()},[w,s,r,n]),_=(0,o.useCallback)(e=>{if("Escape"===e.key&&s&&!N)return e.preventDefault(),g(s.start),c([]),!0;if(!k)return!1;switch(e.key){case"ArrowDown":return e.preventDefault(),m(e=>(e+1)%d.length),!0;case"ArrowUp":return e.preventDefault(),m(e=>(e-1+d.length)%d.length),!0;case"Enter":case"Tab":{let t=d[u];if(!t)return!1;return e.preventDefault(),C(t),!0}default:return!1}},[u,N,k,s,C,d]);return{isOpen:k,suggestions:d,activeIndex:u,isLoading:h,query:null!==(t=null==s?void 0:s.query)&&void 0!==t?t:"",handleKeyDown:_,syncCaret:j,selectSuggestion:C,setActiveIndex:m,close:w,listboxId:b}}({text:eU,setText:(0,o.useCallback)(e=>eO("title",e,{shouldDirty:!0,shouldValidate:!0}),[eO]),textareaRef:eL,enabled:!eV});(0,o.useEffect)(()=>{eL.current&&(eL.current.style.height="auto",eL.current.style.height=Math.min(eL.current.scrollHeight,300)+"px")},[eU]),(0,o.useEffect)(()=>{eL.current&&eL.current.focus()},[]),(0,o.useEffect)(()=>{m&&(k(m),A(!1))},[m]),(0,o.useEffect)(()=>
1{if(!f){eS(!1);return}let e=!1;return(async()=>{try{var t;let n=await fetch("/api/v2/community/".concat(f,"/member-role"));if(!n.ok)return;let r=await n.json(),i=null!==(t=null==r?void 0:r.role)&&void 0!==t?t:null,a="owner"===i||"admin"===i;if(e||(eS(a),!a||!(null==x?void 0:x.user_id)))return;let s=await fetch("/api/v2/community/notifications/check-limit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({communityId:f,userId:x.user_id})});if(s.ok){let t=await s.json();e||eE(t.canSend)}}catch(e){console.error("Error resolving email permissions:",e)}})(),()=>{e=!0}},[f,null==x?void 0:x.user_id]);let eG=(0,o.useCallback)(()=>{Z&&ey(Z),F(null),O(""),G(null),ec(""),em(!1),ep(0),Q("")},[Z]),eY=async()=>{if(!L)return;let e=L.type.split("/")[1],t=await eW({type:e,folder:"posts"});if(!t.data){et.Am.error("Failed to upload image.");return}let{signedUrl:n,token:r,path:i}=t.data;if(200!==(await (0,X.c)(n,L,r)).status){et.Am.error("Failed to upload image.");return}return(0,er.L)("".concat(ee.$6.COMMUNITY,"/").concat(i))},eQ=async()=>{if(L){eg(!0);try{let e=await (0,en.$)(L,{onProgress:e=>ep(e)});return{playbackId:e.playback_id,assetId:e.asset_id}}catch(e){console.error("Video upload error:",e),et.Am.error("Failed to upload video.");return}finally{eg(!1)}}},e$=(0,o.useCallback)(async function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!f){A(!0),et.Am.error("Please select a community before posting.");return}if(!(null===(t=e.title)||void 0===t?void 0:t.trim())&&!L&&!ed&&!ea){et.Am.error("Please write something or add media before posting.");return}try{let t,i;let a=ed||void 0;if(L){if("image"===K){if(!(a=await eY()))return}else if("video"===K){let e=await eQ();if(!(null==e?void 0:e.playbackId))return;t=e.playbackId,i=e.assetId}else{et.Am.error("This kind of media isn't supported yet.");return}}let s=await et.Am.promise(eB({title:(null===(n=e.title)||void 0===n?void 0:n.trim())||"",image_url:a,image_alt:Y.trim()||void 0,...(()=>{if(r)return{status:"draft"};let e=R(el);return e&&!(0,E.jr)(e)?{status:"scheduled",publish_at:e.toISOString()}:{}})(),poll:ea?{options:ea.options.map(e=>e.trim()).filter(Boolean),duration_minutes:ea.durationMinutes}:void 0,video_playback_id:t,video_asset_id:i,community_id:f,email_all_members:e_&&eA&&eM}),{pending:"Creating post...",success:"Post created!",error:"Failed to create post"});s.data&&p([s.data,...h])}catch(e){console.error("Post creation error:",e)}},[e_,eM,eB,ed,Y,L,ea,el,K,h,f,eA,p]),{getRootProps:eH,getInputProps:eX,open:eJ,isDragActive:e0}=(0,d.uI)({onDrop:(e,t)=>{if(e.length>0){let t=e[0];eG(),F(t),O(URL.createObjectURL(t)),t.type.startsWith("image/")?G("image"):t.type.startsWith("video/")&&G("video")}t.forEach(e=>{let{file:t,errors:n}=e;n.forEach(e=>{et.Am.error("".concat(t.name,": ").concat(e.message))})})},noClick:!0,maxSize:104857600,maxFiles:1,accept:{"image/jpeg":[".jpeg",".jpg"],"image/png":[".png"],"image/webp":[".webp"],"image/gif":[".gif"],"video/mp4":[".mp4"],"video/webm":[".webm"],"video/quicktime":[".mov"]}}),e1=(0,o.useCallback)(e=>{eG(),F(e),O(URL.createObjectURL(e)),G("video"),ew(!1)},[eG]),e2=(0,o.useCallback)(e=>{eG(),F(e),G("audio"),eN(!1),et.Am.success("Audio recorded successfully!")},[eG]),e5=(0,o.useCallback)(e=>{let t=e.trim(),n=/^https?:\/\//i.test(t),r=(()=>{try{return new URL(t).hostname.toLowerCase().includes("gifly")}catch(e){return!1}})(),i=/\.gif($|\?)/i.test(t);if(!n||!r||!i){et.Am.error("Please enter a valid Gifly .gif URL.");return}eG(),ec(t),O(t),G("image"),em(!1),et.Am.success("Gifly GIF attached!")},[eG]),e4=(0,o.useMemo)(()=>{var e,t;let n=(null==x?void 0:null===(e=x.first_name)||void 0===e?void 0:e[0])||"",r=(null==x?void 0:null===(t=x.last_name)||void 0===t?void 0:t[0])||"";return"".concat(n).concat(r).toUpperCase()||"U"},[x]),e3=!ea||(0,S.SG)({options:ea.options,durationMinutes:ea.durationMinutes}).valid,e6=""!==el&&!(0,E.jr)(R(el)),e8=(!!eU.trim()||!!L||!!ed||!!ea)&&!!f&&!eV,e7=(!!eU.trim()||!!L||!!ed||!!ea)&&!!f&&e3&&(""===el||e6)&&!eV,e9=eU.length>500;return(0,o.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e7&&!e9&&eD(e=>e$(e,!1))())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[e7,e9,eD,e$]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{...eH(),className:"relative",children:[(0,r.jsx)("input",{...eX()}),(0,r.jsxs)("form",{onSubmit:eD(e=>e$(e,!1)),children:[(0,r.jsx)("div",{className:"px-5 pb-0 pt-5",children:(0,r.jsxs)("div",{className:"flex min-w-0 gap-3",children:[(0,r.jsxs)(N.Avatar,{className:"h-9 w-9 flex-shrink-0",children:[(0,r.jsx)(N.AvatarImage,{src:(null==x?void 0:x.profile_image)||void 0,alt:"Profile",className:"object-cover"}),(0,r.jsx)(N.AvatarFallback,{className:"bg-gradient-to-br from-sky-4
100 to-blue-600 text-sm font-semibold text-white",children:e4})]}),(0,r.jsxs)("div",{className:"flex min-h-[200px] min-w-0 flex-1 flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)("span",{className:"text-[15px] font-medium leading-5 text-gray-900",children:[null==x?void 0:x.first_name," ",null==x?void 0:x.last_name]}),!m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-gray-300",children:"\xb7"}),(0,r.jsxs)("select",{value:f,"aria-label":"Community to post in",onChange:e=>{k(e.target.value),A(!1)},className:(0,b.cn)("rounded-full border bg-transparent px-2.5 py-0.5","cursor-pointer appearance-none text-xs font-medium","focus:outline-none focus:ring-2 focus:ring-brand/30",C?"border-red-400 bg-red-50 text-red-500":f?"border-brand/30 bg-brand/5 text-brand":"border-gray-200 text-gray-500 hover:border-gray-300"),children:[(0,r.jsx)("option",{value:"",children:"Select community"}),null==v?void 0:null===(t=v.data)||void 0===t?void 0:t.map(e=>(0,r.jsxs)("option",{value:e.community_id,children:[e.name," (Owner)"]},e.community_id)),null==g?void 0:null===(n=g.data)||void 0===n?void 0:n.map(e=>(0,r.jsx)("option",{value:e.community_id,children:e.name},e.community_id))]})]}),C&&(0,r.jsx)("p",{className:"w-full text-xs font-medium text-red-500",children:"Please select a community"})]}),(0,r.jsxs)("div",{ref:eR,className:"relative flex-1",children:[(0,r.jsx)("textarea",{...eT("title"),ref:e=>{eT("title").ref(e),eL.current=e},onKeyDown:eK.handleKeyDown,onSelect:eK.syncCaret,onClick:eK.syncCaret,onBlur:e=>{eK.close(),eT("title").onBlur(e)},className:(0,b.cn)("w-full resize-none border-none bg-transparent","text-[15px] leading-relaxed placeholder:text-gray-400","focus:outline-none focus:ring-0","min-h-[120px]"),placeholder:"What's on your mind?","aria-label":"Post text",role:"combobox","aria-expanded":eK.isOpen,"aria-controls":eK.isOpen?eK.listboxId:void 0,"aria-autocomplete":"list","aria-activedescendant":eK.isOpen?"".concat(eK.listboxId,"-option-").concat(eK.activeIndex):void 0}),(0,r.jsx)(_,{isOpen:eK.isOpen,suggestions:eK.suggestions,activeIndex:eK.activeIndex,listboxId:eK.listboxId,onSelect:eK.selectSuggestion,onHover:eK.setA
1ctiveIndex})]}),(0,r.jsx)(a.M,{children:Z&&("image"===K||"video"===K)&&(0,r.jsxs)(s.E.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-xl border border-gray-200",children:[(0,r.jsx)("button",{type:"button",onClick:eG,"aria-label":"Remove media",className:"absolute right-2 top-2 z-10 rounded-full bg-gray-900/70 p-1.5 shadow-lg transition-colors hover:bg-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:(0,r.jsx)(ef.X,{className:"h-4 w-4 text-white","aria-hidden":"true"})}),"image"===K?ed?(0,r.jsx)("img",{src:Z,alt:"",className:"max-h-[280px] w-full object-cover"}):(0,r.jsx)(l.default,{src:Z,width:600,height:400,alt:"",className:"max-h-[280px] w-full object-cover"}):(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-xl bg-gray-900",children:[(0,r.jsx)("video",{src:Z,className:"max-h-[280px] w-full object-contain",controls:!0}),ex&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:(0,r.jsxs)("div",{className:"text-center text-white",children:[(0,r.jsx)(ef.Loader,{className:"mx-auto mb-2 h-8 w-8"}),(0,r.jsxs)("p",{className:"text-sm font-medium",children:["Uploading... ",eh,"%"]}),(0,r.jsx)("div",{className:"mx-auto mt-2 h-1.5 w-32 overflow-hidden rounded-full bg-white/20",children:(0,r.jsx)("div",{className:"h-full rounded-full bg-white transition-all duration-300",style:{width:"".concat(eh,"%")}})})]})})]})]}),"image"===K&&(0,r.jsx)(j.Z,{value:Y,onChange:Q,disabled:eV,label:ed?"Describe this GIF":"Describe this image",className:"mt-2"})]})}),""!==el&&(0,r.jsx)(D,{value:el,onChange:eo,onClear:()=>eo(""),disabled:eV}),ea&&(0,r.jsx)(M,{value:ea,onChange:es,onRemove:()=>es(null),disabled:eV}),(0,r.jsx)(a.M,{children:L&&"audio"===K&&(0,r.jsx)(s.E.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:(0,r.jsxs)("div",{className:"relative flex items-center gap-3 rounded-xl border border-gray-200 bg-gradient-to-r from-purple-50 to-pink-50 p-3",children:[(0,r.jsx)("button",{type:"button",onClick:eG,"aria-label":"Remove audio",className:"absolute right-2 top-2 rounded-full p-1 transition-colors hover:bg-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:(0,r.jsx)(ef.X,{className:"h-3 w-3 text-gray-500","aria-hidden":"true"})}),(0,r.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-purple-500",children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-5 w-5",children:[(0,r.jsx)("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3",stroke:"white",strokeWidth:"1.5"}),(0,r.jsx)("path",{stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",d:"M5 10v1a7 7 0 0 0 14 0v-1M12 18v4m-3 0h6"})]})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Audio Recording"}),(0,r.jsx)("p",{className:"truncate text-xs text-gray-500",children:L.name})]})]})})})]})]})}),(0,r.jsx)(w.Z,{open:eu,onClose:()=>em(!1),onSelect:e5}),(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between px-5 py-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("button",{type:"button",onClick:eJ,"aria-label":"Add image",className:"rounded-md p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",title:"Add image",children:(0,r.jsx)(ef.Image,{className:"h-5 w-5","aria-hidden":"true"})}),(0,r.jsx)("button",{type:"button",onClick:()=>es(e=>null!=e?e:I()),disabled:eV||!!ea,"aria-label":"Add poll",title:ea?"This post already has a poll":"Add poll",className:"rounded-md p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:cursor-not-allowed disabled:opacity-40",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",d:"M6 20V10M12 20V4M18 20v-6"})})}),(0,r.jsx)("button",{type:"button",onClick:()=>eo(e=>e||T()),disabled:eV||""!==el,"aria-label":"Schedule this post",title:el?"This post is scheduled":"Schedule this post",className:"rounded-md p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:cursor-not-allowed disabled:opacity-40",children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.8"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",d:"M12 7v5l3 2"})]})}),(0,r.jsx)(y,{draft:eU,disabled:eV,onApply:e=>eO("title",e,{shouldDirty:!0,shouldValidate:!0})}),(0,r.jsx)("button",{type:"button",onClick:()=>ew(!0),"aria-label":"Record video",className:"rounded-md p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",title:"Record video",children:(0,r.jsx)(ef.Video,{className:"h-5 w-5","aria-hidden":"true"})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{type:"button",onClick:()=>eC(!ek),"aria-label":"More options","aria-expanded":ek,className:"rounded-md p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",title:"More options",children:(0,r.jsx)(ef.Ellipsis,{className:"h-5 w-5","aria-hidden":"true"})}),(0,r.jsx)(a.M,{children:ek&&(0,r.jsxs)(s.E.div,{initial:{opacity:0,y:4}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:4},className:"absolute bottom-full left-0 z-50 mb-2 w-48 rounded-lg border border-gray-200 bg-white py-1 shadow-lg",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{eN(!0),eC(!1)},className:"flex w-full items-center gap-3 px-3 py-2 text-sm text-gray-700 transition-colors hover:bg-gray-50",children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-4 w-4",children:[(0,r.jsx)("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",d:"M5 10v1a7 7 0 0 0 14 0v-1M12 18v4m-3 0h6"})]}),"Record audio"]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{em(!0),eC(!1)},className:"flex w-full items-center gap-3 px-3 py-2 text-sm text-gray-700 transition-colors hover:bg-gray-50",children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-4 w-4",children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",d:"M8 15v-6h2M8 12h1.5M12 9v6M15 15v-6h2.5M15 12h2"})]}),"Add GIF"]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[eU.length>400&&(0,r.jsx)("span",{role:"status","aria-live":"polite",className:(0,b.cn)("text-xs font-medium tabular-nums",e9?"text-red-500":eU.length>480?"text-amber-500":"text-gray-400"),children:500-eU.length}),(0,r.jsx)("button",{type:"button",onClick:u,className:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",children:"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:()=>eD(e=>e$(e,!0))(),disabled:!e8,className:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand disabled:cursor-not-allowed disabled:opacity-50",children:"Save draft"}),(0,r.jsx)("button",{type:"submit",disabled:!e7||e9,className:(0,b.cn)("rounded-md px-5 py-2 text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",e7&&!e9?"bg-brand text-white shadow-sm hover:bg-brand-emphasis":"cursor-not-allowed bg-gray-100 text-gray-400"),children:eV?(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)(ef.Loader,{className:"h-4 w-4"}),"Posting..."]}):e6?"Schedule":"Post"})]})]}),e_&&(0,r.jsx)("div",{className:"flex items-center justify-end border-t border-gray-100 px-4 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500",children:eM?"Email all members":"Email all members (already sent today)"}),(0,r.jsx)("button",{type:"button",disabled:!eM||eV,"aria-pressed":eA&&eM,"aria-label":"Email all members about this post",onClick:()=>eI(e=>!e),className:(0,b.cn)("relative inline-flex h-5 w-9 items-center rounded-full transition-colors",eA&&eM?"bg-brand":"bg-gray-300",(!eM||eV)&&"cursor-not-allowed opacity-50"),children:(0,r.jsx)("span",{className:(0,b.cn)("inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform",eA&&eM?"translate-x-4":"translate-x-0.5")})})]})})]}),(0,r.jsx)(a.M,{children:e0&&(0,r.jsxs)(s.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-xl bg-white/90 backdrop-blur-sm",children:[(0,r.jsx)(ef.ArrowDown,{className:"mb-3 h-8 w-8 text-gray-400"}),(0,r.jsx)("p",{className:"text-[15px] text-gray-500",children:"Drop file here to upload"})]})})]}),(0,r.jsx)(ev,{open:eb,onOpenChange:ew,onComplete:e1}),(0,r.jsx)(ei.Z,{open:ej,onOpenChange:eN,onComplete:e2})]})})},87846:function(e,t,n){n.d(t,{a:function(){return i}});let r=["not_configured","rate_limited","unauthenticated","upstream_failed","network"];async function i(e){let t="";try{let n=await fetch("/api/clarua/ask",{method:"POST",headers:{"Content-Type":"application/json"},signal:e.signal,body:JSON.stringify(e.body)});if(!n.ok||!n.body){let e=null;try{e=await n.json()}catch(e){}return{status:"failed",reason:function(e,t){let n=t&&"object"==typeof t?t.error:void 0;return"string"==typeof n&&r.includes(n)?n:401===e?"unauthenticated":429===e?"rate_limited":503===e?"not_configured":"upstream_failed"}(n.status,e)}}let i=n.body.getReader(),a=new TextDecoder;for(;;){let{done:n,value:r}=await i.read();if(n)break;t+=a.decode(r,{stream:!0}),e.onChunk(t)}if(0===t.length)return{status:"failed",reason:"upstream_failed"};return{status:"complete",text:t}}catch(e){if((null==e?void 0:e.name)==="AbortError")return{status:"cancelled",text:t};if(t.length>0)return{status:"interrupted",text:t};return{status:"failed",reason:"network"}}}},11528:function(e,t,n){var r=n(65724),i=n(78883),a=n(92169),s=n(2512),l=n(58682),o=n(76205);t.Z=function(e){let{value:t,onChange:n,disabled:d=!1,label:c="Describe this image",className:u}=e,[m,h]=(0,s.useState)(!1),p=(0,s.useId)(),x=(0,s.useId)(),g=(0,s.useRef)(null),b=t.trim().length>0,v=l.hA-t.length;return(0,s.useEffect)(()=>{var e;m&&(null===(e=g.current)||void 0===e||e.focus())},[m]),(0,r.jsxs)("div",{className:u,children:[(0,r.jsxs)("button",{type:"button",disabled:d,onClick:()=>h(e=>!e),"aria-expanded":m,"aria-controls":m?p:void 0,"aria-label":b?"Edit image description. This image is described.":"Add an image description. This image has no description.",title:b?"Edit image description":"Add a description so screen readers can describe this image",className:(0,o.cn)("rounded-full px-2.5 py-1 text-[11px] font-bold tracking-wide shadow-lg transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",b?"bg-white text-gray-900":"bg-gray-900/70 text-white hover:bg-gray-900",d&&"cursor-not-allowed opacity-50"),children:["ALT",b&&(0,r.jsx)("span",{className:"sr-only",children:" (added)"})]}),(0,r.jsx)(i.M,{children:m&&(0,r.jsx)(a.E.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:(0,r.jsxs)("div",{className:"mt-2 rounded-xl border border-gray-200 bg-white p-3",children:[(0,r.jsx)("label",{htmlFor:p,className:"block text-[13px] font-semibold text-gray-900",children:c}),(0,r.jsx)("p",{className:"mt-0.5 text-[12px] text-gray-500",children:"People using screen readers hear this instead of seeing the image. Say what matters about it, not that it is an image."}),(0,r.jsx)("textarea",{id:p,ref:g,value:t,disabled:d,maxLength:l.hA,onChange:e=>n(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),h(!1))},rows:3,"aria-describedby":x,placeholder:"A tabby cat asleep across a laptop keyboard",className:(0,o.cn)("mt-2 w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2","text-[14px] text-gray-900 placeholder:text-gray-400","focus:border-gray-300 focus:outline-none focus:ring-2 focus:ring-sky-200")}),(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,r.jsxs)("span",{id:x,"aria-live":v<=100?"polite":"off",className:(0,o.cn)("text-[12px] tabular-nums",v<=100?"font-medium text-amber-600":"text-gray-400"),children:[v," characters left"]}),(0,r.jsx)("button",{type:"button",onClick:()=>h(!1),className:"rounded-full px-3 py-1 text-[13px] font-semibold text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400",children:"Done"})]})]})})})]})}},79980:function(e,t,n){n.d(t,{T:function(){return i}});var r=n(65724);function i(e){let{children:t}=e;return(0,r.jsx)("span",{style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"},children:t})}},64376:function(e,t,n){n.d(t,{I:function(){return r}});
1let r={not_configured:"Clarua isn't switched on for this environment yet. Nothing you did — the model credentials aren't set on the server.",rate_limited:"You've asked Clarua a lot in a short window. Give it a minute and try again.",unauthenticated:"Sign in to ask Clarua.",upstream_failed:"Clarua couldn't reach the model just now. Worth trying again in a moment.",network:"The connection dropped before Clarua finished. Your question wasn't lost — try sending it again."}},18866:function(e,t,n){n.d(t,{FU:function(){return a},HU:function(){return s},Vz:function(){return i}});var r=n(59316);let i=e=>r.x.post("/community",e),a=()=>r.x.get("/community/user/memberships"),s=()=>r.x.get("/community/user/ownerships")},10387:function(e,t,n){n.d(t,{Y:function(){return a}});var r=n(19704),i=n(18866);let a=["community-user-memberships"];t.Z=()=>(0,r.a)({queryKey:a,queryFn:i.FU,staleTime:3e5,gcTime:9e5,refetchOnWindowFocus:!1})},49159:function(e,t,n){n.d(t,{t:function(){return a}});var r=n(19704),i=n(18866);let a=["community-user-ownerships"];t.Z=()=>(0,r.a)({queryKey:a,queryFn:i.HU,staleTime:6e5,gcTime:18e5,refetchOnWindowFocus:!1})},74575:function(e,t,n){n.d(t,{Kw:function(){return l},PW:function(){return o},_G:function(){return i},jr:function(){return s}});let r={draft:"draft",scheduled:"scheduled",archived:"archived"},i=5,a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return e.status===r.scheduled&&!!e.publish_at&&new Date(e.publish_at).getTime()<=t.getTime()},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return"not_a_time";let n=e instanceof Date?e:new Date(e);if(Number.isNaN(n.getTime()))return"not_a_time";if((n.getTime()-t.getTime())/6e4<i)return"too_soon";let r=new Date(t);return(r.setMonth(r.getMonth()+18),n.getTime()>r.getTime())?"too_far_ahead":null},l=e=>{switch(e){case"not_a_time":return"Pick a date and time to schedule this post.";case"too_soon":return"Schedule at least ".concat(i," minutes from now, so there's time to change your mind.");case"too_far_ahead":return"You can schedule up to ".concat(18," months ahead.")}},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return e.status===r.draft?"Draft":e.status===r.scheduled?a(e,t)?"Published":"Scheduled":e.status===r.archived?"Archived":"Published"}},40614:function(e,t,n){n.d(t,{zk:function(){return l}});var r=n(7233);let i=e=>r.Z_().max(1e5,"".concat(e," is too long to store")),a={title:i("Title").trim().optional().default(""),description:i("Post text").optional(),image_url:r.Z_().optional(),image_alt:r.Z_().trim().max(1e3).optional(),status:r.Km(["published","draft","scheduled"]).optional(),publish_at:r.Z_().datetime().optional(),poll:r.Ry({options:r.IX(r.Z_().trim().max(25)).min(2).max(4),duration_minutes:r.oQ.number().int().min(5).max(10080)}).optional(),video_playback_id:r.Z_().optional(),video_asset_id:r.Z_().optional(),audio_url:r.Z_().optional(),thumbnail_url:r.Z_().optional()},s={email_all_members:r.O7().optional()},l=r.Ry({...a,...s});r.Ry({...a,...s,community_id:r.Z_().trim().min(1,"Community id is required")}),r.Ry({...a,pinned:r.O7().optional()})},52596:function(e,t,n){n.d(t,{Am:function(){return v}});var r=n(28266);let i=new Map,a=0,s=()=>"toastify-".concat(++a),l=e=>(null==e?void 0:e.toastId)!==void 0&&null!==e.toastId?e.toastId:(null==e?void 0:e.id)!==void 0&&null!==e.id?e.id:void 0,o=(e,t)=>(null==e?void 0:e.autoClose)===!1?Number.POSITIVE_INFINITY:"number"==typeof(null==e?void 0:e.autoClose)&&Number.isFinite(e.autoClose)&&e.autoClose>0?e.autoClose:"number"==typeof(null==e?void 0:e.duration)&&Number.isFinite(e.duration)&&e.duration>0?e.duration:t,d=e=>{if("number"==typeof e&&Number.isFinite(e))return"".concat(Math.round(100*Math.min(1,Math.max(0,e))),"%")},c=(e,t)=>"function"==typeof e?e({closeToast:()=>p(t),toastProps:{toastId:t}}):e,u=(e,t,n)=>{let r={id:e},a=o(t,n);if(void 0!==a&&(r.duration=a),(null==t?void 0:t.icon)!==void 0&&!1!==t.icon&&(r.icon=t.icon),(null==t?void 0:t.description)!==void 0)r.description=t.description;else{let e=d(null==t?void 0:t.progress);void 0!==e&&(r.description=e)}(null==t?void 0:t.action)!==void 0&&(r.action=t.action),(null==t?void 0:t.className)&&(r.className=t.className),(null==t?void 0:t.style)&&(r.style=t.style),(null==t?void 0:t.closeButton)!==void 0&&(r.closeButton=t.closeButton);let s=null==t?void 0:t.onClose;return r.onDismiss=()=>{i.delete(e),null==s||s()},r.onAutoClose=()=>{i.delete(e),null==s||s()},r}
1,m=(e,t,n)=>{var a,o;let d=null!==(o=l(n))&&void 0!==o?o:s(),m=u(d,n,"loading"===e?Number.POSITIVE_INFINITY:void 0),h=c(t,d);switch(i.set(d,{message:t,kind:e}),e){case"success":r.Am.success(h,m);break;case"error":r.Am.error(h,m);break;case"info":r.Am.info(h,m);break;case"warning":r.Am.warning(h,m);break;case"loading":r.Am.loading(h,m);break;default:(0,r.Am)(h,m)}return null==n||null===(a=n.onOpen)||void 0===a||a.call(n),d},h=e=>"warn"===e?"warning":"success"===e||"error"===e||"info"===e||"warning"===e||"loading"===e?e:"default";function p(e){if(null==e){i.clear(),r.Am.dismiss();return}i.delete(e),r.Am.dismiss(e)}let x=e=>e&&"object"==typeof e&&!Array.isArray(e)&&"render"in e?e.render:e,g=(e,t)=>{let n=x(e);return"function"==typeof n?e=>n({data:e}):null==n?t:n},b=(e,t)=>m(h(null==t?void 0:t.type),e,t);b.success=(e,t)=>m("success",e,t),b.error=(e,t)=>m("error",e,t),b.info=(e,t)=>m("info",e,t),b.warning=(e,t)=>m("warning",e,t),b.warn=b.warning,b.loading=(e,t)=>m("loading",e,t),b.promise=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a="function"==typeof e?e():e,o=null!==(t=l(i))&&void 0!==t?t:s(),d=x(n.pending);return r.Am.promise(a,{...u(o,i),loading:null==d?"Loading…":d,success:g(n.success,"Done"),error:g(n.error,"Something went wrong")}),a},b.update=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.get(e),a=void 0!==n.render?n.render:null==r?void 0:r.message;if(void 0===a)return;let s=!0===n.isLoading||void 0===n.isLoading&&void 0===n.type?(null==r?void 0:r.kind)==="loading"||!0===n.isLoading?"loading":null!==(t=null==r?void 0:r.kind)&&void 0!==t?t:"default":h(n.type),{render:l,isLoading:o,type:d,...c}=n;m(s,a,{...c,toastId:e})},b.dismiss=p,b.done=e=>p(e),b.isActive=e=>i.has(e),b.clearWaitingQueue=()=>void 0;let v=b},49260:function(e,t,n){n.d(t,{$:function(){return i}});var r=n(16584);async function i(e){var t,n,i,a,s,l,o,d;let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let o=await r.default.post("/api/v2/community/posts/upload");if(!(null===(n=o.data)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.upload_url))throw Error("Invalid upload URL received from server");await r.default.put(o.data.data.upload_url,e,{headers:{"Content-Type":e.type},onUploadProgress:e=>{if(e.total){var t;let n=Math.round(100*e.loaded/e.total);null===(t=c.onProgress)||void 0===t||t.call(c,n)}}});let d=await r.default.get("/api/v2/community/posts/mux/upload-status/".concat(o.data.data.upload_id)),u=null===(s=d.data.data)||void 0===s?void 0:null===(a=s.playback_ids)||void 0===a?void 0:null===(i=a[0])||void 0===i?void 0:i.id,m=u?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Array.from({length:t},(t,n)=>"https://image.mux.com/".concat(e,"/thumbnail.jpg?time=").concat(Math.floor(5*n),"&width=640&height=360&fit_mode=preserve"))}(u):[];return{upload_id:o.data.data.upload_id,asset_id:null===(l=d.data.data)||void 0===l?void 0:l.id,playback_id:u,thumbnails:m}}catch(e){throw console.error("Upload failed:",e),r.default.isAxiosError(e)&&(console.error("Response data:",null===(o=e.response)||void 0===o?void 0:o.data),console.error("Response status:",null===(d=e.response)||void 0===d?void 0:d.status)),Error("Failed to upload video")}}}}]);

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.