blocfeed 0.8.0 → 0.8.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.1 — 2026-02-24
4
+
5
+ ### Bug fixes
6
+
7
+ - **Recording flow: widget no longer closes when clicking the page** — During video recording, the overlay and backdrop are removed so users can freely interact with the page to demonstrate bugs. The full panel collapses into a compact floating recording bar (pulsing dot + timer + stop button) positioned at the widget corner. When recording stops, the panel re-opens with the video preview attached.
8
+
9
+ ---
10
+
3
11
  ## 0.8.0 — 2026-02-24
4
12
 
5
13
  ### New features
package/dist/main.cjs CHANGED
@@ -705,6 +705,70 @@
705
705
  padding: 4px 8px;
706
706
  }
707
707
 
708
+ /* ------------------------------------------------------------------ */
709
+ /* Floating recording bar (shown during active recording) */
710
+ /* ------------------------------------------------------------------ */
711
+
712
+ :where([data-blocfeed-ui-root]) .bf-recording-bar {
713
+ position: fixed;
714
+ z-index: var(--bf-z);
715
+ display: flex;
716
+ align-items: center;
717
+ gap: 10px;
718
+ padding: 8px 14px;
719
+ border-radius: 20px;
720
+ background: var(--bf-bg);
721
+ border: 1px solid var(--bf-danger);
722
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.25);
723
+ font-size: 13px;
724
+ color: var(--bf-fg);
725
+ pointer-events: auto;
726
+ animation: bf-slideUp 0.2s ease-out;
727
+ }
728
+
729
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-right {
730
+ bottom: 24px;
731
+ right: 24px;
732
+ }
733
+
734
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-left {
735
+ bottom: 24px;
736
+ left: 24px;
737
+ }
738
+
739
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-right {
740
+ top: 24px;
741
+ right: 24px;
742
+ }
743
+
744
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-left {
745
+ top: 24px;
746
+ left: 24px;
747
+ }
748
+
749
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-timer {
750
+ color: var(--bf-danger);
751
+ font-weight: 500;
752
+ font-variant-numeric: tabular-nums;
753
+ }
754
+
755
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-stop {
756
+ padding: 4px 12px;
757
+ border-radius: 12px;
758
+ border: 1px solid var(--bf-danger);
759
+ background: transparent;
760
+ color: var(--bf-danger);
761
+ font-size: 12px;
762
+ font-weight: 600;
763
+ cursor: pointer;
764
+ transition: background 0.15s, color 0.15s;
765
+ }
766
+
767
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-stop:hover {
768
+ background: var(--bf-danger);
769
+ color: #fff;
770
+ }
771
+
708
772
  /* ------------------------------------------------------------------ */
709
773
  /* Watermark */
710
774
  /* ------------------------------------------------------------------ */
@@ -734,9 +798,10 @@
734
798
  :where([data-blocfeed-ui-root]) .bf-toast,
735
799
  :where([data-blocfeed-ui-root]) .bf-hint,
736
800
  :where([data-blocfeed-ui-root]) .bf-cursor,
737
- :where([data-blocfeed-ui-root]) .bf-rec-dot-pulse {
801
+ :where([data-blocfeed-ui-root]) .bf-rec-dot-pulse,
802
+ :where([data-blocfeed-ui-root]) .bf-recording-bar {
738
803
  animation: none;
739
804
  }
740
805
  }
