/* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. GitHub Web Components Polyfill Add-on Copyright (c) 2020 JustOff. All rights reserved. Element.prototype.toggleAttribute and Array.prototype.flat polyfills Copyright (c) 2005-2020 Mozilla and individual contributors. https://developer.mozilla.org/docs/Web/API/Element/toggleAttribute https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/flat Array.prototype.flatMap polyfill Copyright (c) 2017 Aluan Haddad. https://github.com/aluanhaddad/flat-map PerformanceObserver polyfill Copyright (c) 2020 Fastly, Inc. https://github.com/fastly/performance-observer-polyfill Custom Elements polyfill Copyright (c) 2020 The Polymer Project Authors. All rights reserved. https://github.com/webcomponents/polyfills */ "use strict"; var Cc = Components.classes, Ci = Components.interfaces, Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); const isSeaMonkey = Services.appinfo.name == "SeaMonkey"; const pfSeaMonkey = `(function(){ if (!Element.prototype.toggleAttribute) { Element.prototype.toggleAttribute = function(name, force) { if(force !== void 0) force = !!force if (this.hasAttribute(name)) { if (force) return true; this.removeAttribute(name); return false; } if (force === false) return false; this.setAttribute(name, ""); return true; }; } function flattenIntoArray(target, source, start, depth, mapperFunction, thisArg) { const mapperFunctionProvied = mapperFunction !== undefined; let targetIndex = start; let sourceIndex = 0; const sourceLen = source.length; while (sourceIndex < sourceLen) { const p = sourceIndex; const exists = !!source[p]; if (exists === true) { let element = source[p]; if (element) { if (mapperFunctionProvied) { element = mapperFunction.call(thisArg, element, sourceIndex, target); } const spreadable = Object.getOwnPropertySymbols(element).includes(Symbol.isConcatSpreadable) || Array.isArray(element); if (spreadable === true && depth > 0) { const nextIndex = flattenIntoArray(target, element, targetIndex, depth - 1); targetIndex = nextIndex; } else { if (!Number.isSafeInteger(targetIndex)) { throw TypeError(); } target[targetIndex] = element; } } } targetIndex += 1; sourceIndex += 1; } return targetIndex; } function arraySpeciesCreate(originalArray, length) { const isArray = Array.isArray(originalArray); if (!isArray) { return Array(length); } let C = Object.getPrototypeOf(originalArray).constructor; if (C) { if (typeof C === 'object' || typeof C === 'function') { C = C[Symbol.species.toString()]; C = C !== null ? C : undefined; } if (C === undefined) { return Array(length); } if (typeof C !== 'function') { throw TypeError('invalid constructor'); } const result = new C(length); return result; } } if (!Object.prototype.hasOwnProperty.call(Array.prototype, 'flatMap')) { Array.prototype.flatMap = function flatMap(callbackFn, thisArg) { const o = Object(this); if (!callbackFn || typeof callbackFn.call !== 'function') { throw TypeError('callbackFn must be callable.'); } const t = thisArg !== undefined ? thisArg : undefined; const a = arraySpeciesCreate(o, o.length); flattenIntoArray(a, o, 0, 1, callbackFn, t); return a.filter(x => x !== undefined, a); }; } if (!Array.prototype.flat) { Array.prototype.flat = function() { var depth = arguments[0]; depth = depth === undefined ? 1 : Math.floor(depth); if (depth < 1) return Array.prototype.slice.call(this); return (function flat(arr, depth) { var len = arr.length >>> 0; var flattened = []; var i = 0; while (i < len) { if (i in arr) { var el = arr[i]; if (Array.isArray(el) && depth > 0) flattened = flattened.concat(flat(el, depth - 1)); else flattened.push(el); } i++; } return flattened; })(this, depth); }; } }).call(this);`; const hashSeaMonkey = "'sha256-e4RJ1+xAp4xhtpaeSLNr50yP+/R80IwoR3JYjsq58MY='"; const pfBase = `typeof queueMicrotask !== 'function' && (queueMicrotask = function(f) {setTimeout(f, 0)});(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},r=t.registeredObservers,n=void 0===r?new Set:r,o=t.processedEntries,i=void 0===o?new Set:o,u=t.interval,s=void 0===u?100:u,c=t.context,a=void 0===c?self:c;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,"registeredObservers",void 0),p(this,"processedEntries",void 0),p(this,"interval",void 0),p(this,"intervalId",void 0),p(this,"context",void 0),this.registeredObservers=n,this.processedEntries=i,this.interval=s,this.context=a,this.intervalId=null}var t,r,n;return t=e,(r=[{key:"getNewEntries",value:function(){var e=this;return this.context.performance.getEntries().filter((function(t){return!e.processedEntries.has(t)}))}},{key:"getObserversForType",value:function(e,t){return Array.from(e).filter((function(e){return e.entryTypes.some((function(e){return e===t}))}))}},{key:"processBuffer",value:function(e){var t=Array.from(e.buffer),r=new l(t);e.buffer.clear(),t.length&&e.callback&&e.callback.call(void 0,r,e)}},{key:"processEntries",value:function(){var e=this;this.getNewEntries().forEach((function(t){var r=t.entryType;e.getObserversForType(e.registeredObservers,r).forEach((function(e){e.buffer.add(t)})),e.processedEntries.add(t)}));var t=function(){return e.registeredObservers.forEach(e.processBuffer)};"requestAnimationFrame"in this.context?this.context.requestAnimationFrame(t):this.context.setTimeout(t,0)}},{key:"add",value:function(e){this.registeredObservers.add(e),1===this.registeredObservers.size&&this.observe()}},{key:"remove",value:function(e){this.registeredObservers.delete(e),this.registeredObservers.size||this.disconnect()}},{key:"observe",value:function(){this.intervalId=this.context.setInterval(this.processEntries.bind(this),this.interval)}},{key:"disconnect",value:function(){this.intervalId=this.context.clearInterval(this.intervalId)}}])&&y(t.prototype,r),n&&y(t,n),e}()),k=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),b(this,"callback",void 0),b(this,"buffer",void 0),b(this,"entryTypes",[]),b(this,"taskQueue",void 0),this.callback=t,this.buffer=new Set,this.taskQueue=r}var t,r,n;return t=e,(r=[{key:"observe",value:function(e){if(!e)throw new Error(h);if(e.entryTypes&&e.type)throw new Error(m);var t;if(e.entryTypes)t=e.entryTypes;else{if(!e.type)throw new Error(h);t=[e.type]}var r=t.filter(w);r.length>0&&r.length!==t.length&&console.warn(O),r.length?(this.entryTypes=r,this.taskQueue.add(this)):console.warn(g)}},{key:"disconnect",value:function(){this.taskQueue.remove(this)}},{key:"takeRecords",value:function(){var e=Array.from(this.buffer);return new l(e)}}])&&v(t.prototype,r),n&&v(t,n),e}();b(k,"supportedEntryTypes",d);var E="PerformanceObserver"in self&&"function"==typeof PerformanceObserver?PerformanceObserver:k,j=self;j.PerformanceObserver||(j.PerformanceObserver=E)}])}).call(this);(function(){if(Element.prototype.replaceChildren===undefined){Element.prototype.replaceChildren=function(...nodesOrDOMStrings){while(this.lastChild){this.removeChild(this.lastChild)}if(nodesOrDOMStrings.length){this.append(...nodesOrDOMStrings)}}}}());`; const hashBase = "'sha256-42R2FZJVkeBWdLoYdalbWdVqgI528zXbU9KqqdqXgRw='"; const customElements = `(function(){var n=window.Document.prototype.createElement,p=window.Document.prototype.createElementNS,aa=window.Document.prototype.importNode,ba=window.Document.prototype.prepend,ca=window.Document.prototype.append,da=window.DocumentFragment.prototype.prepend,ea=window.DocumentFragment.prototype.append,q=window.Node.prototype.cloneNode,r=window.Node.prototype.appendChild,t=window.Node.prototype.insertBefore,u=window.Node.prototype.removeChild,v=window.Node.prototype.replaceChild,w=Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"),y=window.Element.prototype.attachShadow,z=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),A=window.Element.prototype.getAttribute,B=window.Element.prototype.setAttribute,C=window.Element.prototype.removeAttribute,D=window.Element.prototype.getAttributeNS,E=window.Element.prototype.setAttributeNS,F=window.Element.prototype.removeAttributeNS,G=window.Element.prototype.insertAdjacentElement,H=window.Element.prototype.insertAdjacentHTML,fa=window.Element.prototype.prepend, ha=window.Element.prototype.append,ia=window.Element.prototype.before,ja=window.Element.prototype.after,ka=window.Element.prototype.replaceWith,la=window.Element.prototype.remove,ma=window.HTMLElement,I=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),na=window.HTMLElement.prototype.insertAdjacentElement,oa=window.HTMLElement.prototype.insertAdjacentHTML;var pa=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(a){return pa.add(a)});function qa(a){var b=pa.has(a);a=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(a);return!b&&a}var ra=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement); function J(a){var b=a.isConnected;if(void 0!==b)return b;if(ra(a))return!0;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))}function K(a){var b=a.children;if(b)return Array.prototype.slice.call(b);b=[];for(a=a.firstChild;a;a=a.nextSibling)a.nodeType===Node.ELEMENT_NODE&&b.push(a);return b} function L(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null} function M(a,b,c){for(var f=a;f;){if(f.nodeType===Node.ELEMENT_NODE){var d=f;b(d);var e=d.localName;if("link"===e&&"import"===d.getAttribute("rel")){f=d.import;void 0===c&&(c=new Set);if(f instanceof Node&&!c.has(f))for(c.add(f),f=f.firstChild;f;f=f.nextSibling)M(f,b,c);f=L(a,d);continue}else if("template"===e){f=L(a,d);continue}if(d=d.__CE_shadowRoot)for(d=d.firstChild;d;d=d.nextSibling)M(d,b,c)}f=f.firstChild?f.firstChild:L(a,f)}};function N(){var a=!(null===O||void 0===O||!O.noDocumentConstructionObserver),b=!(null===O||void 0===O||!O.shadyDomFastWalk);this.h=[];this.a=[];this.f=!1;this.shadyDomFastWalk=b;this.C=!a}function P(a,b,c,f){var d=window.ShadyDom;if(a.shadyDomFastWalk&&d&&d.inUse){if(b.nodeType===Node.ELEMENT_NODE&&c(b),b.querySelectorAll)for(a=d.nativeMethods.querySelectorAll.call(b,"*"),b=0;b", ""); data = data.replace("", ""); if (isSeaMonkey) { data = data.replace("", ""); } } else if (this.site == "gitlab") { data = data.replace("" + customElements + "", "(").replace(".groups.iid", "[1]"); // https://gitlab.com/gitlab-org/gitlab-ui/-/commit/d23c341bb8cef5683bf2d49556dabe4008be76cf data = data.replace("\\p{Emoji}", "[\\u{1f300}-\\u{1f5ff}\\u{1f900}-\\u{1f9ff}\\u{1f600}-\\u{1f64f}\\u{1f680}-\\u{1f6ff}\\u{2600}-\\u{26ff}\\u{2700}-\\u{27bf}\\u{1f1e6}-\\u{1f1ff}\\u{1f191}-\\u{1f251}\\u{1f004}\\u{1f0cf}\\u{1f170}-\\u{1f171}\\u{1f17e}-\\u{1f17f}\\u{1f18e}\\u{3030}\\u{2b50}\\u{2b55}\\u{2934}-\\u{2935}\\u{2b05}-\\u{2b07}\\u{2b1b}-\\u{2b1c}\\u{3297}\\u{3299}\\u{303d}\\u{00a9}\\u{00ae}\\u{2122}\\u{23f3}\\u{24c2}\\u{23e9}-\\u{23ef}\\u{25b6}\\u{23f8}-\\u{23fa}]"); } } catch (e) {} let storageStream = Cc["@mozilla.org/storagestream;1"].createInstance(Ci["nsIStorageStream"]); storageStream.init(8192, data.length, null); let os = storageStream.getOutputStream(0); if (data.length > 0) { os.write(data, data.length); } os.close(); try { this.originalListener.onDataAvailable(request, context, storageStream.newInputStream(0), 0, data.length); } catch (e) {} try { this.originalListener.onStopRequest(request, context, statusCode); } catch (e) {} }, QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamListener, Ci.nsISupports]) } function startup(data, reason) { Services.obs.addObserver(httpObserver, "http-on-examine-response", false); Services.obs.addObserver(httpObserver, "http-on-examine-cached-response", false); if (isSeaMonkey) { Services.obs.addObserver(httpObserver, "http-on-modify-request", false); } } function shutdown(data, reason) { if (reason == APP_SHUTDOWN) { return; } if (isSeaMonkey) { Services.obs.removeObserver(httpObserver, "http-on-modify-request", false); } Services.obs.removeObserver(httpObserver, "http-on-examine-cached-response", false); Services.obs.removeObserver(httpObserver, "http-on-examine-response", false); } function install() {} function uninstall() {}