blocfeed 0.9.0 → 0.10.1
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.
- package/CHANGELOG.md +40 -0
- package/README.md +113 -0
- package/dist/chunk-CU24MLER.cjs +2 -0
- package/dist/chunk-JZW5QQ6Q.js +2 -0
- package/dist/{controller-C6M-ge3K.d.cts → controller-97Hd8v8C.d.cts} +20 -1
- package/dist/{controller-C6M-ge3K.d.ts → controller-97Hd8v8C.d.ts} +20 -1
- package/dist/engine.cjs +1 -1
- package/dist/engine.d.cts +44 -3
- package/dist/engine.d.ts +44 -3
- package/dist/engine.js +1 -1
- package/dist/main.cjs +42 -3
- package/dist/main.d.cts +2 -2
- package/dist/main.d.ts +2 -2
- package/dist/main.js +42 -3
- package/package.json +6 -3
- package/dist/chunk-EFTA67IW.cjs +0 -2
- package/dist/chunk-QL6DSCNT.js +0 -2
package/dist/engine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as ScreenshotAdapter, C as CaptureConfig, h as CaptureResult, V as VideoAsset, R as RecordingConfig,
|
|
2
|
-
export { B as BlocFeedConfig, c as BlocFeedController, d as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, e as BlocFeedStrings, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, F as FeedbackCategory,
|
|
1
|
+
import { o as ScreenshotAdapter, C as CaptureConfig, h as CaptureResult, V as VideoAsset, R as RecordingConfig, H as ClickEvent, G as VoiceConfig, l as MetadataConfig, m as MetadataContext, f as BlocFeedUser, k as FeedbackPayload, u as SecuritySnapshot, s as SecurityConfig } from './controller-97Hd8v8C.js';
|
|
2
|
+
export { B as BlocFeedConfig, c as BlocFeedController, d as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, e as BlocFeedStrings, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, F as FeedbackCategory, J as HoverListener, I as ImageAsset, N as NetworkEntry, n as Rect, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, t as SecurityFinding, v as SessionPhase, K as StateListener, S as SubmitResult, T as ThemeConfig, w as TransportConfig, y as TriggerStyle, z as VideoIntent, A as VideoMime, W as WidgetPosition, L as createBlocFeedController } from './controller-97Hd8v8C.js';
|
|
3
3
|
|
|
4
4
|
declare function createHtmlToImageAdapter(): ScreenshotAdapter;
|
|
5
5
|
|
|
@@ -68,6 +68,47 @@ declare function startRecording(params: {
|
|
|
68
68
|
declare function drainClickEvents(): ClickEvent[];
|
|
69
69
|
declare function clearClickEvents(): void;
|
|
70
70
|
|
|
71
|
+
interface VoiceSession {
|
|
72
|
+
/** Resolves with the final audio Blob when recording finishes. */
|
|
73
|
+
result: Promise<{
|
|
74
|
+
blob: Blob;
|
|
75
|
+
mime: string;
|
|
76
|
+
durationMs: number;
|
|
77
|
+
}>;
|
|
78
|
+
/** Stop recording early (user clicks stop). */
|
|
79
|
+
stop: () => void;
|
|
80
|
+
/** Subscribe to elapsed-time ticks (~250 ms interval). */
|
|
81
|
+
onTick: (cb: (elapsedMs: number) => void) => void;
|
|
82
|
+
/** Abort and clean up. */
|
|
83
|
+
abort: () => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Returns true if the current browser supports audio recording
|
|
87
|
+
* (getUserMedia + MediaRecorder with WebM/Ogg audio).
|
|
88
|
+
*/
|
|
89
|
+
declare function isVoiceSupported(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Start a voice recording session using the microphone.
|
|
92
|
+
*/
|
|
93
|
+
declare function startVoiceRecording(params: {
|
|
94
|
+
config?: VoiceConfig;
|
|
95
|
+
signal?: AbortSignal;
|
|
96
|
+
}): Promise<VoiceSession>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Send audio blob to the voice transcription endpoint.
|
|
100
|
+
* Returns the transcribed text or throws on failure.
|
|
101
|
+
*/
|
|
102
|
+
declare function transcribeAudio(params: {
|
|
103
|
+
blob: Blob;
|
|
104
|
+
mime: string;
|
|
105
|
+
blocfeedId: string;
|
|
106
|
+
signal?: AbortSignal;
|
|
107
|
+
}): Promise<{
|
|
108
|
+
text: string;
|
|
109
|
+
warning?: string;
|
|
110
|
+
}>;
|
|
111
|
+
|
|
71
112
|
declare function collectMetadata(params: {
|
|
72
113
|
config: MetadataConfig | undefined;
|
|
73
114
|
context: MetadataContext;
|
|
@@ -162,4 +203,4 @@ declare function clearSecurityFindings(): void;
|
|
|
162
203
|
|
|
163
204
|
declare function dataUrlToBlob(dataUrl: string): Blob;
|
|
164
205
|
|
|
165
|
-
export { BlocFeedUser, CaptureResult, ClickEvent, FeedbackPayload, type ModernScreenshotModule, RecordingConfig, type RecordingSession, ScreenshotAdapter, SecurityConfig, SecuritySnapshot, VideoAsset, clearClickEvents, clearDiagnostics, clearQueue, clearSecurityFindings, collectMetadata, createHtmlToImageAdapter, createModernScreenshotAdapter, dataUrlToBlob, dequeueAll, drainClickEvents, drainDiagnostics, enqueue, getQueueSize, getSecurityFindings, installDiagnostics, isRecordingSupported, runCapture, runSecretScan, startRecording, uninstallDiagnostics };
|
|
206
|
+
export { BlocFeedUser, CaptureResult, ClickEvent, FeedbackPayload, type ModernScreenshotModule, RecordingConfig, type RecordingSession, ScreenshotAdapter, SecurityConfig, SecuritySnapshot, VideoAsset, VoiceConfig, type VoiceSession, clearClickEvents, clearDiagnostics, clearQueue, clearSecurityFindings, collectMetadata, createHtmlToImageAdapter, createModernScreenshotAdapter, dataUrlToBlob, dequeueAll, drainClickEvents, drainDiagnostics, enqueue, getQueueSize, getSecurityFindings, installDiagnostics, isRecordingSupported, isVoiceSupported, runCapture, runSecretScan, startRecording, startVoiceRecording, transcribeAudio, uninstallDiagnostics };
|
package/dist/engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-JZW5QQ6Q.js';export{k as clearClickEvents,u as clearDiagnostics,h as clearQueue,x as clearSecurityFindings,e as collectMetadata,q as createBlocFeedController,c as createHtmlToImageAdapter,g as dequeueAll,j as drainClickEvents,t as drainDiagnostics,f as enqueue,i as getQueueSize,w as getSecurityFindings,r as installDiagnostics,l as isRecordingSupported,n as isVoiceSupported,d as runCapture,v as runSecretScan,m as startRecording,o as startVoiceRecording,p as transcribeAudio,s as uninstallDiagnostics}from'./chunk-JZW5QQ6Q.js';function s(o){if(o?.aborted)throw new Error("Aborted")}async function D(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await D(o);return {dataUrl:o,mime:t,width:e,height:r}}function v(o){return {async captureElement(t,e){if(!a())throw new Error("captureElement can only run in the browser");s(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return s(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!a())throw new Error("captureFullPage can only run in the browser");s(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),i=Math.min(1,t.maxDimension/Math.max(r,n)),c={width:Math.max(1,Math.round(r*i)),height:Math.max(1,Math.round(n*i)),scale:t.pixelRatio},a$1=t.mime==="image/jpeg"?await o.domToJpeg(e,{...c,quality:t.quality??.92}):await o.domToPng(e,c);return s(t.signal),await l(a$1,t.mime)}}}function H(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(e),c=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)c[a]=i.charCodeAt(a);return new Blob([c],{type:n})}export{v as createModernScreenshotAdapter,H as dataUrlToBlob};
|
package/dist/main.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var
|
|
2
|
+
'use strict';var chunkCU24MLER_cjs=require('./chunk-CU24MLER.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom'),framerMotion=require('framer-motion');var Y=react.createContext(null);function re(t){let e=react.useMemo(()=>chunkCU24MLER_cjs.q({...t.config??{},blocfeed_id:t.blocfeed_id}),[]),[a,r]=react.useState(()=>e.getState());return react.useEffect(()=>e.subscribe(r),[e]),react.useEffect(()=>e.setConfig({...t.config??{},blocfeed_id:t.blocfeed_id}),[e,t.config,t.blocfeed_id]),react.useEffect(()=>()=>e.destroy(),[e]),jsxRuntime.jsx(Y.Provider,{value:{controller:e,state:a},children:t.children})}var Be="blocfeed-styles-v1",Ft=`
|
|
3
3
|
:where([data-blocfeed-ui-root]),
|
|
4
4
|
:where([data-blocfeed-ui-root]) * {
|
|
5
5
|
box-sizing: border-box;
|
|
@@ -637,6 +637,45 @@
|
|
|
637
637
|
cursor: not-allowed;
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
/* ---- Voice feedback button ---- */
|
|
641
|
+
|
|
642
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn {
|
|
643
|
+
display: inline-flex;
|
|
644
|
+
align-items: center;
|
|
645
|
+
gap: 6px;
|
|
646
|
+
padding: 6px 12px;
|
|
647
|
+
border-radius: 6px;
|
|
648
|
+
border: 1px solid var(--bf-border);
|
|
649
|
+
background: transparent;
|
|
650
|
+
color: var(--bf-panel-fg);
|
|
651
|
+
font-size: 13px;
|
|
652
|
+
cursor: pointer;
|
|
653
|
+
transition: background 0.15s, border-color 0.15s;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn:hover {
|
|
657
|
+
background: rgba(128,128,128,0.1);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn:focus-visible {
|
|
661
|
+
outline: 2px solid var(--bf-accent);
|
|
662
|
+
outline-offset: 2px;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn[disabled] {
|
|
666
|
+
opacity: 0.6;
|
|
667
|
+
cursor: not-allowed;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn-active {
|
|
671
|
+
border-color: var(--bf-danger);
|
|
672
|
+
color: var(--bf-danger);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
:where([data-blocfeed-ui-root]) .bf-mic-icon {
|
|
676
|
+
flex-shrink: 0;
|
|
677
|
+
}
|
|
678
|
+
|
|
640
679
|
:where([data-blocfeed-ui-root]) .bf-recording-indicator {
|
|
641
680
|
display: flex;
|
|
642
681
|
align-items: center;
|
|
@@ -803,5 +842,5 @@
|
|
|
803
842
|
animation: none;
|
|
804
843
|
}
|
|
805
844
|
}
|
|
806
|
-
`;function Se(){if(!chunkEFTA67IW_cjs.a()||document.getElementById(Te))return;let e=document.createElement("style");e.id=Te,e.textContent=Tt,document.head.appendChild(e);}var Pe={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"};function Ce(e){return e?{...Pe,...e}:Pe}function oe(){let e=react.useContext(U);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}}function v(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 g({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ee({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.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 Be({size:e=16}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ne({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){return i?jsxRuntime.jsxs("button",{className:v(e),type:"button",onClick:t,"aria-label":o,children:[l?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]}):null}function m(){let[e,t]=react.useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return react.useEffect(()=>{let i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=a=>t(a.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}var Nt={duration:.18,ease:"easeOut"},Rt={duration:0};function Me({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Rt:Nt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",animate:r?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"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:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"dot")})}var At={duration:.18,ease:"easeOut"},Le={duration:0};function Ie({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Le:At;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.div,{className:v(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:r?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:r?0:4},transition:s,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:o},"tooltip")}),jsxRuntime.jsxs(framerMotion.motion.button,{type:"button",onClick:t,"aria-label":o,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:r?{}:{y:[0,-3,0]},transition:r?Le:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:16})},"success"):jsxRuntime.jsx(Ee,{size:16}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var _t={duration:.2,ease:"easeOut"},Ht={duration:0};function _e(e){return e==="bottom-left"||e==="top-left"}function Ot(e){return `bf-trigger-edge ${_e(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function He({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=_e(e),s=m(),h=s?Ht:_t;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:Ot(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.span,{animate:{rotate:s||n?0:r?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[r?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"edge-tab")})}var Kt={duration:.18,ease:"easeOut"},Vt={duration:0};function De({delay:e,hovered:t,reduced:i}){return i?null:jsxRuntime.jsx(framerMotion.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 Ke({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Vt:Kt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(De,{delay:0,hovered:n,reduced:r}),jsxRuntime.jsx(De,{delay:.7,hovered:n,reduced:r}),jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"pulse-ring")})}var Gt={duration:.18,ease:"easeOut"},jt={duration:0};function Qt(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 Xe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?jt:Gt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.button,{className:Qt(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:r?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:r?0:5},transition:s,whileTap:{scale:.95},children:[l?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${a} queued`,children:a})]}),!r&&jsxRuntime.jsx(framerMotion.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:n?1:0},transition:s})]},"minimal")})}var Zt={duration:.18,ease:"easeOut"},eo={duration:0};function Ge({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?eo:Zt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{style:{display:"inline-flex",flexShrink:0},animate:r?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||r?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsxRuntime.jsx(Be,{size:16})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"icon-pop")})}var ao={duration:.18,ease:"easeOut"},io={duration:0};function qe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?io:ao;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:r?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"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:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!r&&jsxRuntime.jsx(framerMotion.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"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"beacon")})}var po={duration:.18,ease:"easeOut"},fo={duration:0};function tt({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),[r,s]=react.useState(0),h=m(),M=h?fo:po,f=react.useRef(null);react.useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!i||n||h){s(n||h?o.length:0);return}let u=8,C=o.length*2+u*2,y=0;return f.current=setInterval(()=>{y=(y+1)%C,y<=o.length?s(y):y<=o.length+u?s(o.length):y<=o.length*2+u?s(o.length*2+u-y):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[i,n,h,o]);let S=o.slice(0,r);return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:M,whileTap:{scale:.95},style:{minWidth:"44px"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:M,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxRuntime.jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsxRuntime.jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"typewriter")})}function ot(e){switch(e){case "dot":return Me;case "bubble":return Ie;case "edge-tab":return He;case "pulse-ring":return Ke;case "minimal":return Xe;case "icon-pop":return Ge;case "beacon":return qe;case "typewriter":return tt;default:return Ne}}function at(e,t,i){return Math.max(t,Math.min(i,e))}function ho(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=at(e.x,12,Math.max(12,a-t-12));let c=e.y+e.height+12,r=Math.max(12,e.y-240);return {top:c+240<=l?c:r,left:n}}function xo(e){let{rect:t}=e,i={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsxRuntime.jsx("div",{className:"bf-highlight",style:i,"aria-hidden":"true"})}function yo(e){let t=react.useRef(null);return react.useEffect(()=>{if(!e||!t.current)return;t.current.querySelector(".bf-textarea")?.focus();let o=a=>{if(a.key!=="Tab"||!t.current)return;let l=t.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let n=l[0],c=l[l.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),c.focus()):!a.shiftKey&&document.activeElement===c&&(a.preventDefault(),n.focus());};return document.addEventListener("keydown",o,{capture:true}),()=>document.removeEventListener("keydown",o,{capture:true})},[e]),t}function vo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function wo(e){let[t,i]=react.useState(()=>typeof window<"u"?window.location.pathname:"/");return react.useEffect(()=>{if(typeof window>"u")return;let o=()=>i(window.location.pathname);window.addEventListener("popstate",o);let a=history.pushState,l=history.replaceState;return history.pushState=function(...n){a.apply(this,n),o();},history.replaceState=function(...n){l.apply(this,n),o();},()=>{window.removeEventListener("popstate",o),history.pushState=a,history.replaceState=l;}},[]),vo(e,t)}function ko(e){let[t,i]=react.useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return react.useEffect(()=>{if(e!=="auto"){i(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),a=l=>i(l.matches?"dark":"light");return i(o.matches?"dark":"light"),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e]),t}var To=["bug","feature","ux","general"],So={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function re(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function Po(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Co(e){let{state:t,controller:i,start:o,stop:a,clearSelection:l,submit:n}=oe(),c=e.config.ui?.position,r=Ce(e.config.ui?.strings),s=e.config.ui?.branding!==false,[h,M]=react.useState(null),[f,S]=react.useState(""),[u,C]=react.useState(e.config.capture?.element??true),[y,O]=react.useState(e.config.capture?.fullPage??false),[nt,ie]=react.useState(null),[D,ne]=react.useState(void 0),se=e.config.ui?.categories??To,st=e.config.recording?.enabled===true&&chunkEFTA67IW_cjs.l(),ct=e.config.recording?.maxDurationMs??3e4,[lt,dt]=react.useState(false),[Q,pt]=react.useState(0);react.useEffect(()=>{let d=window.setTimeout(()=>{let N=chunkEFTA67IW_cjs.t();pt(N.findings.length);},500);return ()=>window.clearTimeout(d)},[]),react.useImperativeHandle(e.handleRef,()=>({open:o,close:a,submit:d=>n(d),startRecording:()=>i.startRecording(),stopRecording:()=>i.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,a,n,i,t.phase]);let ce=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",ft=yo(ce),[ut,bt]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&bt(chunkEFTA67IW_cjs.i());},[t.phase]);let[gt,le]=react.useState(false),de=react.useRef(t.phase);react.useEffect(()=>{if(de.current==="success"&&t.phase==="idle"){le(true);let d=window.setTimeout(()=>le(false),1500);return ()=>window.clearTimeout(d)}de.current=t.phase;},[t.phase]),react.useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",z=new Set(N.slice(0,-1)),fe=P=>{let xt=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(z.has("mod")){if(xt?!P.metaKey:!P.ctrlKey)return}else if(z.has("ctrl")&&!P.ctrlKey||(z.has("meta")||z.has("cmd"))&&!P.metaKey)return;z.has("shift")&&!P.shiftKey||(z.has("alt")||z.has("option"))&&!P.altKey||P.key.toLowerCase()===W&&(P.preventDefault(),t.phase==="idle"?o():a());};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[e.config.ui?.shortcut,t.phase,o,a]),react.useEffect(()=>i.subscribeHover(M),[i]),react.useEffect(()=>{let d=i.__unsafeGetSelectedElement();if(!d||t.phase==="idle"||t.phase==="picking"){ie(null);return}let N=()=>{ie(chunkEFTA67IW_cjs.b(d.getBoundingClientRect()));};N();let W=()=>N();return window.addEventListener("scroll",W,{capture:true,passive:true}),window.addEventListener("resize",W,{passive:true}),()=>{window.removeEventListener("scroll",W,{capture:true}),window.removeEventListener("resize",W);}},[i,t.phase,t.selection?.selector]),react.useEffect(()=>{t.phase==="review"&&(S(""),C(e.config.capture?.element??true),O(e.config.capture?.fullPage??false),ne(void 0));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),react.useEffect(()=>{if(t.phase!=="success")return;let d=window.setTimeout(()=>a(),1200);return ()=>window.clearTimeout(d)},[t.phase,a]);let k=t.phase==="capturing"||t.phase==="submitting",F=t.phase==="picking"?h?.rect??null:nt??t.selection?.rect??null,q=react.useMemo(()=>F?ho(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,J=react.useCallback(()=>{let d={capture:{element:u,fullPage:y}};D&&(d.category=D),n(f,d);},[n,f,u,y,D]),mt=react.useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),J());},[J,f,k]),ht=ot(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ht,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ut,showSuccess:gt}),t.phase!=="idle"&&t.phase!=="recording"&&jsxRuntime.jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsxRuntime.jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsxRuntime.jsx(xo,{rect:F}),t.phase==="picking"&&jsxRuntime.jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{id:"bf-hint-text",children:r.hintText}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r.cancelButton,children:r.cancelButton})]}),ce&&q&&jsxRuntime.jsxs("div",{ref:ft,className:"bf-panel",style:{left:q.left,top:q.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxRuntime.jsxs("div",{className:"bf-panelHeader",children:[jsxRuntime.jsx("div",{className:"bf-title",id:"bf-panel-title",children:r.panelTitle}),jsxRuntime.jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>l(),disabled:k,"aria-label":r.rePickButton,children:r.rePickButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.closeButton,children:r.closeButton})]})]}),jsxRuntime.jsxs("div",{className:"bf-panelBody",children:[jsxRuntime.jsx("textarea",{className:"bf-textarea",placeholder:r.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:mt,disabled:k,"aria-label":r.panelTitle}),se.length>0&&jsxRuntime.jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:se.map(d=>jsxRuntime.jsx("button",{type:"button",className:`bf-pill${D===d?" bf-pill-active":""}`,onClick:()=>ne(D===d?void 0:d),disabled:k,children:r[So[d]]},d))}),jsxRuntime.jsxs("div",{className:"bf-row",role:"group","aria-label":r.screenshotElement,children:[jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r.screenshotElement]}),jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:y,onChange:d=>O(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),st&&t.phase==="review"&&!t.video&&jsxRuntime.jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i.startRecording(),disabled:k,"aria-label":r.recordButton,children:[jsxRuntime.jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r.recordButton]}),t.video&&t.phase==="review"&&jsxRuntime.jsxs("div",{className:"bf-video-preview",children:[jsxRuntime.jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsxRuntime.jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i.removeVideo(),"aria-label":r.removeVideoButton,children:"\xD7"}),jsxRuntime.jsxs("div",{className:"bf-video-meta",children:[r.videoPreviewLabel," (",re(t.video.durationMs),", ",Po(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.capturingText]}),t.phase==="submitting"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.submittingText]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r.successText}),t.phase==="error"&&pe&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:pe}),jsxRuntime.jsxs("div",{className:"bf-actions",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.cancelButton,children:r.cancelButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:J,disabled:k||f.trim().length===0,"aria-label":r.sendButton,children:r.sendButton})]})]}),s&&jsxRuntime.jsx("div",{className:"bf-watermark",children:jsxRuntime.jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t.phase==="recording"&&jsxRuntime.jsxs("div",{className:`bf-recording-bar bf-pos-${c}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"bf-recording-bar-timer",children:[r.recordingText," ",re(t.recordingElapsedMs??0)," / ",re(ct)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>i.stopRecording(),"aria-label":r.stopRecordButton,children:r.stopRecordButton})]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r.toastText}),Q>0&&!lt&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>dt(true),"aria-label":"Dismiss",children:"\xD7"}),jsxRuntime.jsx("strong",{children:"Security Warning"}),Q," potential secret",Q>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Eo=react.forwardRef(function(t,i){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=react.useState(null),n=wo(o.ui?.showOn),c=ko(o.ui?.theme?.mode),r=!!o.diagnostics;react.useEffect(()=>{if(r)return chunkEFTA67IW_cjs.o(o.diagnostics),()=>chunkEFTA67IW_cjs.p()},[r]);let s=!!o.security;react.useEffect(()=>{s&&chunkEFTA67IW_cjs.s(o.security);},[s]);let h=react.useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let M=react.useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=chunkEFTA67IW_cjs.q(),y=chunkEFTA67IW_cjs.t(),O=chunkEFTA67IW_cjs.j();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{},...O.length>0?{_clickEvents:O}:{}}}}}},[]);return react.useEffect(()=>{Se();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",c);let S=o.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let u=o.ui?.theme;return u&&(u.accentColor&&f.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&f.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&f.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&f.style.setProperty("--bf-font",u.fontFamily)),document.body.appendChild(f),l(f),()=>{f.remove(),l(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,c]),react.useEffect(()=>{a&&a.setAttribute("data-bf-theme",c);},[a,c]),!n||!a?null:reactDom.createPortal(jsxRuntime.jsx(te,{blocfeed_id:o.blocfeed_id,...M?{config:M}:{},children:jsxRuntime.jsx(Co,{config:o,handleRef:i})}),a)});
|
|
807
|
-
exports.BlocFeedProvider=
|
|
845
|
+
`;function Ne(){if(!chunkCU24MLER_cjs.a()||document.getElementById(Be))return;let t=document.createElement("style");t.id=Be,t.textContent=Ft,document.head.appendChild(t);}var Fe={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 Re(t){return t?{...Fe,...t}:Fe}function ie(){let t=react.useContext(Y);if(!t)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:t.state,controller:t.controller,start:t.controller.start,stop:t.controller.stop,clearSelection:t.controller.clearSelection,submit:t.controller.submit,startRecording:t.controller.startRecording,stopRecording:t.controller.stopRecording,removeVideo:t.controller.removeVideo}}function w(t){switch(t){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 g({size:t=14}){return jsxRuntime.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Me({size:t=14}){return jsxRuntime.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.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 ze({size:t=16}){return jsxRuntime.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsxRuntime.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"}),jsxRuntime.jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ae({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){return a?jsxRuntime.jsxs("button",{className:w(t),type:"button",onClick:e,"aria-label":r,children:[p?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),r]}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]}):null}function m(){let[t,e]=react.useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return react.useEffect(()=>{let a=window.matchMedia("(prefers-reduced-motion: reduce)"),r=i=>e(i.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),t}var Wt={duration:.18,ease:"easeOut"},_t={duration:0};function We({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=m(),s=o?_t:Wt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsx(framerMotion.motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",animate:o?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"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:n||o?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:o?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"dot")})}var Vt={duration:.18,ease:"easeOut"},He={duration:0};function De({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=m(),s=o?He:Vt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsxs(framerMotion.motion.div,{className:w(t),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:o?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:o?0:4},transition:s,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")}),jsxRuntime.jsxs(framerMotion.motion.button,{type:"button",onClick:e,"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:o?{}:{y:[0,-3,0]},transition:o?He:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:16})},"success"):jsxRuntime.jsx(Me,{size:16}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${i} queued`,children:i})]})]},"bubble")})}var Ut={duration:.2,ease:"easeOut"},Xt={duration:0};function $e(t){return t==="bottom-left"||t==="top-left"}function Yt(t){return `bf-trigger-edge ${$e(t)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function Ke({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=$e(t),s=m(),h=s?Xt:Ut;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsx(framerMotion.motion.button,{className:Yt(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.span,{animate:{rotate:s||n?0:o?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&jsxRuntime.jsx(framerMotion.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]}),jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[o?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"edge-tab")})}var Qt={duration:.18,ease:"easeOut"},qt={duration:0};function Xe({delay:t,hovered:e,reduced:a}){return a?null:jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:e?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:e?{duration:.15}:{duration:2,repeat:1/0,delay:t,ease:"easeOut"}})}function Ge({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=m(),s=o?qt:Qt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsx(framerMotion.motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(Xe,{delay:0,hovered:n,reduced:o}),jsxRuntime.jsx(Xe,{delay:.7,hovered:n,reduced:o}),jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:o?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"pulse-ring")})}var to={duration:.18,ease:"easeOut"},oo={duration:0};function ro(t){switch(t){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 qe({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=m(),s=o?oo:to;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsxs(framerMotion.motion.button,{className:ro(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{opacity:0,y:o?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:o?0:5},transition:s,whileTap:{scale:.95},children:[p?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:r}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${i} queued`,children:i})]}),!o&&jsxRuntime.jsx(framerMotion.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:n?1:0},transition:s})]},"minimal")})}var no={duration:.18,ease:"easeOut"},so={duration:0};function Ze({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=m(),s=o?so:no;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsx(framerMotion.motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{style:{display:"inline-flex",flexShrink:0},animate:o?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||o?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsxRuntime.jsx(ze,{size:16})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:o?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"icon-pop")})}var fo={duration:.18,ease:"easeOut"},uo={duration:0};function ot({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),o=m(),s=o?uo:fo;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsx(framerMotion.motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:o?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"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:n||o?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!o&&jsxRuntime.jsx(framerMotion.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"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:o?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"beacon")})}var xo={duration:.18,ease:"easeOut"},vo={duration:0};function nt({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=react.useState(false),[o,s]=react.useState(0),h=m(),z=h?vo:xo,f=react.useRef(null);react.useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!a||n||h){s(n||h?r.length:0);return}let b=8,B=r.length*2+b*2,v=0;return f.current=setInterval(()=>{v=(v+1)%B,v<=r.length?s(v):v<=r.length+b?s(r.length):v<=r.length*2+b?s(r.length*2+b-v):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[a,n,h,r]);let S=r.slice(0,o);return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:a&&jsxRuntime.jsx(framerMotion.motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:z,whileTap:{scale:.95},style:{minWidth:"44px"},children:p?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:z,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxRuntime.jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsxRuntime.jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),i>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"typewriter")})}function st(t){switch(t){case "dot":return We;case "bubble":return De;case "edge-tab":return Ke;case "pulse-ring":return Ge;case "minimal":return qe;case "icon-pop":return Ze;case "beacon":return ot;case "typewriter":return nt;default:return Ae}}function ct(t,e,a){return Math.max(e,Math.min(a,t))}function So(t,e,a="bottom-right"){let i=window.innerWidth,p=window.innerHeight,n;n=ct(t.x,12,Math.max(12,i-e-12));let l=t.y+t.height+12,o=Math.max(12,t.y-240);return {top:l+240<=p?l:o,left:n}}function Eo(t){let{rect:e}=t,a={left:`${e.x}px`,top:`${e.y}px`,width:`${Math.max(0,e.width)}px`,height:`${Math.max(0,e.height)}px`};return jsxRuntime.jsx("div",{className:"bf-highlight",style:a,"aria-hidden":"true"})}function Co(t){let e=react.useRef(null);return react.useEffect(()=>{if(!t||!e.current)return;e.current.querySelector(".bf-textarea")?.focus();let r=i=>{if(i.key!=="Tab"||!e.current)return;let p=e.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(p.length===0)return;let n=p[0],l=p[p.length-1];i.shiftKey&&document.activeElement===n?(i.preventDefault(),l.focus()):!i.shiftKey&&document.activeElement===l&&(i.preventDefault(),n.focus());};return document.addEventListener("keydown",r,{capture:true}),()=>document.removeEventListener("keydown",r,{capture:true})},[t]),e}function Po(t,e){return t?typeof t=="function"?t(e):t.some(a=>a.endsWith("*")?e.startsWith(a.slice(0,-1)):e===a):true}function Bo(t){let[e,a]=react.useState(()=>typeof window<"u"?window.location.pathname:"/");return react.useEffect(()=>{if(typeof window>"u")return;let r=()=>a(window.location.pathname);window.addEventListener("popstate",r);let i=history.pushState,p=history.replaceState;return history.pushState=function(...n){i.apply(this,n),r();},history.replaceState=function(...n){p.apply(this,n),r();},()=>{window.removeEventListener("popstate",r),history.pushState=i,history.replaceState=p;}},[]),Po(t,e)}function No(t){let[e,a]=react.useState(()=>!t||t==="dark"?"dark":t==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return react.useEffect(()=>{if(t!=="auto"){a(t==="light"?"light":"dark");return}let r=window.matchMedia("(prefers-color-scheme: dark)"),i=p=>a(p.matches?"dark":"light");return a(r.matches?"dark":"light"),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[t]),e}var Fo=["bug","feature","ux","general"],Ro={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function X(t){let e=Math.floor(t/1e3),a=Math.floor(e/60),r=e%60;return `${a}:${String(r).padStart(2,"0")}`}function Mo(t){return t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function zo(t){let{state:e,controller:a,start:r,stop:i,clearSelection:p,submit:n}=ie(),l=t.config.ui?.position,o=Re(t.config.ui?.strings),s=t.config.ui?.branding!==false,[h,z]=react.useState(null),[f,S]=react.useState(""),[b,B]=react.useState(t.config.capture?.element??true),[v,O]=react.useState(t.config.capture?.fullPage??false),[dt,ce]=react.useState(null),[D,le]=react.useState(void 0),de=t.config.ui?.categories??Fo,pt=t.config.recording?.enabled===true&&chunkCU24MLER_cjs.l(),ft=t.config.recording?.maxDurationMs??3e4,ut=t.config.voice?.enabled===true&&chunkCU24MLER_cjs.n(),bt=t.config.voice?.maxDurationMs??6e4,[gt,mt]=react.useState(false),[J,ht]=react.useState(0);react.useEffect(()=>{let d=window.setTimeout(()=>{let y=chunkCU24MLER_cjs.w();ht(y.findings.length);},500);return ()=>window.clearTimeout(d)},[]),react.useImperativeHandle(t.handleRef,()=>({open:r,close:i,submit:d=>n(d),startRecording:()=>a.startRecording(),stopRecording:()=>a.stopRecording(),get isOpen(){return e.phase!=="idle"}}),[r,i,n,a,e.phase]);let pe=e.phase==="review"||e.phase==="capturing"||e.phase==="submitting"||e.phase==="error"||e.phase==="success",xt=Co(pe),[vt,yt]=react.useState(0);react.useEffect(()=>{e.phase==="idle"&&yt(chunkCU24MLER_cjs.i());},[e.phase]);let[wt,fe]=react.useState(false),ue=react.useRef(e.phase);react.useEffect(()=>{if(ue.current==="success"&&e.phase==="idle"){fe(true);let d=window.setTimeout(()=>fe(false),1500);return ()=>window.clearTimeout(d)}ue.current=e.phase;},[e.phase]),react.useEffect(()=>{let d=t.config.ui?.shortcut;if(!d)return;let y=d.toLowerCase().split("+").map(P=>P.trim()),C=y[y.length-1]||"",L=new Set(y.slice(0,-1)),me=P=>{let Et=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(L.has("mod")){if(Et?!P.metaKey:!P.ctrlKey)return}else if(L.has("ctrl")&&!P.ctrlKey||(L.has("meta")||L.has("cmd"))&&!P.metaKey)return;L.has("shift")&&!P.shiftKey||(L.has("alt")||L.has("option"))&&!P.altKey||P.key.toLowerCase()===C&&(P.preventDefault(),e.phase==="idle"?r():i());};return document.addEventListener("keydown",me),()=>document.removeEventListener("keydown",me)},[t.config.ui?.shortcut,e.phase,r,i]),react.useEffect(()=>a.subscribeHover(z),[a]),react.useEffect(()=>{let d=a.__unsafeGetSelectedElement();if(!d||e.phase==="idle"||e.phase==="picking"){ce(null);return}let y=()=>{ce(chunkCU24MLER_cjs.b(d.getBoundingClientRect()));};y();let C=()=>y();return window.addEventListener("scroll",C,{capture:true,passive:true}),window.addEventListener("resize",C,{passive:true}),()=>{window.removeEventListener("scroll",C,{capture:true}),window.removeEventListener("resize",C);}},[a,e.phase,e.selection?.selector]),react.useEffect(()=>{e.phase==="review"&&(S(""),B(t.config.capture?.element??true),O(t.config.capture?.fullPage??false),le(void 0),V(null));},[e.phase,e.selection?.selector,t.config.capture?.element,t.config.capture?.fullPage]),react.useEffect(()=>{if(e.phase!=="success")return;let d=window.setTimeout(()=>i(),1200);return ()=>window.clearTimeout(d)},[e.phase,i]);let T=e.phase==="capturing"||e.phase==="submitting",R=e.phase==="picking"?h?.rect??null:dt??e.selection?.rect??null,Z=react.useMemo(()=>R?So(R,360,l):null,[R?.x,R?.y,R?.width,R?.height,l]),be=e.lastError?.message,ee=react.useCallback(()=>{let d={capture:{element:b,fullPage:v}};D&&(d.category=D),n(f,d);},[n,f,b,v,D]),kt=react.useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!T&&(d.preventDefault(),ee());},[ee,f,T]),[ge,V]=react.useState(null),Tt=react.useCallback(async()=>{if(e.voiceRecording){a.stopVoice();return}V(null);let d=await a.startVoice();if(d?.text)S(y=>y?y+" "+d.text:d.text);else if(d?.warning)V(o.voiceEmptyText);else if(!d){let y=a.getState().lastError;if(y){let C=y.message?.toLowerCase()??"";C.includes("denied")||C.includes("permission")||C.includes("not allowed")?V(o.voiceDeniedText):V(o.voiceErrorText);}}},[e.voiceRecording,a,o]),St=st(t.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(St,{position:l,onClick:()=>r(),isVisible:e.phase==="idle",label:t.config.ui?.triggerLabel??o.triggerLabel,queueCount:vt,showSuccess:wt}),e.phase!=="idle"&&e.phase!=="recording"&&jsxRuntime.jsxs("div",{className:"bf-overlay",role:"presentation",children:[e.phase!=="picking"&&jsxRuntime.jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>i()}),R&&jsxRuntime.jsx(Eo,{rect:R}),e.phase==="picking"&&jsxRuntime.jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{id:"bf-hint-text",children:o.hintText}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),"aria-label":o.cancelButton,children:o.cancelButton})]}),pe&&Z&&jsxRuntime.jsxs("div",{ref:xt,className:"bf-panel",style:{left:Z.left,top:Z.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxRuntime.jsxs("div",{className:"bf-panelHeader",children:[jsxRuntime.jsx("div",{className:"bf-title",id:"bf-panel-title",children:o.panelTitle}),jsxRuntime.jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>p(),disabled:T,"aria-label":o.rePickButton,children:o.rePickButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:T,"aria-label":o.closeButton,children:o.closeButton})]})]}),jsxRuntime.jsxs("div",{className:"bf-panelBody",children:[jsxRuntime.jsx("textarea",{className:"bf-textarea",placeholder:o.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:kt,disabled:T,"aria-label":o.panelTitle}),de.length>0&&jsxRuntime.jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:de.map(d=>jsxRuntime.jsx("button",{type:"button",className:`bf-pill${D===d?" bf-pill-active":""}`,onClick:()=>le(D===d?void 0:d),disabled:T,children:o[Ro[d]]},d))}),jsxRuntime.jsxs("div",{className:"bf-row",role:"group","aria-label":o.screenshotElement,children:[jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:b,onChange:d=>B(d.target.checked),disabled:T}),o.screenshotElement]}),jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:v,onChange:d=>O(d.target.checked),disabled:T}),o.screenshotFullPage]})]}),ut&&e.phase==="review"&&!e.voiceTranscribing&&jsxRuntime.jsx("button",{type:"button",className:`bf-voice-btn${e.voiceRecording?" bf-voice-btn-active":""}`,onClick:Tt,disabled:T,"aria-label":e.voiceRecording?o.voiceStopButton:o.voiceButton,children:e.voiceRecording?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),o.voiceRecordingText," ",X(e.voiceElapsedMs??0)," / ",X(bt)," \u2014 ",o.voiceStopButton]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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:[jsxRuntime.jsx("rect",{x:"9",y:"1",width:"6",height:"11",rx:"3"}),jsxRuntime.jsx("path",{d:"M19 10v1a7 7 0 0 1-14 0v-1"}),jsxRuntime.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),jsxRuntime.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),o.voiceButton]})}),e.voiceTranscribing&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),o.voiceTranscribingText]}),ge&&!e.voiceRecording&&!e.voiceTranscribing&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:ge}),pt&&e.phase==="review"&&!e.video&&jsxRuntime.jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>a.startRecording(),disabled:T,"aria-label":o.recordButton,children:[jsxRuntime.jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),o.recordButton]}),e.video&&e.phase==="review"&&jsxRuntime.jsxs("div",{className:"bf-video-preview",children:[jsxRuntime.jsx("video",{src:e.video.blobUrl,controls:true,muted:true,playsInline:true}),jsxRuntime.jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>a.removeVideo(),"aria-label":o.removeVideoButton,children:"\xD7"}),jsxRuntime.jsxs("div",{className:"bf-video-meta",children:[o.videoPreviewLabel," (",X(e.video.durationMs),", ",Mo(e.video.sizeBytes),")"]})]}),e.phase==="capturing"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),o.capturingText]}),e.phase==="submitting"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),o.submittingText]}),e.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:o.successText}),e.phase==="error"&&be&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:be}),jsxRuntime.jsxs("div",{className:"bf-actions",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i(),disabled:T,"aria-label":o.cancelButton,children:o.cancelButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:ee,disabled:T||f.trim().length===0,"aria-label":o.sendButton,children:o.sendButton})]})]}),s&&jsxRuntime.jsx("div",{className:"bf-watermark",children:jsxRuntime.jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),e.phase==="recording"&&jsxRuntime.jsxs("div",{className:`bf-recording-bar bf-pos-${l}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"bf-recording-bar-timer",children:[o.recordingText," ",X(e.recordingElapsedMs??0)," / ",X(ft)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>a.stopRecording(),"aria-label":o.stopRecordButton,children:o.stopRecordButton})]}),e.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:o.toastText}),J>0&&!gt&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>mt(true),"aria-label":"Dismiss",children:"\xD7"}),jsxRuntime.jsx("strong",{children:"Security Warning"}),J," potential secret",J>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Lo=react.forwardRef(function(e,a){let r={...e.config??{},blocfeed_id:e.blocfeed_id},[i,p]=react.useState(null),n=Bo(r.ui?.showOn),l=No(r.ui?.theme?.mode),o=!!r.diagnostics;react.useEffect(()=>{if(o)return chunkCU24MLER_cjs.r(r.diagnostics),()=>chunkCU24MLER_cjs.s()},[o]);let s=!!r.security;react.useEffect(()=>{s&&chunkCU24MLER_cjs.v(r.security);},[s]);let h=react.useRef(e.config?.metadata?.enrich);h.current=e.config?.metadata?.enrich;let z=react.useMemo(()=>{if(e.config)return {...e.config,metadata:{...e.config.metadata,enrich:async f=>{let S=h.current,b=S?await S(f):{},B=chunkCU24MLER_cjs.t(),v=chunkCU24MLER_cjs.w(),O=chunkCU24MLER_cjs.j();return {...b,...B.consoleLogs.length>0?{_consoleLogs:B.consoleLogs}:{},...B.networkErrors.length>0?{_networkErrors:B.networkErrors}:{},...v.findings.length>0?{_securityFindings:v.findings}:{},...O.length>0?{_clickEvents:O}:{}}}}}},[]);return react.useEffect(()=>{Ne();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",l);let S=r.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let b=r.ui?.theme;return b&&(b.accentColor&&f.style.setProperty("--bf-accent",b.accentColor),b.panelBackground&&f.style.setProperty("--bf-panel-bg",b.panelBackground),b.panelForeground&&f.style.setProperty("--bf-panel-fg",b.panelForeground),b.fontFamily&&f.style.setProperty("--bf-font",b.fontFamily)),document.body.appendChild(f),p(f),()=>{f.remove(),p(null);}},[r.ui?.zIndex,r.ui?.theme?.accentColor,r.ui?.theme?.panelBackground,r.ui?.theme?.panelForeground,r.ui?.theme?.fontFamily,l]),react.useEffect(()=>{i&&i.setAttribute("data-bf-theme",l);},[i,l]),!n||!i?null:reactDom.createPortal(jsxRuntime.jsx(re,{blocfeed_id:r.blocfeed_id,...z?{config:z}:{},children:jsxRuntime.jsx(zo,{config:r,handleRef:a})}),i)});
|
|
846
|
+
exports.BlocFeedProvider=re;exports.BlocFeedWidget=Lo;exports.useBlocFeed=ie;
|
package/dist/main.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-
|
|
2
|
-
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, W as WidgetPosition } from './controller-
|
|
1
|
+
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-97Hd8v8C.cjs';
|
|
2
|
+
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, G as VoiceConfig, W as WidgetPosition } from './controller-97Hd8v8C.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-
|
|
2
|
-
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, W as WidgetPosition } from './controller-
|
|
1
|
+
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-97Hd8v8C.js';
|
|
2
|
+
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, G as VoiceConfig, W as WidgetPosition } from './controller-97Hd8v8C.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import {r,s,v,t,w as w$1,j,a,q,l,n,i,b}from'./chunk-JZW5QQ6Q.js';import {createContext,forwardRef,useState,useEffect,useRef,useMemo,useImperativeHandle,useCallback,useContext}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';import {AnimatePresence,motion}from'framer-motion';var Y=createContext(null);function re(t){let e=useMemo(()=>q({...t.config??{},blocfeed_id:t.blocfeed_id}),[]),[a,r]=useState(()=>e.getState());return useEffect(()=>e.subscribe(r),[e]),useEffect(()=>e.setConfig({...t.config??{},blocfeed_id:t.blocfeed_id}),[e,t.config,t.blocfeed_id]),useEffect(()=>()=>e.destroy(),[e]),jsx(Y.Provider,{value:{controller:e,state:a},children:t.children})}var Be="blocfeed-styles-v1",Ft=`
|
|
3
3
|
:where([data-blocfeed-ui-root]),
|
|
4
4
|
:where([data-blocfeed-ui-root]) * {
|
|
5
5
|
box-sizing: border-box;
|
|
@@ -637,6 +637,45 @@ import {o,p,s,q,t,j,a,n,l,i,b}from'./chunk-QL6DSCNT.js';import {createContext,fo
|
|
|
637
637
|
cursor: not-allowed;
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
/* ---- Voice feedback button ---- */
|
|
641
|
+
|
|
642
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn {
|
|
643
|
+
display: inline-flex;
|
|
644
|
+
align-items: center;
|
|
645
|
+
gap: 6px;
|
|
646
|
+
padding: 6px 12px;
|
|
647
|
+
border-radius: 6px;
|
|
648
|
+
border: 1px solid var(--bf-border);
|
|
649
|
+
background: transparent;
|
|
650
|
+
color: var(--bf-panel-fg);
|
|
651
|
+
font-size: 13px;
|
|
652
|
+
cursor: pointer;
|
|
653
|
+
transition: background 0.15s, border-color 0.15s;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn:hover {
|
|
657
|
+
background: rgba(128,128,128,0.1);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn:focus-visible {
|
|
661
|
+
outline: 2px solid var(--bf-accent);
|
|
662
|
+
outline-offset: 2px;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn[disabled] {
|
|
666
|
+
opacity: 0.6;
|
|
667
|
+
cursor: not-allowed;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
:where([data-blocfeed-ui-root]) .bf-voice-btn-active {
|
|
671
|
+
border-color: var(--bf-danger);
|
|
672
|
+
color: var(--bf-danger);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
:where([data-blocfeed-ui-root]) .bf-mic-icon {
|
|
676
|
+
flex-shrink: 0;
|
|
677
|
+
}
|
|
678
|
+
|
|
640
679
|
:where([data-blocfeed-ui-root]) .bf-recording-indicator {
|
|
641
680
|
display: flex;
|
|
642
681
|
align-items: center;
|
|
@@ -803,5 +842,5 @@ import {o,p,s,q,t,j,a,n,l,i,b}from'./chunk-QL6DSCNT.js';import {createContext,fo
|
|
|
803
842
|
animation: none;
|
|
804
843
|
}
|
|
805
844
|
}
|
|
806
|
-
`;function Se(){if(!a()||document.getElementById(Te))return;let e=document.createElement("style");e.id=Te,e.textContent=Tt,document.head.appendChild(e);}var Pe={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"};function Ce(e){return e?{...Pe,...e}:Pe}function oe(){let e=useContext(U);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}}function v(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 g({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 Ee({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 Be({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 Ne({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){return i?jsxs("button",{className:v(e),type:"button",onClick:t,"aria-label":o,children:[l?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]}):null}function m(){let[e,t]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=a=>t(a.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}var Nt={duration:.18,ease:"easeOut"},Rt={duration:0};function Me({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Rt:Nt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:r?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"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:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"dot")})}var At={duration:.18,ease:"easeOut"},Le={duration:0};function Ie({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Le:At;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.div,{className:v(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.div,{initial:{opacity:0,y:r?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:r?0:4},transition:s,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:o},"tooltip")}),jsxs(motion.button,{type:"button",onClick:t,"aria-label":o,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:r?{}:{y:[0,-3,0]},transition:r?Le:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:16})},"success"):jsx(Ee,{size:16}),a>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var _t={duration:.2,ease:"easeOut"},Ht={duration:0};function _e(e){return e==="bottom-left"||e==="top-left"}function Ot(e){return `bf-trigger-edge ${_e(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function He({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=_e(e),s=m(),h=s?Ht:_t;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:Ot(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:s||n?0:r?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&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}}),o]}),jsx(motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[r?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"edge-tab")})}var Kt={duration:.18,ease:"easeOut"},Vt={duration:0};function De({delay:e,hovered:t,reduced:i}){return i?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 Ke({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Vt:Kt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{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(De,{delay:0,hovered:n,reduced:r}),jsx(De,{delay:.7,hovered:n,reduced:r}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"pulse-ring")})}var Gt={duration:.18,ease:"easeOut"},jt={duration:0};function Qt(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 Xe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?jt:Gt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.button,{className:Qt(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:r?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:r?0:5},transition:s,whileTap:{scale:.95},children:[l?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:o}),a>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${a} queued`,children:a})]}),!r&&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:n?1:0},transition:s})]},"minimal")})}var Zt={duration:.18,ease:"easeOut"},eo={duration:0};function Ge({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?eo:Zt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:r?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||r?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(Be,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"icon-pop")})}var ao={duration:.18,ease:"easeOut"},io={duration:0};function qe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?io:ao;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{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:r?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"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:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!r&&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:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"beacon")})}var po={duration:.18,ease:"easeOut"},fo={duration:0};function tt({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),[r,s]=useState(0),h=m(),M=h?fo:po,f=useRef(null);useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!i||n||h){s(n||h?o.length:0);return}let u=8,C=o.length*2+u*2,y=0;return f.current=setInterval(()=>{y=(y+1)%C,y<=o.length?s(y):y<=o.length+u?s(o.length):y<=o.length*2+u?s(o.length*2+u-y):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[i,n,h,o]);let S=o.slice(0,r);return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:M,whileTap:{scale:.95},style:{minWidth:"44px"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:M,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"typewriter")})}function ot(e){switch(e){case "dot":return Me;case "bubble":return Ie;case "edge-tab":return He;case "pulse-ring":return Ke;case "minimal":return Xe;case "icon-pop":return Ge;case "beacon":return qe;case "typewriter":return tt;default:return Ne}}function at(e,t,i){return Math.max(t,Math.min(i,e))}function ho(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=at(e.x,12,Math.max(12,a-t-12));let c=e.y+e.height+12,r=Math.max(12,e.y-240);return {top:c+240<=l?c:r,left:n}}function xo(e){let{rect:t}=e,i={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:i,"aria-hidden":"true"})}function yo(e){let t=useRef(null);return useEffect(()=>{if(!e||!t.current)return;t.current.querySelector(".bf-textarea")?.focus();let o=a=>{if(a.key!=="Tab"||!t.current)return;let l=t.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let n=l[0],c=l[l.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),c.focus()):!a.shiftKey&&document.activeElement===c&&(a.preventDefault(),n.focus());};return document.addEventListener("keydown",o,{capture:true}),()=>document.removeEventListener("keydown",o,{capture:true})},[e]),t}function vo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function wo(e){let[t,i]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let o=()=>i(window.location.pathname);window.addEventListener("popstate",o);let a=history.pushState,l=history.replaceState;return history.pushState=function(...n){a.apply(this,n),o();},history.replaceState=function(...n){l.apply(this,n),o();},()=>{window.removeEventListener("popstate",o),history.pushState=a,history.replaceState=l;}},[]),vo(e,t)}function ko(e){let[t,i]=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"){i(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),a=l=>i(l.matches?"dark":"light");return i(o.matches?"dark":"light"),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e]),t}var To=["bug","feature","ux","general"],So={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function re(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function Po(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Co(e){let{state:t$1,controller:i$1,start:o,stop:a,clearSelection:l$1,submit:n}=oe(),c=e.config.ui?.position,r=Ce(e.config.ui?.strings),s=e.config.ui?.branding!==false,[h,M]=useState(null),[f,S]=useState(""),[u,C]=useState(e.config.capture?.element??true),[y,O]=useState(e.config.capture?.fullPage??false),[nt,ie]=useState(null),[D,ne]=useState(void 0),se=e.config.ui?.categories??To,st=e.config.recording?.enabled===true&&l(),ct=e.config.recording?.maxDurationMs??3e4,[lt,dt]=useState(false),[Q,pt]=useState(0);useEffect(()=>{let d=window.setTimeout(()=>{let N=t();pt(N.findings.length);},500);return ()=>window.clearTimeout(d)},[]),useImperativeHandle(e.handleRef,()=>({open:o,close:a,submit:d=>n(d),startRecording:()=>i$1.startRecording(),stopRecording:()=>i$1.stopRecording(),get isOpen(){return t$1.phase!=="idle"}}),[o,a,n,i$1,t$1.phase]);let ce=t$1.phase==="review"||t$1.phase==="capturing"||t$1.phase==="submitting"||t$1.phase==="error"||t$1.phase==="success",ft=yo(ce),[ut,bt]=useState(0);useEffect(()=>{t$1.phase==="idle"&&bt(i());},[t$1.phase]);let[gt,le]=useState(false),de=useRef(t$1.phase);useEffect(()=>{if(de.current==="success"&&t$1.phase==="idle"){le(true);let d=window.setTimeout(()=>le(false),1500);return ()=>window.clearTimeout(d)}de.current=t$1.phase;},[t$1.phase]),useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",z=new Set(N.slice(0,-1)),fe=P=>{let xt=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(z.has("mod")){if(xt?!P.metaKey:!P.ctrlKey)return}else if(z.has("ctrl")&&!P.ctrlKey||(z.has("meta")||z.has("cmd"))&&!P.metaKey)return;z.has("shift")&&!P.shiftKey||(z.has("alt")||z.has("option"))&&!P.altKey||P.key.toLowerCase()===W&&(P.preventDefault(),t$1.phase==="idle"?o():a());};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[e.config.ui?.shortcut,t$1.phase,o,a]),useEffect(()=>i$1.subscribeHover(M),[i$1]),useEffect(()=>{let d=i$1.__unsafeGetSelectedElement();if(!d||t$1.phase==="idle"||t$1.phase==="picking"){ie(null);return}let N=()=>{ie(b(d.getBoundingClientRect()));};N();let W=()=>N();return window.addEventListener("scroll",W,{capture:true,passive:true}),window.addEventListener("resize",W,{passive:true}),()=>{window.removeEventListener("scroll",W,{capture:true}),window.removeEventListener("resize",W);}},[i$1,t$1.phase,t$1.selection?.selector]),useEffect(()=>{t$1.phase==="review"&&(S(""),C(e.config.capture?.element??true),O(e.config.capture?.fullPage??false),ne(void 0));},[t$1.phase,t$1.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),useEffect(()=>{if(t$1.phase!=="success")return;let d=window.setTimeout(()=>a(),1200);return ()=>window.clearTimeout(d)},[t$1.phase,a]);let k=t$1.phase==="capturing"||t$1.phase==="submitting",F=t$1.phase==="picking"?h?.rect??null:nt??t$1.selection?.rect??null,q=useMemo(()=>F?ho(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t$1.lastError?.message,J=useCallback(()=>{let d={capture:{element:u,fullPage:y}};D&&(d.category=D),n(f,d);},[n,f,u,y,D]),mt=useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),J());},[J,f,k]),ht=ot(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(ht,{position:c,onClick:()=>o(),isVisible:t$1.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ut,showSuccess:gt}),t$1.phase!=="idle"&&t$1.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t$1.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsx(xo,{rect:F}),t$1.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:r.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r.cancelButton,children:r.cancelButton})]}),ce&&q&&jsxs("div",{ref:ft,className:"bf-panel",style:{left:q.left,top:q.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:r.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>l$1(),disabled:k,"aria-label":r.rePickButton,children:r.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.closeButton,children:r.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:r.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:mt,disabled:k,"aria-label":r.panelTitle}),se.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:se.map(d=>jsx("button",{type:"button",className:`bf-pill${D===d?" bf-pill-active":""}`,onClick:()=>ne(D===d?void 0:d),disabled:k,children:r[So[d]]},d))}),jsxs("div",{className:"bf-row",role:"group","aria-label":r.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:y,onChange:d=>O(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),st&&t$1.phase==="review"&&!t$1.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i$1.startRecording(),disabled:k,"aria-label":r.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r.recordButton]}),t$1.video&&t$1.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t$1.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i$1.removeVideo(),"aria-label":r.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[r.videoPreviewLabel," (",re(t$1.video.durationMs),", ",Po(t$1.video.sizeBytes),")"]})]}),t$1.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.capturingText]}),t$1.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.submittingText]}),t$1.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r.successText}),t$1.phase==="error"&&pe&&jsx("div",{className:"bf-error",role:"alert",children:pe}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.cancelButton,children:r.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:J,disabled:k||f.trim().length===0,"aria-label":r.sendButton,children:r.sendButton})]})]}),s&&jsx("div",{className:"bf-watermark",children:jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t$1.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:[r.recordingText," ",re(t$1.recordingElapsedMs??0)," / ",re(ct)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>i$1.stopRecording(),"aria-label":r.stopRecordButton,children:r.stopRecordButton})]}),t$1.phase==="success"&&jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r.toastText}),Q>0&&!lt&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>dt(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),Q," potential secret",Q>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Eo=forwardRef(function(t$1,i){let o$1={...t$1.config??{},blocfeed_id:t$1.blocfeed_id},[a,l]=useState(null),n=wo(o$1.ui?.showOn),c=ko(o$1.ui?.theme?.mode),r=!!o$1.diagnostics;useEffect(()=>{if(r)return o(o$1.diagnostics),()=>p()},[r]);let s$1=!!o$1.security;useEffect(()=>{s$1&&s(o$1.security);},[s$1]);let h=useRef(t$1.config?.metadata?.enrich);h.current=t$1.config?.metadata?.enrich;let M=useMemo(()=>{if(t$1.config)return {...t$1.config,metadata:{...t$1.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=q(),y=t(),O=j();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{},...O.length>0?{_clickEvents:O}:{}}}}}},[]);return useEffect(()=>{Se();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",c);let S=o$1.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let u=o$1.ui?.theme;return u&&(u.accentColor&&f.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&f.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&f.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&f.style.setProperty("--bf-font",u.fontFamily)),document.body.appendChild(f),l(f),()=>{f.remove(),l(null);}},[o$1.ui?.zIndex,o$1.ui?.theme?.accentColor,o$1.ui?.theme?.panelBackground,o$1.ui?.theme?.panelForeground,o$1.ui?.theme?.fontFamily,c]),useEffect(()=>{a&&a.setAttribute("data-bf-theme",c);},[a,c]),!n||!a?null:createPortal(jsx(te,{blocfeed_id:o$1.blocfeed_id,...M?{config:M}:{},children:jsx(Co,{config:o$1,handleRef:i})}),a)});
|
|
807
|
-
export{
|
|
845
|
+
`;function Ne(){if(!a()||document.getElementById(Be))return;let t=document.createElement("style");t.id=Be,t.textContent=Ft,document.head.appendChild(t);}var Fe={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 Re(t){return t?{...Fe,...t}:Fe}function ie(){let t=useContext(Y);if(!t)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:t.state,controller:t.controller,start:t.controller.start,stop:t.controller.stop,clearSelection:t.controller.clearSelection,submit:t.controller.submit,startRecording:t.controller.startRecording,stopRecording:t.controller.stopRecording,removeVideo:t.controller.removeVideo}}function w(t){switch(t){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 g({size:t=14}){return jsx("svg",{width:t,height:t,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 Me({size:t=14}){return jsx("svg",{width:t,height:t,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 ze({size:t=16}){return jsxs("svg",{width:t,height:t,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 Ae({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){return a?jsxs("button",{className:w(t),type:"button",onClick:e,"aria-label":r,children:[p?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),r]}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]}):null}function m(){let[t,e]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let a=window.matchMedia("(prefers-reduced-motion: reduce)"),r=i=>e(i.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),t}var Wt={duration:.18,ease:"easeOut"},_t={duration:0};function We({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=m(),s=o?_t:Wt;return jsx(AnimatePresence,{mode:"wait",children:a&&jsx(motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:o?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"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:n||o?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:o?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"dot")})}var Vt={duration:.18,ease:"easeOut"},He={duration:0};function De({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=m(),s=o?He:Vt;return jsx(AnimatePresence,{mode:"wait",children:a&&jsxs(motion.div,{className:w(t),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.div,{initial:{opacity:0,y:o?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:o?0:4},transition:s,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:e,"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:o?{}:{y:[0,-3,0]},transition:o?He:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:16})},"success"):jsx(Me,{size:16}),i>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${i} queued`,children:i})]})]},"bubble")})}var Ut={duration:.2,ease:"easeOut"},Xt={duration:0};function $e(t){return t==="bottom-left"||t==="top-left"}function Yt(t){return `bf-trigger-edge ${$e(t)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function Ke({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=$e(t),s=m(),h=s?Xt:Ut;return jsx(AnimatePresence,{mode:"wait",children:a&&jsx(motion.button,{className:Yt(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:s||n?0:o?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&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:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[o?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"edge-tab")})}var Qt={duration:.18,ease:"easeOut"},qt={duration:0};function Xe({delay:t,hovered:e,reduced:a}){return a?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:e?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:e?{duration:.15}:{duration:2,repeat:1/0,delay:t,ease:"easeOut"}})}function Ge({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=m(),s=o?qt:Qt;return jsx(AnimatePresence,{mode:"wait",children:a&&jsx(motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{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(Xe,{delay:0,hovered:n,reduced:o}),jsx(Xe,{delay:.7,hovered:n,reduced:o}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:o?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"pulse-ring")})}var to={duration:.18,ease:"easeOut"},oo={duration:0};function ro(t){switch(t){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 qe({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=m(),s=o?oo:to;return jsx(AnimatePresence,{mode:"wait",children:a&&jsxs(motion.button,{className:ro(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{opacity:0,y:o?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:o?0:5},transition:s,whileTap:{scale:.95},children:[p?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:r}),i>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${i} queued`,children:i})]}),!o&&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:n?1:0},transition:s})]},"minimal")})}var no={duration:.18,ease:"easeOut"},so={duration:0};function Ze({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=m(),s=o?so:no;return jsx(AnimatePresence,{mode:"wait",children:a&&jsx(motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:o?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||o?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(ze,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:o?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"icon-pop")})}var fo={duration:.18,ease:"easeOut"},uo={duration:0};function ot({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),o=m(),s=o?uo:fo;return jsx(AnimatePresence,{mode:"wait",children:a&&jsx(motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{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:o?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"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:n||o?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!o&&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:n&&jsx(motion.span,{initial:{opacity:0,x:o?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:o?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:r},"label")}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"beacon")})}var xo={duration:.18,ease:"easeOut"},vo={duration:0};function nt({position:t,onClick:e,isVisible:a,label:r,queueCount:i,showSuccess:p}){let[n,l]=useState(false),[o,s]=useState(0),h=m(),z=h?vo:xo,f=useRef(null);useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!a||n||h){s(n||h?r.length:0);return}let b=8,B=r.length*2+b*2,v=0;return f.current=setInterval(()=>{v=(v+1)%B,v<=r.length?s(v):v<=r.length+b?s(r.length):v<=r.length*2+b?s(r.length*2+b-v):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[a,n,h,r]);let S=r.slice(0,o);return jsx(AnimatePresence,{mode:"wait",children:a&&jsx(motion.button,{className:w(t),type:"button",onClick:e,onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),"aria-label":r,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:z,whileTap:{scale:.95},style:{minWidth:"44px"},children:p?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:z,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),i>0&&jsx("span",{className:"bf-badge","aria-label":`${i} queued`,children:i})]})},"typewriter")})}function st(t){switch(t){case "dot":return We;case "bubble":return De;case "edge-tab":return Ke;case "pulse-ring":return Ge;case "minimal":return qe;case "icon-pop":return Ze;case "beacon":return ot;case "typewriter":return nt;default:return Ae}}function ct(t,e,a){return Math.max(e,Math.min(a,t))}function So(t,e,a="bottom-right"){let i=window.innerWidth,p=window.innerHeight,n;n=ct(t.x,12,Math.max(12,i-e-12));let l=t.y+t.height+12,o=Math.max(12,t.y-240);return {top:l+240<=p?l:o,left:n}}function Eo(t){let{rect:e}=t,a={left:`${e.x}px`,top:`${e.y}px`,width:`${Math.max(0,e.width)}px`,height:`${Math.max(0,e.height)}px`};return jsx("div",{className:"bf-highlight",style:a,"aria-hidden":"true"})}function Co(t){let e=useRef(null);return useEffect(()=>{if(!t||!e.current)return;e.current.querySelector(".bf-textarea")?.focus();let r=i=>{if(i.key!=="Tab"||!e.current)return;let p=e.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(p.length===0)return;let n=p[0],l=p[p.length-1];i.shiftKey&&document.activeElement===n?(i.preventDefault(),l.focus()):!i.shiftKey&&document.activeElement===l&&(i.preventDefault(),n.focus());};return document.addEventListener("keydown",r,{capture:true}),()=>document.removeEventListener("keydown",r,{capture:true})},[t]),e}function Po(t,e){return t?typeof t=="function"?t(e):t.some(a=>a.endsWith("*")?e.startsWith(a.slice(0,-1)):e===a):true}function Bo(t){let[e,a]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let r=()=>a(window.location.pathname);window.addEventListener("popstate",r);let i=history.pushState,p=history.replaceState;return history.pushState=function(...n){i.apply(this,n),r();},history.replaceState=function(...n){p.apply(this,n),r();},()=>{window.removeEventListener("popstate",r),history.pushState=i,history.replaceState=p;}},[]),Po(t,e)}function No(t){let[e,a]=useState(()=>!t||t==="dark"?"dark":t==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return useEffect(()=>{if(t!=="auto"){a(t==="light"?"light":"dark");return}let r=window.matchMedia("(prefers-color-scheme: dark)"),i=p=>a(p.matches?"dark":"light");return a(r.matches?"dark":"light"),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[t]),e}var Fo=["bug","feature","ux","general"],Ro={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function X(t){let e=Math.floor(t/1e3),a=Math.floor(e/60),r=e%60;return `${a}:${String(r).padStart(2,"0")}`}function Mo(t){return t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function zo(t){let{state:e,controller:a,start:r,stop:i$1,clearSelection:p,submit:n$1}=ie(),l$1=t.config.ui?.position,o=Re(t.config.ui?.strings),s=t.config.ui?.branding!==false,[h,z]=useState(null),[f,S]=useState(""),[b$1,B]=useState(t.config.capture?.element??true),[v,O]=useState(t.config.capture?.fullPage??false),[dt,ce]=useState(null),[D,le]=useState(void 0),de=t.config.ui?.categories??Fo,pt=t.config.recording?.enabled===true&&l(),ft=t.config.recording?.maxDurationMs??3e4,ut=t.config.voice?.enabled===true&&n(),bt=t.config.voice?.maxDurationMs??6e4,[gt,mt]=useState(false),[J,ht]=useState(0);useEffect(()=>{let d=window.setTimeout(()=>{let y=w$1();ht(y.findings.length);},500);return ()=>window.clearTimeout(d)},[]),useImperativeHandle(t.handleRef,()=>({open:r,close:i$1,submit:d=>n$1(d),startRecording:()=>a.startRecording(),stopRecording:()=>a.stopRecording(),get isOpen(){return e.phase!=="idle"}}),[r,i$1,n$1,a,e.phase]);let pe=e.phase==="review"||e.phase==="capturing"||e.phase==="submitting"||e.phase==="error"||e.phase==="success",xt=Co(pe),[vt,yt]=useState(0);useEffect(()=>{e.phase==="idle"&&yt(i());},[e.phase]);let[wt,fe]=useState(false),ue=useRef(e.phase);useEffect(()=>{if(ue.current==="success"&&e.phase==="idle"){fe(true);let d=window.setTimeout(()=>fe(false),1500);return ()=>window.clearTimeout(d)}ue.current=e.phase;},[e.phase]),useEffect(()=>{let d=t.config.ui?.shortcut;if(!d)return;let y=d.toLowerCase().split("+").map(P=>P.trim()),C=y[y.length-1]||"",L=new Set(y.slice(0,-1)),me=P=>{let Et=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(L.has("mod")){if(Et?!P.metaKey:!P.ctrlKey)return}else if(L.has("ctrl")&&!P.ctrlKey||(L.has("meta")||L.has("cmd"))&&!P.metaKey)return;L.has("shift")&&!P.shiftKey||(L.has("alt")||L.has("option"))&&!P.altKey||P.key.toLowerCase()===C&&(P.preventDefault(),e.phase==="idle"?r():i$1());};return document.addEventListener("keydown",me),()=>document.removeEventListener("keydown",me)},[t.config.ui?.shortcut,e.phase,r,i$1]),useEffect(()=>a.subscribeHover(z),[a]),useEffect(()=>{let d=a.__unsafeGetSelectedElement();if(!d||e.phase==="idle"||e.phase==="picking"){ce(null);return}let y=()=>{ce(b(d.getBoundingClientRect()));};y();let C=()=>y();return window.addEventListener("scroll",C,{capture:true,passive:true}),window.addEventListener("resize",C,{passive:true}),()=>{window.removeEventListener("scroll",C,{capture:true}),window.removeEventListener("resize",C);}},[a,e.phase,e.selection?.selector]),useEffect(()=>{e.phase==="review"&&(S(""),B(t.config.capture?.element??true),O(t.config.capture?.fullPage??false),le(void 0),V(null));},[e.phase,e.selection?.selector,t.config.capture?.element,t.config.capture?.fullPage]),useEffect(()=>{if(e.phase!=="success")return;let d=window.setTimeout(()=>i$1(),1200);return ()=>window.clearTimeout(d)},[e.phase,i$1]);let T=e.phase==="capturing"||e.phase==="submitting",R=e.phase==="picking"?h?.rect??null:dt??e.selection?.rect??null,Z=useMemo(()=>R?So(R,360,l$1):null,[R?.x,R?.y,R?.width,R?.height,l$1]),be=e.lastError?.message,ee=useCallback(()=>{let d={capture:{element:b$1,fullPage:v}};D&&(d.category=D),n$1(f,d);},[n$1,f,b$1,v,D]),kt=useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!T&&(d.preventDefault(),ee());},[ee,f,T]),[ge,V]=useState(null),Tt=useCallback(async()=>{if(e.voiceRecording){a.stopVoice();return}V(null);let d=await a.startVoice();if(d?.text)S(y=>y?y+" "+d.text:d.text);else if(d?.warning)V(o.voiceEmptyText);else if(!d){let y=a.getState().lastError;if(y){let C=y.message?.toLowerCase()??"";C.includes("denied")||C.includes("permission")||C.includes("not allowed")?V(o.voiceDeniedText):V(o.voiceErrorText);}}},[e.voiceRecording,a,o]),St=st(t.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(St,{position:l$1,onClick:()=>r(),isVisible:e.phase==="idle",label:t.config.ui?.triggerLabel??o.triggerLabel,queueCount:vt,showSuccess:wt}),e.phase!=="idle"&&e.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[e.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>i$1()}),R&&jsx(Eo,{rect:R}),e.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:o.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>i$1(),"aria-label":o.cancelButton,children:o.cancelButton})]}),pe&&Z&&jsxs("div",{ref:xt,className:"bf-panel",style:{left:Z.left,top:Z.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:o.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>p(),disabled:T,"aria-label":o.rePickButton,children:o.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>i$1(),disabled:T,"aria-label":o.closeButton,children:o.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:o.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:kt,disabled:T,"aria-label":o.panelTitle}),de.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:de.map(d=>jsx("button",{type:"button",className:`bf-pill${D===d?" bf-pill-active":""}`,onClick:()=>le(D===d?void 0:d),disabled:T,children:o[Ro[d]]},d))}),jsxs("div",{className:"bf-row",role:"group","aria-label":o.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:b$1,onChange:d=>B(d.target.checked),disabled:T}),o.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:v,onChange:d=>O(d.target.checked),disabled:T}),o.screenshotFullPage]})]}),ut&&e.phase==="review"&&!e.voiceTranscribing&&jsx("button",{type:"button",className:`bf-voice-btn${e.voiceRecording?" bf-voice-btn-active":""}`,onClick:Tt,disabled:T,"aria-label":e.voiceRecording?o.voiceStopButton:o.voiceButton,children:e.voiceRecording?jsxs(Fragment,{children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),o.voiceRecordingText," ",X(e.voiceElapsedMs??0)," / ",X(bt)," \u2014 ",o.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"})]}),o.voiceButton]})}),e.voiceTranscribing&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),o.voiceTranscribingText]}),ge&&!e.voiceRecording&&!e.voiceTranscribing&&jsx("div",{className:"bf-error",role:"alert",children:ge}),pt&&e.phase==="review"&&!e.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>a.startRecording(),disabled:T,"aria-label":o.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),o.recordButton]}),e.video&&e.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:e.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>a.removeVideo(),"aria-label":o.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[o.videoPreviewLabel," (",X(e.video.durationMs),", ",Mo(e.video.sizeBytes),")"]})]}),e.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),o.capturingText]}),e.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),o.submittingText]}),e.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:o.successText}),e.phase==="error"&&be&&jsx("div",{className:"bf-error",role:"alert",children:be}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>i$1(),disabled:T,"aria-label":o.cancelButton,children:o.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:ee,disabled:T||f.trim().length===0,"aria-label":o.sendButton,children:o.sendButton})]})]}),s&&jsx("div",{className:"bf-watermark",children:jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),e.phase==="recording"&&jsxs("div",{className:`bf-recording-bar bf-pos-${l$1}`,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:[o.recordingText," ",X(e.recordingElapsedMs??0)," / ",X(ft)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>a.stopRecording(),"aria-label":o.stopRecordButton,children:o.stopRecordButton})]}),e.phase==="success"&&jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:o.toastText}),J>0&&!gt&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>mt(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),J," potential secret",J>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Lo=forwardRef(function(e,a){let r$1={...e.config??{},blocfeed_id:e.blocfeed_id},[i,p]=useState(null),n=Bo(r$1.ui?.showOn),l=No(r$1.ui?.theme?.mode),o=!!r$1.diagnostics;useEffect(()=>{if(o)return r(r$1.diagnostics),()=>s()},[o]);let s$1=!!r$1.security;useEffect(()=>{s$1&&v(r$1.security);},[s$1]);let h=useRef(e.config?.metadata?.enrich);h.current=e.config?.metadata?.enrich;let z=useMemo(()=>{if(e.config)return {...e.config,metadata:{...e.config.metadata,enrich:async f=>{let S=h.current,b=S?await S(f):{},B=t(),v=w$1(),O=j();return {...b,...B.consoleLogs.length>0?{_consoleLogs:B.consoleLogs}:{},...B.networkErrors.length>0?{_networkErrors:B.networkErrors}:{},...v.findings.length>0?{_securityFindings:v.findings}:{},...O.length>0?{_clickEvents:O}:{}}}}}},[]);return useEffect(()=>{Ne();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",l);let S=r$1.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let b=r$1.ui?.theme;return b&&(b.accentColor&&f.style.setProperty("--bf-accent",b.accentColor),b.panelBackground&&f.style.setProperty("--bf-panel-bg",b.panelBackground),b.panelForeground&&f.style.setProperty("--bf-panel-fg",b.panelForeground),b.fontFamily&&f.style.setProperty("--bf-font",b.fontFamily)),document.body.appendChild(f),p(f),()=>{f.remove(),p(null);}},[r$1.ui?.zIndex,r$1.ui?.theme?.accentColor,r$1.ui?.theme?.panelBackground,r$1.ui?.theme?.panelForeground,r$1.ui?.theme?.fontFamily,l]),useEffect(()=>{i&&i.setAttribute("data-bf-theme",l);},[i,l]),!n||!i?null:createPortal(jsx(re,{blocfeed_id:r$1.blocfeed_id,...z?{config:z}:{},children:jsx(zo,{config:r$1,handleRef:a})}),i)});
|
|
846
|
+
export{re as BlocFeedProvider,Lo as BlocFeedWidget,ie as useBlocFeed};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blocfeed",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Drop-in feedback widget for React — element picking, screenshots, and
|
|
3
|
+
"version": "0.10.1",
|
|
4
|
+
"description": "Drop-in feedback widget for React — element picking, screenshots, video recording, and voice feedback.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
"screen-capture",
|
|
16
16
|
"bug-report",
|
|
17
17
|
"product-feedback",
|
|
18
|
-
"element-picker"
|
|
18
|
+
"element-picker",
|
|
19
|
+
"voice-feedback",
|
|
20
|
+
"speech-to-text",
|
|
21
|
+
"transcription"
|
|
19
22
|
],
|
|
20
23
|
"publishConfig": {
|
|
21
24
|
"access": "public"
|