!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClipboardAddon=t():e.ClipboardAddon=t()}(self,()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=t.BrowserClipboardProvider=t.ClipboardAddon=void 0,t.ClipboardAddon=class{constructor(e=new o,t=new r){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){const r=this._base64.encodeText(t);this._terminal?.input(`]52;${e};${r}`,!1)}_setOrReportClipboard(e){const t=e.split(";");if(t.length<2)return!0;const r=t[0],o=t[1];if("?"===o){const e=this._provider.readText(r);return e instanceof Promise?e.then(e=>(this._readText(r,e),!0)):(this._readText(r,e),!0)}let s="";try{s=this._base64.decodeText(o)}catch{}const i=this._provider.writeText(r,s);return!(i instanceof Promise)||i.then(()=>!0)}};class r{readText(e){return navigator.clipboard.readText()}writeText(e,t){return navigator.clipboard.writeText(t)}}t.BrowserClipboardProvider=r;class o{encodeText(e){return btoa(e)}decodeText(e){try{return atob(e)}catch{}return""}}t.Base64=o})(),e})());//# sourceMappingURL=http://go/sourcemap/sourcemaps/fc2563ec93d793fc275eef734405a4fdf8b47b20/node_modules/@xterm/addon-clipboard/lib/addon-clipboard.js.map