741
- `;function Te(){if(!chunkORVW2RTZ_cjs.a()||document.getElementById(ke))return;let e=document.createElement("style");e.id=ke,e.textContent=kt,document.head.appendChild(e);}var Se={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 Pe(e){return e?{...Se,...e}:Se}function te(){let e=react.useContext(V);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 Ce({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 Ee({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 Fe({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 Ft={duration:.18,ease:"easeOut"},Nt={duration:0};function Re({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Nt:Ft;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 zt={duration:.18,ease:"easeOut"},Le={duration:0};function Ae({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Le:zt;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(Ce,{size:16}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var Wt={duration:.2,ease:"easeOut"},_t={duration:0};function We(e){return e==="bottom-left"||e==="top-left"}function Ht(e){return `bf-trigger-edge ${We(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function _e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=We(e),s=m(),h=s?_t:Wt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:Ht(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 $t={duration:.18,ease:"easeOut"},Kt={duration:0};function Oe({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 $e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Kt:$t;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(Oe,{delay:0,hovered:n,reduced:r}),jsxRuntime.jsx(Oe,{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 Yt={duration:.18,ease:"easeOut"},Gt={duration:0};function jt(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 Ue({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Gt:Yt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.button,{className:jt(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 Jt={duration:.18,ease:"easeOut"},Zt={duration:0};function Ye({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Zt:Jt;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(Ee,{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 ro={duration:.18,ease:"easeOut"},ao={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?ao:ro;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 lo={duration:.18,ease:"easeOut"},po={duration:0};function et({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?po:lo,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 tt(e){switch(e){case "dot":return Re;case "bubble":return Ae;case "edge-tab":return _e;case "pulse-ring":return $e;case "minimal":return Ue;case "icon-pop":return Ye;case "beacon":return Qe;case "typewriter":return et;default:return Fe}}function rt(e,t,i){return Math.max(t,Math.min(i,e))}function mo(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=rt(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 ho(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 xo(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 yo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function vo(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;}},[]),yo(e,t)}function wo(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 ko=["bug","feature","ux","general"],To={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function oe(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function So(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Po(e){let{state:t,controller:i,start:o,stop:a,clearSelection:l,submit:n}=te(),c=e.config.ui?.position,r=Pe(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,ae]=react.useState(e.config.capture?.fullPage??false),[it,ie]=react.useState(null),[O,ne]=react.useState(void 0),se=e.config.ui?.categories??ko,nt=e.config.recording?.enabled===true&&chunkORVW2RTZ_cjs.j(),st=e.config.recording?.maxDurationMs??3e4,[ct,lt]=react.useState(false),[j,dt]=react.useState(0);react.useEffect(()=>{let d=window.setTimeout(()=>{let N=chunkORVW2RTZ_cjs.r();dt(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==="recording"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",pt=xo(ce),[ft,ut]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&ut(chunkORVW2RTZ_cjs.i());},[t.phase]);let[bt,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]||"",L=new Set(N.slice(0,-1)),fe=P=>{let ht=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(L.has("mod")){if(ht?!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()===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(chunkORVW2RTZ_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),ae(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"||t.phase==="recording",F=t.phase==="picking"?h?.rect??null:it??t.selection?.rect??null,Q=react.useMemo(()=>F?mo(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,q=react.useCallback(()=>{let d={capture:{element:u,fullPage:y}};O&&(d.category=O),n(f,d);},[n,f,u,y,O]),gt=react.useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),q());},[q,f,k]),mt=tt(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(mt,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ft,showSuccess:bt}),t.phase!=="idle"&&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(ho,{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:pt,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:gt,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${O===d?" bf-pill-active":""}`,onClick:()=>ne(O===d?void 0:d),disabled:k,children:r[To[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=>ae(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),nt&&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.phase==="recording"&&jsxRuntime.jsxs("div",{className:"bf-recording-indicator",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{children:[r.recordingText," ",oe(t.recordingElapsedMs??0)," / ",oe(st)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i.stopRecording(),"aria-label":r.stopRecordButton,children:r.stopRecordButton})]}),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," (",oe(t.video.durationMs),", ",So(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:q,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==="success"&&jsxRuntime.jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r.toastText}),j>0&&!ct&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>lt(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 Co=react.forwardRef(function(t,i){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=react.useState(null),n=vo(o.ui?.showOn),c=wo(o.ui?.theme?.mode),r=!!o.diagnostics;react.useEffect(()=>{if(r)return chunkORVW2RTZ_cjs.m(o.diagnostics),()=>chunkORVW2RTZ_cjs.n()},[r]);let s=!!o.security;react.useEffect(()=>{s&&chunkORVW2RTZ_cjs.q(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=chunkORVW2RTZ_cjs.o(),y=chunkORVW2RTZ_cjs.r();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{}}}}}},[]);return react.useEffect(()=>{Te();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(ee,{blocfeed_id:o.blocfeed_id,...M?{config:M}:{},children:jsxRuntime.jsx(Po,{config:o,handleRef:i})}),a)});
806
+ `;function Te(){if(!chunkORVW2RTZ_cjs.a()||document.getElementById(ke))return;let e=document.createElement("style");e.id=ke,e.textContent=kt,document.head.appendChild(e);}var Se={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 Pe(e){return e?{...Se,...e}:Se}function te(){let e=react.useContext(V);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 Ce({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 Ee({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 Fe({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 Ft={duration:.18,ease:"easeOut"},Nt={duration:0};function Re({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Nt:Ft;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 Lt={duration:.18,ease:"easeOut"},ze={duration:0};function Ae({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?ze:Lt;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?ze:{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(Ce,{size:16}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var Wt={duration:.2,ease:"easeOut"},_t={duration:0};function We(e){return e==="bottom-left"||e==="top-left"}function Ht(e){return `bf-trigger-edge ${We(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function _e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=We(e),s=m(),h=s?_t:Wt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:Ht(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 $t={duration:.18,ease:"easeOut"},Kt={duration:0};function Oe({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 $e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Kt:$t;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(Oe,{delay:0,hovered:n,reduced:r}),jsxRuntime.jsx(Oe,{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 Yt={duration:.18,ease:"easeOut"},Gt={duration:0};function jt(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 Ue({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Gt:Yt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.button,{className:jt(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 Jt={duration:.18,ease:"easeOut"},Zt={duration:0};function Ye({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Zt:Jt;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(Ee,{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 ro={duration:.18,ease:"easeOut"},ao={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?ao:ro;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 lo={duration:.18,ease:"easeOut"},po={duration:0};function et({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?po:lo,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 tt(e){switch(e){case "dot":return Re;case "bubble":return Ae;case "edge-tab":return _e;case "pulse-ring":return $e;case "minimal":return Ue;case "icon-pop":return Ye;case "beacon":return Qe;case "typewriter":return et;default:return Fe}}function rt(e,t,i){return Math.max(t,Math.min(i,e))}function mo(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=rt(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 ho(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 xo(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 yo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function vo(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;}},[]),yo(e,t)}function wo(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 ko=["bug","feature","ux","general"],To={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function oe(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function So(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Po(e){let{state:t,controller:i,start:o,stop:a,clearSelection:l,submit:n}=te(),c=e.config.ui?.position,r=Pe(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,ae]=react.useState(e.config.capture?.fullPage??false),[it,ie]=react.useState(null),[O,ne]=react.useState(void 0),se=e.config.ui?.categories??ko,nt=e.config.recording?.enabled===true&&chunkORVW2RTZ_cjs.j(),st=e.config.recording?.maxDurationMs??3e4,[ct,lt]=react.useState(false),[j,dt]=react.useState(0);react.useEffect(()=>{let d=window.setTimeout(()=>{let N=chunkORVW2RTZ_cjs.r();dt(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",pt=xo(ce),[ft,ut]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&ut(chunkORVW2RTZ_cjs.i());},[t.phase]);let[bt,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 ht=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(z.has("mod")){if(ht?!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(chunkORVW2RTZ_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),ae(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:it??t.selection?.rect??null,Q=react.useMemo(()=>F?mo(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,q=react.useCallback(()=>{let d={capture:{element:u,fullPage:y}};O&&(d.category=O),n(f,d);},[n,f,u,y,O]),gt=react.useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),q());},[q,f,k]),mt=tt(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(mt,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ft,showSuccess:bt}),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(ho,{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:pt,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:gt,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${O===d?" bf-pill-active":""}`,onClick:()=>ne(O===d?void 0:d),disabled:k,children:r[To[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=>ae(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),nt&&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," (",oe(t.video.durationMs),", ",So(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:q,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," ",oe(t.recordingElapsedMs??0)," / ",oe(st)]}),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}),j>0&&!ct&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>lt(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 Co=react.forwardRef(function(t,i){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=react.useState(null),n=vo(o.ui?.showOn),c=wo(o.ui?.theme?.mode),r=!!o.diagnostics;react.useEffect(()=>{if(r)return chunkORVW2RTZ_cjs.m(o.diagnostics),()=>chunkORVW2RTZ_cjs.n()},[r]);let s=!!o.security;react.useEffect(()=>{s&&chunkORVW2RTZ_cjs.q(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=chunkORVW2RTZ_cjs.o(),y=chunkORVW2RTZ_cjs.r();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{}}}}}},[]);return react.useEffect(()=>{Te();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(ee,{blocfeed_id:o.blocfeed_id,...M?{config:M}:{},children:jsxRuntime.jsx(Po,{config:o,handleRef:i})}),a)});
742
807
  exports.BlocFeedProvider=ee;exports.BlocFeedWidget=Co;exports.useBlocFeed=te;
package/dist/main.js CHANGED
@@ -705,6 +705,70 @@ import {m as m$1,n,q,o,r,a,l,j,i,b}from'./chunk-KJRV7PRA.js';import {createConte
705
705
  padding: 4px 8px;
706
706
  }
707
707
 
708
+ /* ------------------------------------------------------------------ */
709
+ /* Floating recording bar (shown during active recording) */
710
+ /* ------------------------------------------------------------------ */
711
+
712
+ :where([data-blocfeed-ui-root]) .bf-recording-bar {
713
+ position: fixed;
714
+ z-index: var(--bf-z);
715
+ display: flex;
716
+ align-items: center;
717
+ gap: 10px;
718
+ padding: 8px 14px;
719
+ border-radius: 20px;
720
+ background: var(--bf-bg);
721
+ border: 1px solid var(--bf-danger);
722
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.25);
723
+ font-size: 13px;
724
+ color: var(--bf-fg);
725
+ pointer-events: auto;
726
+ animation: bf-slideUp 0.2s ease-out;
727
+ }
728
+
729
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-right {
730
+ bottom: 24px;
731
+ right: 24px;
732
+ }
733
+
734
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-left {
735
+ bottom: 24px;
736
+ left: 24px;
737
+ }
738
+
739
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-right {
740
+ top: 24px;
741
+ right: 24px;
742
+ }
743
+
744
+ :where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-left {
745
+ top: 24px;
746
+ left: 24px;
747
+ }
748
+
749
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-timer {
750
+ color: var(--bf-danger);
751
+ font-weight: 500;
752
+ font-variant-numeric: tabular-nums;
753
+ }
754
+
755
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-stop {
756
+ padding: 4px 12px;
757
+ border-radius: 12px;
758
+ border: 1px solid var(--bf-danger);
759
+ background: transparent;
760
+ color: var(--bf-danger);
761
+ font-size: 12px;
762
+ font-weight: 600;
763
+ cursor: pointer;
764
+ transition: background 0.15s, color 0.15s;
765
+ }
766
+
767
+ :where([data-blocfeed-ui-root]) .bf-recording-bar-stop:hover {
768
+ background: var(--bf-danger);
769
+ color: #fff;
770
+ }
771
+
708
772
  /* ------------------------------------------------------------------ */
709
773
  /* Watermark */
710
774
  /* ------------------------------------------------------------------ */
@@ -734,9 +798,10 @@ import {m as m$1,n,q,o,r,a,l,j,i,b}from'./chunk-KJRV7PRA.js';import {createConte
734
798
  :where([data-blocfeed-ui-root]) .bf-toast,
735
799
  :where([data-blocfeed-ui-root]) .bf-hint,
736
800
  :where([data-blocfeed-ui-root]) .bf-cursor,
737
- :where([data-blocfeed-ui-root]) .bf-rec-dot-pulse {
801
+ :where([data-blocfeed-ui-root]) .bf-rec-dot-pulse,
802
+ :where([data-blocfeed-ui-root]) .bf-recording-bar {
738
803
  animation: none;
739
804
  }
740
805
  }
741
- `;function Te(){if(!a()||document.getElementById(ke))return;let e=document.createElement("style");e.id=ke,e.textContent=kt,document.head.appendChild(e);}var Se={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 Pe(e){return e?{...Se,...e}:Se}function te(){let e=useContext(V);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 Ce({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 Ee({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 Fe({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 Ft={duration:.18,ease:"easeOut"},Nt={duration:0};function Re({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Nt:Ft;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 zt={duration:.18,ease:"easeOut"},Le={duration:0};function Ae({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Le:zt;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(Ce,{size:16}),a>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var Wt={duration:.2,ease:"easeOut"},_t={duration:0};function We(e){return e==="bottom-left"||e==="top-left"}function Ht(e){return `bf-trigger-edge ${We(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function _e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=We(e),s=m(),h=s?_t:Wt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:Ht(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 $t={duration:.18,ease:"easeOut"},Kt={duration:0};function Oe({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 $e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Kt:$t;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(Oe,{delay:0,hovered:n,reduced:r}),jsx(Oe,{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 Yt={duration:.18,ease:"easeOut"},Gt={duration:0};function jt(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 Ue({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Gt:Yt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.button,{className:jt(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 Jt={duration:.18,ease:"easeOut"},Zt={duration:0};function Ye({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Zt:Jt;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(Ee,{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 ro={duration:.18,ease:"easeOut"},ao={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?ao:ro;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 lo={duration:.18,ease:"easeOut"},po={duration:0};function et({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?po:lo,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 tt(e){switch(e){case "dot":return Re;case "bubble":return Ae;case "edge-tab":return _e;case "pulse-ring":return $e;case "minimal":return Ue;case "icon-pop":return Ye;case "beacon":return Qe;case "typewriter":return et;default:return Fe}}function rt(e,t,i){return Math.max(t,Math.min(i,e))}function mo(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=rt(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 ho(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 xo(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 yo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function vo(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;}},[]),yo(e,t)}function wo(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 ko=["bug","feature","ux","general"],To={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function oe(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function So(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Po(e){let{state:t,controller:i$1,start:o,stop:a,clearSelection:l,submit:n}=te(),c=e.config.ui?.position,r$1=Pe(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,ae]=useState(e.config.capture?.fullPage??false),[it,ie]=useState(null),[O,ne]=useState(void 0),se=e.config.ui?.categories??ko,nt=e.config.recording?.enabled===true&&j(),st=e.config.recording?.maxDurationMs??3e4,[ct,lt]=useState(false),[j$1,dt]=useState(0);useEffect(()=>{let d=window.setTimeout(()=>{let N=r();dt(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.phase!=="idle"}}),[o,a,n,i$1,t.phase]);let ce=t.phase==="review"||t.phase==="recording"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",pt=xo(ce),[ft,ut]=useState(0);useEffect(()=>{t.phase==="idle"&&ut(i());},[t.phase]);let[bt,le]=useState(false),de=useRef(t.phase);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]),useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",L=new Set(N.slice(0,-1)),fe=P=>{let ht=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(L.has("mod")){if(ht?!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()===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]),useEffect(()=>i$1.subscribeHover(M),[i$1]),useEffect(()=>{let d=i$1.__unsafeGetSelectedElement();if(!d||t.phase==="idle"||t.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.phase,t.selection?.selector]),useEffect(()=>{t.phase==="review"&&(S(""),C(e.config.capture?.element??true),ae(e.config.capture?.fullPage??false),ne(void 0));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),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"||t.phase==="recording",F=t.phase==="picking"?h?.rect??null:it??t.selection?.rect??null,Q=useMemo(()=>F?mo(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,q=useCallback(()=>{let d={capture:{element:u,fullPage:y}};O&&(d.category=O),n(f,d);},[n,f,u,y,O]),gt=useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),q());},[q,f,k]),mt=tt(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(mt,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r$1.triggerLabel,queueCount:ft,showSuccess:bt}),t.phase!=="idle"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsx(ho,{rect:F}),t.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:r$1.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r$1.cancelButton,children:r$1.cancelButton})]}),ce&&Q&&jsxs("div",{ref:pt,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$1.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>l(),disabled:k,"aria-label":r$1.rePickButton,children:r$1.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r$1.closeButton,children:r$1.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:r$1.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:gt,disabled:k,"aria-label":r$1.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${O===d?" bf-pill-active":""}`,onClick:()=>ne(O===d?void 0:d),disabled:k,children:r$1[To[d]]},d))}),jsxs("div",{className:"bf-row",role:"group","aria-label":r$1.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r$1.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:y,onChange:d=>ae(d.target.checked),disabled:k}),r$1.screenshotFullPage]})]}),nt&&t.phase==="review"&&!t.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i$1.startRecording(),disabled:k,"aria-label":r$1.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r$1.recordButton]}),t.phase==="recording"&&jsxs("div",{className:"bf-recording-indicator",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{children:[r$1.recordingText," ",oe(t.recordingElapsedMs??0)," / ",oe(st)]}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>i$1.stopRecording(),"aria-label":r$1.stopRecordButton,children:r$1.stopRecordButton})]}),t.video&&t.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i$1.removeVideo(),"aria-label":r$1.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[r$1.videoPreviewLabel," (",oe(t.video.durationMs),", ",So(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r$1.capturingText]}),t.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r$1.submittingText]}),t.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r$1.successText}),t.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$1.cancelButton,children:r$1.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:q,disabled:k||f.trim().length===0,"aria-label":r$1.sendButton,children:r$1.sendButton})]})]}),s&&jsx("div",{className:"bf-watermark",children:jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t.phase==="success"&&jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r$1.toastText}),j$1>0&&!ct&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>lt(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),j$1," potential secret",j$1>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Co=forwardRef(function(t,i){let o$1={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=useState(null),n$1=vo(o$1.ui?.showOn),c=wo(o$1.ui?.theme?.mode),r$1=!!o$1.diagnostics;useEffect(()=>{if(r$1)return m$1(o$1.diagnostics),()=>n()},[r$1]);let s=!!o$1.security;useEffect(()=>{s&&q(o$1.security);},[s]);let h=useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let M=useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=o(),y=r();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{}}}}}},[]);return useEffect(()=>{Te();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$1||!a?null:createPortal(jsx(ee,{blocfeed_id:o$1.blocfeed_id,...M?{config:M}:{},children:jsx(Po,{config:o$1,handleRef:i})}),a)});
806
+ `;function Te(){if(!a()||document.getElementById(ke))return;let e=document.createElement("style");e.id=ke,e.textContent=kt,document.head.appendChild(e);}var Se={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 Pe(e){return e?{...Se,...e}:Se}function te(){let e=useContext(V);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 Ce({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 Ee({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 Fe({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 Ft={duration:.18,ease:"easeOut"},Nt={duration:0};function Re({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Nt:Ft;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 Lt={duration:.18,ease:"easeOut"},ze={duration:0};function Ae({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?ze:Lt;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?ze:{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(Ce,{size:16}),a>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var Wt={duration:.2,ease:"easeOut"},_t={duration:0};function We(e){return e==="bottom-left"||e==="top-left"}function Ht(e){return `bf-trigger-edge ${We(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function _e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=We(e),s=m(),h=s?_t:Wt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:Ht(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 $t={duration:.18,ease:"easeOut"},Kt={duration:0};function Oe({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 $e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Kt:$t;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(Oe,{delay:0,hovered:n,reduced:r}),jsx(Oe,{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 Yt={duration:.18,ease:"easeOut"},Gt={duration:0};function jt(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 Ue({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Gt:Yt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.button,{className:jt(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 Jt={duration:.18,ease:"easeOut"},Zt={duration:0};function Ye({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Zt:Jt;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(Ee,{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 ro={duration:.18,ease:"easeOut"},ao={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?ao:ro;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 lo={duration:.18,ease:"easeOut"},po={duration:0};function et({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?po:lo,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 tt(e){switch(e){case "dot":return Re;case "bubble":return Ae;case "edge-tab":return _e;case "pulse-ring":return $e;case "minimal":return Ue;case "icon-pop":return Ye;case "beacon":return Qe;case "typewriter":return et;default:return Fe}}function rt(e,t,i){return Math.max(t,Math.min(i,e))}function mo(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=rt(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 ho(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 xo(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 yo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function vo(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;}},[]),yo(e,t)}function wo(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 ko=["bug","feature","ux","general"],To={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function oe(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function So(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Po(e){let{state:t,controller:i$1,start:o,stop:a,clearSelection:l,submit:n}=te(),c=e.config.ui?.position,r$1=Pe(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,ae]=useState(e.config.capture?.fullPage??false),[it,ie]=useState(null),[O,ne]=useState(void 0),se=e.config.ui?.categories??ko,nt=e.config.recording?.enabled===true&&j(),st=e.config.recording?.maxDurationMs??3e4,[ct,lt]=useState(false),[j$1,dt]=useState(0);useEffect(()=>{let d=window.setTimeout(()=>{let N=r();dt(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.phase!=="idle"}}),[o,a,n,i$1,t.phase]);let ce=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",pt=xo(ce),[ft,ut]=useState(0);useEffect(()=>{t.phase==="idle"&&ut(i());},[t.phase]);let[bt,le]=useState(false),de=useRef(t.phase);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]),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 ht=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(z.has("mod")){if(ht?!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]),useEffect(()=>i$1.subscribeHover(M),[i$1]),useEffect(()=>{let d=i$1.__unsafeGetSelectedElement();if(!d||t.phase==="idle"||t.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.phase,t.selection?.selector]),useEffect(()=>{t.phase==="review"&&(S(""),C(e.config.capture?.element??true),ae(e.config.capture?.fullPage??false),ne(void 0));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),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:it??t.selection?.rect??null,Q=useMemo(()=>F?mo(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,q=useCallback(()=>{let d={capture:{element:u,fullPage:y}};O&&(d.category=O),n(f,d);},[n,f,u,y,O]),gt=useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),q());},[q,f,k]),mt=tt(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(mt,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r$1.triggerLabel,queueCount:ft,showSuccess:bt}),t.phase!=="idle"&&t.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsx(ho,{rect:F}),t.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:r$1.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r$1.cancelButton,children:r$1.cancelButton})]}),ce&&Q&&jsxs("div",{ref:pt,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$1.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>l(),disabled:k,"aria-label":r$1.rePickButton,children:r$1.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r$1.closeButton,children:r$1.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:r$1.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:gt,disabled:k,"aria-label":r$1.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${O===d?" bf-pill-active":""}`,onClick:()=>ne(O===d?void 0:d),disabled:k,children:r$1[To[d]]},d))}),jsxs("div",{className:"bf-row",role:"group","aria-label":r$1.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r$1.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:y,onChange:d=>ae(d.target.checked),disabled:k}),r$1.screenshotFullPage]})]}),nt&&t.phase==="review"&&!t.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i$1.startRecording(),disabled:k,"aria-label":r$1.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r$1.recordButton]}),t.video&&t.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i$1.removeVideo(),"aria-label":r$1.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[r$1.videoPreviewLabel," (",oe(t.video.durationMs),", ",So(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r$1.capturingText]}),t.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r$1.submittingText]}),t.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r$1.successText}),t.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$1.cancelButton,children:r$1.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:q,disabled:k||f.trim().length===0,"aria-label":r$1.sendButton,children:r$1.sendButton})]})]}),s&&jsx("div",{className:"bf-watermark",children:jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t.phase==="recording"&&jsxs("div",{className:`bf-recording-bar bf-pos-${c}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{className:"bf-recording-bar-timer",children:[r$1.recordingText," ",oe(t.recordingElapsedMs??0)," / ",oe(st)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>i$1.stopRecording(),"aria-label":r$1.stopRecordButton,children:r$1.stopRecordButton})]}),t.phase==="success"&&jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r$1.toastText}),j$1>0&&!ct&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>lt(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),j$1," potential secret",j$1>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Co=forwardRef(function(t,i){let o$1={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=useState(null),n$1=vo(o$1.ui?.showOn),c=wo(o$1.ui?.theme?.mode),r$1=!!o$1.diagnostics;useEffect(()=>{if(r$1)return m$1(o$1.diagnostics),()=>n()},[r$1]);let s=!!o$1.security;useEffect(()=>{s&&q(o$1.security);},[s]);let h=useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let M=useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=o(),y=r();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{}}}}}},[]);return useEffect(()=>{Te();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$1||!a?null:createPortal(jsx(ee,{blocfeed_id:o$1.blocfeed_id,...M?{config:M}:{},children:jsx(Po,{config:o$1,handleRef:i})}),a)});
742
807
  export{ee as BlocFeedProvider,Co as BlocFeedWidget,te as useBlocFeed};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blocfeed",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Drop-in feedback widget for React — element picking, screenshots, and video recording.",
5
5
  "license": "MIT",
6
6
  "type": "module",