main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
declare const getTarget: (target: any) => any;
declare let __webpack_nonce__: string;

View File

@@ -0,0 +1,57 @@
"use strict";
const getTarget = (()=>{
const memo = {};
return function memorize(target) {
if (typeof memo[target] === "undefined") {
let styleTarget = document.querySelector(target);
// Special case to return head of iframe instead of iframe itself
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
styleTarget = styleTarget.contentDocument.head;
} catch (e) {
// istanbul ignore next
styleTarget = null;
}
}
memo[target] = styleTarget;
}
return memo[target];
};
})();
module.exports = (url, options)=>{
options = options || {};
options.attributes = typeof options.attributes === "object" ? options.attributes : {};
if (typeof options.attributes.nonce === "undefined") {
const nonce = // eslint-disable-next-line no-undef
typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
if (nonce) {
options.attributes.nonce = nonce;
}
}
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = url;
Object.keys(options.attributes).forEach((key)=>{
link.setAttribute(key, options.attributes[key]);
});
if (typeof options.insert === "function") {
options.insert(link);
} else {
const target = getTarget(options.insert || "head");
if (!target) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
}
target.appendChild(link);
}
return (newUrl)=>{
if (typeof newUrl === "string") {
link.href = newUrl;
} else {
link.parentNode.removeChild(link);
}
};
};
//# sourceMappingURL=injectStylesIntoLinkTag.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoLinkTag.ts"],"names":["getTarget","memo","memorize","target","styleTarget","document","querySelector","window","HTMLIFrameElement","contentDocument","head","e","module","exports","url","options","attributes","nonce","__webpack_nonce__","link","createElement","rel","href","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","newUrl","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I,CAACzB,QAAQ;YACX,MAAM,IAAI0B,MACR;QAEJ;QAEA1B,OAAO2B,WAAW,CAACX;IACrB;IAEA,OAAO,CAACY;QACN,IAAI,OAAOA,WAAW,UAAU;YAC9BZ,KAAKG,IAAI,GAAGS;QACd,OAAO;YACLZ,KAAKa,UAAU,CAAEC,WAAW,CAACd;QAC/B;IACF;AACF"}

View File

@@ -0,0 +1,13 @@
declare const isOldIE: () => any;
declare const getTargetElement: (target: any) => any;
declare const stylesInDom: any;
declare function getIndexByIdentifier(identifier: any): number;
declare function modulesToDom(list: any, options: any): string[];
declare function insertStyleElement(options: any): HTMLStyleElement;
declare function removeStyleElement(style: any): false | undefined;
declare const replaceText: (index: any, replacement: any) => any;
declare function applyToSingletonTag(style: any, index: any, remove: any, obj: any): void;
declare function applyToTag(style: any, _options: any, obj: any): void;
declare let singleton: any;
declare let singletonCounter: number;
declare function addStyle(obj: any, options: any): (newObj: any) => void;

View File

