var content=(function(){"use strict";var ie=Object.defineProperty;var oe=(C,v,M)=>v in C?ie(C,v,{enumerable:!0,configurable:!0,writable:!0,value:M}):C[v]=M;var S=(C,v,M)=>oe(C,typeof v!="symbol"?v+"":v,M);function C(n){return n}const v={matches:["<all_urls>"],runAt:"document_start",main(){let n=!1,e=[],r=null;const i=200;let c=0,g=0,A=0;window.addEventListener("mousemove",o=>{g=o.clientX,A=o.clientY},{passive:!0});function x(o){n&&(g=o.clientX,A=o.clientY,e.push({type:"move",timeMs:Date.now(),clientX:o.clientX,clientY:o.clientY,screenX:o.screenX,screenY:o.screenY,windowInnerWidth:window.innerWidth,windowInnerHeight:window.innerHeight,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,devicePixelRatio:window.devicePixelRatio}))}function O(o){if(!n)return;let b=o.clientX,p=o.clientY;b===0&&p===0&&(g!==0||A!==0)&&(b=g,p=A);const U={type:"click",timeMs:Date.now(),clientX:b,clientY:p,screenX:o.screenX,screenY:o.screenY,windowInnerWidth:window.innerWidth,windowInnerHeight:window.innerHeight,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,devicePixelRatio:window.devicePixelRatio};chrome.runtime.sendMessage({action:"METADATA_EVENT",data:{type:"click",payload:U}})}function I(o){if(!n)return;const b={key:o.key,code:o.code,timeMs:Date.now(),altKey:o.altKey,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey};chrome.runtime.sendMessage({action:"METADATA_EVENT",data:{type:"keystroke",payload:b}})}function T(){e.length>0&&(chrome.runtime.sendMessage({action:"METADATA_EVENT",data:{type:"mouse_batch",payload:e}}),e=[])}function j(){n||(n=!0,e=[],c=Date.now(),e.push({type:"move",timeMs:Date.now(),clientX:g,clientY:A,screenX:g,screenY:A,windowInnerWidth:window.innerWidth,windowInnerHeight:window.innerHeight,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,devicePixelRatio:window.devicePixelRatio}),window.addEventListener("mousemove",x,{passive:!0}),window.addEventListener("mousedown",O,{passive:!0}),window.addEventListener("keydown",I,{passive:!0}),r=window.setInterval(T,i),console.log("[Clipive Content] Telemetry tracking started."))}function $(){n&&(n=!1,T(),r!==null&&(clearInterval(r),r=null),window.removeEventListener("mousemove",x),window.removeEventListener("mousedown",O),window.removeEventListener("keydown",I),console.log("[Clipive Content] Telemetry tracking stopped."))}function E(){if(document.getElementById("clipive-scrollbar-hider"))return;const o=document.createElement("style");o.id="clipive-scrollbar-hider",o.textContent=`
        /* Hide scrollbars globally for WebKit/Blink browsers with high specificity */
        ::-webkit-scrollbar,
        *::-webkit-scrollbar,
        html::-webkit-scrollbar,
        body::-webkit-scrollbar,
        :root::-webkit-scrollbar,
        :root ::-webkit-scrollbar,
        body ::-webkit-scrollbar,
        html ::-webkit-scrollbar {
          display: none !important;
          width: 0px !important;
          height: 0px !important;
          background: transparent !important;
        }
        /* Hide scrollbars for Firefox and other browsers */
        html, body, *, :root {
          scrollbar-width: none !important;
        }
      `;const b=document.head||document.documentElement;b&&(b.appendChild(o),console.log("[Clipive Content] Scrollbars hidden via style injection."))}function k(){const o=document.getElementById("clipive-scrollbar-hider");o&&(o.remove(),console.log("[Clipive Content] Scrollbars restored."))}chrome.runtime.onMessage.addListener((o,b,p)=>{o.action==="START_CAPTURING"?(j(),E(),p({success:!0,startTime:c})):o.action==="STOP_CAPTURING"?($(),k(),p({success:!0})):o.action==="GET_VIEWPORT_SIZE"?(E(),p({width:window.innerWidth,height:window.innerHeight,scrollbarWidth:0,scrollbarHeight:0,dpr:window.devicePixelRatio})):o.action==="RESTORE_SCROLLBARS"&&(k(),p({success:!0}))})}};function M(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var R={exports:{}},G=R.exports,q;function z(){return q||(q=1,(function(n,e){(function(r,i){i(n)})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:G,function(r){if(!(globalThis.chrome&&globalThis.chrome.runtime&&globalThis.chrome.runtime.id))throw new Error("This script should only be loaded in a browser extension.");if(globalThis.browser&&globalThis.browser.runtime&&globalThis.browser.runtime.id)r.exports=globalThis.browser;else{const i="The message port closed before a response was received.",c=g=>{const A={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(Object.keys(A).length===0)throw new Error("api-metadata.json has not been included in browser-polyfill");class x extends WeakMap{constructor(t,l=void 0){super(l),this.createItem=t}get(t){return this.has(t)||this.set(t,this.createItem(t)),super.get(t)}}const O=s=>s&&typeof s=="object"&&typeof s.then=="function",I=(s,t)=>(...l)=>{g.runtime.lastError?s.reject(new Error(g.runtime.lastError.message)):t.singleCallbackArg||l.length<=1&&t.singleCallbackArg!==!1?s.resolve(l[0]):s.resolve(l)},T=s=>s==1?"argument":"arguments",j=(s,t)=>function(m,...d){if(d.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${T(t.minArgs)} for ${s}(), got ${d.length}`);if(d.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${T(t.maxArgs)} for ${s}(), got ${d.length}`);return new Promise((h,w)=>{if(t.fallbackToNoCallback)try{m[s](...d,I({resolve:h,reject:w},t))}catch(a){console.warn(`${s} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,a),m[s](...d),t.fallbackToNoCallback=!1,t.noCallback=!0,h()}else t.noCallback?(m[s](...d),h()):m[s](...d,I({resolve:h,reject:w},t))})},$=(s,t,l)=>new Proxy(t,{apply(m,d,h){return l.call(d,s,...h)}});let E=Function.call.bind(Object.prototype.hasOwnProperty);const k=(s,t={},l={})=>{let m=Object.create(null),d={has(w,a){return a in s||a in m},get(w,a,f){if(a in m)return m[a];if(!(a in s))return;let u=s[a];if(typeof u=="function")if(typeof t[a]=="function")u=$(s,s[a],t[a]);else if(E(l,a)){let P=j(a,l[a]);u=$(s,s[a],P)}else u=u.bind(s);else if(typeof u=="object"&&u!==null&&(E(t,a)||E(l,a)))u=k(u,t[a],l[a]);else if(E(l,"*"))u=k(u,t[a],l["*"]);else return Object.defineProperty(m,a,{configurable:!0,enumerable:!0,get(){return s[a]},set(P){s[a]=P}}),u;return m[a]=u,u},set(w,a,f,u){return a in m?m[a]=f:s[a]=f,!0},defineProperty(w,a,f){return Reflect.defineProperty(m,a,f)},deleteProperty(w,a){return Reflect.deleteProperty(m,a)}},h=Object.create(s);return new Proxy(h,d)},o=s=>({addListener(t,l,...m){t.addListener(s.get(l),...m)},hasListener(t,l){return t.hasListener(s.get(l))},removeListener(t,l){t.removeListener(s.get(l))}}),b=new x(s=>typeof s!="function"?s:function(l){const m=k(l,{},{getContent:{minArgs:0,maxArgs:0}});s(m)}),p=new x(s=>typeof s!="function"?s:function(l,m,d){let h=!1,w,a=new Promise(N=>{w=function(y){h=!0,N(y)}}),f;try{f=s(l,m,w)}catch(N){f=Promise.reject(N)}const u=f!==!0&&O(f);if(f!==!0&&!u&&!h)return!1;const P=N=>{N.then(y=>{d(y)},y=>{let V;y&&(y instanceof Error||typeof y.message=="string")?V=y.message:V="An unexpected error occurred",d({__mozWebExtensionPolyfillReject__:!0,message:V})}).catch(y=>{console.error("Failed to send onMessage rejected reply",y)})};return P(u?f:a),!0}),U=({reject:s,resolve:t},l)=>{g.runtime.lastError?g.runtime.lastError.message===i?t():s(new Error(g.runtime.lastError.message)):l&&l.__mozWebExtensionPolyfillReject__?s(new Error(l.message)):t(l)},X=(s,t,l,...m)=>{if(m.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${T(t.minArgs)} for ${s}(), got ${m.length}`);if(m.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${T(t.maxArgs)} for ${s}(), got ${m.length}`);return new Promise((d,h)=>{const w=U.bind(null,{resolve:d,reject:h});m.push(w),l.sendMessage(...m)})},ne={devtools:{network:{onRequestFinished:o(b)}},runtime:{onMessage:o(p),onMessageExternal:o(p),sendMessage:X.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:X.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},Y={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return A.privacy={network:{"*":Y},services:{"*":Y},websites:{"*":Y}},k(g,ne,A)};r.exports=c(chrome)}})})(R)),R.exports}var Z=z();const K=M(Z);function L(n,...e){}const J={debug:(...n)=>L(console.debug,...n),log:(...n)=>L(console.log,...n),warn:(...n)=>L(console.warn,...n),error:(...n)=>L(console.error,...n)},W=class W extends Event{constructor(e,r){super(W.EVENT_NAME,{}),this.newUrl=e,this.oldUrl=r}};S(W,"EVENT_NAME",H("wxt:locationchange"));let B=W;function H(n){var e;return`${(e=K==null?void 0:K.runtime)==null?void 0:e.id}:content:${n}`}function Q(n){let e,r;return{run(){e==null&&(r=new URL(location.href),e=n.setInterval(()=>{let i=new URL(location.href);i.href!==r.href&&(window.dispatchEvent(new B(i,r)),r=i)},1e3))}}}const _=class _{constructor(e,r){S(this,"isTopFrame",window.self===window.top);S(this,"abortController");S(this,"locationWatcher",Q(this));S(this,"receivedMessageIds",new Set);this.contentScriptName=e,this.options=r,this.abortController=new AbortController,this.isTopFrame?(this.listenForNewerScripts({ignoreFirstEvent:!0}),this.stopOldScripts()):this.listenForNewerScripts()}get signal(){return this.abortController.signal}abort(e){return this.abortController.abort(e)}get isInvalid(){return K.runtime.id==null&&this.notifyInvalidated(),this.signal.aborted}get isValid(){return!this.isInvalid}onInvalidated(e){return this.signal.addEventListener("abort",e),()=>this.signal.removeEventListener("abort",e)}block(){return new Promise(()=>{})}setInterval(e,r){const i=setInterval(()=>{this.isValid&&e()},r);return this.onInvalidated(()=>clearInterval(i)),i}setTimeout(e,r){const i=setTimeout(()=>{this.isValid&&e()},r);return this.onInvalidated(()=>clearTimeout(i)),i}requestAnimationFrame(e){const r=requestAnimationFrame((...i)=>{this.isValid&&e(...i)});return this.onInvalidated(()=>cancelAnimationFrame(r)),r}requestIdleCallback(e,r){const i=requestIdleCallback((...c)=>{this.signal.aborted||e(...c)},r);return this.onInvalidated(()=>cancelIdleCallback(i)),i}addEventListener(e,r,i,c){var g;r==="wxt:locationchange"&&this.isValid&&this.locationWatcher.run(),(g=e.addEventListener)==null||g.call(e,r.startsWith("wxt:")?H(r):r,i,{...c,signal:this.signal})}notifyInvalidated(){this.abort("Content script context invalidated"),J.debug(`Content script "${this.contentScriptName}" context invalidated`)}stopOldScripts(){window.postMessage({type:_.SCRIPT_STARTED_MESSAGE_TYPE,contentScriptName:this.contentScriptName,messageId:Math.random().toString(36).slice(2)},"*")}verifyScriptStartedEvent(e){var g,A,x;const r=((g=e.data)==null?void 0:g.type)===_.SCRIPT_STARTED_MESSAGE_TYPE,i=((A=e.data)==null?void 0:A.contentScriptName)===this.contentScriptName,c=!this.receivedMessageIds.has((x=e.data)==null?void 0:x.messageId);return r&&i&&c}listenForNewerScripts(e){let r=!0;const i=c=>{if(this.verifyScriptStartedEvent(c)){this.receivedMessageIds.add(c.data.messageId);const g=r;if(r=!1,g&&(e!=null&&e.ignoreFirstEvent))return;this.notifyInvalidated()}};addEventListener("message",i),this.onInvalidated(()=>removeEventListener("message",i))}};S(_,"SCRIPT_STARTED_MESSAGE_TYPE",H("wxt:content-script-started"));let D=_;const ee=Symbol("null");let re=0;class se extends Map{constructor(...e){super(),this._objectHashes=new WeakMap,this._symbolHashes=new Map,this._publicKeys=new Map;const[r]=e;if(r!=null){if(typeof r[Symbol.iterator]!="function")throw new TypeError(typeof r+" is not iterable (cannot read property Symbol(Symbol.iterator))");for(const[i,c]of r)this.set(i,c)}}_getPublicKeys(e,r=!1){if(!Array.isArray(e))throw new TypeError("The keys parameter must be an array");const i=this._getPrivateKey(e,r);let c;return i&&this._publicKeys.has(i)?c=this._publicKeys.get(i):r&&(c=[...e],this._publicKeys.set(i,c)),{privateKey:i,publicKey:c}}_getPrivateKey(e,r=!1){const i=[];for(const c of e){const g=c===null?ee:c;let A;if(typeof g=="object"||typeof g=="function"?A="_objectHashes":typeof g=="symbol"?A="_symbolHashes":A=!1,!A)i.push(g);else if(this[A].has(g))i.push(this[A].get(g));else if(r){const x=`@@mkm-ref-${re++}@@`;this[A].set(g,x),i.push(x)}else return!1}return JSON.stringify(i)}set(e,r){const{publicKey:i}=this._getPublicKeys(e,!0);return super.set(i,r)}get(e){const{publicKey:r}=this._getPublicKeys(e);return super.get(r)}has(e){const{publicKey:r}=this._getPublicKeys(e);return super.has(r)}delete(e){const{publicKey:r,privateKey:i}=this._getPublicKeys(e);return!!(r&&super.delete(r)&&this._publicKeys.delete(i))}clear(){super.clear(),this._symbolHashes.clear(),this._publicKeys.clear()}get[Symbol.toStringTag](){return"ManyKeysMap"}get size(){return super.size}}new se;function le(){}function F(n,...e){}const te={debug:(...n)=>F(console.debug,...n),log:(...n)=>F(console.log,...n),warn:(...n)=>F(console.warn,...n),error:(...n)=>F(console.error,...n)};return(async()=>{try{const{main:n,...e}=v,r=new D("content",e);return await n(r)}catch(n){throw te.error('The content script "content" crashed on startup!',n),n}})()})();
content;
