(()=>{const e=document.currentScript.getAttribute("data-site-id");if(!e)return void console.error("Feedback widget: Missing data-site-id attribute");const n="https://bugdrop.app",t="https://cdn.bugdrop.app",o=window.location.hostname.replace(/^www\./i,"");const i=Date.now(),r=function(e,n){const t=document.currentScript,o=t?t.src:"";return btoa([o,e,n,"bugdrop-widget"].join("|"))}(e,i);function a(){const e=navigator.userAgent;let n="Unknown",t="Unknown";return e.indexOf("Firefox")>-1?(n="Firefox",t=e.match(/Firefox\/([0-9.]+)/)[1]):e.indexOf("Chrome")>-1&&-1===e.indexOf("Edg")&&-1===e.indexOf("OPR")?(n="Chrome",t=e.match(/Chrome\/([0-9.]+)/)[1]):e.indexOf("Safari")>-1&&-1===e.indexOf("Chrome")?(n="Safari",t=e.match(/Version\/([0-9.]+)/)[1]):e.indexOf("Edg")>-1?(n="Edge",t=e.match(/Edg\/([0-9.]+)/)[1]):e.indexOf("OPR")>-1&&(n="Opera",t=e.match(/OPR\/([0-9.]+)/)[1]),{name:n,version:t}}function s(){const e=navigator.userAgent;let n="Unknown",t="";if(-1!==e.indexOf("Win"))n="Windows",-1!==e.indexOf("Windows NT 10.0")?t="10":-1!==e.indexOf("Windows NT 6.3")?t="8.1":-1!==e.indexOf("Windows NT 6.2")?t="8":-1!==e.indexOf("Windows NT 6.1")&&(t="7");else if(-1!==e.indexOf("Mac")){n="macOS";const o=e.match(/Mac OS X ([0-9_]+)/);o&&(t=o[1].replace(/_/g,"."))}else if(-1!==e.indexOf("Linux")){if(n="Linux",-1!==e.indexOf("Ubuntu"))t="Ubuntu";else if(-1!==e.indexOf("Fedora"))t="Fedora";else if(-1!==e.indexOf("Android")){n="Android";const o=e.match(/Android ([0-9.]+)/);o&&(t=o[1])}}else if(-1!==e.indexOf("iPhone")||-1!==e.indexOf("iPad")||-1!==e.indexOf("iPod")){n="iOS";const o=e.match(/OS ([0-9_]+)/);o&&(t=o[1].replace(/_/g,"."))}return{name:n,version:t,platform:navigator.platform,userAgent:navigator.userAgent}}fetch(`${n}/api/check_site_status.php?site_key=${e}&t=${i}&domain=${o}`,{headers:{"X-Widget-Signature":r,"X-Widget-Timestamp":i.toString()}}).then((e=>e.json())).then((o=>{if(!o.is_active)return void console.log("Bugdrop: Site is not active");!function(o,i,r,d,l,c,p,m,f,b){const u=document.createElement("script");u.src="proxy.php?url=https://html2canvas.hertzen.com/dist/html2canvas.min.js",document.head.appendChild(u);const h={small:"32px",medium:"48px",large:"64px",xl:"80px"},g=`\n @import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');\n\n /* Mobile viewport meta */\n @viewport {\n width: device-width;\n zoom: 1.0;\n }\n\n .feedback-widget {\n --widget-color: #4a90e2;\n --widget-hover: #357abd;\n --widget-text: #ffffff;\n --modal-bg: #ffffff;\n --modal-text: #333333;\n position: fixed;\n z-index: 2147483640;\n transition: transform 0.3s ease;\n touch-action: manipulation; /* Optimize for touch */\n user-select: none;\n -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */\n }\n \n .feedback-bug-icon {\n width: ${h[i]};\n height: ${h[i]};\n cursor: move;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s ease;\n user-select: none;\n min-width: ${h[i]}; /* Use the actual size from sizeMap */\n min-height: ${h[i]}; /* Use the actual size from sizeMap */\n padding: 0; /* Remove padding to prevent size increase */\n }\n \n /* Mobile-specific styles */\n @media (max-width: 768px) {\n .feedback-modal {\n width: 90vw !important; /* Use viewport width */\n max-width: 320px;\n margin: auto;\n }\n\n .feedback-modal-body {\n padding: 16px !important; /* Larger padding on mobile */\n }\n\n .feedback-modal textarea {\n min-height: 100px; /* Taller textarea on mobile */\n font-size: 16px !important; /* Prevent zoom on iOS */\n padding: 12px !important; /* Larger padding for touch */\n }\n\n .feedback-modal-footer {\n padding: 16px !important;\n flex-wrap: wrap; /* Allow wrapping on small screens */\n gap: 12px;\n }\n\n .feedback-screenshot-btn {\n width: 44px !important; /* Larger touch target */\n height: 44px !important;\n }\n\n .feedback-modal button.submit-btn {\n padding: 12px 24px !important; /* Larger touch target */\n font-size: 16px !important;\n width: 100%; /* Full width on mobile */\n margin-top: 8px;\n }\n\n .feedback-modal-close {\n width: 44px !important; /* Larger touch target */\n height: 44px !important;\n font-size: 24px !important;\n }\n\n /* Improve touch targets for screenshot preview */\n .feedback-screenshot-preview .remove-screenshot {\n width: 32px !important;\n height: 32px !important;\n font-size: 18px !important;\n }\n }\n\n .feedback-bug-icon:hover {\n transform: scale(1.1);\n }\n \n .feedback-bug-icon img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n pointer-events: none;\n display: block; /* Ensure proper sizing */\n }\n \n .feedback-modal {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: #fff;\n width: 320px;\n z-index: 2147483647;\n border-radius: 12px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n user-select: none;\n max-height: 90vh;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n .feedback-modal.dragging {\n user-select: none;\n cursor: move;\n }\n\n .feedback-modal.dragging * {\n cursor: move;\n }\n\n .feedback-modal-header {\n display: flex;\n align-items: center;\n padding: 12px 16px;\n gap: 12px;\n cursor: move;\n border-bottom: 1px solid #f0f0f0;\n user-select: none;\n }\n\n .feedback-modal-header h3 {\n margin: 0;\n color: #1c1c1c;\n font-size: 15px;\n font-weight: 500;\n flex-grow: 1;\n }\n\n .feedback-modal-close {\n width: 24px;\n height: 24px;\n border: none;\n background: none;\n cursor: pointer;\n padding: 0;\n color: #666;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 24px;\n }\n\n .feedback-modal-close:hover {\n color: #333;\n }\n\n .feedback-modal-body {\n padding: 12px 16px;\n }\n\n .feedback-modal textarea {\n width: 100%;\n min-height: 80px;\n padding: 10px;\n border: 1px solid #e6e6e6;\n border-radius: 8px;\n font-size: 14px;\n line-height: 1.4;\n resize: none;\n font-family: inherit;\n margin: 0;\n box-sizing: border-box;\n background: white;\n user-select: text;\n }\n \n .feedback-modal textarea:focus {\n outline: none;\n border-color: #03346E;\n }\n\n .feedback-modal-footer {\n padding: 12px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid #f0f0f0;\n }\n\n .feedback-modal-footer-left {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .feedback-screenshot-btn {\n width: 38px;\n height: 38px;\n border: 1px solid #e6e6e6;\n background: white;\n border-radius: 6px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n transition: all 0.2s ease;\n }\n\n .feedback-screenshot-btn:hover {\n border-color: #03346E;\n color: #03346E;\n }\n\n .feedback-screenshot-btn.active {\n background: #03346E;\n border-color: #03346E;\n color: white;\n }\n\n .feedback-screenshot-preview {\n display: none;\n margin-top: 12px;\n position: relative;\n }\n\n .feedback-screenshot-preview.visible {\n display: block;\n }\n\n .feedback-screenshot-preview img {\n width: 100%;\n border-radius: 6px;\n border: 1px solid #e6e6e6;\n }\n\n .feedback-screenshot-preview .remove-screenshot {\n position: absolute;\n top: -6px;\n right: 10px;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #fff;\n border: 1px solid #e6e6e6;\n color: #666;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n font-size: 14px;\n box-shadow: 0 1px 3px rgba(0,0,0,0.1);\n }\n\n .feedback-screenshot-preview .remove-screenshot:hover {\n background: #f5f5f5;\n color: #333;\n }\n\n .feedback-modal button.submit-btn,\n .feedback-modal button.submit-email-btn {\n padding: 8px 16px;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n border: none;\n background: ${m};\n color: ${f};\n transition: all 0.2s ease;\n }\n\n .feedback-modal button.submit-email-btn {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .feedback-modal button.submit-btn:hover,\n .feedback-modal button.submit-email-btn:hover {\n filter: brightness(110%);\n transform: translateY(-1px);\n }\n\n .feedback-modal button.submit-btn:disabled,\n .feedback-modal button.submit-email-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n transform: none;\n }\n\n .feedback-branding {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 8px;\n font-size: 11px;\n color: #666;\n gap: 4px;\n border-top: 1px solid #f0f0f0;\n }\n\n .feedback-branding a {\n color: #333;\n text-decoration: none;\n font-weight: 500;\n font-size: 12px;\n }\n\n .feedback-tooltip {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n background-color: #333;\n color: #fff;\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 13px;\n width: 230px;\n text-align: center;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s ease, visibility 0.2s ease;\n z-index: 1;\n pointer-events: none;\n }\n\n /* Tooltip arrow styles */\n .feedback-tooltip::after {\n content: '';\n position: absolute;\n top: 50%;\n margin-top: -5px;\n border-width: 5px;\n border-style: solid;\n }\n\n /* Right position styles */\n .feedback-tooltip.tooltip-right {\n left: calc(100% + 10px);\n }\n .feedback-tooltip.tooltip-right::after {\n right: 100%;\n border-color: transparent #333 transparent transparent;\n }\n\n /* Left position styles */\n .feedback-tooltip.tooltip-left {\n right: calc(100% + 10px);\n }\n .feedback-tooltip.tooltip-left::after {\n left: 100%;\n border-color: transparent transparent transparent #333;\n }\n\n /* Mobile-specific modal styles */\n @media (max-width: 768px) {\n /* Base modal styles - remove default desktop positioning */\n .feedback-modal {\n position: static;\n top: auto;\n left: auto;\n transform: none;\n }\n\n /* Overlay styles */\n .modal-overlay {\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n background: rgba(0, 0, 0, 0.5) !important;\n z-index: 2147483646 !important;\n opacity: 0;\n transition: opacity 0.3s ease-out !important;\n }\n\n .modal-overlay.visible {\n opacity: 1;\n }\n\n .feedback-modal.mobile-fullscreen {\n position: fixed !important;\n top: auto !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100% !important;\n height: auto !important;\n max-width: none !important;\n max-height: 70vh !important;\n min-height: 300px !important;\n margin: 0 !important;\n padding: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n border-top-left-radius: 16px !important;\n border-top-right-radius: 16px !important;\n display: flex !important;\n flex-direction: column !important;\n background: #fff !important;\n box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12) !important;\n z-index: 2147483647 !important;\n transform: translateY(100%) !important;\n transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;\n will-change: transform !important;\n }\n\n .feedback-modal.mobile-fullscreen.visible {\n transform: translateY(0) !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-header {\n padding: 16px !important;\n border-bottom: 1px solid #f0f0f0 !important;\n background: var(--modal-bg) !important;\n position: relative !important;\n z-index: 2 !important;\n border-top-left-radius: 16px !important;\n border-top-right-radius: 16px !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-body {\n flex: 1 1 auto !important;\n padding: 20px !important;\n overflow-y: auto !important;\n -webkit-overflow-scrolling: touch !important;\n background: var(--modal-bg) !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-footer {\n padding: 16px !important;\n border-top: 1px solid #f0f0f0 !important;\n background: #fff !important;\n position: relative !important;\n z-index: 2 !important;\n display: flex !important;\n align-items: center !important;\n gap: 12px !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-branding {\n padding: 12px 16px !important;\n border-top: 1px solid #f0f0f0 !important;\n background: #fff !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen textarea {\n height: 120px !important;\n font-size: 16px !important;\n padding: 12px !important;\n margin-bottom: 16px !important;\n border-radius: 8px !important;\n resize: none !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-screenshot-preview {\n margin: 16px -20px !important;\n background: #f8f8f8 !important;\n position: relative !important;\n z-index: 1 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-screenshot-preview img {\n border: none !important;\n width: 100% !important;\n height: auto !important;\n display: block !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-modal-close {\n width: 44px !important;\n height: 44px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n font-size: 24px !important;\n margin-right: -8px !important;\n position: relative !important;\n z-index: 3 !important;\n background: none !important;\n border: none !important;\n cursor: pointer !important;\n color: #666 !important;\n }\n\n .feedback-modal.mobile-fullscreen .feedback-screenshot-btn {\n width: 44px !important;\n height: 44px !important;\n flex-shrink: 0 !important;\n border: 1px solid #e6e6e6 !important;\n border-radius: 8px !important;\n background: white !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n color: black !important;\n }\n\n .feedback-modal.mobile-fullscreen .submit-btn {\n position: relative !important;\n z-index: 2 !important;\n flex: 1 !important;\n margin: 0 !important;\n height: 44px !important;\n border-radius: 8px !important;\n font-size: 16px !important;\n }\n }\n `,x=document.createElement("style");x.textContent=g,document.head.appendChild(x);const w=document.createElement("div");w.className="feedback-widget",w.style[r]="20px",w.style.bottom="20px",w.style.position="fixed",w.style.zIndex="2147483640",w.style.transition="transform 0.2s ease";const y=document.createElement("div");y.className="feedback-bug-icon";parseInt(h[i]);y.innerHTML=`Feedback`,w.appendChild(y),document.body.appendChild(w);const v=document.createElement("div");v.className="feedback-tooltip tooltip-"+("right"===r?"left":"right"),v.textContent="Spotted a bug? Drag me there!",l||w.appendChild(v);let k=!1,E=0,z=0,L=0,S=0,C=0,O=0,_=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);function M(){w.style[r]="20px",w.style.bottom="20px","right"===r?w.style.left="":w.style.right="",w.style.top=""}y.style.cursor="move";let T=0,B=0,Y=!1,W=!1;function q(e){if(_&&(T=e.touches[0].clientX,B=e.touches[0].clientY,Y=!1,W=!1,y.style.opacity="0.8",e.target.closest(".feedback-bug-icon"))){W=!0;const n=e.target.closest(".feedback-bug-icon").getBoundingClientRect(),t=e.touches[0].clientX-n.left,o=e.touches[0].clientY-n.top,i=w.getBoundingClientRect();L=i.left,S=i.top,w.dataset.offsetX=t,w.dataset.offsetY=o,w.style.position="fixed",w.style.left=L+"px",w.style.top=S+"px",w.style.right="",w.style.bottom="",w.style.transition="none",w.style.transform="scale(1.1)",v.style.opacity="0",v.style.visibility="hidden"}}function R(e){if(_&&W){e.preventDefault(),Y=!0;const n=parseFloat(w.dataset.offsetX)||0,t=parseFloat(w.dataset.offsetY)||0;let o=e.touches[0].clientX-n,i=e.touches[0].clientY-t;const r=window.innerWidth,a=window.innerHeight,s=w.getBoundingClientRect(),d=s.width,l=s.height,c=20;o=Math.max(c,Math.min(o,r-d-c)),i=Math.max(c,Math.min(i,a-l-c)),w.style.left=o+"px",w.style.top=i+"px"}}function X(e){if(_&&(y.style.opacity="1",W)){W=!1,w.style.transition="transform 0.2s ease",w.style.transform="scale(1)";const n=e.changedTouches[0].clientX,t=e.changedTouches[0].clientY;$(),N(n,t)}}function j(e){if(e.target.closest(".feedback-bug-icon")){k=!0;const n=e.target.closest(".feedback-bug-icon").getBoundingClientRect(),t=e.clientX-n.left,o=e.clientY-n.top;E=e.clientX,z=e.clientY;const i=w.getBoundingClientRect();L=i.left,S=i.top,w.dataset.offsetX=t,w.dataset.offsetY=o,w.style.position="fixed",w.style.left=L+"px",w.style.top=S+"px",w.style.right="",w.style.bottom="",w.style.transition="none",w.style.transform="scale(1.1)",v.style.opacity="0",v.style.visibility="hidden"}}function P(e){if(k){e.preventDefault();const n=parseFloat(w.dataset.offsetX)||0,t=parseFloat(w.dataset.offsetY)||0;let o=e.clientX-n,i=e.clientY-t;const r=window.innerWidth,a=window.innerHeight,s=w.getBoundingClientRect(),d=s.width,l=s.height,c=20;o=Math.max(c,Math.min(o,r-d-c)),i=Math.max(c,Math.min(i,a-l-c)),w.style.left=o+"px",w.style.top=i+"px";const p=50,m=15;e.clientXr-p&&(window.scrollBy(m,0),o-=m),e.clientYa-p&&(window.scrollBy(0,m),i-=m),w.style.left=o+"px",w.style.top=i+"px"}}function F(e){if(k){k=!1,w.style.transition="transform 0.2s ease",w.style.transform="scale(1)",C=e.clientX,O=e.clientY;Math.sqrt(Math.pow(C-E,2)+Math.pow(O-z,2))>10&&($(),N(C,O))}}w.addEventListener("mousedown",j),document.addEventListener("mousemove",P),document.addEventListener("mouseup",F),_||(y.addEventListener("mouseenter",(()=>{k||l||(v.style.opacity="1",v.style.visibility="visible")})),y.addEventListener("mouseleave",(()=>{l||(v.style.opacity="0",v.style.visibility="hidden")})),l||setTimeout((()=>{v.style.opacity="1",v.style.visibility="visible",setTimeout((()=>{v.style.opacity="0",v.style.visibility="hidden"}),3500)}),500));function N(t,o){let i;_&&(i=document.createElement("div"),i.className="modal-overlay",document.body.appendChild(i),i.offsetHeight,i.classList.add("visible"));const r=document.createElement("div");r.className="feedback-modal",_&&(r.classList.add("mobile-fullscreen"),document.body.style.overflow="hidden");let l=!1,f=0,b=0,u=0,h=0;function g(e){if(e.target.closest(".feedback-modal-header")){l=!0,f=e.clientX,b=e.clientY;const n=r.getBoundingClientRect();u=n.left,h=n.top,r.classList.add("dragging"),r.style.transition="none"}}function x(e){if(l){e.preventDefault();const n=e.clientX-f,t=e.clientY-b;let o=u+n,i=h+t;const a=window.innerWidth,s=window.innerHeight,d=r.getBoundingClientRect(),l=d.width,c=d.height,p=20;o=Math.max(p,Math.min(o,a-l-p)),i=Math.max(p,Math.min(i,s-c-p)),r.style.left=o+"px",r.style.top=i+"px"}}function v(){l&&(l=!1,r.classList.remove("dragging"),r.style.transition="")}document.addEventListener("mousemove",x),document.addEventListener("mouseup",v),r.innerHTML=`\n \n \n \n ${d?"":`\n \n `}\n `,document.body.appendChild(r);if(r.querySelector(".feedback-modal-header").addEventListener("mousedown",g),_)requestAnimationFrame((()=>{r.classList.add("visible")}));else{const e=r.getBoundingClientRect(),n=20;let i=Math.min(Math.max(t+10,n),window.innerWidth-e.width-n),a=Math.min(Math.max(o-e.height/2,n),window.innerHeight-e.height-n);r.style.transform="none",r.style.left=i+"px",r.style.top=a+"px"}r.querySelector(".feedback-modal-close").addEventListener("click",(()=>{_?(r.classList.remove("visible"),i.classList.remove("visible"),setTimeout((()=>{$(),M(),i.remove(),document.body.style.overflow=""}),300)):($(),M())}));const k=document.createElement("div");k.className="error";const E=r.querySelector(".submit-btn"),z=r.querySelector("textarea"),L=r.querySelector(".feedback-screenshot-btn"),S=r.querySelector(".feedback-screenshot-preview"),C=S.querySelector("img"),O=S.querySelector(".remove-screenshot");E.disabled=!0,E.style.opacity="0.5",E.style.cursor="not-allowed",z.addEventListener("input",(()=>{const e=z.value.trim().length>0;E.disabled=!e,E.style.opacity=e?"1":"0.5",E.style.cursor=e?"pointer":"not-allowed"}));let T=null;async function B(){if("undefined"==typeof html2canvas){let e=0;for(;"undefined"==typeof html2canvas&&e<30;)await new Promise((e=>setTimeout(e,100))),e++;if("undefined"==typeof html2canvas)throw new Error("html2canvas library failed to load")}r.style.visibility="hidden";const e=document.querySelector(".modal-overlay");e&&(e.style.visibility="hidden");const n={position:w.style.position,left:w.style.left,top:w.style.top,right:w.style.right,bottom:w.style.bottom,zIndex:w.style.zIndex},t=w.getBoundingClientRect(),o=window.pageXOffset,i=window.pageYOffset;w.style.zIndex="999999",w.style.position="absolute",w.style.left=t.left+o+"px",w.style.top=t.top+i+"px",w.style.right="",w.style.bottom="",y.style.boxShadow="0 0 0 4px rgba(74, 144, 226, 0.5)";try{const e=await html2canvas(document.body,{useCORS:!0,allowTaint:!0,x:window.scrollX,y:window.scrollY,width:window.innerWidth,height:window.innerHeight,scrollX:0,scrollY:0,windowWidth:window.innerWidth,windowHeight:window.innerHeight,scale:window.devicePixelRatio,logging:!1,ignoreElements:e=>e.classList.contains("feedback-modal")||e.classList.contains("modal-overlay"),onclone:e=>{const n=e.querySelector(".feedback-modal"),t=e.querySelector(".modal-overlay");n&&n.remove(),t&&t.remove()}});T=e.toDataURL("image/png"),C.src=T,S.classList.add("visible"),L.classList.add("active")}catch(e){console.error("Failed to take screenshot:",e);const n=r.querySelector(".error")||document.createElement("div");if(n.className="error",n.style.cssText="\n display: block;\n margin: 8px 12px;\n padding: 8px;\n background: #fff0f0;\n color: #e74c3c;\n border-radius: 4px;\n font-size: 13px;\n ",n.textContent="Could not capture screenshot. You can still submit feedback without it.",!r.querySelector(".error")){const e=r.querySelector(".feedback-modal-body");e.insertBefore(n,e.firstChild)}T=null,L.classList.remove("active"),S.classList.remove("visible")}finally{w.style.zIndex=n.zIndex,w.style.position=n.position,w.style.left=n.left,w.style.top=n.top,w.style.right=n.right,w.style.bottom=n.bottom,w.style.display="",y.style.boxShadow="",r.style.visibility="visible",e&&(e.style.visibility="visible")}}function Y(){T=null,S.classList.remove("visible"),L.classList.remove("active")}L.addEventListener("click",B),O.addEventListener("click",Y),E.addEventListener("click",(async()=>{const i=z.value.trim();if(!i)return k.style.display="block",void(k.textContent="Please describe the issue");const d=E.textContent;E.disabled=!0,E.textContent="Submitting...",k.style.display="none";try{const d={siteId:e,message:i,screenshot:T||null,pageUrl:window.location.href,x:t,y:o,technical:{browser:{name:a().name,version:a().version,userAgent:navigator.userAgent,vendor:navigator.vendor,language:navigator.language,cookieEnabled:navigator.cookieEnabled,doNotTrack:navigator.doNotTrack},os:s(),errors:{consoleErrors:window._bugdropConsoleErrors||[],uncaughtErrors:window._bugdropUncaughtErrors||[],networkErrors:window._bugdropNetworkErrors||[]},performance:{loadTime:window.performance?window.performance.timing.loadEventEnd-window.performance.timing.navigationStart:null,domContentLoaded:window.performance?window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart:null,firstPaint:window.performance&&window.performance.getEntriesByType?window.performance.getEntriesByType("paint").find((e=>"first-paint"===e.name))?.startTime:null,firstContentfulPaint:window.performance&&window.performance.getEntriesByType?window.performance.getEntriesByType("paint").find((e=>"first-contentful-paint"===e.name))?.startTime:null},screen:{width:window.screen.width,height:window.screen.height,availWidth:window.screen.availWidth,availHeight:window.screen.availHeight,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,devicePixelRatio:window.devicePixelRatio},window:{innerWidth:window.innerWidth,innerHeight:window.innerHeight,outerWidth:window.outerWidth,outerHeight:window.outerHeight},platform:navigator.platform,timestamp:(new Date).toISOString(),timezoneOffset:(new Date).getTimezoneOffset(),referrer:document.referrer,previousPage:window.history.length>1?document.referrer:null}},l=await fetch(`${n}/api/report.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!l.ok)throw new Error("Failed to submit feedback");const c=(await l.json()).report_id;r.classList.add("success");const p=r.querySelector(".feedback-modal-footer");p&&p.remove();const f=r.querySelector(".feedback-modal-body");f.style.padding="12px 16px",f.innerHTML='\n
\n \n \n \n \n

Your feedback has been submitted successfully.

\n
\n
\n

Want to get notified about updates? (optional)

\n \n \n
\n ';const b=r.querySelector(".feedback-modal-header");b.style.cursor="move",b.addEventListener("mousedown",g);const u=f.querySelector('input[type="email"]'),h=f.querySelector(".submit-email-btn");h.disabled=!0,h.style.opacity="0.5",h.style.cursor="not-allowed",u.addEventListener("input",(()=>{const e=u.value.trim(),n=e.length>0&&e.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);h.disabled=!n,h.style.opacity=n?"1":"0.5",h.style.cursor=n?"pointer":"not-allowed",u.style.borderColor=0===e.length?"#e6e6e6":n?"#4CAF50":"#e74c3c"})),h.addEventListener("click",(async()=>{const t=u.value.trim();if(!t)return;if(!t.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))return void(u.style.borderColor="#e74c3c");const o=h.textContent;h.disabled=!0,h.textContent="Submitting...";try{if(!(await fetch(`${n}/api/report.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteId:e,message:"",pageUrl:window.location.href,email:t,update_email:!0,report_id:c})})).ok)throw new Error("Failed to submit email");f.style.padding="32px 20px",f.innerHTML=`\n
\n \n \n \n \n

We'll keep you updated!

\n
\n `,setTimeout((()=>{$(),M()}),2e3)}catch(e){h.disabled=!1,h.textContent=o,u.style.borderColor="#e74c3c"}}))}catch(e){console.error("Error submitting feedback:",e),k.style.display="block",k.textContent="Failed to submit feedback. Please try again.",E.disabled=!1,E.textContent=d}}))}function $(){const e=document.querySelector(".feedback-modal"),n=document.querySelector(".modal-overlay");_?(e&&e.classList.remove("visible"),n&&n.classList.remove("visible"),setTimeout((()=>{e&&e.remove(),n&&n.remove(),document.body.style.overflow=""}),300)):(e&&e.remove(),n&&n.remove())}w.addEventListener("touchstart",q,{passive:!1}),w.addEventListener("touchmove",R,{passive:!1}),w.addEventListener("touchend",X),v.textContent=_?"Tap to report a bug":b,u.onload=()=>{w.appendChild(y),document.body.appendChild(w)}}(o.bug_color||"blue",o.bug_size||"medium",o.bug_position||"left",o.hide_branding||0,o.hide_tooltip||0,o.branding_text||"Lightweight feedback by bugdrop 🐞",o.modal_header_text||"What's bugging you?",o.button_bg_color||"#03346e",o.button_text_color||"#ffffff",o.tooltip_text||"Spotted a bug? Drag me there!")})).catch((e=>{console.error("Bugdrop: Failed to check site status",e)})),window._bugdropConsoleErrors=[],window._bugdropUncaughtErrors=[],window._bugdropNetworkErrors=[];const d=console.error;console.error=function(...e){window._bugdropConsoleErrors.push({timestamp:(new Date).toISOString(),message:e.map((e=>String(e))).join(" ")}),window._bugdropConsoleErrors.length>10&&window._bugdropConsoleErrors.shift(),d.apply(this,e)},window.addEventListener("error",(function(e){window._bugdropUncaughtErrors.push({timestamp:(new Date).toISOString(),message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error:e.error?e.error.stack:null}),window._bugdropUncaughtErrors.length>10&&window._bugdropUncaughtErrors.shift()}));const l=window.fetch;window.fetch=function(...e){return l.apply(this,e).catch((n=>{throw window._bugdropNetworkErrors.push({timestamp:(new Date).toISOString(),url:e[0],message:n.message}),window._bugdropNetworkErrors.length>10&&window._bugdropNetworkErrors.shift(),n}))}})();