blocfeed 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,885 @@
1
+ import {createContext,forwardRef,useState,useEffect,useRef,useMemo,useImperativeHandle,useCallback,useContext}from'react';import {record}from'rrweb';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';import {AnimatePresence,motion}from'framer-motion';function C(){return typeof window<"u"&&typeof document<"u"}function jt(e){let t=globalThis.CSS;return typeof t?.escape=="function"?t.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>{let r=n.codePointAt(0);return r===void 0?"":`\\${r.toString(16)} `})}function Pe(e){return {x:e.x,y:e.y,width:e.width,height:e.height}}function $r(e){return {x:e.x+window.scrollX,y:e.y+window.scrollY,width:e.width,height:e.height}}function qr(e){return e.replace(/\s+/g," ").trim()}function oe(e,t=140){let n=e.textContent;if(!n)return;let r=qr(n);if(r)return r.length<=t?r:`${r.slice(0,t-1)}\u2026`}function jr(e){let t=1;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}var ft=["data-testid","data-test-id","data-test","data-qa","data-cy"],ut="data-blocfeed-component";function le(e){let t=e.closest(`[${ut}]`);if(!t)return;let r=t.getAttribute(ut)?.trim();return r||void 0}function xe(e,t=5){let n=[],r=e,o=0;for(;r&&o<t*4;){let i=le(r);if(i&&n[n.length-1]!==i&&(n.push(i),n.length>=t))break;r=r.parentElement,o++;}return n}function Ee(e,t=4){let n=e,r=0;for(;n&&r<t;){let i=n.getAttribute(ut)?.trim();if(i)return `bf:component:${i}`;for(let a of ft){let h=n.getAttribute(a)?.trim();if(h)return `bf:testid:${h}`}let c=n.getAttribute("id")?.trim();if(c&&!/^\d/.test(c))return `bf:id:${c}`;n=n.parentElement,r+=1;}return null}function Kr(e){for(let t of ft){let n=e.closest(`[${t}]`);if(!n)continue;let o=n.getAttribute(t)?.trim();if(o)return o}}function Kt(e){try{let t=e,n=Object.getOwnPropertyNames(t);for(let r of n)if(r.startsWith("__reactFiber$")||r.startsWith("__reactInternalInstance$")){let o=t[r];if(o&&typeof o=="object")return o}}catch{}return null}function me(e){if(e.length<=1||e.length===2&&e[0]===e[0].toLowerCase()||e.startsWith("__")&&e.endsWith("__"))return true;let t=e[0];return t>="a"&&t<="z"}function Re(e){if(e){for(let t of e)if(typeof t.name=="string"&&t.name&&!me(t.name))return t.name}}function K(e){if(e&&typeof e!="string"){if(typeof e=="function"){let t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.name=="string"&&t.name?t.name:void 0}if(typeof e=="object"){let t=e,n=t.displayName;if(typeof n=="string"&&n)return n;let r=t.render;if(typeof r=="function"){let i=r;if(typeof i.displayName=="string"&&i.displayName)return i.displayName;if(typeof i.name=="string"&&i.name)return i.name}let o=t.type;return K(o)}}}function pt(e){let t=Kt(e);if(!t)return;let n=Re(t._debugInfo);if(n)return n;let r=t._debugOwner!==void 0;if(r){let a=t._debugOwner;for(let l=0;a&&l<50;l+=1){let h=Re(a._debugInfo);if(h)return h;let b=K(a.type)??K(a.elementType);if(b&&!me(b))return b;a=a._debugOwner;}}if(t._owner!==void 0&&t._owner!==t._debugOwner){let a=t._owner;for(let l=0;a&&l<50;l+=1){let h=Re(a._debugInfo);if(h)return h;let b=K(a.type)??K(a.elementType);if(b&&!me(b))return b;a=a._owner;}}let i=t,s=r?80:25;for(let a=0;i&&a<s;a+=1){let l=Re(i._debugInfo);if(l)return l;let h=K(i.type)??K(i.elementType);if(h&&!me(h))return h;i=i.return;}let c=e.parentElement;for(let a=0;c&&a<15;a+=1){let l=Kt(c);if(l){let h=Re(l._debugInfo);if(h)return h;let b=K(l.type)??K(l.elementType);if(b&&!me(b))return b;if(l._debugOwner){let d=K(l._debugOwner.type)??K(l._debugOwner.elementType);if(d&&!me(d))return d}if(l._owner&&l._owner!==l._debugOwner){let d=K(l._owner.type)??K(l._owner.elementType);if(d&&!me(d))return d}}c=c.parentElement;}}function Xr(e){let t=e.tagName.toLowerCase(),n=e.getAttribute("id");if(n)return `#${jt(n)}`;for(let r of ft){let o=e.getAttribute(r);if(o)return `${t}[${r}="${jt(o)}"]`}return `${t}:nth-of-type(${jr(e)})`}function ge(e,t=10){let n=[],r=e;for(;r&&n.length<t;){let o=Xr(r);if(n.unshift(o),o.startsWith("#"))break;r=r.parentElement;}return n.join(" > ")}var Yr=new Set(["button","link","tab","menuitem"]);function Yt(e){if(e.tagName==="BUTTON")return e.disabled?null:"button";if(e.tagName==="A"||e.tagName==="a"){let n=e.getAttribute("href")?.trim();return !n||n==="#"||n.toLowerCase().startsWith("javascript:")?null:"link"}let t=e.getAttribute("role");if(t&&Yr.has(t))return "role";try{if(window.getComputedStyle(e).cursor==="pointer")return "cursor_pointer"}catch{}return null}function Xt(e,t){if(!t||t.length===0)return false;for(let n of t)if(e.closest(n))return true;return false}function mt(e,t){if(!e||Xt(e,t.ignoreSelectors))return null;let n=e;for(;n;){if(Xt(n,t.ignoreSelectors))return null;if(t.isSelectable?t.isSelectable(n):Jr(n))return n;n=n.parentElement;}return null}function Ve(e,t){if(t.length===0)return false;for(let n of t)try{if(e.matches(n)||e.closest(n))return !0}catch{}return false}function Jr(e){let t=e.tagName;return !(t==="HTML"||t==="BODY")}function Jt(e){let t=e.getBoundingClientRect(),n={selector:ge(e),tagName:e.tagName.toLowerCase(),rect:Pe(t),pageRect:$r(t)},r=e.getAttribute("id");r&&(n.id=r);let o=e.className;typeof o=="string"&&o.trim()&&(n.className=o);let i=oe(e);i&&(n.textSnippet=i);let s=le(e)??pt(e);s&&(n.componentName=s);let c=Kr(e);return c&&(n.testId=c),n}function Gr(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}}function k(e,t,n){let r={kind:e,message:Gr(t)};return n&&(r.detail=n),r}var gt=null;async function Gt(){return gt||(gt=import('html-to-image')),gt}async function Zr(e){return await new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(new Error("Failed to load generated screenshot")),r.src=e;})}async function Zt(e,t){let{width:n,height:r}=await Zr(e);return {dataUrl:e,mime:t,width:n,height:r}}function ke(e){if(e?.aborted)throw new Error("Aborted")}function Qt(){return {async captureElement(e,t){if(!C())throw new Error("captureElement can only run in the browser");ke(t.signal);let n=await Gt();ke(t.signal);let r=t.mime==="image/jpeg"?await n.toJpeg(e,{quality:t.quality??.92,pixelRatio:t.pixelRatio}):await n.toPng(e,{pixelRatio:t.pixelRatio});return ke(t.signal),await Zt(r,t.mime)},async captureFullPage(e){if(!C())throw new Error("captureFullPage can only run in the browser");ke(e.signal);let t=document.documentElement,n=Math.max(t.scrollWidth,t.clientWidth),r=Math.max(t.scrollHeight,t.clientHeight),o=Math.min(1,e.maxDimension/Math.max(n,r)),i=Math.max(1,Math.round(n*o)),s=Math.max(1,Math.round(r*o)),c=await Gt();ke(e.signal);let a=e.mime==="image/jpeg"?await c.toJpeg(t,{width:i,height:s,quality:e.quality??.92,pixelRatio:e.pixelRatio}):await c.toPng(t,{width:i,height:s,pixelRatio:e.pixelRatio});return ke(e.signal),await Zt(a,e.mime)}}}var Qr=12e3,eo=2048,to=.92;function en(){return Date.now()}function no(e){return new Promise((t,n)=>{let r=()=>n(new Error("Aborted"));if(e.aborted){r();return}e.addEventListener("abort",r,{once:true});})}async function tn(e,t,n){let r=new Promise((i,s)=>{let c=setTimeout(()=>s(new Error("Timeout")),t);typeof c.unref=="function"&&c.unref();}),o=[e,r];return n&&o.push(no(n)),await Promise.race(o)}function ro(e){if(!C())return 1;let t=window.devicePixelRatio||1,n=e?.pixelRatio??Math.min(t,2);return Math.max(.1,n)}function oo(e){return !!(e?.element||e?.fullPage)}function nn(e){let t={mime:e.mime,pixelRatio:e.pixelRatio,maxDimension:e.maxDimension};return e.includeQuality&&(t.quality=e.quality),e.signal&&(t.signal=e.signal),t}async function rn(e){let{selectionElement:t,capture:n,signal:r}=e;if(!C()||!oo(n))return;let o=en(),i=[],s=n?.timeoutMs??Qr,c=n?.maxDimension??eo,a=n?.mime??"image/png",l=n?.quality??to,h=n?.adapter??Qt(),b={},d=ro(n);if(n?.element&&t)try{let p=t.getBoundingClientRect(),f=Math.min(1,c/Math.max(p.width,p.height)),m=Math.min(d,d*f),y=await tn(Promise.resolve(h.captureElement(t,{...nn({mime:a,quality:l,pixelRatio:m,maxDimension:c,includeQuality:a==="image/jpeg",...r?{signal:r}:{}})})),s,r);b.element=y;}catch(p){if(r?.aborted)throw p;i.push(k("capture_failed",p,{target:"element"}));}if(n?.fullPage)try{let p=await tn(Promise.resolve(h.captureFullPage(nn({mime:a,quality:l,pixelRatio:d,maxDimension:c,includeQuality:a==="image/jpeg",...r?{signal:r}:{}}))),s,r);b.fullPage=p;}catch(p){if(r?.aborted)throw p;i.push(k("capture_failed",p,{target:"fullPage"}));}let g=en(),u={startedAt:o,finishedAt:g,durationMs:Math.max(0,g-o)};return i.length>0&&(u.errors=i),{...b,diagnostics:u}}function io(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ao(){return C()?{url:window.location.href,title:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen.width,height:window.screen.height},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,timezone:io()}:{}}function so(e){if(!e)return {};let t={};return e.id&&(t.userId=e.id),e.email&&(t.userEmail=e.email),e.name&&(t.userName=e.name),t}async function on(e){let{config:t,context:n,user:r}=e;if(t?.enabled===false)return {};let o={...ao(),...so(r)},i=t?.enrich;if(!i)return o;try{let s=await i(n);return {...o,...s}}catch(s){let c=k("unknown",s);return {...o,blocfeedMetadataError:c.message}}}var Fe="blocfeed-queue",co=50;function bt(){if(!C())return [];try{let e=localStorage.getItem(Fe);if(!e)return [];let t=JSON.parse(e);if(Array.isArray(t))return t;console.warn("[BlocFeed] offline queue was corrupt (non-array) \u2014 resetting");try{localStorage.removeItem(Fe);}catch{}return []}catch(e){console.warn("[BlocFeed] offline queue could not be read \u2014 resetting",e);try{localStorage.removeItem(Fe);}catch{}return []}}function ht(e){if(C())try{e.length===0?localStorage.removeItem(Fe):localStorage.setItem(Fe,JSON.stringify(e));}catch(t){let n=t instanceof DOMException?t.name:"";console.warn(`[BlocFeed] failed to persist offline queue${n?` (${n})`:""} \u2014 feedback may be lost if page is closed`);}}function lo(e){let t={...e};if(t.screenshots){let n={...t.screenshots};n.element&&(n.element={...n.element,dataUrl:""}),n.fullPage&&(n.fullPage={...n.fullPage,dataUrl:""}),t.screenshots=n;}return delete t.video,t}function yt(e){let t=bt(),n=lo(e);for(n.metadata={...n.metadata,_queued:true},t.push({payload:n,timestamp:Date.now()});t.length>co;)t.shift();ht(t);}function an(){let e=bt();return e.length===0?[]:(ht([]),e.map(t=>t.payload))}function ns(){ht([]);}function sn(){return bt().length}function vt(e){let t=null,n=null,r=(...o)=>{n=o,t===null&&(t=requestAnimationFrame(()=>{if(t=null,!n)return;let i=n;n=null,e(...i);}));};return r.cancel=()=>{t!==null&&cancelAnimationFrame(t),t=null,n=null;},r}function We(e){return e instanceof Element?!!e.closest("[data-blocfeed-ui]"):false}function $e(e){e.stopPropagation(),e.stopImmediatePropagation?.();}function cn(e,t){if(!C())throw new Error("BlocFeed picker can only run in a browser environment.");let n=e.ignoreSelectors,r=e.isSelectable,o={};n&&n.length>0&&(o.ignoreSelectors=n),r&&(o.isSelectable=r);let i=null,s=null,c=(u,p=false)=>{if(!u){i=null,s=null,t.onHover(null);return}let f=Pe(u.getBoundingClientRect()),m=`${Math.round(f.x)}:${Math.round(f.y)}:${Math.round(f.width)}:${Math.round(f.height)}`;!p&&u===i&&m===s||(i=u,s=m,t.onHover({element:u,rect:f}));},a=vt(u=>{if(We(u.target))return;let p=document.elementFromPoint(u.clientX,u.clientY),f=mt(p,o);c(f);}),l=vt(()=>{i&&c(i,true);}),h=u=>{We(u.target)||($e(u),u.pointerType==="mouse"&&u.preventDefault());},b=u=>{We(u.target)||($e(u),u.pointerType==="mouse"&&u.preventDefault());},d=u=>{if(We(u.target))return;$e(u),u.preventDefault();let p=document.elementFromPoint(u.clientX,u.clientY),f=mt(p,o);f&&t.onSelect({element:f,descriptor:Jt(f)});},g=u=>{u.key==="Escape"&&($e(u),u.preventDefault(),t.onCancel());};return window.addEventListener("pointermove",a,{capture:true,passive:true}),window.addEventListener("pointerdown",h,{capture:true}),window.addEventListener("pointerup",b,{capture:true}),window.addEventListener("click",d,{capture:true}),window.addEventListener("keydown",g,{capture:true}),window.addEventListener("scroll",l,{capture:true,passive:true}),window.addEventListener("resize",l,{passive:true}),{stop(){window.removeEventListener("pointermove",a,{capture:true}),window.removeEventListener("pointerdown",h,{capture:true}),window.removeEventListener("pointerup",b,{capture:true}),window.removeEventListener("click",d,{capture:true}),window.removeEventListener("keydown",g,{capture:true}),window.removeEventListener("scroll",l,{capture:true}),window.removeEventListener("resize",l),a.cancel(),l.cancel(),t.onHover(null);}}}var uo=200,Be=[],ln=0,qe=false;function dn(e){let t=e.target;if(!(t instanceof Element)||t.closest("[data-blocfeed-ui]"))return;let n={timestampMs:Date.now()-ln,path:window.location.pathname,tagName:t.tagName.toLowerCase()},r=oe(t,100);r&&(n.textSnippet=r);let o=le(t)??pt(t);o&&(n.componentName=o),Be.length<uo&&Be.push(n);}var un={capture:true,passive:true};function fn(){qe||!C()||(qe=true,Be=[],ln=Date.now(),document.addEventListener("click",dn,un));}function pn(){qe&&(qe=false,document.removeEventListener("click",dn,un));}function wt(){return [...Be]}function fo(){Be=[];}var po=3e4,mo=25e5,mn="video/webm",go=250,bo=1e3,ho=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function gn(){if(typeof MediaRecorder>"u")return null;for(let e of ho)if(MediaRecorder.isTypeSupported(e))return e;return null}function xt(){return !C()||typeof navigator?.mediaDevices?.getDisplayMedia!="function"?false:gn()!==null}async function Et(e){let{config:t,signal:n}=e;if(!C()||typeof navigator?.mediaDevices?.getDisplayMedia!="function")throw k("recording_failed",new Error("Screen recording is not supported in this browser"));let r=gn();if(!r)throw k("recording_failed",new Error("No supported video codec found (WebM required)"));if(n?.aborted)throw k("aborted",new Error("Recording aborted before start"));let o;try{o=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1});}catch(f){let m=f instanceof DOMException&&f.name==="NotAllowedError"?"Screen share permission denied":"Failed to start screen share";throw k("recording_failed",new Error(m))}if(n?.aborted)throw o.getTracks().forEach(f=>f.stop()),k("aborted",new Error("Recording aborted after permission"));let i=t?.maxDurationMs??po,s=t?.videoBitsPerSecond??mo,c=new MediaRecorder(o,{mimeType:r,videoBitsPerSecond:s}),a=[],l=[],h=0,b=null,d=null,g=false,u=()=>{pn(),b!==null&&(clearInterval(b),b=null),d!==null&&(clearTimeout(d),d=null),o.getTracks().forEach(f=>f.stop());},p=new Promise((f,m)=>{c.ondataavailable=T=>{T.data.size>0&&a.push(T.data);},c.onstop=()=>{if(g)return;g=true,u();let T=Date.now()-h,S=new Blob(a,{type:mn}),x=URL.createObjectURL(S);f({mime:mn,blobUrl:x,blob:S,durationMs:T,sizeBytes:S.size});},c.onerror=()=>{g||(g=true,u(),m(k("recording_failed",new Error("MediaRecorder error"))));};let y=o.getVideoTracks()[0];if(y&&y.addEventListener("ended",()=>{c.state!=="inactive"&&c.stop();}),n){let T=()=>{g||(g=true,c.state!=="inactive"&&c.stop(),u(),m(k("aborted",new Error("Recording aborted"))));};n.addEventListener("abort",T,{once:true});}});return c.start(bo),fn(),h=Date.now(),b=setInterval(()=>{let f=Date.now()-h;for(let m of l)m(f);},go),d=setTimeout(()=>{!g&&c.state!=="inactive"&&c.stop();},i),{result:p,stop(){!g&&c.state!=="inactive"&&c.stop();},onTick(f){l.push(f);},abort(){g||(g=true,c.state!=="inactive"&&c.stop(),u());}}}var yo=6e4,bn="audio/webm",vo=250,wo=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus"];function hn(){if(typeof MediaRecorder>"u")return null;for(let e of wo)if(MediaRecorder.isTypeSupported(e))return e;return null}function kt(){return !C()||typeof navigator?.mediaDevices?.getUserMedia!="function"?false:hn()!==null}async function St(e){let{config:t,signal:n}=e;if(!C()||typeof navigator?.mediaDevices?.getUserMedia!="function")throw k("recording_failed",new Error("Microphone recording is not supported in this browser"));let r=hn();if(!r)throw k("recording_failed",new Error("No supported audio codec found"));if(n?.aborted)throw k("aborted",new Error("Voice recording aborted before start"));let o;try{o=await navigator.mediaDevices.getUserMedia({audio:!0});}catch(p){let f=p instanceof DOMException&&p.name==="NotAllowedError"?"Microphone permission denied":"Failed to access microphone";throw k("recording_failed",new Error(f))}if(n?.aborted)throw o.getTracks().forEach(p=>p.stop()),k("aborted",new Error("Voice recording aborted after permission"));let i=t?.maxDurationMs??yo,s=new MediaRecorder(o,{mimeType:r}),c=[],a=[],l=0,h=null,b=null,d=false,g=()=>{h!==null&&(clearInterval(h),h=null),b!==null&&(clearTimeout(b),b=null),o.getTracks().forEach(p=>p.stop());},u=new Promise((p,f)=>{if(s.ondataavailable=m=>{m.data.size>0&&c.push(m.data);},s.onstop=()=>{if(d)return;d=true,g();let m=Date.now()-l,y=new Blob(c,{type:bn});p({blob:y,mime:bn,durationMs:m});},s.onerror=()=>{d||(d=true,g(),f(k("recording_failed",new Error("MediaRecorder error"))));},n){let m=()=>{d||(d=true,s.state!=="inactive"&&s.stop(),g(),f(k("aborted",new Error("Voice recording aborted"))));};n.addEventListener("abort",m,{once:true});}});return s.start(1e3),l=Date.now(),h=setInterval(()=>{let p=Date.now()-l;for(let f of a)f(p);},vo),b=setTimeout(()=>{b=null,!d&&s.state!=="inactive"&&s.stop();},i),{result:u,stop(){!d&&s.state!=="inactive"&&s.stop();},onTick(p){a.push(p);},abort(){d||(d=true,s.state!=="inactive"&&s.stop(),g());}}}var xo=12e3,Eo=2,ko=500,So=2e3,_t="https://blocfeed.com/api/feedback",_o="https://blocfeed.com/api/feedback/voice",yn=0,xn="blocfeed-viewer-token",En="blocfeed-my-feedback-url";function To(){try{return localStorage.getItem(xn)}catch{return null}}function Tt(){try{return localStorage.getItem(En)}catch{return null}}function Co(e,t){try{localStorage.setItem(xn,e),t&&localStorage.setItem(En,t);}catch{}}function vn(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new Error("Aborted"));return}let o=setTimeout(n,e),i=()=>{clearTimeout(o),r(new Error("Aborted"));};t?.addEventListener("abort",i,{once:true});})}function Ro(e){return e>=500&&e<=599}function Po(e){let[t,n]=e.split(",",2);if(!t||!n)throw new Error("Invalid data URL");let o=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(n),s=new Uint8Array(i.length);for(let c=0;c<i.length;c+=1)s[c]=i.charCodeAt(c);return new Blob([s],{type:o})}function Fo(e){let t={},n={},r={...e};if(r.screenshots){let o={},i={...r.screenshots};i.element&&(t.element=i.element.dataUrl,o.element={mime:i.element.mime,width:i.element.width,height:i.element.height},i.element={...i.element,dataUrl:""}),i.fullPage&&(t.fullPage=i.fullPage.dataUrl,o.fullPage={mime:i.fullPage.mime,width:i.fullPage.width,height:i.fullPage.height},i.fullPage={...i.fullPage,dataUrl:""}),r.screenshots=i,(o.element||o.fullPage)&&(r.screenshot_intent=o);}return r.video&&(n.blob=r.video.blob,r.video_intent={mime:r.video.mime,durationMs:r.video.durationMs,sizeBytes:r.video.sizeBytes},delete r.video),{lean:r,extracted:t,extractedVideo:n}}async function wn(e,t,n){let r=Po(t);await fetch(e,{method:"PUT",body:r,headers:{"content-type":r.type},...n?{signal:n}:{}});}async function Bo(e){let{feedbackId:t,extracted:n,screenshots:r,signal:o}=e,i={};n.element&&r?.element&&(i.element={dataUrl:n.element,mime:r.element.mime,width:r.element.width,height:r.element.height}),n.fullPage&&r?.fullPage&&(i.fullPage={dataUrl:n.fullPage,mime:r.fullPage.mime,width:r.fullPage.width,height:r.fullPage.height}),Object.keys(i).length!==0&&await fetch(`${_t}/${t}/screenshots`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),...o?{signal:o}:{}});}async function Mo(e){await fetch(`${_t}/${e.feedbackId}/video`,{method:"POST",body:e.blob,headers:{"content-type":e.blob.type},...e.signal?{signal:e.signal}:{}});}async function kn(e){let{signal:t,transport:n}=e;if(Date.now()-yn<So)return {ok:false,error:k("configuration",new Error("Please wait before submitting again"))};let o=n?.timeoutMs??xo,i=n?.maxAttempts??Eo,s=n?.backoffMs??ko,c=!!(e.payload.screenshots?.element?.dataUrl||e.payload.screenshots?.fullPage?.dataUrl),a=!!e.payload.video?.blob,l=c||a,{lean:h,extracted:b,extractedVideo:d}=l?Fo(e.payload):{lean:e.payload,extracted:{},extractedVideo:{}},g=To();g&&(h.viewer_token=g);let u={...b,...e.screenshotDataUrls};for(let p=1;p<=i;p+=1){let f=new AbortController,m=setTimeout(()=>f.abort(),o),y=()=>f.abort();t&&t.addEventListener("abort",y,{once:true});try{let T=await fetch(_t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(h),signal:f.signal});if(T.ok){yn=Date.now();let x;try{x=await T.json();}catch{}if(x?.viewer_token&&Co(x.viewer_token,x.my_feedback_url),(u.element||u.fullPage)&&x){let P=x.upload_urls;if(P){let B=[];u.element&&P.element&&B.push(wn(P.element,u.element,t)),u.fullPage&&P.fullPage&&B.push(wn(P.fullPage,u.fullPage,t));try{await Promise.all(B);}catch{}}else if(x.feedback_id)try{await Bo({feedbackId:x.feedback_id,extracted:u,screenshots:e.payload.screenshots,...t?{signal:t}:{}});}catch{}}if(d.blob&&x){let P=x.upload_urls;if(P?.video)try{await fetch(P.video,{method:"PUT",body:d.blob,headers:{"content-type":d.blob.type},...t?{signal:t}:{}});}catch{}else if(x.feedback_id)try{await Mo({feedbackId:x.feedback_id,blob:d.blob,...t?{signal:t}:{}});}catch{}}let O={ok:!0,status:T.status};return x&&(O.apiResponse=x),O}if(p<i&&Ro(T.status)){let x=.85+Math.random()*.3,L=Math.round(s*2**(p-1)*x);await vn(L,t);continue}let S=`HTTP ${T.status}`;try{let x=await T.json();x?.error&&(S=x.error);}catch{}return {ok:!1,status:T.status,error:k("api_failed",new Error(S))}}catch(T){if(f.signal.aborted||t?.aborted)return {ok:false,error:k("aborted",T)};if(p<i){let S=.85+Math.random()*.3,x=Math.round(s*2**(p-1)*S);await vn(x,t);continue}return {ok:false,error:k("api_failed",T)}}finally{clearTimeout(m),t&&t.removeEventListener("abort",y);}}return {ok:false,error:k("api_failed",new Error("Failed"))}}async function Sn(e){let{blob:t,mime:n,blocfeedId:r,signal:o}=e,i=await fetch(_o,{method:"POST",headers:{"Content-Type":n,"X-Blocfeed-Id":r},body:t,...o?{signal:o}:{}});if(!i.ok){let c=await i.json().catch(()=>({error:"Unknown error"}));throw k("api_failed",new Error(c?.error??`Voice API returned ${i.status}`))}let s=await i.json();return {text:s.text??"",warning:s.warning}}async function Ct(e){let{signal:t,transport:n}=e,r={ok:false};try{let o={payload:e.payload,...t?{signal:t}:{},...n?{transport:n}:{}};r.api=await kn(o),r.ok=!!r.api?.ok;}catch(o){r.api={ok:false,error:k("api_failed",o)},r.ok=false;}return {payload:e.payload,result:r}}var Ao={enabled:true,sampling:1,ignoreSelectors:["[data-blocfeed-ui]","[data-blocfeed-ignore]"],rageClick:{enabled:true,threshold:3,windowMs:1e3,streakIdleMs:1500},httpFail:{enabled:true,statusCodes:[400,401,403,404,408,409,422,429,500,502,503,504],ignoreUrls:["/api/behavioral-events","/api/feedback"],treatJsonErrorAsFail:false},redirectLoop:{enabled:true,threshold:3,windowMs:2e3},formDataLoss:{enabled:true},deadClick:{enabled:true,observationWindowMs:300,rateLimitPerSelector:5},jsError:{enabled:true,sampling:1,ignorePatterns:[],rateLimitPerFingerprint:5,rateLimitWindowMs:6e4},piiScrub:"default"};function _n(e){let t=Ao;return {enabled:e?.enabled??t.enabled,sampling:e?.sampling??t.sampling,ignoreSelectors:e?.ignoreSelectors??t.ignoreSelectors,rageClick:{...t.rageClick,...e?.rageClick??{}},httpFail:{...t.httpFail,...e?.httpFail??{}},redirectLoop:{...t.redirectLoop,...e?.redirectLoop??{}},formDataLoss:{...t.formDataLoss,...e?.formDataLoss??{}},deadClick:{...t.deadClick,...e?.deadClick??{}},jsError:{...t.jsError,...e?.jsError??{}},piiScrub:e?.piiScrub??t.piiScrub}}function Tn(e){let t=[];async function n(){if(t.length===0)return;let o=t.splice(0,50);try{await fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-blocfeed-id":e.blocfeedId},body:JSON.stringify({events:o}),keepalive:!0});}catch{}}function r(){if(t.length===0)return;if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"){n();return}let o=t.splice(0,50),i=new Blob([JSON.stringify({events:o})],{type:"application/json"}),s=`${e.endpoint}?_bfid=${encodeURIComponent(e.blocfeedId)}`;try{navigator.sendBeacon(s,i);}catch{}}return {enqueue(o){t.push(o);},flush:n,flushBeacon:r,size(){return t.length}}}var Cn="bf_behavioral_session",je=null;function D(){try{let e=sessionStorage.getItem(Cn);if(e)return e;let t=Rn();return sessionStorage.setItem(Cn,t),t}catch{return je||(je=Rn(),je)}}function Rn(){let e=Math.random().toString(36).slice(2,10).padEnd(8,"0");return `bf_${Date.now()}_${e}`}function Se(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}function Pn(e,t){if(!e.rageClick.enabled)return ()=>{};let{threshold:n,windowMs:r,streakIdleMs:o}=e.rageClick,i=new Map;function s(b){let d=b.target,g=d?Io(d):false,u=d?oe(d,200)??null:null,p=d?d.tagName.toLowerCase():"",f=d&&d.id||null,m=d?le(d)??null:null,y=d?xe(d,5):[];return {session_id:D(),event_type:"rage_click",page_url:typeof window>"u"?"":window.location.href,selector:b.selector,element_text:u,event_data:{click_count:b.timestamps.length,window_ms:r,final:true,...g?{disabled:true}:{},tag_name:p,...f?{element_id:f}:{},...m?{component_name:m}:{},...y.length>0?{parent_components:y}:{}},created_at:new Date().toISOString(),stable_key:b.stableKey}}function c(b){let d=i.get(b);d&&(d.idleTimer&&(clearTimeout(d.idleTimer),d.idleTimer=null),d.reached&&t(s(d)),i.delete(b));}function a(b){let d=i.get(b);d&&(d.idleTimer&&clearTimeout(d.idleTimer),d.idleTimer=setTimeout(()=>{c(b);},o));}function l(b){try{let d=b.target;if(!d||!(d instanceof Element)||Ve(d,e.ignoreSelectors))return;let g=ge(d,4);if(!g)return;let u=Ee(d),p=u??g,f=Date.now(),m=i.get(p);m?(m.target=d,m.selector=g):(m={selector:g,stableKey:u,timestamps:[],reached:!1,idleTimer:null,target:d},i.set(p,m)),m.reached||(m.timestamps=m.timestamps.filter(y=>f-y<=r)),m.timestamps.push(f),a(p),!m.reached&&m.timestamps.length>=n&&(m.reached=!0);}catch{}}function h(){for(let b of Array.from(i.keys()))c(b);}return document.addEventListener("click",l,{capture:true,passive:true}),typeof window<"u"&&window.addEventListener("pagehide",h),()=>{document.removeEventListener("click",l,{capture:true}),typeof window<"u"&&window.removeEventListener("pagehide",h);for(let b of i.values())b.idleTimer&&clearTimeout(b.idleTimer);i.clear();}}function Io(e){if(e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true")return true;try{if(window.getComputedStyle(e).pointerEvents==="none")return !0}catch{}return false}var Fn=0,Bn=null,Xe=null,Ye=[],Lo=1500;function No(){function e(t){try{let n=t.target;if(!n)return;let r=n.closest('button[type="submit"], input[type="submit"], [data-blocfeed-submit]');if(!r)return;Fn=Date.now();let o=r.closest("form");Bn=(o?ge(o,3):"")||null,Xe=oe(r,100)??null,Ye=xe(r,5);}catch{}}return document.addEventListener("click",e,{capture:true,passive:true}),()=>document.removeEventListener("click",e,{capture:true})}function Mn(e,t){if(!e.httpFail.enabled)return ()=>{};let{statusCodes:n,ignoreUrls:r,treatJsonErrorAsFail:o}=e.httpFail,i=new Set(n),s=No(),c=globalThis.fetch,a=async(d,g)=>{let u=typeof d=="string"?d:d instanceof URL?d.toString():d.url,p=(g?.method??d.method??"GET").toUpperCase(),f;try{f=await c.call(globalThis,d,g);}catch(m){try{if(!Ke(u,r)){let y=m&&typeof m=="object"&&m.name==="AbortError"?"abort":"network";t(b(0,u,p,y));}}catch{}throw m}try{if(!Ke(u,r)&&i.has(f.status))t(b(f.status,u,p));else if(o&&!Ke(u,r)&&f.status>=200&&f.status<300){let m=f.headers.get("content-type")??"";(m.includes("application/json")||m.includes("+json"))&&f.clone().json().then(y=>{if(Do(y))try{t(b(f.status,u,p,"json_error"));}catch{}}).catch(()=>{});}}catch{}return f};globalThis.fetch=a;let l=XMLHttpRequest.prototype.open,h=XMLHttpRequest.prototype.send;return XMLHttpRequest.prototype.open=function(d,g,...u){return this.__bf_url=g,this.__bf_method=d.toUpperCase(),l.call(this,d,g,...u)},XMLHttpRequest.prototype.send=function(d){let g=()=>{try{let u=this.__bf_url??"",p=this.__bf_method??"GET";!Ke(u,r)&&i.has(this.status)&&t(b(this.status,u,p));}catch{}};return this.__bf_handler=g,this.addEventListener("loadend",g),h.call(this,d??null)},()=>{globalThis.fetch=c,XMLHttpRequest.prototype.open=l,XMLHttpRequest.prototype.send=h,s(),Xe=null,Ye=[];};function b(d,g,u,p){let m=Date.now()-Fn<Lo;return {session_id:D(),event_type:"error",page_url:typeof window>"u"?"":window.location.href,selector:null,element_text:null,event_data:{http_status:d,request_url:g,method:u,...p?{error_kind:p}:{},form_selector:m?Bn:null,...m&&Xe?{button_text:Xe}:{},...m&&Ye.length>0?{parent_components:Ye}:{}},created_at:new Date().toISOString(),stable_key:null}}}function Do(e){if(!e||typeof e!="object")return false;let t=e;return t.ok===false||t.success===false||"error"in t&&t.error!=null&&t.error!==false}function Ke(e,t){if(t.length===0)return false;for(let n of t)if(e.includes(n))return true;return false}var Oo=3e4;function An(e,t){if(!e.redirectLoop.enabled)return ()=>{};if(typeof window>"u")return ()=>{};let{threshold:n,windowMs:r}=e.redirectLoop,o=new Map,i=new Map,s=history.pushState,c=history.replaceState;function a(h){try{let b=Date.now(),d=i.get(h)??0;if(b<d)return;let u=(o.get(h)??[]).filter(p=>b-p<=r);if(u.push(b),o.set(h,u),u.length>=n){let p={session_id:D(),event_type:"thrashing",page_url:window.location.href,selector:null,element_text:null,event_data:{count:u.length,url:h,window_ms:r},created_at:new Date().toISOString(),stable_key:null};t(p),i.set(h,b+Oo),o.set(h,[]);}}catch{}}function l(){let h=window.location.pathname+window.location.search;a(h);}return history.pushState=function(...h){let b=s.apply(this,h);return l(),b},history.replaceState=function(...h){let b=c.apply(this,h);return l(),b},window.addEventListener("popstate",l),()=>{history.pushState=s,history.replaceState=c,window.removeEventListener("popstate",l);}}var Ho=6e4;function In(e,t){if(!e.formDataLoss.enabled)return ()=>{};if(typeof window>"u")return ()=>{};let n=new Set,r=new Map,o=new Map,i=new Map;function s(p){let f=p.closest("form");return f?f.id?`#${f.id}`:"form":null}function c(){let p=0;for(let f of r.values())p+=f;return p}function a(p){n.delete(p),r.delete(p),i.delete(p);}function l(p){try{let f=p.target;if(!f||!(f instanceof HTMLInputElement||f instanceof HTMLTextAreaElement||f instanceof HTMLSelectElement))return;let m=s(f);if(!m)return;n.add(m),r.set(m,(r.get(m)??0)+1);let y=f.closest("form");y&&i.set(m,y);}catch{}}function h(p){try{let f=p.target;if(!f||!(f instanceof HTMLFormElement))return;let m=f.id?`#${f.id}`:"form";o.set(m,Date.now()),a(m);}catch{}}function b(p){try{let f=p.target;if(!f||!(f instanceof HTMLFormElement))return;let m=f.id?`#${f.id}`:"form";a(m);}catch{}}function d(p){if(n.size===0)return;let f=Array.from(n),m=f[0]??null,y=m?i.get(m)??null:null,T=y?Ee(y):null,S={session_id:D(),event_type:"form_abandonment",page_url:window.location.href,selector:m,element_text:null,event_data:{cause:p,field_count:c(),forms:f},created_at:new Date().toISOString(),stable_key:T};t(S);}function g(p){if(!p.persisted||n.size===0)return;let f=Date.now();for(let[,m]of o)if(f-m<Ho)return;d("bfcache_restore");}function u(){d("beforeunload_after_edit");}return document.addEventListener("input",l,{capture:true,passive:true}),document.addEventListener("submit",h,{capture:true}),document.addEventListener("reset",b,{capture:true}),window.addEventListener("pageshow",g),window.addEventListener("beforeunload",u),()=>{document.removeEventListener("input",l,{capture:true}),document.removeEventListener("submit",h,{capture:true}),document.removeEventListener("reset",b,{capture:true}),window.removeEventListener("pageshow",g),window.removeEventListener("beforeunload",u);}}function Uo(){let e={urlChangeCount:0,networkCount:0,filePickerCount:0,uninstall:()=>{}},t=history.pushState,n=history.replaceState;history.pushState=function(...c){return e.urlChangeCount+=1,t.apply(this,c)},history.replaceState=function(...c){return e.urlChangeCount+=1,n.apply(this,c)};let r=()=>{e.urlChangeCount+=1;};window.addEventListener("popstate",r);let o=globalThis.fetch;if(o){let c=(a,l)=>(e.networkCount+=1,o.call(globalThis,a,l));globalThis.fetch=c;}let i=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(c,a,...l){return e.networkCount+=1,i.call(this,c,a,...l)};let s=HTMLInputElement.prototype.click;return HTMLInputElement.prototype.click=function(){return this.type==="file"&&(e.filePickerCount+=1),s.call(this)},e.uninstall=()=>{history.pushState=t,history.replaceState=n,window.removeEventListener("popstate",r),o&&(globalThis.fetch=o),XMLHttpRequest.prototype.open=i,HTMLInputElement.prototype.click=s;},e}function Ln(e,t){if(!e.deadClick.enabled)return ()=>{};if(typeof window>"u")return ()=>{};let{observationWindowMs:n,rateLimitPerSelector:r}=e.deadClick,o=new Map,i=Uo();function s(c){try{let a=c.target;if(!a||!(a instanceof Element)||c.button!==0||c.metaKey||c.ctrlKey||c.altKey||c.shiftKey||Ve(a,e.ignoreSelectors)||a.closest("label"))return;if(a instanceof HTMLInputElement){let B=a.type;if(B==="checkbox"||B==="radio"||B==="file")return}if(a instanceof HTMLSelectElement||a.closest("a[target='_blank'], a[download]")||a.closest('[contenteditable="true"]'))return;try{let B=window.getSelection();if(B&&B.toString().length>0)return}catch{}let l=Yt(a);if(!l)return;let h=ge(a,4);if(!h)return;let b=Ee(a),d=b??h,g=i.urlChangeCount,u=i.networkCount,p=i.filePickerCount,f=new Date().toISOString(),m=oe(a,200)??null,y=a.tagName.toLowerCase(),T=a.id||null,S=le(a)??null,x=xe(a,5),L=zo(a),O=0,P=null;if(L){P=new MutationObserver(()=>{O+=1;});try{P.observe(L,{childList:!0,attributes:!0,characterData:!0,subtree:!0});}catch{P=null;}}setTimeout(()=>{if(P)try{P.disconnect();}catch{}if(O>0||i.urlChangeCount!==g||i.networkCount!==u||i.filePickerCount!==p)return;let B=o.get(d)??0;if(B>=r)return;o.set(d,B+1);let se={session_id:D(),event_type:"dead_click",page_url:typeof window>"u"?"":window.location.href,selector:h,element_text:m,event_data:{tag_name:y,...T?{element_id:T}:{},...S?{component_name:S}:{},...x.length>0?{parent_components:x}:{},clickable_reason:l},created_at:f,stable_key:b};t(se);},n);}catch{}}return document.addEventListener("click",s,{capture:true,passive:true}),()=>{document.removeEventListener("click",s,{capture:true}),i.uninstall();}}function zo(e){let t=e.closest('button, a, form, [role="button"]');return t||e.parentElement}var Nn=[{name:"email",regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,replacement:"[email]"},{name:"credit_card",regex:/\b(?:\d[ -]?){13,19}\b/g,replacement:"[card]"},{name:"ssn",regex:/\b\d{3}-\d{2}-\d{4}\b/g,replacement:"[ssn]"},{name:"phone",regex:/(?:\+?\d{1,3}[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}/g,replacement:"[phone]"}],Vo=[...Nn,{name:"ipv4",regex:/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,replacement:"[ip]"},{name:"iban",regex:/\b[A-Z]{2}\d{2}[A-Z0-9]{11,30}\b/g,replacement:"[iban]"}],Wo=10;function $o(e){return e==="strict"?Vo:e==="default"?Nn:[]}function qo(e,t){let n=e;for(let r of t)n=n.replace(r.regex,r.replacement);return n}function Rt(e,t,n){if(n>Wo||e==null)return e;if(typeof e=="string")return qo(e,t);if(typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(r=>Rt(r,t,n+1));if(typeof e=="object"){let r={};for(let o of Object.keys(e))r[o]=Rt(e[o],t,n+1);return r}return e}function de(e,t){if(t==="off")return e;let n=$o(t);return n.length===0?e:Rt(e,n,0)}var jo=[/^Script error\.?$/,/^ResizeObserver loop/,/^Non-Error promise rejection captured/];function Ko(e){let t=e.trim();if(!t)return "";let n="",r=t,o=t.indexOf("@"),i=/^\s*at\s+(?:(.+?)\s+\()?(.+?)\)?$/.exec(t);o>-1&&!t.startsWith("at ")?(n=t.slice(0,o),r=t.slice(o+1)):i&&(n=i[1]??"",r=i[2]??""),r=r.replace(/^https?:\/\/[^/]+/,""),r=r.replace(/\?[^:]*(?=:\d|$)/,"");let s=r.split(":");return s.length>=3&&(r=s.slice(0,s.length-1).join(":")),n?`${n}@${r}`:r}function Xo(e,t,n){let r=t.slice(0,120),o=[];if(n){let s=n.split(`
2
+ `);for(let c of s){let a=Ko(c);if(a&&(o.push(a),o.length>=3))break}}let i=`${e}:${r}:${o.join("|")}`;return Se(i).toString(16).padStart(8,"0").slice(0,8)}function Yo(e,t){for(let n of t)if(n.test(e))return true;return false}function Dn(e,t){if(!e.jsError.enabled)return ()=>{};if(typeof window>"u")return ()=>{};let{sampling:n,ignorePatterns:r,rateLimitPerFingerprint:o,rateLimitWindowMs:i}=e.jsError,s=[];for(let g of r)try{s.push(new RegExp(g));}catch{}let c=[...jo,...s],a=e.piiScrub,l=new Map;function h(g,u,p,f,m,y,T){try{if(Yo(u,c))return;let S=Xo(g,u,p),x=Date.now(),L=l.get(S);if(L&&x-L.windowStart<i){if(L.count>=o)return;L.count+=1;}else l.set(S,{count:1,windowStart:x});if(n<1&&Math.random()>=n)return;let O=a==="off"?u:de(u,a),P=p==null?null:a==="off"?p:de(p,a),B={session_id:D(),event_type:"error",page_url:window.location.href,selector:null,element_text:null,event_data:{name:g,message:O,filename:f,lineno:m,colno:y,stack:P,fingerprint:S,source:T,error_kind:"js_error"},created_at:new Date().toISOString(),stable_key:null};t(B);}catch{}}function b(g){let u=g.error,p=u?.name??"Error",f=g.message??u?.message??"Error",m=u?.stack??null;h(p,f,m,g.filename||null,typeof g.lineno=="number"?g.lineno:null,typeof g.colno=="number"?g.colno:null,"window.onerror");}function d(g){let u=g.reason,p="UnhandledRejection",f,m=null;if(u instanceof Error)p=u.name||"UnhandledRejection",f=u.message||String(u),m=u.stack??null;else if(u&&typeof u=="object"){let y=u;typeof y.name=="string"&&(p=y.name),f=typeof y.message=="string"?y.message:Jo(u),m=typeof y.stack=="string"?y.stack:null;}else f=String(u);h(p,f,m,null,null,null,"unhandledrejection");}return window.addEventListener("error",b,true),window.addEventListener("unhandledrejection",d),()=>{window.removeEventListener("error",b,true),window.removeEventListener("unhandledrejection",d),l.clear();}}function Jo(e){try{return JSON.stringify(e)}catch{return String(e)}}var Zo="https://blocfeed.com/api/replay-events";function On(e){if(!e.config.enabled)return ()=>{};if(typeof window>"u")return ()=>{};if(typeof globalThis.matchMedia>"u")return ()=>{};let t=D();if(Se(t)%100/100>=e.config.sampling)return ()=>{};let r=Date.now(),o=e.config.endpoint??Zo,i=[],s=0,c=false,a=false,l=null,h=`bf_replay_chunkseq_${t}`,b=`bf_replay_pauses_${t}`,d=0,g=0;try{let v=sessionStorage.getItem(h);v&&(d=parseInt(v,10)||0);let _=sessionStorage.getItem(b);_&&(g=parseInt(_,10)||0);}catch{}let u=(v=false)=>{if(i.length===0)return;let _=v?ei(i):i;i=[],s=0;let N=d++;try{sessionStorage.setItem(h,String(d));}catch{}ti({blocfeedId:e.blocfeedId,sessionId:t,sessionStartedAtMs:r,chunkSeq:N,events:_,endpoint:o,useBeacon:v,pauseCount:g});},p=setInterval(()=>{c||u();},e.config.flushIntervalMs),f=setTimeout(()=>{u(),fe();},e.config.maxDurationMs),m=null,y=()=>{m&&clearTimeout(m),m=setTimeout(()=>{B();},e.config.inactivityTimeoutMs);},T=()=>{u(true);};window.addEventListener("pagehide",T);let S=e.config.masking,x={emit(v){c||(i.push(v),s+=Qo(v),y(),s>=e.config.flushSizeBytes&&u());},recordCanvas:false,sampling:{mousemove:50}};S.maskAllInputs!==void 0&&(x.maskAllInputs=S.maskAllInputs),S.maskTextSelector!==void 0&&(x.maskTextSelector=S.maskTextSelector),S.maskTextClass!==void 0&&(x.maskTextClass=S.maskTextClass),S.blockSelector!==void 0&&(x.blockSelector=S.blockSelector);let L=null,O=()=>{L&&(document.removeEventListener("pointerdown",L,true),document.removeEventListener("keydown",L,true),L=null);};function P(){l=record(x)??null;}function B(){if(c||a)return;a=true,g++;try{sessionStorage.setItem(b,String(g));}catch{}if(u(),l){try{l();}catch{}l=null;}m&&(clearTimeout(m),m=null);let v=()=>{O(),se();};L=v,document.addEventListener("pointerdown",v,{capture:true,once:true}),document.addEventListener("keydown",v,{capture:true,once:true});}function se(){c||!a||(a=false,P(),y());}y(),P();function fe(){if(!c&&(c=true,clearInterval(p),clearTimeout(f),m&&clearTimeout(m),O(),window.removeEventListener("pagehide",T),l)){try{l();}catch{}l=null;}}return fe}function Qo(e){try{return JSON.stringify(e).length}catch{return 1024}}function ei(e){let n=JSON.stringify(e);if(n.length<=6e4)return e;let r=[...e];for(;r.length>1;)if(r.shift(),n=JSON.stringify(r),n.length<=6e4)return r;return r}async function ti(e){let t=JSON.stringify({blocfeed_id:e.blocfeedId,session_id:e.sessionId,session_started_at_ms:e.sessionStartedAtMs,chunk_seq:e.chunkSeq,pause_count:e.pauseCount,events:e.events,page_url:typeof window<"u"?window.location.href:"",user_agent:typeof navigator<"u"?navigator.userAgent:""});if(e.useBeacon&&typeof navigator<"u"&&typeof navigator.sendBeacon=="function")try{let r=new Blob([t],{type:"application/json"});navigator.sendBeacon(e.endpoint,r);return}catch{}let n=!!e.useBeacon;try{await fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:t,...n?{keepalive:!0}:{}});}catch{}}var ni={enabled:true,endpoint:null,maxDurationMs:144e5,flushIntervalMs:3e4,flushSizeBytes:1048576,inactivityTimeoutMs:18e5,sampling:1,masking:{maskAllInputs:true,maskTextSelector:"[data-blocfeed-mask]",maskTextClass:"blocfeed-mask",blockSelector:"[data-blocfeed-block]"}};function Hn(e){let t=ni;return {enabled:e?.enabled??t.enabled,endpoint:e?.endpoint??t.endpoint,maxDurationMs:e?.maxDurationMs??t.maxDurationMs,flushIntervalMs:e?.flushIntervalMs??t.flushIntervalMs,flushSizeBytes:e?.flushSizeBytes??t.flushSizeBytes,inactivityTimeoutMs:e?.inactivityTimeoutMs??t.inactivityTimeoutMs,sampling:e?.sampling??t.sampling,masking:{...t.masking,...e?.masking??{}}}}var ri="https://blocfeed.com/api/events/track",oi=5e3,ii=50,ai=1024,Ze="blocfeed-events-queue",Un=500,zn=100,si=/^[a-z][a-z0-9_]{0,127}$/,Vn=50,Wn=1024,$n,Pt="default";function qn(e){$n=e;}function jn(e){Pt=e;}function ci(e){if(typeof e!="string"||!si.test(e))throw new Error(`[BlocFeed] track(): event_name "${e}" must match /^[a-z][a-z0-9_]{0,127}$/ (lowercase, start with a letter, only [a-z0-9_], \u2264128 chars).`)}function li(e){if(e===void 0)return {};if(e===null||typeof e!="object"||Array.isArray(e))throw new Error("[BlocFeed] track(): properties must be a plain object.");let t=Object.keys(e);if(t.length>Vn)throw new Error(`[BlocFeed] track(): properties has ${t.length} keys, max ${Vn}.`);for(let r of t){let o=e[r];if(o!==null&&typeof o!="string"&&typeof o!="number"&&typeof o!="boolean")throw new Error(`[BlocFeed] track(): property "${r}" has unsupported type "${typeof o}". Allowed: string | number | boolean | null.`)}let n;try{n=JSON.stringify(e);}catch(r){throw new Error(`[BlocFeed] track(): properties is not JSON-serializable (${r.message}).`)}if(n.length>Wn)throw new Error(`[BlocFeed] track(): properties serialized to ${n.length} bytes, max ${Wn}. Server allows 8192 bytes \u2014 the client cap is defensive; trim down or split the event.`);return e}function Ft(){if(typeof localStorage>"u")return [];try{let e=localStorage.getItem(Ze);if(!e)return [];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{try{localStorage.removeItem(Ze);}catch{}return []}}function Bt(e){if(!(typeof localStorage>"u"))try{if(e.length===0)localStorage.removeItem(Ze);else {let t=e.length>Un?e.slice(e.length-Un):e;localStorage.setItem(Ze,JSON.stringify(t));}}catch{}}var Y=null;function di(){if(Y)return Y;if(typeof window>"u")return null;let e=ui();return e?(Y={blocfeedId:e,endpoint:ri,events:[],bytes:0,flushTimer:null,pageHideHandler:null,visibilityHandler:null},Y.flushTimer=setInterval(()=>{Ge(false);},oi),Y.pageHideHandler=()=>{Ge(true);},Y.visibilityHandler=()=>{document.visibilityState==="hidden"&&Ge(true);},window.addEventListener("pagehide",Y.pageHideHandler),document.addEventListener("visibilitychange",Y.visibilityHandler),Y):null}function ui(){try{let t=window.__blocfeed_id__;return typeof t=="string"&&t.length>0?t:null}catch{return null}}function _e(e){try{window.__blocfeed_id__=e;}catch{}Y&&(Y.blocfeedId=e);}function Me(e,t,n){ci(e);let r=li(t),o=Pt==="off"?r:de(r,Pt),i=n?.occurredAt?bi(n.occurredAt):new Date().toISOString(),s={event_name:e,properties:o,occurred_at:i},c=n?.sessionId??pi();c&&(s.session_id=c);let a=n?.userId??$n;a&&(s.user_id=a);let l=n?.pageUrl??mi();l&&(s.page_url=l);let h=gi();h&&(s.user_agent=h);let b=di();if(!b){let d=Ft();d.push(s),Bt(d);return}b.events.push(s),b.bytes+=fi(s),(b.events.length>=ii||b.bytes>=ai)&&Ge(false);}async function Ge(e){let t=Y;if(!t)return;let r=Ft().concat(t.events);if(t.events=[],t.bytes=0,Bt([]),r.length!==0)for(let o=0;o<r.length;o+=zn){let i=r.slice(o,o+zn),s=JSON.stringify({blocfeed_id:t.blocfeedId,events:i});if(e&&hi())try{let c=new Blob([s],{type:"application/json"});navigator.sendBeacon(t.endpoint,c)||Je(i);continue}catch{Je(i);continue}try{(await fetch(t.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:s})).ok||Je(i);}catch{Je(i);}}}function Je(e){let t=Ft();Bt(t.concat(e));}function fi(e){try{return JSON.stringify(e).length}catch{return 256}}function pi(){try{return D()}catch{return}}function mi(){try{return typeof window<"u"?window.location.href:void 0}catch{return}}function gi(){try{return typeof navigator<"u"?navigator.userAgent:void 0}catch{return}}function bi(e){return e instanceof Date?e.toISOString():new Date(e).toISOString()}function hi(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}var yi="https://blocfeed.com/api/heartbeat",vi=300*1e3;function Kn(e){if(typeof window>"u")return ()=>{};if(typeof globalThis.matchMedia>"u")return ()=>{};let t=e.endpoint??yi,n=e.intervalMs??vi,r=e.features??["replay","behavioral","customEvents"],o=c=>{try{let a=JSON.stringify({blocfeed_id:e.blocfeedId,session_id:wi(),version:e.version,page_url:typeof window<"u"?window.location.href:"",user_agent:typeof navigator<"u"?navigator.userAgent:"",sdk_features:r}),l={method:"POST",headers:{"Content-Type":"application/json"},body:a};c&&(l.keepalive=!0),fetch(t,l).catch(()=>{});}catch{}};try{o(!1);}catch{}let i=null;try{i=setInterval(()=>{try{o(!1);}catch{}},n);}catch{i=null;}let s=()=>{try{o(!0);}catch{}};try{window.addEventListener("pagehide",s);}catch{}return function(){try{i&&clearInterval(i);}catch{}i=null;try{window.removeEventListener("pagehide",s);}catch{}}}function wi(){try{return D()}catch{return ""}}var xi=5e3,Ae=class{constructor(t){this.submitter=null;this.detectorUninstallers=[];this.flushTimer=null;this.pageHideHandler=null;this.installed=false;this.opts=t,this.resolved=_n(t.config);}install(){if(this.installed||!this.resolved.enabled)return;let t=()=>{try{let a=D();return Se(a)%100/100<this.resolved.sampling}catch{return false}};if(!(this.opts.passiveSampler??t)())return;_e(this.opts.blocfeedId),jn(this.resolved.piiScrub);let r=this.opts.endpoint??"https://blocfeed.com/api/behavioral-events";this.submitter=this.opts.submitter??Tn({endpoint:r,blocfeedId:this.opts.blocfeedId});let o=this.resolved.piiScrub,i=a=>{let l=o==="off"?a:{...a,element_text:a.element_text==null?a.element_text:de(a.element_text,o),event_data:a.event_data==null?a.event_data:de(a.event_data,o)};this.submitter?.enqueue(l);};this.detectorUninstallers.push(Pn(this.resolved,i)),this.detectorUninstallers.push(Mn(this.resolved,i)),this.detectorUninstallers.push(An(this.resolved,i)),this.detectorUninstallers.push(In(this.resolved,i)),this.detectorUninstallers.push(Ln(this.resolved,i)),this.detectorUninstallers.push(Dn(this.resolved,i));let s=Hn(this.opts.config?.sessionReplay);this.detectorUninstallers.push(On({blocfeedId:this.opts.blocfeedId,config:s}));let c=["behavioral","customEvents"];if(s.enabled&&c.unshift("replay"),this.opts.extraSdkFeatures)for(let a of this.opts.extraSdkFeatures)c.push(a);this.detectorUninstallers.push(Kn({blocfeedId:this.opts.blocfeedId,version:Xn,features:c})),this.flushTimer=setInterval(()=>{this.submitter?.flush();},xi),this.pageHideHandler=()=>{this.submitter?.flushBeacon();},typeof window<"u"&&window.addEventListener("pagehide",this.pageHideHandler),this.installed=true;}uninstall(){if(this.installed){for(let t of [...this.detectorUninstallers].reverse())try{t();}catch{}this.detectorUninstallers=[],this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.pageHideHandler&&typeof window<"u"&&(window.removeEventListener("pagehide",this.pageHideHandler),this.pageHideHandler=null);try{this.submitter?.flush();}catch{}this.submitter=null,this.installed=false;}}};var Ei=["[data-blocfeed-ui]","[data-blocfeed-ignore]"];function ki(e){let t=[...Ei,...e?.ignoreSelectors??[]],n=Array.from(new Set(t));return {...e,ignoreSelectors:n}}function Yn(){return {phase:"idle"}}function Si(e){if(e.ok)return false;let t=e.api;return t?t.status&&t.status>=400&&t.status<500||t.error?.kind==="aborted"||t.error?.kind==="configuration"?false:!t.ok:true}function Jn(e){let t=e,n=new Ae({blocfeedId:t.blocfeed_id??"",...t.behavioral!==void 0?{config:t.behavioral}:{}});n.install();let r=Yn(),o=new Set,i=new Set,s=null,c=null,a=null,l=null,h=0,b=null,d=null,g=null,u=null,p=false,f=()=>{for(let v of o)v(r);},m=v=>{for(let _ of i)_(v);},y=v=>{r=v,f();},T=()=>{h+=1,l?.abort(),l=null;},S=()=>{s?.stop(),s=null,m(null),a!==null&&C()&&(document.documentElement.style.cursor=a,a=null);},x=()=>{if(g){try{URL.revokeObjectURL(g.blobUrl);}catch{}g=null;}},L=()=>{d&&(d.abort(),d=null),x();},O=null,P=()=>{u&&(u.abort(),u=null),O&&(O.abort(),O=null);},B=()=>{T(),S(),L(),P(),c=null,y(Yn());},se=()=>{if(!C())return;S(),c=null;let v=ki(t.picker);a=document.documentElement.style.cursor,document.documentElement.style.cursor="crosshair",y({phase:"picking"}),s=cn(v,{onHover:m,onSelect:({element:_,descriptor:N})=>{c=_,S(),y({phase:"review",selection:N});},onCancel:()=>{B();}});},fe=()=>{let v=an();if(v.length!==0)for(let _ of v)Ct({payload:_,...t.transport?{transport:t.transport}:{}}).catch(()=>{yt(_);});};if(C()){setTimeout(fe,1e3);let v=()=>fe();window.addEventListener("online",v),b=()=>window.removeEventListener("online",v);}return {getState:()=>r,getConfig:()=>t,subscribe(v){return o.add(v),()=>o.delete(v)},subscribeHover(v){return i.add(v),()=>i.delete(v)},start(){r.phase==="capturing"||r.phase==="submitting"||r.phase==="recording"||r.phase!=="picking"&&se();},stop(){B();},clearSelection(){r.phase==="capturing"||r.phase==="submitting"||r.phase==="recording"||se();},setConfig(v){t=v;},async submit(v,_){if(!C()){let M=k("configuration",new Error("BlocFeed submit can only run in the browser"));return y({phase:"error",lastError:M}),{ok:false}}let N=t.blocfeed_id?.trim?.()??"";if(!N){let A={phase:"error",lastError:k("configuration",new Error("Missing blocfeed_id. Create a project in BlocFeed and pass its blocfeed_id."))};return r.selection&&(A.selection=r.selection),y(A),{ok:false}}if(p)return {ok:false};if(r.phase==="capturing"||r.phase==="submitting"||r.phase==="recording")return {ok:false};p=true;let H=h+1;h=H,l?.abort(),l=new AbortController;let I=l.signal,R=r.selection,J=_?.capture?{...t.capture,..._.capture}:t.capture,te=!!(J?.element||J?.fullPage),ce={phase:te?"capturing":"submitting"};R&&(ce.selection=R),y(ce);try{let M=te?await rn({selectionElement:c,capture:J,signal:I}):void 0;if(I.aborted||h!==H)return {ok:!1};let A={phase:"submitting"};R&&(A.selection=R),M&&(A.capture=M),y(A);let z={};R&&(z.selection=R),M&&(z.capture=M);let ne=await on({config:t.metadata,context:z,...t.user?{user:t.user}:{}}),Z={version:1,createdAt:new Date().toISOString(),blocfeed_id:N,message:v,metadata:ne};_?.category&&(Z.category=_.category),t.user&&(Z.user=t.user),R&&(Z.selection=R),M&&(Z.screenshots=M),g&&(Z.video=g);let{result:X}=await Ct({payload:Z,signal:I,...t.transport?{transport:t.transport}:{}});if(I.aborted||h!==H)return X;if(X.ok){x(),c=null;let re={phase:"success",lastSubmit:X};return R&&(re.selection=R),M&&(re.capture=M),y(re),X}Si(X)&&yt(Z);let dt=X.api?.error??k("unknown",new Error("Submission failed")),we={phase:"error",lastSubmit:X,lastError:dt};return R&&(we.selection=R),M&&(we.capture=M),y(we),X}catch(M){if(I.aborted||h!==H)return {ok:false};let z={phase:"error",lastError:I.aborted?k("aborted",M):k("unknown",M)};return R&&(z.selection=R),y(z),{ok:false}}finally{p=false,h===H&&(l=null);}},async startRecording(){if(r.phase!=="review"||!t.recording?.enabled||u||d)return;let v=r.selection,_={phase:"recording",recordingElapsedMs:0};v&&(_.selection=v),y(_);try{let N={config:t.recording};l&&(N.signal=l.signal);let H=await Et(N);d=H,H.onTick(J=>{if(r.phase==="recording"){let te={phase:"recording",recordingElapsedMs:J};v&&(te.selection=v),y(te);}});let I=await H.result;d=null,g=I;let R={phase:"review",video:I};v&&(R.selection=v),y(R);}catch(N){d=null;let I={phase:"review",lastError:N?.kind?N:k("recording_failed",N)};v&&(I.selection=v),y(I);}},stopRecording(){r.phase!=="recording"||!d||d.stop();},removeVideo(){x();let v=r.selection,_={phase:"review"};v&&(_.selection=v),y(_);},async startVoice(){if(r.phase!=="review"){console.warn("[BlocFeed] startVoice: ignored \u2014 phase is",r.phase,'(expected "review")');return}let v=t.voice;if(!v?.enabled){console.warn("[BlocFeed] startVoice: ignored \u2014 voice is not enabled in config");return}if(d){console.warn("[BlocFeed] startVoice: ignored \u2014 a screen recording is already in progress");return}P();let _=r.selection,N={phase:"review",voiceRecording:true,voiceElapsedMs:0};_&&(N.selection=_),g&&(N.video=g),y(N);try{let H={config:v};l&&(H.signal=l.signal);let I=await St(H);u=I,I.onTick(z=>{let ne={phase:"review",voiceRecording:!0,voiceElapsedMs:z};_&&(ne.selection=_),g&&(ne.video=g),y(ne);});let R=await I.result;u=null;let J={phase:"review",voiceRecording:!1,voiceTranscribing:!0};_&&(J.selection=_),g&&(J.video=g),y(J),O=new AbortController;let te={blob:R.blob,mime:R.mime,blocfeedId:t.blocfeed_id,signal:O.signal},{text:ze,warning:ce}=await Sn(te);O=null;let M={phase:"review",voiceRecording:!1,voiceTranscribing:!1};_&&(M.selection=_),g&&(M.video=g),y(M);let A={text:ze};return ce&&(A.warning=ce),A}catch(H){P();let I=H?.kind?H:k("recording_failed",H);console.warn("[BlocFeed] Voice error:",I.message);let R={phase:"review",voiceRecording:false,voiceTranscribing:false,lastError:I};_&&(R.selection=_),g&&(R.video=g),y(R);return}},stopVoice(){u&&u.stop();},__unsafeGetSelectedElement(){return c},destroy(){n.uninstall(),B(),o.clear(),i.clear(),b?.(),b=null;}}}var Qe=createContext(null);function Mt(e){let t=useMemo(()=>Jn({...e.config??{},blocfeed_id:e.blocfeed_id}),[]);useEffect(()=>{_e(e.blocfeed_id);},[e.blocfeed_id]);let[n,r]=useState(()=>t.getState());return useEffect(()=>t.subscribe(r),[t]),useEffect(()=>t.setConfig({...e.config??{},blocfeed_id:e.blocfeed_id}),[t,e.config,e.blocfeed_id]),useEffect(()=>()=>t.destroy(),[t]),jsx(Qe.Provider,{value:{controller:t,state:n},children:e.children})}var Gn="blocfeed-styles-v1",Pi=`
3
+ :where([data-blocfeed-ui-root]),
4
+ :where([data-blocfeed-ui-root]) * {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ :where([data-blocfeed-ui-root]) {
9
+ --bf-z: 2147483647;
10
+ --bf-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
11
+ --bf-panel-bg: rgba(17, 24, 39, 0.98);
12
+ --bf-panel-fg: rgb(243, 244, 246);
13
+ --bf-muted: rgba(243, 244, 246, 0.72);
14
+ --bf-border: rgba(255, 255, 255, 0.14);
15
+ --bf-accent: rgb(99, 102, 241);
16
+ --bf-danger: rgb(239, 68, 68);
17
+ --bf-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
18
+
19
+ /* Ensure widget always floats above customer modals/sidepanels/overlays */
20
+ position: fixed;
21
+ top: 0;
22
+ left: 0;
23
+ width: 0;
24
+ height: 0;
25
+ overflow: visible;
26
+ z-index: var(--bf-z);
27
+ isolation: isolate;
28
+ pointer-events: none;
29
+
30
+ font-family: var(--bf-font);
31
+ color: var(--bf-panel-fg);
32
+ }
33
+
34
+ /* ------------------------------------------------------------------ */
35
+ /* Light theme */
36
+ /* ------------------------------------------------------------------ */
37
+
38
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) {
39
+ --bf-panel-bg: rgba(255, 255, 255, 0.98);
40
+ --bf-panel-fg: rgb(17, 24, 39);
41
+ --bf-muted: rgba(17, 24, 39, 0.6);
42
+ --bf-border: rgba(0, 0, 0, 0.12);
43
+ --bf-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
44
+ }
45
+
46
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-textarea {
47
+ border-color: rgba(0, 0, 0, 0.14);
48
+ background: rgba(0, 0, 0, 0.04);
49
+ color: var(--bf-panel-fg);
50
+ }
51
+
52
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-panelHeader {
53
+ border-bottom-color: rgba(0, 0, 0, 0.08);
54
+ }
55
+
56
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-title {
57
+ color: rgba(17, 24, 39, 0.85);
58
+ }
59
+
60
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-error {
61
+ color: rgb(185, 28, 28);
62
+ }
63
+
64
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-watermark a {
65
+ color: rgba(17, 24, 39, 0.35);
66
+ }
67
+
68
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-watermark {
69
+ border-top-color: rgba(0, 0, 0, 0.06);
70
+ }
71
+
72
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-highlight {
73
+ box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.42);
74
+ }
75
+
76
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-blocker {
77
+ background: rgba(255, 255, 255, 0.35);
78
+ }
79
+
80
+ /* ------------------------------------------------------------------ */
81
+ /* Trigger button \u2014 default bottom-right */
82
+ /* ------------------------------------------------------------------ */
83
+
84
+ :where([data-blocfeed-ui-root]) .bf-trigger {
85
+ position: fixed;
86
+ right: 18px;
87
+ bottom: 18px;
88
+ z-index: var(--bf-z);
89
+ pointer-events: auto;
90
+
91
+ display: inline-flex;
92
+ align-items: center;
93
+ gap: 10px;
94
+ padding: 10px 12px;
95
+ border-radius: 999px;
96
+ border: 1px solid var(--bf-border);
97
+ background: var(--bf-panel-bg);
98
+ color: var(--bf-panel-fg);
99
+ box-shadow: var(--bf-shadow);
100
+ cursor: pointer;
101
+ user-select: none;
102
+ -webkit-tap-highlight-color: transparent;
103
+ }
104
+
105
+ :where([data-blocfeed-ui-root]) .bf-trigger:hover {
106
+ border-color: var(--bf-accent);
107
+ }
108
+
109
+ :where([data-blocfeed-ui-root]) .bf-trigger:focus-visible {
110
+ outline: 2px solid var(--bf-accent);
111
+ outline-offset: 2px;
112
+ }
113
+
114
+ /* Position variants (item 9) */
115
+ :where([data-blocfeed-ui-root]) .bf-trigger-bl {
116
+ left: 18px; bottom: 18px; right: auto; top: auto;
117
+ }
118
+ :where([data-blocfeed-ui-root]) .bf-trigger-tr {
119
+ right: 18px; top: 18px; bottom: auto; left: auto;
120
+ }
121
+ :where([data-blocfeed-ui-root]) .bf-trigger-tl {
122
+ left: 18px; top: 18px; right: auto; bottom: auto;
123
+ }
124
+
125
+ :where([data-blocfeed-ui-root]) .bf-dot {
126
+ width: 10px;
127
+ height: 10px;
128
+ border-radius: 999px;
129
+ background: var(--bf-accent);
130
+ box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
131
+ }
132
+
133
+ /* ------------------------------------------------------------------ */
134
+ /* Overlay, blocker, highlight */
135
+ /* ------------------------------------------------------------------ */
136
+
137
+ :where([data-blocfeed-ui-root]) .bf-overlay {
138
+ position: fixed;
139
+ inset: 0;
140
+ z-index: var(--bf-z);
141
+ pointer-events: none;
142
+ }
143
+
144
+ :where([data-blocfeed-ui-root]) .bf-blocker {
145
+ position: fixed;
146
+ inset: 0;
147
+ background: rgba(0, 0, 0, 0.35);
148
+ pointer-events: auto;
149
+ }
150
+
151
+ :where([data-blocfeed-ui-root]) .bf-highlight {
152
+ position: fixed;
153
+ border: 2px solid var(--bf-accent);
154
+ border-radius: 10px;
155
+ box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
156
+ pointer-events: none;
157
+ }
158
+
159
+ /* ------------------------------------------------------------------ */
160
+ /* Hint bar */
161
+ /* ------------------------------------------------------------------ */
162
+
163
+ :where([data-blocfeed-ui-root]) .bf-hint {
164
+ position: fixed;
165
+ top: 16px;
166
+ left: 50%;
167
+ transform: translateX(-50%);
168
+ max-width: min(640px, calc(100vw - 24px));
169
+ padding: 10px 12px;
170
+ border-radius: 12px;
171
+ border: 1px solid var(--bf-border);
172
+ background: var(--bf-panel-bg);
173
+ box-shadow: var(--bf-shadow);
174
+ pointer-events: auto;
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: space-between;
178
+ gap: 12px;
179
+ }
180
+
181
+ :where([data-blocfeed-ui-root]) .bf-hint p {
182
+ margin: 0;
183
+ font-size: 13px;
184
+ color: var(--bf-muted);
185
+ }
186
+
187
+ /* ------------------------------------------------------------------ */
188
+ /* Buttons */
189
+ /* ------------------------------------------------------------------ */
190
+
191
+ :where([data-blocfeed-ui-root]) .bf-btn {
192
+ border: 1px solid var(--bf-border);
193
+ background: transparent;
194
+ color: var(--bf-panel-fg);
195
+ padding: 8px 10px;
196
+ border-radius: 10px;
197
+ cursor: pointer;
198
+ user-select: none;
199
+ }
200
+
201
+ :where([data-blocfeed-ui-root]) .bf-btn:focus-visible {
202
+ outline: 2px solid var(--bf-accent);
203
+ outline-offset: 2px;
204
+ }
205
+
206
+ :where([data-blocfeed-ui-root]) .bf-btn[disabled] {
207
+ opacity: 0.6;
208
+ cursor: not-allowed;
209
+ }
210
+
211
+ :where([data-blocfeed-ui-root]) .bf-btnPrimary {
212
+ background: var(--bf-accent);
213
+ border-color: rgba(99, 102, 241, 0.6);
214
+ color: white;
215
+ }
216
+
217
+ /* ------------------------------------------------------------------ */
218
+ /* Panel */
219
+ /* ------------------------------------------------------------------ */
220
+
221
+ :where([data-blocfeed-ui-root]) .bf-panel {
222
+ position: fixed;
223
+ width: 360px;
224
+ max-width: calc(100vw - 24px);
225
+ border-radius: 14px;
226
+ border: 1px solid var(--bf-border);
227
+ background: var(--bf-panel-bg);
228
+ box-shadow: var(--bf-shadow);
229
+ pointer-events: auto;
230
+ overflow: hidden;
231
+ }
232
+
233
+ :where([data-blocfeed-ui-root]) .bf-panelHeader {
234
+ display: flex;
235
+ align-items: center;
236
+ justify-content: space-between;
237
+ gap: 8px;
238
+ padding: 12px 12px 10px;
239
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
240
+ }
241
+
242
+ :where([data-blocfeed-ui-root]) .bf-title {
243
+ font-size: 13px;
244
+ letter-spacing: 0.3px;
245
+ text-transform: uppercase;
246
+ color: rgba(243, 244, 246, 0.85);
247
+ }
248
+
249
+ :where([data-blocfeed-ui-root]) .bf-panelBody {
250
+ padding: 12px;
251
+ display: grid;
252
+ gap: 10px;
253
+ }
254
+
255
+ /* ------------------------------------------------------------------ */
256
+ /* Form elements */
257
+ /* ------------------------------------------------------------------ */
258
+
259
+ :where([data-blocfeed-ui-root]) .bf-textarea {
260
+ width: 100%;
261
+ min-height: 96px;
262
+ resize: vertical;
263
+ padding: 10px 10px;
264
+ border-radius: 12px;
265
+ border: 1px solid rgba(255, 255, 255, 0.14);
266
+ background: rgba(0, 0, 0, 0.18);
267
+ color: var(--bf-panel-fg);
268
+ font-size: 14px;
269
+ line-height: 1.4;
270
+ }
271
+
272
+ :where([data-blocfeed-ui-root]) .bf-textarea:focus-visible {
273
+ outline: 2px solid rgba(99, 102, 241, 0.9);
274
+ outline-offset: 2px;
275
+ }
276
+
277
+ :where([data-blocfeed-ui-root]) .bf-row {
278
+ display: flex;
279
+ align-items: center;
280
+ justify-content: space-between;
281
+ gap: 10px;
282
+ }
283
+
284
+ :where([data-blocfeed-ui-root]) .bf-row label {
285
+ font-size: 13px;
286
+ color: var(--bf-muted);
287
+ display: inline-flex;
288
+ align-items: center;
289
+ gap: 8px;
290
+ user-select: none;
291
+ }
292
+
293
+ :where([data-blocfeed-ui-root]) .bf-actions {
294
+ display: flex;
295
+ gap: 10px;
296
+ justify-content: flex-end;
297
+ padding-top: 4px;
298
+ }
299
+
300
+ /* ------------------------------------------------------------------ */
301
+ /* Status, errors, toast */
302
+ /* ------------------------------------------------------------------ */
303
+
304
+ :where([data-blocfeed-ui-root]) .bf-status {
305
+ font-size: 12px;
306
+ color: var(--bf-muted);
307
+ display: flex;
308
+ align-items: center;
309
+ gap: 8px;
310
+ }
311
+
312
+ :where([data-blocfeed-ui-root]) .bf-error {
313
+ font-size: 12px;
314
+ color: rgb(254, 202, 202);
315
+ }
316
+
317
+ :where([data-blocfeed-ui-root]) .bf-toast {
318
+ position: fixed;
319
+ left: 50%;
320
+ bottom: 18px;
321
+ transform: translateX(-50%);
322
+ z-index: var(--bf-z);
323
+ padding: 10px 12px;
324
+ border-radius: 12px;
325
+ border: 1px solid var(--bf-border);
326
+ background: var(--bf-panel-bg);
327
+ box-shadow: var(--bf-shadow);
328
+ pointer-events: none;
329
+ font-size: 13px;
330
+ color: rgba(243, 244, 246, 0.9);
331
+ }
332
+
333
+ /* ------------------------------------------------------------------ */
334
+ /* Category pills */
335
+ /* ------------------------------------------------------------------ */
336
+
337
+ :where([data-blocfeed-ui-root]) .bf-pills {
338
+ display: flex;
339
+ flex-wrap: wrap;
340
+ gap: 6px;
341
+ }
342
+
343
+ :where([data-blocfeed-ui-root]) .bf-pill {
344
+ padding: 4px 10px;
345
+ border-radius: 999px;
346
+ border: 1px solid var(--bf-border);
347
+ background: transparent;
348
+ color: var(--bf-muted);
349
+ font-size: 12px;
350
+ font-family: var(--bf-font);
351
+ cursor: pointer;
352
+ user-select: none;
353
+ transition: border-color 0.15s, color 0.15s, background 0.15s;
354
+ }
355
+
356
+ :where([data-blocfeed-ui-root]) .bf-pill:hover {
357
+ border-color: var(--bf-accent);
358
+ color: var(--bf-panel-fg);
359
+ }
360
+
361
+ :where([data-blocfeed-ui-root]) .bf-pill-active {
362
+ border-color: var(--bf-accent);
363
+ background: var(--bf-accent);
364
+ color: white;
365
+ }
366
+
367
+ :where([data-blocfeed-ui-root]) .bf-pill[disabled] {
368
+ opacity: 0.6;
369
+ cursor: not-allowed;
370
+ }
371
+
372
+ /* ------------------------------------------------------------------ */
373
+ /* Capture spinner (item 12) */
374
+ /* ------------------------------------------------------------------ */
375
+
376
+ :where([data-blocfeed-ui-root]) .bf-spinner {
377
+ display: inline-block;
378
+ width: 10px;
379
+ height: 10px;
380
+ border-radius: 50%;
381
+ background: var(--bf-accent);
382
+ animation: bf-pulse 1s ease-in-out infinite;
383
+ }
384
+
385
+ @keyframes bf-pulse {
386
+ 0%, 100% { opacity: 0.4; transform: scale(0.8); }
387
+ 50% { opacity: 1; transform: scale(1.2); }
388
+ }
389
+
390
+ /* ------------------------------------------------------------------ */
391
+ /* Trigger variant: edge-tab */
392
+ /* ------------------------------------------------------------------ */
393
+
394
+ :where([data-blocfeed-ui-root]) .bf-trigger-edge {
395
+ position: fixed;
396
+ z-index: var(--bf-z);
397
+ pointer-events: auto;
398
+ display: flex;
399
+ align-items: center;
400
+ justify-content: center;
401
+ border: 1px solid var(--bf-border);
402
+ background: var(--bf-panel-bg);
403
+ color: var(--bf-panel-fg);
404
+ box-shadow: var(--bf-shadow);
405
+ cursor: pointer;
406
+ user-select: none;
407
+ -webkit-tap-highlight-color: transparent;
408
+ overflow: hidden;
409
+ padding: 0;
410
+ font-family: var(--bf-font);
411
+ font-size: 12px;
412
+ letter-spacing: 0.5px;
413
+ }
414
+
415
+ :where([data-blocfeed-ui-root]) .bf-trigger-edge:focus-visible {
416
+ outline: 2px solid var(--bf-accent);
417
+ outline-offset: 2px;
418
+ }
419
+
420
+ :where([data-blocfeed-ui-root]) .bf-trigger-edge-left {
421
+ left: 0;
422
+ right: auto;
423
+ border-radius: 0 6px 6px 0;
424
+ border-left: none;
425
+ }
426
+
427
+ :where([data-blocfeed-ui-root]) .bf-trigger-edge-right {
428
+ right: 0;
429
+ left: auto;
430
+ border-radius: 6px 0 0 6px;
431
+ border-right: none;
432
+ }
433
+
434
+ /* ------------------------------------------------------------------ */
435
+ /* Trigger variant: minimal */
436
+ /* ------------------------------------------------------------------ */
437
+
438
+ :where([data-blocfeed-ui-root]) .bf-trigger-minimal {
439
+ position: fixed;
440
+ right: 18px;
441
+ bottom: 18px;
442
+ z-index: var(--bf-z);
443
+ pointer-events: auto;
444
+ display: inline-flex;
445
+ align-items: center;
446
+ background: transparent;
447
+ border: none;
448
+ box-shadow: none;
449
+ padding: 8px 4px;
450
+ font-family: var(--bf-font);
451
+ font-size: 13px;
452
+ color: var(--bf-panel-fg);
453
+ cursor: pointer;
454
+ user-select: none;
455
+ -webkit-tap-highlight-color: transparent;
456
+ }
457
+
458
+ :where([data-blocfeed-ui-root]) .bf-trigger-minimal.bf-trigger-bl {
459
+ left: 18px; bottom: 18px; right: auto; top: auto;
460
+ }
461
+ :where([data-blocfeed-ui-root]) .bf-trigger-minimal.bf-trigger-tr {
462
+ right: 18px; top: 18px; bottom: auto; left: auto;
463
+ }
464
+ :where([data-blocfeed-ui-root]) .bf-trigger-minimal.bf-trigger-tl {
465
+ left: 18px; top: 18px; right: auto; bottom: auto;
466
+ }
467
+
468
+ :where([data-blocfeed-ui-root]) .bf-trigger-minimal:focus-visible {
469
+ outline: 2px solid var(--bf-accent);
470
+ outline-offset: 2px;
471
+ }
472
+
473
+ /* ------------------------------------------------------------------ */
474
+ /* Screen reader only */
475
+ /* ------------------------------------------------------------------ */
476
+
477
+ :where([data-blocfeed-ui-root]) .bf-sr-only {
478
+ position: absolute;
479
+ width: 1px;
480
+ height: 1px;
481
+ padding: 0;
482
+ margin: -1px;
483
+ overflow: hidden;
484
+ clip: rect(0, 0, 0, 0);
485
+ white-space: nowrap;
486
+ border: 0;
487
+ }
488
+
489
+ /* ------------------------------------------------------------------ */
490
+ /* Queue badge */
491
+ /* ------------------------------------------------------------------ */
492
+
493
+ :where([data-blocfeed-ui-root]) .bf-badge {
494
+ display: inline-flex;
495
+ align-items: center;
496
+ justify-content: center;
497
+ min-width: 16px;
498
+ height: 16px;
499
+ padding: 0 4px;
500
+ border-radius: 999px;
501
+ background: var(--bf-danger);
502
+ color: white;
503
+ font-size: 10px;
504
+ font-weight: 600;
505
+ line-height: 1;
506
+ flex-shrink: 0;
507
+ }
508
+
509
+ :where([data-blocfeed-ui-root]) .bf-badge-float {
510
+ position: absolute;
511
+ top: -4px;
512
+ right: -4px;
513
+ }
514
+
515
+ /* ------------------------------------------------------------------ */
516
+ /* Typewriter cursor */
517
+ /* ------------------------------------------------------------------ */
518
+
519
+ :where([data-blocfeed-ui-root]) .bf-cursor {
520
+ display: inline-block;
521
+ width: 1px;
522
+ height: 1em;
523
+ background: var(--bf-panel-fg);
524
+ margin-left: 1px;
525
+ vertical-align: text-bottom;
526
+ animation: bf-blink 1s steps(2) infinite;
527
+ }
528
+
529
+ @keyframes bf-blink {
530
+ 0% { opacity: 1; }
531
+ 50% { opacity: 0; }
532
+ }
533
+
534
+ /* ------------------------------------------------------------------ */
535
+ /* Panel / toast / hint entrance animations */
536
+ /* ------------------------------------------------------------------ */
537
+
538
+ :where([data-blocfeed-ui-root]) .bf-panel {
539
+ animation: bf-panel-in 0.2s ease-out;
540
+ }
541
+
542
+ @keyframes bf-panel-in {
543
+ from { opacity: 0; transform: translateY(8px); }
544
+ to { opacity: 1; transform: translateY(0); }
545
+ }
546
+
547
+ :where([data-blocfeed-ui-root]) .bf-toast {
548
+ animation: bf-toast-in 0.25s ease-out;
549
+ }
550
+
551
+ @keyframes bf-toast-in {
552
+ from { opacity: 0; transform: translateX(-50%) translateY(12px); }
553
+ to { opacity: 1; transform: translateX(-50%) translateY(0); }
554
+ }
555
+
556
+ :where([data-blocfeed-ui-root]) .bf-hint {
557
+ animation: bf-hint-in 0.2s ease-out;
558
+ }
559
+
560
+ @keyframes bf-hint-in {
561
+ from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
562
+ to { opacity: 1; transform: translateX(-50%) translateY(0); }
563
+ }
564
+
565
+ /* ------------------------------------------------------------------ */
566
+ /* Security warning banner */
567
+ /* ------------------------------------------------------------------ */
568
+
569
+ :where([data-blocfeed-ui-root]) .bf-security-banner {
570
+ position: fixed;
571
+ top: 8px;
572
+ right: 8px;
573
+ z-index: var(--bf-z);
574
+ max-width: 360px;
575
+ padding: 10px 14px;
576
+ border-radius: 10px;
577
+ border-left: 3px solid var(--bf-danger);
578
+ background: rgba(239, 68, 68, 0.12);
579
+ color: rgb(254, 202, 202);
580
+ font-family: var(--bf-font);
581
+ font-size: 12px;
582
+ line-height: 1.5;
583
+ pointer-events: auto;
584
+ animation: bf-panel-in 0.2s ease-out;
585
+ }
586
+
587
+ :where([data-blocfeed-ui-root][data-bf-theme="light"]) .bf-security-banner {
588
+ background: rgba(239, 68, 68, 0.08);
589
+ color: rgb(185, 28, 28);
590
+ }
591
+
592
+ :where([data-blocfeed-ui-root]) .bf-security-banner strong {
593
+ display: block;
594
+ margin-bottom: 4px;
595
+ font-size: 13px;
596
+ }
597
+
598
+ :where([data-blocfeed-ui-root]) .bf-security-banner-dismiss {
599
+ position: absolute;
600
+ top: 6px;
601
+ right: 6px;
602
+ background: none;
603
+ border: none;
604
+ color: inherit;
605
+ opacity: 0.6;
606
+ cursor: pointer;
607
+ padding: 2px 4px;
608
+ font-size: 14px;
609
+ line-height: 1;
610
+ }
611
+
612
+ :where([data-blocfeed-ui-root]) .bf-security-banner-dismiss:hover {
613
+ opacity: 1;
614
+ }
615
+
616
+ /* ------------------------------------------------------------------ */
617
+ /* Reduced motion */
618
+ /* ------------------------------------------------------------------ */
619
+
620
+ /* ------------------------------------------------------------------ */
621
+ /* Video recording */
622
+ /* ------------------------------------------------------------------ */
623
+
624
+ :where([data-blocfeed-ui-root]) .bf-record-btn {
625
+ display: inline-flex;
626
+ align-items: center;
627
+ gap: 6px;
628
+ padding: 6px 10px;
629
+ border-radius: 10px;
630
+ border: 1px solid var(--bf-border);
631
+ background: transparent;
632
+ color: var(--bf-panel-fg);
633
+ font-size: 13px;
634
+ font-family: var(--bf-font);
635
+ cursor: pointer;
636
+ user-select: none;
637
+ }
638
+
639
+ :where([data-blocfeed-ui-root]) .bf-record-btn:hover {
640
+ border-color: var(--bf-danger);
641
+ color: var(--bf-danger);
642
+ }
643
+
644
+ :where([data-blocfeed-ui-root]) .bf-record-btn:focus-visible {
645
+ outline: 2px solid var(--bf-accent);
646
+ outline-offset: 2px;
647
+ }
648
+
649
+ :where([data-blocfeed-ui-root]) .bf-record-btn[disabled] {
650
+ opacity: 0.6;
651
+ cursor: not-allowed;
652
+ }
653
+
654
+ /* ---- Voice feedback button ---- */
655
+
656
+ :where([data-blocfeed-ui-root]) .bf-voice-btn {
657
+ display: inline-flex;
658
+ align-items: center;
659
+ gap: 6px;
660
+ padding: 6px 12px;
661
+ border-radius: 6px;
662
+ border: 1px solid var(--bf-border);
663
+ background: transparent;
664
+ color: var(--bf-panel-fg);
665
+ font-size: 13px;
666
+ cursor: pointer;
667
+ transition: background 0.15s, border-color 0.15s;
668
+ }
669
+
670
+ :where([data-blocfeed-ui-root]) .bf-voice-btn:hover {
671
+ background: rgba(128,128,128,0.1);
672
+ }
673
+
674
+ :where([data-blocfeed-ui-root]) .bf-voice-btn:focus-visible {
675
+ outline: 2px solid var(--bf-accent);
676
+ outline-offset: 2px;
677
+ }
678
+
679
+ :where([data-blocfeed-ui-root]) .bf-voice-btn[disabled] {
680
+ opacity: 0.6;
681
+ cursor: not-allowed;
682
+ }
683
+
684
+ :where([data-blocfeed-ui-root]) .bf-voice-btn-active {
685
+ border-color: var(--bf-danger);
686
+ color: var(--bf-danger);
687
+ }
688
+
689
+ :where([data-blocfeed-ui-root]) .bf-mic-icon {
690
+ flex-shrink: 0;
691
+ }
692
+
693
+ :where([data-blocfeed-ui-root]) .bf-recording-indicator {
694
+ display: flex;
695
+ align-items: center;
696
+ gap: 8px;
697
+ font-size: 12px;
698
+ color: var(--bf-danger);
699
+ }
700
+
701
+ :where([data-blocfeed-ui-root]) .bf-rec-dot {
702
+ width: 8px;
703
+ height: 8px;
704
+ border-radius: 50%;
705
+ background: var(--bf-danger);
706
+ flex-shrink: 0;
707
+ }
708
+
709
+ :where([data-blocfeed-ui-root]) .bf-rec-dot-pulse {
710
+ animation: bf-rec-pulse 1s ease-in-out infinite;
711
+ }
712
+
713
+ @keyframes bf-rec-pulse {
714
+ 0%, 100% { opacity: 1; }
715
+ 50% { opacity: 0.3; }
716
+ }
717
+
718
+ :where([data-blocfeed-ui-root]) .bf-video-preview {
719
+ position: relative;
720
+ border-radius: 8px;
721
+ overflow: hidden;
722
+ border: 1px solid var(--bf-border);
723
+ }
724
+
725
+ :where([data-blocfeed-ui-root]) .bf-video-preview video {
726
+ width: 100%;
727
+ max-height: 120px;
728
+ object-fit: contain;
729
+ display: block;
730
+ background: black;
731
+ }
732
+
733
+ :where([data-blocfeed-ui-root]) .bf-video-remove {
734
+ position: absolute;
735
+ top: 4px;
736
+ right: 4px;
737
+ background: rgba(0, 0, 0, 0.7);
738
+ border: none;
739
+ color: white;
740
+ border-radius: 50%;
741
+ width: 20px;
742
+ height: 20px;
743
+ font-size: 12px;
744
+ cursor: pointer;
745
+ display: flex;
746
+ align-items: center;
747
+ justify-content: center;
748
+ line-height: 1;
749
+ }
750
+
751
+ :where([data-blocfeed-ui-root]) .bf-video-remove:hover {
752
+ background: rgba(0, 0, 0, 0.9);
753
+ }
754
+
755
+ :where([data-blocfeed-ui-root]) .bf-video-meta {
756
+ font-size: 11px;
757
+ color: var(--bf-muted);
758
+ padding: 4px 8px;
759
+ }
760
+
761
+ /* ------------------------------------------------------------------ */
762
+ /* Floating recording bar (shown during active recording) */
763
+ /* ------------------------------------------------------------------ */
764
+
765
+ :where([data-blocfeed-ui-root]) .bf-recording-bar {
766
+ position: fixed;
767
+ z-index: var(--bf-z);
768
+ display: flex;
769
+ align-items: center;
770
+ gap: 10px;
771
+ padding: 8px 14px;
772
+ border-radius: 20px;
773
+ background: var(--bf-bg);
774
+ border: 1px solid var(--bf-danger);
775
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.25);
776
+ font-size: 13px;
777
+ color: var(--bf-fg);
778
+ pointer-events: auto;
779
+ animation: bf-slideUp 0.2s ease-out;
780
+ }
781
+
782
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-right {
783
+ bottom: 24px;
784
+ right: 24px;
785
+ }
786
+
787
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-left {
788
+ bottom: 24px;
789
+ left: 24px;
790
+ }
791
+
792
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-right {
793
+ top: 24px;
794
+ right: 24px;
795
+ }
796
+
797
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-left {
798
+ top: 24px;
799
+ left: 24px;
800
+ }
801
+
802
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-timer {
803
+ color: var(--bf-danger);
804
+ font-weight: 500;
805
+ font-variant-numeric: tabular-nums;
806
+ }
807
+
808
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-stop {
809
+ padding: 4px 12px;
810
+ border-radius: 12px;
811
+ border: 1px solid var(--bf-danger);
812
+ background: transparent;
813
+ color: var(--bf-danger);
814
+ font-size: 12px;
815
+ font-weight: 600;
816
+ cursor: pointer;
817
+ transition: background 0.15s, color 0.15s;
818
+ }
819
+
820
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-stop:hover {
821
+ background: var(--bf-danger);
822
+ color: #fff;
823
+ }
824
+
825
+ /* ------------------------------------------------------------------ */
826
+ /* Watermark */
827
+ /* ------------------------------------------------------------------ */
828
+
829
+ :where([data-blocfeed-ui-root]) .bf-watermark {
830
+ padding: 6px 12px;
831
+ border-top: 1px solid rgba(255, 255, 255, 0.06);
832
+ text-align: center;
833
+ }
834
+
835
+ :where([data-blocfeed-ui-root]) .bf-watermark a {
836
+ font-size: 10px;
837
+ color: rgba(243, 244, 246, 0.35);
838
+ text-decoration: none;
839
+ }
840
+
841
+ :where([data-blocfeed-ui-root]) .bf-watermark a:hover {
842
+ color: var(--bf-accent);
843
+ }
844
+
845
+ :where([data-blocfeed-ui-root]) .bf-watermark .bf-my-feedback-link {
846
+ display: block;
847
+ margin-bottom: 2px;
848
+ font-size: 10px;
849
+ color: var(--bf-accent);
850
+ opacity: 0.7;
851
+ }
852
+
853
+ :where([data-blocfeed-ui-root]) .bf-watermark .bf-my-feedback-link:hover {
854
+ opacity: 1;
855
+ }
856
+
857
+ :where([data-blocfeed-ui-root]) .bf-toast-link {
858
+ display: block;
859
+ margin-top: 4px;
860
+ font-size: 11px;
861
+ color: var(--bf-accent);
862
+ pointer-events: auto;
863
+ text-decoration: none;
864
+ }
865
+
866
+ :where([data-blocfeed-ui-root]) .bf-toast-link:hover {
867
+ text-decoration: underline;
868
+ }
869
+
870
+ /* ------------------------------------------------------------------ */
871
+ /* Reduced motion */
872
+ /* ------------------------------------------------------------------ */
873
+
874
+ @media (prefers-reduced-motion: reduce) {
875
+ :where([data-blocfeed-ui-root]) .bf-panel,
876
+ :where([data-blocfeed-ui-root]) .bf-toast,
877
+ :where([data-blocfeed-ui-root]) .bf-hint,
878
+ :where([data-blocfeed-ui-root]) .bf-cursor,
879
+ :where([data-blocfeed-ui-root]) .bf-rec-dot-pulse,
880
+ :where([data-blocfeed-ui-root]) .bf-recording-bar {
881
+ animation: none;
882
+ }
883
+ }
884
+ `;function Zn(){if(!C()||document.getElementById(Gn))return;let e=document.createElement("style");e.id=Gn,e.textContent=Pi,document.head.appendChild(e);}var Ie=[],Le=[],Qn=20,er=15,tt=[],tr=typeof console<"u"?{log:console.log?.bind(console),warn:console.warn?.bind(console),error:console.error?.bind(console),info:console.info?.bind(console),debug:console.debug?.bind(console)}:{},nt=typeof globalThis<"u"&&typeof globalThis.fetch=="function"?globalThis.fetch:void 0,rt=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.open:void 0,ot=typeof XMLHttpRequest<"u"?XMLHttpRequest.prototype.send:void 0,It=new Set,Lt=false,Nt=false,it=false,Fi=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function Bi(e){if(e instanceof Error)return e.name&&e.name!=="Error"?`${e.name}: ${e.message}`:e.message||String(e);if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Mi(e,t){let n=t.map(Bi).join(" "),r=t.find(i=>i instanceof Error),o={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(r?.stack&&(o.stack=r.stack.slice(0,2e3)),Ie.push(o);Ie.length>Qn;)Ie.shift();}function At(e){let t=e.url.toLowerCase();for(let n of tt)if(t.includes(n))return;for(Le.push(e);Le.length>er;)Le.shift();}function nr(e={}){if(it||!C())return;it=true,Qn=e.consoleLimit??20,er=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?tt=t.map(n=>n.toLowerCase()):tt=[...Fi],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let r of n){let o=tr[r];o&&(It.add(r),console[r]=(...i)=>{Mi(r,i),o.apply(console,i);});}}if(e.network!==false&&nt){let n=nt;Lt=true,window.fetch=async function(o,i){let s=typeof o=="string"?o:o instanceof URL?o.toString():o.url,c=(i?.method??"GET").toUpperCase(),a=Date.now();try{let l=await n.call(window,o,i);return l.ok||At({url:s.slice(0,500),method:c,status:l.status,statusText:l.statusText,timestamp:a,durationMs:Date.now()-a}),l}catch(l){throw At({url:s.slice(0,500),method:c,status:0,statusText:l instanceof Error?l.message:"Network error",timestamp:a,durationMs:Date.now()-a}),l}};}if(e.network!==false&&rt&&ot){let n=rt,r=ot;Nt=true,XMLHttpRequest.prototype.open=function(o,i,...s){return this.__bf_method=o.toUpperCase(),this.__bf_url=String(i),n.apply(this,[o,i,...s])},XMLHttpRequest.prototype.send=function(...o){let i=this.__bf_method||"GET",s=this.__bf_url||"",c=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let a={url:s.slice(0,500),method:i,status:this.status,timestamp:c,durationMs:Date.now()-c};this.statusText&&(a.statusText=this.statusText),At(a);}},{once:true}),r.apply(this,o)};}}function rr(){if(it){for(let e of It){let t=tr[e];t&&(console[e]=t);}It.clear(),Lt&&nt&&(window.fetch=nt,Lt=false),Nt&&rt&&ot&&(XMLHttpRequest.prototype.open=rt,XMLHttpRequest.prototype.send=ot,Nt=false),tt=[],it=false;}}function or(){return {consoleLogs:[...Ie],networkErrors:[...Le]}}function Wc(){Ie=[],Le=[];}var Ai=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]{1,8}[A-Za-z0-9_.=-]{30,400}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:\s"']{1,100}:[^@\s"']{1,200}@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]{1,8}[A-Za-z0-9/+=]{30,200}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]{1,8}[A-Za-z0-9/+=]{30,600}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,200}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,200}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,200}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,100}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,100}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,100}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,100}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,200}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,200}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,200}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,100}\.[a-zA-Z0-9_-]{22,100}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]{1,8}[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,60}_SECRET_KEY["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_secret",pattern:/[A-Z_]{2,60}_SECRET["'=:\s]{1,8}[^\s"']{8,200}/},{name:"generic_password",pattern:/[A-Z_]{2,60}_PASSWORD["'=:\s]{1,8}[^\s"']{6,200}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,60}_PRIVATE_KEY["'=:\s]{1,8}[^\s"']{8,400}/}],be=[],Ot=0,Dt=false;function Ii(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function Li(e,t,n,r){if(be.some(s=>s.rule===e&&s.source===t))return;let i={rule:e,source:t,hint:Ii(n),timestamp:Date.now()};r&&(i.location=r),be.push(i);}function Ne(e,t,n,r){for(let{name:o,pattern:i}of n){let s=i.exec(e);s&&Li(o,t,s[0],r);}}function Ni(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);Ne(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);Ne(n,"hydration",e,"__NUXT__");}}catch{}}function Di(e){try{document.querySelectorAll("script:not([src])").forEach((n,r)=>{let o=n.textContent;o&&o.length>0&&Ne(o,"scripts",e,`inline-script[${r}]`);});}catch{}}function Oi(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let r=n.getAttribute("content"),o=n.getAttribute("name")||n.getAttribute("property")||"";r&&r.length>10&&Ne(r,"meta",e,o?`meta[${o}]`:void 0);});}catch{}}function Hi(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let r=n.attributes;for(let o=0;o<r.length;o++){let i=r[o];i.name.startsWith("data-")&&i.value.length>10&&Ne(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function ir(e={}){if(Dt||!C()||(Dt=true,e.secretScan===false))return;let t=[...Ai,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{Ot=Date.now(),n.includes("hydration")&&Ni(t),n.includes("scripts")&&Di(t),n.includes("meta")&&Oi(t),n.includes("dom")&&Hi(t);let r=e.notify??"both";be.length>0&&(r==="console"||r==="both")&&console.warn(`[BlocFeed Security] Found ${be.length} potential secret(s) exposed in client code:`,be.map(o=>`${o.rule} (${o.source}${o.location?`: ${o.location}`:""})`));},100);}function Ht(){return {findings:[...be],scannedAt:Ot}}function jc(){be=[],Ot=0,Dt=false;}var ar={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove",voiceButton:"Voice",voiceStopButton:"Stop",voiceRecordingText:"Recording\u2026",voiceTranscribingText:"Transcribing\u2026",voiceDeniedText:"Microphone access was denied",voiceErrorText:"Voice transcription failed. Please type instead.",voiceEmptyText:"No speech detected. Try again or type instead."};function sr(e){return e?{...ar,...e}:ar}function Ut(){let e=useContext(Qe);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo,track:Me}}function $(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function U({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cr({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function lr({size:e=16}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ur({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){return n?jsxs("button",{className:$(e),type:"button",onClick:t,"aria-label":r,children:[i?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),r]}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]}):null}function V(){let[e,t]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=o=>t(o.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}var ji={duration:.18,ease:"easeOut"},Ki={duration:0};function pr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=V(),l=a?Ki:ji;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:$(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:a?{}:{scale:s?1:[1,1.2,1],boxShadow:s?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:s||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:r},"label")}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]})},"dot")})}var Gi={duration:.18,ease:"easeOut"},gr={duration:0};function hr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=V(),l=a?gr:Gi;return jsx(AnimatePresence,{mode:"wait",children:n&&jsxs(motion.div,{className:$(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:l,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.div,{initial:{opacity:0,y:a?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:a?0:4},transition:l,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:r},"tooltip")}),jsxs(motion.button,{type:"button",onClick:t,"aria-label":r,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:a?{}:{y:[0,-3,0]},transition:a?gr:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:16})},"success"):jsx(cr,{size:16}),o>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${o} queued`,children:o})]})]},"bubble")})}var ea={duration:.2,ease:"easeOut"},ta={duration:0};function vr(e){return e==="bottom-left"||e==="top-left"}function na(e){return `bf-trigger-edge ${vr(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function wr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=vr(e),l=V(),h=l?ta:ea;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:na(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{opacity:0,width:0},animate:{opacity:1,width:s?140:22,height:s?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:l||s?0:a?-90:90,opacity:s?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[s&&jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),r]}),jsx(motion.span,{"aria-hidden":"true",animate:{opacity:s?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[a?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]})},"edge-tab")})}var ia={duration:.18,ease:"easeOut"},aa={duration:0};function Er({delay:e,hovered:t,reduced:n}){return n?null:jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function Sr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=V(),l=a?aa:ia;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:$(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(Er,{delay:0,hovered:s,reduced:a}),jsx(Er,{delay:.7,hovered:s,reduced:a}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:r},"label")}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]})},"pulse-ring")})}var da={duration:.18,ease:"easeOut"},ua={duration:0};function fa(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Cr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=V(),l=a?ua:da;return jsx(AnimatePresence,{mode:"wait",children:n&&jsxs(motion.button,{className:fa(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{opacity:0,y:a?0:5},animate:{opacity:s?1:.65,y:0},exit:{opacity:0,y:a?0:5},transition:l,whileTap:{scale:.95},children:[i?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:r}),o>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${o} queued`,children:o})]}),!a&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:s?1:0},transition:l})]},"minimal")})}var ga={duration:.18,ease:"easeOut"},ba={duration:0};function Pr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=V(),l=a?ba:ga;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:$(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.9},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:a?{}:s?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:s||a?l:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(lr,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.span,{initial:{opacity:0,x:a?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-8},transition:l,style:{whiteSpace:"nowrap"},children:r},"label")}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]})},"icon-pop")})}var wa={duration:.18,ease:"easeOut"},xa={duration:0};function Mr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),a=V(),l=a?xa:wa;return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:$(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:l,whileTap:{scale:.92},style:{overflow:"hidden"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:l,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:a?{}:{opacity:s?1:[.5,1,.5],boxShadow:s?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:s||a?l:{duration:2,repeat:1/0,ease:"easeInOut"}}),!s&&!a&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsx(AnimatePresence,{mode:"wait",children:s&&jsx(motion.span,{initial:{opacity:0,x:a?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:a?0:-6},transition:l,style:{whiteSpace:"nowrap"},children:r},"label")}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]})},"beacon")})}var Ta={duration:.18,ease:"easeOut"},Ca={duration:0};function Nr({position:e,onClick:t,isVisible:n,label:r,queueCount:o,showSuccess:i}){let[s,c]=useState(false),[a,l]=useState(0),h=V(),b=h?Ca:Ta,d=useRef(null);useEffect(()=>{if(d.current&&(clearInterval(d.current),d.current=null),!n||s||h){l(s||h?r.length:0);return}let u=8,p=r.length*2+u*2,f=0;return d.current=setInterval(()=>{f=(f+1)%p,f<=r.length?l(f):f<=r.length+u?l(r.length):f<=r.length*2+u?l(r.length*2+u-f):l(0);},100),()=>{d.current&&(clearInterval(d.current),d.current=null);}},[n,s,h,r]);let g=r.slice(0,a);return jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.button,{className:$(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":r,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:b,whileTap:{scale:.95},style:{minWidth:"44px"},children:i?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:b,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(U,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[g,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),o>0&&jsx("span",{className:"bf-badge","aria-label":`${o} queued`,children:o})]})},"typewriter")})}function Dr(e){switch(e){case "dot":return pr;case "bubble":return hr;case "edge-tab":return wr;case "pulse-ring":return Sr;case "minimal":return Cr;case "icon-pop":return Pr;case "beacon":return Mr;case "typewriter":return Nr;default:return ur}}function Or(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n="bottom-right"){let o=window.innerWidth,i=window.innerHeight,s;s=Or(e.x,12,Math.max(12,o-t-12));let c=e.y+e.height+12,a=Math.max(12,e.y-240);return {top:c+240<=i?c:a,left:s}}function Aa(e){let{rect:t}=e,n={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsx("div",{className:"bf-highlight",style:n,"aria-hidden":"true"})}function Ia(e){let t=useRef(null);return useEffect(()=>{if(!e||!t.current)return;let n=t.current,r=n.querySelector(".bf-textarea");r?.focus();let o=s=>{if(s.key!=="Tab")return;let c=n.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(c.length===0)return;let a=c[0],l=c[c.length-1];s.shiftKey&&document.activeElement===a?(s.preventDefault(),l.focus()):!s.shiftKey&&document.activeElement===l&&(s.preventDefault(),a.focus());},i=s=>{let c=s.target;c&&(n.contains(c)||(s.stopImmediatePropagation(),r?.focus()));};return document.addEventListener("keydown",o,{capture:true}),document.addEventListener("focusin",i,{capture:true}),()=>{document.removeEventListener("keydown",o,{capture:true}),document.removeEventListener("focusin",i,{capture:true});}},[e]),t}function La(e,t){return e?typeof e=="function"?e(t):e.some(n=>n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n):true}var Wt=new Set,Hr=false;function Na(){if(Hr||typeof window>"u")return;Hr=true;let e=history.pushState,t=history.replaceState,n=()=>{for(let r of Wt)r();};history.pushState=function(...r){e.apply(this,r),setTimeout(n,0);},history.replaceState=function(...r){t.apply(this,r),setTimeout(n,0);};}function Da(e){let[t,n]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let r=()=>n(window.location.pathname);return window.addEventListener("popstate",r),Na(),Wt.add(r),()=>{window.removeEventListener("popstate",r),Wt.delete(r);}},[]),La(e,t)}function Oa(e){let[t,n]=useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return useEffect(()=>{if(e!=="auto"){n(e==="light"?"light":"dark");return}let r=window.matchMedia("(prefers-color-scheme: dark)"),o=i=>n(i.matches?"dark":"light");return n(r.matches?"dark":"light"),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}var Ha=["bug","feature","ux","general"],Ua={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function Ue(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return `${n}:${String(r).padStart(2,"0")}`}function za(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Va(e){let{state:t,controller:n,start:r,stop:o,clearSelection:i,submit:s}=Ut(),c=e.config.ui?.position,a=sr(e.config.ui?.strings),l=e.config.ui?.branding!==false,[h,b]=useState(null),[d,g]=useState(""),[u,p]=useState(e.config.capture?.element??true),[f,m]=useState(e.config.capture?.fullPage??false),[y,T]=useState(null),[S,x]=useState(void 0),L=e.config.ui?.categories??Ha,O=e.config.recording?.enabled===true&&xt(),P=e.config.recording?.maxDurationMs??3e4,B=n.getConfig().voice,se=B?.enabled===true&&kt(),fe=B?.maxDurationMs??6e4,[v,_]=useState(false),[N,H]=useState(0);useEffect(()=>{let w=window.setTimeout(()=>{let W=Ht();H(W.findings.length);},500);return ()=>window.clearTimeout(w)},[]),useImperativeHandle(e.handleRef,()=>({open:r,close:o,submit:w=>s(w),startRecording:()=>n.startRecording(),stopRecording:()=>n.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[r,o,s,n,t.phase]);let I=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",R=Ia(I),[J,te]=useState(0);useEffect(()=>{t.phase==="idle"&&te(sn());},[t.phase]);let[ze,ce]=useState(false),M=useRef(t.phase);useEffect(()=>{if(M.current==="success"&&t.phase==="idle"){ce(true);let w=window.setTimeout(()=>ce(false),1500);return ()=>window.clearTimeout(w)}M.current=t.phase;},[t.phase]),useEffect(()=>{let w=e.config.ui?.shortcut;if(!w)return;let W=w.toLowerCase().split("+").map(ee=>ee.trim()),Q=W[W.length-1]||"",pe=new Set(W.slice(0,-1)),qt=ee=>{let Wr=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(pe.has("mod")){if(Wr?!ee.metaKey:!ee.ctrlKey)return}else if(pe.has("ctrl")&&!ee.ctrlKey||(pe.has("meta")||pe.has("cmd"))&&!ee.metaKey)return;pe.has("shift")&&!ee.shiftKey||(pe.has("alt")||pe.has("option"))&&!ee.altKey||ee.key.toLowerCase()===Q&&(ee.preventDefault(),t.phase==="idle"?r():o());};return document.addEventListener("keydown",qt),()=>document.removeEventListener("keydown",qt)},[e.config.ui?.shortcut,t.phase,r,o]),useEffect(()=>n.subscribeHover(b),[n]),useEffect(()=>{let w=n.__unsafeGetSelectedElement();if(!w||t.phase==="idle"||t.phase==="picking"){T(null);return}let W=()=>{T(Pe(w.getBoundingClientRect()));};W();let Q=()=>W();return window.addEventListener("scroll",Q,{capture:true,passive:true}),window.addEventListener("resize",Q,{passive:true}),()=>{window.removeEventListener("scroll",Q,{capture:true}),window.removeEventListener("resize",Q);}},[n,t.phase,t.selection?.selector]),useEffect(()=>{t.phase==="review"&&(g(""),p(e.config.capture?.element??true),m(e.config.capture?.fullPage??false),x(void 0),re(null));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),useEffect(()=>{if(t.phase!=="success")return;let w=window.setTimeout(()=>o(),1200);return ()=>window.clearTimeout(w)},[t.phase,o]);let A=t.phase==="capturing"||t.phase==="submitting",z=t.phase==="picking"?h?.rect??null:y??t.selection?.rect??null,ne=useMemo(()=>z?Ma(z,360,c):null,[z?.x,z?.y,z?.width,z?.height,c]),Z=t.lastError?.message,X=useCallback(()=>{let w={capture:{element:u,fullPage:f}};S&&(w.category=S),s(d,w);},[s,d,u,f,S]),dt=useCallback(w=>{(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&d.trim().length>0&&!A&&(w.preventDefault(),X());},[X,d,A]),[we,re]=useState(null),zr=useCallback(async()=>{if(t.voiceRecording){n.stopVoice();return}re(null);let w=await n.startVoice();if(w?.text)g(W=>W?W+" "+w.text:w.text);else if(w?.warning)re(a.voiceEmptyText);else if(!w){let W=n.getState().lastError;if(W){let Q=W.message?.toLowerCase()??"";Q.includes("denied")||Q.includes("permission")||Q.includes("not allowed")?re(a.voiceDeniedText):re(a.voiceErrorText);}}},[t.voiceRecording,n,a]),Vr=Dr(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(Vr,{position:c,onClick:()=>r(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??a.triggerLabel,queueCount:J,showSuccess:ze}),t.phase!=="idle"&&t.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>o()}),z&&jsx(Aa,{rect:z}),t.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:a.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>o(),"aria-label":a.cancelButton,children:a.cancelButton})]}),I&&ne&&jsxs("div",{ref:R,className:"bf-panel",style:{left:ne.left,top:ne.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxs("div",{className:"bf-panelHeader",children:[jsx("div",{className:"bf-title",id:"bf-panel-title",children:a.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:A,"aria-label":a.rePickButton,children:a.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>o(),disabled:A,"aria-label":a.closeButton,children:a.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:a.textareaPlaceholder,value:d,onChange:w=>g(w.target.value),onKeyDown:dt,disabled:A,"aria-label":a.panelTitle}),L.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:L.map(w=>jsx("button",{type:"button",className:`bf-pill${S===w?" bf-pill-active":""}`,onClick:()=>x(S===w?void 0:w),disabled:A,children:a[Ua[w]]},w))}),jsxs("div",{className:"bf-row",role:"group","aria-label":a.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:w=>p(w.target.checked),disabled:A}),a.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:f,onChange:w=>m(w.target.checked),disabled:A}),a.screenshotFullPage]})]}),se&&t.phase==="review"&&!t.voiceTranscribing&&jsx("button",{type:"button",className:`bf-voice-btn${t.voiceRecording?" bf-voice-btn-active":""}`,onClick:zr,disabled:A,"aria-label":t.voiceRecording?a.voiceStopButton:a.voiceButton,children:t.voiceRecording?jsxs(Fragment,{children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),a.voiceRecordingText," ",Ue(t.voiceElapsedMs??0)," / ",Ue(fe)," \u2014 ",a.voiceStopButton]}):jsxs(Fragment,{children:[jsxs("svg",{className:"bf-mic-icon",viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[jsx("rect",{x:"9",y:"1",width:"6",height:"11",rx:"3"}),jsx("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),a.voiceButton]})}),t.voiceTranscribing&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.voiceTranscribingText]}),we&&!t.voiceRecording&&!t.voiceTranscribing&&jsx("div",{className:"bf-error",role:"alert",children:we}),O&&t.phase==="review"&&!t.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>n.startRecording(),disabled:A,"aria-label":a.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),a.recordButton]}),t.video&&t.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>n.removeVideo(),"aria-label":a.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[a.videoPreviewLabel," (",Ue(t.video.durationMs),", ",za(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.capturingText]}),t.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),a.submittingText]}),t.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:a.successText}),t.phase==="error"&&Z&&jsx("div",{className:"bf-error",role:"alert",children:Z}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>o(),disabled:A,"aria-label":a.cancelButton,children:a.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:X,disabled:A||d.trim().length===0,"aria-label":a.sendButton,children:a.sendButton})]})]}),l&&jsxs("div",{className:"bf-watermark",children:[(()=>{let w=Tt();return w?jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-my-feedback-link",children:"View my feedback"}):null})(),jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})]})]})]}),t.phase==="recording"&&jsxs("div",{className:`bf-recording-bar bf-pos-${c}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{className:"bf-recording-bar-timer",children:[a.recordingText," ",Ue(t.recordingElapsedMs??0)," / ",Ue(P)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>n.stopRecording(),"aria-label":a.stopRecordButton,children:a.stopRecordButton})]}),t.phase==="success"&&jsxs("div",{className:"bf-toast",role:"status","aria-live":"polite",children:[a.toastText,(()=>{let w=Tt();return w?jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"bf-toast-link",children:"View my feedback"}):null})()]}),N>0&&!v&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>_(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),N," potential secret",N>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Wa=forwardRef(function(t,n){let r={...t.config??{},blocfeed_id:t.blocfeed_id},[o,i]=useState(null),s=Da(r.ui?.showOn),c=Oa(r.ui?.theme?.mode),a=!!r.diagnostics;useEffect(()=>{if(a)return nr(r.diagnostics),()=>rr()},[a]);let l=!!r.security;useEffect(()=>{l&&ir(r.security);},[l]);let h=useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let b=useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async d=>{let g=h.current,u=g?await g(d):{},p=or(),f=Ht(),m=wt();return {...u,...p.consoleLogs.length>0?{_consoleLogs:p.consoleLogs}:{},...p.networkErrors.length>0?{_networkErrors:p.networkErrors}:{},...f.findings.length>0?{_securityFindings:f.findings}:{},...m.length>0?{_clickEvents:m}:{}}}}}},[]);return useEffect(()=>{Zn();let d=document.createElement("div");d.setAttribute("data-blocfeed-ui-root","true"),d.setAttribute("data-blocfeed-ui","true"),d.setAttribute("data-bf-theme",c);let g=r.ui?.zIndex;typeof g=="number"&&d.style.setProperty("--bf-z",String(g));let u=r.ui?.theme;u&&(u.accentColor&&d.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&d.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&d.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&d.style.setProperty("--bf-font",u.fontFamily));let p=m=>m.stopPropagation(),f=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend"];for(let m of f)d.addEventListener(m,p);try{document.body.appendChild(d);}catch{return}return i(d),()=>{for(let m of f)d.removeEventListener(m,p);d.remove(),i(null);}},[r.ui?.zIndex,r.ui?.theme?.accentColor,r.ui?.theme?.panelBackground,r.ui?.theme?.panelForeground,r.ui?.theme?.fontFamily,c]),!s||!o?null:createPortal(jsx(Mt,{blocfeed_id:r.blocfeed_id,...b?{config:b}:{},children:jsx(Va,{config:r,handleRef:n})}),o)});var Xn="0.24.0",Ld={init(e){_e(e);},identify(e){qn(e);},track:Me};
885
+ export{ir as A,Ht as B,jc as C,Ut as D,Wa as E,Xn as F,Ld as G,C as a,Qt as b,rn as c,on as d,yt as e,an as f,ns as g,sn as h,wt as i,fo as j,xt as k,Et as l,kt as m,St as n,To as o,Tt as p,Sn as q,qn as r,Me as s,Ae as t,Jn as u,Mt as v,nr as w,rr as x,or as y,Wc as z};