@@ -0,0 +1,218 @@
"use strict";
const isOldIE = function isOldIE() {
let memo;
return function memorize() {
if (typeof memo === "undefined") {
// Test for IE <= 9 as proposed by Browserhacks
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// Tests for existence of standard globals is to allow style-loader
// to operate correctly into non-standard environments
// @see https://github.com/webpack-contrib/style-loader/issues/177
memo = Boolean(window && document && document.all && !window.atob);
}
return memo;
};
}();
const getTargetElement = function() {
const memo = {};
return function memorize(target) {
if (typeof memo[target] === "undefined") {
let styleTarget = document.querySelector(target);
// Special case to return head of iframe instead of iframe itself
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
styleTarget = styleTarget.contentDocument.head;
} catch (e) {
// istanbul ignore next
styleTarget = null;
}
}
memo[target] = styleTarget;
}
return memo[target];
};
}();
const stylesInDom = [];
function getIndexByIdentifier(identifier) {
let result = -1;
for(let i = 0; i < stylesInDom.length; i++){
if (stylesInDom[i].identifier === identifier) {
result = i;
break;
}
}
return result;
}
function modulesToDom(list, options) {
const idCountMap = {};
const identifiers = [];
for(let i = 0; i < list.length; i++){
const item = list[i];
const id = options.base ? item[0] + options.base : item[0];
const count = idCountMap[id] || 0;
const identifier = id + " " + count.toString();
idCountMap[id] = count + 1;
const index = getIndexByIdentifier(identifier);
const obj = {
css: item[1],
media: item[2],
sourceMap: item[3]
};
if (index !== -1) {
stylesInDom[index].references++;
stylesInDom[index].updater(obj);
} else {
stylesInDom.push({
identifier: identifier,
// eslint-disable-next-line @typescript-eslint/no-use-before-define
updater: addStyle(obj, options),
references: 1
});
}
identifiers.push(identifier);
}
return identifiers;
}
function insertStyleElement(options) {
const style = document.createElement("style");
const attributes = options.attributes || {};
if (typeof attributes.nonce === "undefined") {
const nonce = // eslint-disable-next-line no-undef
typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
if (nonce) {
attributes.nonce = nonce;
}
}
Object.keys(attributes).forEach(function(key) {
style.setAttribute(key, attributes[key]);
});
if (typeof options.insert === "function") {
options.insert(style);
} else {
const target = getTargetElement(options.insert || "head");
if (!target) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
}
target.appendChild(style);
}
return style;
}
function removeStyleElement(style) {
// istanbul ignore if
if (style.parentNode === null) {
return false;
}
style.parentNode.removeChild(style);
}
/* istanbul ignore next */ const replaceText = function replaceText() {
const textStore = [];
return function replace(index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join("\n");
};
}();
function applyToSingletonTag(style, index, remove, obj) {
const css = remove ? "" : obj.media ? "@media " + obj.media + " {" + obj.css + "}" : obj.css;
// For old IE
/* istanbul ignore if */ if (style.styleSheet) {
style.styleSheet.cssText = replaceText(index, css);
} else {
const cssNode = document.createTextNode(css);
const childNodes = style.childNodes;
if (childNodes[index]) {
style.removeChild(childNodes[index]);
}
if (childNodes.length) {
style.insertBefore(cssNode, childNodes[index]);
} else {
style.appendChild(cssNode);
}
}
}
function applyToTag(style, _options, obj) {
let css = obj.css;
const media = obj.media;
const sourceMap = obj.sourceMap;
if (media) {
style.setAttribute("media", media);
} else {
style.removeAttribute("media");
}
if (sourceMap && typeof btoa !== "undefined") {
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
}
// For old IE
/* istanbul ignore if */ if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
while(style.firstChild){
style.removeChild(style.firstChild);
}
style.appendChild(document.createTextNode(css));
}
}
let singleton = null;
let singletonCounter = 0;
function addStyle(obj, options) {
let style;
let update;
let remove;
if (options.singleton) {
const styleIndex = singletonCounter++;
style = singleton || (singleton = insertStyleElement(options));
update = applyToSingletonTag.bind(null, style, styleIndex, false);
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
} else {
style = insertStyleElement(options);
update = applyToTag.bind(null, style, options);
remove = function() {
removeStyleElement(style);
};
}
update(obj);
return function updateStyle(newObj) {
if (newObj) {
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
return;
}
update(obj = newObj);
} else {
remove();
}
};
}
module.exports = function(list, options) {
options = options || {};
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
if (!options.singleton && typeof options.singleton !== "boolean") {
options.singleton = isOldIE();
}
list = list || [];
let lastIdentifiers = modulesToDom(list, options);
return function update(newList) {
newList = newList || [];
if (Object.prototype.toString.call(newList) !== "[object Array]") {
return;
}
for(let i = 0; i < lastIdentifiers.length; i++){
const identifier = lastIdentifiers[i];
const index = getIndexByIdentifier(identifier);
stylesInDom[index].references--;
}
const newLastIdentifiers = modulesToDom(newList, options);
for(let i = 0; i < lastIdentifiers.length; i++){
const identifier = lastIdentifiers[i];
const index = getIndexByIdentifier(identifier);
if (stylesInDom[index].references === 0) {
stylesInDom[index].updater();
stylesInDom.splice(index, 1);
}
}
lastIdentifiers = newLastIdentifiers;
};
};
//# sourceMappingURL=injectStylesIntoStyleTag.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
declare function isEqualLocals(a: any, b: any, isNamedExport: any): boolean;

View File

@@ -0,0 +1,27 @@
"use strict";
function isEqualLocals(a, b, isNamedExport) {
if (!a && b || a && !b) {
return false;
}
let p;
for(p in a){
if (isNamedExport && p === "default") {
continue;
}
if (a[p] !== b[p]) {
return false;
}
}
for(p in b){
if (isNamedExport && p === "default") {
continue;
}
if (!a[p]) {
return false;
}
}
return true;
}
module.exports = isEqualLocals;
//# sourceMappingURL=isEqualLocals.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/next-style-loader/runtime/isEqualLocals.ts"],"names":["isEqualLocals","a","b","isNamedExport","p","module","exports"],"mappings":";AAAA,SAASA,cAAcC,CAAM,EAAEC,CAAM,EAAEC,aAAkB;IACvD,IAAI,AAAC,CAACF,KAAKC,KAAOD,KAAK,CAACC,GAAI;QAC1B,OAAO;IACT;IAEA,IAAIE;IAEJ,IAAKA,KAAKH,EAAG;QACX,IAAIE,iBAAiBC,MAAM,WAAW;YAEpC;QACF;QAEA,IAAIH,CAAC,CAACG,EAAE,KAAKF,CAAC,CAACE,EAAE,EAAE;YACjB,OAAO;QACT;IACF;IAEA,IAAKA,KAAKF,EAAG;QACX,IAAIC,iBAAiBC,MAAM,WAAW;YAEpC;QACF;QAEA,IAAI,CAACH,CAAC,CAACG,EAAE,EAAE;YACT,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEAC,OAAOC,OAAO,GAAGN"}