/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
"use strict";(function(){const{contextBridge:o,ipcRenderer:i}=require("electron");window.addEventListener("keydown",r=>{if(!(r instanceof KeyboardEvent)||!r.isTrusted||r.defaultPrevented)return;const y=r.key==="Escape"||/^F\d+$/.test(r.key)||r.key.startsWith("Audio")||r.key.startsWith("Media")||r.key.startsWith("Browser");if(!(r.ctrlKey||r.altKey||r.metaKey)&&!y)return;const e=navigator.platform.indexOf("Mac")>=0;if(r.altKey&&!r.ctrlKey&&!r.metaKey&&(e||/^Numpad\d+$/.test(r.code)))return;if((e?r.metaKey:r.ctrlKey)&&!r.altKey){const t=r.key.toLowerCase();if(!r.shiftKey&&(t==="a"||t==="c"||t==="v"||t==="x"||t==="z")||r.shiftKey&&(t==="v"||t==="z")||!r.shiftKey&&t==="y"&&!e)return}r.preventDefault(),r.stopPropagation(),i.send("vscode:browserView:keydown",{key:r.key,keyCode:r.keyCode,code:r.code,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,altKey:r.altKey,metaKey:r.metaKey,repeat:r.repeat})});const s={getSelectedText(){try{return window.getSelection()?.toString()??""}catch{return""}}};try{o.exposeInIsolatedWorld(999,"browserViewAPI",s)}catch(r){console.error(r)}})();
//# sourceMappingURL=preload-browserView.js.map
