From 17f27980c61ec85d782663188ba968b64560d248 Mon Sep 17 00:00:00 2001 From: iOS Date: Tue, 20 Sep 2022 23:56:37 +0200 Subject: [PATCH] cleanup geo data --- .obsidian/community-plugins.json | 4 +- .obsidian/graph.json | 2 +- .obsidian/plugins/obsidian-3d-graph/main.js | 30998 ++++++++++++++++ .../plugins/obsidian-3d-graph/manifest.json | 9 + .../obisidian-3d-graph-1.0.0.zip | Bin 0 -> 410744 bytes .../plugins/obsidian-3d-graph/styles.css | 57 + .../obsidian-activity-history/data.json | 16 +- .obsidian/plugins/obsidian-commits/data.json | 349 +- .../plugins/obsidian-dice-roller/main.js | 4 +- .../obsidian-dice-roller/manifest.json | 2 +- .obsidian/plugins/obsidian-kanban/main.js | 4 +- .../plugins/obsidian-kanban/manifest.json | 2 +- .obsidian/plugins/obsidian-kanban/styles.css | 2 +- .obsidian/plugins/obsidian-map-view/data.json | 39 +- .../obsidian-reminder-plugin/data.json | 58 +- .obsidian/plugins/plugins-galore/data.json | 24 + .obsidian/plugins/plugins-galore/main.js | 388 + .../plugins/plugins-galore/manifest.json | 10 + .obsidian/plugins/podnotes/data.json | 38 +- .obsidian/plugins/templater-obsidian/main.js | 352 +- .../plugins/templater-obsidian/manifest.json | 2 +- .obsidian/workspace | 32 +- 00.01 Admin/Calendars/2022-09-12.md | 4 +- 00.01 Admin/Calendars/2022-09-14.md | 4 +- 00.01 Admin/Calendars/2022-09-17.md | 5 +- .../2022-09-18 Lyon - Paris SG (0-1).md | 11 + 00.01 Admin/Calendars/2022-09-18.md | 112 + 00.01 Admin/Calendars/2022-09-19.md | 111 + 00.01 Admin/Calendars/2022-09-20.md | 112 + ...ctices For Leaders To Consider Adopting.md | 2 +- ...mpanies screw up their global expansion.md | 2 +- .../{@Professional.md => @@Professional.md} | 9 +- 00.06 Professional/@Useful tools.md | 77 + ... a support network, and raise millions..md | 2 +- ...push into regulated derivatives markets.md | 2 +- ...reurs de management à ne pas commettre.md | 2 +- ... tant que Responsable du Développement.md | 2 +- .../Managing people 🤯 Andreas Klinger.md | 2 +- .../Sameer Huda - gunnercooke llp.md | 2 +- ...p-by-step How to grow a company culture.md | 2 +- ... Agarwal, Bain Capital Partners SaaStr.md | 2 +- ...eds to Focus On — Advice from HubSpot.md | 2 +- ...Leading With Empathy (And How To Do It).md | 2 +- 01.01 Life Orga/@Lifestyle.md | 2 +- 01.02 Home/@Shopping list.md | 18 +- 01.02 Home/Household.md | 34 +- 01.02 Home/League Tables.md | 21 +- ...cal infos.md => Life - Practical infos.md} | 15 +- 02.01 London/Callum Anderson.md | 4 +- 02.01 London/Ealing Riding School.md | 3 +- 02.01 London/Epsom Polo Club.md | 3 +- 02.01 London/Ryan Anderson.md | 4 +- 02.02 Paris/Chez Robert.md | 2 +- 02.02 Paris/Domaine de Courances.md | 3 +- 02.02 Paris/Guibine.md | 5 +- 02.02 Paris/Haras de la Cense.md | 3 +- 02.02 Paris/Inavoué.md | 2 +- 02.02 Paris/Le Barn.md | 1 + 02.03 Zürich/Afghan Anar.md | 2 +- 02.03 Zürich/Baur's.md | 2 +- 02.03 Zürich/Bebek.md | 2 +- 02.03 Zürich/Bimi.md | 2 +- 02.03 Zürich/Café des Amis.md | 2 +- 02.03 Zürich/Cantinetta Antinori.md | 2 +- 02.03 Zürich/Daizy.md | 2 +- 02.03 Zürich/Dante.md | 2 +- 02.03 Zürich/Dolder Grand.md | 4 +- 02.03 Zürich/Francisco Podesta.md | 5 +- 02.03 Zürich/Franzos.md | 2 +- 02.03 Zürich/Gestuet Homberg.md | 2 +- 02.03 Zürich/Ginger.md | 2 +- 02.03 Zürich/Grande.md | 2 +- 02.03 Zürich/Kiosk.md | 2 +- 02.03 Zürich/La Baracca.md | 2 +- 02.03 Zürich/La Réserve.md | 2 +- 02.03 Zürich/La Stanza.md | 2 +- 02.03 Zürich/Le Mezzerie.md | 2 +- 02.03 Zürich/Le Raymond Bar.md | 2 +- 02.03 Zürich/Luca2.md | 2 +- 02.03 Zürich/Luigia.md | 109 + 02.03 Zürich/Modo.md | 2 +- 02.03 Zürich/Monocle.md | 2 +- 02.03 Zürich/No Idea.md | 2 +- 02.03 Zürich/Polo Park Zürich.md | 2 +- 02.03 Zürich/Rosi.md | 2 +- 02.03 Zürich/Schluessel.md | 2 +- 02.03 Zürich/Shilla.md | 2 +- 02.03 Zürich/Toto.md | 2 +- 03.04 Cinematheque/@Cinematheque.md | 2 +- 05.02 Networks/Server VPN.md | 3 +- 90 files changed, 32634 insertions(+), 524 deletions(-) create mode 100644 .obsidian/plugins/obsidian-3d-graph/main.js create mode 100644 .obsidian/plugins/obsidian-3d-graph/manifest.json create mode 100644 .obsidian/plugins/obsidian-3d-graph/obisidian-3d-graph-1.0.0.zip create mode 100644 .obsidian/plugins/obsidian-3d-graph/styles.css create mode 100644 .obsidian/plugins/plugins-galore/data.json create mode 100644 .obsidian/plugins/plugins-galore/main.js create mode 100644 .obsidian/plugins/plugins-galore/manifest.json create mode 100644 00.01 Admin/Calendars/2022-09-18 Lyon - Paris SG (0-1).md create mode 100644 00.01 Admin/Calendars/2022-09-18.md create mode 100644 00.01 Admin/Calendars/2022-09-19.md create mode 100644 00.01 Admin/Calendars/2022-09-20.md rename 00.06 Professional/{@Professional.md => @@Professional.md} (91%) create mode 100644 00.06 Professional/@Useful tools.md rename 01.02 Home/{Zürich - Practical infos.md => Life - Practical infos.md} (91%) create mode 100644 02.03 Zürich/Luigia.md diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index a341a58c..57318840 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -61,5 +61,7 @@ "emoji-shortcodes", "obsidian-banners", "templater-obsidian", - "obsidian-kanban" + "obsidian-kanban", + "plugins-galore", + "obsidian-3d-graph" ] \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json index af8300a7..bb4391d5 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -95,6 +95,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 0.16523273475461206, + "scale": 0.1470305035890801, "close": true } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-3d-graph/main.js b/.obsidian/plugins/obsidian-3d-graph/main.js new file mode 100644 index 00000000..96afc568 --- /dev/null +++ b/.obsidian/plugins/obsidian-3d-graph/main.js @@ -0,0 +1,30998 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/ngraph.events/index.js +var require_ngraph = __commonJS({ + "node_modules/ngraph.events/index.js"(exports2, module2) { + module2.exports = function eventify(subject) { + validateSubject(subject); + var eventsStorage = createEventsStorage(subject); + subject.on = eventsStorage.on; + subject.off = eventsStorage.off; + subject.fire = eventsStorage.fire; + return subject; + }; + function createEventsStorage(subject) { + var registeredEvents = /* @__PURE__ */ Object.create(null); + return { + on: function(eventName, callback, ctx) { + if (typeof callback !== "function") { + throw new Error("callback is expected to be a function"); + } + var handlers = registeredEvents[eventName]; + if (!handlers) { + handlers = registeredEvents[eventName] = []; + } + handlers.push({ callback, ctx }); + return subject; + }, + off: function(eventName, callback) { + var wantToRemoveAll = typeof eventName === "undefined"; + if (wantToRemoveAll) { + registeredEvents = /* @__PURE__ */ Object.create(null); + return subject; + } + if (registeredEvents[eventName]) { + var deleteAllCallbacksForEvent = typeof callback !== "function"; + if (deleteAllCallbacksForEvent) { + delete registeredEvents[eventName]; + } else { + var callbacks = registeredEvents[eventName]; + for (var i = 0; i < callbacks.length; ++i) { + if (callbacks[i].callback === callback) { + callbacks.splice(i, 1); + } + } + } + } + return subject; + }, + fire: function(eventName) { + var callbacks = registeredEvents[eventName]; + if (!callbacks) { + return subject; + } + var fireArguments; + if (arguments.length > 1) { + fireArguments = Array.prototype.splice.call(arguments, 1); + } + for (var i = 0; i < callbacks.length; ++i) { + var callbackInfo = callbacks[i]; + callbackInfo.callback.apply(callbackInfo.ctx, fireArguments); + } + return subject; + } + }; + } + function validateSubject(subject) { + if (!subject) { + throw new Error("Eventify cannot use falsy object as events subject"); + } + var reservedWords = ["on", "fire", "off"]; + for (var i = 0; i < reservedWords.length; ++i) { + if (subject.hasOwnProperty(reservedWords[i])) { + throw new Error("Subject cannot be eventified, since it already has property '" + reservedWords[i] + "'"); + } + } + } + } +}); + +// node_modules/ngraph.graph/index.js +var require_ngraph2 = __commonJS({ + "node_modules/ngraph.graph/index.js"(exports2, module2) { + module2.exports = createGraph; + var eventify = require_ngraph(); + function createGraph(options) { + options = options || {}; + if ("uniqueLinkId" in options) { + console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n", "\n", "Note: there is also change in default behavior: From now on each graph\nis considered to be not a multigraph by default (each edge is unique)."); + options.multigraph = options.uniqueLinkId; + } + if (options.multigraph === void 0) + options.multigraph = false; + if (typeof Map !== "function") { + throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph"); + } + var nodes = /* @__PURE__ */ new Map(); + var links = /* @__PURE__ */ new Map(); + var multiEdges = {}; + var suspendEvents = 0; + var createLink = options.multigraph ? createUniqueLink : createSingleLink, changes = [], recordLinkChange = noop2, recordNodeChange = noop2, enterModification = noop2, exitModification = noop2; + var graphPart = { + version: 20, + addNode, + addLink, + removeLink, + removeNode, + getNode, + getNodeCount, + getLinkCount, + getEdgeCount: getLinkCount, + getLinksCount: getLinkCount, + getNodesCount: getNodeCount, + getLinks, + forEachNode, + forEachLinkedNode, + forEachLink, + beginUpdate: enterModification, + endUpdate: exitModification, + clear, + hasLink: getLink, + hasNode: getNode, + getLink + }; + eventify(graphPart); + monitorSubscribers(); + return graphPart; + function monitorSubscribers() { + var realOn = graphPart.on; + graphPart.on = on; + function on() { + graphPart.beginUpdate = enterModification = enterModificationReal; + graphPart.endUpdate = exitModification = exitModificationReal; + recordLinkChange = recordLinkChangeReal; + recordNodeChange = recordNodeChangeReal; + graphPart.on = realOn; + return realOn.apply(graphPart, arguments); + } + } + function recordLinkChangeReal(link, changeType) { + changes.push({ + link, + changeType + }); + } + function recordNodeChangeReal(node, changeType) { + changes.push({ + node, + changeType + }); + } + function addNode(nodeId, data) { + if (nodeId === void 0) { + throw new Error("Invalid node identifier"); + } + enterModification(); + var node = getNode(nodeId); + if (!node) { + node = new Node2(nodeId, data); + recordNodeChange(node, "add"); + } else { + node.data = data; + recordNodeChange(node, "update"); + } + nodes.set(nodeId, node); + exitModification(); + return node; + } + function getNode(nodeId) { + return nodes.get(nodeId); + } + function removeNode(nodeId) { + var node = getNode(nodeId); + if (!node) { + return false; + } + enterModification(); + var prevLinks = node.links; + if (prevLinks) { + prevLinks.forEach(removeLinkInstance); + node.links = null; + } + nodes.delete(nodeId); + recordNodeChange(node, "remove"); + exitModification(); + return true; + } + function addLink(fromId, toId, data) { + enterModification(); + var fromNode = getNode(fromId) || addNode(fromId); + var toNode = getNode(toId) || addNode(toId); + var link = createLink(fromId, toId, data); + var isUpdate = links.has(link.id); + links.set(link.id, link); + addLinkToNode(fromNode, link); + if (fromId !== toId) { + addLinkToNode(toNode, link); + } + recordLinkChange(link, isUpdate ? "update" : "add"); + exitModification(); + return link; + } + function createSingleLink(fromId, toId, data) { + var linkId = makeLinkId(fromId, toId); + var prevLink = links.get(linkId); + if (prevLink) { + prevLink.data = data; + return prevLink; + } + return new Link2(fromId, toId, data, linkId); + } + function createUniqueLink(fromId, toId, data) { + var linkId = makeLinkId(fromId, toId); + var isMultiEdge = multiEdges.hasOwnProperty(linkId); + if (isMultiEdge || getLink(fromId, toId)) { + if (!isMultiEdge) { + multiEdges[linkId] = 0; + } + var suffix = "@" + ++multiEdges[linkId]; + linkId = makeLinkId(fromId + suffix, toId + suffix); + } + return new Link2(fromId, toId, data, linkId); + } + function getNodeCount() { + return nodes.size; + } + function getLinkCount() { + return links.size; + } + function getLinks(nodeId) { + var node = getNode(nodeId); + return node ? node.links : null; + } + function removeLink(link, otherId) { + if (otherId !== void 0) { + link = getLink(link, otherId); + } + return removeLinkInstance(link); + } + function removeLinkInstance(link) { + if (!link) { + return false; + } + if (!links.get(link.id)) + return false; + enterModification(); + links.delete(link.id); + var fromNode = getNode(link.fromId); + var toNode = getNode(link.toId); + if (fromNode) { + fromNode.links.delete(link); + } + if (toNode) { + toNode.links.delete(link); + } + recordLinkChange(link, "remove"); + exitModification(); + return true; + } + function getLink(fromNodeId, toNodeId) { + if (fromNodeId === void 0 || toNodeId === void 0) + return void 0; + return links.get(makeLinkId(fromNodeId, toNodeId)); + } + function clear() { + enterModification(); + forEachNode(function(node) { + removeNode(node.id); + }); + exitModification(); + } + function forEachLink(callback) { + if (typeof callback === "function") { + var valuesIterator = links.values(); + var nextValue = valuesIterator.next(); + while (!nextValue.done) { + if (callback(nextValue.value)) { + return true; + } + nextValue = valuesIterator.next(); + } + } + } + function forEachLinkedNode(nodeId, callback, oriented) { + var node = getNode(nodeId); + if (node && node.links && typeof callback === "function") { + if (oriented) { + return forEachOrientedLink(node.links, nodeId, callback); + } else { + return forEachNonOrientedLink(node.links, nodeId, callback); + } + } + } + function forEachNonOrientedLink(links2, nodeId, callback) { + var quitFast; + var valuesIterator = links2.values(); + var nextValue = valuesIterator.next(); + while (!nextValue.done) { + var link = nextValue.value; + var linkedNodeId = link.fromId === nodeId ? link.toId : link.fromId; + quitFast = callback(nodes.get(linkedNodeId), link); + if (quitFast) { + return true; + } + nextValue = valuesIterator.next(); + } + } + function forEachOrientedLink(links2, nodeId, callback) { + var quitFast; + var valuesIterator = links2.values(); + var nextValue = valuesIterator.next(); + while (!nextValue.done) { + var link = nextValue.value; + if (link.fromId === nodeId) { + quitFast = callback(nodes.get(link.toId), link); + if (quitFast) { + return true; + } + } + nextValue = valuesIterator.next(); + } + } + function noop2() { + } + function enterModificationReal() { + suspendEvents += 1; + } + function exitModificationReal() { + suspendEvents -= 1; + if (suspendEvents === 0 && changes.length > 0) { + graphPart.fire("changed", changes); + changes.length = 0; + } + } + function forEachNode(callback) { + if (typeof callback !== "function") { + throw new Error("Function is expected to iterate over graph nodes. You passed " + callback); + } + var valuesIterator = nodes.values(); + var nextValue = valuesIterator.next(); + while (!nextValue.done) { + if (callback(nextValue.value)) { + return true; + } + nextValue = valuesIterator.next(); + } + } + } + function Node2(id, data) { + this.id = id; + this.links = null; + this.data = data; + } + function addLinkToNode(node, link) { + if (node.links) { + node.links.add(link); + } else { + node.links = /* @__PURE__ */ new Set([link]); + } + } + function Link2(fromId, toId, data, id) { + this.fromId = fromId; + this.toId = toId; + this.data = data; + this.id = id; + } + function makeLinkId(fromId, toId) { + return fromId.toString() + "\u{1F449} " + toId.toString(); + } + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/getVariableName.js +var require_getVariableName = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/getVariableName.js"(exports2, module2) { + module2.exports = function getVariableName(index5) { + if (index5 === 0) + return "x"; + if (index5 === 1) + return "y"; + if (index5 === 2) + return "z"; + return "c" + (index5 + 1); + }; + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/createPatternBuilder.js +var require_createPatternBuilder = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/createPatternBuilder.js"(exports2, module2) { + var getVariableName = require_getVariableName(); + module2.exports = function createPatternBuilder(dimension) { + return pattern; + function pattern(template, config) { + let indent = config && config.indent || 0; + let join = config && config.join !== void 0 ? config.join : "\n"; + let indentString = Array(indent + 1).join(" "); + let buffer = []; + for (let i = 0; i < dimension; ++i) { + let variableName = getVariableName(i); + let prefix = i === 0 ? "" : indentString; + buffer.push(prefix + template.replace(/{var}/g, variableName)); + } + return buffer.join(join); + } + }; + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/generateCreateBody.js +var require_generateCreateBody = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/generateCreateBody.js"(exports2, module2) { + var createPatternBuilder = require_createPatternBuilder(); + module2.exports = generateCreateBodyFunction; + module2.exports.generateCreateBodyFunctionBody = generateCreateBodyFunctionBody; + module2.exports.getVectorCode = getVectorCode; + module2.exports.getBodyCode = getBodyCode; + function generateCreateBodyFunction(dimension, debugSetters) { + let code = generateCreateBodyFunctionBody(dimension, debugSetters); + let { Body } = new Function(code)(); + return Body; + } + function generateCreateBodyFunctionBody(dimension, debugSetters) { + let code = ` +${getVectorCode(dimension, debugSetters)} +${getBodyCode(dimension, debugSetters)} +return {Body: Body, Vector: Vector}; +`; + return code; + } + function getBodyCode(dimension) { + let pattern = createPatternBuilder(dimension); + let variableList = pattern("{var}", { join: ", " }); + return ` +function Body(${variableList}) { + this.isPinned = false; + this.pos = new Vector(${variableList}); + this.force = new Vector(); + this.velocity = new Vector(); + this.mass = 1; + + this.springCount = 0; + this.springLength = 0; +} + +Body.prototype.reset = function() { + this.force.reset(); + this.springCount = 0; + this.springLength = 0; +} + +Body.prototype.setPosition = function (${variableList}) { + ${pattern("this.pos.{var} = {var} || 0;", { indent: 2 })} +};`; + } + function getVectorCode(dimension, debugSetters) { + let pattern = createPatternBuilder(dimension); + let setters = ""; + if (debugSetters) { + setters = `${pattern("\n var v{var};\nObject.defineProperty(this, '{var}', {\n set: function(v) { \n if (!Number.isFinite(v)) throw new Error('Cannot set non-numbers to {var}');\n v{var} = v; \n },\n get: function() { return v{var}; }\n});")}`; + } + let variableList = pattern("{var}", { join: ", " }); + return `function Vector(${variableList}) { + ${setters} + if (typeof arguments[0] === 'object') { + // could be another vector + let v = arguments[0]; + ${pattern('if (!Number.isFinite(v.{var})) throw new Error("Expected value is not a finite number at Vector constructor ({var})");', { indent: 4 })} + ${pattern("this.{var} = v.{var};", { indent: 4 })} + } else { + ${pattern('this.{var} = typeof {var} === "number" ? {var} : 0;', { indent: 4 })} + } + } + + Vector.prototype.reset = function () { + ${pattern("this.{var} = ", { join: "" })}0; + };`; + } + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/generateQuadTree.js +var require_generateQuadTree = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/generateQuadTree.js"(exports2, module2) { + var createPatternBuilder = require_createPatternBuilder(); + var getVariableName = require_getVariableName(); + module2.exports = generateQuadTreeFunction; + module2.exports.generateQuadTreeFunctionBody = generateQuadTreeFunctionBody; + module2.exports.getInsertStackCode = getInsertStackCode; + module2.exports.getQuadNodeCode = getQuadNodeCode; + module2.exports.isSamePosition = isSamePosition; + module2.exports.getChildBodyCode = getChildBodyCode; + module2.exports.setChildBodyCode = setChildBodyCode; + function generateQuadTreeFunction(dimension) { + let code = generateQuadTreeFunctionBody(dimension); + return new Function(code)(); + } + function generateQuadTreeFunctionBody(dimension) { + let pattern = createPatternBuilder(dimension); + let quadCount = Math.pow(2, dimension); + let code = ` +${getInsertStackCode()} +${getQuadNodeCode(dimension)} +${isSamePosition(dimension)} +${getChildBodyCode(dimension)} +${setChildBodyCode(dimension)} + +function createQuadTree(options, random) { + options = options || {}; + options.gravity = typeof options.gravity === 'number' ? options.gravity : -1; + options.theta = typeof options.theta === 'number' ? options.theta : 0.8; + + var gravity = options.gravity; + var updateQueue = []; + var insertStack = new InsertStack(); + var theta = options.theta; + + var nodesCache = []; + var currentInCache = 0; + var root = newNode(); + + return { + insertBodies: insertBodies, + + /** + * Gets root node if it is present + */ + getRoot: function() { + return root; + }, + + updateBodyForce: update, + + options: function(newOptions) { + if (newOptions) { + if (typeof newOptions.gravity === 'number') { + gravity = newOptions.gravity; + } + if (typeof newOptions.theta === 'number') { + theta = newOptions.theta; + } + + return this; + } + + return { + gravity: gravity, + theta: theta + }; + } + }; + + function newNode() { + // To avoid pressure on GC we reuse nodes. + var node = nodesCache[currentInCache]; + if (node) { +${assignQuads(" node.")} + node.body = null; + node.mass = ${pattern("node.mass_{var} = ", { join: "" })}0; + ${pattern("node.min_{var} = node.max_{var} = ", { join: "" })}0; + } else { + node = new QuadNode(); + nodesCache[currentInCache] = node; + } + + ++currentInCache; + return node; + } + + function update(sourceBody) { + var queue = updateQueue; + var v; + ${pattern("var d{var};", { indent: 4 })} + var r; + ${pattern("var f{var} = 0;", { indent: 4 })} + var queueLength = 1; + var shiftIdx = 0; + var pushIdx = 1; + + queue[0] = root; + + while (queueLength) { + var node = queue[shiftIdx]; + var body = node.body; + + queueLength -= 1; + shiftIdx += 1; + var differentBody = (body !== sourceBody); + if (body && differentBody) { + // If the current node is a leaf node (and it is not source body), + // calculate the force exerted by the current node on body, and add this + // amount to body's net force. + ${pattern("d{var} = body.pos.{var} - sourceBody.pos.{var};", { indent: 8 })} + r = Math.sqrt(${pattern("d{var} * d{var}", { join: " + " })}); + + if (r === 0) { + // Poor man's protection against zero distance. + ${pattern("d{var} = (random.nextDouble() - 0.5) / 50;", { indent: 10 })} + r = Math.sqrt(${pattern("d{var} * d{var}", { join: " + " })}); + } + + // This is standard gravitation force calculation but we divide + // by r^3 to save two operations when normalizing force vector. + v = gravity * body.mass * sourceBody.mass / (r * r * r); + ${pattern("f{var} += v * d{var};", { indent: 8 })} + } else if (differentBody) { + // Otherwise, calculate the ratio s / r, where s is the width of the region + // represented by the internal node, and r is the distance between the body + // and the node's center-of-mass + ${pattern("d{var} = node.mass_{var} / node.mass - sourceBody.pos.{var};", { indent: 8 })} + r = Math.sqrt(${pattern("d{var} * d{var}", { join: " + " })}); + + if (r === 0) { + // Sorry about code duplication. I don't want to create many functions + // right away. Just want to see performance first. + ${pattern("d{var} = (random.nextDouble() - 0.5) / 50;", { indent: 10 })} + r = Math.sqrt(${pattern("d{var} * d{var}", { join: " + " })}); + } + // If s / r < \u03B8, treat this internal node as a single body, and calculate the + // force it exerts on sourceBody, and add this amount to sourceBody's net force. + if ((node.max_${getVariableName(0)} - node.min_${getVariableName(0)}) / r < theta) { + // in the if statement above we consider node's width only + // because the region was made into square during tree creation. + // Thus there is no difference between using width or height. + v = gravity * node.mass * sourceBody.mass / (r * r * r); + ${pattern("f{var} += v * d{var};", { indent: 10 })} + } else { + // Otherwise, run the procedure recursively on each of the current node's children. + + // I intentionally unfolded this loop, to save several CPU cycles. +${runRecursiveOnChildren()} + } + } + } + + ${pattern("sourceBody.force.{var} += f{var};", { indent: 4 })} + } + + function insertBodies(bodies) { + ${pattern("var {var}min = Number.MAX_VALUE;", { indent: 4 })} + ${pattern("var {var}max = Number.MIN_VALUE;", { indent: 4 })} + var i = bodies.length; + + // To reduce quad tree depth we are looking for exact bounding box of all particles. + while (i--) { + var pos = bodies[i].pos; + ${pattern("if (pos.{var} < {var}min) {var}min = pos.{var};", { indent: 6 })} + ${pattern("if (pos.{var} > {var}max) {var}max = pos.{var};", { indent: 6 })} + } + + // Makes the bounds square. + var maxSideLength = -Infinity; + ${pattern("if ({var}max - {var}min > maxSideLength) maxSideLength = {var}max - {var}min ;", { indent: 4 })} + + currentInCache = 0; + root = newNode(); + ${pattern("root.min_{var} = {var}min;", { indent: 4 })} + ${pattern("root.max_{var} = {var}min + maxSideLength;", { indent: 4 })} + + i = bodies.length - 1; + if (i >= 0) { + root.body = bodies[i]; + } + while (i--) { + insert(bodies[i], root); + } + } + + function insert(newBody) { + insertStack.reset(); + insertStack.push(root, newBody); + + while (!insertStack.isEmpty()) { + var stackItem = insertStack.pop(); + var node = stackItem.node; + var body = stackItem.body; + + if (!node.body) { + // This is internal node. Update the total mass of the node and center-of-mass. + ${pattern("var {var} = body.pos.{var};", { indent: 8 })} + node.mass += body.mass; + ${pattern("node.mass_{var} += body.mass * {var};", { indent: 8 })} + + // Recursively insert the body in the appropriate quadrant. + // But first find the appropriate quadrant. + var quadIdx = 0; // Assume we are in the 0's quad. + ${pattern("var min_{var} = node.min_{var};", { indent: 8 })} + ${pattern("var max_{var} = (min_{var} + node.max_{var}) / 2;", { indent: 8 })} + +${assignInsertionQuadIndex(8)} + + var child = getChild(node, quadIdx); + + if (!child) { + // The node is internal but this quadrant is not taken. Add + // subnode to it. + child = newNode(); + ${pattern("child.min_{var} = min_{var};", { indent: 10 })} + ${pattern("child.max_{var} = max_{var};", { indent: 10 })} + child.body = body; + + setChild(node, quadIdx, child); + } else { + // continue searching in this quadrant. + insertStack.push(child, body); + } + } else { + // We are trying to add to the leaf node. + // We have to convert current leaf into internal node + // and continue adding two nodes. + var oldBody = node.body; + node.body = null; // internal nodes do not cary bodies + + if (isSamePosition(oldBody.pos, body.pos)) { + // Prevent infinite subdivision by bumping one node + // anywhere in this quadrant + var retriesCount = 3; + do { + var offset = random.nextDouble(); + ${pattern("var d{var} = (node.max_{var} - node.min_{var}) * offset;", { indent: 12 })} + + ${pattern("oldBody.pos.{var} = node.min_{var} + d{var};", { indent: 12 })} + retriesCount -= 1; + // Make sure we don't bump it out of the box. If we do, next iteration should fix it + } while (retriesCount > 0 && isSamePosition(oldBody.pos, body.pos)); + + if (retriesCount === 0 && isSamePosition(oldBody.pos, body.pos)) { + // This is very bad, we ran out of precision. + // if we do not return from the method we'll get into + // infinite loop here. So we sacrifice correctness of layout, and keep the app running + // Next layout iteration should get larger bounding box in the first step and fix this + return; + } + } + // Next iteration should subdivide node further. + insertStack.push(node, oldBody); + insertStack.push(node, body); + } + } + } +} +return createQuadTree; + +`; + return code; + function assignInsertionQuadIndex(indentCount) { + let insertionCode = []; + let indent = Array(indentCount + 1).join(" "); + for (let i = 0; i < dimension; ++i) { + insertionCode.push(indent + `if (${getVariableName(i)} > max_${getVariableName(i)}) {`); + insertionCode.push(indent + ` quadIdx = quadIdx + ${Math.pow(2, i)};`); + insertionCode.push(indent + ` min_${getVariableName(i)} = max_${getVariableName(i)};`); + insertionCode.push(indent + ` max_${getVariableName(i)} = node.max_${getVariableName(i)};`); + insertionCode.push(indent + `}`); + } + return insertionCode.join("\n"); + } + function runRecursiveOnChildren() { + let indent = Array(11).join(" "); + let recursiveCode = []; + for (let i = 0; i < quadCount; ++i) { + recursiveCode.push(indent + `if (node.quad${i}) {`); + recursiveCode.push(indent + ` queue[pushIdx] = node.quad${i};`); + recursiveCode.push(indent + ` queueLength += 1;`); + recursiveCode.push(indent + ` pushIdx += 1;`); + recursiveCode.push(indent + `}`); + } + return recursiveCode.join("\n"); + } + function assignQuads(indent) { + let quads = []; + for (let i = 0; i < quadCount; ++i) { + quads.push(`${indent}quad${i} = null;`); + } + return quads.join("\n"); + } + } + function isSamePosition(dimension) { + let pattern = createPatternBuilder(dimension); + return ` + function isSamePosition(point1, point2) { + ${pattern("var d{var} = Math.abs(point1.{var} - point2.{var});", { indent: 2 })} + + return ${pattern("d{var} < 1e-8", { join: " && " })}; + } +`; + } + function setChildBodyCode(dimension) { + var quadCount = Math.pow(2, dimension); + return ` +function setChild(node, idx, child) { + ${setChildBody()} +}`; + function setChildBody() { + let childBody = []; + for (let i = 0; i < quadCount; ++i) { + let prefix = i === 0 ? " " : " else "; + childBody.push(`${prefix}if (idx === ${i}) node.quad${i} = child;`); + } + return childBody.join("\n"); + } + } + function getChildBodyCode(dimension) { + return `function getChild(node, idx) { +${getChildBody()} + return null; +}`; + function getChildBody() { + let childBody = []; + let quadCount = Math.pow(2, dimension); + for (let i = 0; i < quadCount; ++i) { + childBody.push(` if (idx === ${i}) return node.quad${i};`); + } + return childBody.join("\n"); + } + } + function getQuadNodeCode(dimension) { + let pattern = createPatternBuilder(dimension); + let quadCount = Math.pow(2, dimension); + var quadNodeCode = ` +function QuadNode() { + // body stored inside this node. In quad tree only leaf nodes (by construction) + // contain bodies: + this.body = null; + + // Child nodes are stored in quads. Each quad is presented by number: + // 0 | 1 + // ----- + // 2 | 3 +${assignQuads(" this.")} + + // Total mass of current node + this.mass = 0; + + // Center of mass coordinates + ${pattern("this.mass_{var} = 0;", { indent: 2 })} + + // bounding box coordinates + ${pattern("this.min_{var} = 0;", { indent: 2 })} + ${pattern("this.max_{var} = 0;", { indent: 2 })} +} +`; + return quadNodeCode; + function assignQuads(indent) { + let quads = []; + for (let i = 0; i < quadCount; ++i) { + quads.push(`${indent}quad${i} = null;`); + } + return quads.join("\n"); + } + } + function getInsertStackCode() { + return ` +/** + * Our implementation of QuadTree is non-recursive to avoid GC hit + * This data structure represent stack of elements + * which we are trying to insert into quad tree. + */ +function InsertStack () { + this.stack = []; + this.popIdx = 0; +} + +InsertStack.prototype = { + isEmpty: function() { + return this.popIdx === 0; + }, + push: function (node, body) { + var item = this.stack[this.popIdx]; + if (!item) { + // we are trying to avoid memory pressure: create new element + // only when absolutely necessary + this.stack[this.popIdx] = new InsertStackElement(node, body); + } else { + item.node = node; + item.body = body; + } + ++this.popIdx; + }, + pop: function () { + if (this.popIdx > 0) { + return this.stack[--this.popIdx]; + } + }, + reset: function () { + this.popIdx = 0; + } +}; + +function InsertStackElement(node, body) { + this.node = node; // QuadTree node + this.body = body; // physical body which needs to be inserted to node +} +`; + } + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/generateBounds.js +var require_generateBounds = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/generateBounds.js"(exports2, module2) { + module2.exports = generateBoundsFunction; + module2.exports.generateFunctionBody = generateBoundsFunctionBody; + var createPatternBuilder = require_createPatternBuilder(); + function generateBoundsFunction(dimension) { + let code = generateBoundsFunctionBody(dimension); + return new Function("bodies", "settings", "random", code); + } + function generateBoundsFunctionBody(dimension) { + let pattern = createPatternBuilder(dimension); + let code = ` + var boundingBox = { + ${pattern("min_{var}: 0, max_{var}: 0,", { indent: 4 })} + }; + + return { + box: boundingBox, + + update: updateBoundingBox, + + reset: resetBoundingBox, + + getBestNewPosition: function (neighbors) { + var ${pattern("base_{var} = 0", { join: ", " })}; + + if (neighbors.length) { + for (var i = 0; i < neighbors.length; ++i) { + let neighborPos = neighbors[i].pos; + ${pattern("base_{var} += neighborPos.{var};", { indent: 10 })} + } + + ${pattern("base_{var} /= neighbors.length;", { indent: 8 })} + } else { + ${pattern("base_{var} = (boundingBox.min_{var} + boundingBox.max_{var}) / 2;", { indent: 8 })} + } + + var springLength = settings.springLength; + return { + ${pattern("{var}: base_{var} + (random.nextDouble() - 0.5) * springLength,", { indent: 8 })} + }; + } + }; + + function updateBoundingBox() { + var i = bodies.length; + if (i === 0) return; // No bodies - no borders. + + ${pattern("var max_{var} = -Infinity;", { indent: 4 })} + ${pattern("var min_{var} = Infinity;", { indent: 4 })} + + while(i--) { + // this is O(n), it could be done faster with quadtree, if we check the root node bounds + var bodyPos = bodies[i].pos; + ${pattern("if (bodyPos.{var} < min_{var}) min_{var} = bodyPos.{var};", { indent: 6 })} + ${pattern("if (bodyPos.{var} > max_{var}) max_{var} = bodyPos.{var};", { indent: 6 })} + } + + ${pattern("boundingBox.min_{var} = min_{var};", { indent: 4 })} + ${pattern("boundingBox.max_{var} = max_{var};", { indent: 4 })} + } + + function resetBoundingBox() { + ${pattern("boundingBox.min_{var} = boundingBox.max_{var} = 0;", { indent: 4 })} + } +`; + return code; + } + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/generateCreateDragForce.js +var require_generateCreateDragForce = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/generateCreateDragForce.js"(exports2, module2) { + var createPatternBuilder = require_createPatternBuilder(); + module2.exports = generateCreateDragForceFunction; + module2.exports.generateCreateDragForceFunctionBody = generateCreateDragForceFunctionBody; + function generateCreateDragForceFunction(dimension) { + let code = generateCreateDragForceFunctionBody(dimension); + return new Function("options", code); + } + function generateCreateDragForceFunctionBody(dimension) { + let pattern = createPatternBuilder(dimension); + let code = ` + if (!Number.isFinite(options.dragCoefficient)) throw new Error('dragCoefficient is not a finite number'); + + return { + update: function(body) { + ${pattern("body.force.{var} -= options.dragCoefficient * body.velocity.{var};", { indent: 6 })} + } + }; +`; + return code; + } + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/generateCreateSpringForce.js +var require_generateCreateSpringForce = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/generateCreateSpringForce.js"(exports2, module2) { + var createPatternBuilder = require_createPatternBuilder(); + module2.exports = generateCreateSpringForceFunction; + module2.exports.generateCreateSpringForceFunctionBody = generateCreateSpringForceFunctionBody; + function generateCreateSpringForceFunction(dimension) { + let code = generateCreateSpringForceFunctionBody(dimension); + return new Function("options", "random", code); + } + function generateCreateSpringForceFunctionBody(dimension) { + let pattern = createPatternBuilder(dimension); + let code = ` + if (!Number.isFinite(options.springCoefficient)) throw new Error('Spring coefficient is not a number'); + if (!Number.isFinite(options.springLength)) throw new Error('Spring length is not a number'); + + return { + /** + * Updates forces acting on a spring + */ + update: function (spring) { + var body1 = spring.from; + var body2 = spring.to; + var length = spring.length < 0 ? options.springLength : spring.length; + ${pattern("var d{var} = body2.pos.{var} - body1.pos.{var};", { indent: 6 })} + var r = Math.sqrt(${pattern("d{var} * d{var}", { join: " + " })}); + + if (r === 0) { + ${pattern("d{var} = (random.nextDouble() - 0.5) / 50;", { indent: 8 })} + r = Math.sqrt(${pattern("d{var} * d{var}", { join: " + " })}); + } + + var d = r - length; + var coefficient = ((spring.coefficient > 0) ? spring.coefficient : options.springCoefficient) * d / r; + + ${pattern("body1.force.{var} += coefficient * d{var}", { indent: 6 })}; + body1.springCount += 1; + body1.springLength += r; + + ${pattern("body2.force.{var} -= coefficient * d{var}", { indent: 6 })}; + body2.springCount += 1; + body2.springLength += r; + } + }; +`; + return code; + } + } +}); + +// node_modules/ngraph.forcelayout/lib/codeGenerators/generateIntegrator.js +var require_generateIntegrator = __commonJS({ + "node_modules/ngraph.forcelayout/lib/codeGenerators/generateIntegrator.js"(exports2, module2) { + var createPatternBuilder = require_createPatternBuilder(); + module2.exports = generateIntegratorFunction; + module2.exports.generateIntegratorFunctionBody = generateIntegratorFunctionBody; + function generateIntegratorFunction(dimension) { + let code = generateIntegratorFunctionBody(dimension); + return new Function("bodies", "timeStep", "adaptiveTimeStepWeight", code); + } + function generateIntegratorFunctionBody(dimension) { + let pattern = createPatternBuilder(dimension); + let code = ` + var length = bodies.length; + if (length === 0) return 0; + + ${pattern("var d{var} = 0, t{var} = 0;", { indent: 2 })} + + for (var i = 0; i < length; ++i) { + var body = bodies[i]; + if (body.isPinned) continue; + + if (adaptiveTimeStepWeight && body.springCount) { + timeStep = (adaptiveTimeStepWeight * body.springLength/body.springCount); + } + + var coeff = timeStep / body.mass; + + ${pattern("body.velocity.{var} += coeff * body.force.{var};", { indent: 4 })} + ${pattern("var v{var} = body.velocity.{var};", { indent: 4 })} + var v = Math.sqrt(${pattern("v{var} * v{var}", { join: " + " })}); + + if (v > 1) { + // We normalize it so that we move within timeStep range. + // for the case when v <= 1 - we let velocity to fade out. + ${pattern("body.velocity.{var} = v{var} / v;", { indent: 6 })} + } + + ${pattern("d{var} = timeStep * body.velocity.{var};", { indent: 4 })} + + ${pattern("body.pos.{var} += d{var};", { indent: 4 })} + + ${pattern("t{var} += Math.abs(d{var});", { indent: 4 })} + } + + return (${pattern("t{var} * t{var}", { join: " + " })})/length; +`; + return code; + } + } +}); + +// node_modules/ngraph.forcelayout/lib/spring.js +var require_spring = __commonJS({ + "node_modules/ngraph.forcelayout/lib/spring.js"(exports2, module2) { + module2.exports = Spring; + function Spring(fromBody, toBody, length, springCoefficient) { + this.from = fromBody; + this.to = toBody; + this.length = length; + this.coefficient = springCoefficient; + } + } +}); + +// node_modules/ngraph.merge/index.js +var require_ngraph3 = __commonJS({ + "node_modules/ngraph.merge/index.js"(exports2, module2) { + module2.exports = merge; + function merge(target, options) { + var key; + if (!target) { + target = {}; + } + if (options) { + for (key in options) { + if (options.hasOwnProperty(key)) { + var targetHasIt = target.hasOwnProperty(key), optionsValueType = typeof options[key], shouldReplace = !targetHasIt || typeof target[key] !== optionsValueType; + if (shouldReplace) { + target[key] = options[key]; + } else if (optionsValueType === "object") { + target[key] = merge(target[key], options[key]); + } + } + } + } + return target; + } + } +}); + +// node_modules/ngraph.random/index.js +var require_ngraph4 = __commonJS({ + "node_modules/ngraph.random/index.js"(exports2, module2) { + module2.exports = random; + module2.exports.random = random, module2.exports.randomIterator = randomIterator; + function random(inputSeed) { + var seed = typeof inputSeed === "number" ? inputSeed : +new Date(); + return new Generator(seed); + } + function Generator(seed) { + this.seed = seed; + } + Generator.prototype.next = next; + Generator.prototype.nextDouble = nextDouble; + Generator.prototype.uniform = nextDouble; + Generator.prototype.gaussian = gaussian; + function gaussian() { + var r, x2, y2; + do { + x2 = this.nextDouble() * 2 - 1; + y2 = this.nextDouble() * 2 - 1; + r = x2 * x2 + y2 * y2; + } while (r >= 1 || r === 0); + return x2 * Math.sqrt(-2 * Math.log(r) / r); + } + Generator.prototype.levy = levy; + function levy() { + var beta = 3 / 2; + var sigma = Math.pow(gamma(1 + beta) * Math.sin(Math.PI * beta / 2) / (gamma((1 + beta) / 2) * beta * Math.pow(2, (beta - 1) / 2)), 1 / beta); + return this.gaussian() * sigma / Math.pow(Math.abs(this.gaussian()), 1 / beta); + } + function gamma(z2) { + return Math.sqrt(2 * Math.PI / z2) * Math.pow(1 / Math.E * (z2 + 1 / (12 * z2 - 1 / (10 * z2))), z2); + } + function nextDouble() { + var seed = this.seed; + seed = seed + 2127912214 + (seed << 12) & 4294967295; + seed = (seed ^ 3345072700 ^ seed >>> 19) & 4294967295; + seed = seed + 374761393 + (seed << 5) & 4294967295; + seed = (seed + 3550635116 ^ seed << 9) & 4294967295; + seed = seed + 4251993797 + (seed << 3) & 4294967295; + seed = (seed ^ 3042594569 ^ seed >>> 16) & 4294967295; + this.seed = seed; + return (seed & 268435455) / 268435456; + } + function next(maxValue) { + return Math.floor(this.nextDouble() * maxValue); + } + function randomIterator(array, customRandom) { + var localRandom = customRandom || random(); + if (typeof localRandom.next !== "function") { + throw new Error("customRandom does not match expected API: next() function is missing"); + } + return { + forEach, + shuffle + }; + function shuffle() { + var i, j, t; + for (i = array.length - 1; i > 0; --i) { + j = localRandom.next(i + 1); + t = array[j]; + array[j] = array[i]; + array[i] = t; + } + return array; + } + function forEach(callback) { + var i, j, t; + for (i = array.length - 1; i > 0; --i) { + j = localRandom.next(i + 1); + t = array[j]; + array[j] = array[i]; + array[i] = t; + callback(t); + } + if (array.length) { + callback(array[0]); + } + } + } + } +}); + +// node_modules/ngraph.forcelayout/lib/createPhysicsSimulator.js +var require_createPhysicsSimulator = __commonJS({ + "node_modules/ngraph.forcelayout/lib/createPhysicsSimulator.js"(exports2, module2) { + module2.exports = createPhysicsSimulator; + var generateCreateBodyFunction = require_generateCreateBody(); + var generateQuadTreeFunction = require_generateQuadTree(); + var generateBoundsFunction = require_generateBounds(); + var generateCreateDragForceFunction = require_generateCreateDragForce(); + var generateCreateSpringForceFunction = require_generateCreateSpringForce(); + var generateIntegratorFunction = require_generateIntegrator(); + var dimensionalCache = {}; + function createPhysicsSimulator(settings) { + var Spring = require_spring(); + var merge = require_ngraph3(); + var eventify = require_ngraph(); + if (settings) { + if (settings.springCoeff !== void 0) + throw new Error("springCoeff was renamed to springCoefficient"); + if (settings.dragCoeff !== void 0) + throw new Error("dragCoeff was renamed to dragCoefficient"); + } + settings = merge(settings, { + springLength: 10, + springCoefficient: 0.8, + gravity: -12, + theta: 0.8, + dragCoefficient: 0.9, + timeStep: 0.5, + adaptiveTimeStepWeight: 0, + dimensions: 2, + debug: false + }); + var factory = dimensionalCache[settings.dimensions]; + if (!factory) { + var dimensions = settings.dimensions; + factory = { + Body: generateCreateBodyFunction(dimensions, settings.debug), + createQuadTree: generateQuadTreeFunction(dimensions), + createBounds: generateBoundsFunction(dimensions), + createDragForce: generateCreateDragForceFunction(dimensions), + createSpringForce: generateCreateSpringForceFunction(dimensions), + integrate: generateIntegratorFunction(dimensions) + }; + dimensionalCache[dimensions] = factory; + } + var Body = factory.Body; + var createQuadTree = factory.createQuadTree; + var createBounds = factory.createBounds; + var createDragForce = factory.createDragForce; + var createSpringForce = factory.createSpringForce; + var integrate = factory.integrate; + var createBody = (pos) => new Body(pos); + var random = require_ngraph4().random(42); + var bodies = []; + var springs = []; + var quadTree = createQuadTree(settings, random); + var bounds = createBounds(bodies, settings, random); + var springForce = createSpringForce(settings, random); + var dragForce = createDragForce(settings); + var totalMovement = 0; + var forces = []; + var forceMap = /* @__PURE__ */ new Map(); + var iterationNumber = 0; + addForce("nbody", nbodyForce); + addForce("spring", updateSpringForce); + var publicApi = { + bodies, + quadTree, + springs, + settings, + addForce, + removeForce, + getForces, + step: function() { + for (var i = 0; i < forces.length; ++i) { + forces[i](iterationNumber); + } + var movement = integrate(bodies, settings.timeStep, settings.adaptiveTimeStepWeight); + iterationNumber += 1; + return movement; + }, + addBody: function(body) { + if (!body) { + throw new Error("Body is required"); + } + bodies.push(body); + return body; + }, + addBodyAt: function(pos) { + if (!pos) { + throw new Error("Body position is required"); + } + var body = createBody(pos); + bodies.push(body); + return body; + }, + removeBody: function(body) { + if (!body) { + return; + } + var idx = bodies.indexOf(body); + if (idx < 0) { + return; + } + bodies.splice(idx, 1); + if (bodies.length === 0) { + bounds.reset(); + } + return true; + }, + addSpring: function(body1, body2, springLength, springCoefficient) { + if (!body1 || !body2) { + throw new Error("Cannot add null spring to force simulator"); + } + if (typeof springLength !== "number") { + springLength = -1; + } + var spring = new Spring(body1, body2, springLength, springCoefficient >= 0 ? springCoefficient : -1); + springs.push(spring); + return spring; + }, + getTotalMovement: function() { + return totalMovement; + }, + removeSpring: function(spring) { + if (!spring) { + return; + } + var idx = springs.indexOf(spring); + if (idx > -1) { + springs.splice(idx, 1); + return true; + } + }, + getBestNewBodyPosition: function(neighbors) { + return bounds.getBestNewPosition(neighbors); + }, + getBBox: getBoundingBox, + getBoundingBox, + invalidateBBox: function() { + console.warn("invalidateBBox() is deprecated, bounds always recomputed on `getBBox()` call"); + }, + gravity: function(value) { + if (value !== void 0) { + settings.gravity = value; + quadTree.options({ gravity: value }); + return this; + } else { + return settings.gravity; + } + }, + theta: function(value) { + if (value !== void 0) { + settings.theta = value; + quadTree.options({ theta: value }); + return this; + } else { + return settings.theta; + } + }, + random + }; + expose(settings, publicApi); + eventify(publicApi); + return publicApi; + function getBoundingBox() { + bounds.update(); + return bounds.box; + } + function addForce(forceName, forceFunction) { + if (forceMap.has(forceName)) + throw new Error("Force " + forceName + " is already added"); + forceMap.set(forceName, forceFunction); + forces.push(forceFunction); + } + function removeForce(forceName) { + var forceIndex = forces.indexOf(forceMap.get(forceName)); + if (forceIndex < 0) + return; + forces.splice(forceIndex, 1); + forceMap.delete(forceName); + } + function getForces() { + return forceMap; + } + function nbodyForce() { + if (bodies.length === 0) + return; + quadTree.insertBodies(bodies); + var i = bodies.length; + while (i--) { + var body = bodies[i]; + if (!body.isPinned) { + body.reset(); + quadTree.updateBodyForce(body); + dragForce.update(body); + } + } + } + function updateSpringForce() { + var i = springs.length; + while (i--) { + springForce.update(springs[i]); + } + } + } + function expose(settings, target) { + for (var key in settings) { + augment(settings, target, key); + } + } + function augment(source, target, key) { + if (!source.hasOwnProperty(key)) + return; + if (typeof target[key] === "function") { + return; + } + var sourceIsNumber = Number.isFinite(source[key]); + if (sourceIsNumber) { + target[key] = function(value) { + if (value !== void 0) { + if (!Number.isFinite(value)) + throw new Error("Value of " + key + " should be a valid number."); + source[key] = value; + return target; + } + return source[key]; + }; + } else { + target[key] = function(value) { + if (value !== void 0) { + source[key] = value; + return target; + } + return source[key]; + }; + } + } + } +}); + +// node_modules/ngraph.forcelayout/index.js +var require_ngraph5 = __commonJS({ + "node_modules/ngraph.forcelayout/index.js"(exports2, module2) { + module2.exports = createLayout; + module2.exports.simulator = require_createPhysicsSimulator(); + var eventify = require_ngraph(); + function createLayout(graph2, physicsSettings) { + if (!graph2) { + throw new Error("Graph structure cannot be undefined"); + } + var createSimulator = physicsSettings && physicsSettings.createSimulator || require_createPhysicsSimulator(); + var physicsSimulator = createSimulator(physicsSettings); + if (Array.isArray(physicsSettings)) + throw new Error("Physics settings is expected to be an object"); + var nodeMass = graph2.version > 19 ? defaultSetNodeMass : defaultArrayNodeMass; + if (physicsSettings && typeof physicsSettings.nodeMass === "function") { + nodeMass = physicsSettings.nodeMass; + } + var nodeBodies = /* @__PURE__ */ new Map(); + var springs = {}; + var bodiesCount = 0; + var springTransform = physicsSimulator.settings.springTransform || noop2; + initPhysics(); + listenToEvents(); + var wasStable = false; + var api = { + step: function() { + if (bodiesCount === 0) { + updateStableStatus(true); + return true; + } + var lastMove = physicsSimulator.step(); + api.lastMove = lastMove; + api.fire("step"); + var ratio = lastMove / bodiesCount; + var isStableNow = ratio <= 0.01; + updateStableStatus(isStableNow); + return isStableNow; + }, + getNodePosition: function(nodeId) { + return getInitializedBody(nodeId).pos; + }, + setNodePosition: function(nodeId) { + var body = getInitializedBody(nodeId); + body.setPosition.apply(body, Array.prototype.slice.call(arguments, 1)); + }, + getLinkPosition: function(linkId) { + var spring = springs[linkId]; + if (spring) { + return { + from: spring.from.pos, + to: spring.to.pos + }; + } + }, + getGraphRect: function() { + return physicsSimulator.getBBox(); + }, + forEachBody, + pinNode: function(node, isPinned) { + var body = getInitializedBody(node.id); + body.isPinned = !!isPinned; + }, + isNodePinned: function(node) { + return getInitializedBody(node.id).isPinned; + }, + dispose: function() { + graph2.off("changed", onGraphChanged); + api.fire("disposed"); + }, + getBody, + getSpring, + getForceVectorLength, + simulator: physicsSimulator, + graph: graph2, + lastMove: 0 + }; + eventify(api); + return api; + function updateStableStatus(isStableNow) { + if (wasStable !== isStableNow) { + wasStable = isStableNow; + onStableChanged(isStableNow); + } + } + function forEachBody(cb) { + nodeBodies.forEach(cb); + } + function getForceVectorLength() { + var fx = 0, fy = 0; + forEachBody(function(body) { + fx += Math.abs(body.force.x); + fy += Math.abs(body.force.y); + }); + return Math.sqrt(fx * fx + fy * fy); + } + function getSpring(fromId, toId) { + var linkId; + if (toId === void 0) { + if (typeof fromId !== "object") { + linkId = fromId; + } else { + linkId = fromId.id; + } + } else { + var link = graph2.hasLink(fromId, toId); + if (!link) + return; + linkId = link.id; + } + return springs[linkId]; + } + function getBody(nodeId) { + return nodeBodies.get(nodeId); + } + function listenToEvents() { + graph2.on("changed", onGraphChanged); + } + function onStableChanged(isStable) { + api.fire("stable", isStable); + } + function onGraphChanged(changes) { + for (var i = 0; i < changes.length; ++i) { + var change = changes[i]; + if (change.changeType === "add") { + if (change.node) { + initBody(change.node.id); + } + if (change.link) { + initLink(change.link); + } + } else if (change.changeType === "remove") { + if (change.node) { + releaseNode(change.node); + } + if (change.link) { + releaseLink(change.link); + } + } + } + bodiesCount = graph2.getNodesCount(); + } + function initPhysics() { + bodiesCount = 0; + graph2.forEachNode(function(node) { + initBody(node.id); + bodiesCount += 1; + }); + graph2.forEachLink(initLink); + } + function initBody(nodeId) { + var body = nodeBodies.get(nodeId); + if (!body) { + var node = graph2.getNode(nodeId); + if (!node) { + throw new Error("initBody() was called with unknown node id"); + } + var pos = node.position; + if (!pos) { + var neighbors = getNeighborBodies(node); + pos = physicsSimulator.getBestNewBodyPosition(neighbors); + } + body = physicsSimulator.addBodyAt(pos); + body.id = nodeId; + nodeBodies.set(nodeId, body); + updateBodyMass(nodeId); + if (isNodeOriginallyPinned(node)) { + body.isPinned = true; + } + } + } + function releaseNode(node) { + var nodeId = node.id; + var body = nodeBodies.get(nodeId); + if (body) { + nodeBodies.delete(nodeId); + physicsSimulator.removeBody(body); + } + } + function initLink(link) { + updateBodyMass(link.fromId); + updateBodyMass(link.toId); + var fromBody = nodeBodies.get(link.fromId), toBody = nodeBodies.get(link.toId), spring = physicsSimulator.addSpring(fromBody, toBody, link.length); + springTransform(link, spring); + springs[link.id] = spring; + } + function releaseLink(link) { + var spring = springs[link.id]; + if (spring) { + var from = graph2.getNode(link.fromId), to = graph2.getNode(link.toId); + if (from) + updateBodyMass(from.id); + if (to) + updateBodyMass(to.id); + delete springs[link.id]; + physicsSimulator.removeSpring(spring); + } + } + function getNeighborBodies(node) { + var neighbors = []; + if (!node.links) { + return neighbors; + } + var maxNeighbors = Math.min(node.links.length, 2); + for (var i = 0; i < maxNeighbors; ++i) { + var link = node.links[i]; + var otherBody = link.fromId !== node.id ? nodeBodies.get(link.fromId) : nodeBodies.get(link.toId); + if (otherBody && otherBody.pos) { + neighbors.push(otherBody); + } + } + return neighbors; + } + function updateBodyMass(nodeId) { + var body = nodeBodies.get(nodeId); + body.mass = nodeMass(nodeId); + if (Number.isNaN(body.mass)) { + throw new Error("Node mass should be a number"); + } + } + function isNodeOriginallyPinned(node) { + return node && (node.isPinned || node.data && node.data.isPinned); + } + function getInitializedBody(nodeId) { + var body = nodeBodies.get(nodeId); + if (!body) { + initBody(nodeId); + body = nodeBodies.get(nodeId); + } + return body; + } + function defaultArrayNodeMass(nodeId) { + var links = graph2.getLinks(nodeId); + if (!links) + return 1; + return 1 + links.length / 3; + } + function defaultSetNodeMass(nodeId) { + var links = graph2.getLinks(nodeId); + if (!links) + return 1; + return 1 + links.size / 3; + } + } + function noop2() { + } + } +}); + +// node_modules/debounce/index.js +var require_debounce = __commonJS({ + "node_modules/debounce/index.js"(exports2, module2) { + function debounce2(func, wait, immediate) { + var timeout2, args, context, timestamp, result; + if (wait == null) + wait = 100; + function later() { + var last = Date.now() - timestamp; + if (last < wait && last >= 0) { + timeout2 = setTimeout(later, wait - last); + } else { + timeout2 = null; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + } + ; + var debounced = function() { + context = this; + args = arguments; + timestamp = Date.now(); + var callNow = immediate && !timeout2; + if (!timeout2) + timeout2 = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + return result; + }; + debounced.clear = function() { + if (timeout2) { + clearTimeout(timeout2); + timeout2 = null; + } + }; + debounced.flush = function() { + if (timeout2) { + result = func.apply(context, args); + context = args = null; + clearTimeout(timeout2); + timeout2 = null; + } + }; + return debounced; + } + debounce2.debounce = debounce2; + module2.exports = debounce2; + } +}); + +// node_modules/tinycolor2/tinycolor.js +var require_tinycolor = __commonJS({ + "node_modules/tinycolor2/tinycolor.js"(exports2, module2) { + (function(Math2) { + var trimLeft = /^\s+/, trimRight = /\s+$/, tinyCounter = 0, mathRound = Math2.round, mathMin = Math2.min, mathMax = Math2.max, mathRandom = Math2.random; + function tinycolor(color, opts) { + color = color ? color : ""; + opts = opts || {}; + if (color instanceof tinycolor) { + return color; + } + if (!(this instanceof tinycolor)) { + return new tinycolor(color, opts); + } + var rgb2 = inputToRGB(color); + this._originalInput = color, this._r = rgb2.r, this._g = rgb2.g, this._b = rgb2.b, this._a = rgb2.a, this._roundA = mathRound(100 * this._a) / 100, this._format = opts.format || rgb2.format; + this._gradientType = opts.gradientType; + if (this._r < 1) { + this._r = mathRound(this._r); + } + if (this._g < 1) { + this._g = mathRound(this._g); + } + if (this._b < 1) { + this._b = mathRound(this._b); + } + this._ok = rgb2.ok; + this._tc_id = tinyCounter++; + } + tinycolor.prototype = { + isDark: function() { + return this.getBrightness() < 128; + }, + isLight: function() { + return !this.isDark(); + }, + isValid: function() { + return this._ok; + }, + getOriginalInput: function() { + return this._originalInput; + }, + getFormat: function() { + return this._format; + }, + getAlpha: function() { + return this._a; + }, + getBrightness: function() { + var rgb2 = this.toRgb(); + return (rgb2.r * 299 + rgb2.g * 587 + rgb2.b * 114) / 1e3; + }, + getLuminance: function() { + var rgb2 = this.toRgb(); + var RsRGB, GsRGB, BsRGB, R, G, B; + RsRGB = rgb2.r / 255; + GsRGB = rgb2.g / 255; + BsRGB = rgb2.b / 255; + if (RsRGB <= 0.03928) { + R = RsRGB / 12.92; + } else { + R = Math2.pow((RsRGB + 0.055) / 1.055, 2.4); + } + if (GsRGB <= 0.03928) { + G = GsRGB / 12.92; + } else { + G = Math2.pow((GsRGB + 0.055) / 1.055, 2.4); + } + if (BsRGB <= 0.03928) { + B = BsRGB / 12.92; + } else { + B = Math2.pow((BsRGB + 0.055) / 1.055, 2.4); + } + return 0.2126 * R + 0.7152 * G + 0.0722 * B; + }, + setAlpha: function(value) { + this._a = boundAlpha(value); + this._roundA = mathRound(100 * this._a) / 100; + return this; + }, + toHsv: function() { + var hsv = rgbToHsv(this._r, this._g, this._b); + return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; + }, + toHsvString: function() { + var hsv = rgbToHsv(this._r, this._g, this._b); + var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); + return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")"; + }, + toHsl: function() { + var hsl = rgbToHsl(this._r, this._g, this._b); + return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; + }, + toHslString: function() { + var hsl = rgbToHsl(this._r, this._g, this._b); + var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); + return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")"; + }, + toHex: function(allow3Char) { + return rgbToHex(this._r, this._g, this._b, allow3Char); + }, + toHexString: function(allow3Char) { + return "#" + this.toHex(allow3Char); + }, + toHex8: function(allow4Char) { + return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); + }, + toHex8String: function(allow4Char) { + return "#" + this.toHex8(allow4Char); + }, + toRgb: function() { + return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; + }, + toRgbString: function() { + return this._a == 1 ? "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; + }, + toPercentageRgb: function() { + return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; + }, + toPercentageRgbString: function() { + return this._a == 1 ? "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; + }, + toName: function() { + if (this._a === 0) { + return "transparent"; + } + if (this._a < 1) { + return false; + } + return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; + }, + toFilter: function(secondColor) { + var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a); + var secondHex8String = hex8String; + var gradientType = this._gradientType ? "GradientType = 1, " : ""; + if (secondColor) { + var s = tinycolor(secondColor); + secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a); + } + return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")"; + }, + toString: function(format2) { + var formatSet = !!format2; + format2 = format2 || this._format; + var formattedString = false; + var hasAlpha = this._a < 1 && this._a >= 0; + var needsAlphaFormat = !formatSet && hasAlpha && (format2 === "hex" || format2 === "hex6" || format2 === "hex3" || format2 === "hex4" || format2 === "hex8" || format2 === "name"); + if (needsAlphaFormat) { + if (format2 === "name" && this._a === 0) { + return this.toName(); + } + return this.toRgbString(); + } + if (format2 === "rgb") { + formattedString = this.toRgbString(); + } + if (format2 === "prgb") { + formattedString = this.toPercentageRgbString(); + } + if (format2 === "hex" || format2 === "hex6") { + formattedString = this.toHexString(); + } + if (format2 === "hex3") { + formattedString = this.toHexString(true); + } + if (format2 === "hex4") { + formattedString = this.toHex8String(true); + } + if (format2 === "hex8") { + formattedString = this.toHex8String(); + } + if (format2 === "name") { + formattedString = this.toName(); + } + if (format2 === "hsl") { + formattedString = this.toHslString(); + } + if (format2 === "hsv") { + formattedString = this.toHsvString(); + } + return formattedString || this.toHexString(); + }, + clone: function() { + return tinycolor(this.toString()); + }, + _applyModification: function(fn, args) { + var color = fn.apply(null, [this].concat([].slice.call(args))); + this._r = color._r; + this._g = color._g; + this._b = color._b; + this.setAlpha(color._a); + return this; + }, + lighten: function() { + return this._applyModification(lighten, arguments); + }, + brighten: function() { + return this._applyModification(brighten, arguments); + }, + darken: function() { + return this._applyModification(darken, arguments); + }, + desaturate: function() { + return this._applyModification(desaturate, arguments); + }, + saturate: function() { + return this._applyModification(saturate, arguments); + }, + greyscale: function() { + return this._applyModification(greyscale, arguments); + }, + spin: function() { + return this._applyModification(spin, arguments); + }, + _applyCombination: function(fn, args) { + return fn.apply(null, [this].concat([].slice.call(args))); + }, + analogous: function() { + return this._applyCombination(analogous, arguments); + }, + complement: function() { + return this._applyCombination(complement, arguments); + }, + monochromatic: function() { + return this._applyCombination(monochromatic, arguments); + }, + splitcomplement: function() { + return this._applyCombination(splitcomplement, arguments); + }, + triad: function() { + return this._applyCombination(triad, arguments); + }, + tetrad: function() { + return this._applyCombination(tetrad, arguments); + } + }; + tinycolor.fromRatio = function(color, opts) { + if (typeof color == "object") { + var newColor = {}; + for (var i in color) { + if (color.hasOwnProperty(i)) { + if (i === "a") { + newColor[i] = color[i]; + } else { + newColor[i] = convertToPercentage(color[i]); + } + } + } + color = newColor; + } + return tinycolor(color, opts); + }; + function inputToRGB(color) { + var rgb2 = { r: 0, g: 0, b: 0 }; + var a2 = 1; + var s = null; + var v = null; + var l = null; + var ok = false; + var format2 = false; + if (typeof color == "string") { + color = stringInputToObject(color); + } + if (typeof color == "object") { + if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { + rgb2 = rgbToRgb(color.r, color.g, color.b); + ok = true; + format2 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; + } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { + s = convertToPercentage(color.s); + v = convertToPercentage(color.v); + rgb2 = hsvToRgb(color.h, s, v); + ok = true; + format2 = "hsv"; + } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { + s = convertToPercentage(color.s); + l = convertToPercentage(color.l); + rgb2 = hslToRgb2(color.h, s, l); + ok = true; + format2 = "hsl"; + } + if (color.hasOwnProperty("a")) { + a2 = color.a; + } + } + a2 = boundAlpha(a2); + return { + ok, + format: color.format || format2, + r: mathMin(255, mathMax(rgb2.r, 0)), + g: mathMin(255, mathMax(rgb2.g, 0)), + b: mathMin(255, mathMax(rgb2.b, 0)), + a: a2 + }; + } + function rgbToRgb(r, g, b) { + return { + r: bound01(r, 255) * 255, + g: bound01(g, 255) * 255, + b: bound01(b, 255) * 255 + }; + } + function rgbToHsl(r, g, b) { + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + var max2 = mathMax(r, g, b), min2 = mathMin(r, g, b); + var h, s, l = (max2 + min2) / 2; + if (max2 == min2) { + h = s = 0; + } else { + var d = max2 - min2; + s = l > 0.5 ? d / (2 - max2 - min2) : d / (max2 + min2); + switch (max2) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; + } + h /= 6; + } + return { h, s, l }; + } + function hslToRgb2(h, s, l) { + var r, g, b; + h = bound01(h, 360); + s = bound01(s, 100); + l = bound01(l, 100); + function hue2rgb2(p2, q2, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p2 + (q2 - p2) * 6 * t; + if (t < 1 / 2) + return q2; + if (t < 2 / 3) + return p2 + (q2 - p2) * (2 / 3 - t) * 6; + return p2; + } + if (s === 0) { + r = g = b = l; + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hue2rgb2(p, q, h + 1 / 3); + g = hue2rgb2(p, q, h); + b = hue2rgb2(p, q, h - 1 / 3); + } + return { r: r * 255, g: g * 255, b: b * 255 }; + } + function rgbToHsv(r, g, b) { + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + var max2 = mathMax(r, g, b), min2 = mathMin(r, g, b); + var h, s, v = max2; + var d = max2 - min2; + s = max2 === 0 ? 0 : d / max2; + if (max2 == min2) { + h = 0; + } else { + switch (max2) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; + } + h /= 6; + } + return { h, s, v }; + } + function hsvToRgb(h, s, v) { + h = bound01(h, 360) * 6; + s = bound01(s, 100); + v = bound01(v, 100); + var i = Math2.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod]; + return { r: r * 255, g: g * 255, b: b * 255 }; + } + function rgbToHex(r, g, b, allow3Char) { + var hex = [ + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)) + ]; + if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { + return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); + } + return hex.join(""); + } + function rgbaToHex(r, g, b, a2, allow4Char) { + var hex = [ + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)), + pad2(convertDecimalToHex(a2)) + ]; + if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { + return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); + } + return hex.join(""); + } + function rgbaToArgbHex(r, g, b, a2) { + var hex = [ + pad2(convertDecimalToHex(a2)), + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)) + ]; + return hex.join(""); + } + tinycolor.equals = function(color1, color2) { + if (!color1 || !color2) { + return false; + } + return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); + }; + tinycolor.random = function() { + return tinycolor.fromRatio({ + r: mathRandom(), + g: mathRandom(), + b: mathRandom() + }); + }; + function desaturate(color, amount) { + amount = amount === 0 ? 0 : amount || 10; + var hsl = tinycolor(color).toHsl(); + hsl.s -= amount / 100; + hsl.s = clamp01(hsl.s); + return tinycolor(hsl); + } + function saturate(color, amount) { + amount = amount === 0 ? 0 : amount || 10; + var hsl = tinycolor(color).toHsl(); + hsl.s += amount / 100; + hsl.s = clamp01(hsl.s); + return tinycolor(hsl); + } + function greyscale(color) { + return tinycolor(color).desaturate(100); + } + function lighten(color, amount) { + amount = amount === 0 ? 0 : amount || 10; + var hsl = tinycolor(color).toHsl(); + hsl.l += amount / 100; + hsl.l = clamp01(hsl.l); + return tinycolor(hsl); + } + function brighten(color, amount) { + amount = amount === 0 ? 0 : amount || 10; + var rgb2 = tinycolor(color).toRgb(); + rgb2.r = mathMax(0, mathMin(255, rgb2.r - mathRound(255 * -(amount / 100)))); + rgb2.g = mathMax(0, mathMin(255, rgb2.g - mathRound(255 * -(amount / 100)))); + rgb2.b = mathMax(0, mathMin(255, rgb2.b - mathRound(255 * -(amount / 100)))); + return tinycolor(rgb2); + } + function darken(color, amount) { + amount = amount === 0 ? 0 : amount || 10; + var hsl = tinycolor(color).toHsl(); + hsl.l -= amount / 100; + hsl.l = clamp01(hsl.l); + return tinycolor(hsl); + } + function spin(color, amount) { + var hsl = tinycolor(color).toHsl(); + var hue = (hsl.h + amount) % 360; + hsl.h = hue < 0 ? 360 + hue : hue; + return tinycolor(hsl); + } + function complement(color) { + var hsl = tinycolor(color).toHsl(); + hsl.h = (hsl.h + 180) % 360; + return tinycolor(hsl); + } + function triad(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) + ]; + } + function tetrad(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) + ]; + } + function splitcomplement(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }) + ]; + } + function analogous(color, results, slices) { + results = results || 6; + slices = slices || 30; + var hsl = tinycolor(color).toHsl(); + var part = 360 / slices; + var ret = [tinycolor(color)]; + for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) { + hsl.h = (hsl.h + part) % 360; + ret.push(tinycolor(hsl)); + } + return ret; + } + function monochromatic(color, results) { + results = results || 6; + var hsv = tinycolor(color).toHsv(); + var h = hsv.h, s = hsv.s, v = hsv.v; + var ret = []; + var modification = 1 / results; + while (results--) { + ret.push(tinycolor({ h, s, v })); + v = (v + modification) % 1; + } + return ret; + } + tinycolor.mix = function(color1, color2, amount) { + amount = amount === 0 ? 0 : amount || 50; + var rgb1 = tinycolor(color1).toRgb(); + var rgb2 = tinycolor(color2).toRgb(); + var p = amount / 100; + var rgba2 = { + r: (rgb2.r - rgb1.r) * p + rgb1.r, + g: (rgb2.g - rgb1.g) * p + rgb1.g, + b: (rgb2.b - rgb1.b) * p + rgb1.b, + a: (rgb2.a - rgb1.a) * p + rgb1.a + }; + return tinycolor(rgba2); + }; + tinycolor.readability = function(color1, color2) { + var c1 = tinycolor(color1); + var c2 = tinycolor(color2); + return (Math2.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math2.min(c1.getLuminance(), c2.getLuminance()) + 0.05); + }; + tinycolor.isReadable = function(color1, color2, wcag2) { + var readability = tinycolor.readability(color1, color2); + var wcag2Parms, out; + out = false; + wcag2Parms = validateWCAG2Parms(wcag2); + switch (wcag2Parms.level + wcag2Parms.size) { + case "AAsmall": + case "AAAlarge": + out = readability >= 4.5; + break; + case "AAlarge": + out = readability >= 3; + break; + case "AAAsmall": + out = readability >= 7; + break; + } + return out; + }; + tinycolor.mostReadable = function(baseColor, colorList, args) { + var bestColor = null; + var bestScore = 0; + var readability; + var includeFallbackColors, level, size; + args = args || {}; + includeFallbackColors = args.includeFallbackColors; + level = args.level; + size = args.size; + for (var i = 0; i < colorList.length; i++) { + readability = tinycolor.readability(baseColor, colorList[i]); + if (readability > bestScore) { + bestScore = readability; + bestColor = tinycolor(colorList[i]); + } + } + if (tinycolor.isReadable(baseColor, bestColor, { "level": level, "size": size }) || !includeFallbackColors) { + return bestColor; + } else { + args.includeFallbackColors = false; + return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args); + } + }; + var names = tinycolor.names = { + aliceblue: "f0f8ff", + antiquewhite: "faebd7", + aqua: "0ff", + aquamarine: "7fffd4", + azure: "f0ffff", + beige: "f5f5dc", + bisque: "ffe4c4", + black: "000", + blanchedalmond: "ffebcd", + blue: "00f", + blueviolet: "8a2be2", + brown: "a52a2a", + burlywood: "deb887", + burntsienna: "ea7e5d", + cadetblue: "5f9ea0", + chartreuse: "7fff00", + chocolate: "d2691e", + coral: "ff7f50", + cornflowerblue: "6495ed", + cornsilk: "fff8dc", + crimson: "dc143c", + cyan: "0ff", + darkblue: "00008b", + darkcyan: "008b8b", + darkgoldenrod: "b8860b", + darkgray: "a9a9a9", + darkgreen: "006400", + darkgrey: "a9a9a9", + darkkhaki: "bdb76b", + darkmagenta: "8b008b", + darkolivegreen: "556b2f", + darkorange: "ff8c00", + darkorchid: "9932cc", + darkred: "8b0000", + darksalmon: "e9967a", + darkseagreen: "8fbc8f", + darkslateblue: "483d8b", + darkslategray: "2f4f4f", + darkslategrey: "2f4f4f", + darkturquoise: "00ced1", + darkviolet: "9400d3", + deeppink: "ff1493", + deepskyblue: "00bfff", + dimgray: "696969", + dimgrey: "696969", + dodgerblue: "1e90ff", + firebrick: "b22222", + floralwhite: "fffaf0", + forestgreen: "228b22", + fuchsia: "f0f", + gainsboro: "dcdcdc", + ghostwhite: "f8f8ff", + gold: "ffd700", + goldenrod: "daa520", + gray: "808080", + green: "008000", + greenyellow: "adff2f", + grey: "808080", + honeydew: "f0fff0", + hotpink: "ff69b4", + indianred: "cd5c5c", + indigo: "4b0082", + ivory: "fffff0", + khaki: "f0e68c", + lavender: "e6e6fa", + lavenderblush: "fff0f5", + lawngreen: "7cfc00", + lemonchiffon: "fffacd", + lightblue: "add8e6", + lightcoral: "f08080", + lightcyan: "e0ffff", + lightgoldenrodyellow: "fafad2", + lightgray: "d3d3d3", + lightgreen: "90ee90", + lightgrey: "d3d3d3", + lightpink: "ffb6c1", + lightsalmon: "ffa07a", + lightseagreen: "20b2aa", + lightskyblue: "87cefa", + lightslategray: "789", + lightslategrey: "789", + lightsteelblue: "b0c4de", + lightyellow: "ffffe0", + lime: "0f0", + limegreen: "32cd32", + linen: "faf0e6", + magenta: "f0f", + maroon: "800000", + mediumaquamarine: "66cdaa", + mediumblue: "0000cd", + mediumorchid: "ba55d3", + mediumpurple: "9370db", + mediumseagreen: "3cb371", + mediumslateblue: "7b68ee", + mediumspringgreen: "00fa9a", + mediumturquoise: "48d1cc", + mediumvioletred: "c71585", + midnightblue: "191970", + mintcream: "f5fffa", + mistyrose: "ffe4e1", + moccasin: "ffe4b5", + navajowhite: "ffdead", + navy: "000080", + oldlace: "fdf5e6", + olive: "808000", + olivedrab: "6b8e23", + orange: "ffa500", + orangered: "ff4500", + orchid: "da70d6", + palegoldenrod: "eee8aa", + palegreen: "98fb98", + paleturquoise: "afeeee", + palevioletred: "db7093", + papayawhip: "ffefd5", + peachpuff: "ffdab9", + peru: "cd853f", + pink: "ffc0cb", + plum: "dda0dd", + powderblue: "b0e0e6", + purple: "800080", + rebeccapurple: "663399", + red: "f00", + rosybrown: "bc8f8f", + royalblue: "4169e1", + saddlebrown: "8b4513", + salmon: "fa8072", + sandybrown: "f4a460", + seagreen: "2e8b57", + seashell: "fff5ee", + sienna: "a0522d", + silver: "c0c0c0", + skyblue: "87ceeb", + slateblue: "6a5acd", + slategray: "708090", + slategrey: "708090", + snow: "fffafa", + springgreen: "00ff7f", + steelblue: "4682b4", + tan: "d2b48c", + teal: "008080", + thistle: "d8bfd8", + tomato: "ff6347", + turquoise: "40e0d0", + violet: "ee82ee", + wheat: "f5deb3", + white: "fff", + whitesmoke: "f5f5f5", + yellow: "ff0", + yellowgreen: "9acd32" + }; + var hexNames = tinycolor.hexNames = flip(names); + function flip(o) { + var flipped = {}; + for (var i in o) { + if (o.hasOwnProperty(i)) { + flipped[o[i]] = i; + } + } + return flipped; + } + function boundAlpha(a2) { + a2 = parseFloat(a2); + if (isNaN(a2) || a2 < 0 || a2 > 1) { + a2 = 1; + } + return a2; + } + function bound01(n, max2) { + if (isOnePointZero(n)) { + n = "100%"; + } + var processPercent = isPercentage(n); + n = mathMin(max2, mathMax(0, parseFloat(n))); + if (processPercent) { + n = parseInt(n * max2, 10) / 100; + } + if (Math2.abs(n - max2) < 1e-6) { + return 1; + } + return n % max2 / parseFloat(max2); + } + function clamp01(val) { + return mathMin(1, mathMax(0, val)); + } + function parseIntFromHex(val) { + return parseInt(val, 16); + } + function isOnePointZero(n) { + return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1; + } + function isPercentage(n) { + return typeof n === "string" && n.indexOf("%") != -1; + } + function pad2(c2) { + return c2.length == 1 ? "0" + c2 : "" + c2; + } + function convertToPercentage(n) { + if (n <= 1) { + n = n * 100 + "%"; + } + return n; + } + function convertDecimalToHex(d) { + return Math2.round(parseFloat(d) * 255).toString(16); + } + function convertHexToDecimal(h) { + return parseIntFromHex(h) / 255; + } + var matchers = function() { + var CSS_INTEGER = "[-\\+]?\\d+%?"; + var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; + var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; + var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + return { + CSS_UNIT: new RegExp(CSS_UNIT), + rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), + rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), + hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), + hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), + hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), + hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), + hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, + hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ + }; + }(); + function isValidCSSUnit(color) { + return !!matchers.CSS_UNIT.exec(color); + } + function stringInputToObject(color) { + color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase(); + var named = false; + if (names[color]) { + color = names[color]; + named = true; + } else if (color == "transparent") { + return { r: 0, g: 0, b: 0, a: 0, format: "name" }; + } + var match; + if (match = matchers.rgb.exec(color)) { + return { r: match[1], g: match[2], b: match[3] }; + } + if (match = matchers.rgba.exec(color)) { + return { r: match[1], g: match[2], b: match[3], a: match[4] }; + } + if (match = matchers.hsl.exec(color)) { + return { h: match[1], s: match[2], l: match[3] }; + } + if (match = matchers.hsla.exec(color)) { + return { h: match[1], s: match[2], l: match[3], a: match[4] }; + } + if (match = matchers.hsv.exec(color)) { + return { h: match[1], s: match[2], v: match[3] }; + } + if (match = matchers.hsva.exec(color)) { + return { h: match[1], s: match[2], v: match[3], a: match[4] }; + } + if (match = matchers.hex8.exec(color)) { + return { + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + a: convertHexToDecimal(match[4]), + format: named ? "name" : "hex8" + }; + } + if (match = matchers.hex6.exec(color)) { + return { + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + format: named ? "name" : "hex" + }; + } + if (match = matchers.hex4.exec(color)) { + return { + r: parseIntFromHex(match[1] + "" + match[1]), + g: parseIntFromHex(match[2] + "" + match[2]), + b: parseIntFromHex(match[3] + "" + match[3]), + a: convertHexToDecimal(match[4] + "" + match[4]), + format: named ? "name" : "hex8" + }; + } + if (match = matchers.hex3.exec(color)) { + return { + r: parseIntFromHex(match[1] + "" + match[1]), + g: parseIntFromHex(match[2] + "" + match[2]), + b: parseIntFromHex(match[3] + "" + match[3]), + format: named ? "name" : "hex" + }; + } + return false; + } + function validateWCAG2Parms(parms) { + var level, size; + parms = parms || { "level": "AA", "size": "small" }; + level = (parms.level || "AA").toUpperCase(); + size = (parms.size || "small").toLowerCase(); + if (level !== "AA" && level !== "AAA") { + level = "AA"; + } + if (size !== "small" && size !== "large") { + size = "small"; + } + return { "level": level, "size": size }; + } + if (typeof module2 !== "undefined" && module2.exports) { + module2.exports = tinycolor; + } else if (typeof define === "function" && define.amd) { + define(function() { + return tinycolor; + }); + } else { + window.tinycolor = tinycolor; + } + })(Math); + } +}); + +// node_modules/observable-slim/observable-slim.js +var require_observable_slim = __commonJS({ + "node_modules/observable-slim/observable-slim.js"(exports2, module2) { + var ObservableSlim2 = function() { + var paths = []; + var observables = []; + var targets = []; + var targetsProxy = []; + var dupProxy = null; + var _getProperty = function(obj, path) { + return path.split(".").reduce(function(prev, curr) { + return prev ? prev[curr] : void 0; + }, obj || self); + }; + var _create = function(target, domDelay, originalObservable, originalPath) { + var observable = originalObservable || null; + var path = originalPath || [{ "target": target, "property": "" }]; + paths.push(path); + if (target instanceof Array) { + if (!target.hasOwnProperty("__length")) + Object.defineProperty(target, "__length", { enumerable: false, value: target.length, writable: true }); + else + target.__length = target.length; + } + var changes = []; + var _getPath = function(target2, property, jsonPointer) { + var fullPath = ""; + var lastTarget = null; + for (var i = 0; i < path.length; i++) { + if (lastTarget instanceof Array && !isNaN(path[i].property)) { + path[i].property = lastTarget.indexOf(path[i].target); + } + fullPath = fullPath + "." + path[i].property; + lastTarget = path[i].target; + } + fullPath = fullPath + "." + property; + fullPath = fullPath.substring(2); + if (jsonPointer === true) + fullPath = "/" + fullPath.replace(/\./g, "/"); + return fullPath; + }; + var _notifyObservers = function(numChanges) { + if (observable.paused === true) + return; + var domDelayIsNumber = typeof domDelay === "number"; + if (domDelayIsNumber || domDelay === true) { + setTimeout(function() { + if (numChanges === changes.length) { + var changesCopy2 = changes.slice(0); + changes = []; + for (var i2 = 0; i2 < observable.observers.length; i2++) + observable.observers[i2](changesCopy2); + } + }, domDelayIsNumber && domDelay > 0 ? domDelay : 10); + } else { + var changesCopy = changes.slice(0); + changes = []; + for (var i = 0; i < observable.observers.length; i++) + observable.observers[i](changesCopy); + } + }; + var handler = { + get: function(target2, property) { + if (property === "__getTarget") { + return target2; + } else if (property === "__isProxy") { + return true; + } else if (property === "__getParent") { + return function(i2) { + if (typeof i2 === "undefined") + var i2 = 1; + var parentPath2 = _getPath(target2, "__getParent").split("."); + parentPath2.splice(-(i2 + 1), i2 + 1); + return _getProperty(observable.parentProxy, parentPath2.join(".")); + }; + } else if (property === "__getPath") { + var parentPath = _getPath(target2, "__getParent"); + return parentPath.slice(0, -12); + } + var targetProp = target2[property]; + if (target2 instanceof Date && targetProp instanceof Function && targetProp !== null) { + return targetProp.bind(target2); + } + if (targetProp instanceof Object && targetProp !== null && target2.hasOwnProperty(property)) { + if (targetProp.__isProxy === true) + targetProp = targetProp.__getTarget; + if (targetProp.__targetPosition > -1 && targets[targetProp.__targetPosition] !== null) { + var ttp = targetsProxy[targetProp.__targetPosition]; + for (var i = 0, l = ttp.length; i < l; i++) { + if (observable === ttp[i].observable) { + return ttp[i].proxy; + } + } + } + var newPath = path.slice(0); + newPath.push({ "target": targetProp, "property": property }); + return _create(targetProp, domDelay, observable, newPath); + } else { + return targetProp; + } + }, + deleteProperty: function(target2, property) { + var originalChange = true; + if (dupProxy === proxy) { + originalChange = false; + dupProxy = null; + } + var previousValue = Object.assign({}, target2); + changes.push({ + "type": "delete", + "target": target2, + "property": property, + "newValue": null, + "previousValue": previousValue[property], + "currentPath": _getPath(target2, property), + "jsonPointer": _getPath(target2, property, true), + "proxy": proxy + }); + if (originalChange === true) { + if (!observable.changesPaused) + delete target2[property]; + for (var a2 = 0, l = targets.length; a2 < l; a2++) + if (target2 === targets[a2]) + break; + var currentTargetProxy = targetsProxy[a2] || []; + var b = currentTargetProxy.length; + while (b--) { + if (currentTargetProxy[b].proxy !== proxy) { + dupProxy = currentTargetProxy[b].proxy; + delete currentTargetProxy[b].proxy[property]; + } + } + } + _notifyObservers(changes.length); + return true; + }, + set: function(target2, property, value, receiver) { + if (value && value.__isProxy) + value = value.__getTarget; + var originalChange = true; + if (dupProxy === proxy) { + originalChange = false; + dupProxy = null; + } + var targetProp = target2[property]; + if (targetProp !== value || originalChange === false || property === "length" && target2 instanceof Array && target2.__length !== value) { + var foundObservable = true; + var typeOfTargetProp = typeof targetProp; + var type = "update"; + if (typeOfTargetProp === "undefined") + type = "add"; + changes.push({ + "type": type, + "target": target2, + "property": property, + "newValue": value, + "previousValue": receiver[property], + "currentPath": _getPath(target2, property), + "jsonPointer": _getPath(target2, property, true), + "proxy": proxy + }); + if (property === "length" && target2 instanceof Array && target2.__length !== value) { + changes[changes.length - 1].previousValue = target2.__length; + target2.__length = value; + } + if (originalChange === true) { + if (!observable.changesPaused) + target2[property] = value; + foundObservable = false; + var targetPosition = target2.__targetPosition; + var z2 = targetsProxy[targetPosition].length; + while (z2--) { + if (observable === targetsProxy[targetPosition][z2].observable) { + if (targets[targetsProxy[targetPosition][z2].observable.parentTarget.__targetPosition] !== null) { + foundObservable = true; + break; + } + } + } + if (foundObservable) { + var currentTargetProxy = targetsProxy[targetPosition]; + for (var b = 0, l = currentTargetProxy.length; b < l; b++) { + if (currentTargetProxy[b].proxy !== proxy) { + dupProxy = currentTargetProxy[b].proxy; + currentTargetProxy[b].proxy[property] = value; + } + } + setTimeout(function() { + if (typeOfTargetProp === "object" && targetProp !== null) { + var keys = Object.keys(target2); + for (var i = 0, l2 = keys.length; i < l2; i++) { + if (target2[keys[i]] === targetProp) + return; + } + var stillExists = false; + (function iterate(target3) { + var keys2 = Object.keys(target3); + for (var i2 = 0, l3 = keys2.length; i2 < l3; i2++) { + var property2 = keys2[i2]; + var nestedTarget = target3[property2]; + if (nestedTarget instanceof Object && nestedTarget !== null) + iterate(nestedTarget); + if (nestedTarget === targetProp) { + stillExists = true; + return; + } + } + ; + })(target2); + if (stillExists === true) + return; + (function iterate(obj) { + var keys2 = Object.keys(obj); + for (var i2 = 0, l3 = keys2.length; i2 < l3; i2++) { + var objProp = obj[keys2[i2]]; + if (objProp instanceof Object && objProp !== null) + iterate(objProp); + } + var c2 = -1; + for (var i2 = 0, l3 = targets.length; i2 < l3; i2++) { + if (obj === targets[i2]) { + c2 = i2; + break; + } + } + if (c2 > -1) { + var currentTargetProxy2 = targetsProxy[c2]; + var d = currentTargetProxy2.length; + while (d--) { + if (observable === currentTargetProxy2[d].observable) { + currentTargetProxy2.splice(d, 1); + break; + } + } + if (currentTargetProxy2.length == 0) { + targets[c2] = null; + } + } + })(targetProp); + } + }, 1e4); + } + } + ; + if (foundObservable) { + _notifyObservers(changes.length); + } + } + return true; + } + }; + var __targetPosition = target.__targetPosition; + if (!(__targetPosition > -1)) { + Object.defineProperty(target, "__targetPosition", { + value: targets.length, + writable: false, + enumerable: false, + configurable: false + }); + } + var proxy = new Proxy(target, handler); + if (observable === null) { + observable = { "parentTarget": target, "domDelay": domDelay, "parentProxy": proxy, "observers": [], "paused": false, "path": path, "changesPaused": false }; + observables.push(observable); + } + var proxyItem = { "target": target, "proxy": proxy, "observable": observable }; + if (__targetPosition > -1) { + if (targets[__targetPosition] === null) { + targets[__targetPosition] = target; + } + targetsProxy[__targetPosition].push(proxyItem); + } else { + targets.push(target); + targetsProxy.push([proxyItem]); + } + return proxy; + }; + return { + create: function(target, domDelay, observer) { + if (target.__isProxy === true) { + var target = target.__getTarget; + } + var proxy = _create(target, domDelay); + if (typeof observer === "function") + this.observe(proxy, observer); + (function iterate(proxy2) { + var target2 = proxy2.__getTarget; + var keys = Object.keys(target2); + for (var i = 0, l = keys.length; i < l; i++) { + var property = keys[i]; + if (target2[property] instanceof Object && target2[property] !== null) + iterate(proxy2[property]); + } + })(proxy); + return proxy; + }, + observe: function(proxy, observer) { + var i = observables.length; + while (i--) { + if (observables[i].parentProxy === proxy) { + observables[i].observers.push(observer); + break; + } + } + ; + }, + pause: function(proxy) { + var i = observables.length; + var foundMatch = false; + while (i--) { + if (observables[i].parentProxy === proxy) { + observables[i].paused = true; + foundMatch = true; + break; + } + } + ; + if (foundMatch == false) + throw new Error("ObseravableSlim could not pause observable -- matching proxy not found."); + }, + resume: function(proxy) { + var i = observables.length; + var foundMatch = false; + while (i--) { + if (observables[i].parentProxy === proxy) { + observables[i].paused = false; + foundMatch = true; + break; + } + } + ; + if (foundMatch == false) + throw new Error("ObseravableSlim could not resume observable -- matching proxy not found."); + }, + pauseChanges: function(proxy) { + var i = observables.length; + var foundMatch = false; + while (i--) { + if (observables[i].parentProxy === proxy) { + observables[i].changesPaused = true; + foundMatch = true; + break; + } + } + ; + if (foundMatch == false) + throw new Error("ObseravableSlim could not pause changes on observable -- matching proxy not found."); + }, + resumeChanges: function(proxy) { + var i = observables.length; + var foundMatch = false; + while (i--) { + if (observables[i].parentProxy === proxy) { + observables[i].changesPaused = false; + foundMatch = true; + break; + } + } + ; + if (foundMatch == false) + throw new Error("ObseravableSlim could not resume changes on observable -- matching proxy not found."); + }, + remove: function(proxy) { + var matchedObservable = null; + var foundMatch = false; + var c2 = observables.length; + while (c2--) { + if (observables[c2].parentProxy === proxy) { + matchedObservable = observables[c2]; + foundMatch = true; + break; + } + } + ; + var a2 = targetsProxy.length; + while (a2--) { + var b = targetsProxy[a2].length; + while (b--) { + if (targetsProxy[a2][b].observable === matchedObservable) { + targetsProxy[a2].splice(b, 1); + if (targetsProxy[a2].length === 0) { + targets[a2] = null; + } + ; + } + } + ; + } + ; + if (foundMatch === true) { + observables.splice(c2, 1); + } + } + }; + }(); + try { + module2.exports = ObservableSlim2; + } catch (err) { + } + } +}); + +// src/main.ts +var main_exports = {}; +__export(main_exports, { + default: () => Graph3dPlugin +}); +module.exports = __toCommonJS(main_exports); +var import_obsidian7 = require("obsidian"); + +// src/views/graph/Graph3dView.ts +var import_obsidian6 = require("obsidian"); + +// node_modules/three/build/three.module.js +var REVISION = "143"; +var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; +var TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; +var CullFaceNone = 0; +var CullFaceBack = 1; +var CullFaceFront = 2; +var PCFShadowMap = 1; +var PCFSoftShadowMap = 2; +var VSMShadowMap = 3; +var FrontSide = 0; +var BackSide = 1; +var DoubleSide = 2; +var FlatShading = 1; +var NoBlending = 0; +var NormalBlending = 1; +var AdditiveBlending = 2; +var SubtractiveBlending = 3; +var MultiplyBlending = 4; +var CustomBlending = 5; +var AddEquation = 100; +var SubtractEquation = 101; +var ReverseSubtractEquation = 102; +var MinEquation = 103; +var MaxEquation = 104; +var ZeroFactor = 200; +var OneFactor = 201; +var SrcColorFactor = 202; +var OneMinusSrcColorFactor = 203; +var SrcAlphaFactor = 204; +var OneMinusSrcAlphaFactor = 205; +var DstAlphaFactor = 206; +var OneMinusDstAlphaFactor = 207; +var DstColorFactor = 208; +var OneMinusDstColorFactor = 209; +var SrcAlphaSaturateFactor = 210; +var NeverDepth = 0; +var AlwaysDepth = 1; +var LessDepth = 2; +var LessEqualDepth = 3; +var EqualDepth = 4; +var GreaterEqualDepth = 5; +var GreaterDepth = 6; +var NotEqualDepth = 7; +var MultiplyOperation = 0; +var MixOperation = 1; +var AddOperation = 2; +var NoToneMapping = 0; +var LinearToneMapping = 1; +var ReinhardToneMapping = 2; +var CineonToneMapping = 3; +var ACESFilmicToneMapping = 4; +var CustomToneMapping = 5; +var UVMapping = 300; +var CubeReflectionMapping = 301; +var CubeRefractionMapping = 302; +var EquirectangularReflectionMapping = 303; +var EquirectangularRefractionMapping = 304; +var CubeUVReflectionMapping = 306; +var RepeatWrapping = 1e3; +var ClampToEdgeWrapping = 1001; +var MirroredRepeatWrapping = 1002; +var NearestFilter = 1003; +var NearestMipmapNearestFilter = 1004; +var NearestMipmapLinearFilter = 1005; +var LinearFilter = 1006; +var LinearMipmapNearestFilter = 1007; +var LinearMipmapLinearFilter = 1008; +var UnsignedByteType = 1009; +var ByteType = 1010; +var ShortType = 1011; +var UnsignedShortType = 1012; +var IntType = 1013; +var UnsignedIntType = 1014; +var FloatType = 1015; +var HalfFloatType = 1016; +var UnsignedShort4444Type = 1017; +var UnsignedShort5551Type = 1018; +var UnsignedInt248Type = 1020; +var AlphaFormat = 1021; +var RGBFormat = 1022; +var RGBAFormat = 1023; +var LuminanceFormat = 1024; +var LuminanceAlphaFormat = 1025; +var DepthFormat = 1026; +var DepthStencilFormat = 1027; +var RedFormat = 1028; +var RedIntegerFormat = 1029; +var RGFormat = 1030; +var RGIntegerFormat = 1031; +var RGBAIntegerFormat = 1033; +var RGB_S3TC_DXT1_Format = 33776; +var RGBA_S3TC_DXT1_Format = 33777; +var RGBA_S3TC_DXT3_Format = 33778; +var RGBA_S3TC_DXT5_Format = 33779; +var RGB_PVRTC_4BPPV1_Format = 35840; +var RGB_PVRTC_2BPPV1_Format = 35841; +var RGBA_PVRTC_4BPPV1_Format = 35842; +var RGBA_PVRTC_2BPPV1_Format = 35843; +var RGB_ETC1_Format = 36196; +var RGB_ETC2_Format = 37492; +var RGBA_ETC2_EAC_Format = 37496; +var RGBA_ASTC_4x4_Format = 37808; +var RGBA_ASTC_5x4_Format = 37809; +var RGBA_ASTC_5x5_Format = 37810; +var RGBA_ASTC_6x5_Format = 37811; +var RGBA_ASTC_6x6_Format = 37812; +var RGBA_ASTC_8x5_Format = 37813; +var RGBA_ASTC_8x6_Format = 37814; +var RGBA_ASTC_8x8_Format = 37815; +var RGBA_ASTC_10x5_Format = 37816; +var RGBA_ASTC_10x6_Format = 37817; +var RGBA_ASTC_10x8_Format = 37818; +var RGBA_ASTC_10x10_Format = 37819; +var RGBA_ASTC_12x10_Format = 37820; +var RGBA_ASTC_12x12_Format = 37821; +var RGBA_BPTC_Format = 36492; +var InterpolateDiscrete = 2300; +var InterpolateLinear = 2301; +var InterpolateSmooth = 2302; +var ZeroCurvatureEnding = 2400; +var ZeroSlopeEnding = 2401; +var WrapAroundEnding = 2402; +var LinearEncoding = 3e3; +var sRGBEncoding = 3001; +var BasicDepthPacking = 3200; +var RGBADepthPacking = 3201; +var TangentSpaceNormalMap = 0; +var ObjectSpaceNormalMap = 1; +var SRGBColorSpace = "srgb"; +var LinearSRGBColorSpace = "srgb-linear"; +var KeepStencilOp = 7680; +var AlwaysStencilFunc = 519; +var StaticDrawUsage = 35044; +var GLSL3 = "300 es"; +var _SRGBAFormat = 1035; +var EventDispatcher = class { + addEventListener(type, listener) { + if (this._listeners === void 0) + this._listeners = {}; + const listeners = this._listeners; + if (listeners[type] === void 0) { + listeners[type] = []; + } + if (listeners[type].indexOf(listener) === -1) { + listeners[type].push(listener); + } + } + hasEventListener(type, listener) { + if (this._listeners === void 0) + return false; + const listeners = this._listeners; + return listeners[type] !== void 0 && listeners[type].indexOf(listener) !== -1; + } + removeEventListener(type, listener) { + if (this._listeners === void 0) + return; + const listeners = this._listeners; + const listenerArray = listeners[type]; + if (listenerArray !== void 0) { + const index5 = listenerArray.indexOf(listener); + if (index5 !== -1) { + listenerArray.splice(index5, 1); + } + } + } + dispatchEvent(event) { + if (this._listeners === void 0) + return; + const listeners = this._listeners; + const listenerArray = listeners[event.type]; + if (listenerArray !== void 0) { + event.target = this; + const array = listenerArray.slice(0); + for (let i = 0, l = array.length; i < l; i++) { + array[i].call(this, event); + } + event.target = null; + } + } +}; +var _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"]; +var DEG2RAD = Math.PI / 180; +var RAD2DEG = 180 / Math.PI; +function generateUUID() { + const d0 = Math.random() * 4294967295 | 0; + const d1 = Math.random() * 4294967295 | 0; + const d2 = Math.random() * 4294967295 | 0; + const d3 = Math.random() * 4294967295 | 0; + const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255]; + return uuid.toLowerCase(); +} +function clamp(value, min2, max2) { + return Math.max(min2, Math.min(max2, value)); +} +function euclideanModulo(n, m2) { + return (n % m2 + m2) % m2; +} +function lerp(x2, y2, t) { + return (1 - t) * x2 + t * y2; +} +function isPowerOfTwo(value) { + return (value & value - 1) === 0 && value !== 0; +} +function floorPowerOfTwo(value) { + return Math.pow(2, Math.floor(Math.log(value) / Math.LN2)); +} +var Vector2 = class { + constructor(x2 = 0, y2 = 0) { + Vector2.prototype.isVector2 = true; + this.x = x2; + this.y = y2; + } + get width() { + return this.x; + } + set width(value) { + this.x = value; + } + get height() { + return this.y; + } + set height(value) { + this.y = value; + } + set(x2, y2) { + this.x = x2; + this.y = y2; + return this; + } + setScalar(scalar) { + this.x = scalar; + this.y = scalar; + return this; + } + setX(x2) { + this.x = x2; + return this; + } + setY(y2) { + this.y = y2; + return this; + } + setComponent(index5, value) { + switch (index5) { + case 0: + this.x = value; + break; + case 1: + this.y = value; + break; + default: + throw new Error("index is out of range: " + index5); + } + return this; + } + getComponent(index5) { + switch (index5) { + case 0: + return this.x; + case 1: + return this.y; + default: + throw new Error("index is out of range: " + index5); + } + } + clone() { + return new this.constructor(this.x, this.y); + } + copy(v) { + this.x = v.x; + this.y = v.y; + return this; + } + add(v) { + this.x += v.x; + this.y += v.y; + return this; + } + addScalar(s) { + this.x += s; + this.y += s; + return this; + } + addVectors(a2, b) { + this.x = a2.x + b.x; + this.y = a2.y + b.y; + return this; + } + addScaledVector(v, s) { + this.x += v.x * s; + this.y += v.y * s; + return this; + } + sub(v) { + this.x -= v.x; + this.y -= v.y; + return this; + } + subScalar(s) { + this.x -= s; + this.y -= s; + return this; + } + subVectors(a2, b) { + this.x = a2.x - b.x; + this.y = a2.y - b.y; + return this; + } + multiply(v) { + this.x *= v.x; + this.y *= v.y; + return this; + } + multiplyScalar(scalar) { + this.x *= scalar; + this.y *= scalar; + return this; + } + divide(v) { + this.x /= v.x; + this.y /= v.y; + return this; + } + divideScalar(scalar) { + return this.multiplyScalar(1 / scalar); + } + applyMatrix3(m2) { + const x2 = this.x, y2 = this.y; + const e = m2.elements; + this.x = e[0] * x2 + e[3] * y2 + e[6]; + this.y = e[1] * x2 + e[4] * y2 + e[7]; + return this; + } + min(v) { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + return this; + } + max(v) { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + return this; + } + clamp(min2, max2) { + this.x = Math.max(min2.x, Math.min(max2.x, this.x)); + this.y = Math.max(min2.y, Math.min(max2.y, this.y)); + return this; + } + clampScalar(minVal, maxVal) { + this.x = Math.max(minVal, Math.min(maxVal, this.x)); + this.y = Math.max(minVal, Math.min(maxVal, this.y)); + return this; + } + clampLength(min2, max2) { + const length = this.length(); + return this.divideScalar(length || 1).multiplyScalar(Math.max(min2, Math.min(max2, length))); + } + floor() { + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + return this; + } + ceil() { + this.x = Math.ceil(this.x); + this.y = Math.ceil(this.y); + return this; + } + round() { + this.x = Math.round(this.x); + this.y = Math.round(this.y); + return this; + } + roundToZero() { + this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x); + this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y); + return this; + } + negate() { + this.x = -this.x; + this.y = -this.y; + return this; + } + dot(v) { + return this.x * v.x + this.y * v.y; + } + cross(v) { + return this.x * v.y - this.y * v.x; + } + lengthSq() { + return this.x * this.x + this.y * this.y; + } + length() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } + manhattanLength() { + return Math.abs(this.x) + Math.abs(this.y); + } + normalize() { + return this.divideScalar(this.length() || 1); + } + angle() { + const angle = Math.atan2(-this.y, -this.x) + Math.PI; + return angle; + } + distanceTo(v) { + return Math.sqrt(this.distanceToSquared(v)); + } + distanceToSquared(v) { + const dx = this.x - v.x, dy = this.y - v.y; + return dx * dx + dy * dy; + } + manhattanDistanceTo(v) { + return Math.abs(this.x - v.x) + Math.abs(this.y - v.y); + } + setLength(length) { + return this.normalize().multiplyScalar(length); + } + lerp(v, alpha) { + this.x += (v.x - this.x) * alpha; + this.y += (v.y - this.y) * alpha; + return this; + } + lerpVectors(v1, v2, alpha) { + this.x = v1.x + (v2.x - v1.x) * alpha; + this.y = v1.y + (v2.y - v1.y) * alpha; + return this; + } + equals(v) { + return v.x === this.x && v.y === this.y; + } + fromArray(array, offset = 0) { + this.x = array[offset]; + this.y = array[offset + 1]; + return this; + } + toArray(array = [], offset = 0) { + array[offset] = this.x; + array[offset + 1] = this.y; + return array; + } + fromBufferAttribute(attribute, index5) { + this.x = attribute.getX(index5); + this.y = attribute.getY(index5); + return this; + } + rotateAround(center, angle) { + const c2 = Math.cos(angle), s = Math.sin(angle); + const x2 = this.x - center.x; + const y2 = this.y - center.y; + this.x = x2 * c2 - y2 * s + center.x; + this.y = x2 * s + y2 * c2 + center.y; + return this; + } + random() { + this.x = Math.random(); + this.y = Math.random(); + return this; + } + *[Symbol.iterator]() { + yield this.x; + yield this.y; + } +}; +var Matrix3 = class { + constructor() { + Matrix3.prototype.isMatrix3 = true; + this.elements = [ + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1 + ]; + } + set(n11, n12, n13, n21, n22, n23, n31, n32, n33) { + const te = this.elements; + te[0] = n11; + te[1] = n21; + te[2] = n31; + te[3] = n12; + te[4] = n22; + te[5] = n32; + te[6] = n13; + te[7] = n23; + te[8] = n33; + return this; + } + identity() { + this.set(1, 0, 0, 0, 1, 0, 0, 0, 1); + return this; + } + copy(m2) { + const te = this.elements; + const me = m2.elements; + te[0] = me[0]; + te[1] = me[1]; + te[2] = me[2]; + te[3] = me[3]; + te[4] = me[4]; + te[5] = me[5]; + te[6] = me[6]; + te[7] = me[7]; + te[8] = me[8]; + return this; + } + extractBasis(xAxis, yAxis, zAxis) { + xAxis.setFromMatrix3Column(this, 0); + yAxis.setFromMatrix3Column(this, 1); + zAxis.setFromMatrix3Column(this, 2); + return this; + } + setFromMatrix4(m2) { + const me = m2.elements; + this.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]); + return this; + } + multiply(m2) { + return this.multiplyMatrices(this, m2); + } + premultiply(m2) { + return this.multiplyMatrices(m2, this); + } + multiplyMatrices(a2, b) { + const ae = a2.elements; + const be = b.elements; + const te = this.elements; + const a11 = ae[0], a12 = ae[3], a13 = ae[6]; + const a21 = ae[1], a22 = ae[4], a23 = ae[7]; + const a31 = ae[2], a32 = ae[5], a33 = ae[8]; + const b11 = be[0], b12 = be[3], b13 = be[6]; + const b21 = be[1], b22 = be[4], b23 = be[7]; + const b31 = be[2], b32 = be[5], b33 = be[8]; + te[0] = a11 * b11 + a12 * b21 + a13 * b31; + te[3] = a11 * b12 + a12 * b22 + a13 * b32; + te[6] = a11 * b13 + a12 * b23 + a13 * b33; + te[1] = a21 * b11 + a22 * b21 + a23 * b31; + te[4] = a21 * b12 + a22 * b22 + a23 * b32; + te[7] = a21 * b13 + a22 * b23 + a23 * b33; + te[2] = a31 * b11 + a32 * b21 + a33 * b31; + te[5] = a31 * b12 + a32 * b22 + a33 * b32; + te[8] = a31 * b13 + a32 * b23 + a33 * b33; + return this; + } + multiplyScalar(s) { + const te = this.elements; + te[0] *= s; + te[3] *= s; + te[6] *= s; + te[1] *= s; + te[4] *= s; + te[7] *= s; + te[2] *= s; + te[5] *= s; + te[8] *= s; + return this; + } + determinant() { + const te = this.elements; + const a2 = te[0], b = te[1], c2 = te[2], d = te[3], e = te[4], f = te[5], g = te[6], h = te[7], i = te[8]; + return a2 * e * i - a2 * f * h - b * d * i + b * f * g + c2 * d * h - c2 * e * g; + } + invert() { + const te = this.elements, n11 = te[0], n21 = te[1], n31 = te[2], n12 = te[3], n22 = te[4], n32 = te[5], n13 = te[6], n23 = te[7], n33 = te[8], t11 = n33 * n22 - n32 * n23, t12 = n32 * n13 - n33 * n12, t13 = n23 * n12 - n22 * n13, det = n11 * t11 + n21 * t12 + n31 * t13; + if (det === 0) + return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); + const detInv = 1 / det; + te[0] = t11 * detInv; + te[1] = (n31 * n23 - n33 * n21) * detInv; + te[2] = (n32 * n21 - n31 * n22) * detInv; + te[3] = t12 * detInv; + te[4] = (n33 * n11 - n31 * n13) * detInv; + te[5] = (n31 * n12 - n32 * n11) * detInv; + te[6] = t13 * detInv; + te[7] = (n21 * n13 - n23 * n11) * detInv; + te[8] = (n22 * n11 - n21 * n12) * detInv; + return this; + } + transpose() { + let tmp2; + const m2 = this.elements; + tmp2 = m2[1]; + m2[1] = m2[3]; + m2[3] = tmp2; + tmp2 = m2[2]; + m2[2] = m2[6]; + m2[6] = tmp2; + tmp2 = m2[5]; + m2[5] = m2[7]; + m2[7] = tmp2; + return this; + } + getNormalMatrix(matrix4) { + return this.setFromMatrix4(matrix4).invert().transpose(); + } + transposeIntoArray(r) { + const m2 = this.elements; + r[0] = m2[0]; + r[1] = m2[3]; + r[2] = m2[6]; + r[3] = m2[1]; + r[4] = m2[4]; + r[5] = m2[7]; + r[6] = m2[2]; + r[7] = m2[5]; + r[8] = m2[8]; + return this; + } + setUvTransform(tx, ty, sx, sy, rotation, cx, cy) { + const c2 = Math.cos(rotation); + const s = Math.sin(rotation); + this.set(sx * c2, sx * s, -sx * (c2 * cx + s * cy) + cx + tx, -sy * s, sy * c2, -sy * (-s * cx + c2 * cy) + cy + ty, 0, 0, 1); + return this; + } + scale(sx, sy) { + const te = this.elements; + te[0] *= sx; + te[3] *= sx; + te[6] *= sx; + te[1] *= sy; + te[4] *= sy; + te[7] *= sy; + return this; + } + rotate(theta) { + const c2 = Math.cos(theta); + const s = Math.sin(theta); + const te = this.elements; + const a11 = te[0], a12 = te[3], a13 = te[6]; + const a21 = te[1], a22 = te[4], a23 = te[7]; + te[0] = c2 * a11 + s * a21; + te[3] = c2 * a12 + s * a22; + te[6] = c2 * a13 + s * a23; + te[1] = -s * a11 + c2 * a21; + te[4] = -s * a12 + c2 * a22; + te[7] = -s * a13 + c2 * a23; + return this; + } + translate(tx, ty) { + const te = this.elements; + te[0] += tx * te[2]; + te[3] += tx * te[5]; + te[6] += tx * te[8]; + te[1] += ty * te[2]; + te[4] += ty * te[5]; + te[7] += ty * te[8]; + return this; + } + equals(matrix) { + const te = this.elements; + const me = matrix.elements; + for (let i = 0; i < 9; i++) { + if (te[i] !== me[i]) + return false; + } + return true; + } + fromArray(array, offset = 0) { + for (let i = 0; i < 9; i++) { + this.elements[i] = array[i + offset]; + } + return this; + } + toArray(array = [], offset = 0) { + const te = this.elements; + array[offset] = te[0]; + array[offset + 1] = te[1]; + array[offset + 2] = te[2]; + array[offset + 3] = te[3]; + array[offset + 4] = te[4]; + array[offset + 5] = te[5]; + array[offset + 6] = te[6]; + array[offset + 7] = te[7]; + array[offset + 8] = te[8]; + return array; + } + clone() { + return new this.constructor().fromArray(this.elements); + } +}; +function arrayNeedsUint32(array) { + for (let i = array.length - 1; i >= 0; --i) { + if (array[i] > 65535) + return true; + } + return false; +} +function createElementNS(name) { + return document.createElementNS("http://www.w3.org/1999/xhtml", name); +} +function SRGBToLinear(c2) { + return c2 < 0.04045 ? c2 * 0.0773993808 : Math.pow(c2 * 0.9478672986 + 0.0521327014, 2.4); +} +function LinearToSRGB(c2) { + return c2 < 31308e-7 ? c2 * 12.92 : 1.055 * Math.pow(c2, 0.41666) - 0.055; +} +var FN = { + [SRGBColorSpace]: { [LinearSRGBColorSpace]: SRGBToLinear }, + [LinearSRGBColorSpace]: { [SRGBColorSpace]: LinearToSRGB } +}; +var ColorManagement = { + legacyMode: true, + get workingColorSpace() { + return LinearSRGBColorSpace; + }, + set workingColorSpace(colorSpace) { + console.warn("THREE.ColorManagement: .workingColorSpace is readonly."); + }, + convert: function(color, sourceColorSpace, targetColorSpace) { + if (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) { + return color; + } + if (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== void 0) { + const fn = FN[sourceColorSpace][targetColorSpace]; + color.r = fn(color.r); + color.g = fn(color.g); + color.b = fn(color.b); + return color; + } + throw new Error("Unsupported color space conversion."); + }, + fromWorkingColorSpace: function(color, targetColorSpace) { + return this.convert(color, this.workingColorSpace, targetColorSpace); + }, + toWorkingColorSpace: function(color, sourceColorSpace) { + return this.convert(color, sourceColorSpace, this.workingColorSpace); + } +}; +var _colorKeywords = { + "aliceblue": 15792383, + "antiquewhite": 16444375, + "aqua": 65535, + "aquamarine": 8388564, + "azure": 15794175, + "beige": 16119260, + "bisque": 16770244, + "black": 0, + "blanchedalmond": 16772045, + "blue": 255, + "blueviolet": 9055202, + "brown": 10824234, + "burlywood": 14596231, + "cadetblue": 6266528, + "chartreuse": 8388352, + "chocolate": 13789470, + "coral": 16744272, + "cornflowerblue": 6591981, + "cornsilk": 16775388, + "crimson": 14423100, + "cyan": 65535, + "darkblue": 139, + "darkcyan": 35723, + "darkgoldenrod": 12092939, + "darkgray": 11119017, + "darkgreen": 25600, + "darkgrey": 11119017, + "darkkhaki": 12433259, + "darkmagenta": 9109643, + "darkolivegreen": 5597999, + "darkorange": 16747520, + "darkorchid": 10040012, + "darkred": 9109504, + "darksalmon": 15308410, + "darkseagreen": 9419919, + "darkslateblue": 4734347, + "darkslategray": 3100495, + "darkslategrey": 3100495, + "darkturquoise": 52945, + "darkviolet": 9699539, + "deeppink": 16716947, + "deepskyblue": 49151, + "dimgray": 6908265, + "dimgrey": 6908265, + "dodgerblue": 2003199, + "firebrick": 11674146, + "floralwhite": 16775920, + "forestgreen": 2263842, + "fuchsia": 16711935, + "gainsboro": 14474460, + "ghostwhite": 16316671, + "gold": 16766720, + "goldenrod": 14329120, + "gray": 8421504, + "green": 32768, + "greenyellow": 11403055, + "grey": 8421504, + "honeydew": 15794160, + "hotpink": 16738740, + "indianred": 13458524, + "indigo": 4915330, + "ivory": 16777200, + "khaki": 15787660, + "lavender": 15132410, + "lavenderblush": 16773365, + "lawngreen": 8190976, + "lemonchiffon": 16775885, + "lightblue": 11393254, + "lightcoral": 15761536, + "lightcyan": 14745599, + "lightgoldenrodyellow": 16448210, + "lightgray": 13882323, + "lightgreen": 9498256, + "lightgrey": 13882323, + "lightpink": 16758465, + "lightsalmon": 16752762, + "lightseagreen": 2142890, + "lightskyblue": 8900346, + "lightslategray": 7833753, + "lightslategrey": 7833753, + "lightsteelblue": 11584734, + "lightyellow": 16777184, + "lime": 65280, + "limegreen": 3329330, + "linen": 16445670, + "magenta": 16711935, + "maroon": 8388608, + "mediumaquamarine": 6737322, + "mediumblue": 205, + "mediumorchid": 12211667, + "mediumpurple": 9662683, + "mediumseagreen": 3978097, + "mediumslateblue": 8087790, + "mediumspringgreen": 64154, + "mediumturquoise": 4772300, + "mediumvioletred": 13047173, + "midnightblue": 1644912, + "mintcream": 16121850, + "mistyrose": 16770273, + "moccasin": 16770229, + "navajowhite": 16768685, + "navy": 128, + "oldlace": 16643558, + "olive": 8421376, + "olivedrab": 7048739, + "orange": 16753920, + "orangered": 16729344, + "orchid": 14315734, + "palegoldenrod": 15657130, + "palegreen": 10025880, + "paleturquoise": 11529966, + "palevioletred": 14381203, + "papayawhip": 16773077, + "peachpuff": 16767673, + "peru": 13468991, + "pink": 16761035, + "plum": 14524637, + "powderblue": 11591910, + "purple": 8388736, + "rebeccapurple": 6697881, + "red": 16711680, + "rosybrown": 12357519, + "royalblue": 4286945, + "saddlebrown": 9127187, + "salmon": 16416882, + "sandybrown": 16032864, + "seagreen": 3050327, + "seashell": 16774638, + "sienna": 10506797, + "silver": 12632256, + "skyblue": 8900331, + "slateblue": 6970061, + "slategray": 7372944, + "slategrey": 7372944, + "snow": 16775930, + "springgreen": 65407, + "steelblue": 4620980, + "tan": 13808780, + "teal": 32896, + "thistle": 14204888, + "tomato": 16737095, + "turquoise": 4251856, + "violet": 15631086, + "wheat": 16113331, + "white": 16777215, + "whitesmoke": 16119285, + "yellow": 16776960, + "yellowgreen": 10145074 +}; +var _rgb = { r: 0, g: 0, b: 0 }; +var _hslA = { h: 0, s: 0, l: 0 }; +var _hslB = { h: 0, s: 0, l: 0 }; +function hue2rgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * 6 * (2 / 3 - t); + return p; +} +function toComponents(source, target) { + target.r = source.r; + target.g = source.g; + target.b = source.b; + return target; +} +var Color = class { + constructor(r, g, b) { + this.isColor = true; + this.r = 1; + this.g = 1; + this.b = 1; + if (g === void 0 && b === void 0) { + return this.set(r); + } + return this.setRGB(r, g, b); + } + set(value) { + if (value && value.isColor) { + this.copy(value); + } else if (typeof value === "number") { + this.setHex(value); + } else if (typeof value === "string") { + this.setStyle(value); + } + return this; + } + setScalar(scalar) { + this.r = scalar; + this.g = scalar; + this.b = scalar; + return this; + } + setHex(hex, colorSpace = SRGBColorSpace) { + hex = Math.floor(hex); + this.r = (hex >> 16 & 255) / 255; + this.g = (hex >> 8 & 255) / 255; + this.b = (hex & 255) / 255; + ColorManagement.toWorkingColorSpace(this, colorSpace); + return this; + } + setRGB(r, g, b, colorSpace = LinearSRGBColorSpace) { + this.r = r; + this.g = g; + this.b = b; + ColorManagement.toWorkingColorSpace(this, colorSpace); + return this; + } + setHSL(h, s, l, colorSpace = LinearSRGBColorSpace) { + h = euclideanModulo(h, 1); + s = clamp(s, 0, 1); + l = clamp(l, 0, 1); + if (s === 0) { + this.r = this.g = this.b = l; + } else { + const p = l <= 0.5 ? l * (1 + s) : l + s - l * s; + const q = 2 * l - p; + this.r = hue2rgb(q, p, h + 1 / 3); + this.g = hue2rgb(q, p, h); + this.b = hue2rgb(q, p, h - 1 / 3); + } + ColorManagement.toWorkingColorSpace(this, colorSpace); + return this; + } + setStyle(style, colorSpace = SRGBColorSpace) { + function handleAlpha(string) { + if (string === void 0) + return; + if (parseFloat(string) < 1) { + console.warn("THREE.Color: Alpha component of " + style + " will be ignored."); + } + } + let m2; + if (m2 = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(style)) { + let color; + const name = m2[1]; + const components = m2[2]; + switch (name) { + case "rgb": + case "rgba": + if (color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) { + this.r = Math.min(255, parseInt(color[1], 10)) / 255; + this.g = Math.min(255, parseInt(color[2], 10)) / 255; + this.b = Math.min(255, parseInt(color[3], 10)) / 255; + ColorManagement.toWorkingColorSpace(this, colorSpace); + handleAlpha(color[4]); + return this; + } + if (color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) { + this.r = Math.min(100, parseInt(color[1], 10)) / 100; + this.g = Math.min(100, parseInt(color[2], 10)) / 100; + this.b = Math.min(100, parseInt(color[3], 10)) / 100; + ColorManagement.toWorkingColorSpace(this, colorSpace); + handleAlpha(color[4]); + return this; + } + break; + case "hsl": + case "hsla": + if (color = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) { + const h = parseFloat(color[1]) / 360; + const s = parseInt(color[2], 10) / 100; + const l = parseInt(color[3], 10) / 100; + handleAlpha(color[4]); + return this.setHSL(h, s, l, colorSpace); + } + break; + } + } else if (m2 = /^\#([A-Fa-f\d]+)$/.exec(style)) { + const hex = m2[1]; + const size = hex.length; + if (size === 3) { + this.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255; + this.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255; + this.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255; + ColorManagement.toWorkingColorSpace(this, colorSpace); + return this; + } else if (size === 6) { + this.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255; + this.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255; + this.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255; + ColorManagement.toWorkingColorSpace(this, colorSpace); + return this; + } + } + if (style && style.length > 0) { + return this.setColorName(style, colorSpace); + } + return this; + } + setColorName(style, colorSpace = SRGBColorSpace) { + const hex = _colorKeywords[style.toLowerCase()]; + if (hex !== void 0) { + this.setHex(hex, colorSpace); + } else { + console.warn("THREE.Color: Unknown color " + style); + } + return this; + } + clone() { + return new this.constructor(this.r, this.g, this.b); + } + copy(color) { + this.r = color.r; + this.g = color.g; + this.b = color.b; + return this; + } + copySRGBToLinear(color) { + this.r = SRGBToLinear(color.r); + this.g = SRGBToLinear(color.g); + this.b = SRGBToLinear(color.b); + return this; + } + copyLinearToSRGB(color) { + this.r = LinearToSRGB(color.r); + this.g = LinearToSRGB(color.g); + this.b = LinearToSRGB(color.b); + return this; + } + convertSRGBToLinear() { + this.copySRGBToLinear(this); + return this; + } + convertLinearToSRGB() { + this.copyLinearToSRGB(this); + return this; + } + getHex(colorSpace = SRGBColorSpace) { + ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace); + return clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0; + } + getHexString(colorSpace = SRGBColorSpace) { + return ("000000" + this.getHex(colorSpace).toString(16)).slice(-6); + } + getHSL(target, colorSpace = LinearSRGBColorSpace) { + ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace); + const r = _rgb.r, g = _rgb.g, b = _rgb.b; + const max2 = Math.max(r, g, b); + const min2 = Math.min(r, g, b); + let hue, saturation; + const lightness = (min2 + max2) / 2; + if (min2 === max2) { + hue = 0; + saturation = 0; + } else { + const delta = max2 - min2; + saturation = lightness <= 0.5 ? delta / (max2 + min2) : delta / (2 - max2 - min2); + switch (max2) { + case r: + hue = (g - b) / delta + (g < b ? 6 : 0); + break; + case g: + hue = (b - r) / delta + 2; + break; + case b: + hue = (r - g) / delta + 4; + break; + } + hue /= 6; + } + target.h = hue; + target.s = saturation; + target.l = lightness; + return target; + } + getRGB(target, colorSpace = LinearSRGBColorSpace) { + ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace); + target.r = _rgb.r; + target.g = _rgb.g; + target.b = _rgb.b; + return target; + } + getStyle(colorSpace = SRGBColorSpace) { + ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace); + if (colorSpace !== SRGBColorSpace) { + return `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`; + } + return `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`; + } + offsetHSL(h, s, l) { + this.getHSL(_hslA); + _hslA.h += h; + _hslA.s += s; + _hslA.l += l; + this.setHSL(_hslA.h, _hslA.s, _hslA.l); + return this; + } + add(color) { + this.r += color.r; + this.g += color.g; + this.b += color.b; + return this; + } + addColors(color1, color2) { + this.r = color1.r + color2.r; + this.g = color1.g + color2.g; + this.b = color1.b + color2.b; + return this; + } + addScalar(s) { + this.r += s; + this.g += s; + this.b += s; + return this; + } + sub(color) { + this.r = Math.max(0, this.r - color.r); + this.g = Math.max(0, this.g - color.g); + this.b = Math.max(0, this.b - color.b); + return this; + } + multiply(color) { + this.r *= color.r; + this.g *= color.g; + this.b *= color.b; + return this; + } + multiplyScalar(s) { + this.r *= s; + this.g *= s; + this.b *= s; + return this; + } + lerp(color, alpha) { + this.r += (color.r - this.r) * alpha; + this.g += (color.g - this.g) * alpha; + this.b += (color.b - this.b) * alpha; + return this; + } + lerpColors(color1, color2, alpha) { + this.r = color1.r + (color2.r - color1.r) * alpha; + this.g = color1.g + (color2.g - color1.g) * alpha; + this.b = color1.b + (color2.b - color1.b) * alpha; + return this; + } + lerpHSL(color, alpha) { + this.getHSL(_hslA); + color.getHSL(_hslB); + const h = lerp(_hslA.h, _hslB.h, alpha); + const s = lerp(_hslA.s, _hslB.s, alpha); + const l = lerp(_hslA.l, _hslB.l, alpha); + this.setHSL(h, s, l); + return this; + } + equals(c2) { + return c2.r === this.r && c2.g === this.g && c2.b === this.b; + } + fromArray(array, offset = 0) { + this.r = array[offset]; + this.g = array[offset + 1]; + this.b = array[offset + 2]; + return this; + } + toArray(array = [], offset = 0) { + array[offset] = this.r; + array[offset + 1] = this.g; + array[offset + 2] = this.b; + return array; + } + fromBufferAttribute(attribute, index5) { + this.r = attribute.getX(index5); + this.g = attribute.getY(index5); + this.b = attribute.getZ(index5); + if (attribute.normalized === true) { + this.r /= 255; + this.g /= 255; + this.b /= 255; + } + return this; + } + toJSON() { + return this.getHex(); + } + *[Symbol.iterator]() { + yield this.r; + yield this.g; + yield this.b; + } +}; +Color.NAMES = _colorKeywords; +var _canvas; +var ImageUtils = class { + static getDataURL(image) { + if (/^data:/i.test(image.src)) { + return image.src; + } + if (typeof HTMLCanvasElement == "undefined") { + return image.src; + } + let canvas; + if (image instanceof HTMLCanvasElement) { + canvas = image; + } else { + if (_canvas === void 0) + _canvas = createElementNS("canvas"); + _canvas.width = image.width; + _canvas.height = image.height; + const context = _canvas.getContext("2d"); + if (image instanceof ImageData) { + context.putImageData(image, 0, 0); + } else { + context.drawImage(image, 0, 0, image.width, image.height); + } + canvas = _canvas; + } + if (canvas.width > 2048 || canvas.height > 2048) { + console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", image); + return canvas.toDataURL("image/jpeg", 0.6); + } else { + return canvas.toDataURL("image/png"); + } + } + static sRGBToLinear(image) { + if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) { + const canvas = createElementNS("canvas"); + canvas.width = image.width; + canvas.height = image.height; + const context = canvas.getContext("2d"); + context.drawImage(image, 0, 0, image.width, image.height); + const imageData = context.getImageData(0, 0, image.width, image.height); + const data = imageData.data; + for (let i = 0; i < data.length; i++) { + data[i] = SRGBToLinear(data[i] / 255) * 255; + } + context.putImageData(imageData, 0, 0); + return canvas; + } else if (image.data) { + const data = image.data.slice(0); + for (let i = 0; i < data.length; i++) { + if (data instanceof Uint8Array || data instanceof Uint8ClampedArray) { + data[i] = Math.floor(SRGBToLinear(data[i] / 255) * 255); + } else { + data[i] = SRGBToLinear(data[i]); + } + } + return { + data, + width: image.width, + height: image.height + }; + } else { + console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."); + return image; + } + } +}; +var Source = class { + constructor(data = null) { + this.isSource = true; + this.uuid = generateUUID(); + this.data = data; + this.version = 0; + } + set needsUpdate(value) { + if (value === true) + this.version++; + } + toJSON(meta) { + const isRootObject = meta === void 0 || typeof meta === "string"; + if (!isRootObject && meta.images[this.uuid] !== void 0) { + return meta.images[this.uuid]; + } + const output = { + uuid: this.uuid, + url: "" + }; + const data = this.data; + if (data !== null) { + let url; + if (Array.isArray(data)) { + url = []; + for (let i = 0, l = data.length; i < l; i++) { + if (data[i].isDataTexture) { + url.push(serializeImage(data[i].image)); + } else { + url.push(serializeImage(data[i])); + } + } + } else { + url = serializeImage(data); + } + output.url = url; + } + if (!isRootObject) { + meta.images[this.uuid] = output; + } + return output; + } +}; +function serializeImage(image) { + if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) { + return ImageUtils.getDataURL(image); + } else { + if (image.data) { + return { + data: Array.from(image.data), + width: image.width, + height: image.height, + type: image.data.constructor.name + }; + } else { + console.warn("THREE.Texture: Unable to serialize Texture."); + return {}; + } + } +} +var textureId = 0; +var Texture = class extends EventDispatcher { + constructor(image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format2 = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding) { + super(); + this.isTexture = true; + Object.defineProperty(this, "id", { value: textureId++ }); + this.uuid = generateUUID(); + this.name = ""; + this.source = new Source(image); + this.mipmaps = []; + this.mapping = mapping; + this.wrapS = wrapS; + this.wrapT = wrapT; + this.magFilter = magFilter; + this.minFilter = minFilter; + this.anisotropy = anisotropy; + this.format = format2; + this.internalFormat = null; + this.type = type; + this.offset = new Vector2(0, 0); + this.repeat = new Vector2(1, 1); + this.center = new Vector2(0, 0); + this.rotation = 0; + this.matrixAutoUpdate = true; + this.matrix = new Matrix3(); + this.generateMipmaps = true; + this.premultiplyAlpha = false; + this.flipY = true; + this.unpackAlignment = 4; + this.encoding = encoding; + this.userData = {}; + this.version = 0; + this.onUpdate = null; + this.isRenderTargetTexture = false; + this.needsPMREMUpdate = false; + } + get image() { + return this.source.data; + } + set image(value) { + this.source.data = value; + } + updateMatrix() { + this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y); + } + clone() { + return new this.constructor().copy(this); + } + copy(source) { + this.name = source.name; + this.source = source.source; + this.mipmaps = source.mipmaps.slice(0); + this.mapping = source.mapping; + this.wrapS = source.wrapS; + this.wrapT = source.wrapT; + this.magFilter = source.magFilter; + this.minFilter = source.minFilter; + this.anisotropy = source.anisotropy; + this.format = source.format; + this.internalFormat = source.internalFormat; + this.type = source.type; + this.offset.copy(source.offset); + this.repeat.copy(source.repeat); + this.center.copy(source.center); + this.rotation = source.rotation; + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrix.copy(source.matrix); + this.generateMipmaps = source.generateMipmaps; + this.premultiplyAlpha = source.premultiplyAlpha; + this.flipY = source.flipY; + this.unpackAlignment = source.unpackAlignment; + this.encoding = source.encoding; + this.userData = JSON.parse(JSON.stringify(source.userData)); + this.needsUpdate = true; + return this; + } + toJSON(meta) { + const isRootObject = meta === void 0 || typeof meta === "string"; + if (!isRootObject && meta.textures[this.uuid] !== void 0) { + return meta.textures[this.uuid]; + } + const output = { + metadata: { + version: 4.5, + type: "Texture", + generator: "Texture.toJSON" + }, + uuid: this.uuid, + name: this.name, + image: this.source.toJSON(meta).uuid, + mapping: this.mapping, + repeat: [this.repeat.x, this.repeat.y], + offset: [this.offset.x, this.offset.y], + center: [this.center.x, this.center.y], + rotation: this.rotation, + wrap: [this.wrapS, this.wrapT], + format: this.format, + type: this.type, + encoding: this.encoding, + minFilter: this.minFilter, + magFilter: this.magFilter, + anisotropy: this.anisotropy, + flipY: this.flipY, + premultiplyAlpha: this.premultiplyAlpha, + unpackAlignment: this.unpackAlignment + }; + if (JSON.stringify(this.userData) !== "{}") + output.userData = this.userData; + if (!isRootObject) { + meta.textures[this.uuid] = output; + } + return output; + } + dispose() { + this.dispatchEvent({ type: "dispose" }); + } + transformUv(uv) { + if (this.mapping !== UVMapping) + return uv; + uv.applyMatrix3(this.matrix); + if (uv.x < 0 || uv.x > 1) { + switch (this.wrapS) { + case RepeatWrapping: + uv.x = uv.x - Math.floor(uv.x); + break; + case ClampToEdgeWrapping: + uv.x = uv.x < 0 ? 0 : 1; + break; + case MirroredRepeatWrapping: + if (Math.abs(Math.floor(uv.x) % 2) === 1) { + uv.x = Math.ceil(uv.x) - uv.x; + } else { + uv.x = uv.x - Math.floor(uv.x); + } + break; + } + } + if (uv.y < 0 || uv.y > 1) { + switch (this.wrapT) { + case RepeatWrapping: + uv.y = uv.y - Math.floor(uv.y); + break; + case ClampToEdgeWrapping: + uv.y = uv.y < 0 ? 0 : 1; + break; + case MirroredRepeatWrapping: + if (Math.abs(Math.floor(uv.y) % 2) === 1) { + uv.y = Math.ceil(uv.y) - uv.y; + } else { + uv.y = uv.y - Math.floor(uv.y); + } + break; + } + } + if (this.flipY) { + uv.y = 1 - uv.y; + } + return uv; + } + set needsUpdate(value) { + if (value === true) { + this.version++; + this.source.needsUpdate = true; + } + } +}; +Texture.DEFAULT_IMAGE = null; +Texture.DEFAULT_MAPPING = UVMapping; +var Vector4 = class { + constructor(x2 = 0, y2 = 0, z2 = 0, w = 1) { + Vector4.prototype.isVector4 = true; + this.x = x2; + this.y = y2; + this.z = z2; + this.w = w; + } + get width() { + return this.z; + } + set width(value) { + this.z = value; + } + get height() { + return this.w; + } + set height(value) { + this.w = value; + } + set(x2, y2, z2, w) { + this.x = x2; + this.y = y2; + this.z = z2; + this.w = w; + return this; + } + setScalar(scalar) { + this.x = scalar; + this.y = scalar; + this.z = scalar; + this.w = scalar; + return this; + } + setX(x2) { + this.x = x2; + return this; + } + setY(y2) { + this.y = y2; + return this; + } + setZ(z2) { + this.z = z2; + return this; + } + setW(w) { + this.w = w; + return this; + } + setComponent(index5, value) { + switch (index5) { + case 0: + this.x = value; + break; + case 1: + this.y = value; + break; + case 2: + this.z = value; + break; + case 3: + this.w = value; + break; + default: + throw new Error("index is out of range: " + index5); + } + return this; + } + getComponent(index5) { + switch (index5) { + case 0: + return this.x; + case 1: + return this.y; + case 2: + return this.z; + case 3: + return this.w; + default: + throw new Error("index is out of range: " + index5); + } + } + clone() { + return new this.constructor(this.x, this.y, this.z, this.w); + } + copy(v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w !== void 0 ? v.w : 1; + return this; + } + add(v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; + return this; + } + addScalar(s) { + this.x += s; + this.y += s; + this.z += s; + this.w += s; + return this; + } + addVectors(a2, b) { + this.x = a2.x + b.x; + this.y = a2.y + b.y; + this.z = a2.z + b.z; + this.w = a2.w + b.w; + return this; + } + addScaledVector(v, s) { + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + this.w += v.w * s; + return this; + } + sub(v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; + return this; + } + subScalar(s) { + this.x -= s; + this.y -= s; + this.z -= s; + this.w -= s; + return this; + } + subVectors(a2, b) { + this.x = a2.x - b.x; + this.y = a2.y - b.y; + this.z = a2.z - b.z; + this.w = a2.w - b.w; + return this; + } + multiply(v) { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + this.w *= v.w; + return this; + } + multiplyScalar(scalar) { + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + this.w *= scalar; + return this; + } + applyMatrix4(m2) { + const x2 = this.x, y2 = this.y, z2 = this.z, w = this.w; + const e = m2.elements; + this.x = e[0] * x2 + e[4] * y2 + e[8] * z2 + e[12] * w; + this.y = e[1] * x2 + e[5] * y2 + e[9] * z2 + e[13] * w; + this.z = e[2] * x2 + e[6] * y2 + e[10] * z2 + e[14] * w; + this.w = e[3] * x2 + e[7] * y2 + e[11] * z2 + e[15] * w; + return this; + } + divideScalar(scalar) { + return this.multiplyScalar(1 / scalar); + } + setAxisAngleFromQuaternion(q) { + this.w = 2 * Math.acos(q.w); + const s = Math.sqrt(1 - q.w * q.w); + if (s < 1e-4) { + this.x = 1; + this.y = 0; + this.z = 0; + } else { + this.x = q.x / s; + this.y = q.y / s; + this.z = q.z / s; + } + return this; + } + setAxisAngleFromRotationMatrix(m2) { + let angle, x2, y2, z2; + const epsilon = 0.01, epsilon2 = 0.1, te = m2.elements, m11 = te[0], m12 = te[4], m13 = te[8], m21 = te[1], m22 = te[5], m23 = te[9], m31 = te[2], m32 = te[6], m33 = te[10]; + if (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) { + if (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) { + this.set(1, 0, 0, 0); + return this; + } + angle = Math.PI; + const xx = (m11 + 1) / 2; + const yy = (m22 + 1) / 2; + const zz = (m33 + 1) / 2; + const xy = (m12 + m21) / 4; + const xz = (m13 + m31) / 4; + const yz = (m23 + m32) / 4; + if (xx > yy && xx > zz) { + if (xx < epsilon) { + x2 = 0; + y2 = 0.707106781; + z2 = 0.707106781; + } else { + x2 = Math.sqrt(xx); + y2 = xy / x2; + z2 = xz / x2; + } + } else if (yy > zz) { + if (yy < epsilon) { + x2 = 0.707106781; + y2 = 0; + z2 = 0.707106781; + } else { + y2 = Math.sqrt(yy); + x2 = xy / y2; + z2 = yz / y2; + } + } else { + if (zz < epsilon) { + x2 = 0.707106781; + y2 = 0.707106781; + z2 = 0; + } else { + z2 = Math.sqrt(zz); + x2 = xz / z2; + y2 = yz / z2; + } + } + this.set(x2, y2, z2, angle); + return this; + } + let s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); + if (Math.abs(s) < 1e-3) + s = 1; + this.x = (m32 - m23) / s; + this.y = (m13 - m31) / s; + this.z = (m21 - m12) / s; + this.w = Math.acos((m11 + m22 + m33 - 1) / 2); + return this; + } + min(v) { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + this.w = Math.min(this.w, v.w); + return this; + } + max(v) { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + this.w = Math.max(this.w, v.w); + return this; + } + clamp(min2, max2) { + this.x = Math.max(min2.x, Math.min(max2.x, this.x)); + this.y = Math.max(min2.y, Math.min(max2.y, this.y)); + this.z = Math.max(min2.z, Math.min(max2.z, this.z)); + this.w = Math.max(min2.w, Math.min(max2.w, this.w)); + return this; + } + clampScalar(minVal, maxVal) { + this.x = Math.max(minVal, Math.min(maxVal, this.x)); + this.y = Math.max(minVal, Math.min(maxVal, this.y)); + this.z = Math.max(minVal, Math.min(maxVal, this.z)); + this.w = Math.max(minVal, Math.min(maxVal, this.w)); + return this; + } + clampLength(min2, max2) { + const length = this.length(); + return this.divideScalar(length || 1).multiplyScalar(Math.max(min2, Math.min(max2, length))); + } + floor() { + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + this.z = Math.floor(this.z); + this.w = Math.floor(this.w); + return this; + } + ceil() { + this.x = Math.ceil(this.x); + this.y = Math.ceil(this.y); + this.z = Math.ceil(this.z); + this.w = Math.ceil(this.w); + return this; + } + round() { + this.x = Math.round(this.x); + this.y = Math.round(this.y); + this.z = Math.round(this.z); + this.w = Math.round(this.w); + return this; + } + roundToZero() { + this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x); + this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y); + this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z); + this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w); + return this; + } + negate() { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + this.w = -this.w; + return this; + } + dot(v) { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + } + lengthSq() { + return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; + } + length() { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); + } + manhattanLength() { + return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w); + } + normalize() { + return this.divideScalar(this.length() || 1); + } + setLength(length) { + return this.normalize().multiplyScalar(length); + } + lerp(v, alpha) { + this.x += (v.x - this.x) * alpha; + this.y += (v.y - this.y) * alpha; + this.z += (v.z - this.z) * alpha; + this.w += (v.w - this.w) * alpha; + return this; + } + lerpVectors(v1, v2, alpha) { + this.x = v1.x + (v2.x - v1.x) * alpha; + this.y = v1.y + (v2.y - v1.y) * alpha; + this.z = v1.z + (v2.z - v1.z) * alpha; + this.w = v1.w + (v2.w - v1.w) * alpha; + return this; + } + equals(v) { + return v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w; + } + fromArray(array, offset = 0) { + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + this.w = array[offset + 3]; + return this; + } + toArray(array = [], offset = 0) { + array[offset] = this.x; + array[offset + 1] = this.y; + array[offset + 2] = this.z; + array[offset + 3] = this.w; + return array; + } + fromBufferAttribute(attribute, index5) { + this.x = attribute.getX(index5); + this.y = attribute.getY(index5); + this.z = attribute.getZ(index5); + this.w = attribute.getW(index5); + return this; + } + random() { + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); + this.w = Math.random(); + return this; + } + *[Symbol.iterator]() { + yield this.x; + yield this.y; + yield this.z; + yield this.w; + } +}; +var WebGLRenderTarget = class extends EventDispatcher { + constructor(width, height, options = {}) { + super(); + this.isWebGLRenderTarget = true; + this.width = width; + this.height = height; + this.depth = 1; + this.scissor = new Vector4(0, 0, width, height); + this.scissorTest = false; + this.viewport = new Vector4(0, 0, width, height); + const image = { width, height, depth: 1 }; + this.texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding); + this.texture.isRenderTargetTexture = true; + this.texture.flipY = false; + this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false; + this.texture.internalFormat = options.internalFormat !== void 0 ? options.internalFormat : null; + this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter; + this.depthBuffer = options.depthBuffer !== void 0 ? options.depthBuffer : true; + this.stencilBuffer = options.stencilBuffer !== void 0 ? options.stencilBuffer : false; + this.depthTexture = options.depthTexture !== void 0 ? options.depthTexture : null; + this.samples = options.samples !== void 0 ? options.samples : 0; + } + setSize(width, height, depth = 1) { + if (this.width !== width || this.height !== height || this.depth !== depth) { + this.width = width; + this.height = height; + this.depth = depth; + this.texture.image.width = width; + this.texture.image.height = height; + this.texture.image.depth = depth; + this.dispose(); + } + this.viewport.set(0, 0, width, height); + this.scissor.set(0, 0, width, height); + } + clone() { + return new this.constructor().copy(this); + } + copy(source) { + this.width = source.width; + this.height = source.height; + this.depth = source.depth; + this.viewport.copy(source.viewport); + this.texture = source.texture.clone(); + this.texture.isRenderTargetTexture = true; + const image = Object.assign({}, source.texture.image); + this.texture.source = new Source(image); + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; + if (source.depthTexture !== null) + this.depthTexture = source.depthTexture.clone(); + this.samples = source.samples; + return this; + } + dispose() { + this.dispatchEvent({ type: "dispose" }); + } +}; +var DataArrayTexture = class extends Texture { + constructor(data = null, width = 1, height = 1, depth = 1) { + super(null); + this.isDataArrayTexture = true; + this.image = { data, width, height, depth }; + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; + this.wrapR = ClampToEdgeWrapping; + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + } +}; +var Data3DTexture = class extends Texture { + constructor(data = null, width = 1, height = 1, depth = 1) { + super(null); + this.isData3DTexture = true; + this.image = { data, width, height, depth }; + this.magFilter = NearestFilter; + this.minFilter = NearestFilter; + this.wrapR = ClampToEdgeWrapping; + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + } +}; +var Quaternion = class { + constructor(x2 = 0, y2 = 0, z2 = 0, w = 1) { + this.isQuaternion = true; + this._x = x2; + this._y = y2; + this._z = z2; + this._w = w; + } + static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) { + let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3]; + const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3]; + if (t === 0) { + dst[dstOffset + 0] = x0; + dst[dstOffset + 1] = y0; + dst[dstOffset + 2] = z0; + dst[dstOffset + 3] = w0; + return; + } + if (t === 1) { + dst[dstOffset + 0] = x1; + dst[dstOffset + 1] = y1; + dst[dstOffset + 2] = z1; + dst[dstOffset + 3] = w1; + return; + } + if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) { + let s = 1 - t; + const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos >= 0 ? 1 : -1, sqrSin = 1 - cos * cos; + if (sqrSin > Number.EPSILON) { + const sin = Math.sqrt(sqrSin), len = Math.atan2(sin, cos * dir); + s = Math.sin(s * len) / sin; + t = Math.sin(t * len) / sin; + } + const tDir = t * dir; + x0 = x0 * s + x1 * tDir; + y0 = y0 * s + y1 * tDir; + z0 = z0 * s + z1 * tDir; + w0 = w0 * s + w1 * tDir; + if (s === 1 - t) { + const f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0); + x0 *= f; + y0 *= f; + z0 *= f; + w0 *= f; + } + } + dst[dstOffset] = x0; + dst[dstOffset + 1] = y0; + dst[dstOffset + 2] = z0; + dst[dstOffset + 3] = w0; + } + static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) { + const x0 = src0[srcOffset0]; + const y0 = src0[srcOffset0 + 1]; + const z0 = src0[srcOffset0 + 2]; + const w0 = src0[srcOffset0 + 3]; + const x1 = src1[srcOffset1]; + const y1 = src1[srcOffset1 + 1]; + const z1 = src1[srcOffset1 + 2]; + const w1 = src1[srcOffset1 + 3]; + dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; + dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; + dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; + dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; + return dst; + } + get x() { + return this._x; + } + set x(value) { + this._x = value; + this._onChangeCallback(); + } + get y() { + return this._y; + } + set y(value) { + this._y = value; + this._onChangeCallback(); + } + get z() { + return this._z; + } + set z(value) { + this._z = value; + this._onChangeCallback(); + } + get w() { + return this._w; + } + set w(value) { + this._w = value; + this._onChangeCallback(); + } + set(x2, y2, z2, w) { + this._x = x2; + this._y = y2; + this._z = z2; + this._w = w; + this._onChangeCallback(); + return this; + } + clone() { + return new this.constructor(this._x, this._y, this._z, this._w); + } + copy(quaternion) { + this._x = quaternion.x; + this._y = quaternion.y; + this._z = quaternion.z; + this._w = quaternion.w; + this._onChangeCallback(); + return this; + } + setFromEuler(euler, update4) { + if (!(euler && euler.isEuler)) { + throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order."); + } + const x2 = euler._x, y2 = euler._y, z2 = euler._z, order = euler._order; + const cos = Math.cos; + const sin = Math.sin; + const c1 = cos(x2 / 2); + const c2 = cos(y2 / 2); + const c3 = cos(z2 / 2); + const s1 = sin(x2 / 2); + const s2 = sin(y2 / 2); + const s3 = sin(z2 / 2); + switch (order) { + case "XYZ": + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; + case "YXZ": + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; + case "ZXY": + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; + case "ZYX": + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; + case "YZX": + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; + case "XZY": + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; + default: + console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order); + } + if (update4 !== false) + this._onChangeCallback(); + return this; + } + setFromAxisAngle(axis, angle) { + const halfAngle = angle / 2, s = Math.sin(halfAngle); + this._x = axis.x * s; + this._y = axis.y * s; + this._z = axis.z * s; + this._w = Math.cos(halfAngle); + this._onChangeCallback(); + return this; + } + setFromRotationMatrix(m2) { + const te = m2.elements, m11 = te[0], m12 = te[4], m13 = te[8], m21 = te[1], m22 = te[5], m23 = te[9], m31 = te[2], m32 = te[6], m33 = te[10], trace = m11 + m22 + m33; + if (trace > 0) { + const s = 0.5 / Math.sqrt(trace + 1); + this._w = 0.25 / s; + this._x = (m32 - m23) * s; + this._y = (m13 - m31) * s; + this._z = (m21 - m12) * s; + } else if (m11 > m22 && m11 > m33) { + const s = 2 * Math.sqrt(1 + m11 - m22 - m33); + this._w = (m32 - m23) / s; + this._x = 0.25 * s; + this._y = (m12 + m21) / s; + this._z = (m13 + m31) / s; + } else if (m22 > m33) { + const s = 2 * Math.sqrt(1 + m22 - m11 - m33); + this._w = (m13 - m31) / s; + this._x = (m12 + m21) / s; + this._y = 0.25 * s; + this._z = (m23 + m32) / s; + } else { + const s = 2 * Math.sqrt(1 + m33 - m11 - m22); + this._w = (m21 - m12) / s; + this._x = (m13 + m31) / s; + this._y = (m23 + m32) / s; + this._z = 0.25 * s; + } + this._onChangeCallback(); + return this; + } + setFromUnitVectors(vFrom, vTo) { + let r = vFrom.dot(vTo) + 1; + if (r < Number.EPSILON) { + r = 0; + if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) { + this._x = -vFrom.y; + this._y = vFrom.x; + this._z = 0; + this._w = r; + } else { + this._x = 0; + this._y = -vFrom.z; + this._z = vFrom.y; + this._w = r; + } + } else { + this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; + this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; + this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; + this._w = r; + } + return this.normalize(); + } + angleTo(q) { + return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1))); + } + rotateTowards(q, step) { + const angle = this.angleTo(q); + if (angle === 0) + return this; + const t = Math.min(1, step / angle); + this.slerp(q, t); + return this; + } + identity() { + return this.set(0, 0, 0, 1); + } + invert() { + return this.conjugate(); + } + conjugate() { + this._x *= -1; + this._y *= -1; + this._z *= -1; + this._onChangeCallback(); + return this; + } + dot(v) { + return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; + } + lengthSq() { + return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; + } + length() { + return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w); + } + normalize() { + let l = this.length(); + if (l === 0) { + this._x = 0; + this._y = 0; + this._z = 0; + this._w = 1; + } else { + l = 1 / l; + this._x = this._x * l; + this._y = this._y * l; + this._z = this._z * l; + this._w = this._w * l; + } + this._onChangeCallback(); + return this; + } + multiply(q) { + return this.multiplyQuaternions(this, q); + } + premultiply(q) { + return this.multiplyQuaternions(q, this); + } + multiplyQuaternions(a2, b) { + const qax = a2._x, qay = a2._y, qaz = a2._z, qaw = a2._w; + const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; + this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; + this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; + this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; + this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; + this._onChangeCallback(); + return this; + } + slerp(qb, t) { + if (t === 0) + return this; + if (t === 1) + return this.copy(qb); + const x2 = this._x, y2 = this._y, z2 = this._z, w = this._w; + let cosHalfTheta = w * qb._w + x2 * qb._x + y2 * qb._y + z2 * qb._z; + if (cosHalfTheta < 0) { + this._w = -qb._w; + this._x = -qb._x; + this._y = -qb._y; + this._z = -qb._z; + cosHalfTheta = -cosHalfTheta; + } else { + this.copy(qb); + } + if (cosHalfTheta >= 1) { + this._w = w; + this._x = x2; + this._y = y2; + this._z = z2; + return this; + } + const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta; + if (sqrSinHalfTheta <= Number.EPSILON) { + const s = 1 - t; + this._w = s * w + t * this._w; + this._x = s * x2 + t * this._x; + this._y = s * y2 + t * this._y; + this._z = s * z2 + t * this._z; + this.normalize(); + this._onChangeCallback(); + return this; + } + const sinHalfTheta = Math.sqrt(sqrSinHalfTheta); + const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta); + const ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t * halfTheta) / sinHalfTheta; + this._w = w * ratioA + this._w * ratioB; + this._x = x2 * ratioA + this._x * ratioB; + this._y = y2 * ratioA + this._y * ratioB; + this._z = z2 * ratioA + this._z * ratioB; + this._onChangeCallback(); + return this; + } + slerpQuaternions(qa, qb, t) { + return this.copy(qa).slerp(qb, t); + } + random() { + const u1 = Math.random(); + const sqrt1u1 = Math.sqrt(1 - u1); + const sqrtu1 = Math.sqrt(u1); + const u2 = 2 * Math.PI * Math.random(); + const u3 = 2 * Math.PI * Math.random(); + return this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2)); + } + equals(quaternion) { + return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w; + } + fromArray(array, offset = 0) { + this._x = array[offset]; + this._y = array[offset + 1]; + this._z = array[offset + 2]; + this._w = array[offset + 3]; + this._onChangeCallback(); + return this; + } + toArray(array = [], offset = 0) { + array[offset] = this._x; + array[offset + 1] = this._y; + array[offset + 2] = this._z; + array[offset + 3] = this._w; + return array; + } + fromBufferAttribute(attribute, index5) { + this._x = attribute.getX(index5); + this._y = attribute.getY(index5); + this._z = attribute.getZ(index5); + this._w = attribute.getW(index5); + return this; + } + _onChange(callback) { + this._onChangeCallback = callback; + return this; + } + _onChangeCallback() { + } + *[Symbol.iterator]() { + yield this._x; + yield this._y; + yield this._z; + yield this._w; + } +}; +var Vector3 = class { + constructor(x2 = 0, y2 = 0, z2 = 0) { + Vector3.prototype.isVector3 = true; + this.x = x2; + this.y = y2; + this.z = z2; + } + set(x2, y2, z2) { + if (z2 === void 0) + z2 = this.z; + this.x = x2; + this.y = y2; + this.z = z2; + return this; + } + setScalar(scalar) { + this.x = scalar; + this.y = scalar; + this.z = scalar; + return this; + } + setX(x2) { + this.x = x2; + return this; + } + setY(y2) { + this.y = y2; + return this; + } + setZ(z2) { + this.z = z2; + return this; + } + setComponent(index5, value) { + switch (index5) { + case 0: + this.x = value; + break; + case 1: + this.y = value; + break; + case 2: + this.z = value; + break; + default: + throw new Error("index is out of range: " + index5); + } + return this; + } + getComponent(index5) { + switch (index5) { + case 0: + return this.x; + case 1: + return this.y; + case 2: + return this.z; + default: + throw new Error("index is out of range: " + index5); + } + } + clone() { + return new this.constructor(this.x, this.y, this.z); + } + copy(v) { + this.x = v.x; + this.y = v.y; + this.z = v.z; + return this; + } + add(v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + } + addScalar(s) { + this.x += s; + this.y += s; + this.z += s; + return this; + } + addVectors(a2, b) { + this.x = a2.x + b.x; + this.y = a2.y + b.y; + this.z = a2.z + b.z; + return this; + } + addScaledVector(v, s) { + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + return this; + } + sub(v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + } + subScalar(s) { + this.x -= s; + this.y -= s; + this.z -= s; + return this; + } + subVectors(a2, b) { + this.x = a2.x - b.x; + this.y = a2.y - b.y; + this.z = a2.z - b.z; + return this; + } + multiply(v) { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + return this; + } + multiplyScalar(scalar) { + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + return this; + } + multiplyVectors(a2, b) { + this.x = a2.x * b.x; + this.y = a2.y * b.y; + this.z = a2.z * b.z; + return this; + } + applyEuler(euler) { + return this.applyQuaternion(_quaternion$4.setFromEuler(euler)); + } + applyAxisAngle(axis, angle) { + return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle)); + } + applyMatrix3(m2) { + const x2 = this.x, y2 = this.y, z2 = this.z; + const e = m2.elements; + this.x = e[0] * x2 + e[3] * y2 + e[6] * z2; + this.y = e[1] * x2 + e[4] * y2 + e[7] * z2; + this.z = e[2] * x2 + e[5] * y2 + e[8] * z2; + return this; + } + applyNormalMatrix(m2) { + return this.applyMatrix3(m2).normalize(); + } + applyMatrix4(m2) { + const x2 = this.x, y2 = this.y, z2 = this.z; + const e = m2.elements; + const w = 1 / (e[3] * x2 + e[7] * y2 + e[11] * z2 + e[15]); + this.x = (e[0] * x2 + e[4] * y2 + e[8] * z2 + e[12]) * w; + this.y = (e[1] * x2 + e[5] * y2 + e[9] * z2 + e[13]) * w; + this.z = (e[2] * x2 + e[6] * y2 + e[10] * z2 + e[14]) * w; + return this; + } + applyQuaternion(q) { + const x2 = this.x, y2 = this.y, z2 = this.z; + const qx = q.x, qy = q.y, qz = q.z, qw = q.w; + const ix = qw * x2 + qy * z2 - qz * y2; + const iy = qw * y2 + qz * x2 - qx * z2; + const iz = qw * z2 + qx * y2 - qy * x2; + const iw = -qx * x2 - qy * y2 - qz * z2; + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + return this; + } + project(camera3) { + return this.applyMatrix4(camera3.matrixWorldInverse).applyMatrix4(camera3.projectionMatrix); + } + unproject(camera3) { + return this.applyMatrix4(camera3.projectionMatrixInverse).applyMatrix4(camera3.matrixWorld); + } + transformDirection(m2) { + const x2 = this.x, y2 = this.y, z2 = this.z; + const e = m2.elements; + this.x = e[0] * x2 + e[4] * y2 + e[8] * z2; + this.y = e[1] * x2 + e[5] * y2 + e[9] * z2; + this.z = e[2] * x2 + e[6] * y2 + e[10] * z2; + return this.normalize(); + } + divide(v) { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z; + return this; + } + divideScalar(scalar) { + return this.multiplyScalar(1 / scalar); + } + min(v) { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + return this; + } + max(v) { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + return this; + } + clamp(min2, max2) { + this.x = Math.max(min2.x, Math.min(max2.x, this.x)); + this.y = Math.max(min2.y, Math.min(max2.y, this.y)); + this.z = Math.max(min2.z, Math.min(max2.z, this.z)); + return this; + } + clampScalar(minVal, maxVal) { + this.x = Math.max(minVal, Math.min(maxVal, this.x)); + this.y = Math.max(minVal, Math.min(maxVal, this.y)); + this.z = Math.max(minVal, Math.min(maxVal, this.z)); + return this; + } + clampLength(min2, max2) { + const length = this.length(); + return this.divideScalar(length || 1).multiplyScalar(Math.max(min2, Math.min(max2, length))); + } + floor() { + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + this.z = Math.floor(this.z); + return this; + } + ceil() { + this.x = Math.ceil(this.x); + this.y = Math.ceil(this.y); + this.z = Math.ceil(this.z); + return this; + } + round() { + this.x = Math.round(this.x); + this.y = Math.round(this.y); + this.z = Math.round(this.z); + return this; + } + roundToZero() { + this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x); + this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y); + this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z); + return this; + } + negate() { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + return this; + } + dot(v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + } + lengthSq() { + return this.x * this.x + this.y * this.y + this.z * this.z; + } + length() { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + } + manhattanLength() { + return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z); + } + normalize() { + return this.divideScalar(this.length() || 1); + } + setLength(length) { + return this.normalize().multiplyScalar(length); + } + lerp(v, alpha) { + this.x += (v.x - this.x) * alpha; + this.y += (v.y - this.y) * alpha; + this.z += (v.z - this.z) * alpha; + return this; + } + lerpVectors(v1, v2, alpha) { + this.x = v1.x + (v2.x - v1.x) * alpha; + this.y = v1.y + (v2.y - v1.y) * alpha; + this.z = v1.z + (v2.z - v1.z) * alpha; + return this; + } + cross(v) { + return this.crossVectors(this, v); + } + crossVectors(a2, b) { + const ax = a2.x, ay = a2.y, az = a2.z; + const bx = b.x, by = b.y, bz = b.z; + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + return this; + } + projectOnVector(v) { + const denominator = v.lengthSq(); + if (denominator === 0) + return this.set(0, 0, 0); + const scalar = v.dot(this) / denominator; + return this.copy(v).multiplyScalar(scalar); + } + projectOnPlane(planeNormal) { + _vector$c.copy(this).projectOnVector(planeNormal); + return this.sub(_vector$c); + } + reflect(normal) { + return this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal))); + } + angleTo(v) { + const denominator = Math.sqrt(this.lengthSq() * v.lengthSq()); + if (denominator === 0) + return Math.PI / 2; + const theta = this.dot(v) / denominator; + return Math.acos(clamp(theta, -1, 1)); + } + distanceTo(v) { + return Math.sqrt(this.distanceToSquared(v)); + } + distanceToSquared(v) { + const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; + return dx * dx + dy * dy + dz * dz; + } + manhattanDistanceTo(v) { + return Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z); + } + setFromSpherical(s) { + return this.setFromSphericalCoords(s.radius, s.phi, s.theta); + } + setFromSphericalCoords(radius, phi, theta) { + const sinPhiRadius = Math.sin(phi) * radius; + this.x = sinPhiRadius * Math.sin(theta); + this.y = Math.cos(phi) * radius; + this.z = sinPhiRadius * Math.cos(theta); + return this; + } + setFromCylindrical(c2) { + return this.setFromCylindricalCoords(c2.radius, c2.theta, c2.y); + } + setFromCylindricalCoords(radius, theta, y2) { + this.x = radius * Math.sin(theta); + this.y = y2; + this.z = radius * Math.cos(theta); + return this; + } + setFromMatrixPosition(m2) { + const e = m2.elements; + this.x = e[12]; + this.y = e[13]; + this.z = e[14]; + return this; + } + setFromMatrixScale(m2) { + const sx = this.setFromMatrixColumn(m2, 0).length(); + const sy = this.setFromMatrixColumn(m2, 1).length(); + const sz = this.setFromMatrixColumn(m2, 2).length(); + this.x = sx; + this.y = sy; + this.z = sz; + return this; + } + setFromMatrixColumn(m2, index5) { + return this.fromArray(m2.elements, index5 * 4); + } + setFromMatrix3Column(m2, index5) { + return this.fromArray(m2.elements, index5 * 3); + } + setFromEuler(e) { + this.x = e._x; + this.y = e._y; + this.z = e._z; + return this; + } + equals(v) { + return v.x === this.x && v.y === this.y && v.z === this.z; + } + fromArray(array, offset = 0) { + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + return this; + } + toArray(array = [], offset = 0) { + array[offset] = this.x; + array[offset + 1] = this.y; + array[offset + 2] = this.z; + return array; + } + fromBufferAttribute(attribute, index5) { + this.x = attribute.getX(index5); + this.y = attribute.getY(index5); + this.z = attribute.getZ(index5); + return this; + } + random() { + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); + return this; + } + randomDirection() { + const u = (Math.random() - 0.5) * 2; + const t = Math.random() * Math.PI * 2; + const f = Math.sqrt(1 - u ** 2); + this.x = f * Math.cos(t); + this.y = f * Math.sin(t); + this.z = u; + return this; + } + *[Symbol.iterator]() { + yield this.x; + yield this.y; + yield this.z; + } +}; +var _vector$c = /* @__PURE__ */ new Vector3(); +var _quaternion$4 = /* @__PURE__ */ new Quaternion(); +var Box3 = class { + constructor(min2 = new Vector3(Infinity, Infinity, Infinity), max2 = new Vector3(-Infinity, -Infinity, -Infinity)) { + this.isBox3 = true; + this.min = min2; + this.max = max2; + } + set(min2, max2) { + this.min.copy(min2); + this.max.copy(max2); + return this; + } + setFromArray(array) { + let minX = Infinity; + let minY = Infinity; + let minZ = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + let maxZ = -Infinity; + for (let i = 0, l = array.length; i < l; i += 3) { + const x2 = array[i]; + const y2 = array[i + 1]; + const z2 = array[i + 2]; + if (x2 < minX) + minX = x2; + if (y2 < minY) + minY = y2; + if (z2 < minZ) + minZ = z2; + if (x2 > maxX) + maxX = x2; + if (y2 > maxY) + maxY = y2; + if (z2 > maxZ) + maxZ = z2; + } + this.min.set(minX, minY, minZ); + this.max.set(maxX, maxY, maxZ); + return this; + } + setFromBufferAttribute(attribute) { + let minX = Infinity; + let minY = Infinity; + let minZ = Infinity; + let maxX = -Infinity; + let maxY = -Infinity; + let maxZ = -Infinity; + for (let i = 0, l = attribute.count; i < l; i++) { + const x2 = attribute.getX(i); + const y2 = attribute.getY(i); + const z2 = attribute.getZ(i); + if (x2 < minX) + minX = x2; + if (y2 < minY) + minY = y2; + if (z2 < minZ) + minZ = z2; + if (x2 > maxX) + maxX = x2; + if (y2 > maxY) + maxY = y2; + if (z2 > maxZ) + maxZ = z2; + } + this.min.set(minX, minY, minZ); + this.max.set(maxX, maxY, maxZ); + return this; + } + setFromPoints(points) { + this.makeEmpty(); + for (let i = 0, il = points.length; i < il; i++) { + this.expandByPoint(points[i]); + } + return this; + } + setFromCenterAndSize(center, size) { + const halfSize = _vector$b.copy(size).multiplyScalar(0.5); + this.min.copy(center).sub(halfSize); + this.max.copy(center).add(halfSize); + return this; + } + setFromObject(object, precise = false) { + this.makeEmpty(); + return this.expandByObject(object, precise); + } + clone() { + return new this.constructor().copy(this); + } + copy(box) { + this.min.copy(box.min); + this.max.copy(box.max); + return this; + } + makeEmpty() { + this.min.x = this.min.y = this.min.z = Infinity; + this.max.x = this.max.y = this.max.z = -Infinity; + return this; + } + isEmpty() { + return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z; + } + getCenter(target) { + return this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5); + } + getSize(target) { + return this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min); + } + expandByPoint(point) { + this.min.min(point); + this.max.max(point); + return this; + } + expandByVector(vector) { + this.min.sub(vector); + this.max.add(vector); + return this; + } + expandByScalar(scalar) { + this.min.addScalar(-scalar); + this.max.addScalar(scalar); + return this; + } + expandByObject(object, precise = false) { + object.updateWorldMatrix(false, false); + const geometry = object.geometry; + if (geometry !== void 0) { + if (precise && geometry.attributes != void 0 && geometry.attributes.position !== void 0) { + const position = geometry.attributes.position; + for (let i = 0, l = position.count; i < l; i++) { + _vector$b.fromBufferAttribute(position, i).applyMatrix4(object.matrixWorld); + this.expandByPoint(_vector$b); + } + } else { + if (geometry.boundingBox === null) { + geometry.computeBoundingBox(); + } + _box$3.copy(geometry.boundingBox); + _box$3.applyMatrix4(object.matrixWorld); + this.union(_box$3); + } + } + const children = object.children; + for (let i = 0, l = children.length; i < l; i++) { + this.expandByObject(children[i], precise); + } + return this; + } + containsPoint(point) { + return point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true; + } + containsBox(box) { + return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z; + } + getParameter(point, target) { + return target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z)); + } + intersectsBox(box) { + return box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true; + } + intersectsSphere(sphere) { + this.clampPoint(sphere.center, _vector$b); + return _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius; + } + intersectsPlane(plane) { + let min2, max2; + if (plane.normal.x > 0) { + min2 = plane.normal.x * this.min.x; + max2 = plane.normal.x * this.max.x; + } else { + min2 = plane.normal.x * this.max.x; + max2 = plane.normal.x * this.min.x; + } + if (plane.normal.y > 0) { + min2 += plane.normal.y * this.min.y; + max2 += plane.normal.y * this.max.y; + } else { + min2 += plane.normal.y * this.max.y; + max2 += plane.normal.y * this.min.y; + } + if (plane.normal.z > 0) { + min2 += plane.normal.z * this.min.z; + max2 += plane.normal.z * this.max.z; + } else { + min2 += plane.normal.z * this.max.z; + max2 += plane.normal.z * this.min.z; + } + return min2 <= -plane.constant && max2 >= -plane.constant; + } + intersectsTriangle(triangle) { + if (this.isEmpty()) { + return false; + } + this.getCenter(_center); + _extents.subVectors(this.max, _center); + _v0$2.subVectors(triangle.a, _center); + _v1$7.subVectors(triangle.b, _center); + _v2$3.subVectors(triangle.c, _center); + _f0.subVectors(_v1$7, _v0$2); + _f1.subVectors(_v2$3, _v1$7); + _f2.subVectors(_v0$2, _v2$3); + let axes = [ + 0, + -_f0.z, + _f0.y, + 0, + -_f1.z, + _f1.y, + 0, + -_f2.z, + _f2.y, + _f0.z, + 0, + -_f0.x, + _f1.z, + 0, + -_f1.x, + _f2.z, + 0, + -_f2.x, + -_f0.y, + _f0.x, + 0, + -_f1.y, + _f1.x, + 0, + -_f2.y, + _f2.x, + 0 + ]; + if (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) { + return false; + } + axes = [1, 0, 0, 0, 1, 0, 0, 0, 1]; + if (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) { + return false; + } + _triangleNormal.crossVectors(_f0, _f1); + axes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z]; + return satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents); + } + clampPoint(point, target) { + return target.copy(point).clamp(this.min, this.max); + } + distanceToPoint(point) { + const clampedPoint = _vector$b.copy(point).clamp(this.min, this.max); + return clampedPoint.sub(point).length(); + } + getBoundingSphere(target) { + this.getCenter(target.center); + target.radius = this.getSize(_vector$b).length() * 0.5; + return target; + } + intersect(box) { + this.min.max(box.min); + this.max.min(box.max); + if (this.isEmpty()) + this.makeEmpty(); + return this; + } + union(box) { + this.min.min(box.min); + this.max.max(box.max); + return this; + } + applyMatrix4(matrix) { + if (this.isEmpty()) + return this; + _points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); + _points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); + _points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); + _points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); + _points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); + _points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); + _points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); + _points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); + this.setFromPoints(_points); + return this; + } + translate(offset) { + this.min.add(offset); + this.max.add(offset); + return this; + } + equals(box) { + return box.min.equals(this.min) && box.max.equals(this.max); + } +}; +var _points = [ + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3(), + /* @__PURE__ */ new Vector3() +]; +var _vector$b = /* @__PURE__ */ new Vector3(); +var _box$3 = /* @__PURE__ */ new Box3(); +var _v0$2 = /* @__PURE__ */ new Vector3(); +var _v1$7 = /* @__PURE__ */ new Vector3(); +var _v2$3 = /* @__PURE__ */ new Vector3(); +var _f0 = /* @__PURE__ */ new Vector3(); +var _f1 = /* @__PURE__ */ new Vector3(); +var _f2 = /* @__PURE__ */ new Vector3(); +var _center = /* @__PURE__ */ new Vector3(); +var _extents = /* @__PURE__ */ new Vector3(); +var _triangleNormal = /* @__PURE__ */ new Vector3(); +var _testAxis = /* @__PURE__ */ new Vector3(); +function satForAxes(axes, v0, v1, v2, extents) { + for (let i = 0, j = axes.length - 3; i <= j; i += 3) { + _testAxis.fromArray(axes, i); + const r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); + const p0 = v0.dot(_testAxis); + const p1 = v1.dot(_testAxis); + const p2 = v2.dot(_testAxis); + if (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) { + return false; + } + } + return true; +} +var _box$2 = /* @__PURE__ */ new Box3(); +var _v1$6 = /* @__PURE__ */ new Vector3(); +var _toFarthestPoint = /* @__PURE__ */ new Vector3(); +var _toPoint = /* @__PURE__ */ new Vector3(); +var Sphere = class { + constructor(center = new Vector3(), radius = -1) { + this.center = center; + this.radius = radius; + } + set(center, radius) { + this.center.copy(center); + this.radius = radius; + return this; + } + setFromPoints(points, optionalCenter) { + const center = this.center; + if (optionalCenter !== void 0) { + center.copy(optionalCenter); + } else { + _box$2.setFromPoints(points).getCenter(center); + } + let maxRadiusSq = 0; + for (let i = 0, il = points.length; i < il; i++) { + maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i])); + } + this.radius = Math.sqrt(maxRadiusSq); + return this; + } + copy(sphere) { + this.center.copy(sphere.center); + this.radius = sphere.radius; + return this; + } + isEmpty() { + return this.radius < 0; + } + makeEmpty() { + this.center.set(0, 0, 0); + this.radius = -1; + return this; + } + containsPoint(point) { + return point.distanceToSquared(this.center) <= this.radius * this.radius; + } + distanceToPoint(point) { + return point.distanceTo(this.center) - this.radius; + } + intersectsSphere(sphere) { + const radiusSum = this.radius + sphere.radius; + return sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum; + } + intersectsBox(box) { + return box.intersectsSphere(this); + } + intersectsPlane(plane) { + return Math.abs(plane.distanceToPoint(this.center)) <= this.radius; + } + clampPoint(point, target) { + const deltaLengthSq = this.center.distanceToSquared(point); + target.copy(point); + if (deltaLengthSq > this.radius * this.radius) { + target.sub(this.center).normalize(); + target.multiplyScalar(this.radius).add(this.center); + } + return target; + } + getBoundingBox(target) { + if (this.isEmpty()) { + target.makeEmpty(); + return target; + } + target.set(this.center, this.center); + target.expandByScalar(this.radius); + return target; + } + applyMatrix4(matrix) { + this.center.applyMatrix4(matrix); + this.radius = this.radius * matrix.getMaxScaleOnAxis(); + return this; + } + translate(offset) { + this.center.add(offset); + return this; + } + expandByPoint(point) { + _toPoint.subVectors(point, this.center); + const lengthSq = _toPoint.lengthSq(); + if (lengthSq > this.radius * this.radius) { + const length = Math.sqrt(lengthSq); + const missingRadiusHalf = (length - this.radius) * 0.5; + this.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length)); + this.radius += missingRadiusHalf; + } + return this; + } + union(sphere) { + if (this.center.equals(sphere.center) === true) { + _toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius); + } else { + _toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius); + } + this.expandByPoint(_v1$6.copy(sphere.center).add(_toFarthestPoint)); + this.expandByPoint(_v1$6.copy(sphere.center).sub(_toFarthestPoint)); + return this; + } + equals(sphere) { + return sphere.center.equals(this.center) && sphere.radius === this.radius; + } + clone() { + return new this.constructor().copy(this); + } +}; +var _vector$a = /* @__PURE__ */ new Vector3(); +var _segCenter = /* @__PURE__ */ new Vector3(); +var _segDir = /* @__PURE__ */ new Vector3(); +var _diff = /* @__PURE__ */ new Vector3(); +var _edge1 = /* @__PURE__ */ new Vector3(); +var _edge2 = /* @__PURE__ */ new Vector3(); +var _normal$1 = /* @__PURE__ */ new Vector3(); +var Ray = class { + constructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) { + this.origin = origin; + this.direction = direction; + } + set(origin, direction) { + this.origin.copy(origin); + this.direction.copy(direction); + return this; + } + copy(ray) { + this.origin.copy(ray.origin); + this.direction.copy(ray.direction); + return this; + } + at(t, target) { + return target.copy(this.direction).multiplyScalar(t).add(this.origin); + } + lookAt(v) { + this.direction.copy(v).sub(this.origin).normalize(); + return this; + } + recast(t) { + this.origin.copy(this.at(t, _vector$a)); + return this; + } + closestPointToPoint(point, target) { + target.subVectors(point, this.origin); + const directionDistance = target.dot(this.direction); + if (directionDistance < 0) { + return target.copy(this.origin); + } + return target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin); + } + distanceToPoint(point) { + return Math.sqrt(this.distanceSqToPoint(point)); + } + distanceSqToPoint(point) { + const directionDistance = _vector$a.subVectors(point, this.origin).dot(this.direction); + if (directionDistance < 0) { + return this.origin.distanceToSquared(point); + } + _vector$a.copy(this.direction).multiplyScalar(directionDistance).add(this.origin); + return _vector$a.distanceToSquared(point); + } + distanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) { + _segCenter.copy(v0).add(v1).multiplyScalar(0.5); + _segDir.copy(v1).sub(v0).normalize(); + _diff.copy(this.origin).sub(_segCenter); + const segExtent = v0.distanceTo(v1) * 0.5; + const a01 = -this.direction.dot(_segDir); + const b0 = _diff.dot(this.direction); + const b1 = -_diff.dot(_segDir); + const c2 = _diff.lengthSq(); + const det = Math.abs(1 - a01 * a01); + let s0, s1, sqrDist, extDet; + if (det > 0) { + s0 = a01 * b1 - b0; + s1 = a01 * b0 - b1; + extDet = segExtent * det; + if (s0 >= 0) { + if (s1 >= -extDet) { + if (s1 <= extDet) { + const invDet = 1 / det; + s0 *= invDet; + s1 *= invDet; + sqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c2; + } else { + s1 = segExtent; + s0 = Math.max(0, -(a01 * s1 + b0)); + sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2; + } + } else { + s1 = -segExtent; + s0 = Math.max(0, -(a01 * s1 + b0)); + sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2; + } + } else { + if (s1 <= -extDet) { + s0 = Math.max(0, -(-a01 * segExtent + b0)); + s1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent); + sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2; + } else if (s1 <= extDet) { + s0 = 0; + s1 = Math.min(Math.max(-segExtent, -b1), segExtent); + sqrDist = s1 * (s1 + 2 * b1) + c2; + } else { + s0 = Math.max(0, -(a01 * segExtent + b0)); + s1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent); + sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2; + } + } + } else { + s1 = a01 > 0 ? -segExtent : segExtent; + s0 = Math.max(0, -(a01 * s1 + b0)); + sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c2; + } + if (optionalPointOnRay) { + optionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin); + } + if (optionalPointOnSegment) { + optionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter); + } + return sqrDist; + } + intersectSphere(sphere, target) { + _vector$a.subVectors(sphere.center, this.origin); + const tca = _vector$a.dot(this.direction); + const d2 = _vector$a.dot(_vector$a) - tca * tca; + const radius2 = sphere.radius * sphere.radius; + if (d2 > radius2) + return null; + const thc = Math.sqrt(radius2 - d2); + const t0 = tca - thc; + const t1 = tca + thc; + if (t0 < 0 && t1 < 0) + return null; + if (t0 < 0) + return this.at(t1, target); + return this.at(t0, target); + } + intersectsSphere(sphere) { + return this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius; + } + distanceToPlane(plane) { + const denominator = plane.normal.dot(this.direction); + if (denominator === 0) { + if (plane.distanceToPoint(this.origin) === 0) { + return 0; + } + return null; + } + const t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; + return t >= 0 ? t : null; + } + intersectPlane(plane, target) { + const t = this.distanceToPlane(plane); + if (t === null) { + return null; + } + return this.at(t, target); + } + intersectsPlane(plane) { + const distToPoint = plane.distanceToPoint(this.origin); + if (distToPoint === 0) { + return true; + } + const denominator = plane.normal.dot(this.direction); + if (denominator * distToPoint < 0) { + return true; + } + return false; + } + intersectBox(box, target) { + let tmin, tmax, tymin, tymax, tzmin, tzmax; + const invdirx = 1 / this.direction.x, invdiry = 1 / this.direction.y, invdirz = 1 / this.direction.z; + const origin = this.origin; + if (invdirx >= 0) { + tmin = (box.min.x - origin.x) * invdirx; + tmax = (box.max.x - origin.x) * invdirx; + } else { + tmin = (box.max.x - origin.x) * invdirx; + tmax = (box.min.x - origin.x) * invdirx; + } + if (invdiry >= 0) { + tymin = (box.min.y - origin.y) * invdiry; + tymax = (box.max.y - origin.y) * invdiry; + } else { + tymin = (box.max.y - origin.y) * invdiry; + tymax = (box.min.y - origin.y) * invdiry; + } + if (tmin > tymax || tymin > tmax) + return null; + if (tymin > tmin || tmin !== tmin) + tmin = tymin; + if (tymax < tmax || tmax !== tmax) + tmax = tymax; + if (invdirz >= 0) { + tzmin = (box.min.z - origin.z) * invdirz; + tzmax = (box.max.z - origin.z) * invdirz; + } else { + tzmin = (box.max.z - origin.z) * invdirz; + tzmax = (box.min.z - origin.z) * invdirz; + } + if (tmin > tzmax || tzmin > tmax) + return null; + if (tzmin > tmin || tmin !== tmin) + tmin = tzmin; + if (tzmax < tmax || tmax !== tmax) + tmax = tzmax; + if (tmax < 0) + return null; + return this.at(tmin >= 0 ? tmin : tmax, target); + } + intersectsBox(box) { + return this.intersectBox(box, _vector$a) !== null; + } + intersectTriangle(a2, b, c2, backfaceCulling, target) { + _edge1.subVectors(b, a2); + _edge2.subVectors(c2, a2); + _normal$1.crossVectors(_edge1, _edge2); + let DdN = this.direction.dot(_normal$1); + let sign; + if (DdN > 0) { + if (backfaceCulling) + return null; + sign = 1; + } else if (DdN < 0) { + sign = -1; + DdN = -DdN; + } else { + return null; + } + _diff.subVectors(this.origin, a2); + const DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); + if (DdQxE2 < 0) { + return null; + } + const DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); + if (DdE1xQ < 0) { + return null; + } + if (DdQxE2 + DdE1xQ > DdN) { + return null; + } + const QdN = -sign * _diff.dot(_normal$1); + if (QdN < 0) { + return null; + } + return this.at(QdN / DdN, target); + } + applyMatrix4(matrix4) { + this.origin.applyMatrix4(matrix4); + this.direction.transformDirection(matrix4); + return this; + } + equals(ray) { + return ray.origin.equals(this.origin) && ray.direction.equals(this.direction); + } + clone() { + return new this.constructor().copy(this); + } +}; +var Matrix4 = class { + constructor() { + Matrix4.prototype.isMatrix4 = true; + this.elements = [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ]; + } + set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) { + const te = this.elements; + te[0] = n11; + te[4] = n12; + te[8] = n13; + te[12] = n14; + te[1] = n21; + te[5] = n22; + te[9] = n23; + te[13] = n24; + te[2] = n31; + te[6] = n32; + te[10] = n33; + te[14] = n34; + te[3] = n41; + te[7] = n42; + te[11] = n43; + te[15] = n44; + return this; + } + identity() { + this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + return this; + } + clone() { + return new Matrix4().fromArray(this.elements); + } + copy(m2) { + const te = this.elements; + const me = m2.elements; + te[0] = me[0]; + te[1] = me[1]; + te[2] = me[2]; + te[3] = me[3]; + te[4] = me[4]; + te[5] = me[5]; + te[6] = me[6]; + te[7] = me[7]; + te[8] = me[8]; + te[9] = me[9]; + te[10] = me[10]; + te[11] = me[11]; + te[12] = me[12]; + te[13] = me[13]; + te[14] = me[14]; + te[15] = me[15]; + return this; + } + copyPosition(m2) { + const te = this.elements, me = m2.elements; + te[12] = me[12]; + te[13] = me[13]; + te[14] = me[14]; + return this; + } + setFromMatrix3(m2) { + const me = m2.elements; + this.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1); + return this; + } + extractBasis(xAxis, yAxis, zAxis) { + xAxis.setFromMatrixColumn(this, 0); + yAxis.setFromMatrixColumn(this, 1); + zAxis.setFromMatrixColumn(this, 2); + return this; + } + makeBasis(xAxis, yAxis, zAxis) { + this.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1); + return this; + } + extractRotation(m2) { + const te = this.elements; + const me = m2.elements; + const scaleX = 1 / _v1$5.setFromMatrixColumn(m2, 0).length(); + const scaleY = 1 / _v1$5.setFromMatrixColumn(m2, 1).length(); + const scaleZ = 1 / _v1$5.setFromMatrixColumn(m2, 2).length(); + te[0] = me[0] * scaleX; + te[1] = me[1] * scaleX; + te[2] = me[2] * scaleX; + te[3] = 0; + te[4] = me[4] * scaleY; + te[5] = me[5] * scaleY; + te[6] = me[6] * scaleY; + te[7] = 0; + te[8] = me[8] * scaleZ; + te[9] = me[9] * scaleZ; + te[10] = me[10] * scaleZ; + te[11] = 0; + te[12] = 0; + te[13] = 0; + te[14] = 0; + te[15] = 1; + return this; + } + makeRotationFromEuler(euler) { + const te = this.elements; + const x2 = euler.x, y2 = euler.y, z2 = euler.z; + const a2 = Math.cos(x2), b = Math.sin(x2); + const c2 = Math.cos(y2), d = Math.sin(y2); + const e = Math.cos(z2), f = Math.sin(z2); + if (euler.order === "XYZ") { + const ae = a2 * e, af = a2 * f, be = b * e, bf = b * f; + te[0] = c2 * e; + te[4] = -c2 * f; + te[8] = d; + te[1] = af + be * d; + te[5] = ae - bf * d; + te[9] = -b * c2; + te[2] = bf - ae * d; + te[6] = be + af * d; + te[10] = a2 * c2; + } else if (euler.order === "YXZ") { + const ce = c2 * e, cf = c2 * f, de = d * e, df = d * f; + te[0] = ce + df * b; + te[4] = de * b - cf; + te[8] = a2 * d; + te[1] = a2 * f; + te[5] = a2 * e; + te[9] = -b; + te[2] = cf * b - de; + te[6] = df + ce * b; + te[10] = a2 * c2; + } else if (euler.order === "ZXY") { + const ce = c2 * e, cf = c2 * f, de = d * e, df = d * f; + te[0] = ce - df * b; + te[4] = -a2 * f; + te[8] = de + cf * b; + te[1] = cf + de * b; + te[5] = a2 * e; + te[9] = df - ce * b; + te[2] = -a2 * d; + te[6] = b; + te[10] = a2 * c2; + } else if (euler.order === "ZYX") { + const ae = a2 * e, af = a2 * f, be = b * e, bf = b * f; + te[0] = c2 * e; + te[4] = be * d - af; + te[8] = ae * d + bf; + te[1] = c2 * f; + te[5] = bf * d + ae; + te[9] = af * d - be; + te[2] = -d; + te[6] = b * c2; + te[10] = a2 * c2; + } else if (euler.order === "YZX") { + const ac = a2 * c2, ad = a2 * d, bc = b * c2, bd = b * d; + te[0] = c2 * e; + te[4] = bd - ac * f; + te[8] = bc * f + ad; + te[1] = f; + te[5] = a2 * e; + te[9] = -b * e; + te[2] = -d * e; + te[6] = ad * f + bc; + te[10] = ac - bd * f; + } else if (euler.order === "XZY") { + const ac = a2 * c2, ad = a2 * d, bc = b * c2, bd = b * d; + te[0] = c2 * e; + te[4] = -f; + te[8] = d * e; + te[1] = ac * f + bd; + te[5] = a2 * e; + te[9] = ad * f - bc; + te[2] = bc * f - ad; + te[6] = b * e; + te[10] = bd * f + ac; + } + te[3] = 0; + te[7] = 0; + te[11] = 0; + te[12] = 0; + te[13] = 0; + te[14] = 0; + te[15] = 1; + return this; + } + makeRotationFromQuaternion(q) { + return this.compose(_zero, q, _one); + } + lookAt(eye, target, up) { + const te = this.elements; + _z.subVectors(eye, target); + if (_z.lengthSq() === 0) { + _z.z = 1; + } + _z.normalize(); + _x.crossVectors(up, _z); + if (_x.lengthSq() === 0) { + if (Math.abs(up.z) === 1) { + _z.x += 1e-4; + } else { + _z.z += 1e-4; + } + _z.normalize(); + _x.crossVectors(up, _z); + } + _x.normalize(); + _y.crossVectors(_z, _x); + te[0] = _x.x; + te[4] = _y.x; + te[8] = _z.x; + te[1] = _x.y; + te[5] = _y.y; + te[9] = _z.y; + te[2] = _x.z; + te[6] = _y.z; + te[10] = _z.z; + return this; + } + multiply(m2) { + return this.multiplyMatrices(this, m2); + } + premultiply(m2) { + return this.multiplyMatrices(m2, this); + } + multiplyMatrices(a2, b) { + const ae = a2.elements; + const be = b.elements; + const te = this.elements; + const a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12]; + const a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13]; + const a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14]; + const a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15]; + const b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12]; + const b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13]; + const b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14]; + const b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15]; + te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + return this; + } + multiplyScalar(s) { + const te = this.elements; + te[0] *= s; + te[4] *= s; + te[8] *= s; + te[12] *= s; + te[1] *= s; + te[5] *= s; + te[9] *= s; + te[13] *= s; + te[2] *= s; + te[6] *= s; + te[10] *= s; + te[14] *= s; + te[3] *= s; + te[7] *= s; + te[11] *= s; + te[15] *= s; + return this; + } + determinant() { + const te = this.elements; + const n11 = te[0], n12 = te[4], n13 = te[8], n14 = te[12]; + const n21 = te[1], n22 = te[5], n23 = te[9], n24 = te[13]; + const n31 = te[2], n32 = te[6], n33 = te[10], n34 = te[14]; + const n41 = te[3], n42 = te[7], n43 = te[11], n44 = te[15]; + return n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31); + } + transpose() { + const te = this.elements; + let tmp2; + tmp2 = te[1]; + te[1] = te[4]; + te[4] = tmp2; + tmp2 = te[2]; + te[2] = te[8]; + te[8] = tmp2; + tmp2 = te[6]; + te[6] = te[9]; + te[9] = tmp2; + tmp2 = te[3]; + te[3] = te[12]; + te[12] = tmp2; + tmp2 = te[7]; + te[7] = te[13]; + te[13] = tmp2; + tmp2 = te[11]; + te[11] = te[14]; + te[14] = tmp2; + return this; + } + setPosition(x2, y2, z2) { + const te = this.elements; + if (x2.isVector3) { + te[12] = x2.x; + te[13] = x2.y; + te[14] = x2.z; + } else { + te[12] = x2; + te[13] = y2; + te[14] = z2; + } + return this; + } + invert() { + const te = this.elements, n11 = te[0], n21 = te[1], n31 = te[2], n41 = te[3], n12 = te[4], n22 = te[5], n32 = te[6], n42 = te[7], n13 = te[8], n23 = te[9], n33 = te[10], n43 = te[11], n14 = te[12], n24 = te[13], n34 = te[14], n44 = te[15], t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; + if (det === 0) + return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + const detInv = 1 / det; + te[0] = t11 * detInv; + te[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv; + te[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv; + te[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv; + te[4] = t12 * detInv; + te[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv; + te[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv; + te[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv; + te[8] = t13 * detInv; + te[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv; + te[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv; + te[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv; + te[12] = t14 * detInv; + te[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv; + te[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv; + te[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv; + return this; + } + scale(v) { + const te = this.elements; + const x2 = v.x, y2 = v.y, z2 = v.z; + te[0] *= x2; + te[4] *= y2; + te[8] *= z2; + te[1] *= x2; + te[5] *= y2; + te[9] *= z2; + te[2] *= x2; + te[6] *= y2; + te[10] *= z2; + te[3] *= x2; + te[7] *= y2; + te[11] *= z2; + return this; + } + getMaxScaleOnAxis() { + const te = this.elements; + const scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2]; + const scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6]; + const scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10]; + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + makeTranslation(x2, y2, z2) { + this.set(1, 0, 0, x2, 0, 1, 0, y2, 0, 0, 1, z2, 0, 0, 0, 1); + return this; + } + makeRotationX(theta) { + const c2 = Math.cos(theta), s = Math.sin(theta); + this.set(1, 0, 0, 0, 0, c2, -s, 0, 0, s, c2, 0, 0, 0, 0, 1); + return this; + } + makeRotationY(theta) { + const c2 = Math.cos(theta), s = Math.sin(theta); + this.set(c2, 0, s, 0, 0, 1, 0, 0, -s, 0, c2, 0, 0, 0, 0, 1); + return this; + } + makeRotationZ(theta) { + const c2 = Math.cos(theta), s = Math.sin(theta); + this.set(c2, -s, 0, 0, s, c2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + return this; + } + makeRotationAxis(axis, angle) { + const c2 = Math.cos(angle); + const s = Math.sin(angle); + const t = 1 - c2; + const x2 = axis.x, y2 = axis.y, z2 = axis.z; + const tx = t * x2, ty = t * y2; + this.set(tx * x2 + c2, tx * y2 - s * z2, tx * z2 + s * y2, 0, tx * y2 + s * z2, ty * y2 + c2, ty * z2 - s * x2, 0, tx * z2 - s * y2, ty * z2 + s * x2, t * z2 * z2 + c2, 0, 0, 0, 0, 1); + return this; + } + makeScale(x2, y2, z2) { + this.set(x2, 0, 0, 0, 0, y2, 0, 0, 0, 0, z2, 0, 0, 0, 0, 1); + return this; + } + makeShear(xy, xz, yx, yz, zx, zy) { + this.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1); + return this; + } + compose(position, quaternion, scale) { + const te = this.elements; + const x2 = quaternion._x, y2 = quaternion._y, z2 = quaternion._z, w = quaternion._w; + const x22 = x2 + x2, y22 = y2 + y2, z22 = z2 + z2; + const xx = x2 * x22, xy = x2 * y22, xz = x2 * z22; + const yy = y2 * y22, yz = y2 * z22, zz = z2 * z22; + const wx = w * x22, wy = w * y22, wz = w * z22; + const sx = scale.x, sy = scale.y, sz = scale.z; + te[0] = (1 - (yy + zz)) * sx; + te[1] = (xy + wz) * sx; + te[2] = (xz - wy) * sx; + te[3] = 0; + te[4] = (xy - wz) * sy; + te[5] = (1 - (xx + zz)) * sy; + te[6] = (yz + wx) * sy; + te[7] = 0; + te[8] = (xz + wy) * sz; + te[9] = (yz - wx) * sz; + te[10] = (1 - (xx + yy)) * sz; + te[11] = 0; + te[12] = position.x; + te[13] = position.y; + te[14] = position.z; + te[15] = 1; + return this; + } + decompose(position, quaternion, scale) { + const te = this.elements; + let sx = _v1$5.set(te[0], te[1], te[2]).length(); + const sy = _v1$5.set(te[4], te[5], te[6]).length(); + const sz = _v1$5.set(te[8], te[9], te[10]).length(); + const det = this.determinant(); + if (det < 0) + sx = -sx; + position.x = te[12]; + position.y = te[13]; + position.z = te[14]; + _m1$2.copy(this); + const invSX = 1 / sx; + const invSY = 1 / sy; + const invSZ = 1 / sz; + _m1$2.elements[0] *= invSX; + _m1$2.elements[1] *= invSX; + _m1$2.elements[2] *= invSX; + _m1$2.elements[4] *= invSY; + _m1$2.elements[5] *= invSY; + _m1$2.elements[6] *= invSY; + _m1$2.elements[8] *= invSZ; + _m1$2.elements[9] *= invSZ; + _m1$2.elements[10] *= invSZ; + quaternion.setFromRotationMatrix(_m1$2); + scale.x = sx; + scale.y = sy; + scale.z = sz; + return this; + } + makePerspective(left, right, top, bottom, near, far) { + const te = this.elements; + const x2 = 2 * near / (right - left); + const y2 = 2 * near / (top - bottom); + const a2 = (right + left) / (right - left); + const b = (top + bottom) / (top - bottom); + const c2 = -(far + near) / (far - near); + const d = -2 * far * near / (far - near); + te[0] = x2; + te[4] = 0; + te[8] = a2; + te[12] = 0; + te[1] = 0; + te[5] = y2; + te[9] = b; + te[13] = 0; + te[2] = 0; + te[6] = 0; + te[10] = c2; + te[14] = d; + te[3] = 0; + te[7] = 0; + te[11] = -1; + te[15] = 0; + return this; + } + makeOrthographic(left, right, top, bottom, near, far) { + const te = this.elements; + const w = 1 / (right - left); + const h = 1 / (top - bottom); + const p = 1 / (far - near); + const x2 = (right + left) * w; + const y2 = (top + bottom) * h; + const z2 = (far + near) * p; + te[0] = 2 * w; + te[4] = 0; + te[8] = 0; + te[12] = -x2; + te[1] = 0; + te[5] = 2 * h; + te[9] = 0; + te[13] = -y2; + te[2] = 0; + te[6] = 0; + te[10] = -2 * p; + te[14] = -z2; + te[3] = 0; + te[7] = 0; + te[11] = 0; + te[15] = 1; + return this; + } + equals(matrix) { + const te = this.elements; + const me = matrix.elements; + for (let i = 0; i < 16; i++) { + if (te[i] !== me[i]) + return false; + } + return true; + } + fromArray(array, offset = 0) { + for (let i = 0; i < 16; i++) { + this.elements[i] = array[i + offset]; + } + return this; + } + toArray(array = [], offset = 0) { + const te = this.elements; + array[offset] = te[0]; + array[offset + 1] = te[1]; + array[offset + 2] = te[2]; + array[offset + 3] = te[3]; + array[offset + 4] = te[4]; + array[offset + 5] = te[5]; + array[offset + 6] = te[6]; + array[offset + 7] = te[7]; + array[offset + 8] = te[8]; + array[offset + 9] = te[9]; + array[offset + 10] = te[10]; + array[offset + 11] = te[11]; + array[offset + 12] = te[12]; + array[offset + 13] = te[13]; + array[offset + 14] = te[14]; + array[offset + 15] = te[15]; + return array; + } +}; +var _v1$5 = /* @__PURE__ */ new Vector3(); +var _m1$2 = /* @__PURE__ */ new Matrix4(); +var _zero = /* @__PURE__ */ new Vector3(0, 0, 0); +var _one = /* @__PURE__ */ new Vector3(1, 1, 1); +var _x = /* @__PURE__ */ new Vector3(); +var _y = /* @__PURE__ */ new Vector3(); +var _z = /* @__PURE__ */ new Vector3(); +var _matrix$1 = /* @__PURE__ */ new Matrix4(); +var _quaternion$3 = /* @__PURE__ */ new Quaternion(); +var Euler = class { + constructor(x2 = 0, y2 = 0, z2 = 0, order = Euler.DefaultOrder) { + this.isEuler = true; + this._x = x2; + this._y = y2; + this._z = z2; + this._order = order; + } + get x() { + return this._x; + } + set x(value) { + this._x = value; + this._onChangeCallback(); + } + get y() { + return this._y; + } + set y(value) { + this._y = value; + this._onChangeCallback(); + } + get z() { + return this._z; + } + set z(value) { + this._z = value; + this._onChangeCallback(); + } + get order() { + return this._order; + } + set order(value) { + this._order = value; + this._onChangeCallback(); + } + set(x2, y2, z2, order = this._order) { + this._x = x2; + this._y = y2; + this._z = z2; + this._order = order; + this._onChangeCallback(); + return this; + } + clone() { + return new this.constructor(this._x, this._y, this._z, this._order); + } + copy(euler) { + this._x = euler._x; + this._y = euler._y; + this._z = euler._z; + this._order = euler._order; + this._onChangeCallback(); + return this; + } + setFromRotationMatrix(m2, order = this._order, update4 = true) { + const te = m2.elements; + const m11 = te[0], m12 = te[4], m13 = te[8]; + const m21 = te[1], m22 = te[5], m23 = te[9]; + const m31 = te[2], m32 = te[6], m33 = te[10]; + switch (order) { + case "XYZ": + this._y = Math.asin(clamp(m13, -1, 1)); + if (Math.abs(m13) < 0.9999999) { + this._x = Math.atan2(-m23, m33); + this._z = Math.atan2(-m12, m11); + } else { + this._x = Math.atan2(m32, m22); + this._z = 0; + } + break; + case "YXZ": + this._x = Math.asin(-clamp(m23, -1, 1)); + if (Math.abs(m23) < 0.9999999) { + this._y = Math.atan2(m13, m33); + this._z = Math.atan2(m21, m22); + } else { + this._y = Math.atan2(-m31, m11); + this._z = 0; + } + break; + case "ZXY": + this._x = Math.asin(clamp(m32, -1, 1)); + if (Math.abs(m32) < 0.9999999) { + this._y = Math.atan2(-m31, m33); + this._z = Math.atan2(-m12, m22); + } else { + this._y = 0; + this._z = Math.atan2(m21, m11); + } + break; + case "ZYX": + this._y = Math.asin(-clamp(m31, -1, 1)); + if (Math.abs(m31) < 0.9999999) { + this._x = Math.atan2(m32, m33); + this._z = Math.atan2(m21, m11); + } else { + this._x = 0; + this._z = Math.atan2(-m12, m22); + } + break; + case "YZX": + this._z = Math.asin(clamp(m21, -1, 1)); + if (Math.abs(m21) < 0.9999999) { + this._x = Math.atan2(-m23, m22); + this._y = Math.atan2(-m31, m11); + } else { + this._x = 0; + this._y = Math.atan2(m13, m33); + } + break; + case "XZY": + this._z = Math.asin(-clamp(m12, -1, 1)); + if (Math.abs(m12) < 0.9999999) { + this._x = Math.atan2(m32, m22); + this._y = Math.atan2(m13, m11); + } else { + this._x = Math.atan2(-m23, m33); + this._y = 0; + } + break; + default: + console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + order); + } + this._order = order; + if (update4 === true) + this._onChangeCallback(); + return this; + } + setFromQuaternion(q, order, update4) { + _matrix$1.makeRotationFromQuaternion(q); + return this.setFromRotationMatrix(_matrix$1, order, update4); + } + setFromVector3(v, order = this._order) { + return this.set(v.x, v.y, v.z, order); + } + reorder(newOrder) { + _quaternion$3.setFromEuler(this); + return this.setFromQuaternion(_quaternion$3, newOrder); + } + equals(euler) { + return euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order; + } + fromArray(array) { + this._x = array[0]; + this._y = array[1]; + this._z = array[2]; + if (array[3] !== void 0) + this._order = array[3]; + this._onChangeCallback(); + return this; + } + toArray(array = [], offset = 0) { + array[offset] = this._x; + array[offset + 1] = this._y; + array[offset + 2] = this._z; + array[offset + 3] = this._order; + return array; + } + _onChange(callback) { + this._onChangeCallback = callback; + return this; + } + _onChangeCallback() { + } + *[Symbol.iterator]() { + yield this._x; + yield this._y; + yield this._z; + yield this._order; + } + toVector3() { + console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead"); + } +}; +Euler.DefaultOrder = "XYZ"; +Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]; +var Layers = class { + constructor() { + this.mask = 1 | 0; + } + set(channel) { + this.mask = (1 << channel | 0) >>> 0; + } + enable(channel) { + this.mask |= 1 << channel | 0; + } + enableAll() { + this.mask = 4294967295 | 0; + } + toggle(channel) { + this.mask ^= 1 << channel | 0; + } + disable(channel) { + this.mask &= ~(1 << channel | 0); + } + disableAll() { + this.mask = 0; + } + test(layers) { + return (this.mask & layers.mask) !== 0; + } + isEnabled(channel) { + return (this.mask & (1 << channel | 0)) !== 0; + } +}; +var _object3DId = 0; +var _v1$4 = /* @__PURE__ */ new Vector3(); +var _q1 = /* @__PURE__ */ new Quaternion(); +var _m1$1 = /* @__PURE__ */ new Matrix4(); +var _target = /* @__PURE__ */ new Vector3(); +var _position$3 = /* @__PURE__ */ new Vector3(); +var _scale$2 = /* @__PURE__ */ new Vector3(); +var _quaternion$2 = /* @__PURE__ */ new Quaternion(); +var _xAxis = /* @__PURE__ */ new Vector3(1, 0, 0); +var _yAxis = /* @__PURE__ */ new Vector3(0, 1, 0); +var _zAxis = /* @__PURE__ */ new Vector3(0, 0, 1); +var _addedEvent = { type: "added" }; +var _removedEvent = { type: "removed" }; +var Object3D = class extends EventDispatcher { + constructor() { + super(); + this.isObject3D = true; + Object.defineProperty(this, "id", { value: _object3DId++ }); + this.uuid = generateUUID(); + this.name = ""; + this.type = "Object3D"; + this.parent = null; + this.children = []; + this.up = Object3D.DefaultUp.clone(); + const position = new Vector3(); + const rotation = new Euler(); + const quaternion = new Quaternion(); + const scale = new Vector3(1, 1, 1); + function onRotationChange() { + quaternion.setFromEuler(rotation, false); + } + function onQuaternionChange() { + rotation.setFromQuaternion(quaternion, void 0, false); + } + rotation._onChange(onRotationChange); + quaternion._onChange(onQuaternionChange); + Object.defineProperties(this, { + position: { + configurable: true, + enumerable: true, + value: position + }, + rotation: { + configurable: true, + enumerable: true, + value: rotation + }, + quaternion: { + configurable: true, + enumerable: true, + value: quaternion + }, + scale: { + configurable: true, + enumerable: true, + value: scale + }, + modelViewMatrix: { + value: new Matrix4() + }, + normalMatrix: { + value: new Matrix3() + } + }); + this.matrix = new Matrix4(); + this.matrixWorld = new Matrix4(); + this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; + this.matrixWorldNeedsUpdate = false; + this.layers = new Layers(); + this.visible = true; + this.castShadow = false; + this.receiveShadow = false; + this.frustumCulled = true; + this.renderOrder = 0; + this.animations = []; + this.userData = {}; + } + onBeforeRender() { + } + onAfterRender() { + } + applyMatrix4(matrix) { + if (this.matrixAutoUpdate) + this.updateMatrix(); + this.matrix.premultiply(matrix); + this.matrix.decompose(this.position, this.quaternion, this.scale); + } + applyQuaternion(q) { + this.quaternion.premultiply(q); + return this; + } + setRotationFromAxisAngle(axis, angle) { + this.quaternion.setFromAxisAngle(axis, angle); + } + setRotationFromEuler(euler) { + this.quaternion.setFromEuler(euler, true); + } + setRotationFromMatrix(m2) { + this.quaternion.setFromRotationMatrix(m2); + } + setRotationFromQuaternion(q) { + this.quaternion.copy(q); + } + rotateOnAxis(axis, angle) { + _q1.setFromAxisAngle(axis, angle); + this.quaternion.multiply(_q1); + return this; + } + rotateOnWorldAxis(axis, angle) { + _q1.setFromAxisAngle(axis, angle); + this.quaternion.premultiply(_q1); + return this; + } + rotateX(angle) { + return this.rotateOnAxis(_xAxis, angle); + } + rotateY(angle) { + return this.rotateOnAxis(_yAxis, angle); + } + rotateZ(angle) { + return this.rotateOnAxis(_zAxis, angle); + } + translateOnAxis(axis, distance) { + _v1$4.copy(axis).applyQuaternion(this.quaternion); + this.position.add(_v1$4.multiplyScalar(distance)); + return this; + } + translateX(distance) { + return this.translateOnAxis(_xAxis, distance); + } + translateY(distance) { + return this.translateOnAxis(_yAxis, distance); + } + translateZ(distance) { + return this.translateOnAxis(_zAxis, distance); + } + localToWorld(vector) { + return vector.applyMatrix4(this.matrixWorld); + } + worldToLocal(vector) { + return vector.applyMatrix4(_m1$1.copy(this.matrixWorld).invert()); + } + lookAt(x2, y2, z2) { + if (x2.isVector3) { + _target.copy(x2); + } else { + _target.set(x2, y2, z2); + } + const parent = this.parent; + this.updateWorldMatrix(true, false); + _position$3.setFromMatrixPosition(this.matrixWorld); + if (this.isCamera || this.isLight) { + _m1$1.lookAt(_position$3, _target, this.up); + } else { + _m1$1.lookAt(_target, _position$3, this.up); + } + this.quaternion.setFromRotationMatrix(_m1$1); + if (parent) { + _m1$1.extractRotation(parent.matrixWorld); + _q1.setFromRotationMatrix(_m1$1); + this.quaternion.premultiply(_q1.invert()); + } + } + add(object) { + if (arguments.length > 1) { + for (let i = 0; i < arguments.length; i++) { + this.add(arguments[i]); + } + return this; + } + if (object === this) { + console.error("THREE.Object3D.add: object can't be added as a child of itself.", object); + return this; + } + if (object && object.isObject3D) { + if (object.parent !== null) { + object.parent.remove(object); + } + object.parent = this; + this.children.push(object); + object.dispatchEvent(_addedEvent); + } else { + console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", object); + } + return this; + } + remove(object) { + if (arguments.length > 1) { + for (let i = 0; i < arguments.length; i++) { + this.remove(arguments[i]); + } + return this; + } + const index5 = this.children.indexOf(object); + if (index5 !== -1) { + object.parent = null; + this.children.splice(index5, 1); + object.dispatchEvent(_removedEvent); + } + return this; + } + removeFromParent() { + const parent = this.parent; + if (parent !== null) { + parent.remove(this); + } + return this; + } + clear() { + for (let i = 0; i < this.children.length; i++) { + const object = this.children[i]; + object.parent = null; + object.dispatchEvent(_removedEvent); + } + this.children.length = 0; + return this; + } + attach(object) { + this.updateWorldMatrix(true, false); + _m1$1.copy(this.matrixWorld).invert(); + if (object.parent !== null) { + object.parent.updateWorldMatrix(true, false); + _m1$1.multiply(object.parent.matrixWorld); + } + object.applyMatrix4(_m1$1); + this.add(object); + object.updateWorldMatrix(false, true); + return this; + } + getObjectById(id) { + return this.getObjectByProperty("id", id); + } + getObjectByName(name) { + return this.getObjectByProperty("name", name); + } + getObjectByProperty(name, value) { + if (this[name] === value) + return this; + for (let i = 0, l = this.children.length; i < l; i++) { + const child = this.children[i]; + const object = child.getObjectByProperty(name, value); + if (object !== void 0) { + return object; + } + } + return void 0; + } + getWorldPosition(target) { + this.updateWorldMatrix(true, false); + return target.setFromMatrixPosition(this.matrixWorld); + } + getWorldQuaternion(target) { + this.updateWorldMatrix(true, false); + this.matrixWorld.decompose(_position$3, target, _scale$2); + return target; + } + getWorldScale(target) { + this.updateWorldMatrix(true, false); + this.matrixWorld.decompose(_position$3, _quaternion$2, target); + return target; + } + getWorldDirection(target) { + this.updateWorldMatrix(true, false); + const e = this.matrixWorld.elements; + return target.set(e[8], e[9], e[10]).normalize(); + } + raycast() { + } + traverse(callback) { + callback(this); + const children = this.children; + for (let i = 0, l = children.length; i < l; i++) { + children[i].traverse(callback); + } + } + traverseVisible(callback) { + if (this.visible === false) + return; + callback(this); + const children = this.children; + for (let i = 0, l = children.length; i < l; i++) { + children[i].traverseVisible(callback); + } + } + traverseAncestors(callback) { + const parent = this.parent; + if (parent !== null) { + callback(parent); + parent.traverseAncestors(callback); + } + } + updateMatrix() { + this.matrix.compose(this.position, this.quaternion, this.scale); + this.matrixWorldNeedsUpdate = true; + } + updateMatrixWorld(force) { + if (this.matrixAutoUpdate) + this.updateMatrix(); + if (this.matrixWorldNeedsUpdate || force) { + if (this.parent === null) { + this.matrixWorld.copy(this.matrix); + } else { + this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix); + } + this.matrixWorldNeedsUpdate = false; + force = true; + } + const children = this.children; + for (let i = 0, l = children.length; i < l; i++) { + children[i].updateMatrixWorld(force); + } + } + updateWorldMatrix(updateParents, updateChildren) { + const parent = this.parent; + if (updateParents === true && parent !== null) { + parent.updateWorldMatrix(true, false); + } + if (this.matrixAutoUpdate) + this.updateMatrix(); + if (this.parent === null) { + this.matrixWorld.copy(this.matrix); + } else { + this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix); + } + if (updateChildren === true) { + const children = this.children; + for (let i = 0, l = children.length; i < l; i++) { + children[i].updateWorldMatrix(false, true); + } + } + } + toJSON(meta) { + const isRootObject = meta === void 0 || typeof meta === "string"; + const output = {}; + if (isRootObject) { + meta = { + geometries: {}, + materials: {}, + textures: {}, + images: {}, + shapes: {}, + skeletons: {}, + animations: {}, + nodes: {} + }; + output.metadata = { + version: 4.5, + type: "Object", + generator: "Object3D.toJSON" + }; + } + const object = {}; + object.uuid = this.uuid; + object.type = this.type; + if (this.name !== "") + object.name = this.name; + if (this.castShadow === true) + object.castShadow = true; + if (this.receiveShadow === true) + object.receiveShadow = true; + if (this.visible === false) + object.visible = false; + if (this.frustumCulled === false) + object.frustumCulled = false; + if (this.renderOrder !== 0) + object.renderOrder = this.renderOrder; + if (JSON.stringify(this.userData) !== "{}") + object.userData = this.userData; + object.layers = this.layers.mask; + object.matrix = this.matrix.toArray(); + if (this.matrixAutoUpdate === false) + object.matrixAutoUpdate = false; + if (this.isInstancedMesh) { + object.type = "InstancedMesh"; + object.count = this.count; + object.instanceMatrix = this.instanceMatrix.toJSON(); + if (this.instanceColor !== null) + object.instanceColor = this.instanceColor.toJSON(); + } + function serialize(library, element) { + if (library[element.uuid] === void 0) { + library[element.uuid] = element.toJSON(meta); + } + return element.uuid; + } + if (this.isScene) { + if (this.background) { + if (this.background.isColor) { + object.background = this.background.toJSON(); + } else if (this.background.isTexture) { + object.background = this.background.toJSON(meta).uuid; + } + } + if (this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true) { + object.environment = this.environment.toJSON(meta).uuid; + } + } else if (this.isMesh || this.isLine || this.isPoints) { + object.geometry = serialize(meta.geometries, this.geometry); + const parameters = this.geometry.parameters; + if (parameters !== void 0 && parameters.shapes !== void 0) { + const shapes = parameters.shapes; + if (Array.isArray(shapes)) { + for (let i = 0, l = shapes.length; i < l; i++) { + const shape = shapes[i]; + serialize(meta.shapes, shape); + } + } else { + serialize(meta.shapes, shapes); + } + } + } + if (this.isSkinnedMesh) { + object.bindMode = this.bindMode; + object.bindMatrix = this.bindMatrix.toArray(); + if (this.skeleton !== void 0) { + serialize(meta.skeletons, this.skeleton); + object.skeleton = this.skeleton.uuid; + } + } + if (this.material !== void 0) { + if (Array.isArray(this.material)) { + const uuids = []; + for (let i = 0, l = this.material.length; i < l; i++) { + uuids.push(serialize(meta.materials, this.material[i])); + } + object.material = uuids; + } else { + object.material = serialize(meta.materials, this.material); + } + } + if (this.children.length > 0) { + object.children = []; + for (let i = 0; i < this.children.length; i++) { + object.children.push(this.children[i].toJSON(meta).object); + } + } + if (this.animations.length > 0) { + object.animations = []; + for (let i = 0; i < this.animations.length; i++) { + const animation = this.animations[i]; + object.animations.push(serialize(meta.animations, animation)); + } + } + if (isRootObject) { + const geometries = extractFromCache(meta.geometries); + const materials = extractFromCache(meta.materials); + const textures = extractFromCache(meta.textures); + const images = extractFromCache(meta.images); + const shapes = extractFromCache(meta.shapes); + const skeletons = extractFromCache(meta.skeletons); + const animations = extractFromCache(meta.animations); + const nodes = extractFromCache(meta.nodes); + if (geometries.length > 0) + output.geometries = geometries; + if (materials.length > 0) + output.materials = materials; + if (textures.length > 0) + output.textures = textures; + if (images.length > 0) + output.images = images; + if (shapes.length > 0) + output.shapes = shapes; + if (skeletons.length > 0) + output.skeletons = skeletons; + if (animations.length > 0) + output.animations = animations; + if (nodes.length > 0) + output.nodes = nodes; + } + output.object = object; + return output; + function extractFromCache(cache) { + const values = []; + for (const key in cache) { + const data = cache[key]; + delete data.metadata; + values.push(data); + } + return values; + } + } + clone(recursive) { + return new this.constructor().copy(this, recursive); + } + copy(source, recursive = true) { + this.name = source.name; + this.up.copy(source.up); + this.position.copy(source.position); + this.rotation.order = source.rotation.order; + this.quaternion.copy(source.quaternion); + this.scale.copy(source.scale); + this.matrix.copy(source.matrix); + this.matrixWorld.copy(source.matrixWorld); + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; + this.layers.mask = source.layers.mask; + this.visible = source.visible; + this.castShadow = source.castShadow; + this.receiveShadow = source.receiveShadow; + this.frustumCulled = source.frustumCulled; + this.renderOrder = source.renderOrder; + this.userData = JSON.parse(JSON.stringify(source.userData)); + if (recursive === true) { + for (let i = 0; i < source.children.length; i++) { + const child = source.children[i]; + this.add(child.clone()); + } + } + return this; + } +}; +Object3D.DefaultUp = /* @__PURE__ */ new Vector3(0, 1, 0); +Object3D.DefaultMatrixAutoUpdate = true; +var _v0$1 = /* @__PURE__ */ new Vector3(); +var _v1$3 = /* @__PURE__ */ new Vector3(); +var _v2$2 = /* @__PURE__ */ new Vector3(); +var _v3$1 = /* @__PURE__ */ new Vector3(); +var _vab = /* @__PURE__ */ new Vector3(); +var _vac = /* @__PURE__ */ new Vector3(); +var _vbc = /* @__PURE__ */ new Vector3(); +var _vap = /* @__PURE__ */ new Vector3(); +var _vbp = /* @__PURE__ */ new Vector3(); +var _vcp = /* @__PURE__ */ new Vector3(); +var Triangle = class { + constructor(a2 = new Vector3(), b = new Vector3(), c2 = new Vector3()) { + this.a = a2; + this.b = b; + this.c = c2; + } + static getNormal(a2, b, c2, target) { + target.subVectors(c2, b); + _v0$1.subVectors(a2, b); + target.cross(_v0$1); + const targetLengthSq = target.lengthSq(); + if (targetLengthSq > 0) { + return target.multiplyScalar(1 / Math.sqrt(targetLengthSq)); + } + return target.set(0, 0, 0); + } + static getBarycoord(point, a2, b, c2, target) { + _v0$1.subVectors(c2, a2); + _v1$3.subVectors(b, a2); + _v2$2.subVectors(point, a2); + const dot00 = _v0$1.dot(_v0$1); + const dot01 = _v0$1.dot(_v1$3); + const dot02 = _v0$1.dot(_v2$2); + const dot11 = _v1$3.dot(_v1$3); + const dot12 = _v1$3.dot(_v2$2); + const denom = dot00 * dot11 - dot01 * dot01; + if (denom === 0) { + return target.set(-2, -1, -1); + } + const invDenom = 1 / denom; + const u = (dot11 * dot02 - dot01 * dot12) * invDenom; + const v = (dot00 * dot12 - dot01 * dot02) * invDenom; + return target.set(1 - u - v, v, u); + } + static containsPoint(point, a2, b, c2) { + this.getBarycoord(point, a2, b, c2, _v3$1); + return _v3$1.x >= 0 && _v3$1.y >= 0 && _v3$1.x + _v3$1.y <= 1; + } + static getUV(point, p1, p2, p3, uv1, uv2, uv3, target) { + this.getBarycoord(point, p1, p2, p3, _v3$1); + target.set(0, 0); + target.addScaledVector(uv1, _v3$1.x); + target.addScaledVector(uv2, _v3$1.y); + target.addScaledVector(uv3, _v3$1.z); + return target; + } + static isFrontFacing(a2, b, c2, direction) { + _v0$1.subVectors(c2, b); + _v1$3.subVectors(a2, b); + return _v0$1.cross(_v1$3).dot(direction) < 0 ? true : false; + } + set(a2, b, c2) { + this.a.copy(a2); + this.b.copy(b); + this.c.copy(c2); + return this; + } + setFromPointsAndIndices(points, i0, i1, i2) { + this.a.copy(points[i0]); + this.b.copy(points[i1]); + this.c.copy(points[i2]); + return this; + } + setFromAttributeAndIndices(attribute, i0, i1, i2) { + this.a.fromBufferAttribute(attribute, i0); + this.b.fromBufferAttribute(attribute, i1); + this.c.fromBufferAttribute(attribute, i2); + return this; + } + clone() { + return new this.constructor().copy(this); + } + copy(triangle) { + this.a.copy(triangle.a); + this.b.copy(triangle.b); + this.c.copy(triangle.c); + return this; + } + getArea() { + _v0$1.subVectors(this.c, this.b); + _v1$3.subVectors(this.a, this.b); + return _v0$1.cross(_v1$3).length() * 0.5; + } + getMidpoint(target) { + return target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3); + } + getNormal(target) { + return Triangle.getNormal(this.a, this.b, this.c, target); + } + getPlane(target) { + return target.setFromCoplanarPoints(this.a, this.b, this.c); + } + getBarycoord(point, target) { + return Triangle.getBarycoord(point, this.a, this.b, this.c, target); + } + getUV(point, uv1, uv2, uv3, target) { + return Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target); + } + containsPoint(point) { + return Triangle.containsPoint(point, this.a, this.b, this.c); + } + isFrontFacing(direction) { + return Triangle.isFrontFacing(this.a, this.b, this.c, direction); + } + intersectsBox(box) { + return box.intersectsTriangle(this); + } + closestPointToPoint(p, target) { + const a2 = this.a, b = this.b, c2 = this.c; + let v, w; + _vab.subVectors(b, a2); + _vac.subVectors(c2, a2); + _vap.subVectors(p, a2); + const d1 = _vab.dot(_vap); + const d2 = _vac.dot(_vap); + if (d1 <= 0 && d2 <= 0) { + return target.copy(a2); + } + _vbp.subVectors(p, b); + const d3 = _vab.dot(_vbp); + const d4 = _vac.dot(_vbp); + if (d3 >= 0 && d4 <= d3) { + return target.copy(b); + } + const vc = d1 * d4 - d3 * d2; + if (vc <= 0 && d1 >= 0 && d3 <= 0) { + v = d1 / (d1 - d3); + return target.copy(a2).addScaledVector(_vab, v); + } + _vcp.subVectors(p, c2); + const d5 = _vab.dot(_vcp); + const d6 = _vac.dot(_vcp); + if (d6 >= 0 && d5 <= d6) { + return target.copy(c2); + } + const vb = d5 * d2 - d1 * d6; + if (vb <= 0 && d2 >= 0 && d6 <= 0) { + w = d2 / (d2 - d6); + return target.copy(a2).addScaledVector(_vac, w); + } + const va = d3 * d6 - d5 * d4; + if (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) { + _vbc.subVectors(c2, b); + w = (d4 - d3) / (d4 - d3 + (d5 - d6)); + return target.copy(b).addScaledVector(_vbc, w); + } + const denom = 1 / (va + vb + vc); + v = vb * denom; + w = vc * denom; + return target.copy(a2).addScaledVector(_vab, v).addScaledVector(_vac, w); + } + equals(triangle) { + return triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c); + } +}; +var materialId = 0; +var Material = class extends EventDispatcher { + constructor() { + super(); + this.isMaterial = true; + Object.defineProperty(this, "id", { value: materialId++ }); + this.uuid = generateUUID(); + this.name = ""; + this.type = "Material"; + this.blending = NormalBlending; + this.side = FrontSide; + this.vertexColors = false; + this.opacity = 1; + this.transparent = false; + this.blendSrc = SrcAlphaFactor; + this.blendDst = OneMinusSrcAlphaFactor; + this.blendEquation = AddEquation; + this.blendSrcAlpha = null; + this.blendDstAlpha = null; + this.blendEquationAlpha = null; + this.depthFunc = LessEqualDepth; + this.depthTest = true; + this.depthWrite = true; + this.stencilWriteMask = 255; + this.stencilFunc = AlwaysStencilFunc; + this.stencilRef = 0; + this.stencilFuncMask = 255; + this.stencilFail = KeepStencilOp; + this.stencilZFail = KeepStencilOp; + this.stencilZPass = KeepStencilOp; + this.stencilWrite = false; + this.clippingPlanes = null; + this.clipIntersection = false; + this.clipShadows = false; + this.shadowSide = null; + this.colorWrite = true; + this.precision = null; + this.polygonOffset = false; + this.polygonOffsetFactor = 0; + this.polygonOffsetUnits = 0; + this.dithering = false; + this.alphaToCoverage = false; + this.premultipliedAlpha = false; + this.visible = true; + this.toneMapped = true; + this.userData = {}; + this.version = 0; + this._alphaTest = 0; + } + get alphaTest() { + return this._alphaTest; + } + set alphaTest(value) { + if (this._alphaTest > 0 !== value > 0) { + this.version++; + } + this._alphaTest = value; + } + onBuild() { + } + onBeforeRender() { + } + onBeforeCompile() { + } + customProgramCacheKey() { + return this.onBeforeCompile.toString(); + } + setValues(values) { + if (values === void 0) + return; + for (const key in values) { + const newValue = values[key]; + if (newValue === void 0) { + console.warn("THREE.Material: '" + key + "' parameter is undefined."); + continue; + } + if (key === "shading") { + console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."); + this.flatShading = newValue === FlatShading ? true : false; + continue; + } + const currentValue = this[key]; + if (currentValue === void 0) { + console.warn("THREE." + this.type + ": '" + key + "' is not a property of this material."); + continue; + } + if (currentValue && currentValue.isColor) { + currentValue.set(newValue); + } else if (currentValue && currentValue.isVector3 && (newValue && newValue.isVector3)) { + currentValue.copy(newValue); + } else { + this[key] = newValue; + } + } + } + toJSON(meta) { + const isRootObject = meta === void 0 || typeof meta === "string"; + if (isRootObject) { + meta = { + textures: {}, + images: {} + }; + } + const data = { + metadata: { + version: 4.5, + type: "Material", + generator: "Material.toJSON" + } + }; + data.uuid = this.uuid; + data.type = this.type; + if (this.name !== "") + data.name = this.name; + if (this.color && this.color.isColor) + data.color = this.color.getHex(); + if (this.roughness !== void 0) + data.roughness = this.roughness; + if (this.metalness !== void 0) + data.metalness = this.metalness; + if (this.sheen !== void 0) + data.sheen = this.sheen; + if (this.sheenColor && this.sheenColor.isColor) + data.sheenColor = this.sheenColor.getHex(); + if (this.sheenRoughness !== void 0) + data.sheenRoughness = this.sheenRoughness; + if (this.emissive && this.emissive.isColor) + data.emissive = this.emissive.getHex(); + if (this.emissiveIntensity && this.emissiveIntensity !== 1) + data.emissiveIntensity = this.emissiveIntensity; + if (this.specular && this.specular.isColor) + data.specular = this.specular.getHex(); + if (this.specularIntensity !== void 0) + data.specularIntensity = this.specularIntensity; + if (this.specularColor && this.specularColor.isColor) + data.specularColor = this.specularColor.getHex(); + if (this.shininess !== void 0) + data.shininess = this.shininess; + if (this.clearcoat !== void 0) + data.clearcoat = this.clearcoat; + if (this.clearcoatRoughness !== void 0) + data.clearcoatRoughness = this.clearcoatRoughness; + if (this.clearcoatMap && this.clearcoatMap.isTexture) { + data.clearcoatMap = this.clearcoatMap.toJSON(meta).uuid; + } + if (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) { + data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta).uuid; + } + if (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) { + data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta).uuid; + data.clearcoatNormalScale = this.clearcoatNormalScale.toArray(); + } + if (this.iridescence !== void 0) + data.iridescence = this.iridescence; + if (this.iridescenceIOR !== void 0) + data.iridescenceIOR = this.iridescenceIOR; + if (this.iridescenceThicknessRange !== void 0) + data.iridescenceThicknessRange = this.iridescenceThicknessRange; + if (this.iridescenceMap && this.iridescenceMap.isTexture) { + data.iridescenceMap = this.iridescenceMap.toJSON(meta).uuid; + } + if (this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture) { + data.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(meta).uuid; + } + if (this.map && this.map.isTexture) + data.map = this.map.toJSON(meta).uuid; + if (this.matcap && this.matcap.isTexture) + data.matcap = this.matcap.toJSON(meta).uuid; + if (this.alphaMap && this.alphaMap.isTexture) + data.alphaMap = this.alphaMap.toJSON(meta).uuid; + if (this.lightMap && this.lightMap.isTexture) { + data.lightMap = this.lightMap.toJSON(meta).uuid; + data.lightMapIntensity = this.lightMapIntensity; + } + if (this.aoMap && this.aoMap.isTexture) { + data.aoMap = this.aoMap.toJSON(meta).uuid; + data.aoMapIntensity = this.aoMapIntensity; + } + if (this.bumpMap && this.bumpMap.isTexture) { + data.bumpMap = this.bumpMap.toJSON(meta).uuid; + data.bumpScale = this.bumpScale; + } + if (this.normalMap && this.normalMap.isTexture) { + data.normalMap = this.normalMap.toJSON(meta).uuid; + data.normalMapType = this.normalMapType; + data.normalScale = this.normalScale.toArray(); + } + if (this.displacementMap && this.displacementMap.isTexture) { + data.displacementMap = this.displacementMap.toJSON(meta).uuid; + data.displacementScale = this.displacementScale; + data.displacementBias = this.displacementBias; + } + if (this.roughnessMap && this.roughnessMap.isTexture) + data.roughnessMap = this.roughnessMap.toJSON(meta).uuid; + if (this.metalnessMap && this.metalnessMap.isTexture) + data.metalnessMap = this.metalnessMap.toJSON(meta).uuid; + if (this.emissiveMap && this.emissiveMap.isTexture) + data.emissiveMap = this.emissiveMap.toJSON(meta).uuid; + if (this.specularMap && this.specularMap.isTexture) + data.specularMap = this.specularMap.toJSON(meta).uuid; + if (this.specularIntensityMap && this.specularIntensityMap.isTexture) + data.specularIntensityMap = this.specularIntensityMap.toJSON(meta).uuid; + if (this.specularColorMap && this.specularColorMap.isTexture) + data.specularColorMap = this.specularColorMap.toJSON(meta).uuid; + if (this.envMap && this.envMap.isTexture) { + data.envMap = this.envMap.toJSON(meta).uuid; + if (this.combine !== void 0) + data.combine = this.combine; + } + if (this.envMapIntensity !== void 0) + data.envMapIntensity = this.envMapIntensity; + if (this.reflectivity !== void 0) + data.reflectivity = this.reflectivity; + if (this.refractionRatio !== void 0) + data.refractionRatio = this.refractionRatio; + if (this.gradientMap && this.gradientMap.isTexture) { + data.gradientMap = this.gradientMap.toJSON(meta).uuid; + } + if (this.transmission !== void 0) + data.transmission = this.transmission; + if (this.transmissionMap && this.transmissionMap.isTexture) + data.transmissionMap = this.transmissionMap.toJSON(meta).uuid; + if (this.thickness !== void 0) + data.thickness = this.thickness; + if (this.thicknessMap && this.thicknessMap.isTexture) + data.thicknessMap = this.thicknessMap.toJSON(meta).uuid; + if (this.attenuationDistance !== void 0) + data.attenuationDistance = this.attenuationDistance; + if (this.attenuationColor !== void 0) + data.attenuationColor = this.attenuationColor.getHex(); + if (this.size !== void 0) + data.size = this.size; + if (this.shadowSide !== null) + data.shadowSide = this.shadowSide; + if (this.sizeAttenuation !== void 0) + data.sizeAttenuation = this.sizeAttenuation; + if (this.blending !== NormalBlending) + data.blending = this.blending; + if (this.side !== FrontSide) + data.side = this.side; + if (this.vertexColors) + data.vertexColors = true; + if (this.opacity < 1) + data.opacity = this.opacity; + if (this.transparent === true) + data.transparent = this.transparent; + data.depthFunc = this.depthFunc; + data.depthTest = this.depthTest; + data.depthWrite = this.depthWrite; + data.colorWrite = this.colorWrite; + data.stencilWrite = this.stencilWrite; + data.stencilWriteMask = this.stencilWriteMask; + data.stencilFunc = this.stencilFunc; + data.stencilRef = this.stencilRef; + data.stencilFuncMask = this.stencilFuncMask; + data.stencilFail = this.stencilFail; + data.stencilZFail = this.stencilZFail; + data.stencilZPass = this.stencilZPass; + if (this.rotation !== void 0 && this.rotation !== 0) + data.rotation = this.rotation; + if (this.polygonOffset === true) + data.polygonOffset = true; + if (this.polygonOffsetFactor !== 0) + data.polygonOffsetFactor = this.polygonOffsetFactor; + if (this.polygonOffsetUnits !== 0) + data.polygonOffsetUnits = this.polygonOffsetUnits; + if (this.linewidth !== void 0 && this.linewidth !== 1) + data.linewidth = this.linewidth; + if (this.dashSize !== void 0) + data.dashSize = this.dashSize; + if (this.gapSize !== void 0) + data.gapSize = this.gapSize; + if (this.scale !== void 0) + data.scale = this.scale; + if (this.dithering === true) + data.dithering = true; + if (this.alphaTest > 0) + data.alphaTest = this.alphaTest; + if (this.alphaToCoverage === true) + data.alphaToCoverage = this.alphaToCoverage; + if (this.premultipliedAlpha === true) + data.premultipliedAlpha = this.premultipliedAlpha; + if (this.wireframe === true) + data.wireframe = this.wireframe; + if (this.wireframeLinewidth > 1) + data.wireframeLinewidth = this.wireframeLinewidth; + if (this.wireframeLinecap !== "round") + data.wireframeLinecap = this.wireframeLinecap; + if (this.wireframeLinejoin !== "round") + data.wireframeLinejoin = this.wireframeLinejoin; + if (this.flatShading === true) + data.flatShading = this.flatShading; + if (this.visible === false) + data.visible = false; + if (this.toneMapped === false) + data.toneMapped = false; + if (this.fog === false) + data.fog = false; + if (JSON.stringify(this.userData) !== "{}") + data.userData = this.userData; + function extractFromCache(cache) { + const values = []; + for (const key in cache) { + const data2 = cache[key]; + delete data2.metadata; + values.push(data2); + } + return values; + } + if (isRootObject) { + const textures = extractFromCache(meta.textures); + const images = extractFromCache(meta.images); + if (textures.length > 0) + data.textures = textures; + if (images.length > 0) + data.images = images; + } + return data; + } + clone() { + return new this.constructor().copy(this); + } + copy(source) { + this.name = source.name; + this.blending = source.blending; + this.side = source.side; + this.vertexColors = source.vertexColors; + this.opacity = source.opacity; + this.transparent = source.transparent; + this.blendSrc = source.blendSrc; + this.blendDst = source.blendDst; + this.blendEquation = source.blendEquation; + this.blendSrcAlpha = source.blendSrcAlpha; + this.blendDstAlpha = source.blendDstAlpha; + this.blendEquationAlpha = source.blendEquationAlpha; + this.depthFunc = source.depthFunc; + this.depthTest = source.depthTest; + this.depthWrite = source.depthWrite; + this.stencilWriteMask = source.stencilWriteMask; + this.stencilFunc = source.stencilFunc; + this.stencilRef = source.stencilRef; + this.stencilFuncMask = source.stencilFuncMask; + this.stencilFail = source.stencilFail; + this.stencilZFail = source.stencilZFail; + this.stencilZPass = source.stencilZPass; + this.stencilWrite = source.stencilWrite; + const srcPlanes = source.clippingPlanes; + let dstPlanes = null; + if (srcPlanes !== null) { + const n = srcPlanes.length; + dstPlanes = new Array(n); + for (let i = 0; i !== n; ++i) { + dstPlanes[i] = srcPlanes[i].clone(); + } + } + this.clippingPlanes = dstPlanes; + this.clipIntersection = source.clipIntersection; + this.clipShadows = source.clipShadows; + this.shadowSide = source.shadowSide; + this.colorWrite = source.colorWrite; + this.precision = source.precision; + this.polygonOffset = source.polygonOffset; + this.polygonOffsetFactor = source.polygonOffsetFactor; + this.polygonOffsetUnits = source.polygonOffsetUnits; + this.dithering = source.dithering; + this.alphaTest = source.alphaTest; + this.alphaToCoverage = source.alphaToCoverage; + this.premultipliedAlpha = source.premultipliedAlpha; + this.visible = source.visible; + this.toneMapped = source.toneMapped; + this.userData = JSON.parse(JSON.stringify(source.userData)); + return this; + } + dispose() { + this.dispatchEvent({ type: "dispose" }); + } + set needsUpdate(value) { + if (value === true) + this.version++; + } +}; +var MeshBasicMaterial = class extends Material { + constructor(parameters) { + super(); + this.isMeshBasicMaterial = true; + this.type = "MeshBasicMaterial"; + this.color = new Color(16777215); + this.map = null; + this.lightMap = null; + this.lightMapIntensity = 1; + this.aoMap = null; + this.aoMapIntensity = 1; + this.specularMap = null; + this.alphaMap = null; + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = "round"; + this.wireframeLinejoin = "round"; + this.fog = true; + this.setValues(parameters); + } + copy(source) { + super.copy(source); + this.color.copy(source.color); + this.map = source.map; + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + this.specularMap = source.specularMap; + this.alphaMap = source.alphaMap; + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + this.fog = source.fog; + return this; + } +}; +var _vector$9 = /* @__PURE__ */ new Vector3(); +var _vector2$1 = /* @__PURE__ */ new Vector2(); +var BufferAttribute = class { + constructor(array, itemSize, normalized) { + if (Array.isArray(array)) { + throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); + } + this.isBufferAttribute = true; + this.name = ""; + this.array = array; + this.itemSize = itemSize; + this.count = array !== void 0 ? array.length / itemSize : 0; + this.normalized = normalized === true; + this.usage = StaticDrawUsage; + this.updateRange = { offset: 0, count: -1 }; + this.version = 0; + } + onUploadCallback() { + } + set needsUpdate(value) { + if (value === true) + this.version++; + } + setUsage(value) { + this.usage = value; + return this; + } + copy(source) { + this.name = source.name; + this.array = new source.array.constructor(source.array); + this.itemSize = source.itemSize; + this.count = source.count; + this.normalized = source.normalized; + this.usage = source.usage; + return this; + } + copyAt(index1, attribute, index22) { + index1 *= this.itemSize; + index22 *= attribute.itemSize; + for (let i = 0, l = this.itemSize; i < l; i++) { + this.array[index1 + i] = attribute.array[index22 + i]; + } + return this; + } + copyArray(array) { + this.array.set(array); + return this; + } + copyColorsArray(colors) { + const array = this.array; + let offset = 0; + for (let i = 0, l = colors.length; i < l; i++) { + let color = colors[i]; + if (color === void 0) { + console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", i); + color = new Color(); + } + array[offset++] = color.r; + array[offset++] = color.g; + array[offset++] = color.b; + } + return this; + } + copyVector2sArray(vectors) { + const array = this.array; + let offset = 0; + for (let i = 0, l = vectors.length; i < l; i++) { + let vector = vectors[i]; + if (vector === void 0) { + console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", i); + vector = new Vector2(); + } + array[offset++] = vector.x; + array[offset++] = vector.y; + } + return this; + } + copyVector3sArray(vectors) { + const array = this.array; + let offset = 0; + for (let i = 0, l = vectors.length; i < l; i++) { + let vector = vectors[i]; + if (vector === void 0) { + console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", i); + vector = new Vector3(); + } + array[offset++] = vector.x; + array[offset++] = vector.y; + array[offset++] = vector.z; + } + return this; + } + copyVector4sArray(vectors) { + const array = this.array; + let offset = 0; + for (let i = 0, l = vectors.length; i < l; i++) { + let vector = vectors[i]; + if (vector === void 0) { + console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", i); + vector = new Vector4(); + } + array[offset++] = vector.x; + array[offset++] = vector.y; + array[offset++] = vector.z; + array[offset++] = vector.w; + } + return this; + } + applyMatrix3(m2) { + if (this.itemSize === 2) { + for (let i = 0, l = this.count; i < l; i++) { + _vector2$1.fromBufferAttribute(this, i); + _vector2$1.applyMatrix3(m2); + this.setXY(i, _vector2$1.x, _vector2$1.y); + } + } else if (this.itemSize === 3) { + for (let i = 0, l = this.count; i < l; i++) { + _vector$9.fromBufferAttribute(this, i); + _vector$9.applyMatrix3(m2); + this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); + } + } + return this; + } + applyMatrix4(m2) { + for (let i = 0, l = this.count; i < l; i++) { + _vector$9.fromBufferAttribute(this, i); + _vector$9.applyMatrix4(m2); + this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); + } + return this; + } + applyNormalMatrix(m2) { + for (let i = 0, l = this.count; i < l; i++) { + _vector$9.fromBufferAttribute(this, i); + _vector$9.applyNormalMatrix(m2); + this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); + } + return this; + } + transformDirection(m2) { + for (let i = 0, l = this.count; i < l; i++) { + _vector$9.fromBufferAttribute(this, i); + _vector$9.transformDirection(m2); + this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); + } + return this; + } + set(value, offset = 0) { + this.array.set(value, offset); + return this; + } + getX(index5) { + return this.array[index5 * this.itemSize]; + } + setX(index5, x2) { + this.array[index5 * this.itemSize] = x2; + return this; + } + getY(index5) { + return this.array[index5 * this.itemSize + 1]; + } + setY(index5, y2) { + this.array[index5 * this.itemSize + 1] = y2; + return this; + } + getZ(index5) { + return this.array[index5 * this.itemSize + 2]; + } + setZ(index5, z2) { + this.array[index5 * this.itemSize + 2] = z2; + return this; + } + getW(index5) { + return this.array[index5 * this.itemSize + 3]; + } + setW(index5, w) { + this.array[index5 * this.itemSize + 3] = w; + return this; + } + setXY(index5, x2, y2) { + index5 *= this.itemSize; + this.array[index5 + 0] = x2; + this.array[index5 + 1] = y2; + return this; + } + setXYZ(index5, x2, y2, z2) { + index5 *= this.itemSize; + this.array[index5 + 0] = x2; + this.array[index5 + 1] = y2; + this.array[index5 + 2] = z2; + return this; + } + setXYZW(index5, x2, y2, z2, w) { + index5 *= this.itemSize; + this.array[index5 + 0] = x2; + this.array[index5 + 1] = y2; + this.array[index5 + 2] = z2; + this.array[index5 + 3] = w; + return this; + } + onUpload(callback) { + this.onUploadCallback = callback; + return this; + } + clone() { + return new this.constructor(this.array, this.itemSize).copy(this); + } + toJSON() { + const data = { + itemSize: this.itemSize, + type: this.array.constructor.name, + array: Array.from(this.array), + normalized: this.normalized + }; + if (this.name !== "") + data.name = this.name; + if (this.usage !== StaticDrawUsage) + data.usage = this.usage; + if (this.updateRange.offset !== 0 || this.updateRange.count !== -1) + data.updateRange = this.updateRange; + return data; + } +}; +var Uint16BufferAttribute = class extends BufferAttribute { + constructor(array, itemSize, normalized) { + super(new Uint16Array(array), itemSize, normalized); + } +}; +var Uint32BufferAttribute = class extends BufferAttribute { + constructor(array, itemSize, normalized) { + super(new Uint32Array(array), itemSize, normalized); + } +}; +var Float32BufferAttribute = class extends BufferAttribute { + constructor(array, itemSize, normalized) { + super(new Float32Array(array), itemSize, normalized); + } +}; +var _id$1 = 0; +var _m1 = /* @__PURE__ */ new Matrix4(); +var _obj = /* @__PURE__ */ new Object3D(); +var _offset = /* @__PURE__ */ new Vector3(); +var _box$1 = /* @__PURE__ */ new Box3(); +var _boxMorphTargets = /* @__PURE__ */ new Box3(); +var _vector$8 = /* @__PURE__ */ new Vector3(); +var BufferGeometry = class extends EventDispatcher { + constructor() { + super(); + this.isBufferGeometry = true; + Object.defineProperty(this, "id", { value: _id$1++ }); + this.uuid = generateUUID(); + this.name = ""; + this.type = "BufferGeometry"; + this.index = null; + this.attributes = {}; + this.morphAttributes = {}; + this.morphTargetsRelative = false; + this.groups = []; + this.boundingBox = null; + this.boundingSphere = null; + this.drawRange = { start: 0, count: Infinity }; + this.userData = {}; + } + getIndex() { + return this.index; + } + setIndex(index5) { + if (Array.isArray(index5)) { + this.index = new (arrayNeedsUint32(index5) ? Uint32BufferAttribute : Uint16BufferAttribute)(index5, 1); + } else { + this.index = index5; + } + return this; + } + getAttribute(name) { + return this.attributes[name]; + } + setAttribute(name, attribute) { + this.attributes[name] = attribute; + return this; + } + deleteAttribute(name) { + delete this.attributes[name]; + return this; + } + hasAttribute(name) { + return this.attributes[name] !== void 0; + } + addGroup(start, count, materialIndex = 0) { + this.groups.push({ + start, + count, + materialIndex + }); + } + clearGroups() { + this.groups = []; + } + setDrawRange(start, count) { + this.drawRange.start = start; + this.drawRange.count = count; + } + applyMatrix4(matrix) { + const position = this.attributes.position; + if (position !== void 0) { + position.applyMatrix4(matrix); + position.needsUpdate = true; + } + const normal = this.attributes.normal; + if (normal !== void 0) { + const normalMatrix = new Matrix3().getNormalMatrix(matrix); + normal.applyNormalMatrix(normalMatrix); + normal.needsUpdate = true; + } + const tangent = this.attributes.tangent; + if (tangent !== void 0) { + tangent.transformDirection(matrix); + tangent.needsUpdate = true; + } + if (this.boundingBox !== null) { + this.computeBoundingBox(); + } + if (this.boundingSphere !== null) { + this.computeBoundingSphere(); + } + return this; + } + applyQuaternion(q) { + _m1.makeRotationFromQuaternion(q); + this.applyMatrix4(_m1); + return this; + } + rotateX(angle) { + _m1.makeRotationX(angle); + this.applyMatrix4(_m1); + return this; + } + rotateY(angle) { + _m1.makeRotationY(angle); + this.applyMatrix4(_m1); + return this; + } + rotateZ(angle) { + _m1.makeRotationZ(angle); + this.applyMatrix4(_m1); + return this; + } + translate(x2, y2, z2) { + _m1.makeTranslation(x2, y2, z2); + this.applyMatrix4(_m1); + return this; + } + scale(x2, y2, z2) { + _m1.makeScale(x2, y2, z2); + this.applyMatrix4(_m1); + return this; + } + lookAt(vector) { + _obj.lookAt(vector); + _obj.updateMatrix(); + this.applyMatrix4(_obj.matrix); + return this; + } + center() { + this.computeBoundingBox(); + this.boundingBox.getCenter(_offset).negate(); + this.translate(_offset.x, _offset.y, _offset.z); + return this; + } + setFromPoints(points) { + const position = []; + for (let i = 0, l = points.length; i < l; i++) { + const point = points[i]; + position.push(point.x, point.y, point.z || 0); + } + this.setAttribute("position", new Float32BufferAttribute(position, 3)); + return this; + } + computeBoundingBox() { + if (this.boundingBox === null) { + this.boundingBox = new Box3(); + } + const position = this.attributes.position; + const morphAttributesPosition = this.morphAttributes.position; + if (position && position.isGLBufferAttribute) { + console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this); + this.boundingBox.set(new Vector3(-Infinity, -Infinity, -Infinity), new Vector3(Infinity, Infinity, Infinity)); + return; + } + if (position !== void 0) { + this.boundingBox.setFromBufferAttribute(position); + if (morphAttributesPosition) { + for (let i = 0, il = morphAttributesPosition.length; i < il; i++) { + const morphAttribute = morphAttributesPosition[i]; + _box$1.setFromBufferAttribute(morphAttribute); + if (this.morphTargetsRelative) { + _vector$8.addVectors(this.boundingBox.min, _box$1.min); + this.boundingBox.expandByPoint(_vector$8); + _vector$8.addVectors(this.boundingBox.max, _box$1.max); + this.boundingBox.expandByPoint(_vector$8); + } else { + this.boundingBox.expandByPoint(_box$1.min); + this.boundingBox.expandByPoint(_box$1.max); + } + } + } + } else { + this.boundingBox.makeEmpty(); + } + if (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) { + console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this); + } + } + computeBoundingSphere() { + if (this.boundingSphere === null) { + this.boundingSphere = new Sphere(); + } + const position = this.attributes.position; + const morphAttributesPosition = this.morphAttributes.position; + if (position && position.isGLBufferAttribute) { + console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this); + this.boundingSphere.set(new Vector3(), Infinity); + return; + } + if (position) { + const center = this.boundingSphere.center; + _box$1.setFromBufferAttribute(position); + if (morphAttributesPosition) { + for (let i = 0, il = morphAttributesPosition.length; i < il; i++) { + const morphAttribute = morphAttributesPosition[i]; + _boxMorphTargets.setFromBufferAttribute(morphAttribute); + if (this.morphTargetsRelative) { + _vector$8.addVectors(_box$1.min, _boxMorphTargets.min); + _box$1.expandByPoint(_vector$8); + _vector$8.addVectors(_box$1.max, _boxMorphTargets.max); + _box$1.expandByPoint(_vector$8); + } else { + _box$1.expandByPoint(_boxMorphTargets.min); + _box$1.expandByPoint(_boxMorphTargets.max); + } + } + } + _box$1.getCenter(center); + let maxRadiusSq = 0; + for (let i = 0, il = position.count; i < il; i++) { + _vector$8.fromBufferAttribute(position, i); + maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8)); + } + if (morphAttributesPosition) { + for (let i = 0, il = morphAttributesPosition.length; i < il; i++) { + const morphAttribute = morphAttributesPosition[i]; + const morphTargetsRelative = this.morphTargetsRelative; + for (let j = 0, jl = morphAttribute.count; j < jl; j++) { + _vector$8.fromBufferAttribute(morphAttribute, j); + if (morphTargetsRelative) { + _offset.fromBufferAttribute(position, j); + _vector$8.add(_offset); + } + maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8)); + } + } + } + this.boundingSphere.radius = Math.sqrt(maxRadiusSq); + if (isNaN(this.boundingSphere.radius)) { + console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this); + } + } + } + computeTangents() { + const index5 = this.index; + const attributes = this.attributes; + if (index5 === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) { + console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)"); + return; + } + const indices = index5.array; + const positions = attributes.position.array; + const normals = attributes.normal.array; + const uvs = attributes.uv.array; + const nVertices = positions.length / 3; + if (this.hasAttribute("tangent") === false) { + this.setAttribute("tangent", new BufferAttribute(new Float32Array(4 * nVertices), 4)); + } + const tangents = this.getAttribute("tangent").array; + const tan1 = [], tan2 = []; + for (let i = 0; i < nVertices; i++) { + tan1[i] = new Vector3(); + tan2[i] = new Vector3(); + } + const vA = new Vector3(), vB = new Vector3(), vC = new Vector3(), uvA = new Vector2(), uvB = new Vector2(), uvC = new Vector2(), sdir = new Vector3(), tdir = new Vector3(); + function handleTriangle(a2, b, c2) { + vA.fromArray(positions, a2 * 3); + vB.fromArray(positions, b * 3); + vC.fromArray(positions, c2 * 3); + uvA.fromArray(uvs, a2 * 2); + uvB.fromArray(uvs, b * 2); + uvC.fromArray(uvs, c2 * 2); + vB.sub(vA); + vC.sub(vA); + uvB.sub(uvA); + uvC.sub(uvA); + const r = 1 / (uvB.x * uvC.y - uvC.x * uvB.y); + if (!isFinite(r)) + return; + sdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r); + tdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r); + tan1[a2].add(sdir); + tan1[b].add(sdir); + tan1[c2].add(sdir); + tan2[a2].add(tdir); + tan2[b].add(tdir); + tan2[c2].add(tdir); + } + let groups = this.groups; + if (groups.length === 0) { + groups = [{ + start: 0, + count: indices.length + }]; + } + for (let i = 0, il = groups.length; i < il; ++i) { + const group = groups[i]; + const start = group.start; + const count = group.count; + for (let j = start, jl = start + count; j < jl; j += 3) { + handleTriangle(indices[j + 0], indices[j + 1], indices[j + 2]); + } + } + const tmp2 = new Vector3(), tmp22 = new Vector3(); + const n = new Vector3(), n2 = new Vector3(); + function handleVertex(v) { + n.fromArray(normals, v * 3); + n2.copy(n); + const t = tan1[v]; + tmp2.copy(t); + tmp2.sub(n.multiplyScalar(n.dot(t))).normalize(); + tmp22.crossVectors(n2, t); + const test = tmp22.dot(tan2[v]); + const w = test < 0 ? -1 : 1; + tangents[v * 4] = tmp2.x; + tangents[v * 4 + 1] = tmp2.y; + tangents[v * 4 + 2] = tmp2.z; + tangents[v * 4 + 3] = w; + } + for (let i = 0, il = groups.length; i < il; ++i) { + const group = groups[i]; + const start = group.start; + const count = group.count; + for (let j = start, jl = start + count; j < jl; j += 3) { + handleVertex(indices[j + 0]); + handleVertex(indices[j + 1]); + handleVertex(indices[j + 2]); + } + } + } + computeVertexNormals() { + const index5 = this.index; + const positionAttribute = this.getAttribute("position"); + if (positionAttribute !== void 0) { + let normalAttribute = this.getAttribute("normal"); + if (normalAttribute === void 0) { + normalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3); + this.setAttribute("normal", normalAttribute); + } else { + for (let i = 0, il = normalAttribute.count; i < il; i++) { + normalAttribute.setXYZ(i, 0, 0, 0); + } + } + const pA = new Vector3(), pB = new Vector3(), pC = new Vector3(); + const nA = new Vector3(), nB = new Vector3(), nC = new Vector3(); + const cb = new Vector3(), ab = new Vector3(); + if (index5) { + for (let i = 0, il = index5.count; i < il; i += 3) { + const vA = index5.getX(i + 0); + const vB = index5.getX(i + 1); + const vC = index5.getX(i + 2); + pA.fromBufferAttribute(positionAttribute, vA); + pB.fromBufferAttribute(positionAttribute, vB); + pC.fromBufferAttribute(positionAttribute, vC); + cb.subVectors(pC, pB); + ab.subVectors(pA, pB); + cb.cross(ab); + nA.fromBufferAttribute(normalAttribute, vA); + nB.fromBufferAttribute(normalAttribute, vB); + nC.fromBufferAttribute(normalAttribute, vC); + nA.add(cb); + nB.add(cb); + nC.add(cb); + normalAttribute.setXYZ(vA, nA.x, nA.y, nA.z); + normalAttribute.setXYZ(vB, nB.x, nB.y, nB.z); + normalAttribute.setXYZ(vC, nC.x, nC.y, nC.z); + } + } else { + for (let i = 0, il = positionAttribute.count; i < il; i += 3) { + pA.fromBufferAttribute(positionAttribute, i + 0); + pB.fromBufferAttribute(positionAttribute, i + 1); + pC.fromBufferAttribute(positionAttribute, i + 2); + cb.subVectors(pC, pB); + ab.subVectors(pA, pB); + cb.cross(ab); + normalAttribute.setXYZ(i + 0, cb.x, cb.y, cb.z); + normalAttribute.setXYZ(i + 1, cb.x, cb.y, cb.z); + normalAttribute.setXYZ(i + 2, cb.x, cb.y, cb.z); + } + } + this.normalizeNormals(); + normalAttribute.needsUpdate = true; + } + } + merge(geometry, offset) { + if (!(geometry && geometry.isBufferGeometry)) { + console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", geometry); + return; + } + if (offset === void 0) { + offset = 0; + console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."); + } + const attributes = this.attributes; + for (const key in attributes) { + if (geometry.attributes[key] === void 0) + continue; + const attribute1 = attributes[key]; + const attributeArray1 = attribute1.array; + const attribute2 = geometry.attributes[key]; + const attributeArray2 = attribute2.array; + const attributeOffset = attribute2.itemSize * offset; + const length = Math.min(attributeArray2.length, attributeArray1.length - attributeOffset); + for (let i = 0, j = attributeOffset; i < length; i++, j++) { + attributeArray1[j] = attributeArray2[i]; + } + } + return this; + } + normalizeNormals() { + const normals = this.attributes.normal; + for (let i = 0, il = normals.count; i < il; i++) { + _vector$8.fromBufferAttribute(normals, i); + _vector$8.normalize(); + normals.setXYZ(i, _vector$8.x, _vector$8.y, _vector$8.z); + } + } + toNonIndexed() { + function convertBufferAttribute(attribute, indices2) { + const array = attribute.array; + const itemSize = attribute.itemSize; + const normalized = attribute.normalized; + const array2 = new array.constructor(indices2.length * itemSize); + let index5 = 0, index22 = 0; + for (let i = 0, l = indices2.length; i < l; i++) { + if (attribute.isInterleavedBufferAttribute) { + index5 = indices2[i] * attribute.data.stride + attribute.offset; + } else { + index5 = indices2[i] * itemSize; + } + for (let j = 0; j < itemSize; j++) { + array2[index22++] = array[index5++]; + } + } + return new BufferAttribute(array2, itemSize, normalized); + } + if (this.index === null) { + console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."); + return this; + } + const geometry2 = new BufferGeometry(); + const indices = this.index.array; + const attributes = this.attributes; + for (const name in attributes) { + const attribute = attributes[name]; + const newAttribute = convertBufferAttribute(attribute, indices); + geometry2.setAttribute(name, newAttribute); + } + const morphAttributes = this.morphAttributes; + for (const name in morphAttributes) { + const morphArray = []; + const morphAttribute = morphAttributes[name]; + for (let i = 0, il = morphAttribute.length; i < il; i++) { + const attribute = morphAttribute[i]; + const newAttribute = convertBufferAttribute(attribute, indices); + morphArray.push(newAttribute); + } + geometry2.morphAttributes[name] = morphArray; + } + geometry2.morphTargetsRelative = this.morphTargetsRelative; + const groups = this.groups; + for (let i = 0, l = groups.length; i < l; i++) { + const group = groups[i]; + geometry2.addGroup(group.start, group.count, group.materialIndex); + } + return geometry2; + } + toJSON() { + const data = { + metadata: { + version: 4.5, + type: "BufferGeometry", + generator: "BufferGeometry.toJSON" + } + }; + data.uuid = this.uuid; + data.type = this.type; + if (this.name !== "") + data.name = this.name; + if (Object.keys(this.userData).length > 0) + data.userData = this.userData; + if (this.parameters !== void 0) { + const parameters = this.parameters; + for (const key in parameters) { + if (parameters[key] !== void 0) + data[key] = parameters[key]; + } + return data; + } + data.data = { attributes: {} }; + const index5 = this.index; + if (index5 !== null) { + data.data.index = { + type: index5.array.constructor.name, + array: Array.prototype.slice.call(index5.array) + }; + } + const attributes = this.attributes; + for (const key in attributes) { + const attribute = attributes[key]; + data.data.attributes[key] = attribute.toJSON(data.data); + } + const morphAttributes = {}; + let hasMorphAttributes = false; + for (const key in this.morphAttributes) { + const attributeArray = this.morphAttributes[key]; + const array = []; + for (let i = 0, il = attributeArray.length; i < il; i++) { + const attribute = attributeArray[i]; + array.push(attribute.toJSON(data.data)); + } + if (array.length > 0) { + morphAttributes[key] = array; + hasMorphAttributes = true; + } + } + if (hasMorphAttributes) { + data.data.morphAttributes = morphAttributes; + data.data.morphTargetsRelative = this.morphTargetsRelative; + } + const groups = this.groups; + if (groups.length > 0) { + data.data.groups = JSON.parse(JSON.stringify(groups)); + } + const boundingSphere = this.boundingSphere; + if (boundingSphere !== null) { + data.data.boundingSphere = { + center: boundingSphere.center.toArray(), + radius: boundingSphere.radius + }; + } + return data; + } + clone() { + return new this.constructor().copy(this); + } + copy(source) { + this.index = null; + this.attributes = {}; + this.morphAttributes = {}; + this.groups = []; + this.boundingBox = null; + this.boundingSphere = null; + const data = {}; + this.name = source.name; + const index5 = source.index; + if (index5 !== null) { + this.setIndex(index5.clone(data)); + } + const attributes = source.attributes; + for (const name in attributes) { + const attribute = attributes[name]; + this.setAttribute(name, attribute.clone(data)); + } + const morphAttributes = source.morphAttributes; + for (const name in morphAttributes) { + const array = []; + const morphAttribute = morphAttributes[name]; + for (let i = 0, l = morphAttribute.length; i < l; i++) { + array.push(morphAttribute[i].clone(data)); + } + this.morphAttributes[name] = array; + } + this.morphTargetsRelative = source.morphTargetsRelative; + const groups = source.groups; + for (let i = 0, l = groups.length; i < l; i++) { + const group = groups[i]; + this.addGroup(group.start, group.count, group.materialIndex); + } + const boundingBox = source.boundingBox; + if (boundingBox !== null) { + this.boundingBox = boundingBox.clone(); + } + const boundingSphere = source.boundingSphere; + if (boundingSphere !== null) { + this.boundingSphere = boundingSphere.clone(); + } + this.drawRange.start = source.drawRange.start; + this.drawRange.count = source.drawRange.count; + this.userData = source.userData; + if (source.parameters !== void 0) + this.parameters = Object.assign({}, source.parameters); + return this; + } + dispose() { + this.dispatchEvent({ type: "dispose" }); + } +}; +var _inverseMatrix$2 = /* @__PURE__ */ new Matrix4(); +var _ray$2 = /* @__PURE__ */ new Ray(); +var _sphere$3 = /* @__PURE__ */ new Sphere(); +var _vA$1 = /* @__PURE__ */ new Vector3(); +var _vB$1 = /* @__PURE__ */ new Vector3(); +var _vC$1 = /* @__PURE__ */ new Vector3(); +var _tempA = /* @__PURE__ */ new Vector3(); +var _tempB = /* @__PURE__ */ new Vector3(); +var _tempC = /* @__PURE__ */ new Vector3(); +var _morphA = /* @__PURE__ */ new Vector3(); +var _morphB = /* @__PURE__ */ new Vector3(); +var _morphC = /* @__PURE__ */ new Vector3(); +var _uvA$1 = /* @__PURE__ */ new Vector2(); +var _uvB$1 = /* @__PURE__ */ new Vector2(); +var _uvC$1 = /* @__PURE__ */ new Vector2(); +var _intersectionPoint = /* @__PURE__ */ new Vector3(); +var _intersectionPointWorld = /* @__PURE__ */ new Vector3(); +var Mesh = class extends Object3D { + constructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) { + super(); + this.isMesh = true; + this.type = "Mesh"; + this.geometry = geometry; + this.material = material; + this.updateMorphTargets(); + } + copy(source, recursive) { + super.copy(source, recursive); + if (source.morphTargetInfluences !== void 0) { + this.morphTargetInfluences = source.morphTargetInfluences.slice(); + } + if (source.morphTargetDictionary !== void 0) { + this.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary); + } + this.material = source.material; + this.geometry = source.geometry; + return this; + } + updateMorphTargets() { + const geometry = this.geometry; + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys(morphAttributes); + if (keys.length > 0) { + const morphAttribute = morphAttributes[keys[0]]; + if (morphAttribute !== void 0) { + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; + for (let m2 = 0, ml = morphAttribute.length; m2 < ml; m2++) { + const name = morphAttribute[m2].name || String(m2); + this.morphTargetInfluences.push(0); + this.morphTargetDictionary[name] = m2; + } + } + } + } + raycast(raycaster, intersects) { + const geometry = this.geometry; + const material = this.material; + const matrixWorld = this.matrixWorld; + if (material === void 0) + return; + if (geometry.boundingSphere === null) + geometry.computeBoundingSphere(); + _sphere$3.copy(geometry.boundingSphere); + _sphere$3.applyMatrix4(matrixWorld); + if (raycaster.ray.intersectsSphere(_sphere$3) === false) + return; + _inverseMatrix$2.copy(matrixWorld).invert(); + _ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2); + if (geometry.boundingBox !== null) { + if (_ray$2.intersectsBox(geometry.boundingBox) === false) + return; + } + let intersection; + const index5 = geometry.index; + const position = geometry.attributes.position; + const morphPosition = geometry.morphAttributes.position; + const morphTargetsRelative = geometry.morphTargetsRelative; + const uv = geometry.attributes.uv; + const uv2 = geometry.attributes.uv2; + const groups = geometry.groups; + const drawRange = geometry.drawRange; + if (index5 !== null) { + if (Array.isArray(material)) { + for (let i = 0, il = groups.length; i < il; i++) { + const group = groups[i]; + const groupMaterial = material[group.materialIndex]; + const start = Math.max(group.start, drawRange.start); + const end = Math.min(index5.count, Math.min(group.start + group.count, drawRange.start + drawRange.count)); + for (let j = start, jl = end; j < jl; j += 3) { + const a2 = index5.getX(j); + const b = index5.getX(j + 1); + const c2 = index5.getX(j + 2); + intersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c2); + if (intersection) { + intersection.faceIndex = Math.floor(j / 3); + intersection.face.materialIndex = group.materialIndex; + intersects.push(intersection); + } + } + } + } else { + const start = Math.max(0, drawRange.start); + const end = Math.min(index5.count, drawRange.start + drawRange.count); + for (let i = start, il = end; i < il; i += 3) { + const a2 = index5.getX(i); + const b = index5.getX(i + 1); + const c2 = index5.getX(i + 2); + intersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c2); + if (intersection) { + intersection.faceIndex = Math.floor(i / 3); + intersects.push(intersection); + } + } + } + } else if (position !== void 0) { + if (Array.isArray(material)) { + for (let i = 0, il = groups.length; i < il; i++) { + const group = groups[i]; + const groupMaterial = material[group.materialIndex]; + const start = Math.max(group.start, drawRange.start); + const end = Math.min(position.count, Math.min(group.start + group.count, drawRange.start + drawRange.count)); + for (let j = start, jl = end; j < jl; j += 3) { + const a2 = j; + const b = j + 1; + const c2 = j + 2; + intersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c2); + if (intersection) { + intersection.faceIndex = Math.floor(j / 3); + intersection.face.materialIndex = group.materialIndex; + intersects.push(intersection); + } + } + } + } else { + const start = Math.max(0, drawRange.start); + const end = Math.min(position.count, drawRange.start + drawRange.count); + for (let i = start, il = end; i < il; i += 3) { + const a2 = i; + const b = i + 1; + const c2 = i + 2; + intersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c2); + if (intersection) { + intersection.faceIndex = Math.floor(i / 3); + intersects.push(intersection); + } + } + } + } + } +}; +function checkIntersection(object, material, raycaster, ray, pA, pB, pC, point) { + let intersect; + if (material.side === BackSide) { + intersect = ray.intersectTriangle(pC, pB, pA, true, point); + } else { + intersect = ray.intersectTriangle(pA, pB, pC, material.side !== DoubleSide, point); + } + if (intersect === null) + return null; + _intersectionPointWorld.copy(point); + _intersectionPointWorld.applyMatrix4(object.matrixWorld); + const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld); + if (distance < raycaster.near || distance > raycaster.far) + return null; + return { + distance, + point: _intersectionPointWorld.clone(), + object + }; +} +function checkBufferGeometryIntersection(object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c2) { + _vA$1.fromBufferAttribute(position, a2); + _vB$1.fromBufferAttribute(position, b); + _vC$1.fromBufferAttribute(position, c2); + const morphInfluences = object.morphTargetInfluences; + if (morphPosition && morphInfluences) { + _morphA.set(0, 0, 0); + _morphB.set(0, 0, 0); + _morphC.set(0, 0, 0); + for (let i = 0, il = morphPosition.length; i < il; i++) { + const influence = morphInfluences[i]; + const morphAttribute = morphPosition[i]; + if (influence === 0) + continue; + _tempA.fromBufferAttribute(morphAttribute, a2); + _tempB.fromBufferAttribute(morphAttribute, b); + _tempC.fromBufferAttribute(morphAttribute, c2); + if (morphTargetsRelative) { + _morphA.addScaledVector(_tempA, influence); + _morphB.addScaledVector(_tempB, influence); + _morphC.addScaledVector(_tempC, influence); + } else { + _morphA.addScaledVector(_tempA.sub(_vA$1), influence); + _morphB.addScaledVector(_tempB.sub(_vB$1), influence); + _morphC.addScaledVector(_tempC.sub(_vC$1), influence); + } + } + _vA$1.add(_morphA); + _vB$1.add(_morphB); + _vC$1.add(_morphC); + } + if (object.isSkinnedMesh) { + object.boneTransform(a2, _vA$1); + object.boneTransform(b, _vB$1); + object.boneTransform(c2, _vC$1); + } + const intersection = checkIntersection(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint); + if (intersection) { + if (uv) { + _uvA$1.fromBufferAttribute(uv, a2); + _uvB$1.fromBufferAttribute(uv, b); + _uvC$1.fromBufferAttribute(uv, c2); + intersection.uv = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2()); + } + if (uv2) { + _uvA$1.fromBufferAttribute(uv2, a2); + _uvB$1.fromBufferAttribute(uv2, b); + _uvC$1.fromBufferAttribute(uv2, c2); + intersection.uv2 = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2()); + } + const face = { + a: a2, + b, + c: c2, + normal: new Vector3(), + materialIndex: 0 + }; + Triangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal); + intersection.face = face; + } + return intersection; +} +var BoxGeometry = class extends BufferGeometry { + constructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) { + super(); + this.type = "BoxGeometry"; + this.parameters = { + width, + height, + depth, + widthSegments, + heightSegments, + depthSegments + }; + const scope = this; + widthSegments = Math.floor(widthSegments); + heightSegments = Math.floor(heightSegments); + depthSegments = Math.floor(depthSegments); + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + let numberOfVertices = 0; + let groupStart = 0; + buildPlane("z", "y", "x", -1, -1, depth, height, width, depthSegments, heightSegments, 0); + buildPlane("z", "y", "x", 1, -1, depth, height, -width, depthSegments, heightSegments, 1); + buildPlane("x", "z", "y", 1, 1, width, depth, height, widthSegments, depthSegments, 2); + buildPlane("x", "z", "y", 1, -1, width, depth, -height, widthSegments, depthSegments, 3); + buildPlane("x", "y", "z", 1, -1, width, height, depth, widthSegments, heightSegments, 4); + buildPlane("x", "y", "z", -1, -1, width, height, -depth, widthSegments, heightSegments, 5); + this.setIndex(indices); + this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); + this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); + this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); + function buildPlane(u, v, w, udir, vdir, width2, height2, depth2, gridX, gridY, materialIndex) { + const segmentWidth = width2 / gridX; + const segmentHeight = height2 / gridY; + const widthHalf = width2 / 2; + const heightHalf = height2 / 2; + const depthHalf = depth2 / 2; + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; + let vertexCounter = 0; + let groupCount = 0; + const vector = new Vector3(); + for (let iy = 0; iy < gridY1; iy++) { + const y2 = iy * segmentHeight - heightHalf; + for (let ix = 0; ix < gridX1; ix++) { + const x2 = ix * segmentWidth - widthHalf; + vector[u] = x2 * udir; + vector[v] = y2 * vdir; + vector[w] = depthHalf; + vertices.push(vector.x, vector.y, vector.z); + vector[u] = 0; + vector[v] = 0; + vector[w] = depth2 > 0 ? 1 : -1; + normals.push(vector.x, vector.y, vector.z); + uvs.push(ix / gridX); + uvs.push(1 - iy / gridY); + vertexCounter += 1; + } + } + for (let iy = 0; iy < gridY; iy++) { + for (let ix = 0; ix < gridX; ix++) { + const a2 = numberOfVertices + ix + gridX1 * iy; + const b = numberOfVertices + ix + gridX1 * (iy + 1); + const c2 = numberOfVertices + (ix + 1) + gridX1 * (iy + 1); + const d = numberOfVertices + (ix + 1) + gridX1 * iy; + indices.push(a2, b, d); + indices.push(b, c2, d); + groupCount += 6; + } + } + scope.addGroup(groupStart, groupCount, materialIndex); + groupStart += groupCount; + numberOfVertices += vertexCounter; + } + } + static fromJSON(data) { + return new BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments); + } +}; +function cloneUniforms(src) { + const dst = {}; + for (const u in src) { + dst[u] = {}; + for (const p in src[u]) { + const property = src[u][p]; + if (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) { + dst[u][p] = property.clone(); + } else if (Array.isArray(property)) { + dst[u][p] = property.slice(); + } else { + dst[u][p] = property; + } + } + } + return dst; +} +function mergeUniforms(uniforms) { + const merged = {}; + for (let u = 0; u < uniforms.length; u++) { + const tmp2 = cloneUniforms(uniforms[u]); + for (const p in tmp2) { + merged[p] = tmp2[p]; + } + } + return merged; +} +function cloneUniformsGroups(src) { + const dst = []; + for (let u = 0; u < src.length; u++) { + dst.push(src[u].clone()); + } + return dst; +} +var UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms }; +var default_vertex = "void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"; +var default_fragment = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"; +var ShaderMaterial = class extends Material { + constructor(parameters) { + super(); + this.isShaderMaterial = true; + this.type = "ShaderMaterial"; + this.defines = {}; + this.uniforms = {}; + this.uniformsGroups = []; + this.vertexShader = default_vertex; + this.fragmentShader = default_fragment; + this.linewidth = 1; + this.wireframe = false; + this.wireframeLinewidth = 1; + this.fog = false; + this.lights = false; + this.clipping = false; + this.extensions = { + derivatives: false, + fragDepth: false, + drawBuffers: false, + shaderTextureLOD: false + }; + this.defaultAttributeValues = { + "color": [1, 1, 1], + "uv": [0, 0], + "uv2": [0, 0] + }; + this.index0AttributeName = void 0; + this.uniformsNeedUpdate = false; + this.glslVersion = null; + if (parameters !== void 0) { + if (parameters.attributes !== void 0) { + console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."); + } + this.setValues(parameters); + } + } + copy(source) { + super.copy(source); + this.fragmentShader = source.fragmentShader; + this.vertexShader = source.vertexShader; + this.uniforms = cloneUniforms(source.uniforms); + this.uniformsGroups = cloneUniformsGroups(source.uniformsGroups); + this.defines = Object.assign({}, source.defines); + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.fog = source.fog; + this.lights = source.lights; + this.clipping = source.clipping; + this.extensions = Object.assign({}, source.extensions); + this.glslVersion = source.glslVersion; + return this; + } + toJSON(meta) { + const data = super.toJSON(meta); + data.glslVersion = this.glslVersion; + data.uniforms = {}; + for (const name in this.uniforms) { + const uniform = this.uniforms[name]; + const value = uniform.value; + if (value && value.isTexture) { + data.uniforms[name] = { + type: "t", + value: value.toJSON(meta).uuid + }; + } else if (value && value.isColor) { + data.uniforms[name] = { + type: "c", + value: value.getHex() + }; + } else if (value && value.isVector2) { + data.uniforms[name] = { + type: "v2", + value: value.toArray() + }; + } else if (value && value.isVector3) { + data.uniforms[name] = { + type: "v3", + value: value.toArray() + }; + } else if (value && value.isVector4) { + data.uniforms[name] = { + type: "v4", + value: value.toArray() + }; + } else if (value && value.isMatrix3) { + data.uniforms[name] = { + type: "m3", + value: value.toArray() + }; + } else if (value && value.isMatrix4) { + data.uniforms[name] = { + type: "m4", + value: value.toArray() + }; + } else { + data.uniforms[name] = { + value + }; + } + } + if (Object.keys(this.defines).length > 0) + data.defines = this.defines; + data.vertexShader = this.vertexShader; + data.fragmentShader = this.fragmentShader; + const extensions = {}; + for (const key in this.extensions) { + if (this.extensions[key] === true) + extensions[key] = true; + } + if (Object.keys(extensions).length > 0) + data.extensions = extensions; + return data; + } +}; +var Camera = class extends Object3D { + constructor() { + super(); + this.isCamera = true; + this.type = "Camera"; + this.matrixWorldInverse = new Matrix4(); + this.projectionMatrix = new Matrix4(); + this.projectionMatrixInverse = new Matrix4(); + } + copy(source, recursive) { + super.copy(source, recursive); + this.matrixWorldInverse.copy(source.matrixWorldInverse); + this.projectionMatrix.copy(source.projectionMatrix); + this.projectionMatrixInverse.copy(source.projectionMatrixInverse); + return this; + } + getWorldDirection(target) { + this.updateWorldMatrix(true, false); + const e = this.matrixWorld.elements; + return target.set(-e[8], -e[9], -e[10]).normalize(); + } + updateMatrixWorld(force) { + super.updateMatrixWorld(force); + this.matrixWorldInverse.copy(this.matrixWorld).invert(); + } + updateWorldMatrix(updateParents, updateChildren) { + super.updateWorldMatrix(updateParents, updateChildren); + this.matrixWorldInverse.copy(this.matrixWorld).invert(); + } + clone() { + return new this.constructor().copy(this); + } +}; +var PerspectiveCamera = class extends Camera { + constructor(fov2 = 50, aspect2 = 1, near = 0.1, far = 2e3) { + super(); + this.isPerspectiveCamera = true; + this.type = "PerspectiveCamera"; + this.fov = fov2; + this.zoom = 1; + this.near = near; + this.far = far; + this.focus = 10; + this.aspect = aspect2; + this.view = null; + this.filmGauge = 35; + this.filmOffset = 0; + this.updateProjectionMatrix(); + } + copy(source, recursive) { + super.copy(source, recursive); + this.fov = source.fov; + this.zoom = source.zoom; + this.near = source.near; + this.far = source.far; + this.focus = source.focus; + this.aspect = source.aspect; + this.view = source.view === null ? null : Object.assign({}, source.view); + this.filmGauge = source.filmGauge; + this.filmOffset = source.filmOffset; + return this; + } + setFocalLength(focalLength) { + const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; + this.fov = RAD2DEG * 2 * Math.atan(vExtentSlope); + this.updateProjectionMatrix(); + } + getFocalLength() { + const vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov); + return 0.5 * this.getFilmHeight() / vExtentSlope; + } + getEffectiveFOV() { + return RAD2DEG * 2 * Math.atan(Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom); + } + getFilmWidth() { + return this.filmGauge * Math.min(this.aspect, 1); + } + getFilmHeight() { + return this.filmGauge / Math.max(this.aspect, 1); + } + setViewOffset(fullWidth, fullHeight, x2, y2, width, height) { + this.aspect = fullWidth / fullHeight; + if (this.view === null) { + this.view = { + enabled: true, + fullWidth: 1, + fullHeight: 1, + offsetX: 0, + offsetY: 0, + width: 1, + height: 1 + }; + } + this.view.enabled = true; + this.view.fullWidth = fullWidth; + this.view.fullHeight = fullHeight; + this.view.offsetX = x2; + this.view.offsetY = y2; + this.view.width = width; + this.view.height = height; + this.updateProjectionMatrix(); + } + clearViewOffset() { + if (this.view !== null) { + this.view.enabled = false; + } + this.updateProjectionMatrix(); + } + updateProjectionMatrix() { + const near = this.near; + let top = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom; + let height = 2 * top; + let width = this.aspect * height; + let left = -0.5 * width; + const view = this.view; + if (this.view !== null && this.view.enabled) { + const fullWidth = view.fullWidth, fullHeight = view.fullHeight; + left += view.offsetX * width / fullWidth; + top -= view.offsetY * height / fullHeight; + width *= view.width / fullWidth; + height *= view.height / fullHeight; + } + const skew = this.filmOffset; + if (skew !== 0) + left += near * skew / this.getFilmWidth(); + this.projectionMatrix.makePerspective(left, left + width, top, top - height, near, this.far); + this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); + } + toJSON(meta) { + const data = super.toJSON(meta); + data.object.fov = this.fov; + data.object.zoom = this.zoom; + data.object.near = this.near; + data.object.far = this.far; + data.object.focus = this.focus; + data.object.aspect = this.aspect; + if (this.view !== null) + data.object.view = Object.assign({}, this.view); + data.object.filmGauge = this.filmGauge; + data.object.filmOffset = this.filmOffset; + return data; + } +}; +var fov = 90; +var aspect = 1; +var CubeCamera = class extends Object3D { + constructor(near, far, renderTarget) { + super(); + this.type = "CubeCamera"; + if (renderTarget.isWebGLCubeRenderTarget !== true) { + console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."); + return; + } + this.renderTarget = renderTarget; + const cameraPX = new PerspectiveCamera(fov, aspect, near, far); + cameraPX.layers = this.layers; + cameraPX.up.set(0, -1, 0); + cameraPX.lookAt(new Vector3(1, 0, 0)); + this.add(cameraPX); + const cameraNX = new PerspectiveCamera(fov, aspect, near, far); + cameraNX.layers = this.layers; + cameraNX.up.set(0, -1, 0); + cameraNX.lookAt(new Vector3(-1, 0, 0)); + this.add(cameraNX); + const cameraPY = new PerspectiveCamera(fov, aspect, near, far); + cameraPY.layers = this.layers; + cameraPY.up.set(0, 0, 1); + cameraPY.lookAt(new Vector3(0, 1, 0)); + this.add(cameraPY); + const cameraNY = new PerspectiveCamera(fov, aspect, near, far); + cameraNY.layers = this.layers; + cameraNY.up.set(0, 0, -1); + cameraNY.lookAt(new Vector3(0, -1, 0)); + this.add(cameraNY); + const cameraPZ = new PerspectiveCamera(fov, aspect, near, far); + cameraPZ.layers = this.layers; + cameraPZ.up.set(0, -1, 0); + cameraPZ.lookAt(new Vector3(0, 0, 1)); + this.add(cameraPZ); + const cameraNZ = new PerspectiveCamera(fov, aspect, near, far); + cameraNZ.layers = this.layers; + cameraNZ.up.set(0, -1, 0); + cameraNZ.lookAt(new Vector3(0, 0, -1)); + this.add(cameraNZ); + } + update(renderer3, scene3) { + if (this.parent === null) + this.updateMatrixWorld(); + const renderTarget = this.renderTarget; + const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children; + const currentRenderTarget = renderer3.getRenderTarget(); + const currentToneMapping = renderer3.toneMapping; + const currentXrEnabled = renderer3.xr.enabled; + renderer3.toneMapping = NoToneMapping; + renderer3.xr.enabled = false; + const generateMipmaps = renderTarget.texture.generateMipmaps; + renderTarget.texture.generateMipmaps = false; + renderer3.setRenderTarget(renderTarget, 0); + renderer3.render(scene3, cameraPX); + renderer3.setRenderTarget(renderTarget, 1); + renderer3.render(scene3, cameraNX); + renderer3.setRenderTarget(renderTarget, 2); + renderer3.render(scene3, cameraPY); + renderer3.setRenderTarget(renderTarget, 3); + renderer3.render(scene3, cameraNY); + renderer3.setRenderTarget(renderTarget, 4); + renderer3.render(scene3, cameraPZ); + renderTarget.texture.generateMipmaps = generateMipmaps; + renderer3.setRenderTarget(renderTarget, 5); + renderer3.render(scene3, cameraNZ); + renderer3.setRenderTarget(currentRenderTarget); + renderer3.toneMapping = currentToneMapping; + renderer3.xr.enabled = currentXrEnabled; + renderTarget.texture.needsPMREMUpdate = true; + } +}; +var CubeTexture = class extends Texture { + constructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, encoding) { + images = images !== void 0 ? images : []; + mapping = mapping !== void 0 ? mapping : CubeReflectionMapping; + super(images, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy, encoding); + this.isCubeTexture = true; + this.flipY = false; + } + get images() { + return this.image; + } + set images(value) { + this.image = value; + } +}; +var WebGLCubeRenderTarget = class extends WebGLRenderTarget { + constructor(size, options = {}) { + super(size, size, options); + this.isWebGLCubeRenderTarget = true; + const image = { width: size, height: size, depth: 1 }; + const images = [image, image, image, image, image, image]; + this.texture = new CubeTexture(images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding); + this.texture.isRenderTargetTexture = true; + this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false; + this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter; + } + fromEquirectangularTexture(renderer3, texture) { + this.texture.type = texture.type; + this.texture.encoding = texture.encoding; + this.texture.generateMipmaps = texture.generateMipmaps; + this.texture.minFilter = texture.minFilter; + this.texture.magFilter = texture.magFilter; + const shader = { + uniforms: { + tEquirect: { value: null } + }, + vertexShader: ` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `, + fragmentShader: ` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + ` + }; + const geometry = new BoxGeometry(5, 5, 5); + const material = new ShaderMaterial({ + name: "CubemapFromEquirect", + uniforms: cloneUniforms(shader.uniforms), + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader, + side: BackSide, + blending: NoBlending + }); + material.uniforms.tEquirect.value = texture; + const mesh = new Mesh(geometry, material); + const currentMinFilter = texture.minFilter; + if (texture.minFilter === LinearMipmapLinearFilter) + texture.minFilter = LinearFilter; + const camera3 = new CubeCamera(1, 10, this); + camera3.update(renderer3, mesh); + texture.minFilter = currentMinFilter; + mesh.geometry.dispose(); + mesh.material.dispose(); + return this; + } + clear(renderer3, color, depth, stencil) { + const currentRenderTarget = renderer3.getRenderTarget(); + for (let i = 0; i < 6; i++) { + renderer3.setRenderTarget(this, i); + renderer3.clear(color, depth, stencil); + } + renderer3.setRenderTarget(currentRenderTarget); + } +}; +var _vector1 = /* @__PURE__ */ new Vector3(); +var _vector2 = /* @__PURE__ */ new Vector3(); +var _normalMatrix = /* @__PURE__ */ new Matrix3(); +var Plane = class { + constructor(normal = new Vector3(1, 0, 0), constant = 0) { + this.isPlane = true; + this.normal = normal; + this.constant = constant; + } + set(normal, constant) { + this.normal.copy(normal); + this.constant = constant; + return this; + } + setComponents(x2, y2, z2, w) { + this.normal.set(x2, y2, z2); + this.constant = w; + return this; + } + setFromNormalAndCoplanarPoint(normal, point) { + this.normal.copy(normal); + this.constant = -point.dot(this.normal); + return this; + } + setFromCoplanarPoints(a2, b, c2) { + const normal = _vector1.subVectors(c2, b).cross(_vector2.subVectors(a2, b)).normalize(); + this.setFromNormalAndCoplanarPoint(normal, a2); + return this; + } + copy(plane) { + this.normal.copy(plane.normal); + this.constant = plane.constant; + return this; + } + normalize() { + const inverseNormalLength = 1 / this.normal.length(); + this.normal.multiplyScalar(inverseNormalLength); + this.constant *= inverseNormalLength; + return this; + } + negate() { + this.constant *= -1; + this.normal.negate(); + return this; + } + distanceToPoint(point) { + return this.normal.dot(point) + this.constant; + } + distanceToSphere(sphere) { + return this.distanceToPoint(sphere.center) - sphere.radius; + } + projectPoint(point, target) { + return target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point); + } + intersectLine(line, target) { + const direction = line.delta(_vector1); + const denominator = this.normal.dot(direction); + if (denominator === 0) { + if (this.distanceToPoint(line.start) === 0) { + return target.copy(line.start); + } + return null; + } + const t = -(line.start.dot(this.normal) + this.constant) / denominator; + if (t < 0 || t > 1) { + return null; + } + return target.copy(direction).multiplyScalar(t).add(line.start); + } + intersectsLine(line) { + const startSign = this.distanceToPoint(line.start); + const endSign = this.distanceToPoint(line.end); + return startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0; + } + intersectsBox(box) { + return box.intersectsPlane(this); + } + intersectsSphere(sphere) { + return sphere.intersectsPlane(this); + } + coplanarPoint(target) { + return target.copy(this.normal).multiplyScalar(-this.constant); + } + applyMatrix4(matrix, optionalNormalMatrix) { + const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix); + const referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix); + const normal = this.normal.applyMatrix3(normalMatrix).normalize(); + this.constant = -referencePoint.dot(normal); + return this; + } + translate(offset) { + this.constant -= offset.dot(this.normal); + return this; + } + equals(plane) { + return plane.normal.equals(this.normal) && plane.constant === this.constant; + } + clone() { + return new this.constructor().copy(this); + } +}; +var _sphere$2 = /* @__PURE__ */ new Sphere(); +var _vector$7 = /* @__PURE__ */ new Vector3(); +var Frustum = class { + constructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) { + this.planes = [p0, p1, p2, p3, p4, p5]; + } + set(p0, p1, p2, p3, p4, p5) { + const planes = this.planes; + planes[0].copy(p0); + planes[1].copy(p1); + planes[2].copy(p2); + planes[3].copy(p3); + planes[4].copy(p4); + planes[5].copy(p5); + return this; + } + copy(frustum) { + const planes = this.planes; + for (let i = 0; i < 6; i++) { + planes[i].copy(frustum.planes[i]); + } + return this; + } + setFromProjectionMatrix(m2) { + const planes = this.planes; + const me = m2.elements; + const me0 = me[0], me1 = me[1], me2 = me[2], me3 = me[3]; + const me4 = me[4], me5 = me[5], me6 = me[6], me7 = me[7]; + const me8 = me[8], me9 = me[9], me10 = me[10], me11 = me[11]; + const me12 = me[12], me13 = me[13], me14 = me[14], me15 = me[15]; + planes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize(); + planes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize(); + planes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize(); + planes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize(); + planes[4].setComponents(me3 - me2, me7 - me6, me11 - me10, me15 - me14).normalize(); + planes[5].setComponents(me3 + me2, me7 + me6, me11 + me10, me15 + me14).normalize(); + return this; + } + intersectsObject(object) { + const geometry = object.geometry; + if (geometry.boundingSphere === null) + geometry.computeBoundingSphere(); + _sphere$2.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld); + return this.intersectsSphere(_sphere$2); + } + intersectsSprite(sprite) { + _sphere$2.center.set(0, 0, 0); + _sphere$2.radius = 0.7071067811865476; + _sphere$2.applyMatrix4(sprite.matrixWorld); + return this.intersectsSphere(_sphere$2); + } + intersectsSphere(sphere) { + const planes = this.planes; + const center = sphere.center; + const negRadius = -sphere.radius; + for (let i = 0; i < 6; i++) { + const distance = planes[i].distanceToPoint(center); + if (distance < negRadius) { + return false; + } + } + return true; + } + intersectsBox(box) { + const planes = this.planes; + for (let i = 0; i < 6; i++) { + const plane = planes[i]; + _vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x; + _vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y; + _vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z; + if (plane.distanceToPoint(_vector$7) < 0) { + return false; + } + } + return true; + } + containsPoint(point) { + const planes = this.planes; + for (let i = 0; i < 6; i++) { + if (planes[i].distanceToPoint(point) < 0) { + return false; + } + } + return true; + } + clone() { + return new this.constructor().copy(this); + } +}; +function WebGLAnimation() { + let context = null; + let isAnimating = false; + let animationLoop = null; + let requestId = null; + function onAnimationFrame(time, frame2) { + animationLoop(time, frame2); + requestId = context.requestAnimationFrame(onAnimationFrame); + } + return { + start: function() { + if (isAnimating === true) + return; + if (animationLoop === null) + return; + requestId = context.requestAnimationFrame(onAnimationFrame); + isAnimating = true; + }, + stop: function() { + context.cancelAnimationFrame(requestId); + isAnimating = false; + }, + setAnimationLoop: function(callback) { + animationLoop = callback; + }, + setContext: function(value) { + context = value; + } + }; +} +function WebGLAttributes(gl, capabilities) { + const isWebGL2 = capabilities.isWebGL2; + const buffers = /* @__PURE__ */ new WeakMap(); + function createBuffer(attribute, bufferType) { + const array = attribute.array; + const usage = attribute.usage; + const buffer = gl.createBuffer(); + gl.bindBuffer(bufferType, buffer); + gl.bufferData(bufferType, array, usage); + attribute.onUploadCallback(); + let type; + if (array instanceof Float32Array) { + type = 5126; + } else if (array instanceof Uint16Array) { + if (attribute.isFloat16BufferAttribute) { + if (isWebGL2) { + type = 5131; + } else { + throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."); + } + } else { + type = 5123; + } + } else if (array instanceof Int16Array) { + type = 5122; + } else if (array instanceof Uint32Array) { + type = 5125; + } else if (array instanceof Int32Array) { + type = 5124; + } else if (array instanceof Int8Array) { + type = 5120; + } else if (array instanceof Uint8Array) { + type = 5121; + } else if (array instanceof Uint8ClampedArray) { + type = 5121; + } else { + throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + array); + } + return { + buffer, + type, + bytesPerElement: array.BYTES_PER_ELEMENT, + version: attribute.version + }; + } + function updateBuffer(buffer, attribute, bufferType) { + const array = attribute.array; + const updateRange = attribute.updateRange; + gl.bindBuffer(bufferType, buffer); + if (updateRange.count === -1) { + gl.bufferSubData(bufferType, 0, array); + } else { + if (isWebGL2) { + gl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array, updateRange.offset, updateRange.count); + } else { + gl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array.subarray(updateRange.offset, updateRange.offset + updateRange.count)); + } + updateRange.count = -1; + } + } + function get2(attribute) { + if (attribute.isInterleavedBufferAttribute) + attribute = attribute.data; + return buffers.get(attribute); + } + function remove2(attribute) { + if (attribute.isInterleavedBufferAttribute) + attribute = attribute.data; + const data = buffers.get(attribute); + if (data) { + gl.deleteBuffer(data.buffer); + buffers.delete(attribute); + } + } + function update4(attribute, bufferType) { + if (attribute.isGLBufferAttribute) { + const cached = buffers.get(attribute); + if (!cached || cached.version < attribute.version) { + buffers.set(attribute, { + buffer: attribute.buffer, + type: attribute.type, + bytesPerElement: attribute.elementSize, + version: attribute.version + }); + } + return; + } + if (attribute.isInterleavedBufferAttribute) + attribute = attribute.data; + const data = buffers.get(attribute); + if (data === void 0) { + buffers.set(attribute, createBuffer(attribute, bufferType)); + } else if (data.version < attribute.version) { + updateBuffer(data.buffer, attribute, bufferType); + data.version = attribute.version; + } + } + return { + get: get2, + remove: remove2, + update: update4 + }; +} +var PlaneGeometry = class extends BufferGeometry { + constructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) { + super(); + this.type = "PlaneGeometry"; + this.parameters = { + width, + height, + widthSegments, + heightSegments + }; + const width_half = width / 2; + const height_half = height / 2; + const gridX = Math.floor(widthSegments); + const gridY = Math.floor(heightSegments); + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; + const segment_width = width / gridX; + const segment_height = height / gridY; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + for (let iy = 0; iy < gridY1; iy++) { + const y2 = iy * segment_height - height_half; + for (let ix = 0; ix < gridX1; ix++) { + const x2 = ix * segment_width - width_half; + vertices.push(x2, -y2, 0); + normals.push(0, 0, 1); + uvs.push(ix / gridX); + uvs.push(1 - iy / gridY); + } + } + for (let iy = 0; iy < gridY; iy++) { + for (let ix = 0; ix < gridX; ix++) { + const a2 = ix + gridX1 * iy; + const b = ix + gridX1 * (iy + 1); + const c2 = ix + 1 + gridX1 * (iy + 1); + const d = ix + 1 + gridX1 * iy; + indices.push(a2, b, d); + indices.push(b, c2, d); + } + } + this.setIndex(indices); + this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); + this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); + this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); + } + static fromJSON(data) { + return new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments); + } +}; +var alphamap_fragment = "#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif"; +var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif"; +var alphatest_fragment = "#ifdef USE_ALPHATEST\n if ( diffuseColor.a < alphaTest ) discard;\n#endif"; +var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif"; +var aomap_fragment = "#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif"; +var aomap_pars_fragment = "#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif"; +var begin_vertex = "vec3 transformed = vec3( position );"; +var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif"; +var bsdfs = "vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif"; +var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float R21 = R12;\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif"; +var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = dFdx( surf_pos.xyz );\n vec3 vSigmaY = dFdy( surf_pos.xyz );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif"; +var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n#endif"; +var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif"; +var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif"; +var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif"; +var color_fragment = "#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif"; +var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif"; +var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n varying vec3 vColor;\n#endif"; +var color_vertex = "#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif"; +var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n return dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}"; +var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define r0 1.0\n #define v0 0.339\n #define m0 - 2.0\n #define r1 0.8\n #define v1 0.276\n #define m1 - 1.0\n #define r4 0.4\n #define v4 0.046\n #define m4 2.0\n #define r5 0.305\n #define v5 0.016\n #define m5 3.0\n #define r6 0.21\n #define v6 0.0038\n #define m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= r1 ) {\n mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n } else if ( roughness >= r4 ) {\n mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n } else if ( roughness >= r5 ) {\n mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n } else if ( roughness >= r6 ) {\n mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif"; +var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n mat3 m = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n transformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif"; +var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif"; +var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif"; +var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif"; +var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif"; +var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; +var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; +var envmap_fragment = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif"; +var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif"; +var envmap_pars_fragment = "#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif"; +var envmap_pars_vertex = "#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif"; +var envmap_vertex = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif"; +var fog_vertex = "#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif"; +var fog_pars_vertex = "#ifdef USE_FOG\n varying float vFogDepth;\n#endif"; +var fog_fragment = "#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif"; +var fog_pars_fragment = "#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif"; +var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n #endif\n}"; +var lightmap_fragment = "#ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n reflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif"; +var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif"; +var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n vIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n vIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointLightInfo( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotLightInfo( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n #ifdef DOUBLE_SIDED\n vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n #endif\n }\n #pragma unroll_loop_end\n#endif"; +var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n #if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n #else\n if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n }\n return 1.0;\n #endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometry.position;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometry.position;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif"; +var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #if defined( ENVMAP_TYPE_CUBE_UV )\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #if defined( ENVMAP_TYPE_CUBE_UV )\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n#endif"; +var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;"; +var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material ) (0)"; +var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;"; +var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)"; +var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n #ifdef SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULARINTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n #endif\n #ifdef USE_SPECULARCOLORMAP\n specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEENCOLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEENROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n #endif\n#endif"; +var lights_physical_pars_fragment = "struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometry.normal;\n vec3 viewDir = geometry.viewDir;\n vec3 position = geometry.position;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n #endif\n #ifdef USE_IRIDESCENCE\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n #else\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}"; +var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n geometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometry.viewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif"; +var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometry.normal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif"; +var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif"; +var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif"; +var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif"; +var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n varying float vIsPerspective;\n #else\n uniform float logDepthBufFC;\n #endif\n#endif"; +var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n #else\n if ( isPerspectiveMatrix( projectionMatrix ) ) {\n gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n gl_Position.z *= gl_Position.w;\n }\n #endif\n#endif"; +var map_fragment = "#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif"; +var map_pars_fragment = "#ifdef USE_MAP\n uniform sampler2D map;\n#endif"; +var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif"; +var map_particle_pars_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif"; +var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.b;\n#endif"; +var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif"; +var morphcolor_vertex = "#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif"; +var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n #ifdef MORPHTARGETS_TEXTURE\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n #else\n objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n #endif\n#endif"; +var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n uniform float morphTargetBaseInfluence;\n #ifdef MORPHTARGETS_TEXTURE\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n #else\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n #endif\n#endif"; +var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n #ifdef MORPHTARGETS_TEXTURE\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n #else\n transformed += morphTarget0 * morphTargetInfluences[ 0 ];\n transformed += morphTarget1 * morphTargetInfluences[ 1 ];\n transformed += morphTarget2 * morphTargetInfluences[ 2 ];\n transformed += morphTarget3 * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += morphTarget4 * morphTargetInfluences[ 4 ];\n transformed += morphTarget5 * morphTargetInfluences[ 5 ];\n transformed += morphTarget6 * morphTargetInfluences[ 6 ];\n transformed += morphTarget7 * morphTargetInfluences[ 7 ];\n #endif\n #endif\n#endif"; +var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n #ifdef USE_TANGENT\n vec3 tangent = normalize( vTangent );\n vec3 bitangent = normalize( vBitangent );\n #ifdef DOUBLE_SIDED\n tangent = tangent * faceDirection;\n bitangent = bitangent * faceDirection;\n #endif\n #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n mat3 vTBN = mat3( tangent, bitangent, normal );\n #endif\n #endif\n#endif\nvec3 geometryNormal = normal;"; +var normal_fragment_maps = "#ifdef OBJECTSPACE_NORMALMAP\n normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n #ifdef USE_TANGENT\n normal = normalize( vTBN * mapN );\n #else\n normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n #endif\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; +var normal_pars_fragment = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif"; +var normal_pars_vertex = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif"; +var normal_vertex = "#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif"; +var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n }\n#endif"; +var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = geometryNormal;\n#endif"; +var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n #ifdef USE_TANGENT\n clearcoatNormal = normalize( vTBN * clearcoatMapN );\n #else\n clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n #endif\n#endif"; +var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif"; +var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif"; +var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; +var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}"; +var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif"; +var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;"; +var dithering_fragment = "#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; +var dithering_pars_fragment = "#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif"; +var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.g;\n#endif"; +var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif"; +var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return shadow;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif"; +var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif"; +var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n #endif\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif"; +var shadowmask_pars_fragment = "float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}"; +var skinbase_vertex = "#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif"; +var skinning_pars_vertex = "#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n uniform int boneTextureSize;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureSize ) );\n float y = floor( j / float( boneTextureSize ) );\n float dx = 1.0 / float( boneTextureSize );\n float dy = 1.0 / float( boneTextureSize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n#endif"; +var skinning_vertex = "#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif"; +var skinnormal_vertex = "#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif"; +var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif"; +var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif"; +var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif"; +var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }"; +var transmission_fragment = "#ifdef USE_TRANSMISSION\n float transmissionAlpha = 1.0;\n float transmissionFactor = transmission;\n float thicknessFactor = thickness;\n #ifdef USE_TRANSMISSIONMAP\n transmissionFactor *= texture2D( transmissionMap, vUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n thicknessFactor *= texture2D( thicknessMap, vUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmission = getIBLVolumeRefraction(\n n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n attenuationColor, attenuationDistance );\n totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif"; +var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n #ifdef texture2DLodEXT\n return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n #else\n return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n #endif\n }\n vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( attenuationDistance == 0.0 ) {\n return radiance;\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n }\n#endif"; +var uv_pars_fragment = "#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n varying vec2 vUv;\n#endif"; +var uv_pars_vertex = "#ifdef USE_UV\n #ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n #else\n varying vec2 vUv;\n #endif\n uniform mat3 uvTransform;\n#endif"; +var uv_vertex = "#ifdef USE_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif"; +var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif"; +var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n uniform mat3 uv2Transform;\n#endif"; +var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif"; +var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif"; +var vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}"; +var fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n #endif\n #include \n #include \n}"; +var vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}"; +var fragment$f = "#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 vReflect = vWorldDirection;\n #include \n gl_FragColor = envColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}"; +var vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}"; +var fragment$e = "#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #endif\n}"; +var vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}"; +var fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n #include \n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}"; +var vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}"; +var fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}"; +var vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$9 = "#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var fragment$9 = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #ifdef DOUBLE_SIDED\n reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n #else\n reflectedLight.indirectDiffuse += vIndirectFront;\n #endif\n #include \n reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}"; +var fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n vViewPosition = - mvPosition.xyz;\n#endif\n}"; +var fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n gl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}"; +var vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}"; +var fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}"; +var fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULARINTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n #ifdef USE_SPECULARCOLORMAP\n uniform sampler2D specularColorMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEENCOLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEENROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}"; +var fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include \n #include \n #include \n #include \n}"; +var fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}"; +var vertex$2 = "#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; +var fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}"; +var vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include \n #include \n #include \n}"; +var fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"; +var ShaderChunk = { + alphamap_fragment, + alphamap_pars_fragment, + alphatest_fragment, + alphatest_pars_fragment, + aomap_fragment, + aomap_pars_fragment, + begin_vertex, + beginnormal_vertex, + bsdfs, + iridescence_fragment, + bumpmap_pars_fragment, + clipping_planes_fragment, + clipping_planes_pars_fragment, + clipping_planes_pars_vertex, + clipping_planes_vertex, + color_fragment, + color_pars_fragment, + color_pars_vertex, + color_vertex, + common, + cube_uv_reflection_fragment, + defaultnormal_vertex, + displacementmap_pars_vertex, + displacementmap_vertex, + emissivemap_fragment, + emissivemap_pars_fragment, + encodings_fragment, + encodings_pars_fragment, + envmap_fragment, + envmap_common_pars_fragment, + envmap_pars_fragment, + envmap_pars_vertex, + envmap_physical_pars_fragment, + envmap_vertex, + fog_vertex, + fog_pars_vertex, + fog_fragment, + fog_pars_fragment, + gradientmap_pars_fragment, + lightmap_fragment, + lightmap_pars_fragment, + lights_lambert_vertex, + lights_pars_begin, + lights_toon_fragment, + lights_toon_pars_fragment, + lights_phong_fragment, + lights_phong_pars_fragment, + lights_physical_fragment, + lights_physical_pars_fragment, + lights_fragment_begin, + lights_fragment_maps, + lights_fragment_end, + logdepthbuf_fragment, + logdepthbuf_pars_fragment, + logdepthbuf_pars_vertex, + logdepthbuf_vertex, + map_fragment, + map_pars_fragment, + map_particle_fragment, + map_particle_pars_fragment, + metalnessmap_fragment, + metalnessmap_pars_fragment, + morphcolor_vertex, + morphnormal_vertex, + morphtarget_pars_vertex, + morphtarget_vertex, + normal_fragment_begin, + normal_fragment_maps, + normal_pars_fragment, + normal_pars_vertex, + normal_vertex, + normalmap_pars_fragment, + clearcoat_normal_fragment_begin, + clearcoat_normal_fragment_maps, + clearcoat_pars_fragment, + iridescence_pars_fragment, + output_fragment, + packing, + premultiplied_alpha_fragment, + project_vertex, + dithering_fragment, + dithering_pars_fragment, + roughnessmap_fragment, + roughnessmap_pars_fragment, + shadowmap_pars_fragment, + shadowmap_pars_vertex, + shadowmap_vertex, + shadowmask_pars_fragment, + skinbase_vertex, + skinning_pars_vertex, + skinning_vertex, + skinnormal_vertex, + specularmap_fragment, + specularmap_pars_fragment, + tonemapping_fragment, + tonemapping_pars_fragment, + transmission_fragment, + transmission_pars_fragment, + uv_pars_fragment, + uv_pars_vertex, + uv_vertex, + uv2_pars_fragment, + uv2_pars_vertex, + uv2_vertex, + worldpos_vertex, + background_vert: vertex$g, + background_frag: fragment$g, + cube_vert: vertex$f, + cube_frag: fragment$f, + depth_vert: vertex$e, + depth_frag: fragment$e, + distanceRGBA_vert: vertex$d, + distanceRGBA_frag: fragment$d, + equirect_vert: vertex$c, + equirect_frag: fragment$c, + linedashed_vert: vertex$b, + linedashed_frag: fragment$b, + meshbasic_vert: vertex$a, + meshbasic_frag: fragment$a, + meshlambert_vert: vertex$9, + meshlambert_frag: fragment$9, + meshmatcap_vert: vertex$8, + meshmatcap_frag: fragment$8, + meshnormal_vert: vertex$7, + meshnormal_frag: fragment$7, + meshphong_vert: vertex$6, + meshphong_frag: fragment$6, + meshphysical_vert: vertex$5, + meshphysical_frag: fragment$5, + meshtoon_vert: vertex$4, + meshtoon_frag: fragment$4, + points_vert: vertex$3, + points_frag: fragment$3, + shadow_vert: vertex$2, + shadow_frag: fragment$2, + sprite_vert: vertex$1, + sprite_frag: fragment$1 +}; +var UniformsLib = { + common: { + diffuse: { value: /* @__PURE__ */ new Color(16777215) }, + opacity: { value: 1 }, + map: { value: null }, + uvTransform: { value: /* @__PURE__ */ new Matrix3() }, + uv2Transform: { value: /* @__PURE__ */ new Matrix3() }, + alphaMap: { value: null }, + alphaTest: { value: 0 } + }, + specularmap: { + specularMap: { value: null } + }, + envmap: { + envMap: { value: null }, + flipEnvMap: { value: -1 }, + reflectivity: { value: 1 }, + ior: { value: 1.5 }, + refractionRatio: { value: 0.98 } + }, + aomap: { + aoMap: { value: null }, + aoMapIntensity: { value: 1 } + }, + lightmap: { + lightMap: { value: null }, + lightMapIntensity: { value: 1 } + }, + emissivemap: { + emissiveMap: { value: null } + }, + bumpmap: { + bumpMap: { value: null }, + bumpScale: { value: 1 } + }, + normalmap: { + normalMap: { value: null }, + normalScale: { value: /* @__PURE__ */ new Vector2(1, 1) } + }, + displacementmap: { + displacementMap: { value: null }, + displacementScale: { value: 1 }, + displacementBias: { value: 0 } + }, + roughnessmap: { + roughnessMap: { value: null } + }, + metalnessmap: { + metalnessMap: { value: null } + }, + gradientmap: { + gradientMap: { value: null } + }, + fog: { + fogDensity: { value: 25e-5 }, + fogNear: { value: 1 }, + fogFar: { value: 2e3 }, + fogColor: { value: /* @__PURE__ */ new Color(16777215) } + }, + lights: { + ambientLightColor: { value: [] }, + lightProbe: { value: [] }, + directionalLights: { value: [], properties: { + direction: {}, + color: {} + } }, + directionalLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + directionalShadowMap: { value: [] }, + directionalShadowMatrix: { value: [] }, + spotLights: { value: [], properties: { + color: {}, + position: {}, + direction: {}, + distance: {}, + coneCos: {}, + penumbraCos: {}, + decay: {} + } }, + spotLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + spotShadowMap: { value: [] }, + spotShadowMatrix: { value: [] }, + pointLights: { value: [], properties: { + color: {}, + position: {}, + decay: {}, + distance: {} + } }, + pointLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {}, + shadowCameraNear: {}, + shadowCameraFar: {} + } }, + pointShadowMap: { value: [] }, + pointShadowMatrix: { value: [] }, + hemisphereLights: { value: [], properties: { + direction: {}, + skyColor: {}, + groundColor: {} + } }, + rectAreaLights: { value: [], properties: { + color: {}, + position: {}, + width: {}, + height: {} + } }, + ltc_1: { value: null }, + ltc_2: { value: null } + }, + points: { + diffuse: { value: /* @__PURE__ */ new Color(16777215) }, + opacity: { value: 1 }, + size: { value: 1 }, + scale: { value: 1 }, + map: { value: null }, + alphaMap: { value: null }, + alphaTest: { value: 0 }, + uvTransform: { value: /* @__PURE__ */ new Matrix3() } + }, + sprite: { + diffuse: { value: /* @__PURE__ */ new Color(16777215) }, + opacity: { value: 1 }, + center: { value: /* @__PURE__ */ new Vector2(0.5, 0.5) }, + rotation: { value: 0 }, + map: { value: null }, + alphaMap: { value: null }, + alphaTest: { value: 0 }, + uvTransform: { value: /* @__PURE__ */ new Matrix3() } + } +}; +var ShaderLib = { + basic: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.fog + ]), + vertexShader: ShaderChunk.meshbasic_vert, + fragmentShader: ShaderChunk.meshbasic_frag + }, + lambert: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /* @__PURE__ */ new Color(0) } + } + ]), + vertexShader: ShaderChunk.meshlambert_vert, + fragmentShader: ShaderChunk.meshlambert_frag + }, + phong: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.specularmap, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /* @__PURE__ */ new Color(0) }, + specular: { value: /* @__PURE__ */ new Color(1118481) }, + shininess: { value: 30 } + } + ]), + vertexShader: ShaderChunk.meshphong_vert, + fragmentShader: ShaderChunk.meshphong_frag + }, + standard: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.envmap, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.roughnessmap, + UniformsLib.metalnessmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /* @__PURE__ */ new Color(0) }, + roughness: { value: 1 }, + metalness: { value: 0 }, + envMapIntensity: { value: 1 } + } + ]), + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag + }, + toon: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.gradientmap, + UniformsLib.fog, + UniformsLib.lights, + { + emissive: { value: /* @__PURE__ */ new Color(0) } + } + ]), + vertexShader: ShaderChunk.meshtoon_vert, + fragmentShader: ShaderChunk.meshtoon_frag + }, + matcap: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + { + matcap: { value: null } + } + ]), + vertexShader: ShaderChunk.meshmatcap_vert, + fragmentShader: ShaderChunk.meshmatcap_frag + }, + points: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.points, + UniformsLib.fog + ]), + vertexShader: ShaderChunk.points_vert, + fragmentShader: ShaderChunk.points_frag + }, + dashed: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.fog, + { + scale: { value: 1 }, + dashSize: { value: 1 }, + totalSize: { value: 2 } + } + ]), + vertexShader: ShaderChunk.linedashed_vert, + fragmentShader: ShaderChunk.linedashed_frag + }, + depth: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.displacementmap + ]), + vertexShader: ShaderChunk.depth_vert, + fragmentShader: ShaderChunk.depth_frag + }, + normal: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + { + opacity: { value: 1 } + } + ]), + vertexShader: ShaderChunk.meshnormal_vert, + fragmentShader: ShaderChunk.meshnormal_frag + }, + sprite: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.sprite, + UniformsLib.fog + ]), + vertexShader: ShaderChunk.sprite_vert, + fragmentShader: ShaderChunk.sprite_frag + }, + background: { + uniforms: { + uvTransform: { value: /* @__PURE__ */ new Matrix3() }, + t2D: { value: null } + }, + vertexShader: ShaderChunk.background_vert, + fragmentShader: ShaderChunk.background_frag + }, + cube: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.envmap, + { + opacity: { value: 1 } + } + ]), + vertexShader: ShaderChunk.cube_vert, + fragmentShader: ShaderChunk.cube_frag + }, + equirect: { + uniforms: { + tEquirect: { value: null } + }, + vertexShader: ShaderChunk.equirect_vert, + fragmentShader: ShaderChunk.equirect_frag + }, + distanceRGBA: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.common, + UniformsLib.displacementmap, + { + referencePosition: { value: /* @__PURE__ */ new Vector3() }, + nearDistance: { value: 1 }, + farDistance: { value: 1e3 } + } + ]), + vertexShader: ShaderChunk.distanceRGBA_vert, + fragmentShader: ShaderChunk.distanceRGBA_frag + }, + shadow: { + uniforms: /* @__PURE__ */ mergeUniforms([ + UniformsLib.lights, + UniformsLib.fog, + { + color: { value: /* @__PURE__ */ new Color(0) }, + opacity: { value: 1 } + } + ]), + vertexShader: ShaderChunk.shadow_vert, + fragmentShader: ShaderChunk.shadow_frag + } +}; +ShaderLib.physical = { + uniforms: /* @__PURE__ */ mergeUniforms([ + ShaderLib.standard.uniforms, + { + clearcoat: { value: 0 }, + clearcoatMap: { value: null }, + clearcoatRoughness: { value: 0 }, + clearcoatRoughnessMap: { value: null }, + clearcoatNormalScale: { value: /* @__PURE__ */ new Vector2(1, 1) }, + clearcoatNormalMap: { value: null }, + iridescence: { value: 0 }, + iridescenceMap: { value: null }, + iridescenceIOR: { value: 1.3 }, + iridescenceThicknessMinimum: { value: 100 }, + iridescenceThicknessMaximum: { value: 400 }, + iridescenceThicknessMap: { value: null }, + sheen: { value: 0 }, + sheenColor: { value: /* @__PURE__ */ new Color(0) }, + sheenColorMap: { value: null }, + sheenRoughness: { value: 1 }, + sheenRoughnessMap: { value: null }, + transmission: { value: 0 }, + transmissionMap: { value: null }, + transmissionSamplerSize: { value: /* @__PURE__ */ new Vector2() }, + transmissionSamplerMap: { value: null }, + thickness: { value: 0 }, + thicknessMap: { value: null }, + attenuationDistance: { value: 0 }, + attenuationColor: { value: /* @__PURE__ */ new Color(0) }, + specularIntensity: { value: 1 }, + specularIntensityMap: { value: null }, + specularColor: { value: /* @__PURE__ */ new Color(1, 1, 1) }, + specularColorMap: { value: null } + } + ]), + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag +}; +function WebGLBackground(renderer3, cubemaps, state, objects, alpha, premultipliedAlpha) { + const clearColor = new Color(0); + let clearAlpha = alpha === true ? 0 : 1; + let planeMesh; + let boxMesh; + let currentBackground = null; + let currentBackgroundVersion = 0; + let currentTonemapping = null; + function render(renderList, scene3) { + let forceClear = false; + let background = scene3.isScene === true ? scene3.background : null; + if (background && background.isTexture) { + background = cubemaps.get(background); + } + const xr = renderer3.xr; + const session = xr.getSession && xr.getSession(); + if (session && session.environmentBlendMode === "additive") { + background = null; + } + if (background === null) { + setClear(clearColor, clearAlpha); + } else if (background && background.isColor) { + setClear(background, 1); + forceClear = true; + } + if (renderer3.autoClear || forceClear) { + renderer3.clear(renderer3.autoClearColor, renderer3.autoClearDepth, renderer3.autoClearStencil); + } + if (background && (background.isCubeTexture || background.mapping === CubeUVReflectionMapping)) { + if (boxMesh === void 0) { + boxMesh = new Mesh(new BoxGeometry(1, 1, 1), new ShaderMaterial({ + name: "BackgroundCubeMaterial", + uniforms: cloneUniforms(ShaderLib.cube.uniforms), + vertexShader: ShaderLib.cube.vertexShader, + fragmentShader: ShaderLib.cube.fragmentShader, + side: BackSide, + depthTest: false, + depthWrite: false, + fog: false + })); + boxMesh.geometry.deleteAttribute("normal"); + boxMesh.geometry.deleteAttribute("uv"); + boxMesh.onBeforeRender = function(renderer4, scene4, camera3) { + this.matrixWorld.copyPosition(camera3.matrixWorld); + }; + Object.defineProperty(boxMesh.material, "envMap", { + get: function() { + return this.uniforms.envMap.value; + } + }); + objects.update(boxMesh); + } + boxMesh.material.uniforms.envMap.value = background; + boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1; + if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer3.toneMapping) { + boxMesh.material.needsUpdate = true; + currentBackground = background; + currentBackgroundVersion = background.version; + currentTonemapping = renderer3.toneMapping; + } + boxMesh.layers.enableAll(); + renderList.unshift(boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null); + } else if (background && background.isTexture) { + if (planeMesh === void 0) { + planeMesh = new Mesh(new PlaneGeometry(2, 2), new ShaderMaterial({ + name: "BackgroundMaterial", + uniforms: cloneUniforms(ShaderLib.background.uniforms), + vertexShader: ShaderLib.background.vertexShader, + fragmentShader: ShaderLib.background.fragmentShader, + side: FrontSide, + depthTest: false, + depthWrite: false, + fog: false + })); + planeMesh.geometry.deleteAttribute("normal"); + Object.defineProperty(planeMesh.material, "map", { + get: function() { + return this.uniforms.t2D.value; + } + }); + objects.update(planeMesh); + } + planeMesh.material.uniforms.t2D.value = background; + if (background.matrixAutoUpdate === true) { + background.updateMatrix(); + } + planeMesh.material.uniforms.uvTransform.value.copy(background.matrix); + if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer3.toneMapping) { + planeMesh.material.needsUpdate = true; + currentBackground = background; + currentBackgroundVersion = background.version; + currentTonemapping = renderer3.toneMapping; + } + planeMesh.layers.enableAll(); + renderList.unshift(planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null); + } + } + function setClear(color, alpha2) { + state.buffers.color.setClear(color.r, color.g, color.b, alpha2, premultipliedAlpha); + } + return { + getClearColor: function() { + return clearColor; + }, + setClearColor: function(color, alpha2 = 1) { + clearColor.set(color); + clearAlpha = alpha2; + setClear(clearColor, clearAlpha); + }, + getClearAlpha: function() { + return clearAlpha; + }, + setClearAlpha: function(alpha2) { + clearAlpha = alpha2; + setClear(clearColor, clearAlpha); + }, + render + }; +} +function WebGLBindingStates(gl, extensions, attributes, capabilities) { + const maxVertexAttributes = gl.getParameter(34921); + const extension = capabilities.isWebGL2 ? null : extensions.get("OES_vertex_array_object"); + const vaoAvailable = capabilities.isWebGL2 || extension !== null; + const bindingStates = {}; + const defaultState = createBindingState(null); + let currentState = defaultState; + let forceUpdate = false; + function setup(object, material, program, geometry, index5) { + let updateBuffers = false; + if (vaoAvailable) { + const state = getBindingState(geometry, program, material); + if (currentState !== state) { + currentState = state; + bindVertexArrayObject(currentState.object); + } + updateBuffers = needsUpdate(object, geometry, program, index5); + if (updateBuffers) + saveCache(object, geometry, program, index5); + } else { + const wireframe = material.wireframe === true; + if (currentState.geometry !== geometry.id || currentState.program !== program.id || currentState.wireframe !== wireframe) { + currentState.geometry = geometry.id; + currentState.program = program.id; + currentState.wireframe = wireframe; + updateBuffers = true; + } + } + if (index5 !== null) { + attributes.update(index5, 34963); + } + if (updateBuffers || forceUpdate) { + forceUpdate = false; + setupVertexAttributes(object, material, program, geometry); + if (index5 !== null) { + gl.bindBuffer(34963, attributes.get(index5).buffer); + } + } + } + function createVertexArrayObject() { + if (capabilities.isWebGL2) + return gl.createVertexArray(); + return extension.createVertexArrayOES(); + } + function bindVertexArrayObject(vao) { + if (capabilities.isWebGL2) + return gl.bindVertexArray(vao); + return extension.bindVertexArrayOES(vao); + } + function deleteVertexArrayObject(vao) { + if (capabilities.isWebGL2) + return gl.deleteVertexArray(vao); + return extension.deleteVertexArrayOES(vao); + } + function getBindingState(geometry, program, material) { + const wireframe = material.wireframe === true; + let programMap = bindingStates[geometry.id]; + if (programMap === void 0) { + programMap = {}; + bindingStates[geometry.id] = programMap; + } + let stateMap = programMap[program.id]; + if (stateMap === void 0) { + stateMap = {}; + programMap[program.id] = stateMap; + } + let state = stateMap[wireframe]; + if (state === void 0) { + state = createBindingState(createVertexArrayObject()); + stateMap[wireframe] = state; + } + return state; + } + function createBindingState(vao) { + const newAttributes = []; + const enabledAttributes = []; + const attributeDivisors = []; + for (let i = 0; i < maxVertexAttributes; i++) { + newAttributes[i] = 0; + enabledAttributes[i] = 0; + attributeDivisors[i] = 0; + } + return { + geometry: null, + program: null, + wireframe: false, + newAttributes, + enabledAttributes, + attributeDivisors, + object: vao, + attributes: {}, + index: null + }; + } + function needsUpdate(object, geometry, program, index5) { + const cachedAttributes = currentState.attributes; + const geometryAttributes = geometry.attributes; + let attributesNum = 0; + const programAttributes = program.getAttributes(); + for (const name in programAttributes) { + const programAttribute = programAttributes[name]; + if (programAttribute.location >= 0) { + const cachedAttribute = cachedAttributes[name]; + let geometryAttribute = geometryAttributes[name]; + if (geometryAttribute === void 0) { + if (name === "instanceMatrix" && object.instanceMatrix) + geometryAttribute = object.instanceMatrix; + if (name === "instanceColor" && object.instanceColor) + geometryAttribute = object.instanceColor; + } + if (cachedAttribute === void 0) + return true; + if (cachedAttribute.attribute !== geometryAttribute) + return true; + if (geometryAttribute && cachedAttribute.data !== geometryAttribute.data) + return true; + attributesNum++; + } + } + if (currentState.attributesNum !== attributesNum) + return true; + if (currentState.index !== index5) + return true; + return false; + } + function saveCache(object, geometry, program, index5) { + const cache = {}; + const attributes2 = geometry.attributes; + let attributesNum = 0; + const programAttributes = program.getAttributes(); + for (const name in programAttributes) { + const programAttribute = programAttributes[name]; + if (programAttribute.location >= 0) { + let attribute = attributes2[name]; + if (attribute === void 0) { + if (name === "instanceMatrix" && object.instanceMatrix) + attribute = object.instanceMatrix; + if (name === "instanceColor" && object.instanceColor) + attribute = object.instanceColor; + } + const data = {}; + data.attribute = attribute; + if (attribute && attribute.data) { + data.data = attribute.data; + } + cache[name] = data; + attributesNum++; + } + } + currentState.attributes = cache; + currentState.attributesNum = attributesNum; + currentState.index = index5; + } + function initAttributes() { + const newAttributes = currentState.newAttributes; + for (let i = 0, il = newAttributes.length; i < il; i++) { + newAttributes[i] = 0; + } + } + function enableAttribute(attribute) { + enableAttributeAndDivisor(attribute, 0); + } + function enableAttributeAndDivisor(attribute, meshPerAttribute) { + const newAttributes = currentState.newAttributes; + const enabledAttributes = currentState.enabledAttributes; + const attributeDivisors = currentState.attributeDivisors; + newAttributes[attribute] = 1; + if (enabledAttributes[attribute] === 0) { + gl.enableVertexAttribArray(attribute); + enabledAttributes[attribute] = 1; + } + if (attributeDivisors[attribute] !== meshPerAttribute) { + const extension2 = capabilities.isWebGL2 ? gl : extensions.get("ANGLE_instanced_arrays"); + extension2[capabilities.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](attribute, meshPerAttribute); + attributeDivisors[attribute] = meshPerAttribute; + } + } + function disableUnusedAttributes() { + const newAttributes = currentState.newAttributes; + const enabledAttributes = currentState.enabledAttributes; + for (let i = 0, il = enabledAttributes.length; i < il; i++) { + if (enabledAttributes[i] !== newAttributes[i]) { + gl.disableVertexAttribArray(i); + enabledAttributes[i] = 0; + } + } + } + function vertexAttribPointer(index5, size, type, normalized, stride, offset) { + if (capabilities.isWebGL2 === true && (type === 5124 || type === 5125)) { + gl.vertexAttribIPointer(index5, size, type, stride, offset); + } else { + gl.vertexAttribPointer(index5, size, type, normalized, stride, offset); + } + } + function setupVertexAttributes(object, material, program, geometry) { + if (capabilities.isWebGL2 === false && (object.isInstancedMesh || geometry.isInstancedBufferGeometry)) { + if (extensions.get("ANGLE_instanced_arrays") === null) + return; + } + initAttributes(); + const geometryAttributes = geometry.attributes; + const programAttributes = program.getAttributes(); + const materialDefaultAttributeValues = material.defaultAttributeValues; + for (const name in programAttributes) { + const programAttribute = programAttributes[name]; + if (programAttribute.location >= 0) { + let geometryAttribute = geometryAttributes[name]; + if (geometryAttribute === void 0) { + if (name === "instanceMatrix" && object.instanceMatrix) + geometryAttribute = object.instanceMatrix; + if (name === "instanceColor" && object.instanceColor) + geometryAttribute = object.instanceColor; + } + if (geometryAttribute !== void 0) { + const normalized = geometryAttribute.normalized; + const size = geometryAttribute.itemSize; + const attribute = attributes.get(geometryAttribute); + if (attribute === void 0) + continue; + const buffer = attribute.buffer; + const type = attribute.type; + const bytesPerElement = attribute.bytesPerElement; + if (geometryAttribute.isInterleavedBufferAttribute) { + const data = geometryAttribute.data; + const stride = data.stride; + const offset = geometryAttribute.offset; + if (data.isInstancedInterleavedBuffer) { + for (let i = 0; i < programAttribute.locationSize; i++) { + enableAttributeAndDivisor(programAttribute.location + i, data.meshPerAttribute); + } + if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) { + geometry._maxInstanceCount = data.meshPerAttribute * data.count; + } + } else { + for (let i = 0; i < programAttribute.locationSize; i++) { + enableAttribute(programAttribute.location + i); + } + } + gl.bindBuffer(34962, buffer); + for (let i = 0; i < programAttribute.locationSize; i++) { + vertexAttribPointer(programAttribute.location + i, size / programAttribute.locationSize, type, normalized, stride * bytesPerElement, (offset + size / programAttribute.locationSize * i) * bytesPerElement); + } + } else { + if (geometryAttribute.isInstancedBufferAttribute) { + for (let i = 0; i < programAttribute.locationSize; i++) { + enableAttributeAndDivisor(programAttribute.location + i, geometryAttribute.meshPerAttribute); + } + if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) { + geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; + } + } else { + for (let i = 0; i < programAttribute.locationSize; i++) { + enableAttribute(programAttribute.location + i); + } + } + gl.bindBuffer(34962, buffer); + for (let i = 0; i < programAttribute.locationSize; i++) { + vertexAttribPointer(programAttribute.location + i, size / programAttribute.locationSize, type, normalized, size * bytesPerElement, size / programAttribute.locationSize * i * bytesPerElement); + } + } + } else if (materialDefaultAttributeValues !== void 0) { + const value = materialDefaultAttributeValues[name]; + if (value !== void 0) { + switch (value.length) { + case 2: + gl.vertexAttrib2fv(programAttribute.location, value); + break; + case 3: + gl.vertexAttrib3fv(programAttribute.location, value); + break; + case 4: + gl.vertexAttrib4fv(programAttribute.location, value); + break; + default: + gl.vertexAttrib1fv(programAttribute.location, value); + } + } + } + } + } + disableUnusedAttributes(); + } + function dispose() { + reset(); + for (const geometryId in bindingStates) { + const programMap = bindingStates[geometryId]; + for (const programId in programMap) { + const stateMap = programMap[programId]; + for (const wireframe in stateMap) { + deleteVertexArrayObject(stateMap[wireframe].object); + delete stateMap[wireframe]; + } + delete programMap[programId]; + } + delete bindingStates[geometryId]; + } + } + function releaseStatesOfGeometry(geometry) { + if (bindingStates[geometry.id] === void 0) + return; + const programMap = bindingStates[geometry.id]; + for (const programId in programMap) { + const stateMap = programMap[programId]; + for (const wireframe in stateMap) { + deleteVertexArrayObject(stateMap[wireframe].object); + delete stateMap[wireframe]; + } + delete programMap[programId]; + } + delete bindingStates[geometry.id]; + } + function releaseStatesOfProgram(program) { + for (const geometryId in bindingStates) { + const programMap = bindingStates[geometryId]; + if (programMap[program.id] === void 0) + continue; + const stateMap = programMap[program.id]; + for (const wireframe in stateMap) { + deleteVertexArrayObject(stateMap[wireframe].object); + delete stateMap[wireframe]; + } + delete programMap[program.id]; + } + } + function reset() { + resetDefaultState(); + forceUpdate = true; + if (currentState === defaultState) + return; + currentState = defaultState; + bindVertexArrayObject(currentState.object); + } + function resetDefaultState() { + defaultState.geometry = null; + defaultState.program = null; + defaultState.wireframe = false; + } + return { + setup, + reset, + resetDefaultState, + dispose, + releaseStatesOfGeometry, + releaseStatesOfProgram, + initAttributes, + enableAttribute, + disableUnusedAttributes + }; +} +function WebGLBufferRenderer(gl, extensions, info, capabilities) { + const isWebGL2 = capabilities.isWebGL2; + let mode; + function setMode(value) { + mode = value; + } + function render(start, count) { + gl.drawArrays(mode, start, count); + info.update(count, mode, 1); + } + function renderInstances(start, count, primcount) { + if (primcount === 0) + return; + let extension, methodName; + if (isWebGL2) { + extension = gl; + methodName = "drawArraysInstanced"; + } else { + extension = extensions.get("ANGLE_instanced_arrays"); + methodName = "drawArraysInstancedANGLE"; + if (extension === null) { + console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); + return; + } + } + extension[methodName](mode, start, count, primcount); + info.update(count, mode, primcount); + } + this.setMode = setMode; + this.render = render; + this.renderInstances = renderInstances; +} +function WebGLCapabilities(gl, extensions, parameters) { + let maxAnisotropy; + function getMaxAnisotropy() { + if (maxAnisotropy !== void 0) + return maxAnisotropy; + if (extensions.has("EXT_texture_filter_anisotropic") === true) { + const extension = extensions.get("EXT_texture_filter_anisotropic"); + maxAnisotropy = gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT); + } else { + maxAnisotropy = 0; + } + return maxAnisotropy; + } + function getMaxPrecision(precision2) { + if (precision2 === "highp") { + if (gl.getShaderPrecisionFormat(35633, 36338).precision > 0 && gl.getShaderPrecisionFormat(35632, 36338).precision > 0) { + return "highp"; + } + precision2 = "mediump"; + } + if (precision2 === "mediump") { + if (gl.getShaderPrecisionFormat(35633, 36337).precision > 0 && gl.getShaderPrecisionFormat(35632, 36337).precision > 0) { + return "mediump"; + } + } + return "lowp"; + } + const isWebGL2 = typeof WebGL2RenderingContext !== "undefined" && gl instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext !== "undefined" && gl instanceof WebGL2ComputeRenderingContext; + let precision = parameters.precision !== void 0 ? parameters.precision : "highp"; + const maxPrecision = getMaxPrecision(precision); + if (maxPrecision !== precision) { + console.warn("THREE.WebGLRenderer:", precision, "not supported, using", maxPrecision, "instead."); + precision = maxPrecision; + } + const drawBuffers = isWebGL2 || extensions.has("WEBGL_draw_buffers"); + const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true; + const maxTextures = gl.getParameter(34930); + const maxVertexTextures = gl.getParameter(35660); + const maxTextureSize = gl.getParameter(3379); + const maxCubemapSize = gl.getParameter(34076); + const maxAttributes = gl.getParameter(34921); + const maxVertexUniforms = gl.getParameter(36347); + const maxVaryings = gl.getParameter(36348); + const maxFragmentUniforms = gl.getParameter(36349); + const vertexTextures = maxVertexTextures > 0; + const floatFragmentTextures = isWebGL2 || extensions.has("OES_texture_float"); + const floatVertexTextures = vertexTextures && floatFragmentTextures; + const maxSamples = isWebGL2 ? gl.getParameter(36183) : 0; + return { + isWebGL2, + drawBuffers, + getMaxAnisotropy, + getMaxPrecision, + precision, + logarithmicDepthBuffer, + maxTextures, + maxVertexTextures, + maxTextureSize, + maxCubemapSize, + maxAttributes, + maxVertexUniforms, + maxVaryings, + maxFragmentUniforms, + vertexTextures, + floatFragmentTextures, + floatVertexTextures, + maxSamples + }; +} +function WebGLClipping(properties) { + const scope = this; + let globalState = null, numGlobalPlanes = 0, localClippingEnabled = false, renderingShadows = false; + const plane = new Plane(), viewNormalMatrix = new Matrix3(), uniform = { value: null, needsUpdate: false }; + this.uniform = uniform; + this.numPlanes = 0; + this.numIntersection = 0; + this.init = function(planes, enableLocalClipping, camera3) { + const enabled = planes.length !== 0 || enableLocalClipping || numGlobalPlanes !== 0 || localClippingEnabled; + localClippingEnabled = enableLocalClipping; + globalState = projectPlanes(planes, camera3, 0); + numGlobalPlanes = planes.length; + return enabled; + }; + this.beginShadows = function() { + renderingShadows = true; + projectPlanes(null); + }; + this.endShadows = function() { + renderingShadows = false; + resetGlobalState(); + }; + this.setState = function(material, camera3, useCache) { + const planes = material.clippingPlanes, clipIntersection = material.clipIntersection, clipShadows = material.clipShadows; + const materialProperties = properties.get(material); + if (!localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && !clipShadows) { + if (renderingShadows) { + projectPlanes(null); + } else { + resetGlobalState(); + } + } else { + const nGlobal = renderingShadows ? 0 : numGlobalPlanes, lGlobal = nGlobal * 4; + let dstArray = materialProperties.clippingState || null; + uniform.value = dstArray; + dstArray = projectPlanes(planes, camera3, lGlobal, useCache); + for (let i = 0; i !== lGlobal; ++i) { + dstArray[i] = globalState[i]; + } + materialProperties.clippingState = dstArray; + this.numIntersection = clipIntersection ? this.numPlanes : 0; + this.numPlanes += nGlobal; + } + }; + function resetGlobalState() { + if (uniform.value !== globalState) { + uniform.value = globalState; + uniform.needsUpdate = numGlobalPlanes > 0; + } + scope.numPlanes = numGlobalPlanes; + scope.numIntersection = 0; + } + function projectPlanes(planes, camera3, dstOffset, skipTransform) { + const nPlanes = planes !== null ? planes.length : 0; + let dstArray = null; + if (nPlanes !== 0) { + dstArray = uniform.value; + if (skipTransform !== true || dstArray === null) { + const flatSize = dstOffset + nPlanes * 4, viewMatrix = camera3.matrixWorldInverse; + viewNormalMatrix.getNormalMatrix(viewMatrix); + if (dstArray === null || dstArray.length < flatSize) { + dstArray = new Float32Array(flatSize); + } + for (let i = 0, i4 = dstOffset; i !== nPlanes; ++i, i4 += 4) { + plane.copy(planes[i]).applyMatrix4(viewMatrix, viewNormalMatrix); + plane.normal.toArray(dstArray, i4); + dstArray[i4 + 3] = plane.constant; + } + } + uniform.value = dstArray; + uniform.needsUpdate = true; + } + scope.numPlanes = nPlanes; + scope.numIntersection = 0; + return dstArray; + } +} +function WebGLCubeMaps(renderer3) { + let cubemaps = /* @__PURE__ */ new WeakMap(); + function mapTextureMapping(texture, mapping) { + if (mapping === EquirectangularReflectionMapping) { + texture.mapping = CubeReflectionMapping; + } else if (mapping === EquirectangularRefractionMapping) { + texture.mapping = CubeRefractionMapping; + } + return texture; + } + function get2(texture) { + if (texture && texture.isTexture && texture.isRenderTargetTexture === false) { + const mapping = texture.mapping; + if (mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping) { + if (cubemaps.has(texture)) { + const cubemap = cubemaps.get(texture).texture; + return mapTextureMapping(cubemap, texture.mapping); + } else { + const image = texture.image; + if (image && image.height > 0) { + const renderTarget = new WebGLCubeRenderTarget(image.height / 2); + renderTarget.fromEquirectangularTexture(renderer3, texture); + cubemaps.set(texture, renderTarget); + texture.addEventListener("dispose", onTextureDispose); + return mapTextureMapping(renderTarget.texture, texture.mapping); + } else { + return null; + } + } + } + } + return texture; + } + function onTextureDispose(event) { + const texture = event.target; + texture.removeEventListener("dispose", onTextureDispose); + const cubemap = cubemaps.get(texture); + if (cubemap !== void 0) { + cubemaps.delete(texture); + cubemap.dispose(); + } + } + function dispose() { + cubemaps = /* @__PURE__ */ new WeakMap(); + } + return { + get: get2, + dispose + }; +} +var OrthographicCamera = class extends Camera { + constructor(left = -1, right = 1, top = 1, bottom = -1, near = 0.1, far = 2e3) { + super(); + this.isOrthographicCamera = true; + this.type = "OrthographicCamera"; + this.zoom = 1; + this.view = null; + this.left = left; + this.right = right; + this.top = top; + this.bottom = bottom; + this.near = near; + this.far = far; + this.updateProjectionMatrix(); + } + copy(source, recursive) { + super.copy(source, recursive); + this.left = source.left; + this.right = source.right; + this.top = source.top; + this.bottom = source.bottom; + this.near = source.near; + this.far = source.far; + this.zoom = source.zoom; + this.view = source.view === null ? null : Object.assign({}, source.view); + return this; + } + setViewOffset(fullWidth, fullHeight, x2, y2, width, height) { + if (this.view === null) { + this.view = { + enabled: true, + fullWidth: 1, + fullHeight: 1, + offsetX: 0, + offsetY: 0, + width: 1, + height: 1 + }; + } + this.view.enabled = true; + this.view.fullWidth = fullWidth; + this.view.fullHeight = fullHeight; + this.view.offsetX = x2; + this.view.offsetY = y2; + this.view.width = width; + this.view.height = height; + this.updateProjectionMatrix(); + } + clearViewOffset() { + if (this.view !== null) { + this.view.enabled = false; + } + this.updateProjectionMatrix(); + } + updateProjectionMatrix() { + const dx = (this.right - this.left) / (2 * this.zoom); + const dy = (this.top - this.bottom) / (2 * this.zoom); + const cx = (this.right + this.left) / 2; + const cy = (this.top + this.bottom) / 2; + let left = cx - dx; + let right = cx + dx; + let top = cy + dy; + let bottom = cy - dy; + if (this.view !== null && this.view.enabled) { + const scaleW = (this.right - this.left) / this.view.fullWidth / this.zoom; + const scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom; + left += scaleW * this.view.offsetX; + right = left + scaleW * this.view.width; + top -= scaleH * this.view.offsetY; + bottom = top - scaleH * this.view.height; + } + this.projectionMatrix.makeOrthographic(left, right, top, bottom, this.near, this.far); + this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); + } + toJSON(meta) { + const data = super.toJSON(meta); + data.object.zoom = this.zoom; + data.object.left = this.left; + data.object.right = this.right; + data.object.top = this.top; + data.object.bottom = this.bottom; + data.object.near = this.near; + data.object.far = this.far; + if (this.view !== null) + data.object.view = Object.assign({}, this.view); + return data; + } +}; +var LOD_MIN = 4; +var EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582]; +var MAX_SAMPLES = 20; +var _flatCamera = /* @__PURE__ */ new OrthographicCamera(); +var _clearColor = /* @__PURE__ */ new Color(); +var _oldTarget = null; +var PHI = (1 + Math.sqrt(5)) / 2; +var INV_PHI = 1 / PHI; +var _axisDirections = [ + /* @__PURE__ */ new Vector3(1, 1, 1), + /* @__PURE__ */ new Vector3(-1, 1, 1), + /* @__PURE__ */ new Vector3(1, 1, -1), + /* @__PURE__ */ new Vector3(-1, 1, -1), + /* @__PURE__ */ new Vector3(0, PHI, INV_PHI), + /* @__PURE__ */ new Vector3(0, PHI, -INV_PHI), + /* @__PURE__ */ new Vector3(INV_PHI, 0, PHI), + /* @__PURE__ */ new Vector3(-INV_PHI, 0, PHI), + /* @__PURE__ */ new Vector3(PHI, INV_PHI, 0), + /* @__PURE__ */ new Vector3(-PHI, INV_PHI, 0) +]; +var PMREMGenerator = class { + constructor(renderer3) { + this._renderer = renderer3; + this._pingPongRenderTarget = null; + this._lodMax = 0; + this._cubeSize = 0; + this._lodPlanes = []; + this._sizeLods = []; + this._sigmas = []; + this._blurMaterial = null; + this._cubemapMaterial = null; + this._equirectMaterial = null; + this._compileMaterial(this._blurMaterial); + } + fromScene(scene3, sigma = 0, near = 0.1, far = 100) { + _oldTarget = this._renderer.getRenderTarget(); + this._setSize(256); + const cubeUVRenderTarget = this._allocateTargets(); + cubeUVRenderTarget.depthBuffer = true; + this._sceneToCubeUV(scene3, near, far, cubeUVRenderTarget); + if (sigma > 0) { + this._blur(cubeUVRenderTarget, 0, 0, sigma); + } + this._applyPMREM(cubeUVRenderTarget); + this._cleanup(cubeUVRenderTarget); + return cubeUVRenderTarget; + } + fromEquirectangular(equirectangular, renderTarget = null) { + return this._fromTexture(equirectangular, renderTarget); + } + fromCubemap(cubemap, renderTarget = null) { + return this._fromTexture(cubemap, renderTarget); + } + compileCubemapShader() { + if (this._cubemapMaterial === null) { + this._cubemapMaterial = _getCubemapMaterial(); + this._compileMaterial(this._cubemapMaterial); + } + } + compileEquirectangularShader() { + if (this._equirectMaterial === null) { + this._equirectMaterial = _getEquirectMaterial(); + this._compileMaterial(this._equirectMaterial); + } + } + dispose() { + this._dispose(); + if (this._cubemapMaterial !== null) + this._cubemapMaterial.dispose(); + if (this._equirectMaterial !== null) + this._equirectMaterial.dispose(); + } + _setSize(cubeSize) { + this._lodMax = Math.floor(Math.log2(cubeSize)); + this._cubeSize = Math.pow(2, this._lodMax); + } + _dispose() { + if (this._blurMaterial !== null) + this._blurMaterial.dispose(); + if (this._pingPongRenderTarget !== null) + this._pingPongRenderTarget.dispose(); + for (let i = 0; i < this._lodPlanes.length; i++) { + this._lodPlanes[i].dispose(); + } + } + _cleanup(outputTarget) { + this._renderer.setRenderTarget(_oldTarget); + outputTarget.scissorTest = false; + _setViewport(outputTarget, 0, 0, outputTarget.width, outputTarget.height); + } + _fromTexture(texture, renderTarget) { + if (texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping) { + this._setSize(texture.image.length === 0 ? 16 : texture.image[0].width || texture.image[0].image.width); + } else { + this._setSize(texture.image.width / 4); + } + _oldTarget = this._renderer.getRenderTarget(); + const cubeUVRenderTarget = renderTarget || this._allocateTargets(); + this._textureToCubeUV(texture, cubeUVRenderTarget); + this._applyPMREM(cubeUVRenderTarget); + this._cleanup(cubeUVRenderTarget); + return cubeUVRenderTarget; + } + _allocateTargets() { + const width = 3 * Math.max(this._cubeSize, 16 * 7); + const height = 4 * this._cubeSize; + const params = { + magFilter: LinearFilter, + minFilter: LinearFilter, + generateMipmaps: false, + type: HalfFloatType, + format: RGBAFormat, + encoding: LinearEncoding, + depthBuffer: false + }; + const cubeUVRenderTarget = _createRenderTarget(width, height, params); + if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width) { + if (this._pingPongRenderTarget !== null) { + this._dispose(); + } + this._pingPongRenderTarget = _createRenderTarget(width, height, params); + const { _lodMax } = this; + ({ sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes(_lodMax)); + this._blurMaterial = _getBlurShader(_lodMax, width, height); + } + return cubeUVRenderTarget; + } + _compileMaterial(material) { + const tmpMesh = new Mesh(this._lodPlanes[0], material); + this._renderer.compile(tmpMesh, _flatCamera); + } + _sceneToCubeUV(scene3, near, far, cubeUVRenderTarget) { + const fov2 = 90; + const aspect2 = 1; + const cubeCamera = new PerspectiveCamera(fov2, aspect2, near, far); + const upSign = [1, -1, 1, 1, 1, 1]; + const forwardSign = [1, 1, 1, -1, -1, -1]; + const renderer3 = this._renderer; + const originalAutoClear = renderer3.autoClear; + const toneMapping = renderer3.toneMapping; + renderer3.getClearColor(_clearColor); + renderer3.toneMapping = NoToneMapping; + renderer3.autoClear = false; + const backgroundMaterial = new MeshBasicMaterial({ + name: "PMREM.Background", + side: BackSide, + depthWrite: false, + depthTest: false + }); + const backgroundBox = new Mesh(new BoxGeometry(), backgroundMaterial); + let useSolidColor = false; + const background = scene3.background; + if (background) { + if (background.isColor) { + backgroundMaterial.color.copy(background); + scene3.background = null; + useSolidColor = true; + } + } else { + backgroundMaterial.color.copy(_clearColor); + useSolidColor = true; + } + for (let i = 0; i < 6; i++) { + const col = i % 3; + if (col === 0) { + cubeCamera.up.set(0, upSign[i], 0); + cubeCamera.lookAt(forwardSign[i], 0, 0); + } else if (col === 1) { + cubeCamera.up.set(0, 0, upSign[i]); + cubeCamera.lookAt(0, forwardSign[i], 0); + } else { + cubeCamera.up.set(0, upSign[i], 0); + cubeCamera.lookAt(0, 0, forwardSign[i]); + } + const size = this._cubeSize; + _setViewport(cubeUVRenderTarget, col * size, i > 2 ? size : 0, size, size); + renderer3.setRenderTarget(cubeUVRenderTarget); + if (useSolidColor) { + renderer3.render(backgroundBox, cubeCamera); + } + renderer3.render(scene3, cubeCamera); + } + backgroundBox.geometry.dispose(); + backgroundBox.material.dispose(); + renderer3.toneMapping = toneMapping; + renderer3.autoClear = originalAutoClear; + scene3.background = background; + } + _textureToCubeUV(texture, cubeUVRenderTarget) { + const renderer3 = this._renderer; + const isCubeTexture = texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping; + if (isCubeTexture) { + if (this._cubemapMaterial === null) { + this._cubemapMaterial = _getCubemapMaterial(); + } + this._cubemapMaterial.uniforms.flipEnvMap.value = texture.isRenderTargetTexture === false ? -1 : 1; + } else { + if (this._equirectMaterial === null) { + this._equirectMaterial = _getEquirectMaterial(); + } + } + const material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial; + const mesh = new Mesh(this._lodPlanes[0], material); + const uniforms = material.uniforms; + uniforms["envMap"].value = texture; + const size = this._cubeSize; + _setViewport(cubeUVRenderTarget, 0, 0, 3 * size, 2 * size); + renderer3.setRenderTarget(cubeUVRenderTarget); + renderer3.render(mesh, _flatCamera); + } + _applyPMREM(cubeUVRenderTarget) { + const renderer3 = this._renderer; + const autoClear = renderer3.autoClear; + renderer3.autoClear = false; + for (let i = 1; i < this._lodPlanes.length; i++) { + const sigma = Math.sqrt(this._sigmas[i] * this._sigmas[i] - this._sigmas[i - 1] * this._sigmas[i - 1]); + const poleAxis = _axisDirections[(i - 1) % _axisDirections.length]; + this._blur(cubeUVRenderTarget, i - 1, i, sigma, poleAxis); + } + renderer3.autoClear = autoClear; + } + _blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) { + const pingPongRenderTarget = this._pingPongRenderTarget; + this._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, "latitudinal", poleAxis); + this._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, "longitudinal", poleAxis); + } + _halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) { + const renderer3 = this._renderer; + const blurMaterial = this._blurMaterial; + if (direction !== "latitudinal" && direction !== "longitudinal") { + console.error("blur direction must be either latitudinal or longitudinal!"); + } + const STANDARD_DEVIATIONS = 3; + const blurMesh = new Mesh(this._lodPlanes[lodOut], blurMaterial); + const blurUniforms = blurMaterial.uniforms; + const pixels = this._sizeLods[lodIn] - 1; + const radiansPerPixel = isFinite(sigmaRadians) ? Math.PI / (2 * pixels) : 2 * Math.PI / (2 * MAX_SAMPLES - 1); + const sigmaPixels = sigmaRadians / radiansPerPixel; + const samples = isFinite(sigmaRadians) ? 1 + Math.floor(STANDARD_DEVIATIONS * sigmaPixels) : MAX_SAMPLES; + if (samples > MAX_SAMPLES) { + console.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to ${MAX_SAMPLES}`); + } + const weights = []; + let sum = 0; + for (let i = 0; i < MAX_SAMPLES; ++i) { + const x3 = i / sigmaPixels; + const weight = Math.exp(-x3 * x3 / 2); + weights.push(weight); + if (i === 0) { + sum += weight; + } else if (i < samples) { + sum += 2 * weight; + } + } + for (let i = 0; i < weights.length; i++) { + weights[i] = weights[i] / sum; + } + blurUniforms["envMap"].value = targetIn.texture; + blurUniforms["samples"].value = samples; + blurUniforms["weights"].value = weights; + blurUniforms["latitudinal"].value = direction === "latitudinal"; + if (poleAxis) { + blurUniforms["poleAxis"].value = poleAxis; + } + const { _lodMax } = this; + blurUniforms["dTheta"].value = radiansPerPixel; + blurUniforms["mipInt"].value = _lodMax - lodIn; + const outputSize = this._sizeLods[lodOut]; + const x2 = 3 * outputSize * (lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0); + const y2 = 4 * (this._cubeSize - outputSize); + _setViewport(targetOut, x2, y2, 3 * outputSize, 2 * outputSize); + renderer3.setRenderTarget(targetOut); + renderer3.render(blurMesh, _flatCamera); + } +}; +function _createPlanes(lodMax) { + const lodPlanes = []; + const sizeLods = []; + const sigmas = []; + let lod = lodMax; + const totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length; + for (let i = 0; i < totalLods; i++) { + const sizeLod = Math.pow(2, lod); + sizeLods.push(sizeLod); + let sigma = 1 / sizeLod; + if (i > lodMax - LOD_MIN) { + sigma = EXTRA_LOD_SIGMA[i - lodMax + LOD_MIN - 1]; + } else if (i === 0) { + sigma = 0; + } + sigmas.push(sigma); + const texelSize = 1 / (sizeLod - 2); + const min2 = -texelSize; + const max2 = 1 + texelSize; + const uv1 = [min2, min2, max2, min2, max2, max2, min2, min2, max2, max2, min2, max2]; + const cubeFaces = 6; + const vertices = 6; + const positionSize = 3; + const uvSize = 2; + const faceIndexSize = 1; + const position = new Float32Array(positionSize * vertices * cubeFaces); + const uv = new Float32Array(uvSize * vertices * cubeFaces); + const faceIndex = new Float32Array(faceIndexSize * vertices * cubeFaces); + for (let face = 0; face < cubeFaces; face++) { + const x2 = face % 3 * 2 / 3 - 1; + const y2 = face > 2 ? 0 : -1; + const coordinates = [ + x2, + y2, + 0, + x2 + 2 / 3, + y2, + 0, + x2 + 2 / 3, + y2 + 1, + 0, + x2, + y2, + 0, + x2 + 2 / 3, + y2 + 1, + 0, + x2, + y2 + 1, + 0 + ]; + position.set(coordinates, positionSize * vertices * face); + uv.set(uv1, uvSize * vertices * face); + const fill = [face, face, face, face, face, face]; + faceIndex.set(fill, faceIndexSize * vertices * face); + } + const planes = new BufferGeometry(); + planes.setAttribute("position", new BufferAttribute(position, positionSize)); + planes.setAttribute("uv", new BufferAttribute(uv, uvSize)); + planes.setAttribute("faceIndex", new BufferAttribute(faceIndex, faceIndexSize)); + lodPlanes.push(planes); + if (lod > LOD_MIN) { + lod--; + } + } + return { lodPlanes, sizeLods, sigmas }; +} +function _createRenderTarget(width, height, params) { + const cubeUVRenderTarget = new WebGLRenderTarget(width, height, params); + cubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping; + cubeUVRenderTarget.texture.name = "PMREM.cubeUv"; + cubeUVRenderTarget.scissorTest = true; + return cubeUVRenderTarget; +} +function _setViewport(target, x2, y2, width, height) { + target.viewport.set(x2, y2, width, height); + target.scissor.set(x2, y2, width, height); +} +function _getBlurShader(lodMax, width, height) { + const weights = new Float32Array(MAX_SAMPLES); + const poleAxis = new Vector3(0, 1, 0); + const shaderMaterial = new ShaderMaterial({ + name: "SphericalGaussianBlur", + defines: { + "n": MAX_SAMPLES, + "CUBEUV_TEXEL_WIDTH": 1 / width, + "CUBEUV_TEXEL_HEIGHT": 1 / height, + "CUBEUV_MAX_MIP": `${lodMax}.0` + }, + uniforms: { + "envMap": { value: null }, + "samples": { value: 1 }, + "weights": { value: weights }, + "latitudinal": { value: false }, + "dTheta": { value: 0 }, + "mipInt": { value: 0 }, + "poleAxis": { value: poleAxis } + }, + vertexShader: _getCommonVertexShader(), + fragmentShader: ` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `, + blending: NoBlending, + depthTest: false, + depthWrite: false + }); + return shaderMaterial; +} +function _getEquirectMaterial() { + return new ShaderMaterial({ + name: "EquirectangularToCubeUV", + uniforms: { + "envMap": { value: null } + }, + vertexShader: _getCommonVertexShader(), + fragmentShader: ` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `, + blending: NoBlending, + depthTest: false, + depthWrite: false + }); +} +function _getCubemapMaterial() { + return new ShaderMaterial({ + name: "CubemapToCubeUV", + uniforms: { + "envMap": { value: null }, + "flipEnvMap": { value: -1 } + }, + vertexShader: _getCommonVertexShader(), + fragmentShader: ` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `, + blending: NoBlending, + depthTest: false, + depthWrite: false + }); +} +function _getCommonVertexShader() { + return ` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `; +} +function WebGLCubeUVMaps(renderer3) { + let cubeUVmaps = /* @__PURE__ */ new WeakMap(); + let pmremGenerator = null; + function get2(texture) { + if (texture && texture.isTexture) { + const mapping = texture.mapping; + const isEquirectMap = mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping; + const isCubeMap = mapping === CubeReflectionMapping || mapping === CubeRefractionMapping; + if (isEquirectMap || isCubeMap) { + if (texture.isRenderTargetTexture && texture.needsPMREMUpdate === true) { + texture.needsPMREMUpdate = false; + let renderTarget = cubeUVmaps.get(texture); + if (pmremGenerator === null) + pmremGenerator = new PMREMGenerator(renderer3); + renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture, renderTarget) : pmremGenerator.fromCubemap(texture, renderTarget); + cubeUVmaps.set(texture, renderTarget); + return renderTarget.texture; + } else { + if (cubeUVmaps.has(texture)) { + return cubeUVmaps.get(texture).texture; + } else { + const image = texture.image; + if (isEquirectMap && image && image.height > 0 || isCubeMap && image && isCubeTextureComplete(image)) { + if (pmremGenerator === null) + pmremGenerator = new PMREMGenerator(renderer3); + const renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture) : pmremGenerator.fromCubemap(texture); + cubeUVmaps.set(texture, renderTarget); + texture.addEventListener("dispose", onTextureDispose); + return renderTarget.texture; + } else { + return null; + } + } + } + } + } + return texture; + } + function isCubeTextureComplete(image) { + let count = 0; + const length = 6; + for (let i = 0; i < length; i++) { + if (image[i] !== void 0) + count++; + } + return count === length; + } + function onTextureDispose(event) { + const texture = event.target; + texture.removeEventListener("dispose", onTextureDispose); + const cubemapUV = cubeUVmaps.get(texture); + if (cubemapUV !== void 0) { + cubeUVmaps.delete(texture); + cubemapUV.dispose(); + } + } + function dispose() { + cubeUVmaps = /* @__PURE__ */ new WeakMap(); + if (pmremGenerator !== null) { + pmremGenerator.dispose(); + pmremGenerator = null; + } + } + return { + get: get2, + dispose + }; +} +function WebGLExtensions(gl) { + const extensions = {}; + function getExtension(name) { + if (extensions[name] !== void 0) { + return extensions[name]; + } + let extension; + switch (name) { + case "WEBGL_depth_texture": + extension = gl.getExtension("WEBGL_depth_texture") || gl.getExtension("MOZ_WEBGL_depth_texture") || gl.getExtension("WEBKIT_WEBGL_depth_texture"); + break; + case "EXT_texture_filter_anisotropic": + extension = gl.getExtension("EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic") || gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); + break; + case "WEBGL_compressed_texture_s3tc": + extension = gl.getExtension("WEBGL_compressed_texture_s3tc") || gl.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); + break; + case "WEBGL_compressed_texture_pvrtc": + extension = gl.getExtension("WEBGL_compressed_texture_pvrtc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); + break; + default: + extension = gl.getExtension(name); + } + extensions[name] = extension; + return extension; + } + return { + has: function(name) { + return getExtension(name) !== null; + }, + init: function(capabilities) { + if (capabilities.isWebGL2) { + getExtension("EXT_color_buffer_float"); + } else { + getExtension("WEBGL_depth_texture"); + getExtension("OES_texture_float"); + getExtension("OES_texture_half_float"); + getExtension("OES_texture_half_float_linear"); + getExtension("OES_standard_derivatives"); + getExtension("OES_element_index_uint"); + getExtension("OES_vertex_array_object"); + getExtension("ANGLE_instanced_arrays"); + } + getExtension("OES_texture_float_linear"); + getExtension("EXT_color_buffer_half_float"); + getExtension("WEBGL_multisampled_render_to_texture"); + }, + get: function(name) { + const extension = getExtension(name); + if (extension === null) { + console.warn("THREE.WebGLRenderer: " + name + " extension not supported."); + } + return extension; + } + }; +} +function WebGLGeometries(gl, attributes, info, bindingStates) { + const geometries = {}; + const wireframeAttributes = /* @__PURE__ */ new WeakMap(); + function onGeometryDispose(event) { + const geometry = event.target; + if (geometry.index !== null) { + attributes.remove(geometry.index); + } + for (const name in geometry.attributes) { + attributes.remove(geometry.attributes[name]); + } + geometry.removeEventListener("dispose", onGeometryDispose); + delete geometries[geometry.id]; + const attribute = wireframeAttributes.get(geometry); + if (attribute) { + attributes.remove(attribute); + wireframeAttributes.delete(geometry); + } + bindingStates.releaseStatesOfGeometry(geometry); + if (geometry.isInstancedBufferGeometry === true) { + delete geometry._maxInstanceCount; + } + info.memory.geometries--; + } + function get2(object, geometry) { + if (geometries[geometry.id] === true) + return geometry; + geometry.addEventListener("dispose", onGeometryDispose); + geometries[geometry.id] = true; + info.memory.geometries++; + return geometry; + } + function update4(geometry) { + const geometryAttributes = geometry.attributes; + for (const name in geometryAttributes) { + attributes.update(geometryAttributes[name], 34962); + } + const morphAttributes = geometry.morphAttributes; + for (const name in morphAttributes) { + const array = morphAttributes[name]; + for (let i = 0, l = array.length; i < l; i++) { + attributes.update(array[i], 34962); + } + } + } + function updateWireframeAttribute(geometry) { + const indices = []; + const geometryIndex = geometry.index; + const geometryPosition = geometry.attributes.position; + let version = 0; + if (geometryIndex !== null) { + const array = geometryIndex.array; + version = geometryIndex.version; + for (let i = 0, l = array.length; i < l; i += 3) { + const a2 = array[i + 0]; + const b = array[i + 1]; + const c2 = array[i + 2]; + indices.push(a2, b, b, c2, c2, a2); + } + } else { + const array = geometryPosition.array; + version = geometryPosition.version; + for (let i = 0, l = array.length / 3 - 1; i < l; i += 3) { + const a2 = i + 0; + const b = i + 1; + const c2 = i + 2; + indices.push(a2, b, b, c2, c2, a2); + } + } + const attribute = new (arrayNeedsUint32(indices) ? Uint32BufferAttribute : Uint16BufferAttribute)(indices, 1); + attribute.version = version; + const previousAttribute = wireframeAttributes.get(geometry); + if (previousAttribute) + attributes.remove(previousAttribute); + wireframeAttributes.set(geometry, attribute); + } + function getWireframeAttribute(geometry) { + const currentAttribute = wireframeAttributes.get(geometry); + if (currentAttribute) { + const geometryIndex = geometry.index; + if (geometryIndex !== null) { + if (currentAttribute.version < geometryIndex.version) { + updateWireframeAttribute(geometry); + } + } + } else { + updateWireframeAttribute(geometry); + } + return wireframeAttributes.get(geometry); + } + return { + get: get2, + update: update4, + getWireframeAttribute + }; +} +function WebGLIndexedBufferRenderer(gl, extensions, info, capabilities) { + const isWebGL2 = capabilities.isWebGL2; + let mode; + function setMode(value) { + mode = value; + } + let type, bytesPerElement; + function setIndex(value) { + type = value.type; + bytesPerElement = value.bytesPerElement; + } + function render(start, count) { + gl.drawElements(mode, count, type, start * bytesPerElement); + info.update(count, mode, 1); + } + function renderInstances(start, count, primcount) { + if (primcount === 0) + return; + let extension, methodName; + if (isWebGL2) { + extension = gl; + methodName = "drawElementsInstanced"; + } else { + extension = extensions.get("ANGLE_instanced_arrays"); + methodName = "drawElementsInstancedANGLE"; + if (extension === null) { + console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); + return; + } + } + extension[methodName](mode, count, type, start * bytesPerElement, primcount); + info.update(count, mode, primcount); + } + this.setMode = setMode; + this.setIndex = setIndex; + this.render = render; + this.renderInstances = renderInstances; +} +function WebGLInfo(gl) { + const memory = { + geometries: 0, + textures: 0 + }; + const render = { + frame: 0, + calls: 0, + triangles: 0, + points: 0, + lines: 0 + }; + function update4(count, mode, instanceCount) { + render.calls++; + switch (mode) { + case 4: + render.triangles += instanceCount * (count / 3); + break; + case 1: + render.lines += instanceCount * (count / 2); + break; + case 3: + render.lines += instanceCount * (count - 1); + break; + case 2: + render.lines += instanceCount * count; + break; + case 0: + render.points += instanceCount * count; + break; + default: + console.error("THREE.WebGLInfo: Unknown draw mode:", mode); + break; + } + } + function reset() { + render.frame++; + render.calls = 0; + render.triangles = 0; + render.points = 0; + render.lines = 0; + } + return { + memory, + render, + programs: null, + autoReset: true, + reset, + update: update4 + }; +} +function numericalSort(a2, b) { + return a2[0] - b[0]; +} +function absNumericalSort(a2, b) { + return Math.abs(b[1]) - Math.abs(a2[1]); +} +function denormalize(morph, attribute) { + let denominator = 1; + const array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array; + if (array instanceof Int8Array) + denominator = 127; + else if (array instanceof Uint8Array) + denominator = 255; + else if (array instanceof Uint16Array) + denominator = 65535; + else if (array instanceof Int16Array) + denominator = 32767; + else if (array instanceof Int32Array) + denominator = 2147483647; + else + console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ", array); + morph.divideScalar(denominator); +} +function WebGLMorphtargets(gl, capabilities, textures) { + const influencesList = {}; + const morphInfluences = new Float32Array(8); + const morphTextures = /* @__PURE__ */ new WeakMap(); + const morph = new Vector4(); + const workInfluences = []; + for (let i = 0; i < 8; i++) { + workInfluences[i] = [i, 0]; + } + function update4(object, geometry, material, program) { + const objectInfluences = object.morphTargetInfluences; + if (capabilities.isWebGL2 === true) { + const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; + const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0; + let entry = morphTextures.get(geometry); + if (entry === void 0 || entry.count !== morphTargetsCount) { + let disposeTexture = function() { + texture.dispose(); + morphTextures.delete(geometry); + geometry.removeEventListener("dispose", disposeTexture); + }; + if (entry !== void 0) + entry.texture.dispose(); + const hasMorphPosition = geometry.morphAttributes.position !== void 0; + const hasMorphNormals = geometry.morphAttributes.normal !== void 0; + const hasMorphColors = geometry.morphAttributes.color !== void 0; + const morphTargets = geometry.morphAttributes.position || []; + const morphNormals = geometry.morphAttributes.normal || []; + const morphColors = geometry.morphAttributes.color || []; + let vertexDataCount = 0; + if (hasMorphPosition === true) + vertexDataCount = 1; + if (hasMorphNormals === true) + vertexDataCount = 2; + if (hasMorphColors === true) + vertexDataCount = 3; + let width = geometry.attributes.position.count * vertexDataCount; + let height = 1; + if (width > capabilities.maxTextureSize) { + height = Math.ceil(width / capabilities.maxTextureSize); + width = capabilities.maxTextureSize; + } + const buffer = new Float32Array(width * height * 4 * morphTargetsCount); + const texture = new DataArrayTexture(buffer, width, height, morphTargetsCount); + texture.type = FloatType; + texture.needsUpdate = true; + const vertexDataStride = vertexDataCount * 4; + for (let i = 0; i < morphTargetsCount; i++) { + const morphTarget = morphTargets[i]; + const morphNormal = morphNormals[i]; + const morphColor = morphColors[i]; + const offset = width * height * 4 * i; + for (let j = 0; j < morphTarget.count; j++) { + const stride = j * vertexDataStride; + if (hasMorphPosition === true) { + morph.fromBufferAttribute(morphTarget, j); + if (morphTarget.normalized === true) + denormalize(morph, morphTarget); + buffer[offset + stride + 0] = morph.x; + buffer[offset + stride + 1] = morph.y; + buffer[offset + stride + 2] = morph.z; + buffer[offset + stride + 3] = 0; + } + if (hasMorphNormals === true) { + morph.fromBufferAttribute(morphNormal, j); + if (morphNormal.normalized === true) + denormalize(morph, morphNormal); + buffer[offset + stride + 4] = morph.x; + buffer[offset + stride + 5] = morph.y; + buffer[offset + stride + 6] = morph.z; + buffer[offset + stride + 7] = 0; + } + if (hasMorphColors === true) { + morph.fromBufferAttribute(morphColor, j); + if (morphColor.normalized === true) + denormalize(morph, morphColor); + buffer[offset + stride + 8] = morph.x; + buffer[offset + stride + 9] = morph.y; + buffer[offset + stride + 10] = morph.z; + buffer[offset + stride + 11] = morphColor.itemSize === 4 ? morph.w : 1; + } + } + } + entry = { + count: morphTargetsCount, + texture, + size: new Vector2(width, height) + }; + morphTextures.set(geometry, entry); + geometry.addEventListener("dispose", disposeTexture); + } + let morphInfluencesSum = 0; + for (let i = 0; i < objectInfluences.length; i++) { + morphInfluencesSum += objectInfluences[i]; + } + const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; + program.getUniforms().setValue(gl, "morphTargetBaseInfluence", morphBaseInfluence); + program.getUniforms().setValue(gl, "morphTargetInfluences", objectInfluences); + program.getUniforms().setValue(gl, "morphTargetsTexture", entry.texture, textures); + program.getUniforms().setValue(gl, "morphTargetsTextureSize", entry.size); + } else { + const length = objectInfluences === void 0 ? 0 : objectInfluences.length; + let influences = influencesList[geometry.id]; + if (influences === void 0 || influences.length !== length) { + influences = []; + for (let i = 0; i < length; i++) { + influences[i] = [i, 0]; + } + influencesList[geometry.id] = influences; + } + for (let i = 0; i < length; i++) { + const influence = influences[i]; + influence[0] = i; + influence[1] = objectInfluences[i]; + } + influences.sort(absNumericalSort); + for (let i = 0; i < 8; i++) { + if (i < length && influences[i][1]) { + workInfluences[i][0] = influences[i][0]; + workInfluences[i][1] = influences[i][1]; + } else { + workInfluences[i][0] = Number.MAX_SAFE_INTEGER; + workInfluences[i][1] = 0; + } + } + workInfluences.sort(numericalSort); + const morphTargets = geometry.morphAttributes.position; + const morphNormals = geometry.morphAttributes.normal; + let morphInfluencesSum = 0; + for (let i = 0; i < 8; i++) { + const influence = workInfluences[i]; + const index5 = influence[0]; + const value = influence[1]; + if (index5 !== Number.MAX_SAFE_INTEGER && value) { + if (morphTargets && geometry.getAttribute("morphTarget" + i) !== morphTargets[index5]) { + geometry.setAttribute("morphTarget" + i, morphTargets[index5]); + } + if (morphNormals && geometry.getAttribute("morphNormal" + i) !== morphNormals[index5]) { + geometry.setAttribute("morphNormal" + i, morphNormals[index5]); + } + morphInfluences[i] = value; + morphInfluencesSum += value; + } else { + if (morphTargets && geometry.hasAttribute("morphTarget" + i) === true) { + geometry.deleteAttribute("morphTarget" + i); + } + if (morphNormals && geometry.hasAttribute("morphNormal" + i) === true) { + geometry.deleteAttribute("morphNormal" + i); + } + morphInfluences[i] = 0; + } + } + const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; + program.getUniforms().setValue(gl, "morphTargetBaseInfluence", morphBaseInfluence); + program.getUniforms().setValue(gl, "morphTargetInfluences", morphInfluences); + } + } + return { + update: update4 + }; +} +function WebGLObjects(gl, geometries, attributes, info) { + let updateMap = /* @__PURE__ */ new WeakMap(); + function update4(object) { + const frame2 = info.render.frame; + const geometry = object.geometry; + const buffergeometry = geometries.get(object, geometry); + if (updateMap.get(buffergeometry) !== frame2) { + geometries.update(buffergeometry); + updateMap.set(buffergeometry, frame2); + } + if (object.isInstancedMesh) { + if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) { + object.addEventListener("dispose", onInstancedMeshDispose); + } + attributes.update(object.instanceMatrix, 34962); + if (object.instanceColor !== null) { + attributes.update(object.instanceColor, 34962); + } + } + return buffergeometry; + } + function dispose() { + updateMap = /* @__PURE__ */ new WeakMap(); + } + function onInstancedMeshDispose(event) { + const instancedMesh = event.target; + instancedMesh.removeEventListener("dispose", onInstancedMeshDispose); + attributes.remove(instancedMesh.instanceMatrix); + if (instancedMesh.instanceColor !== null) + attributes.remove(instancedMesh.instanceColor); + } + return { + update: update4, + dispose + }; +} +var emptyTexture = /* @__PURE__ */ new Texture(); +var emptyArrayTexture = /* @__PURE__ */ new DataArrayTexture(); +var empty3dTexture = /* @__PURE__ */ new Data3DTexture(); +var emptyCubeTexture = /* @__PURE__ */ new CubeTexture(); +var arrayCacheF32 = []; +var arrayCacheI32 = []; +var mat4array = new Float32Array(16); +var mat3array = new Float32Array(9); +var mat2array = new Float32Array(4); +function flatten(array, nBlocks, blockSize) { + const firstElem = array[0]; + if (firstElem <= 0 || firstElem > 0) + return array; + const n = nBlocks * blockSize; + let r = arrayCacheF32[n]; + if (r === void 0) { + r = new Float32Array(n); + arrayCacheF32[n] = r; + } + if (nBlocks !== 0) { + firstElem.toArray(r, 0); + for (let i = 1, offset = 0; i !== nBlocks; ++i) { + offset += blockSize; + array[i].toArray(r, offset); + } + } + return r; +} +function arraysEqual(a2, b) { + if (a2.length !== b.length) + return false; + for (let i = 0, l = a2.length; i < l; i++) { + if (a2[i] !== b[i]) + return false; + } + return true; +} +function copyArray(a2, b) { + for (let i = 0, l = b.length; i < l; i++) { + a2[i] = b[i]; + } +} +function allocTexUnits(textures, n) { + let r = arrayCacheI32[n]; + if (r === void 0) { + r = new Int32Array(n); + arrayCacheI32[n] = r; + } + for (let i = 0; i !== n; ++i) { + r[i] = textures.allocateTextureUnit(); + } + return r; +} +function setValueV1f(gl, v) { + const cache = this.cache; + if (cache[0] === v) + return; + gl.uniform1f(this.addr, v); + cache[0] = v; +} +function setValueV2f(gl, v) { + const cache = this.cache; + if (v.x !== void 0) { + if (cache[0] !== v.x || cache[1] !== v.y) { + gl.uniform2f(this.addr, v.x, v.y); + cache[0] = v.x; + cache[1] = v.y; + } + } else { + if (arraysEqual(cache, v)) + return; + gl.uniform2fv(this.addr, v); + copyArray(cache, v); + } +} +function setValueV3f(gl, v) { + const cache = this.cache; + if (v.x !== void 0) { + if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) { + gl.uniform3f(this.addr, v.x, v.y, v.z); + cache[0] = v.x; + cache[1] = v.y; + cache[2] = v.z; + } + } else if (v.r !== void 0) { + if (cache[0] !== v.r || cache[1] !== v.g || cache[2] !== v.b) { + gl.uniform3f(this.addr, v.r, v.g, v.b); + cache[0] = v.r; + cache[1] = v.g; + cache[2] = v.b; + } + } else { + if (arraysEqual(cache, v)) + return; + gl.uniform3fv(this.addr, v); + copyArray(cache, v); + } +} +function setValueV4f(gl, v) { + const cache = this.cache; + if (v.x !== void 0) { + if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) { + gl.uniform4f(this.addr, v.x, v.y, v.z, v.w); + cache[0] = v.x; + cache[1] = v.y; + cache[2] = v.z; + cache[3] = v.w; + } + } else { + if (arraysEqual(cache, v)) + return; + gl.uniform4fv(this.addr, v); + copyArray(cache, v); + } +} +function setValueM2(gl, v) { + const cache = this.cache; + const elements = v.elements; + if (elements === void 0) { + if (arraysEqual(cache, v)) + return; + gl.uniformMatrix2fv(this.addr, false, v); + copyArray(cache, v); + } else { + if (arraysEqual(cache, elements)) + return; + mat2array.set(elements); + gl.uniformMatrix2fv(this.addr, false, mat2array); + copyArray(cache, elements); + } +} +function setValueM3(gl, v) { + const cache = this.cache; + const elements = v.elements; + if (elements === void 0) { + if (arraysEqual(cache, v)) + return; + gl.uniformMatrix3fv(this.addr, false, v); + copyArray(cache, v); + } else { + if (arraysEqual(cache, elements)) + return; + mat3array.set(elements); + gl.uniformMatrix3fv(this.addr, false, mat3array); + copyArray(cache, elements); + } +} +function setValueM4(gl, v) { + const cache = this.cache; + const elements = v.elements; + if (elements === void 0) { + if (arraysEqual(cache, v)) + return; + gl.uniformMatrix4fv(this.addr, false, v); + copyArray(cache, v); + } else { + if (arraysEqual(cache, elements)) + return; + mat4array.set(elements); + gl.uniformMatrix4fv(this.addr, false, mat4array); + copyArray(cache, elements); + } +} +function setValueV1i(gl, v) { + const cache = this.cache; + if (cache[0] === v) + return; + gl.uniform1i(this.addr, v); + cache[0] = v; +} +function setValueV2i(gl, v) { + const cache = this.cache; + if (arraysEqual(cache, v)) + return; + gl.uniform2iv(this.addr, v); + copyArray(cache, v); +} +function setValueV3i(gl, v) { + const cache = this.cache; + if (arraysEqual(cache, v)) + return; + gl.uniform3iv(this.addr, v); + copyArray(cache, v); +} +function setValueV4i(gl, v) { + const cache = this.cache; + if (arraysEqual(cache, v)) + return; + gl.uniform4iv(this.addr, v); + copyArray(cache, v); +} +function setValueV1ui(gl, v) { + const cache = this.cache; + if (cache[0] === v) + return; + gl.uniform1ui(this.addr, v); + cache[0] = v; +} +function setValueV2ui(gl, v) { + const cache = this.cache; + if (arraysEqual(cache, v)) + return; + gl.uniform2uiv(this.addr, v); + copyArray(cache, v); +} +function setValueV3ui(gl, v) { + const cache = this.cache; + if (arraysEqual(cache, v)) + return; + gl.uniform3uiv(this.addr, v); + copyArray(cache, v); +} +function setValueV4ui(gl, v) { + const cache = this.cache; + if (arraysEqual(cache, v)) + return; + gl.uniform4uiv(this.addr, v); + copyArray(cache, v); +} +function setValueT1(gl, v, textures) { + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + if (cache[0] !== unit) { + gl.uniform1i(this.addr, unit); + cache[0] = unit; + } + textures.setTexture2D(v || emptyTexture, unit); +} +function setValueT3D1(gl, v, textures) { + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + if (cache[0] !== unit) { + gl.uniform1i(this.addr, unit); + cache[0] = unit; + } + textures.setTexture3D(v || empty3dTexture, unit); +} +function setValueT6(gl, v, textures) { + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + if (cache[0] !== unit) { + gl.uniform1i(this.addr, unit); + cache[0] = unit; + } + textures.setTextureCube(v || emptyCubeTexture, unit); +} +function setValueT2DArray1(gl, v, textures) { + const cache = this.cache; + const unit = textures.allocateTextureUnit(); + if (cache[0] !== unit) { + gl.uniform1i(this.addr, unit); + cache[0] = unit; + } + textures.setTexture2DArray(v || emptyArrayTexture, unit); +} +function getSingularSetter(type) { + switch (type) { + case 5126: + return setValueV1f; + case 35664: + return setValueV2f; + case 35665: + return setValueV3f; + case 35666: + return setValueV4f; + case 35674: + return setValueM2; + case 35675: + return setValueM3; + case 35676: + return setValueM4; + case 5124: + case 35670: + return setValueV1i; + case 35667: + case 35671: + return setValueV2i; + case 35668: + case 35672: + return setValueV3i; + case 35669: + case 35673: + return setValueV4i; + case 5125: + return setValueV1ui; + case 36294: + return setValueV2ui; + case 36295: + return setValueV3ui; + case 36296: + return setValueV4ui; + case 35678: + case 36198: + case 36298: + case 36306: + case 35682: + return setValueT1; + case 35679: + case 36299: + case 36307: + return setValueT3D1; + case 35680: + case 36300: + case 36308: + case 36293: + return setValueT6; + case 36289: + case 36303: + case 36311: + case 36292: + return setValueT2DArray1; + } +} +function setValueV1fArray(gl, v) { + gl.uniform1fv(this.addr, v); +} +function setValueV2fArray(gl, v) { + const data = flatten(v, this.size, 2); + gl.uniform2fv(this.addr, data); +} +function setValueV3fArray(gl, v) { + const data = flatten(v, this.size, 3); + gl.uniform3fv(this.addr, data); +} +function setValueV4fArray(gl, v) { + const data = flatten(v, this.size, 4); + gl.uniform4fv(this.addr, data); +} +function setValueM2Array(gl, v) { + const data = flatten(v, this.size, 4); + gl.uniformMatrix2fv(this.addr, false, data); +} +function setValueM3Array(gl, v) { + const data = flatten(v, this.size, 9); + gl.uniformMatrix3fv(this.addr, false, data); +} +function setValueM4Array(gl, v) { + const data = flatten(v, this.size, 16); + gl.uniformMatrix4fv(this.addr, false, data); +} +function setValueV1iArray(gl, v) { + gl.uniform1iv(this.addr, v); +} +function setValueV2iArray(gl, v) { + gl.uniform2iv(this.addr, v); +} +function setValueV3iArray(gl, v) { + gl.uniform3iv(this.addr, v); +} +function setValueV4iArray(gl, v) { + gl.uniform4iv(this.addr, v); +} +function setValueV1uiArray(gl, v) { + gl.uniform1uiv(this.addr, v); +} +function setValueV2uiArray(gl, v) { + gl.uniform2uiv(this.addr, v); +} +function setValueV3uiArray(gl, v) { + gl.uniform3uiv(this.addr, v); +} +function setValueV4uiArray(gl, v) { + gl.uniform4uiv(this.addr, v); +} +function setValueT1Array(gl, v, textures) { + const n = v.length; + const units = allocTexUnits(textures, n); + gl.uniform1iv(this.addr, units); + for (let i = 0; i !== n; ++i) { + textures.setTexture2D(v[i] || emptyTexture, units[i]); + } +} +function setValueT3DArray(gl, v, textures) { + const n = v.length; + const units = allocTexUnits(textures, n); + gl.uniform1iv(this.addr, units); + for (let i = 0; i !== n; ++i) { + textures.setTexture3D(v[i] || empty3dTexture, units[i]); + } +} +function setValueT6Array(gl, v, textures) { + const n = v.length; + const units = allocTexUnits(textures, n); + gl.uniform1iv(this.addr, units); + for (let i = 0; i !== n; ++i) { + textures.setTextureCube(v[i] || emptyCubeTexture, units[i]); + } +} +function setValueT2DArrayArray(gl, v, textures) { + const n = v.length; + const units = allocTexUnits(textures, n); + gl.uniform1iv(this.addr, units); + for (let i = 0; i !== n; ++i) { + textures.setTexture2DArray(v[i] || emptyArrayTexture, units[i]); + } +} +function getPureArraySetter(type) { + switch (type) { + case 5126: + return setValueV1fArray; + case 35664: + return setValueV2fArray; + case 35665: + return setValueV3fArray; + case 35666: + return setValueV4fArray; + case 35674: + return setValueM2Array; + case 35675: + return setValueM3Array; + case 35676: + return setValueM4Array; + case 5124: + case 35670: + return setValueV1iArray; + case 35667: + case 35671: + return setValueV2iArray; + case 35668: + case 35672: + return setValueV3iArray; + case 35669: + case 35673: + return setValueV4iArray; + case 5125: + return setValueV1uiArray; + case 36294: + return setValueV2uiArray; + case 36295: + return setValueV3uiArray; + case 36296: + return setValueV4uiArray; + case 35678: + case 36198: + case 36298: + case 36306: + case 35682: + return setValueT1Array; + case 35679: + case 36299: + case 36307: + return setValueT3DArray; + case 35680: + case 36300: + case 36308: + case 36293: + return setValueT6Array; + case 36289: + case 36303: + case 36311: + case 36292: + return setValueT2DArrayArray; + } +} +var SingleUniform = class { + constructor(id, activeInfo, addr) { + this.id = id; + this.addr = addr; + this.cache = []; + this.setValue = getSingularSetter(activeInfo.type); + } +}; +var PureArrayUniform = class { + constructor(id, activeInfo, addr) { + this.id = id; + this.addr = addr; + this.cache = []; + this.size = activeInfo.size; + this.setValue = getPureArraySetter(activeInfo.type); + } +}; +var StructuredUniform = class { + constructor(id) { + this.id = id; + this.seq = []; + this.map = {}; + } + setValue(gl, value, textures) { + const seq = this.seq; + for (let i = 0, n = seq.length; i !== n; ++i) { + const u = seq[i]; + u.setValue(gl, value[u.id], textures); + } + } +}; +var RePathPart = /(\w+)(\])?(\[|\.)?/g; +function addUniform(container, uniformObject) { + container.seq.push(uniformObject); + container.map[uniformObject.id] = uniformObject; +} +function parseUniform(activeInfo, addr, container) { + const path = activeInfo.name, pathLength = path.length; + RePathPart.lastIndex = 0; + while (true) { + const match = RePathPart.exec(path), matchEnd = RePathPart.lastIndex; + let id = match[1]; + const idIsIndex = match[2] === "]", subscript = match[3]; + if (idIsIndex) + id = id | 0; + if (subscript === void 0 || subscript === "[" && matchEnd + 2 === pathLength) { + addUniform(container, subscript === void 0 ? new SingleUniform(id, activeInfo, addr) : new PureArrayUniform(id, activeInfo, addr)); + break; + } else { + const map = container.map; + let next = map[id]; + if (next === void 0) { + next = new StructuredUniform(id); + addUniform(container, next); + } + container = next; + } + } +} +var WebGLUniforms = class { + constructor(gl, program) { + this.seq = []; + this.map = {}; + const n = gl.getProgramParameter(program, 35718); + for (let i = 0; i < n; ++i) { + const info = gl.getActiveUniform(program, i), addr = gl.getUniformLocation(program, info.name); + parseUniform(info, addr, this); + } + } + setValue(gl, name, value, textures) { + const u = this.map[name]; + if (u !== void 0) + u.setValue(gl, value, textures); + } + setOptional(gl, object, name) { + const v = object[name]; + if (v !== void 0) + this.setValue(gl, name, v); + } + static upload(gl, seq, values, textures) { + for (let i = 0, n = seq.length; i !== n; ++i) { + const u = seq[i], v = values[u.id]; + if (v.needsUpdate !== false) { + u.setValue(gl, v.value, textures); + } + } + } + static seqWithValue(seq, values) { + const r = []; + for (let i = 0, n = seq.length; i !== n; ++i) { + const u = seq[i]; + if (u.id in values) + r.push(u); + } + return r; + } +}; +function WebGLShader(gl, type, string) { + const shader = gl.createShader(type); + gl.shaderSource(shader, string); + gl.compileShader(shader); + return shader; +} +var programIdCount = 0; +function handleSource(string, errorLine) { + const lines = string.split("\n"); + const lines2 = []; + const from = Math.max(errorLine - 6, 0); + const to = Math.min(errorLine + 6, lines.length); + for (let i = from; i < to; i++) { + const line = i + 1; + lines2.push(`${line === errorLine ? ">" : " "} ${line}: ${lines[i]}`); + } + return lines2.join("\n"); +} +function getEncodingComponents(encoding) { + switch (encoding) { + case LinearEncoding: + return ["Linear", "( value )"]; + case sRGBEncoding: + return ["sRGB", "( value )"]; + default: + console.warn("THREE.WebGLProgram: Unsupported encoding:", encoding); + return ["Linear", "( value )"]; + } +} +function getShaderErrors(gl, shader, type) { + const status = gl.getShaderParameter(shader, 35713); + const errors = gl.getShaderInfoLog(shader).trim(); + if (status && errors === "") + return ""; + const errorMatches = /ERROR: 0:(\d+)/.exec(errors); + if (errorMatches) { + const errorLine = parseInt(errorMatches[1]); + return type.toUpperCase() + "\n\n" + errors + "\n\n" + handleSource(gl.getShaderSource(shader), errorLine); + } else { + return errors; + } +} +function getTexelEncodingFunction(functionName, encoding) { + const components = getEncodingComponents(encoding); + return "vec4 " + functionName + "( vec4 value ) { return LinearTo" + components[0] + components[1] + "; }"; +} +function getToneMappingFunction(functionName, toneMapping) { + let toneMappingName; + switch (toneMapping) { + case LinearToneMapping: + toneMappingName = "Linear"; + break; + case ReinhardToneMapping: + toneMappingName = "Reinhard"; + break; + case CineonToneMapping: + toneMappingName = "OptimizedCineon"; + break; + case ACESFilmicToneMapping: + toneMappingName = "ACESFilmic"; + break; + case CustomToneMapping: + toneMappingName = "Custom"; + break; + default: + console.warn("THREE.WebGLProgram: Unsupported toneMapping:", toneMapping); + toneMappingName = "Linear"; + } + return "vec3 " + functionName + "( vec3 color ) { return " + toneMappingName + "ToneMapping( color ); }"; +} +function generateExtensions(parameters) { + const chunks = [ + parameters.extensionDerivatives || !!parameters.envMapCubeUVHeight || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "", + (parameters.extensionFragDepth || parameters.logarithmicDepthBuffer) && parameters.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "", + parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "", + (parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission) && parameters.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : "" + ]; + return chunks.filter(filterEmptyLine).join("\n"); +} +function generateDefines(defines) { + const chunks = []; + for (const name in defines) { + const value = defines[name]; + if (value === false) + continue; + chunks.push("#define " + name + " " + value); + } + return chunks.join("\n"); +} +function fetchAttributeLocations(gl, program) { + const attributes = {}; + const n = gl.getProgramParameter(program, 35721); + for (let i = 0; i < n; i++) { + const info = gl.getActiveAttrib(program, i); + const name = info.name; + let locationSize = 1; + if (info.type === 35674) + locationSize = 2; + if (info.type === 35675) + locationSize = 3; + if (info.type === 35676) + locationSize = 4; + attributes[name] = { + type: info.type, + location: gl.getAttribLocation(program, name), + locationSize + }; + } + return attributes; +} +function filterEmptyLine(string) { + return string !== ""; +} +function replaceLightNums(string, parameters) { + return string.replace(/NUM_DIR_LIGHTS/g, parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g, parameters.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g, parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows); +} +function replaceClippingPlaneNums(string, parameters) { + return string.replace(/NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, parameters.numClippingPlanes - parameters.numClipIntersection); +} +var includePattern = /^[ \t]*#include +<([\w\d./]+)>/gm; +function resolveIncludes(string) { + return string.replace(includePattern, includeReplacer); +} +function includeReplacer(match, include) { + const string = ShaderChunk[include]; + if (string === void 0) { + throw new Error("Can not resolve #include <" + include + ">"); + } + return resolveIncludes(string); +} +var deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; +var unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g; +function unrollLoops(string) { + return string.replace(unrollLoopPattern, loopReplacer).replace(deprecatedUnrollLoopPattern, deprecatedLoopReplacer); +} +function deprecatedLoopReplacer(match, start, end, snippet) { + console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."); + return loopReplacer(match, start, end, snippet); +} +function loopReplacer(match, start, end, snippet) { + let string = ""; + for (let i = parseInt(start); i < parseInt(end); i++) { + string += snippet.replace(/\[\s*i\s*\]/g, "[ " + i + " ]").replace(/UNROLLED_LOOP_INDEX/g, i); + } + return string; +} +function generatePrecision(parameters) { + let precisionstring = "precision " + parameters.precision + " float;\nprecision " + parameters.precision + " int;"; + if (parameters.precision === "highp") { + precisionstring += "\n#define HIGH_PRECISION"; + } else if (parameters.precision === "mediump") { + precisionstring += "\n#define MEDIUM_PRECISION"; + } else if (parameters.precision === "lowp") { + precisionstring += "\n#define LOW_PRECISION"; + } + return precisionstring; +} +function generateShadowMapTypeDefine(parameters) { + let shadowMapTypeDefine = "SHADOWMAP_TYPE_BASIC"; + if (parameters.shadowMapType === PCFShadowMap) { + shadowMapTypeDefine = "SHADOWMAP_TYPE_PCF"; + } else if (parameters.shadowMapType === PCFSoftShadowMap) { + shadowMapTypeDefine = "SHADOWMAP_TYPE_PCF_SOFT"; + } else if (parameters.shadowMapType === VSMShadowMap) { + shadowMapTypeDefine = "SHADOWMAP_TYPE_VSM"; + } + return shadowMapTypeDefine; +} +function generateEnvMapTypeDefine(parameters) { + let envMapTypeDefine = "ENVMAP_TYPE_CUBE"; + if (parameters.envMap) { + switch (parameters.envMapMode) { + case CubeReflectionMapping: + case CubeRefractionMapping: + envMapTypeDefine = "ENVMAP_TYPE_CUBE"; + break; + case CubeUVReflectionMapping: + envMapTypeDefine = "ENVMAP_TYPE_CUBE_UV"; + break; + } + } + return envMapTypeDefine; +} +function generateEnvMapModeDefine(parameters) { + let envMapModeDefine = "ENVMAP_MODE_REFLECTION"; + if (parameters.envMap) { + switch (parameters.envMapMode) { + case CubeRefractionMapping: + envMapModeDefine = "ENVMAP_MODE_REFRACTION"; + break; + } + } + return envMapModeDefine; +} +function generateEnvMapBlendingDefine(parameters) { + let envMapBlendingDefine = "ENVMAP_BLENDING_NONE"; + if (parameters.envMap) { + switch (parameters.combine) { + case MultiplyOperation: + envMapBlendingDefine = "ENVMAP_BLENDING_MULTIPLY"; + break; + case MixOperation: + envMapBlendingDefine = "ENVMAP_BLENDING_MIX"; + break; + case AddOperation: + envMapBlendingDefine = "ENVMAP_BLENDING_ADD"; + break; + } + } + return envMapBlendingDefine; +} +function generateCubeUVSize(parameters) { + const imageHeight = parameters.envMapCubeUVHeight; + if (imageHeight === null) + return null; + const maxMip = Math.log2(imageHeight) - 2; + const texelHeight = 1 / imageHeight; + const texelWidth = 1 / (3 * Math.max(Math.pow(2, maxMip), 7 * 16)); + return { texelWidth, texelHeight, maxMip }; +} +function WebGLProgram(renderer3, cacheKey, parameters, bindingStates) { + const gl = renderer3.getContext(); + const defines = parameters.defines; + let vertexShader = parameters.vertexShader; + let fragmentShader = parameters.fragmentShader; + const shadowMapTypeDefine = generateShadowMapTypeDefine(parameters); + const envMapTypeDefine = generateEnvMapTypeDefine(parameters); + const envMapModeDefine = generateEnvMapModeDefine(parameters); + const envMapBlendingDefine = generateEnvMapBlendingDefine(parameters); + const envMapCubeUVSize = generateCubeUVSize(parameters); + const customExtensions = parameters.isWebGL2 ? "" : generateExtensions(parameters); + const customDefines = generateDefines(defines); + const program = gl.createProgram(); + let prefixVertex, prefixFragment; + let versionString = parameters.glslVersion ? "#version " + parameters.glslVersion + "\n" : ""; + if (parameters.isRawShaderMaterial) { + prefixVertex = [ + customDefines + ].filter(filterEmptyLine).join("\n"); + if (prefixVertex.length > 0) { + prefixVertex += "\n"; + } + prefixFragment = [ + customExtensions, + customDefines + ].filter(filterEmptyLine).join("\n"); + if (prefixFragment.length > 0) { + prefixFragment += "\n"; + } + } else { + prefixVertex = [ + generatePrecision(parameters), + "#define SHADER_NAME " + parameters.shaderName, + customDefines, + parameters.instancing ? "#define USE_INSTANCING" : "", + parameters.instancingColor ? "#define USE_INSTANCING_COLOR" : "", + parameters.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", + parameters.useFog && parameters.fog ? "#define USE_FOG" : "", + parameters.useFog && parameters.fogExp2 ? "#define FOG_EXP2" : "", + parameters.map ? "#define USE_MAP" : "", + parameters.envMap ? "#define USE_ENVMAP" : "", + parameters.envMap ? "#define " + envMapModeDefine : "", + parameters.lightMap ? "#define USE_LIGHTMAP" : "", + parameters.aoMap ? "#define USE_AOMAP" : "", + parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "", + parameters.bumpMap ? "#define USE_BUMPMAP" : "", + parameters.normalMap ? "#define USE_NORMALMAP" : "", + parameters.normalMap && parameters.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", + parameters.normalMap && parameters.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", + parameters.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", + parameters.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", + parameters.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", + parameters.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", + parameters.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", + parameters.displacementMap && parameters.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", + parameters.specularMap ? "#define USE_SPECULARMAP" : "", + parameters.specularIntensityMap ? "#define USE_SPECULARINTENSITYMAP" : "", + parameters.specularColorMap ? "#define USE_SPECULARCOLORMAP" : "", + parameters.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", + parameters.metalnessMap ? "#define USE_METALNESSMAP" : "", + parameters.alphaMap ? "#define USE_ALPHAMAP" : "", + parameters.transmission ? "#define USE_TRANSMISSION" : "", + parameters.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", + parameters.thicknessMap ? "#define USE_THICKNESSMAP" : "", + parameters.sheenColorMap ? "#define USE_SHEENCOLORMAP" : "", + parameters.sheenRoughnessMap ? "#define USE_SHEENROUGHNESSMAP" : "", + parameters.vertexTangents ? "#define USE_TANGENT" : "", + parameters.vertexColors ? "#define USE_COLOR" : "", + parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", + parameters.vertexUvs ? "#define USE_UV" : "", + parameters.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", + parameters.flatShading ? "#define FLAT_SHADED" : "", + parameters.skinning ? "#define USE_SKINNING" : "", + parameters.morphTargets ? "#define USE_MORPHTARGETS" : "", + parameters.morphNormals && parameters.flatShading === false ? "#define USE_MORPHNORMALS" : "", + parameters.morphColors && parameters.isWebGL2 ? "#define USE_MORPHCOLORS" : "", + parameters.morphTargetsCount > 0 && parameters.isWebGL2 ? "#define MORPHTARGETS_TEXTURE" : "", + parameters.morphTargetsCount > 0 && parameters.isWebGL2 ? "#define MORPHTARGETS_TEXTURE_STRIDE " + parameters.morphTextureStride : "", + parameters.morphTargetsCount > 0 && parameters.isWebGL2 ? "#define MORPHTARGETS_COUNT " + parameters.morphTargetsCount : "", + parameters.doubleSided ? "#define DOUBLE_SIDED" : "", + parameters.flipSided ? "#define FLIP_SIDED" : "", + parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", + parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "", + parameters.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", + parameters.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", + parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", + "uniform mat4 modelMatrix;", + "uniform mat4 modelViewMatrix;", + "uniform mat4 projectionMatrix;", + "uniform mat4 viewMatrix;", + "uniform mat3 normalMatrix;", + "uniform vec3 cameraPosition;", + "uniform bool isOrthographic;", + "#ifdef USE_INSTANCING", + " attribute mat4 instanceMatrix;", + "#endif", + "#ifdef USE_INSTANCING_COLOR", + " attribute vec3 instanceColor;", + "#endif", + "attribute vec3 position;", + "attribute vec3 normal;", + "attribute vec2 uv;", + "#ifdef USE_TANGENT", + " attribute vec4 tangent;", + "#endif", + "#if defined( USE_COLOR_ALPHA )", + " attribute vec4 color;", + "#elif defined( USE_COLOR )", + " attribute vec3 color;", + "#endif", + "#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )", + " attribute vec3 morphTarget0;", + " attribute vec3 morphTarget1;", + " attribute vec3 morphTarget2;", + " attribute vec3 morphTarget3;", + " #ifdef USE_MORPHNORMALS", + " attribute vec3 morphNormal0;", + " attribute vec3 morphNormal1;", + " attribute vec3 morphNormal2;", + " attribute vec3 morphNormal3;", + " #else", + " attribute vec3 morphTarget4;", + " attribute vec3 morphTarget5;", + " attribute vec3 morphTarget6;", + " attribute vec3 morphTarget7;", + " #endif", + "#endif", + "#ifdef USE_SKINNING", + " attribute vec4 skinIndex;", + " attribute vec4 skinWeight;", + "#endif", + "\n" + ].filter(filterEmptyLine).join("\n"); + prefixFragment = [ + customExtensions, + generatePrecision(parameters), + "#define SHADER_NAME " + parameters.shaderName, + customDefines, + parameters.useFog && parameters.fog ? "#define USE_FOG" : "", + parameters.useFog && parameters.fogExp2 ? "#define FOG_EXP2" : "", + parameters.map ? "#define USE_MAP" : "", + parameters.matcap ? "#define USE_MATCAP" : "", + parameters.envMap ? "#define USE_ENVMAP" : "", + parameters.envMap ? "#define " + envMapTypeDefine : "", + parameters.envMap ? "#define " + envMapModeDefine : "", + parameters.envMap ? "#define " + envMapBlendingDefine : "", + envMapCubeUVSize ? "#define CUBEUV_TEXEL_WIDTH " + envMapCubeUVSize.texelWidth : "", + envMapCubeUVSize ? "#define CUBEUV_TEXEL_HEIGHT " + envMapCubeUVSize.texelHeight : "", + envMapCubeUVSize ? "#define CUBEUV_MAX_MIP " + envMapCubeUVSize.maxMip + ".0" : "", + parameters.lightMap ? "#define USE_LIGHTMAP" : "", + parameters.aoMap ? "#define USE_AOMAP" : "", + parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "", + parameters.bumpMap ? "#define USE_BUMPMAP" : "", + parameters.normalMap ? "#define USE_NORMALMAP" : "", + parameters.normalMap && parameters.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", + parameters.normalMap && parameters.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", + parameters.clearcoat ? "#define USE_CLEARCOAT" : "", + parameters.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", + parameters.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", + parameters.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", + parameters.iridescence ? "#define USE_IRIDESCENCE" : "", + parameters.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", + parameters.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", + parameters.specularMap ? "#define USE_SPECULARMAP" : "", + parameters.specularIntensityMap ? "#define USE_SPECULARINTENSITYMAP" : "", + parameters.specularColorMap ? "#define USE_SPECULARCOLORMAP" : "", + parameters.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", + parameters.metalnessMap ? "#define USE_METALNESSMAP" : "", + parameters.alphaMap ? "#define USE_ALPHAMAP" : "", + parameters.alphaTest ? "#define USE_ALPHATEST" : "", + parameters.sheen ? "#define USE_SHEEN" : "", + parameters.sheenColorMap ? "#define USE_SHEENCOLORMAP" : "", + parameters.sheenRoughnessMap ? "#define USE_SHEENROUGHNESSMAP" : "", + parameters.transmission ? "#define USE_TRANSMISSION" : "", + parameters.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", + parameters.thicknessMap ? "#define USE_THICKNESSMAP" : "", + parameters.decodeVideoTexture ? "#define DECODE_VIDEO_TEXTURE" : "", + parameters.vertexTangents ? "#define USE_TANGENT" : "", + parameters.vertexColors || parameters.instancingColor ? "#define USE_COLOR" : "", + parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", + parameters.vertexUvs ? "#define USE_UV" : "", + parameters.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", + parameters.gradientMap ? "#define USE_GRADIENTMAP" : "", + parameters.flatShading ? "#define FLAT_SHADED" : "", + parameters.doubleSided ? "#define DOUBLE_SIDED" : "", + parameters.flipSided ? "#define FLIP_SIDED" : "", + parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", + parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "", + parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", + parameters.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", + parameters.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", + parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", + "uniform mat4 viewMatrix;", + "uniform vec3 cameraPosition;", + "uniform bool isOrthographic;", + parameters.toneMapping !== NoToneMapping ? "#define TONE_MAPPING" : "", + parameters.toneMapping !== NoToneMapping ? ShaderChunk["tonemapping_pars_fragment"] : "", + parameters.toneMapping !== NoToneMapping ? getToneMappingFunction("toneMapping", parameters.toneMapping) : "", + parameters.dithering ? "#define DITHERING" : "", + parameters.opaque ? "#define OPAQUE" : "", + ShaderChunk["encodings_pars_fragment"], + getTexelEncodingFunction("linearToOutputTexel", parameters.outputEncoding), + parameters.useDepthPacking ? "#define DEPTH_PACKING " + parameters.depthPacking : "", + "\n" + ].filter(filterEmptyLine).join("\n"); + } + vertexShader = resolveIncludes(vertexShader); + vertexShader = replaceLightNums(vertexShader, parameters); + vertexShader = replaceClippingPlaneNums(vertexShader, parameters); + fragmentShader = resolveIncludes(fragmentShader); + fragmentShader = replaceLightNums(fragmentShader, parameters); + fragmentShader = replaceClippingPlaneNums(fragmentShader, parameters); + vertexShader = unrollLoops(vertexShader); + fragmentShader = unrollLoops(fragmentShader); + if (parameters.isWebGL2 && parameters.isRawShaderMaterial !== true) { + versionString = "#version 300 es\n"; + prefixVertex = [ + "precision mediump sampler2DArray;", + "#define attribute in", + "#define varying out", + "#define texture2D texture" + ].join("\n") + "\n" + prefixVertex; + prefixFragment = [ + "#define varying in", + parameters.glslVersion === GLSL3 ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", + parameters.glslVersion === GLSL3 ? "" : "#define gl_FragColor pc_fragColor", + "#define gl_FragDepthEXT gl_FragDepth", + "#define texture2D texture", + "#define textureCube texture", + "#define texture2DProj textureProj", + "#define texture2DLodEXT textureLod", + "#define texture2DProjLodEXT textureProjLod", + "#define textureCubeLodEXT textureLod", + "#define texture2DGradEXT textureGrad", + "#define texture2DProjGradEXT textureProjGrad", + "#define textureCubeGradEXT textureGrad" + ].join("\n") + "\n" + prefixFragment; + } + const vertexGlsl = versionString + prefixVertex + vertexShader; + const fragmentGlsl = versionString + prefixFragment + fragmentShader; + const glVertexShader = WebGLShader(gl, 35633, vertexGlsl); + const glFragmentShader = WebGLShader(gl, 35632, fragmentGlsl); + gl.attachShader(program, glVertexShader); + gl.attachShader(program, glFragmentShader); + if (parameters.index0AttributeName !== void 0) { + gl.bindAttribLocation(program, 0, parameters.index0AttributeName); + } else if (parameters.morphTargets === true) { + gl.bindAttribLocation(program, 0, "position"); + } + gl.linkProgram(program); + if (renderer3.debug.checkShaderErrors) { + const programLog = gl.getProgramInfoLog(program).trim(); + const vertexLog = gl.getShaderInfoLog(glVertexShader).trim(); + const fragmentLog = gl.getShaderInfoLog(glFragmentShader).trim(); + let runnable = true; + let haveDiagnostics = true; + if (gl.getProgramParameter(program, 35714) === false) { + runnable = false; + const vertexErrors = getShaderErrors(gl, glVertexShader, "vertex"); + const fragmentErrors = getShaderErrors(gl, glFragmentShader, "fragment"); + console.error("THREE.WebGLProgram: Shader Error " + gl.getError() + " - VALIDATE_STATUS " + gl.getProgramParameter(program, 35715) + "\n\nProgram Info Log: " + programLog + "\n" + vertexErrors + "\n" + fragmentErrors); + } else if (programLog !== "") { + console.warn("THREE.WebGLProgram: Program Info Log:", programLog); + } else if (vertexLog === "" || fragmentLog === "") { + haveDiagnostics = false; + } + if (haveDiagnostics) { + this.diagnostics = { + runnable, + programLog, + vertexShader: { + log: vertexLog, + prefix: prefixVertex + }, + fragmentShader: { + log: fragmentLog, + prefix: prefixFragment + } + }; + } + } + gl.deleteShader(glVertexShader); + gl.deleteShader(glFragmentShader); + let cachedUniforms; + this.getUniforms = function() { + if (cachedUniforms === void 0) { + cachedUniforms = new WebGLUniforms(gl, program); + } + return cachedUniforms; + }; + let cachedAttributes; + this.getAttributes = function() { + if (cachedAttributes === void 0) { + cachedAttributes = fetchAttributeLocations(gl, program); + } + return cachedAttributes; + }; + this.destroy = function() { + bindingStates.releaseStatesOfProgram(this); + gl.deleteProgram(program); + this.program = void 0; + }; + this.name = parameters.shaderName; + this.id = programIdCount++; + this.cacheKey = cacheKey; + this.usedTimes = 1; + this.program = program; + this.vertexShader = glVertexShader; + this.fragmentShader = glFragmentShader; + return this; +} +var _id = 0; +var WebGLShaderCache = class { + constructor() { + this.shaderCache = /* @__PURE__ */ new Map(); + this.materialCache = /* @__PURE__ */ new Map(); + } + update(material) { + const vertexShader = material.vertexShader; + const fragmentShader = material.fragmentShader; + const vertexShaderStage = this._getShaderStage(vertexShader); + const fragmentShaderStage = this._getShaderStage(fragmentShader); + const materialShaders = this._getShaderCacheForMaterial(material); + if (materialShaders.has(vertexShaderStage) === false) { + materialShaders.add(vertexShaderStage); + vertexShaderStage.usedTimes++; + } + if (materialShaders.has(fragmentShaderStage) === false) { + materialShaders.add(fragmentShaderStage); + fragmentShaderStage.usedTimes++; + } + return this; + } + remove(material) { + const materialShaders = this.materialCache.get(material); + for (const shaderStage of materialShaders) { + shaderStage.usedTimes--; + if (shaderStage.usedTimes === 0) + this.shaderCache.delete(shaderStage.code); + } + this.materialCache.delete(material); + return this; + } + getVertexShaderID(material) { + return this._getShaderStage(material.vertexShader).id; + } + getFragmentShaderID(material) { + return this._getShaderStage(material.fragmentShader).id; + } + dispose() { + this.shaderCache.clear(); + this.materialCache.clear(); + } + _getShaderCacheForMaterial(material) { + const cache = this.materialCache; + if (cache.has(material) === false) { + cache.set(material, /* @__PURE__ */ new Set()); + } + return cache.get(material); + } + _getShaderStage(code) { + const cache = this.shaderCache; + if (cache.has(code) === false) { + const stage = new WebGLShaderStage(code); + cache.set(code, stage); + } + return cache.get(code); + } +}; +var WebGLShaderStage = class { + constructor(code) { + this.id = _id++; + this.code = code; + this.usedTimes = 0; + } +}; +function WebGLPrograms(renderer3, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping) { + const _programLayers = new Layers(); + const _customShaders = new WebGLShaderCache(); + const programs = []; + const isWebGL2 = capabilities.isWebGL2; + const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer; + const vertexTextures = capabilities.vertexTextures; + let precision = capabilities.precision; + const shaderIDs = { + MeshDepthMaterial: "depth", + MeshDistanceMaterial: "distanceRGBA", + MeshNormalMaterial: "normal", + MeshBasicMaterial: "basic", + MeshLambertMaterial: "lambert", + MeshPhongMaterial: "phong", + MeshToonMaterial: "toon", + MeshStandardMaterial: "physical", + MeshPhysicalMaterial: "physical", + MeshMatcapMaterial: "matcap", + LineBasicMaterial: "basic", + LineDashedMaterial: "dashed", + PointsMaterial: "points", + ShadowMaterial: "shadow", + SpriteMaterial: "sprite" + }; + function getParameters(material, lights, shadows, scene3, object) { + const fog = scene3.fog; + const geometry = object.geometry; + const environment = material.isMeshStandardMaterial ? scene3.environment : null; + const envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment); + const envMapCubeUVHeight = !!envMap && envMap.mapping === CubeUVReflectionMapping ? envMap.image.height : null; + const shaderID = shaderIDs[material.type]; + if (material.precision !== null) { + precision = capabilities.getMaxPrecision(material.precision); + if (precision !== material.precision) { + console.warn("THREE.WebGLProgram.getParameters:", material.precision, "not supported, using", precision, "instead."); + } + } + const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; + const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0; + let morphTextureStride = 0; + if (geometry.morphAttributes.position !== void 0) + morphTextureStride = 1; + if (geometry.morphAttributes.normal !== void 0) + morphTextureStride = 2; + if (geometry.morphAttributes.color !== void 0) + morphTextureStride = 3; + let vertexShader, fragmentShader; + let customVertexShaderID, customFragmentShaderID; + if (shaderID) { + const shader = ShaderLib[shaderID]; + vertexShader = shader.vertexShader; + fragmentShader = shader.fragmentShader; + } else { + vertexShader = material.vertexShader; + fragmentShader = material.fragmentShader; + _customShaders.update(material); + customVertexShaderID = _customShaders.getVertexShaderID(material); + customFragmentShaderID = _customShaders.getFragmentShaderID(material); + } + const currentRenderTarget = renderer3.getRenderTarget(); + const useAlphaTest = material.alphaTest > 0; + const useClearcoat = material.clearcoat > 0; + const useIridescence = material.iridescence > 0; + const parameters = { + isWebGL2, + shaderID, + shaderName: material.type, + vertexShader, + fragmentShader, + defines: material.defines, + customVertexShaderID, + customFragmentShaderID, + isRawShaderMaterial: material.isRawShaderMaterial === true, + glslVersion: material.glslVersion, + precision, + instancing: object.isInstancedMesh === true, + instancingColor: object.isInstancedMesh === true && object.instanceColor !== null, + supportsVertexTextures: vertexTextures, + outputEncoding: currentRenderTarget === null ? renderer3.outputEncoding : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding, + map: !!material.map, + matcap: !!material.matcap, + envMap: !!envMap, + envMapMode: envMap && envMap.mapping, + envMapCubeUVHeight, + lightMap: !!material.lightMap, + aoMap: !!material.aoMap, + emissiveMap: !!material.emissiveMap, + bumpMap: !!material.bumpMap, + normalMap: !!material.normalMap, + objectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap, + tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap, + decodeVideoTexture: !!material.map && material.map.isVideoTexture === true && material.map.encoding === sRGBEncoding, + clearcoat: useClearcoat, + clearcoatMap: useClearcoat && !!material.clearcoatMap, + clearcoatRoughnessMap: useClearcoat && !!material.clearcoatRoughnessMap, + clearcoatNormalMap: useClearcoat && !!material.clearcoatNormalMap, + iridescence: useIridescence, + iridescenceMap: useIridescence && !!material.iridescenceMap, + iridescenceThicknessMap: useIridescence && !!material.iridescenceThicknessMap, + displacementMap: !!material.displacementMap, + roughnessMap: !!material.roughnessMap, + metalnessMap: !!material.metalnessMap, + specularMap: !!material.specularMap, + specularIntensityMap: !!material.specularIntensityMap, + specularColorMap: !!material.specularColorMap, + opaque: material.transparent === false && material.blending === NormalBlending, + alphaMap: !!material.alphaMap, + alphaTest: useAlphaTest, + gradientMap: !!material.gradientMap, + sheen: material.sheen > 0, + sheenColorMap: !!material.sheenColorMap, + sheenRoughnessMap: !!material.sheenRoughnessMap, + transmission: material.transmission > 0, + transmissionMap: !!material.transmissionMap, + thicknessMap: !!material.thicknessMap, + combine: material.combine, + vertexTangents: !!material.normalMap && !!geometry.attributes.tangent, + vertexColors: material.vertexColors, + vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4, + vertexUvs: !!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatMap || !!material.clearcoatRoughnessMap || !!material.clearcoatNormalMap || !!material.iridescenceMap || !!material.iridescenceThicknessMap || !!material.displacementMap || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularColorMap || !!material.sheenColorMap || !!material.sheenRoughnessMap, + uvsVertexOnly: !(!!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatNormalMap || !!material.iridescenceMap || !!material.iridescenceThicknessMap || material.transmission > 0 || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularColorMap || material.sheen > 0 || !!material.sheenColorMap || !!material.sheenRoughnessMap) && !!material.displacementMap, + fog: !!fog, + useFog: material.fog === true, + fogExp2: fog && fog.isFogExp2, + flatShading: !!material.flatShading, + sizeAttenuation: material.sizeAttenuation, + logarithmicDepthBuffer, + skinning: object.isSkinnedMesh === true, + morphTargets: geometry.morphAttributes.position !== void 0, + morphNormals: geometry.morphAttributes.normal !== void 0, + morphColors: geometry.morphAttributes.color !== void 0, + morphTargetsCount, + morphTextureStride, + numDirLights: lights.directional.length, + numPointLights: lights.point.length, + numSpotLights: lights.spot.length, + numRectAreaLights: lights.rectArea.length, + numHemiLights: lights.hemi.length, + numDirLightShadows: lights.directionalShadowMap.length, + numPointLightShadows: lights.pointShadowMap.length, + numSpotLightShadows: lights.spotShadowMap.length, + numClippingPlanes: clipping.numPlanes, + numClipIntersection: clipping.numIntersection, + dithering: material.dithering, + shadowMapEnabled: renderer3.shadowMap.enabled && shadows.length > 0, + shadowMapType: renderer3.shadowMap.type, + toneMapping: material.toneMapped ? renderer3.toneMapping : NoToneMapping, + physicallyCorrectLights: renderer3.physicallyCorrectLights, + premultipliedAlpha: material.premultipliedAlpha, + doubleSided: material.side === DoubleSide, + flipSided: material.side === BackSide, + useDepthPacking: !!material.depthPacking, + depthPacking: material.depthPacking || 0, + index0AttributeName: material.index0AttributeName, + extensionDerivatives: material.extensions && material.extensions.derivatives, + extensionFragDepth: material.extensions && material.extensions.fragDepth, + extensionDrawBuffers: material.extensions && material.extensions.drawBuffers, + extensionShaderTextureLOD: material.extensions && material.extensions.shaderTextureLOD, + rendererExtensionFragDepth: isWebGL2 || extensions.has("EXT_frag_depth"), + rendererExtensionDrawBuffers: isWebGL2 || extensions.has("WEBGL_draw_buffers"), + rendererExtensionShaderTextureLod: isWebGL2 || extensions.has("EXT_shader_texture_lod"), + customProgramCacheKey: material.customProgramCacheKey() + }; + return parameters; + } + function getProgramCacheKey(parameters) { + const array = []; + if (parameters.shaderID) { + array.push(parameters.shaderID); + } else { + array.push(parameters.customVertexShaderID); + array.push(parameters.customFragmentShaderID); + } + if (parameters.defines !== void 0) { + for (const name in parameters.defines) { + array.push(name); + array.push(parameters.defines[name]); + } + } + if (parameters.isRawShaderMaterial === false) { + getProgramCacheKeyParameters(array, parameters); + getProgramCacheKeyBooleans(array, parameters); + array.push(renderer3.outputEncoding); + } + array.push(parameters.customProgramCacheKey); + return array.join(); + } + function getProgramCacheKeyParameters(array, parameters) { + array.push(parameters.precision); + array.push(parameters.outputEncoding); + array.push(parameters.envMapMode); + array.push(parameters.envMapCubeUVHeight); + array.push(parameters.combine); + array.push(parameters.vertexUvs); + array.push(parameters.fogExp2); + array.push(parameters.sizeAttenuation); + array.push(parameters.morphTargetsCount); + array.push(parameters.morphAttributeCount); + array.push(parameters.numDirLights); + array.push(parameters.numPointLights); + array.push(parameters.numSpotLights); + array.push(parameters.numHemiLights); + array.push(parameters.numRectAreaLights); + array.push(parameters.numDirLightShadows); + array.push(parameters.numPointLightShadows); + array.push(parameters.numSpotLightShadows); + array.push(parameters.shadowMapType); + array.push(parameters.toneMapping); + array.push(parameters.numClippingPlanes); + array.push(parameters.numClipIntersection); + array.push(parameters.depthPacking); + } + function getProgramCacheKeyBooleans(array, parameters) { + _programLayers.disableAll(); + if (parameters.isWebGL2) + _programLayers.enable(0); + if (parameters.supportsVertexTextures) + _programLayers.enable(1); + if (parameters.instancing) + _programLayers.enable(2); + if (parameters.instancingColor) + _programLayers.enable(3); + if (parameters.map) + _programLayers.enable(4); + if (parameters.matcap) + _programLayers.enable(5); + if (parameters.envMap) + _programLayers.enable(6); + if (parameters.lightMap) + _programLayers.enable(7); + if (parameters.aoMap) + _programLayers.enable(8); + if (parameters.emissiveMap) + _programLayers.enable(9); + if (parameters.bumpMap) + _programLayers.enable(10); + if (parameters.normalMap) + _programLayers.enable(11); + if (parameters.objectSpaceNormalMap) + _programLayers.enable(12); + if (parameters.tangentSpaceNormalMap) + _programLayers.enable(13); + if (parameters.clearcoat) + _programLayers.enable(14); + if (parameters.clearcoatMap) + _programLayers.enable(15); + if (parameters.clearcoatRoughnessMap) + _programLayers.enable(16); + if (parameters.clearcoatNormalMap) + _programLayers.enable(17); + if (parameters.iridescence) + _programLayers.enable(18); + if (parameters.iridescenceMap) + _programLayers.enable(19); + if (parameters.iridescenceThicknessMap) + _programLayers.enable(20); + if (parameters.displacementMap) + _programLayers.enable(21); + if (parameters.specularMap) + _programLayers.enable(22); + if (parameters.roughnessMap) + _programLayers.enable(23); + if (parameters.metalnessMap) + _programLayers.enable(24); + if (parameters.gradientMap) + _programLayers.enable(25); + if (parameters.alphaMap) + _programLayers.enable(26); + if (parameters.alphaTest) + _programLayers.enable(27); + if (parameters.vertexColors) + _programLayers.enable(28); + if (parameters.vertexAlphas) + _programLayers.enable(29); + if (parameters.vertexUvs) + _programLayers.enable(30); + if (parameters.vertexTangents) + _programLayers.enable(31); + if (parameters.uvsVertexOnly) + _programLayers.enable(32); + if (parameters.fog) + _programLayers.enable(33); + array.push(_programLayers.mask); + _programLayers.disableAll(); + if (parameters.useFog) + _programLayers.enable(0); + if (parameters.flatShading) + _programLayers.enable(1); + if (parameters.logarithmicDepthBuffer) + _programLayers.enable(2); + if (parameters.skinning) + _programLayers.enable(3); + if (parameters.morphTargets) + _programLayers.enable(4); + if (parameters.morphNormals) + _programLayers.enable(5); + if (parameters.morphColors) + _programLayers.enable(6); + if (parameters.premultipliedAlpha) + _programLayers.enable(7); + if (parameters.shadowMapEnabled) + _programLayers.enable(8); + if (parameters.physicallyCorrectLights) + _programLayers.enable(9); + if (parameters.doubleSided) + _programLayers.enable(10); + if (parameters.flipSided) + _programLayers.enable(11); + if (parameters.useDepthPacking) + _programLayers.enable(12); + if (parameters.dithering) + _programLayers.enable(13); + if (parameters.specularIntensityMap) + _programLayers.enable(14); + if (parameters.specularColorMap) + _programLayers.enable(15); + if (parameters.transmission) + _programLayers.enable(16); + if (parameters.transmissionMap) + _programLayers.enable(17); + if (parameters.thicknessMap) + _programLayers.enable(18); + if (parameters.sheen) + _programLayers.enable(19); + if (parameters.sheenColorMap) + _programLayers.enable(20); + if (parameters.sheenRoughnessMap) + _programLayers.enable(21); + if (parameters.decodeVideoTexture) + _programLayers.enable(22); + if (parameters.opaque) + _programLayers.enable(23); + array.push(_programLayers.mask); + } + function getUniforms(material) { + const shaderID = shaderIDs[material.type]; + let uniforms; + if (shaderID) { + const shader = ShaderLib[shaderID]; + uniforms = UniformsUtils.clone(shader.uniforms); + } else { + uniforms = material.uniforms; + } + return uniforms; + } + function acquireProgram(parameters, cacheKey) { + let program; + for (let p = 0, pl = programs.length; p < pl; p++) { + const preexistingProgram = programs[p]; + if (preexistingProgram.cacheKey === cacheKey) { + program = preexistingProgram; + ++program.usedTimes; + break; + } + } + if (program === void 0) { + program = new WebGLProgram(renderer3, cacheKey, parameters, bindingStates); + programs.push(program); + } + return program; + } + function releaseProgram(program) { + if (--program.usedTimes === 0) { + const i = programs.indexOf(program); + programs[i] = programs[programs.length - 1]; + programs.pop(); + program.destroy(); + } + } + function releaseShaderCache(material) { + _customShaders.remove(material); + } + function dispose() { + _customShaders.dispose(); + } + return { + getParameters, + getProgramCacheKey, + getUniforms, + acquireProgram, + releaseProgram, + releaseShaderCache, + programs, + dispose + }; +} +function WebGLProperties() { + let properties = /* @__PURE__ */ new WeakMap(); + function get2(object) { + let map = properties.get(object); + if (map === void 0) { + map = {}; + properties.set(object, map); + } + return map; + } + function remove2(object) { + properties.delete(object); + } + function update4(object, key, value) { + properties.get(object)[key] = value; + } + function dispose() { + properties = /* @__PURE__ */ new WeakMap(); + } + return { + get: get2, + remove: remove2, + update: update4, + dispose + }; +} +function painterSortStable(a2, b) { + if (a2.groupOrder !== b.groupOrder) { + return a2.groupOrder - b.groupOrder; + } else if (a2.renderOrder !== b.renderOrder) { + return a2.renderOrder - b.renderOrder; + } else if (a2.material.id !== b.material.id) { + return a2.material.id - b.material.id; + } else if (a2.z !== b.z) { + return a2.z - b.z; + } else { + return a2.id - b.id; + } +} +function reversePainterSortStable(a2, b) { + if (a2.groupOrder !== b.groupOrder) { + return a2.groupOrder - b.groupOrder; + } else if (a2.renderOrder !== b.renderOrder) { + return a2.renderOrder - b.renderOrder; + } else if (a2.z !== b.z) { + return b.z - a2.z; + } else { + return a2.id - b.id; + } +} +function WebGLRenderList() { + const renderItems = []; + let renderItemsIndex = 0; + const opaque = []; + const transmissive = []; + const transparent = []; + function init4() { + renderItemsIndex = 0; + opaque.length = 0; + transmissive.length = 0; + transparent.length = 0; + } + function getNextRenderItem(object, geometry, material, groupOrder, z2, group) { + let renderItem = renderItems[renderItemsIndex]; + if (renderItem === void 0) { + renderItem = { + id: object.id, + object, + geometry, + material, + groupOrder, + renderOrder: object.renderOrder, + z: z2, + group + }; + renderItems[renderItemsIndex] = renderItem; + } else { + renderItem.id = object.id; + renderItem.object = object; + renderItem.geometry = geometry; + renderItem.material = material; + renderItem.groupOrder = groupOrder; + renderItem.renderOrder = object.renderOrder; + renderItem.z = z2; + renderItem.group = group; + } + renderItemsIndex++; + return renderItem; + } + function push(object, geometry, material, groupOrder, z2, group) { + const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z2, group); + if (material.transmission > 0) { + transmissive.push(renderItem); + } else if (material.transparent === true) { + transparent.push(renderItem); + } else { + opaque.push(renderItem); + } + } + function unshift(object, geometry, material, groupOrder, z2, group) { + const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z2, group); + if (material.transmission > 0) { + transmissive.unshift(renderItem); + } else if (material.transparent === true) { + transparent.unshift(renderItem); + } else { + opaque.unshift(renderItem); + } + } + function sort(customOpaqueSort, customTransparentSort) { + if (opaque.length > 1) + opaque.sort(customOpaqueSort || painterSortStable); + if (transmissive.length > 1) + transmissive.sort(customTransparentSort || reversePainterSortStable); + if (transparent.length > 1) + transparent.sort(customTransparentSort || reversePainterSortStable); + } + function finish() { + for (let i = renderItemsIndex, il = renderItems.length; i < il; i++) { + const renderItem = renderItems[i]; + if (renderItem.id === null) + break; + renderItem.id = null; + renderItem.object = null; + renderItem.geometry = null; + renderItem.material = null; + renderItem.group = null; + } + } + return { + opaque, + transmissive, + transparent, + init: init4, + push, + unshift, + finish, + sort + }; +} +function WebGLRenderLists() { + let lists = /* @__PURE__ */ new WeakMap(); + function get2(scene3, renderCallDepth) { + let list; + if (lists.has(scene3) === false) { + list = new WebGLRenderList(); + lists.set(scene3, [list]); + } else { + if (renderCallDepth >= lists.get(scene3).length) { + list = new WebGLRenderList(); + lists.get(scene3).push(list); + } else { + list = lists.get(scene3)[renderCallDepth]; + } + } + return list; + } + function dispose() { + lists = /* @__PURE__ */ new WeakMap(); + } + return { + get: get2, + dispose + }; +} +function UniformsCache() { + const lights = {}; + return { + get: function(light) { + if (lights[light.id] !== void 0) { + return lights[light.id]; + } + let uniforms; + switch (light.type) { + case "DirectionalLight": + uniforms = { + direction: new Vector3(), + color: new Color() + }; + break; + case "SpotLight": + uniforms = { + position: new Vector3(), + direction: new Vector3(), + color: new Color(), + distance: 0, + coneCos: 0, + penumbraCos: 0, + decay: 0 + }; + break; + case "PointLight": + uniforms = { + position: new Vector3(), + color: new Color(), + distance: 0, + decay: 0 + }; + break; + case "HemisphereLight": + uniforms = { + direction: new Vector3(), + skyColor: new Color(), + groundColor: new Color() + }; + break; + case "RectAreaLight": + uniforms = { + color: new Color(), + position: new Vector3(), + halfWidth: new Vector3(), + halfHeight: new Vector3() + }; + break; + } + lights[light.id] = uniforms; + return uniforms; + } + }; +} +function ShadowUniformsCache() { + const lights = {}; + return { + get: function(light) { + if (lights[light.id] !== void 0) { + return lights[light.id]; + } + let uniforms; + switch (light.type) { + case "DirectionalLight": + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + case "SpotLight": + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + case "PointLight": + uniforms = { + shadowBias: 0, + shadowNormalBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2(), + shadowCameraNear: 1, + shadowCameraFar: 1e3 + }; + break; + } + lights[light.id] = uniforms; + return uniforms; + } + }; +} +var nextVersion = 0; +function shadowCastingLightsFirst(lightA, lightB) { + return (lightB.castShadow ? 1 : 0) - (lightA.castShadow ? 1 : 0); +} +function WebGLLights(extensions, capabilities) { + const cache = new UniformsCache(); + const shadowCache = ShadowUniformsCache(); + const state = { + version: 0, + hash: { + directionalLength: -1, + pointLength: -1, + spotLength: -1, + rectAreaLength: -1, + hemiLength: -1, + numDirectionalShadows: -1, + numPointShadows: -1, + numSpotShadows: -1 + }, + ambient: [0, 0, 0], + probe: [], + directional: [], + directionalShadow: [], + directionalShadowMap: [], + directionalShadowMatrix: [], + spot: [], + spotShadow: [], + spotShadowMap: [], + spotShadowMatrix: [], + rectArea: [], + rectAreaLTC1: null, + rectAreaLTC2: null, + point: [], + pointShadow: [], + pointShadowMap: [], + pointShadowMatrix: [], + hemi: [] + }; + for (let i = 0; i < 9; i++) + state.probe.push(new Vector3()); + const vector3 = new Vector3(); + const matrix4 = new Matrix4(); + const matrix42 = new Matrix4(); + function setup(lights, physicallyCorrectLights) { + let r = 0, g = 0, b = 0; + for (let i = 0; i < 9; i++) + state.probe[i].set(0, 0, 0); + let directionalLength = 0; + let pointLength = 0; + let spotLength = 0; + let rectAreaLength = 0; + let hemiLength = 0; + let numDirectionalShadows = 0; + let numPointShadows = 0; + let numSpotShadows = 0; + lights.sort(shadowCastingLightsFirst); + const scaleFactor = physicallyCorrectLights !== true ? Math.PI : 1; + for (let i = 0, l = lights.length; i < l; i++) { + const light = lights[i]; + const color = light.color; + const intensity = light.intensity; + const distance = light.distance; + const shadowMap = light.shadow && light.shadow.map ? light.shadow.map.texture : null; + if (light.isAmbientLight) { + r += color.r * intensity * scaleFactor; + g += color.g * intensity * scaleFactor; + b += color.b * intensity * scaleFactor; + } else if (light.isLightProbe) { + for (let j = 0; j < 9; j++) { + state.probe[j].addScaledVector(light.sh.coefficients[j], intensity); + } + } else if (light.isDirectionalLight) { + const uniforms = cache.get(light); + uniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor); + if (light.castShadow) { + const shadow = light.shadow; + const shadowUniforms = shadowCache.get(light); + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + state.directionalShadow[directionalLength] = shadowUniforms; + state.directionalShadowMap[directionalLength] = shadowMap; + state.directionalShadowMatrix[directionalLength] = light.shadow.matrix; + numDirectionalShadows++; + } + state.directional[directionalLength] = uniforms; + directionalLength++; + } else if (light.isSpotLight) { + const uniforms = cache.get(light); + uniforms.position.setFromMatrixPosition(light.matrixWorld); + uniforms.color.copy(color).multiplyScalar(intensity * scaleFactor); + uniforms.distance = distance; + uniforms.coneCos = Math.cos(light.angle); + uniforms.penumbraCos = Math.cos(light.angle * (1 - light.penumbra)); + uniforms.decay = light.decay; + if (light.castShadow) { + const shadow = light.shadow; + const shadowUniforms = shadowCache.get(light); + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + state.spotShadow[spotLength] = shadowUniforms; + state.spotShadowMap[spotLength] = shadowMap; + state.spotShadowMatrix[spotLength] = light.shadow.matrix; + numSpotShadows++; + } + state.spot[spotLength] = uniforms; + spotLength++; + } else if (light.isRectAreaLight) { + const uniforms = cache.get(light); + uniforms.color.copy(color).multiplyScalar(intensity); + uniforms.halfWidth.set(light.width * 0.5, 0, 0); + uniforms.halfHeight.set(0, light.height * 0.5, 0); + state.rectArea[rectAreaLength] = uniforms; + rectAreaLength++; + } else if (light.isPointLight) { + const uniforms = cache.get(light); + uniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor); + uniforms.distance = light.distance; + uniforms.decay = light.decay; + if (light.castShadow) { + const shadow = light.shadow; + const shadowUniforms = shadowCache.get(light); + shadowUniforms.shadowBias = shadow.bias; + shadowUniforms.shadowNormalBias = shadow.normalBias; + shadowUniforms.shadowRadius = shadow.radius; + shadowUniforms.shadowMapSize = shadow.mapSize; + shadowUniforms.shadowCameraNear = shadow.camera.near; + shadowUniforms.shadowCameraFar = shadow.camera.far; + state.pointShadow[pointLength] = shadowUniforms; + state.pointShadowMap[pointLength] = shadowMap; + state.pointShadowMatrix[pointLength] = light.shadow.matrix; + numPointShadows++; + } + state.point[pointLength] = uniforms; + pointLength++; + } else if (light.isHemisphereLight) { + const uniforms = cache.get(light); + uniforms.skyColor.copy(light.color).multiplyScalar(intensity * scaleFactor); + uniforms.groundColor.copy(light.groundColor).multiplyScalar(intensity * scaleFactor); + state.hemi[hemiLength] = uniforms; + hemiLength++; + } + } + if (rectAreaLength > 0) { + if (capabilities.isWebGL2) { + state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; + state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; + } else { + if (extensions.has("OES_texture_float_linear") === true) { + state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; + state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; + } else if (extensions.has("OES_texture_half_float_linear") === true) { + state.rectAreaLTC1 = UniformsLib.LTC_HALF_1; + state.rectAreaLTC2 = UniformsLib.LTC_HALF_2; + } else { + console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions."); + } + } + } + state.ambient[0] = r; + state.ambient[1] = g; + state.ambient[2] = b; + const hash = state.hash; + if (hash.directionalLength !== directionalLength || hash.pointLength !== pointLength || hash.spotLength !== spotLength || hash.rectAreaLength !== rectAreaLength || hash.hemiLength !== hemiLength || hash.numDirectionalShadows !== numDirectionalShadows || hash.numPointShadows !== numPointShadows || hash.numSpotShadows !== numSpotShadows) { + state.directional.length = directionalLength; + state.spot.length = spotLength; + state.rectArea.length = rectAreaLength; + state.point.length = pointLength; + state.hemi.length = hemiLength; + state.directionalShadow.length = numDirectionalShadows; + state.directionalShadowMap.length = numDirectionalShadows; + state.pointShadow.length = numPointShadows; + state.pointShadowMap.length = numPointShadows; + state.spotShadow.length = numSpotShadows; + state.spotShadowMap.length = numSpotShadows; + state.directionalShadowMatrix.length = numDirectionalShadows; + state.pointShadowMatrix.length = numPointShadows; + state.spotShadowMatrix.length = numSpotShadows; + hash.directionalLength = directionalLength; + hash.pointLength = pointLength; + hash.spotLength = spotLength; + hash.rectAreaLength = rectAreaLength; + hash.hemiLength = hemiLength; + hash.numDirectionalShadows = numDirectionalShadows; + hash.numPointShadows = numPointShadows; + hash.numSpotShadows = numSpotShadows; + state.version = nextVersion++; + } + } + function setupView(lights, camera3) { + let directionalLength = 0; + let pointLength = 0; + let spotLength = 0; + let rectAreaLength = 0; + let hemiLength = 0; + const viewMatrix = camera3.matrixWorldInverse; + for (let i = 0, l = lights.length; i < l; i++) { + const light = lights[i]; + if (light.isDirectionalLight) { + const uniforms = state.directional[directionalLength]; + uniforms.direction.setFromMatrixPosition(light.matrixWorld); + vector3.setFromMatrixPosition(light.target.matrixWorld); + uniforms.direction.sub(vector3); + uniforms.direction.transformDirection(viewMatrix); + directionalLength++; + } else if (light.isSpotLight) { + const uniforms = state.spot[spotLength]; + uniforms.position.setFromMatrixPosition(light.matrixWorld); + uniforms.position.applyMatrix4(viewMatrix); + uniforms.direction.setFromMatrixPosition(light.matrixWorld); + vector3.setFromMatrixPosition(light.target.matrixWorld); + uniforms.direction.sub(vector3); + uniforms.direction.transformDirection(viewMatrix); + spotLength++; + } else if (light.isRectAreaLight) { + const uniforms = state.rectArea[rectAreaLength]; + uniforms.position.setFromMatrixPosition(light.matrixWorld); + uniforms.position.applyMatrix4(viewMatrix); + matrix42.identity(); + matrix4.copy(light.matrixWorld); + matrix4.premultiply(viewMatrix); + matrix42.extractRotation(matrix4); + uniforms.halfWidth.set(light.width * 0.5, 0, 0); + uniforms.halfHeight.set(0, light.height * 0.5, 0); + uniforms.halfWidth.applyMatrix4(matrix42); + uniforms.halfHeight.applyMatrix4(matrix42); + rectAreaLength++; + } else if (light.isPointLight) { + const uniforms = state.point[pointLength]; + uniforms.position.setFromMatrixPosition(light.matrixWorld); + uniforms.position.applyMatrix4(viewMatrix); + pointLength++; + } else if (light.isHemisphereLight) { + const uniforms = state.hemi[hemiLength]; + uniforms.direction.setFromMatrixPosition(light.matrixWorld); + uniforms.direction.transformDirection(viewMatrix); + hemiLength++; + } + } + } + return { + setup, + setupView, + state + }; +} +function WebGLRenderState(extensions, capabilities) { + const lights = new WebGLLights(extensions, capabilities); + const lightsArray = []; + const shadowsArray = []; + function init4() { + lightsArray.length = 0; + shadowsArray.length = 0; + } + function pushLight(light) { + lightsArray.push(light); + } + function pushShadow(shadowLight) { + shadowsArray.push(shadowLight); + } + function setupLights(physicallyCorrectLights) { + lights.setup(lightsArray, physicallyCorrectLights); + } + function setupLightsView(camera3) { + lights.setupView(lightsArray, camera3); + } + const state = { + lightsArray, + shadowsArray, + lights + }; + return { + init: init4, + state, + setupLights, + setupLightsView, + pushLight, + pushShadow + }; +} +function WebGLRenderStates(extensions, capabilities) { + let renderStates = /* @__PURE__ */ new WeakMap(); + function get2(scene3, renderCallDepth = 0) { + let renderState; + if (renderStates.has(scene3) === false) { + renderState = new WebGLRenderState(extensions, capabilities); + renderStates.set(scene3, [renderState]); + } else { + if (renderCallDepth >= renderStates.get(scene3).length) { + renderState = new WebGLRenderState(extensions, capabilities); + renderStates.get(scene3).push(renderState); + } else { + renderState = renderStates.get(scene3)[renderCallDepth]; + } + } + return renderState; + } + function dispose() { + renderStates = /* @__PURE__ */ new WeakMap(); + } + return { + get: get2, + dispose + }; +} +var MeshDepthMaterial = class extends Material { + constructor(parameters) { + super(); + this.isMeshDepthMaterial = true; + this.type = "MeshDepthMaterial"; + this.depthPacking = BasicDepthPacking; + this.map = null; + this.alphaMap = null; + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + this.wireframe = false; + this.wireframeLinewidth = 1; + this.setValues(parameters); + } + copy(source) { + super.copy(source); + this.depthPacking = source.depthPacking; + this.map = source.map; + this.alphaMap = source.alphaMap; + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + return this; + } +}; +var MeshDistanceMaterial = class extends Material { + constructor(parameters) { + super(); + this.isMeshDistanceMaterial = true; + this.type = "MeshDistanceMaterial"; + this.referencePosition = new Vector3(); + this.nearDistance = 1; + this.farDistance = 1e3; + this.map = null; + this.alphaMap = null; + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + this.setValues(parameters); + } + copy(source) { + super.copy(source); + this.referencePosition.copy(source.referencePosition); + this.nearDistance = source.nearDistance; + this.farDistance = source.farDistance; + this.map = source.map; + this.alphaMap = source.alphaMap; + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + return this; + } +}; +var vertex = "void main() {\n gl_Position = vec4( position, 1.0 );\n}"; +var fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"; +function WebGLShadowMap(_renderer, _objects, _capabilities) { + let _frustum = new Frustum(); + const _shadowMapSize = new Vector2(), _viewportSize = new Vector2(), _viewport = new Vector4(), _depthMaterial = new MeshDepthMaterial({ depthPacking: RGBADepthPacking }), _distanceMaterial = new MeshDistanceMaterial(), _materialCache = {}, _maxTextureSize = _capabilities.maxTextureSize; + const shadowSide = { 0: BackSide, 1: FrontSide, 2: DoubleSide }; + const shadowMaterialVertical = new ShaderMaterial({ + defines: { + VSM_SAMPLES: 8 + }, + uniforms: { + shadow_pass: { value: null }, + resolution: { value: new Vector2() }, + radius: { value: 4 } + }, + vertexShader: vertex, + fragmentShader: fragment + }); + const shadowMaterialHorizontal = shadowMaterialVertical.clone(); + shadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1; + const fullScreenTri = new BufferGeometry(); + fullScreenTri.setAttribute("position", new BufferAttribute(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3)); + const fullScreenMesh = new Mesh(fullScreenTri, shadowMaterialVertical); + const scope = this; + this.enabled = false; + this.autoUpdate = true; + this.needsUpdate = false; + this.type = PCFShadowMap; + this.render = function(lights, scene3, camera3) { + if (scope.enabled === false) + return; + if (scope.autoUpdate === false && scope.needsUpdate === false) + return; + if (lights.length === 0) + return; + const currentRenderTarget = _renderer.getRenderTarget(); + const activeCubeFace = _renderer.getActiveCubeFace(); + const activeMipmapLevel = _renderer.getActiveMipmapLevel(); + const _state = _renderer.state; + _state.setBlending(NoBlending); + _state.buffers.color.setClear(1, 1, 1, 1); + _state.buffers.depth.setTest(true); + _state.setScissorTest(false); + for (let i = 0, il = lights.length; i < il; i++) { + const light = lights[i]; + const shadow = light.shadow; + if (shadow === void 0) { + console.warn("THREE.WebGLShadowMap:", light, "has no shadow."); + continue; + } + if (shadow.autoUpdate === false && shadow.needsUpdate === false) + continue; + _shadowMapSize.copy(shadow.mapSize); + const shadowFrameExtents = shadow.getFrameExtents(); + _shadowMapSize.multiply(shadowFrameExtents); + _viewportSize.copy(shadow.mapSize); + if (_shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize) { + if (_shadowMapSize.x > _maxTextureSize) { + _viewportSize.x = Math.floor(_maxTextureSize / shadowFrameExtents.x); + _shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x; + shadow.mapSize.x = _viewportSize.x; + } + if (_shadowMapSize.y > _maxTextureSize) { + _viewportSize.y = Math.floor(_maxTextureSize / shadowFrameExtents.y); + _shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y; + shadow.mapSize.y = _viewportSize.y; + } + } + if (shadow.map === null) { + const pars = this.type !== VSMShadowMap ? { minFilter: NearestFilter, magFilter: NearestFilter } : {}; + shadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars); + shadow.map.texture.name = light.name + ".shadowMap"; + shadow.camera.updateProjectionMatrix(); + } + _renderer.setRenderTarget(shadow.map); + _renderer.clear(); + const viewportCount = shadow.getViewportCount(); + for (let vp = 0; vp < viewportCount; vp++) { + const viewport = shadow.getViewport(vp); + _viewport.set(_viewportSize.x * viewport.x, _viewportSize.y * viewport.y, _viewportSize.x * viewport.z, _viewportSize.y * viewport.w); + _state.viewport(_viewport); + shadow.updateMatrices(light, vp); + _frustum = shadow.getFrustum(); + renderObject(scene3, camera3, shadow.camera, light, this.type); + } + if (shadow.isPointLightShadow !== true && this.type === VSMShadowMap) { + VSMPass(shadow, camera3); + } + shadow.needsUpdate = false; + } + scope.needsUpdate = false; + _renderer.setRenderTarget(currentRenderTarget, activeCubeFace, activeMipmapLevel); + }; + function VSMPass(shadow, camera3) { + const geometry = _objects.update(fullScreenMesh); + if (shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples) { + shadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples; + shadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples; + shadowMaterialVertical.needsUpdate = true; + shadowMaterialHorizontal.needsUpdate = true; + } + if (shadow.mapPass === null) { + shadow.mapPass = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y); + } + shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture; + shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize; + shadowMaterialVertical.uniforms.radius.value = shadow.radius; + _renderer.setRenderTarget(shadow.mapPass); + _renderer.clear(); + _renderer.renderBufferDirect(camera3, null, geometry, shadowMaterialVertical, fullScreenMesh, null); + shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture; + shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize; + shadowMaterialHorizontal.uniforms.radius.value = shadow.radius; + _renderer.setRenderTarget(shadow.map); + _renderer.clear(); + _renderer.renderBufferDirect(camera3, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null); + } + function getDepthMaterial(object, material, light, shadowCameraNear, shadowCameraFar, type) { + let result = null; + const customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial; + if (customMaterial !== void 0) { + result = customMaterial; + } else { + result = light.isPointLight === true ? _distanceMaterial : _depthMaterial; + } + if (_renderer.localClippingEnabled && material.clipShadows === true && Array.isArray(material.clippingPlanes) && material.clippingPlanes.length !== 0 || material.displacementMap && material.displacementScale !== 0 || material.alphaMap && material.alphaTest > 0) { + const keyA = result.uuid, keyB = material.uuid; + let materialsForVariant = _materialCache[keyA]; + if (materialsForVariant === void 0) { + materialsForVariant = {}; + _materialCache[keyA] = materialsForVariant; + } + let cachedMaterial = materialsForVariant[keyB]; + if (cachedMaterial === void 0) { + cachedMaterial = result.clone(); + materialsForVariant[keyB] = cachedMaterial; + } + result = cachedMaterial; + } + result.visible = material.visible; + result.wireframe = material.wireframe; + if (type === VSMShadowMap) { + result.side = material.shadowSide !== null ? material.shadowSide : material.side; + } else { + result.side = material.shadowSide !== null ? material.shadowSide : shadowSide[material.side]; + } + result.alphaMap = material.alphaMap; + result.alphaTest = material.alphaTest; + result.clipShadows = material.clipShadows; + result.clippingPlanes = material.clippingPlanes; + result.clipIntersection = material.clipIntersection; + result.displacementMap = material.displacementMap; + result.displacementScale = material.displacementScale; + result.displacementBias = material.displacementBias; + result.wireframeLinewidth = material.wireframeLinewidth; + result.linewidth = material.linewidth; + if (light.isPointLight === true && result.isMeshDistanceMaterial === true) { + result.referencePosition.setFromMatrixPosition(light.matrixWorld); + result.nearDistance = shadowCameraNear; + result.farDistance = shadowCameraFar; + } + return result; + } + function renderObject(object, camera3, shadowCamera, light, type) { + if (object.visible === false) + return; + const visible = object.layers.test(camera3.layers); + if (visible && (object.isMesh || object.isLine || object.isPoints)) { + if ((object.castShadow || object.receiveShadow && type === VSMShadowMap) && (!object.frustumCulled || _frustum.intersectsObject(object))) { + object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object.matrixWorld); + const geometry = _objects.update(object); + const material = object.material; + if (Array.isArray(material)) { + const groups = geometry.groups; + for (let k = 0, kl = groups.length; k < kl; k++) { + const group = groups[k]; + const groupMaterial = material[group.materialIndex]; + if (groupMaterial && groupMaterial.visible) { + const depthMaterial = getDepthMaterial(object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type); + _renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group); + } + } + } else if (material.visible) { + const depthMaterial = getDepthMaterial(object, material, light, shadowCamera.near, shadowCamera.far, type); + _renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null); + } + } + } + const children = object.children; + for (let i = 0, l = children.length; i < l; i++) { + renderObject(children[i], camera3, shadowCamera, light, type); + } + } +} +function WebGLState(gl, extensions, capabilities) { + const isWebGL2 = capabilities.isWebGL2; + function ColorBuffer() { + let locked = false; + const color = new Vector4(); + let currentColorMask = null; + const currentColorClear = new Vector4(0, 0, 0, 0); + return { + setMask: function(colorMask) { + if (currentColorMask !== colorMask && !locked) { + gl.colorMask(colorMask, colorMask, colorMask, colorMask); + currentColorMask = colorMask; + } + }, + setLocked: function(lock) { + locked = lock; + }, + setClear: function(r, g, b, a2, premultipliedAlpha) { + if (premultipliedAlpha === true) { + r *= a2; + g *= a2; + b *= a2; + } + color.set(r, g, b, a2); + if (currentColorClear.equals(color) === false) { + gl.clearColor(r, g, b, a2); + currentColorClear.copy(color); + } + }, + reset: function() { + locked = false; + currentColorMask = null; + currentColorClear.set(-1, 0, 0, 0); + } + }; + } + function DepthBuffer() { + let locked = false; + let currentDepthMask = null; + let currentDepthFunc = null; + let currentDepthClear = null; + return { + setTest: function(depthTest) { + if (depthTest) { + enable(2929); + } else { + disable(2929); + } + }, + setMask: function(depthMask) { + if (currentDepthMask !== depthMask && !locked) { + gl.depthMask(depthMask); + currentDepthMask = depthMask; + } + }, + setFunc: function(depthFunc) { + if (currentDepthFunc !== depthFunc) { + if (depthFunc) { + switch (depthFunc) { + case NeverDepth: + gl.depthFunc(512); + break; + case AlwaysDepth: + gl.depthFunc(519); + break; + case LessDepth: + gl.depthFunc(513); + break; + case LessEqualDepth: + gl.depthFunc(515); + break; + case EqualDepth: + gl.depthFunc(514); + break; + case GreaterEqualDepth: + gl.depthFunc(518); + break; + case GreaterDepth: + gl.depthFunc(516); + break; + case NotEqualDepth: + gl.depthFunc(517); + break; + default: + gl.depthFunc(515); + } + } else { + gl.depthFunc(515); + } + currentDepthFunc = depthFunc; + } + }, + setLocked: function(lock) { + locked = lock; + }, + setClear: function(depth) { + if (currentDepthClear !== depth) { + gl.clearDepth(depth); + currentDepthClear = depth; + } + }, + reset: function() { + locked = false; + currentDepthMask = null; + currentDepthFunc = null; + currentDepthClear = null; + } + }; + } + function StencilBuffer() { + let locked = false; + let currentStencilMask = null; + let currentStencilFunc = null; + let currentStencilRef = null; + let currentStencilFuncMask = null; + let currentStencilFail = null; + let currentStencilZFail = null; + let currentStencilZPass = null; + let currentStencilClear = null; + return { + setTest: function(stencilTest) { + if (!locked) { + if (stencilTest) { + enable(2960); + } else { + disable(2960); + } + } + }, + setMask: function(stencilMask) { + if (currentStencilMask !== stencilMask && !locked) { + gl.stencilMask(stencilMask); + currentStencilMask = stencilMask; + } + }, + setFunc: function(stencilFunc, stencilRef, stencilMask) { + if (currentStencilFunc !== stencilFunc || currentStencilRef !== stencilRef || currentStencilFuncMask !== stencilMask) { + gl.stencilFunc(stencilFunc, stencilRef, stencilMask); + currentStencilFunc = stencilFunc; + currentStencilRef = stencilRef; + currentStencilFuncMask = stencilMask; + } + }, + setOp: function(stencilFail, stencilZFail, stencilZPass) { + if (currentStencilFail !== stencilFail || currentStencilZFail !== stencilZFail || currentStencilZPass !== stencilZPass) { + gl.stencilOp(stencilFail, stencilZFail, stencilZPass); + currentStencilFail = stencilFail; + currentStencilZFail = stencilZFail; + currentStencilZPass = stencilZPass; + } + }, + setLocked: function(lock) { + locked = lock; + }, + setClear: function(stencil) { + if (currentStencilClear !== stencil) { + gl.clearStencil(stencil); + currentStencilClear = stencil; + } + }, + reset: function() { + locked = false; + currentStencilMask = null; + currentStencilFunc = null; + currentStencilRef = null; + currentStencilFuncMask = null; + currentStencilFail = null; + currentStencilZFail = null; + currentStencilZPass = null; + currentStencilClear = null; + } + }; + } + const colorBuffer = new ColorBuffer(); + const depthBuffer = new DepthBuffer(); + const stencilBuffer = new StencilBuffer(); + const uboBindings = /* @__PURE__ */ new WeakMap(); + const uboProgamMap = /* @__PURE__ */ new WeakMap(); + let enabledCapabilities = {}; + let currentBoundFramebuffers = {}; + let currentDrawbuffers = /* @__PURE__ */ new WeakMap(); + let defaultDrawbuffers = []; + let currentProgram = null; + let currentBlendingEnabled = false; + let currentBlending = null; + let currentBlendEquation = null; + let currentBlendSrc = null; + let currentBlendDst = null; + let currentBlendEquationAlpha = null; + let currentBlendSrcAlpha = null; + let currentBlendDstAlpha = null; + let currentPremultipledAlpha = false; + let currentFlipSided = null; + let currentCullFace = null; + let currentLineWidth = null; + let currentPolygonOffsetFactor = null; + let currentPolygonOffsetUnits = null; + const maxTextures = gl.getParameter(35661); + let lineWidthAvailable = false; + let version = 0; + const glVersion = gl.getParameter(7938); + if (glVersion.indexOf("WebGL") !== -1) { + version = parseFloat(/^WebGL (\d)/.exec(glVersion)[1]); + lineWidthAvailable = version >= 1; + } else if (glVersion.indexOf("OpenGL ES") !== -1) { + version = parseFloat(/^OpenGL ES (\d)/.exec(glVersion)[1]); + lineWidthAvailable = version >= 2; + } + let currentTextureSlot = null; + let currentBoundTextures = {}; + const scissorParam = gl.getParameter(3088); + const viewportParam = gl.getParameter(2978); + const currentScissor = new Vector4().fromArray(scissorParam); + const currentViewport = new Vector4().fromArray(viewportParam); + function createTexture(type, target, count) { + const data = new Uint8Array(4); + const texture = gl.createTexture(); + gl.bindTexture(type, texture); + gl.texParameteri(type, 10241, 9728); + gl.texParameteri(type, 10240, 9728); + for (let i = 0; i < count; i++) { + gl.texImage2D(target + i, 0, 6408, 1, 1, 0, 6408, 5121, data); + } + return texture; + } + const emptyTextures = {}; + emptyTextures[3553] = createTexture(3553, 3553, 1); + emptyTextures[34067] = createTexture(34067, 34069, 6); + colorBuffer.setClear(0, 0, 0, 1); + depthBuffer.setClear(1); + stencilBuffer.setClear(0); + enable(2929); + depthBuffer.setFunc(LessEqualDepth); + setFlipSided(false); + setCullFace(CullFaceBack); + enable(2884); + setBlending(NoBlending); + function enable(id) { + if (enabledCapabilities[id] !== true) { + gl.enable(id); + enabledCapabilities[id] = true; + } + } + function disable(id) { + if (enabledCapabilities[id] !== false) { + gl.disable(id); + enabledCapabilities[id] = false; + } + } + function bindFramebuffer(target, framebuffer) { + if (currentBoundFramebuffers[target] !== framebuffer) { + gl.bindFramebuffer(target, framebuffer); + currentBoundFramebuffers[target] = framebuffer; + if (isWebGL2) { + if (target === 36009) { + currentBoundFramebuffers[36160] = framebuffer; + } + if (target === 36160) { + currentBoundFramebuffers[36009] = framebuffer; + } + } + return true; + } + return false; + } + function drawBuffers(renderTarget, framebuffer) { + let drawBuffers2 = defaultDrawbuffers; + let needsUpdate = false; + if (renderTarget) { + drawBuffers2 = currentDrawbuffers.get(framebuffer); + if (drawBuffers2 === void 0) { + drawBuffers2 = []; + currentDrawbuffers.set(framebuffer, drawBuffers2); + } + if (renderTarget.isWebGLMultipleRenderTargets) { + const textures = renderTarget.texture; + if (drawBuffers2.length !== textures.length || drawBuffers2[0] !== 36064) { + for (let i = 0, il = textures.length; i < il; i++) { + drawBuffers2[i] = 36064 + i; + } + drawBuffers2.length = textures.length; + needsUpdate = true; + } + } else { + if (drawBuffers2[0] !== 36064) { + drawBuffers2[0] = 36064; + needsUpdate = true; + } + } + } else { + if (drawBuffers2[0] !== 1029) { + drawBuffers2[0] = 1029; + needsUpdate = true; + } + } + if (needsUpdate) { + if (capabilities.isWebGL2) { + gl.drawBuffers(drawBuffers2); + } else { + extensions.get("WEBGL_draw_buffers").drawBuffersWEBGL(drawBuffers2); + } + } + } + function useProgram(program) { + if (currentProgram !== program) { + gl.useProgram(program); + currentProgram = program; + return true; + } + return false; + } + const equationToGL = { + [AddEquation]: 32774, + [SubtractEquation]: 32778, + [ReverseSubtractEquation]: 32779 + }; + if (isWebGL2) { + equationToGL[MinEquation] = 32775; + equationToGL[MaxEquation] = 32776; + } else { + const extension = extensions.get("EXT_blend_minmax"); + if (extension !== null) { + equationToGL[MinEquation] = extension.MIN_EXT; + equationToGL[MaxEquation] = extension.MAX_EXT; + } + } + const factorToGL = { + [ZeroFactor]: 0, + [OneFactor]: 1, + [SrcColorFactor]: 768, + [SrcAlphaFactor]: 770, + [SrcAlphaSaturateFactor]: 776, + [DstColorFactor]: 774, + [DstAlphaFactor]: 772, + [OneMinusSrcColorFactor]: 769, + [OneMinusSrcAlphaFactor]: 771, + [OneMinusDstColorFactor]: 775, + [OneMinusDstAlphaFactor]: 773 + }; + function setBlending(blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha) { + if (blending === NoBlending) { + if (currentBlendingEnabled === true) { + disable(3042); + currentBlendingEnabled = false; + } + return; + } + if (currentBlendingEnabled === false) { + enable(3042); + currentBlendingEnabled = true; + } + if (blending !== CustomBlending) { + if (blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha) { + if (currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation) { + gl.blendEquation(32774); + currentBlendEquation = AddEquation; + currentBlendEquationAlpha = AddEquation; + } + if (premultipliedAlpha) { + switch (blending) { + case NormalBlending: + gl.blendFuncSeparate(1, 771, 1, 771); + break; + case AdditiveBlending: + gl.blendFunc(1, 1); + break; + case SubtractiveBlending: + gl.blendFuncSeparate(0, 769, 0, 1); + break; + case MultiplyBlending: + gl.blendFuncSeparate(0, 768, 0, 770); + break; + default: + console.error("THREE.WebGLState: Invalid blending: ", blending); + break; + } + } else { + switch (blending) { + case NormalBlending: + gl.blendFuncSeparate(770, 771, 1, 771); + break; + case AdditiveBlending: + gl.blendFunc(770, 1); + break; + case SubtractiveBlending: + gl.blendFuncSeparate(0, 769, 0, 1); + break; + case MultiplyBlending: + gl.blendFunc(0, 768); + break; + default: + console.error("THREE.WebGLState: Invalid blending: ", blending); + break; + } + } + currentBlendSrc = null; + currentBlendDst = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; + currentBlending = blending; + currentPremultipledAlpha = premultipliedAlpha; + } + return; + } + blendEquationAlpha = blendEquationAlpha || blendEquation; + blendSrcAlpha = blendSrcAlpha || blendSrc; + blendDstAlpha = blendDstAlpha || blendDst; + if (blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha) { + gl.blendEquationSeparate(equationToGL[blendEquation], equationToGL[blendEquationAlpha]); + currentBlendEquation = blendEquation; + currentBlendEquationAlpha = blendEquationAlpha; + } + if (blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha) { + gl.blendFuncSeparate(factorToGL[blendSrc], factorToGL[blendDst], factorToGL[blendSrcAlpha], factorToGL[blendDstAlpha]); + currentBlendSrc = blendSrc; + currentBlendDst = blendDst; + currentBlendSrcAlpha = blendSrcAlpha; + currentBlendDstAlpha = blendDstAlpha; + } + currentBlending = blending; + currentPremultipledAlpha = null; + } + function setMaterial(material, frontFaceCW) { + material.side === DoubleSide ? disable(2884) : enable(2884); + let flipSided = material.side === BackSide; + if (frontFaceCW) + flipSided = !flipSided; + setFlipSided(flipSided); + material.blending === NormalBlending && material.transparent === false ? setBlending(NoBlending) : setBlending(material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha); + depthBuffer.setFunc(material.depthFunc); + depthBuffer.setTest(material.depthTest); + depthBuffer.setMask(material.depthWrite); + colorBuffer.setMask(material.colorWrite); + const stencilWrite = material.stencilWrite; + stencilBuffer.setTest(stencilWrite); + if (stencilWrite) { + stencilBuffer.setMask(material.stencilWriteMask); + stencilBuffer.setFunc(material.stencilFunc, material.stencilRef, material.stencilFuncMask); + stencilBuffer.setOp(material.stencilFail, material.stencilZFail, material.stencilZPass); + } + setPolygonOffset(material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits); + material.alphaToCoverage === true ? enable(32926) : disable(32926); + } + function setFlipSided(flipSided) { + if (currentFlipSided !== flipSided) { + if (flipSided) { + gl.frontFace(2304); + } else { + gl.frontFace(2305); + } + currentFlipSided = flipSided; + } + } + function setCullFace(cullFace) { + if (cullFace !== CullFaceNone) { + enable(2884); + if (cullFace !== currentCullFace) { + if (cullFace === CullFaceBack) { + gl.cullFace(1029); + } else if (cullFace === CullFaceFront) { + gl.cullFace(1028); + } else { + gl.cullFace(1032); + } + } + } else { + disable(2884); + } + currentCullFace = cullFace; + } + function setLineWidth(width) { + if (width !== currentLineWidth) { + if (lineWidthAvailable) + gl.lineWidth(width); + currentLineWidth = width; + } + } + function setPolygonOffset(polygonOffset, factor, units) { + if (polygonOffset) { + enable(32823); + if (currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units) { + gl.polygonOffset(factor, units); + currentPolygonOffsetFactor = factor; + currentPolygonOffsetUnits = units; + } + } else { + disable(32823); + } + } + function setScissorTest(scissorTest) { + if (scissorTest) { + enable(3089); + } else { + disable(3089); + } + } + function activeTexture(webglSlot) { + if (webglSlot === void 0) + webglSlot = 33984 + maxTextures - 1; + if (currentTextureSlot !== webglSlot) { + gl.activeTexture(webglSlot); + currentTextureSlot = webglSlot; + } + } + function bindTexture(webglType, webglTexture) { + if (currentTextureSlot === null) { + activeTexture(); + } + let boundTexture = currentBoundTextures[currentTextureSlot]; + if (boundTexture === void 0) { + boundTexture = { type: void 0, texture: void 0 }; + currentBoundTextures[currentTextureSlot] = boundTexture; + } + if (boundTexture.type !== webglType || boundTexture.texture !== webglTexture) { + gl.bindTexture(webglType, webglTexture || emptyTextures[webglType]); + boundTexture.type = webglType; + boundTexture.texture = webglTexture; + } + } + function unbindTexture() { + const boundTexture = currentBoundTextures[currentTextureSlot]; + if (boundTexture !== void 0 && boundTexture.type !== void 0) { + gl.bindTexture(boundTexture.type, null); + boundTexture.type = void 0; + boundTexture.texture = void 0; + } + } + function compressedTexImage2D() { + try { + gl.compressedTexImage2D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function texSubImage2D() { + try { + gl.texSubImage2D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function texSubImage3D() { + try { + gl.texSubImage3D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function compressedTexSubImage2D() { + try { + gl.compressedTexSubImage2D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function texStorage2D() { + try { + gl.texStorage2D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function texStorage3D() { + try { + gl.texStorage3D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function texImage2D() { + try { + gl.texImage2D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function texImage3D() { + try { + gl.texImage3D.apply(gl, arguments); + } catch (error) { + console.error("THREE.WebGLState:", error); + } + } + function scissor(scissor2) { + if (currentScissor.equals(scissor2) === false) { + gl.scissor(scissor2.x, scissor2.y, scissor2.z, scissor2.w); + currentScissor.copy(scissor2); + } + } + function viewport(viewport2) { + if (currentViewport.equals(viewport2) === false) { + gl.viewport(viewport2.x, viewport2.y, viewport2.z, viewport2.w); + currentViewport.copy(viewport2); + } + } + function updateUBOMapping(uniformsGroup, program) { + let mapping = uboProgamMap.get(program); + if (mapping === void 0) { + mapping = /* @__PURE__ */ new WeakMap(); + uboProgamMap.set(program, mapping); + } + let blockIndex = mapping.get(uniformsGroup); + if (blockIndex === void 0) { + blockIndex = gl.getUniformBlockIndex(program, uniformsGroup.name); + mapping.set(uniformsGroup, blockIndex); + } + } + function uniformBlockBinding(uniformsGroup, program) { + const mapping = uboProgamMap.get(program); + const blockIndex = mapping.get(uniformsGroup); + if (uboBindings.get(uniformsGroup) !== blockIndex) { + gl.uniformBlockBinding(program, blockIndex, uniformsGroup.__bindingPointIndex); + uboBindings.set(uniformsGroup, blockIndex); + } + } + function reset() { + gl.disable(3042); + gl.disable(2884); + gl.disable(2929); + gl.disable(32823); + gl.disable(3089); + gl.disable(2960); + gl.disable(32926); + gl.blendEquation(32774); + gl.blendFunc(1, 0); + gl.blendFuncSeparate(1, 0, 1, 0); + gl.colorMask(true, true, true, true); + gl.clearColor(0, 0, 0, 0); + gl.depthMask(true); + gl.depthFunc(513); + gl.clearDepth(1); + gl.stencilMask(4294967295); + gl.stencilFunc(519, 0, 4294967295); + gl.stencilOp(7680, 7680, 7680); + gl.clearStencil(0); + gl.cullFace(1029); + gl.frontFace(2305); + gl.polygonOffset(0, 0); + gl.activeTexture(33984); + gl.bindFramebuffer(36160, null); + if (isWebGL2 === true) { + gl.bindFramebuffer(36009, null); + gl.bindFramebuffer(36008, null); + } + gl.useProgram(null); + gl.lineWidth(1); + gl.scissor(0, 0, gl.canvas.width, gl.canvas.height); + gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); + enabledCapabilities = {}; + currentTextureSlot = null; + currentBoundTextures = {}; + currentBoundFramebuffers = {}; + currentDrawbuffers = /* @__PURE__ */ new WeakMap(); + defaultDrawbuffers = []; + currentProgram = null; + currentBlendingEnabled = false; + currentBlending = null; + currentBlendEquation = null; + currentBlendSrc = null; + currentBlendDst = null; + currentBlendEquationAlpha = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; + currentPremultipledAlpha = false; + currentFlipSided = null; + currentCullFace = null; + currentLineWidth = null; + currentPolygonOffsetFactor = null; + currentPolygonOffsetUnits = null; + currentScissor.set(0, 0, gl.canvas.width, gl.canvas.height); + currentViewport.set(0, 0, gl.canvas.width, gl.canvas.height); + colorBuffer.reset(); + depthBuffer.reset(); + stencilBuffer.reset(); + } + return { + buffers: { + color: colorBuffer, + depth: depthBuffer, + stencil: stencilBuffer + }, + enable, + disable, + bindFramebuffer, + drawBuffers, + useProgram, + setBlending, + setMaterial, + setFlipSided, + setCullFace, + setLineWidth, + setPolygonOffset, + setScissorTest, + activeTexture, + bindTexture, + unbindTexture, + compressedTexImage2D, + texImage2D, + texImage3D, + updateUBOMapping, + uniformBlockBinding, + texStorage2D, + texStorage3D, + texSubImage2D, + texSubImage3D, + compressedTexSubImage2D, + scissor, + viewport, + reset + }; +} +function WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info) { + const isWebGL2 = capabilities.isWebGL2; + const maxTextures = capabilities.maxTextures; + const maxCubemapSize = capabilities.maxCubemapSize; + const maxTextureSize = capabilities.maxTextureSize; + const maxSamples = capabilities.maxSamples; + const multisampledRTTExt = extensions.has("WEBGL_multisampled_render_to_texture") ? extensions.get("WEBGL_multisampled_render_to_texture") : null; + const supportsInvalidateFramebuffer = /OculusBrowser/g.test(navigator.userAgent); + const _videoTextures = /* @__PURE__ */ new WeakMap(); + let _canvas2; + const _sources = /* @__PURE__ */ new WeakMap(); + let useOffscreenCanvas = false; + try { + useOffscreenCanvas = typeof OffscreenCanvas !== "undefined" && new OffscreenCanvas(1, 1).getContext("2d") !== null; + } catch (err) { + } + function createCanvas(width, height) { + return useOffscreenCanvas ? new OffscreenCanvas(width, height) : createElementNS("canvas"); + } + function resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) { + let scale = 1; + if (image.width > maxSize || image.height > maxSize) { + scale = maxSize / Math.max(image.width, image.height); + } + if (scale < 1 || needsPowerOfTwo === true) { + if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) { + const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor; + const width = floor(scale * image.width); + const height = floor(scale * image.height); + if (_canvas2 === void 0) + _canvas2 = createCanvas(width, height); + const canvas = needsNewCanvas ? createCanvas(width, height) : _canvas2; + canvas.width = width; + canvas.height = height; + const context = canvas.getContext("2d"); + context.drawImage(image, 0, 0, width, height); + console.warn("THREE.WebGLRenderer: Texture has been resized from (" + image.width + "x" + image.height + ") to (" + width + "x" + height + ")."); + return canvas; + } else { + if ("data" in image) { + console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + image.width + "x" + image.height + ")."); + } + return image; + } + } + return image; + } + function isPowerOfTwo$1(image) { + return isPowerOfTwo(image.width) && isPowerOfTwo(image.height); + } + function textureNeedsPowerOfTwo(texture) { + if (isWebGL2) + return false; + return texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping || texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; + } + function textureNeedsGenerateMipmaps(texture, supportsMips) { + return texture.generateMipmaps && supportsMips && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; + } + function generateMipmap(target) { + _gl.generateMipmap(target); + } + function getInternalFormat(internalFormatName, glFormat, glType, encoding, isVideoTexture = false) { + if (isWebGL2 === false) + return glFormat; + if (internalFormatName !== null) { + if (_gl[internalFormatName] !== void 0) + return _gl[internalFormatName]; + console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + internalFormatName + "'"); + } + let internalFormat = glFormat; + if (glFormat === 6403) { + if (glType === 5126) + internalFormat = 33326; + if (glType === 5131) + internalFormat = 33325; + if (glType === 5121) + internalFormat = 33321; + } + if (glFormat === 33319) { + if (glType === 5126) + internalFormat = 33328; + if (glType === 5131) + internalFormat = 33327; + if (glType === 5121) + internalFormat = 33323; + } + if (glFormat === 6408) { + if (glType === 5126) + internalFormat = 34836; + if (glType === 5131) + internalFormat = 34842; + if (glType === 5121) + internalFormat = encoding === sRGBEncoding && isVideoTexture === false ? 35907 : 32856; + if (glType === 32819) + internalFormat = 32854; + if (glType === 32820) + internalFormat = 32855; + } + if (internalFormat === 33325 || internalFormat === 33326 || internalFormat === 33327 || internalFormat === 33328 || internalFormat === 34842 || internalFormat === 34836) { + extensions.get("EXT_color_buffer_float"); + } + return internalFormat; + } + function getMipLevels(texture, image, supportsMips) { + if (textureNeedsGenerateMipmaps(texture, supportsMips) === true || texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) { + return Math.log2(Math.max(image.width, image.height)) + 1; + } else if (texture.mipmaps !== void 0 && texture.mipmaps.length > 0) { + return texture.mipmaps.length; + } else if (texture.isCompressedTexture && Array.isArray(texture.image)) { + return image.mipmaps.length; + } else { + return 1; + } + } + function filterFallback(f) { + if (f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter) { + return 9728; + } + return 9729; + } + function onTextureDispose(event) { + const texture = event.target; + texture.removeEventListener("dispose", onTextureDispose); + deallocateTexture(texture); + if (texture.isVideoTexture) { + _videoTextures.delete(texture); + } + } + function onRenderTargetDispose(event) { + const renderTarget = event.target; + renderTarget.removeEventListener("dispose", onRenderTargetDispose); + deallocateRenderTarget(renderTarget); + } + function deallocateTexture(texture) { + const textureProperties = properties.get(texture); + if (textureProperties.__webglInit === void 0) + return; + const source = texture.source; + const webglTextures = _sources.get(source); + if (webglTextures) { + const webglTexture = webglTextures[textureProperties.__cacheKey]; + webglTexture.usedTimes--; + if (webglTexture.usedTimes === 0) { + deleteTexture(texture); + } + if (Object.keys(webglTextures).length === 0) { + _sources.delete(source); + } + } + properties.remove(texture); + } + function deleteTexture(texture) { + const textureProperties = properties.get(texture); + _gl.deleteTexture(textureProperties.__webglTexture); + const source = texture.source; + const webglTextures = _sources.get(source); + delete webglTextures[textureProperties.__cacheKey]; + info.memory.textures--; + } + function deallocateRenderTarget(renderTarget) { + const texture = renderTarget.texture; + const renderTargetProperties = properties.get(renderTarget); + const textureProperties = properties.get(texture); + if (textureProperties.__webglTexture !== void 0) { + _gl.deleteTexture(textureProperties.__webglTexture); + info.memory.textures--; + } + if (renderTarget.depthTexture) { + renderTarget.depthTexture.dispose(); + } + if (renderTarget.isWebGLCubeRenderTarget) { + for (let i = 0; i < 6; i++) { + _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]); + if (renderTargetProperties.__webglDepthbuffer) + _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]); + } + } else { + _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer); + if (renderTargetProperties.__webglDepthbuffer) + _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer); + if (renderTargetProperties.__webglMultisampledFramebuffer) + _gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer); + if (renderTargetProperties.__webglColorRenderbuffer) { + for (let i = 0; i < renderTargetProperties.__webglColorRenderbuffer.length; i++) { + if (renderTargetProperties.__webglColorRenderbuffer[i]) + _gl.deleteRenderbuffer(renderTargetProperties.__webglColorRenderbuffer[i]); + } + } + if (renderTargetProperties.__webglDepthRenderbuffer) + _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthRenderbuffer); + } + if (renderTarget.isWebGLMultipleRenderTargets) { + for (let i = 0, il = texture.length; i < il; i++) { + const attachmentProperties = properties.get(texture[i]); + if (attachmentProperties.__webglTexture) { + _gl.deleteTexture(attachmentProperties.__webglTexture); + info.memory.textures--; + } + properties.remove(texture[i]); + } + } + properties.remove(texture); + properties.remove(renderTarget); + } + let textureUnits = 0; + function resetTextureUnits() { + textureUnits = 0; + } + function allocateTextureUnit() { + const textureUnit = textureUnits; + if (textureUnit >= maxTextures) { + console.warn("THREE.WebGLTextures: Trying to use " + textureUnit + " texture units while this GPU supports only " + maxTextures); + } + textureUnits += 1; + return textureUnit; + } + function getTextureCacheKey(texture) { + const array = []; + array.push(texture.wrapS); + array.push(texture.wrapT); + array.push(texture.magFilter); + array.push(texture.minFilter); + array.push(texture.anisotropy); + array.push(texture.internalFormat); + array.push(texture.format); + array.push(texture.type); + array.push(texture.generateMipmaps); + array.push(texture.premultiplyAlpha); + array.push(texture.flipY); + array.push(texture.unpackAlignment); + array.push(texture.encoding); + return array.join(); + } + function setTexture2D(texture, slot) { + const textureProperties = properties.get(texture); + if (texture.isVideoTexture) + updateVideoTexture(texture); + if (texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version) { + const image = texture.image; + if (image === null) { + console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found."); + } else if (image.complete === false) { + console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete"); + } else { + uploadTexture(textureProperties, texture, slot); + return; + } + } + state.activeTexture(33984 + slot); + state.bindTexture(3553, textureProperties.__webglTexture); + } + function setTexture2DArray(texture, slot) { + const textureProperties = properties.get(texture); + if (texture.version > 0 && textureProperties.__version !== texture.version) { + uploadTexture(textureProperties, texture, slot); + return; + } + state.activeTexture(33984 + slot); + state.bindTexture(35866, textureProperties.__webglTexture); + } + function setTexture3D(texture, slot) { + const textureProperties = properties.get(texture); + if (texture.version > 0 && textureProperties.__version !== texture.version) { + uploadTexture(textureProperties, texture, slot); + return; + } + state.activeTexture(33984 + slot); + state.bindTexture(32879, textureProperties.__webglTexture); + } + function setTextureCube(texture, slot) { + const textureProperties = properties.get(texture); + if (texture.version > 0 && textureProperties.__version !== texture.version) { + uploadCubeTexture(textureProperties, texture, slot); + return; + } + state.activeTexture(33984 + slot); + state.bindTexture(34067, textureProperties.__webglTexture); + } + const wrappingToGL = { + [RepeatWrapping]: 10497, + [ClampToEdgeWrapping]: 33071, + [MirroredRepeatWrapping]: 33648 + }; + const filterToGL = { + [NearestFilter]: 9728, + [NearestMipmapNearestFilter]: 9984, + [NearestMipmapLinearFilter]: 9986, + [LinearFilter]: 9729, + [LinearMipmapNearestFilter]: 9985, + [LinearMipmapLinearFilter]: 9987 + }; + function setTextureParameters(textureType, texture, supportsMips) { + if (supportsMips) { + _gl.texParameteri(textureType, 10242, wrappingToGL[texture.wrapS]); + _gl.texParameteri(textureType, 10243, wrappingToGL[texture.wrapT]); + if (textureType === 32879 || textureType === 35866) { + _gl.texParameteri(textureType, 32882, wrappingToGL[texture.wrapR]); + } + _gl.texParameteri(textureType, 10240, filterToGL[texture.magFilter]); + _gl.texParameteri(textureType, 10241, filterToGL[texture.minFilter]); + } else { + _gl.texParameteri(textureType, 10242, 33071); + _gl.texParameteri(textureType, 10243, 33071); + if (textureType === 32879 || textureType === 35866) { + _gl.texParameteri(textureType, 32882, 33071); + } + if (texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping) { + console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."); + } + _gl.texParameteri(textureType, 10240, filterFallback(texture.magFilter)); + _gl.texParameteri(textureType, 10241, filterFallback(texture.minFilter)); + if (texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) { + console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."); + } + } + if (extensions.has("EXT_texture_filter_anisotropic") === true) { + const extension = extensions.get("EXT_texture_filter_anisotropic"); + if (texture.type === FloatType && extensions.has("OES_texture_float_linear") === false) + return; + if (isWebGL2 === false && (texture.type === HalfFloatType && extensions.has("OES_texture_half_float_linear") === false)) + return; + if (texture.anisotropy > 1 || properties.get(texture).__currentAnisotropy) { + _gl.texParameterf(textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(texture.anisotropy, capabilities.getMaxAnisotropy())); + properties.get(texture).__currentAnisotropy = texture.anisotropy; + } + } + } + function initTexture(textureProperties, texture) { + let forceUpload = false; + if (textureProperties.__webglInit === void 0) { + textureProperties.__webglInit = true; + texture.addEventListener("dispose", onTextureDispose); + } + const source = texture.source; + let webglTextures = _sources.get(source); + if (webglTextures === void 0) { + webglTextures = {}; + _sources.set(source, webglTextures); + } + const textureCacheKey = getTextureCacheKey(texture); + if (textureCacheKey !== textureProperties.__cacheKey) { + if (webglTextures[textureCacheKey] === void 0) { + webglTextures[textureCacheKey] = { + texture: _gl.createTexture(), + usedTimes: 0 + }; + info.memory.textures++; + forceUpload = true; + } + webglTextures[textureCacheKey].usedTimes++; + const webglTexture = webglTextures[textureProperties.__cacheKey]; + if (webglTexture !== void 0) { + webglTextures[textureProperties.__cacheKey].usedTimes--; + if (webglTexture.usedTimes === 0) { + deleteTexture(texture); + } + } + textureProperties.__cacheKey = textureCacheKey; + textureProperties.__webglTexture = webglTextures[textureCacheKey].texture; + } + return forceUpload; + } + function uploadTexture(textureProperties, texture, slot) { + let textureType = 3553; + if (texture.isDataArrayTexture) + textureType = 35866; + if (texture.isData3DTexture) + textureType = 32879; + const forceUpload = initTexture(textureProperties, texture); + const source = texture.source; + state.activeTexture(33984 + slot); + state.bindTexture(textureType, textureProperties.__webglTexture); + if (source.version !== source.__currentVersion || forceUpload === true) { + _gl.pixelStorei(37440, texture.flipY); + _gl.pixelStorei(37441, texture.premultiplyAlpha); + _gl.pixelStorei(3317, texture.unpackAlignment); + _gl.pixelStorei(37443, 0); + const needsPowerOfTwo = textureNeedsPowerOfTwo(texture) && isPowerOfTwo$1(texture.image) === false; + let image = resizeImage(texture.image, needsPowerOfTwo, false, maxTextureSize); + image = verifyColorSpace(texture, image); + const supportsMips = isPowerOfTwo$1(image) || isWebGL2, glFormat = utils.convert(texture.format, texture.encoding); + let glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture); + setTextureParameters(textureType, texture, supportsMips); + let mipmap; + const mipmaps = texture.mipmaps; + const useTexStorage = isWebGL2 && texture.isVideoTexture !== true; + const allocateMemory = source.__currentVersion === void 0 || forceUpload === true; + const levels = getMipLevels(texture, image, supportsMips); + if (texture.isDepthTexture) { + glInternalFormat = 6402; + if (isWebGL2) { + if (texture.type === FloatType) { + glInternalFormat = 36012; + } else if (texture.type === UnsignedIntType) { + glInternalFormat = 33190; + } else if (texture.type === UnsignedInt248Type) { + glInternalFormat = 35056; + } else { + glInternalFormat = 33189; + } + } else { + if (texture.type === FloatType) { + console.error("WebGLRenderer: Floating point depth texture requires WebGL2."); + } + } + if (texture.format === DepthFormat && glInternalFormat === 6402) { + if (texture.type !== UnsignedShortType && texture.type !== UnsignedIntType) { + console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."); + texture.type = UnsignedIntType; + glType = utils.convert(texture.type); + } + } + if (texture.format === DepthStencilFormat && glInternalFormat === 6402) { + glInternalFormat = 34041; + if (texture.type !== UnsignedInt248Type) { + console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."); + texture.type = UnsignedInt248Type; + glType = utils.convert(texture.type); + } + } + if (allocateMemory) { + if (useTexStorage) { + state.texStorage2D(3553, 1, glInternalFormat, image.width, image.height); + } else { + state.texImage2D(3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null); + } + } + } else if (texture.isDataTexture) { + if (mipmaps.length > 0 && supportsMips) { + if (useTexStorage && allocateMemory) { + state.texStorage2D(3553, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height); + } + for (let i = 0, il = mipmaps.length; i < il; i++) { + mipmap = mipmaps[i]; + if (useTexStorage) { + state.texSubImage2D(3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data); + } else { + state.texImage2D(3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data); + } + } + texture.generateMipmaps = false; + } else { + if (useTexStorage) { + if (allocateMemory) { + state.texStorage2D(3553, levels, glInternalFormat, image.width, image.height); + } + state.texSubImage2D(3553, 0, 0, 0, image.width, image.height, glFormat, glType, image.data); + } else { + state.texImage2D(3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data); + } + } + } else if (texture.isCompressedTexture) { + if (useTexStorage && allocateMemory) { + state.texStorage2D(3553, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height); + } + for (let i = 0, il = mipmaps.length; i < il; i++) { + mipmap = mipmaps[i]; + if (texture.format !== RGBAFormat) { + if (glFormat !== null) { + if (useTexStorage) { + state.compressedTexSubImage2D(3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data); + } else { + state.compressedTexImage2D(3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data); + } + } else { + console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"); + } + } else { + if (useTexStorage) { + state.texSubImage2D(3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data); + } else { + state.texImage2D(3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data); + } + } + } + } else if (texture.isDataArrayTexture) { + if (useTexStorage) { + if (allocateMemory) { + state.texStorage3D(35866, levels, glInternalFormat, image.width, image.height, image.depth); + } + state.texSubImage3D(35866, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data); + } else { + state.texImage3D(35866, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data); + } + } else if (texture.isData3DTexture) { + if (useTexStorage) { + if (allocateMemory) { + state.texStorage3D(32879, levels, glInternalFormat, image.width, image.height, image.depth); + } + state.texSubImage3D(32879, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data); + } else { + state.texImage3D(32879, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data); + } + } else if (texture.isFramebufferTexture) { + if (allocateMemory) { + if (useTexStorage) { + state.texStorage2D(3553, levels, glInternalFormat, image.width, image.height); + } else { + let width = image.width, height = image.height; + for (let i = 0; i < levels; i++) { + state.texImage2D(3553, i, glInternalFormat, width, height, 0, glFormat, glType, null); + width >>= 1; + height >>= 1; + } + } + } + } else { + if (mipmaps.length > 0 && supportsMips) { + if (useTexStorage && allocateMemory) { + state.texStorage2D(3553, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height); + } + for (let i = 0, il = mipmaps.length; i < il; i++) { + mipmap = mipmaps[i]; + if (useTexStorage) { + state.texSubImage2D(3553, i, 0, 0, glFormat, glType, mipmap); + } else { + state.texImage2D(3553, i, glInternalFormat, glFormat, glType, mipmap); + } + } + texture.generateMipmaps = false; + } else { + if (useTexStorage) { + if (allocateMemory) { + state.texStorage2D(3553, levels, glInternalFormat, image.width, image.height); + } + state.texSubImage2D(3553, 0, 0, 0, glFormat, glType, image); + } else { + state.texImage2D(3553, 0, glInternalFormat, glFormat, glType, image); + } + } + } + if (textureNeedsGenerateMipmaps(texture, supportsMips)) { + generateMipmap(textureType); + } + source.__currentVersion = source.version; + if (texture.onUpdate) + texture.onUpdate(texture); + } + textureProperties.__version = texture.version; + } + function uploadCubeTexture(textureProperties, texture, slot) { + if (texture.image.length !== 6) + return; + const forceUpload = initTexture(textureProperties, texture); + const source = texture.source; + state.activeTexture(33984 + slot); + state.bindTexture(34067, textureProperties.__webglTexture); + if (source.version !== source.__currentVersion || forceUpload === true) { + _gl.pixelStorei(37440, texture.flipY); + _gl.pixelStorei(37441, texture.premultiplyAlpha); + _gl.pixelStorei(3317, texture.unpackAlignment); + _gl.pixelStorei(37443, 0); + const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture; + const isDataTexture = texture.image[0] && texture.image[0].isDataTexture; + const cubeImage = []; + for (let i = 0; i < 6; i++) { + if (!isCompressed && !isDataTexture) { + cubeImage[i] = resizeImage(texture.image[i], false, true, maxCubemapSize); + } else { + cubeImage[i] = isDataTexture ? texture.image[i].image : texture.image[i]; + } + cubeImage[i] = verifyColorSpace(texture, cubeImage[i]); + } + const image = cubeImage[0], supportsMips = isPowerOfTwo$1(image) || isWebGL2, glFormat = utils.convert(texture.format, texture.encoding), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding); + const useTexStorage = isWebGL2 && texture.isVideoTexture !== true; + const allocateMemory = source.__currentVersion === void 0 || forceUpload === true; + let levels = getMipLevels(texture, image, supportsMips); + setTextureParameters(34067, texture, supportsMips); + let mipmaps; + if (isCompressed) { + if (useTexStorage && allocateMemory) { + state.texStorage2D(34067, levels, glInternalFormat, image.width, image.height); + } + for (let i = 0; i < 6; i++) { + mipmaps = cubeImage[i].mipmaps; + for (let j = 0; j < mipmaps.length; j++) { + const mipmap = mipmaps[j]; + if (texture.format !== RGBAFormat) { + if (glFormat !== null) { + if (useTexStorage) { + state.compressedTexSubImage2D(34069 + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data); + } else { + state.compressedTexImage2D(34069 + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data); + } + } else { + console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"); + } + } else { + if (useTexStorage) { + state.texSubImage2D(34069 + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data); + } else { + state.texImage2D(34069 + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data); + } + } + } + } + } else { + mipmaps = texture.mipmaps; + if (useTexStorage && allocateMemory) { + if (mipmaps.length > 0) + levels++; + state.texStorage2D(34067, levels, glInternalFormat, cubeImage[0].width, cubeImage[0].height); + } + for (let i = 0; i < 6; i++) { + if (isDataTexture) { + if (useTexStorage) { + state.texSubImage2D(34069 + i, 0, 0, 0, cubeImage[i].width, cubeImage[i].height, glFormat, glType, cubeImage[i].data); + } else { + state.texImage2D(34069 + i, 0, glInternalFormat, cubeImage[i].width, cubeImage[i].height, 0, glFormat, glType, cubeImage[i].data); + } + for (let j = 0; j < mipmaps.length; j++) { + const mipmap = mipmaps[j]; + const mipmapImage = mipmap.image[i].image; + if (useTexStorage) { + state.texSubImage2D(34069 + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data); + } else { + state.texImage2D(34069 + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data); + } + } + } else { + if (useTexStorage) { + state.texSubImage2D(34069 + i, 0, 0, 0, glFormat, glType, cubeImage[i]); + } else { + state.texImage2D(34069 + i, 0, glInternalFormat, glFormat, glType, cubeImage[i]); + } + for (let j = 0; j < mipmaps.length; j++) { + const mipmap = mipmaps[j]; + if (useTexStorage) { + state.texSubImage2D(34069 + i, j + 1, 0, 0, glFormat, glType, mipmap.image[i]); + } else { + state.texImage2D(34069 + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[i]); + } + } + } + } + } + if (textureNeedsGenerateMipmaps(texture, supportsMips)) { + generateMipmap(34067); + } + source.__currentVersion = source.version; + if (texture.onUpdate) + texture.onUpdate(texture); + } + textureProperties.__version = texture.version; + } + function setupFrameBufferTexture(framebuffer, renderTarget, texture, attachment, textureTarget) { + const glFormat = utils.convert(texture.format, texture.encoding); + const glType = utils.convert(texture.type); + const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding); + const renderTargetProperties = properties.get(renderTarget); + if (!renderTargetProperties.__hasExternalTextures) { + if (textureTarget === 32879 || textureTarget === 35866) { + state.texImage3D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null); + } else { + state.texImage2D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null); + } + } + state.bindFramebuffer(36160, framebuffer); + if (useMultisampledRTT(renderTarget)) { + multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160, attachment, textureTarget, properties.get(texture).__webglTexture, 0, getRenderTargetSamples(renderTarget)); + } else { + _gl.framebufferTexture2D(36160, attachment, textureTarget, properties.get(texture).__webglTexture, 0); + } + state.bindFramebuffer(36160, null); + } + function setupRenderBufferStorage(renderbuffer, renderTarget, isMultisample) { + _gl.bindRenderbuffer(36161, renderbuffer); + if (renderTarget.depthBuffer && !renderTarget.stencilBuffer) { + let glInternalFormat = 33189; + if (isMultisample || useMultisampledRTT(renderTarget)) { + const depthTexture = renderTarget.depthTexture; + if (depthTexture && depthTexture.isDepthTexture) { + if (depthTexture.type === FloatType) { + glInternalFormat = 36012; + } else if (depthTexture.type === UnsignedIntType) { + glInternalFormat = 33190; + } + } + const samples = getRenderTargetSamples(renderTarget); + if (useMultisampledRTT(renderTarget)) { + multisampledRTTExt.renderbufferStorageMultisampleEXT(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height); + } else { + _gl.renderbufferStorageMultisample(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height); + } + } else { + _gl.renderbufferStorage(36161, glInternalFormat, renderTarget.width, renderTarget.height); + } + _gl.framebufferRenderbuffer(36160, 36096, 36161, renderbuffer); + } else if (renderTarget.depthBuffer && renderTarget.stencilBuffer) { + const samples = getRenderTargetSamples(renderTarget); + if (isMultisample && useMultisampledRTT(renderTarget) === false) { + _gl.renderbufferStorageMultisample(36161, samples, 35056, renderTarget.width, renderTarget.height); + } else if (useMultisampledRTT(renderTarget)) { + multisampledRTTExt.renderbufferStorageMultisampleEXT(36161, samples, 35056, renderTarget.width, renderTarget.height); + } else { + _gl.renderbufferStorage(36161, 34041, renderTarget.width, renderTarget.height); + } + _gl.framebufferRenderbuffer(36160, 33306, 36161, renderbuffer); + } else { + const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [renderTarget.texture]; + for (let i = 0; i < textures.length; i++) { + const texture = textures[i]; + const glFormat = utils.convert(texture.format, texture.encoding); + const glType = utils.convert(texture.type); + const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding); + const samples = getRenderTargetSamples(renderTarget); + if (isMultisample && useMultisampledRTT(renderTarget) === false) { + _gl.renderbufferStorageMultisample(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height); + } else if (useMultisampledRTT(renderTarget)) { + multisampledRTTExt.renderbufferStorageMultisampleEXT(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height); + } else { + _gl.renderbufferStorage(36161, glInternalFormat, renderTarget.width, renderTarget.height); + } + } + } + _gl.bindRenderbuffer(36161, null); + } + function setupDepthTexture(framebuffer, renderTarget) { + const isCube = renderTarget && renderTarget.isWebGLCubeRenderTarget; + if (isCube) + throw new Error("Depth Texture with cube render targets is not supported"); + state.bindFramebuffer(36160, framebuffer); + if (!(renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture)) { + throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); + } + if (!properties.get(renderTarget.depthTexture).__webglTexture || renderTarget.depthTexture.image.width !== renderTarget.width || renderTarget.depthTexture.image.height !== renderTarget.height) { + renderTarget.depthTexture.image.width = renderTarget.width; + renderTarget.depthTexture.image.height = renderTarget.height; + renderTarget.depthTexture.needsUpdate = true; + } + setTexture2D(renderTarget.depthTexture, 0); + const webglDepthTexture = properties.get(renderTarget.depthTexture).__webglTexture; + const samples = getRenderTargetSamples(renderTarget); + if (renderTarget.depthTexture.format === DepthFormat) { + if (useMultisampledRTT(renderTarget)) { + multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160, 36096, 3553, webglDepthTexture, 0, samples); + } else { + _gl.framebufferTexture2D(36160, 36096, 3553, webglDepthTexture, 0); + } + } else if (renderTarget.depthTexture.format === DepthStencilFormat) { + if (useMultisampledRTT(renderTarget)) { + multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160, 33306, 3553, webglDepthTexture, 0, samples); + } else { + _gl.framebufferTexture2D(36160, 33306, 3553, webglDepthTexture, 0); + } + } else { + throw new Error("Unknown depthTexture format"); + } + } + function setupDepthRenderbuffer(renderTarget) { + const renderTargetProperties = properties.get(renderTarget); + const isCube = renderTarget.isWebGLCubeRenderTarget === true; + if (renderTarget.depthTexture && !renderTargetProperties.__autoAllocateDepthBuffer) { + if (isCube) + throw new Error("target.depthTexture not supported in Cube render targets"); + setupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget); + } else { + if (isCube) { + renderTargetProperties.__webglDepthbuffer = []; + for (let i = 0; i < 6; i++) { + state.bindFramebuffer(36160, renderTargetProperties.__webglFramebuffer[i]); + renderTargetProperties.__webglDepthbuffer[i] = _gl.createRenderbuffer(); + setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i], renderTarget, false); + } + } else { + state.bindFramebuffer(36160, renderTargetProperties.__webglFramebuffer); + renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget, false); + } + } + state.bindFramebuffer(36160, null); + } + function rebindTextures(renderTarget, colorTexture, depthTexture) { + const renderTargetProperties = properties.get(renderTarget); + if (colorTexture !== void 0) { + setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, 36064, 3553); + } + if (depthTexture !== void 0) { + setupDepthRenderbuffer(renderTarget); + } + } + function setupRenderTarget(renderTarget) { + const texture = renderTarget.texture; + const renderTargetProperties = properties.get(renderTarget); + const textureProperties = properties.get(texture); + renderTarget.addEventListener("dispose", onRenderTargetDispose); + if (renderTarget.isWebGLMultipleRenderTargets !== true) { + if (textureProperties.__webglTexture === void 0) { + textureProperties.__webglTexture = _gl.createTexture(); + } + textureProperties.__version = texture.version; + info.memory.textures++; + } + const isCube = renderTarget.isWebGLCubeRenderTarget === true; + const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true; + const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; + if (isCube) { + renderTargetProperties.__webglFramebuffer = []; + for (let i = 0; i < 6; i++) { + renderTargetProperties.__webglFramebuffer[i] = _gl.createFramebuffer(); + } + } else { + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + if (isMultipleRenderTargets) { + if (capabilities.drawBuffers) { + const textures = renderTarget.texture; + for (let i = 0, il = textures.length; i < il; i++) { + const attachmentProperties = properties.get(textures[i]); + if (attachmentProperties.__webglTexture === void 0) { + attachmentProperties.__webglTexture = _gl.createTexture(); + info.memory.textures++; + } + } + } else { + console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension."); + } + } + if (isWebGL2 && renderTarget.samples > 0 && useMultisampledRTT(renderTarget) === false) { + const textures = isMultipleRenderTargets ? texture : [texture]; + renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer(); + renderTargetProperties.__webglColorRenderbuffer = []; + state.bindFramebuffer(36160, renderTargetProperties.__webglMultisampledFramebuffer); + for (let i = 0; i < textures.length; i++) { + const texture2 = textures[i]; + renderTargetProperties.__webglColorRenderbuffer[i] = _gl.createRenderbuffer(); + _gl.bindRenderbuffer(36161, renderTargetProperties.__webglColorRenderbuffer[i]); + const glFormat = utils.convert(texture2.format, texture2.encoding); + const glType = utils.convert(texture2.type); + const glInternalFormat = getInternalFormat(texture2.internalFormat, glFormat, glType, texture2.encoding); + const samples = getRenderTargetSamples(renderTarget); + _gl.renderbufferStorageMultisample(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height); + _gl.framebufferRenderbuffer(36160, 36064 + i, 36161, renderTargetProperties.__webglColorRenderbuffer[i]); + } + _gl.bindRenderbuffer(36161, null); + if (renderTarget.depthBuffer) { + renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage(renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true); + } + state.bindFramebuffer(36160, null); + } + } + if (isCube) { + state.bindTexture(34067, textureProperties.__webglTexture); + setTextureParameters(34067, texture, supportsMips); + for (let i = 0; i < 6; i++) { + setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i], renderTarget, texture, 36064, 34069 + i); + } + if (textureNeedsGenerateMipmaps(texture, supportsMips)) { + generateMipmap(34067); + } + state.unbindTexture(); + } else if (isMultipleRenderTargets) { + const textures = renderTarget.texture; + for (let i = 0, il = textures.length; i < il; i++) { + const attachment = textures[i]; + const attachmentProperties = properties.get(attachment); + state.bindTexture(3553, attachmentProperties.__webglTexture); + setTextureParameters(3553, attachment, supportsMips); + setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, attachment, 36064 + i, 3553); + if (textureNeedsGenerateMipmaps(attachment, supportsMips)) { + generateMipmap(3553); + } + } + state.unbindTexture(); + } else { + let glTextureType = 3553; + if (renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget) { + if (isWebGL2) { + glTextureType = renderTarget.isWebGL3DRenderTarget ? 32879 : 35866; + } else { + console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2."); + } + } + state.bindTexture(glTextureType, textureProperties.__webglTexture); + setTextureParameters(glTextureType, texture, supportsMips); + setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, texture, 36064, glTextureType); + if (textureNeedsGenerateMipmaps(texture, supportsMips)) { + generateMipmap(glTextureType); + } + state.unbindTexture(); + } + if (renderTarget.depthBuffer) { + setupDepthRenderbuffer(renderTarget); + } + } + function updateRenderTargetMipmap(renderTarget) { + const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; + const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [renderTarget.texture]; + for (let i = 0, il = textures.length; i < il; i++) { + const texture = textures[i]; + if (textureNeedsGenerateMipmaps(texture, supportsMips)) { + const target = renderTarget.isWebGLCubeRenderTarget ? 34067 : 3553; + const webglTexture = properties.get(texture).__webglTexture; + state.bindTexture(target, webglTexture); + generateMipmap(target); + state.unbindTexture(); + } + } + } + function updateMultisampleRenderTarget(renderTarget) { + if (isWebGL2 && renderTarget.samples > 0 && useMultisampledRTT(renderTarget) === false) { + const textures = renderTarget.isWebGLMultipleRenderTargets ? renderTarget.texture : [renderTarget.texture]; + const width = renderTarget.width; + const height = renderTarget.height; + let mask = 16384; + const invalidationArray = []; + const depthStyle = renderTarget.stencilBuffer ? 33306 : 36096; + const renderTargetProperties = properties.get(renderTarget); + const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true; + if (isMultipleRenderTargets) { + for (let i = 0; i < textures.length; i++) { + state.bindFramebuffer(36160, renderTargetProperties.__webglMultisampledFramebuffer); + _gl.framebufferRenderbuffer(36160, 36064 + i, 36161, null); + state.bindFramebuffer(36160, renderTargetProperties.__webglFramebuffer); + _gl.framebufferTexture2D(36009, 36064 + i, 3553, null, 0); + } + } + state.bindFramebuffer(36008, renderTargetProperties.__webglMultisampledFramebuffer); + state.bindFramebuffer(36009, renderTargetProperties.__webglFramebuffer); + for (let i = 0; i < textures.length; i++) { + invalidationArray.push(36064 + i); + if (renderTarget.depthBuffer) { + invalidationArray.push(depthStyle); + } + const ignoreDepthValues = renderTargetProperties.__ignoreDepthValues !== void 0 ? renderTargetProperties.__ignoreDepthValues : false; + if (ignoreDepthValues === false) { + if (renderTarget.depthBuffer) + mask |= 256; + if (renderTarget.stencilBuffer) + mask |= 1024; + } + if (isMultipleRenderTargets) { + _gl.framebufferRenderbuffer(36008, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer[i]); + } + if (ignoreDepthValues === true) { + _gl.invalidateFramebuffer(36008, [depthStyle]); + _gl.invalidateFramebuffer(36009, [depthStyle]); + } + if (isMultipleRenderTargets) { + const webglTexture = properties.get(textures[i]).__webglTexture; + _gl.framebufferTexture2D(36009, 36064, 3553, webglTexture, 0); + } + _gl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, mask, 9728); + if (supportsInvalidateFramebuffer) { + _gl.invalidateFramebuffer(36008, invalidationArray); + } + } + state.bindFramebuffer(36008, null); + state.bindFramebuffer(36009, null); + if (isMultipleRenderTargets) { + for (let i = 0; i < textures.length; i++) { + state.bindFramebuffer(36160, renderTargetProperties.__webglMultisampledFramebuffer); + _gl.framebufferRenderbuffer(36160, 36064 + i, 36161, renderTargetProperties.__webglColorRenderbuffer[i]); + const webglTexture = properties.get(textures[i]).__webglTexture; + state.bindFramebuffer(36160, renderTargetProperties.__webglFramebuffer); + _gl.framebufferTexture2D(36009, 36064 + i, 3553, webglTexture, 0); + } + } + state.bindFramebuffer(36009, renderTargetProperties.__webglMultisampledFramebuffer); + } + } + function getRenderTargetSamples(renderTarget) { + return Math.min(maxSamples, renderTarget.samples); + } + function useMultisampledRTT(renderTarget) { + const renderTargetProperties = properties.get(renderTarget); + return isWebGL2 && renderTarget.samples > 0 && extensions.has("WEBGL_multisampled_render_to_texture") === true && renderTargetProperties.__useRenderToTexture !== false; + } + function updateVideoTexture(texture) { + const frame2 = info.render.frame; + if (_videoTextures.get(texture) !== frame2) { + _videoTextures.set(texture, frame2); + texture.update(); + } + } + function verifyColorSpace(texture, image) { + const encoding = texture.encoding; + const format2 = texture.format; + const type = texture.type; + if (texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat) + return image; + if (encoding !== LinearEncoding) { + if (encoding === sRGBEncoding) { + if (isWebGL2 === false) { + if (extensions.has("EXT_sRGB") === true && format2 === RGBAFormat) { + texture.format = _SRGBAFormat; + texture.minFilter = LinearFilter; + texture.generateMipmaps = false; + } else { + image = ImageUtils.sRGBToLinear(image); + } + } else { + if (format2 !== RGBAFormat || type !== UnsignedByteType) { + console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."); + } + } + } else { + console.error("THREE.WebGLTextures: Unsupported texture encoding:", encoding); + } + } + return image; + } + this.allocateTextureUnit = allocateTextureUnit; + this.resetTextureUnits = resetTextureUnits; + this.setTexture2D = setTexture2D; + this.setTexture2DArray = setTexture2DArray; + this.setTexture3D = setTexture3D; + this.setTextureCube = setTextureCube; + this.rebindTextures = rebindTextures; + this.setupRenderTarget = setupRenderTarget; + this.updateRenderTargetMipmap = updateRenderTargetMipmap; + this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; + this.setupDepthRenderbuffer = setupDepthRenderbuffer; + this.setupFrameBufferTexture = setupFrameBufferTexture; + this.useMultisampledRTT = useMultisampledRTT; +} +function WebGLUtils(gl, extensions, capabilities) { + const isWebGL2 = capabilities.isWebGL2; + function convert(p, encoding = null) { + let extension; + if (p === UnsignedByteType) + return 5121; + if (p === UnsignedShort4444Type) + return 32819; + if (p === UnsignedShort5551Type) + return 32820; + if (p === ByteType) + return 5120; + if (p === ShortType) + return 5122; + if (p === UnsignedShortType) + return 5123; + if (p === IntType) + return 5124; + if (p === UnsignedIntType) + return 5125; + if (p === FloatType) + return 5126; + if (p === HalfFloatType) { + if (isWebGL2) + return 5131; + extension = extensions.get("OES_texture_half_float"); + if (extension !== null) { + return extension.HALF_FLOAT_OES; + } else { + return null; + } + } + if (p === AlphaFormat) + return 6406; + if (p === RGBAFormat) + return 6408; + if (p === LuminanceFormat) + return 6409; + if (p === LuminanceAlphaFormat) + return 6410; + if (p === DepthFormat) + return 6402; + if (p === DepthStencilFormat) + return 34041; + if (p === RedFormat) + return 6403; + if (p === RGBFormat) { + console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"); + return 6408; + } + if (p === _SRGBAFormat) { + extension = extensions.get("EXT_sRGB"); + if (extension !== null) { + return extension.SRGB_ALPHA_EXT; + } else { + return null; + } + } + if (p === RedIntegerFormat) + return 36244; + if (p === RGFormat) + return 33319; + if (p === RGIntegerFormat) + return 33320; + if (p === RGBAIntegerFormat) + return 36249; + if (p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format) { + if (encoding === sRGBEncoding) { + extension = extensions.get("WEBGL_compressed_texture_s3tc_srgb"); + if (extension !== null) { + if (p === RGB_S3TC_DXT1_Format) + return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT; + if (p === RGBA_S3TC_DXT1_Format) + return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + if (p === RGBA_S3TC_DXT3_Format) + return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + if (p === RGBA_S3TC_DXT5_Format) + return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + } else { + return null; + } + } else { + extension = extensions.get("WEBGL_compressed_texture_s3tc"); + if (extension !== null) { + if (p === RGB_S3TC_DXT1_Format) + return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; + if (p === RGBA_S3TC_DXT1_Format) + return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; + if (p === RGBA_S3TC_DXT3_Format) + return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; + if (p === RGBA_S3TC_DXT5_Format) + return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; + } else { + return null; + } + } + } + if (p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format) { + extension = extensions.get("WEBGL_compressed_texture_pvrtc"); + if (extension !== null) { + if (p === RGB_PVRTC_4BPPV1_Format) + return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + if (p === RGB_PVRTC_2BPPV1_Format) + return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + if (p === RGBA_PVRTC_4BPPV1_Format) + return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + if (p === RGBA_PVRTC_2BPPV1_Format) + return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + } else { + return null; + } + } + if (p === RGB_ETC1_Format) { + extension = extensions.get("WEBGL_compressed_texture_etc1"); + if (extension !== null) { + return extension.COMPRESSED_RGB_ETC1_WEBGL; + } else { + return null; + } + } + if (p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format) { + extension = extensions.get("WEBGL_compressed_texture_etc"); + if (extension !== null) { + if (p === RGB_ETC2_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; + if (p === RGBA_ETC2_EAC_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; + } else { + return null; + } + } + if (p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format) { + extension = extensions.get("WEBGL_compressed_texture_astc"); + if (extension !== null) { + if (p === RGBA_ASTC_4x4_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; + if (p === RGBA_ASTC_5x4_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; + if (p === RGBA_ASTC_5x5_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; + if (p === RGBA_ASTC_6x5_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; + if (p === RGBA_ASTC_6x6_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; + if (p === RGBA_ASTC_8x5_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; + if (p === RGBA_ASTC_8x6_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; + if (p === RGBA_ASTC_8x8_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; + if (p === RGBA_ASTC_10x5_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; + if (p === RGBA_ASTC_10x6_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; + if (p === RGBA_ASTC_10x8_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; + if (p === RGBA_ASTC_10x10_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; + if (p === RGBA_ASTC_12x10_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; + if (p === RGBA_ASTC_12x12_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; + } else { + return null; + } + } + if (p === RGBA_BPTC_Format) { + extension = extensions.get("EXT_texture_compression_bptc"); + if (extension !== null) { + if (p === RGBA_BPTC_Format) + return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; + } else { + return null; + } + } + if (p === UnsignedInt248Type) { + if (isWebGL2) + return 34042; + extension = extensions.get("WEBGL_depth_texture"); + if (extension !== null) { + return extension.UNSIGNED_INT_24_8_WEBGL; + } else { + return null; + } + } + return gl[p] !== void 0 ? gl[p] : null; + } + return { convert }; +} +var ArrayCamera = class extends PerspectiveCamera { + constructor(array = []) { + super(); + this.isArrayCamera = true; + this.cameras = array; + } +}; +var Group = class extends Object3D { + constructor() { + super(); + this.isGroup = true; + this.type = "Group"; + } +}; +var _moveEvent = { type: "move" }; +var WebXRController = class { + constructor() { + this._targetRay = null; + this._grip = null; + this._hand = null; + } + getHandSpace() { + if (this._hand === null) { + this._hand = new Group(); + this._hand.matrixAutoUpdate = false; + this._hand.visible = false; + this._hand.joints = {}; + this._hand.inputState = { pinching: false }; + } + return this._hand; + } + getTargetRaySpace() { + if (this._targetRay === null) { + this._targetRay = new Group(); + this._targetRay.matrixAutoUpdate = false; + this._targetRay.visible = false; + this._targetRay.hasLinearVelocity = false; + this._targetRay.linearVelocity = new Vector3(); + this._targetRay.hasAngularVelocity = false; + this._targetRay.angularVelocity = new Vector3(); + } + return this._targetRay; + } + getGripSpace() { + if (this._grip === null) { + this._grip = new Group(); + this._grip.matrixAutoUpdate = false; + this._grip.visible = false; + this._grip.hasLinearVelocity = false; + this._grip.linearVelocity = new Vector3(); + this._grip.hasAngularVelocity = false; + this._grip.angularVelocity = new Vector3(); + } + return this._grip; + } + dispatchEvent(event) { + if (this._targetRay !== null) { + this._targetRay.dispatchEvent(event); + } + if (this._grip !== null) { + this._grip.dispatchEvent(event); + } + if (this._hand !== null) { + this._hand.dispatchEvent(event); + } + return this; + } + disconnect(inputSource) { + this.dispatchEvent({ type: "disconnected", data: inputSource }); + if (this._targetRay !== null) { + this._targetRay.visible = false; + } + if (this._grip !== null) { + this._grip.visible = false; + } + if (this._hand !== null) { + this._hand.visible = false; + } + return this; + } + update(inputSource, frame2, referenceSpace) { + let inputPose = null; + let gripPose = null; + let handPose = null; + const targetRay = this._targetRay; + const grip = this._grip; + const hand = this._hand; + if (inputSource && frame2.session.visibilityState !== "visible-blurred") { + if (hand && inputSource.hand) { + handPose = true; + for (const inputjoint of inputSource.hand.values()) { + const jointPose = frame2.getJointPose(inputjoint, referenceSpace); + if (hand.joints[inputjoint.jointName] === void 0) { + const joint2 = new Group(); + joint2.matrixAutoUpdate = false; + joint2.visible = false; + hand.joints[inputjoint.jointName] = joint2; + hand.add(joint2); + } + const joint = hand.joints[inputjoint.jointName]; + if (jointPose !== null) { + joint.matrix.fromArray(jointPose.transform.matrix); + joint.matrix.decompose(joint.position, joint.rotation, joint.scale); + joint.jointRadius = jointPose.radius; + } + joint.visible = jointPose !== null; + } + const indexTip = hand.joints["index-finger-tip"]; + const thumbTip = hand.joints["thumb-tip"]; + const distance = indexTip.position.distanceTo(thumbTip.position); + const distanceToPinch = 0.02; + const threshold = 5e-3; + if (hand.inputState.pinching && distance > distanceToPinch + threshold) { + hand.inputState.pinching = false; + this.dispatchEvent({ + type: "pinchend", + handedness: inputSource.handedness, + target: this + }); + } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) { + hand.inputState.pinching = true; + this.dispatchEvent({ + type: "pinchstart", + handedness: inputSource.handedness, + target: this + }); + } + } else { + if (grip !== null && inputSource.gripSpace) { + gripPose = frame2.getPose(inputSource.gripSpace, referenceSpace); + if (gripPose !== null) { + grip.matrix.fromArray(gripPose.transform.matrix); + grip.matrix.decompose(grip.position, grip.rotation, grip.scale); + if (gripPose.linearVelocity) { + grip.hasLinearVelocity = true; + grip.linearVelocity.copy(gripPose.linearVelocity); + } else { + grip.hasLinearVelocity = false; + } + if (gripPose.angularVelocity) { + grip.hasAngularVelocity = true; + grip.angularVelocity.copy(gripPose.angularVelocity); + } else { + grip.hasAngularVelocity = false; + } + } + } + } + if (targetRay !== null) { + inputPose = frame2.getPose(inputSource.targetRaySpace, referenceSpace); + if (inputPose === null && gripPose !== null) { + inputPose = gripPose; + } + if (inputPose !== null) { + targetRay.matrix.fromArray(inputPose.transform.matrix); + targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale); + if (inputPose.linearVelocity) { + targetRay.hasLinearVelocity = true; + targetRay.linearVelocity.copy(inputPose.linearVelocity); + } else { + targetRay.hasLinearVelocity = false; + } + if (inputPose.angularVelocity) { + targetRay.hasAngularVelocity = true; + targetRay.angularVelocity.copy(inputPose.angularVelocity); + } else { + targetRay.hasAngularVelocity = false; + } + this.dispatchEvent(_moveEvent); + } + } + } + if (targetRay !== null) { + targetRay.visible = inputPose !== null; + } + if (grip !== null) { + grip.visible = gripPose !== null; + } + if (hand !== null) { + hand.visible = handPose !== null; + } + return this; + } +}; +var DepthTexture = class extends Texture { + constructor(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format2) { + format2 = format2 !== void 0 ? format2 : DepthFormat; + if (format2 !== DepthFormat && format2 !== DepthStencilFormat) { + throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); + } + if (type === void 0 && format2 === DepthFormat) + type = UnsignedIntType; + if (type === void 0 && format2 === DepthStencilFormat) + type = UnsignedInt248Type; + super(null, mapping, wrapS, wrapT, magFilter, minFilter, format2, type, anisotropy); + this.isDepthTexture = true; + this.image = { width, height }; + this.magFilter = magFilter !== void 0 ? magFilter : NearestFilter; + this.minFilter = minFilter !== void 0 ? minFilter : NearestFilter; + this.flipY = false; + this.generateMipmaps = false; + } +}; +var WebXRManager = class extends EventDispatcher { + constructor(renderer3, gl) { + super(); + const scope = this; + let session = null; + let framebufferScaleFactor = 1; + let referenceSpace = null; + let referenceSpaceType = "local-floor"; + let customReferenceSpace = null; + let pose = null; + let glBinding = null; + let glProjLayer = null; + let glBaseLayer = null; + let xrFrame = null; + const attributes = gl.getContextAttributes(); + let initialRenderTarget = null; + let newRenderTarget = null; + const controllers = []; + const controllerInputSources = []; + const cameraL = new PerspectiveCamera(); + cameraL.layers.enable(1); + cameraL.viewport = new Vector4(); + const cameraR = new PerspectiveCamera(); + cameraR.layers.enable(2); + cameraR.viewport = new Vector4(); + const cameras = [cameraL, cameraR]; + const cameraVR = new ArrayCamera(); + cameraVR.layers.enable(1); + cameraVR.layers.enable(2); + let _currentDepthNear = null; + let _currentDepthFar = null; + this.cameraAutoUpdate = true; + this.enabled = false; + this.isPresenting = false; + this.getController = function(index5) { + let controller = controllers[index5]; + if (controller === void 0) { + controller = new WebXRController(); + controllers[index5] = controller; + } + return controller.getTargetRaySpace(); + }; + this.getControllerGrip = function(index5) { + let controller = controllers[index5]; + if (controller === void 0) { + controller = new WebXRController(); + controllers[index5] = controller; + } + return controller.getGripSpace(); + }; + this.getHand = function(index5) { + let controller = controllers[index5]; + if (controller === void 0) { + controller = new WebXRController(); + controllers[index5] = controller; + } + return controller.getHandSpace(); + }; + function onSessionEvent(event) { + const controllerIndex = controllerInputSources.indexOf(event.inputSource); + if (controllerIndex === -1) { + return; + } + const controller = controllers[controllerIndex]; + if (controller !== void 0) { + controller.dispatchEvent({ type: event.type, data: event.inputSource }); + } + } + function onSessionEnd() { + session.removeEventListener("select", onSessionEvent); + session.removeEventListener("selectstart", onSessionEvent); + session.removeEventListener("selectend", onSessionEvent); + session.removeEventListener("squeeze", onSessionEvent); + session.removeEventListener("squeezestart", onSessionEvent); + session.removeEventListener("squeezeend", onSessionEvent); + session.removeEventListener("end", onSessionEnd); + session.removeEventListener("inputsourceschange", onInputSourcesChange); + for (let i = 0; i < controllers.length; i++) { + const inputSource = controllerInputSources[i]; + if (inputSource === null) + continue; + controllerInputSources[i] = null; + controllers[i].disconnect(inputSource); + } + _currentDepthNear = null; + _currentDepthFar = null; + renderer3.setRenderTarget(initialRenderTarget); + glBaseLayer = null; + glProjLayer = null; + glBinding = null; + session = null; + newRenderTarget = null; + animation.stop(); + scope.isPresenting = false; + scope.dispatchEvent({ type: "sessionend" }); + } + this.setFramebufferScaleFactor = function(value) { + framebufferScaleFactor = value; + if (scope.isPresenting === true) { + console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); + } + }; + this.setReferenceSpaceType = function(value) { + referenceSpaceType = value; + if (scope.isPresenting === true) { + console.warn("THREE.WebXRManager: Cannot change reference space type while presenting."); + } + }; + this.getReferenceSpace = function() { + return customReferenceSpace || referenceSpace; + }; + this.setReferenceSpace = function(space) { + customReferenceSpace = space; + }; + this.getBaseLayer = function() { + return glProjLayer !== null ? glProjLayer : glBaseLayer; + }; + this.getBinding = function() { + return glBinding; + }; + this.getFrame = function() { + return xrFrame; + }; + this.getSession = function() { + return session; + }; + this.setSession = async function(value) { + session = value; + if (session !== null) { + initialRenderTarget = renderer3.getRenderTarget(); + session.addEventListener("select", onSessionEvent); + session.addEventListener("selectstart", onSessionEvent); + session.addEventListener("selectend", onSessionEvent); + session.addEventListener("squeeze", onSessionEvent); + session.addEventListener("squeezestart", onSessionEvent); + session.addEventListener("squeezeend", onSessionEvent); + session.addEventListener("end", onSessionEnd); + session.addEventListener("inputsourceschange", onInputSourcesChange); + if (attributes.xrCompatible !== true) { + await gl.makeXRCompatible(); + } + if (session.renderState.layers === void 0 || renderer3.capabilities.isWebGL2 === false) { + const layerInit = { + antialias: session.renderState.layers === void 0 ? attributes.antialias : true, + alpha: attributes.alpha, + depth: attributes.depth, + stencil: attributes.stencil, + framebufferScaleFactor + }; + glBaseLayer = new XRWebGLLayer(session, gl, layerInit); + session.updateRenderState({ baseLayer: glBaseLayer }); + newRenderTarget = new WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, { + format: RGBAFormat, + type: UnsignedByteType, + encoding: renderer3.outputEncoding + }); + } else { + let depthFormat = null; + let depthType = null; + let glDepthFormat = null; + if (attributes.depth) { + glDepthFormat = attributes.stencil ? 35056 : 33190; + depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat; + depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType; + } + const projectionlayerInit = { + colorFormat: 32856, + depthFormat: glDepthFormat, + scaleFactor: framebufferScaleFactor + }; + glBinding = new XRWebGLBinding(session, gl); + glProjLayer = glBinding.createProjectionLayer(projectionlayerInit); + session.updateRenderState({ layers: [glProjLayer] }); + newRenderTarget = new WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, { + format: RGBAFormat, + type: UnsignedByteType, + depthTexture: new DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, void 0, void 0, void 0, void 0, void 0, void 0, depthFormat), + stencilBuffer: attributes.stencil, + encoding: renderer3.outputEncoding, + samples: attributes.antialias ? 4 : 0 + }); + const renderTargetProperties = renderer3.properties.get(newRenderTarget); + renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues; + } + newRenderTarget.isXRRenderTarget = true; + this.setFoveation(1); + customReferenceSpace = null; + referenceSpace = await session.requestReferenceSpace(referenceSpaceType); + animation.setContext(session); + animation.start(); + scope.isPresenting = true; + scope.dispatchEvent({ type: "sessionstart" }); + } + }; + function onInputSourcesChange(event) { + for (let i = 0; i < event.removed.length; i++) { + const inputSource = event.removed[i]; + const index5 = controllerInputSources.indexOf(inputSource); + if (index5 >= 0) { + controllerInputSources[index5] = null; + controllers[index5].dispatchEvent({ type: "disconnected", data: inputSource }); + } + } + for (let i = 0; i < event.added.length; i++) { + const inputSource = event.added[i]; + let controllerIndex = controllerInputSources.indexOf(inputSource); + if (controllerIndex === -1) { + for (let i2 = 0; i2 < controllers.length; i2++) { + if (i2 >= controllerInputSources.length) { + controllerInputSources.push(inputSource); + controllerIndex = i2; + break; + } else if (controllerInputSources[i2] === null) { + controllerInputSources[i2] = inputSource; + controllerIndex = i2; + break; + } + } + if (controllerIndex === -1) + break; + } + const controller = controllers[controllerIndex]; + if (controller) { + controller.dispatchEvent({ type: "connected", data: inputSource }); + } + } + } + const cameraLPos = new Vector3(); + const cameraRPos = new Vector3(); + function setProjectionFromUnion(camera3, cameraL2, cameraR2) { + cameraLPos.setFromMatrixPosition(cameraL2.matrixWorld); + cameraRPos.setFromMatrixPosition(cameraR2.matrixWorld); + const ipd = cameraLPos.distanceTo(cameraRPos); + const projL = cameraL2.projectionMatrix.elements; + const projR = cameraR2.projectionMatrix.elements; + const near = projL[14] / (projL[10] - 1); + const far = projL[14] / (projL[10] + 1); + const topFov = (projL[9] + 1) / projL[5]; + const bottomFov = (projL[9] - 1) / projL[5]; + const leftFov = (projL[8] - 1) / projL[0]; + const rightFov = (projR[8] + 1) / projR[0]; + const left = near * leftFov; + const right = near * rightFov; + const zOffset = ipd / (-leftFov + rightFov); + const xOffset = zOffset * -leftFov; + cameraL2.matrixWorld.decompose(camera3.position, camera3.quaternion, camera3.scale); + camera3.translateX(xOffset); + camera3.translateZ(zOffset); + camera3.matrixWorld.compose(camera3.position, camera3.quaternion, camera3.scale); + camera3.matrixWorldInverse.copy(camera3.matrixWorld).invert(); + const near2 = near + zOffset; + const far2 = far + zOffset; + const left2 = left - xOffset; + const right2 = right + (ipd - xOffset); + const top2 = topFov * far / far2 * near2; + const bottom2 = bottomFov * far / far2 * near2; + camera3.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2); + } + function updateCamera(camera3, parent) { + if (parent === null) { + camera3.matrixWorld.copy(camera3.matrix); + } else { + camera3.matrixWorld.multiplyMatrices(parent.matrixWorld, camera3.matrix); + } + camera3.matrixWorldInverse.copy(camera3.matrixWorld).invert(); + } + this.updateCamera = function(camera3) { + if (session === null) + return; + cameraVR.near = cameraR.near = cameraL.near = camera3.near; + cameraVR.far = cameraR.far = cameraL.far = camera3.far; + if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) { + session.updateRenderState({ + depthNear: cameraVR.near, + depthFar: cameraVR.far + }); + _currentDepthNear = cameraVR.near; + _currentDepthFar = cameraVR.far; + } + const parent = camera3.parent; + const cameras2 = cameraVR.cameras; + updateCamera(cameraVR, parent); + for (let i = 0; i < cameras2.length; i++) { + updateCamera(cameras2[i], parent); + } + cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); + camera3.position.copy(cameraVR.position); + camera3.quaternion.copy(cameraVR.quaternion); + camera3.scale.copy(cameraVR.scale); + camera3.matrix.copy(cameraVR.matrix); + camera3.matrixWorld.copy(cameraVR.matrixWorld); + const children = camera3.children; + for (let i = 0, l = children.length; i < l; i++) { + children[i].updateMatrixWorld(true); + } + if (cameras2.length === 2) { + setProjectionFromUnion(cameraVR, cameraL, cameraR); + } else { + cameraVR.projectionMatrix.copy(cameraL.projectionMatrix); + } + }; + this.getCamera = function() { + return cameraVR; + }; + this.getFoveation = function() { + if (glProjLayer !== null) { + return glProjLayer.fixedFoveation; + } + if (glBaseLayer !== null) { + return glBaseLayer.fixedFoveation; + } + return void 0; + }; + this.setFoveation = function(foveation) { + if (glProjLayer !== null) { + glProjLayer.fixedFoveation = foveation; + } + if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== void 0) { + glBaseLayer.fixedFoveation = foveation; + } + }; + let onAnimationFrameCallback = null; + function onAnimationFrame(time, frame2) { + pose = frame2.getViewerPose(customReferenceSpace || referenceSpace); + xrFrame = frame2; + if (pose !== null) { + const views = pose.views; + if (glBaseLayer !== null) { + renderer3.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer); + renderer3.setRenderTarget(newRenderTarget); + } + let cameraVRNeedsUpdate = false; + if (views.length !== cameraVR.cameras.length) { + cameraVR.cameras.length = 0; + cameraVRNeedsUpdate = true; + } + for (let i = 0; i < views.length; i++) { + const view = views[i]; + let viewport = null; + if (glBaseLayer !== null) { + viewport = glBaseLayer.getViewport(view); + } else { + const glSubImage = glBinding.getViewSubImage(glProjLayer, view); + viewport = glSubImage.viewport; + if (i === 0) { + renderer3.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? void 0 : glSubImage.depthStencilTexture); + renderer3.setRenderTarget(newRenderTarget); + } + } + let camera3 = cameras[i]; + if (camera3 === void 0) { + camera3 = new PerspectiveCamera(); + camera3.layers.enable(i); + camera3.viewport = new Vector4(); + cameras[i] = camera3; + } + camera3.matrix.fromArray(view.transform.matrix); + camera3.projectionMatrix.fromArray(view.projectionMatrix); + camera3.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height); + if (i === 0) { + cameraVR.matrix.copy(camera3.matrix); + } + if (cameraVRNeedsUpdate === true) { + cameraVR.cameras.push(camera3); + } + } + } + for (let i = 0; i < controllers.length; i++) { + const inputSource = controllerInputSources[i]; + const controller = controllers[i]; + if (inputSource !== null && controller !== void 0) { + controller.update(inputSource, frame2, customReferenceSpace || referenceSpace); + } + } + if (onAnimationFrameCallback) + onAnimationFrameCallback(time, frame2); + xrFrame = null; + } + const animation = new WebGLAnimation(); + animation.setAnimationLoop(onAnimationFrame); + this.setAnimationLoop = function(callback) { + onAnimationFrameCallback = callback; + }; + this.dispose = function() { + }; + } +}; +function WebGLMaterials(renderer3, properties) { + function refreshFogUniforms(uniforms, fog) { + uniforms.fogColor.value.copy(fog.color); + if (fog.isFog) { + uniforms.fogNear.value = fog.near; + uniforms.fogFar.value = fog.far; + } else if (fog.isFogExp2) { + uniforms.fogDensity.value = fog.density; + } + } + function refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) { + if (material.isMeshBasicMaterial) { + refreshUniformsCommon(uniforms, material); + } else if (material.isMeshLambertMaterial) { + refreshUniformsCommon(uniforms, material); + } else if (material.isMeshToonMaterial) { + refreshUniformsCommon(uniforms, material); + refreshUniformsToon(uniforms, material); + } else if (material.isMeshPhongMaterial) { + refreshUniformsCommon(uniforms, material); + refreshUniformsPhong(uniforms, material); + } else if (material.isMeshStandardMaterial) { + refreshUniformsCommon(uniforms, material); + refreshUniformsStandard(uniforms, material); + if (material.isMeshPhysicalMaterial) { + refreshUniformsPhysical(uniforms, material, transmissionRenderTarget); + } + } else if (material.isMeshMatcapMaterial) { + refreshUniformsCommon(uniforms, material); + refreshUniformsMatcap(uniforms, material); + } else if (material.isMeshDepthMaterial) { + refreshUniformsCommon(uniforms, material); + } else if (material.isMeshDistanceMaterial) { + refreshUniformsCommon(uniforms, material); + refreshUniformsDistance(uniforms, material); + } else if (material.isMeshNormalMaterial) { + refreshUniformsCommon(uniforms, material); + } else if (material.isLineBasicMaterial) { + refreshUniformsLine(uniforms, material); + if (material.isLineDashedMaterial) { + refreshUniformsDash(uniforms, material); + } + } else if (material.isPointsMaterial) { + refreshUniformsPoints(uniforms, material, pixelRatio, height); + } else if (material.isSpriteMaterial) { + refreshUniformsSprites(uniforms, material); + } else if (material.isShadowMaterial) { + uniforms.color.value.copy(material.color); + uniforms.opacity.value = material.opacity; + } else if (material.isShaderMaterial) { + material.uniformsNeedUpdate = false; + } + } + function refreshUniformsCommon(uniforms, material) { + uniforms.opacity.value = material.opacity; + if (material.color) { + uniforms.diffuse.value.copy(material.color); + } + if (material.emissive) { + uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity); + } + if (material.map) { + uniforms.map.value = material.map; + } + if (material.alphaMap) { + uniforms.alphaMap.value = material.alphaMap; + } + if (material.bumpMap) { + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + if (material.side === BackSide) + uniforms.bumpScale.value *= -1; + } + if (material.displacementMap) { + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + } + if (material.emissiveMap) { + uniforms.emissiveMap.value = material.emissiveMap; + } + if (material.normalMap) { + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy(material.normalScale); + if (material.side === BackSide) + uniforms.normalScale.value.negate(); + } + if (material.specularMap) { + uniforms.specularMap.value = material.specularMap; + } + if (material.alphaTest > 0) { + uniforms.alphaTest.value = material.alphaTest; + } + const envMap = properties.get(material).envMap; + if (envMap) { + uniforms.envMap.value = envMap; + uniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1; + uniforms.reflectivity.value = material.reflectivity; + uniforms.ior.value = material.ior; + uniforms.refractionRatio.value = material.refractionRatio; + } + if (material.lightMap) { + uniforms.lightMap.value = material.lightMap; + const scaleFactor = renderer3.physicallyCorrectLights !== true ? Math.PI : 1; + uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor; + } + if (material.aoMap) { + uniforms.aoMap.value = material.aoMap; + uniforms.aoMapIntensity.value = material.aoMapIntensity; + } + let uvScaleMap; + if (material.map) { + uvScaleMap = material.map; + } else if (material.specularMap) { + uvScaleMap = material.specularMap; + } else if (material.displacementMap) { + uvScaleMap = material.displacementMap; + } else if (material.normalMap) { + uvScaleMap = material.normalMap; + } else if (material.bumpMap) { + uvScaleMap = material.bumpMap; + } else if (material.roughnessMap) { + uvScaleMap = material.roughnessMap; + } else if (material.metalnessMap) { + uvScaleMap = material.metalnessMap; + } else if (material.alphaMap) { + uvScaleMap = material.alphaMap; + } else if (material.emissiveMap) { + uvScaleMap = material.emissiveMap; + } else if (material.clearcoatMap) { + uvScaleMap = material.clearcoatMap; + } else if (material.clearcoatNormalMap) { + uvScaleMap = material.clearcoatNormalMap; + } else if (material.clearcoatRoughnessMap) { + uvScaleMap = material.clearcoatRoughnessMap; + } else if (material.iridescenceMap) { + uvScaleMap = material.iridescenceMap; + } else if (material.iridescenceThicknessMap) { + uvScaleMap = material.iridescenceThicknessMap; + } else if (material.specularIntensityMap) { + uvScaleMap = material.specularIntensityMap; + } else if (material.specularColorMap) { + uvScaleMap = material.specularColorMap; + } else if (material.transmissionMap) { + uvScaleMap = material.transmissionMap; + } else if (material.thicknessMap) { + uvScaleMap = material.thicknessMap; + } else if (material.sheenColorMap) { + uvScaleMap = material.sheenColorMap; + } else if (material.sheenRoughnessMap) { + uvScaleMap = material.sheenRoughnessMap; + } + if (uvScaleMap !== void 0) { + if (uvScaleMap.isWebGLRenderTarget) { + uvScaleMap = uvScaleMap.texture; + } + if (uvScaleMap.matrixAutoUpdate === true) { + uvScaleMap.updateMatrix(); + } + uniforms.uvTransform.value.copy(uvScaleMap.matrix); + } + let uv2ScaleMap; + if (material.aoMap) { + uv2ScaleMap = material.aoMap; + } else if (material.lightMap) { + uv2ScaleMap = material.lightMap; + } + if (uv2ScaleMap !== void 0) { + if (uv2ScaleMap.isWebGLRenderTarget) { + uv2ScaleMap = uv2ScaleMap.texture; + } + if (uv2ScaleMap.matrixAutoUpdate === true) { + uv2ScaleMap.updateMatrix(); + } + uniforms.uv2Transform.value.copy(uv2ScaleMap.matrix); + } + } + function refreshUniformsLine(uniforms, material) { + uniforms.diffuse.value.copy(material.color); + uniforms.opacity.value = material.opacity; + } + function refreshUniformsDash(uniforms, material) { + uniforms.dashSize.value = material.dashSize; + uniforms.totalSize.value = material.dashSize + material.gapSize; + uniforms.scale.value = material.scale; + } + function refreshUniformsPoints(uniforms, material, pixelRatio, height) { + uniforms.diffuse.value.copy(material.color); + uniforms.opacity.value = material.opacity; + uniforms.size.value = material.size * pixelRatio; + uniforms.scale.value = height * 0.5; + if (material.map) { + uniforms.map.value = material.map; + } + if (material.alphaMap) { + uniforms.alphaMap.value = material.alphaMap; + } + if (material.alphaTest > 0) { + uniforms.alphaTest.value = material.alphaTest; + } + let uvScaleMap; + if (material.map) { + uvScaleMap = material.map; + } else if (material.alphaMap) { + uvScaleMap = material.alphaMap; + } + if (uvScaleMap !== void 0) { + if (uvScaleMap.matrixAutoUpdate === true) { + uvScaleMap.updateMatrix(); + } + uniforms.uvTransform.value.copy(uvScaleMap.matrix); + } + } + function refreshUniformsSprites(uniforms, material) { + uniforms.diffuse.value.copy(material.color); + uniforms.opacity.value = material.opacity; + uniforms.rotation.value = material.rotation; + if (material.map) { + uniforms.map.value = material.map; + } + if (material.alphaMap) { + uniforms.alphaMap.value = material.alphaMap; + } + if (material.alphaTest > 0) { + uniforms.alphaTest.value = material.alphaTest; + } + let uvScaleMap; + if (material.map) { + uvScaleMap = material.map; + } else if (material.alphaMap) { + uvScaleMap = material.alphaMap; + } + if (uvScaleMap !== void 0) { + if (uvScaleMap.matrixAutoUpdate === true) { + uvScaleMap.updateMatrix(); + } + uniforms.uvTransform.value.copy(uvScaleMap.matrix); + } + } + function refreshUniformsPhong(uniforms, material) { + uniforms.specular.value.copy(material.specular); + uniforms.shininess.value = Math.max(material.shininess, 1e-4); + } + function refreshUniformsToon(uniforms, material) { + if (material.gradientMap) { + uniforms.gradientMap.value = material.gradientMap; + } + } + function refreshUniformsStandard(uniforms, material) { + uniforms.roughness.value = material.roughness; + uniforms.metalness.value = material.metalness; + if (material.roughnessMap) { + uniforms.roughnessMap.value = material.roughnessMap; + } + if (material.metalnessMap) { + uniforms.metalnessMap.value = material.metalnessMap; + } + const envMap = properties.get(material).envMap; + if (envMap) { + uniforms.envMapIntensity.value = material.envMapIntensity; + } + } + function refreshUniformsPhysical(uniforms, material, transmissionRenderTarget) { + uniforms.ior.value = material.ior; + if (material.sheen > 0) { + uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen); + uniforms.sheenRoughness.value = material.sheenRoughness; + if (material.sheenColorMap) { + uniforms.sheenColorMap.value = material.sheenColorMap; + } + if (material.sheenRoughnessMap) { + uniforms.sheenRoughnessMap.value = material.sheenRoughnessMap; + } + } + if (material.clearcoat > 0) { + uniforms.clearcoat.value = material.clearcoat; + uniforms.clearcoatRoughness.value = material.clearcoatRoughness; + if (material.clearcoatMap) { + uniforms.clearcoatMap.value = material.clearcoatMap; + } + if (material.clearcoatRoughnessMap) { + uniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap; + } + if (material.clearcoatNormalMap) { + uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale); + uniforms.clearcoatNormalMap.value = material.clearcoatNormalMap; + if (material.side === BackSide) { + uniforms.clearcoatNormalScale.value.negate(); + } + } + } + if (material.iridescence > 0) { + uniforms.iridescence.value = material.iridescence; + uniforms.iridescenceIOR.value = material.iridescenceIOR; + uniforms.iridescenceThicknessMinimum.value = material.iridescenceThicknessRange[0]; + uniforms.iridescenceThicknessMaximum.value = material.iridescenceThicknessRange[1]; + if (material.iridescenceMap) { + uniforms.iridescenceMap.value = material.iridescenceMap; + } + if (material.iridescenceThicknessMap) { + uniforms.iridescenceThicknessMap.value = material.iridescenceThicknessMap; + } + } + if (material.transmission > 0) { + uniforms.transmission.value = material.transmission; + uniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture; + uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width, transmissionRenderTarget.height); + if (material.transmissionMap) { + uniforms.transmissionMap.value = material.transmissionMap; + } + uniforms.thickness.value = material.thickness; + if (material.thicknessMap) { + uniforms.thicknessMap.value = material.thicknessMap; + } + uniforms.attenuationDistance.value = material.attenuationDistance; + uniforms.attenuationColor.value.copy(material.attenuationColor); + } + uniforms.specularIntensity.value = material.specularIntensity; + uniforms.specularColor.value.copy(material.specularColor); + if (material.specularIntensityMap) { + uniforms.specularIntensityMap.value = material.specularIntensityMap; + } + if (material.specularColorMap) { + uniforms.specularColorMap.value = material.specularColorMap; + } + } + function refreshUniformsMatcap(uniforms, material) { + if (material.matcap) { + uniforms.matcap.value = material.matcap; + } + } + function refreshUniformsDistance(uniforms, material) { + uniforms.referencePosition.value.copy(material.referencePosition); + uniforms.nearDistance.value = material.nearDistance; + uniforms.farDistance.value = material.farDistance; + } + return { + refreshFogUniforms, + refreshMaterialUniforms + }; +} +function WebGLUniformsGroups(gl, info, capabilities, state) { + let buffers = {}; + let updateList = {}; + let allocatedBindingPoints = []; + const maxBindingPoints = capabilities.isWebGL2 ? gl.getParameter(35375) : 0; + function bind(uniformsGroup, program) { + const webglProgram = program.program; + state.uniformBlockBinding(uniformsGroup, webglProgram); + } + function update4(uniformsGroup, program) { + let buffer = buffers[uniformsGroup.id]; + if (buffer === void 0) { + prepareUniformsGroup(uniformsGroup); + buffer = createBuffer(uniformsGroup); + buffers[uniformsGroup.id] = buffer; + uniformsGroup.addEventListener("dispose", onUniformsGroupsDispose); + } + const webglProgram = program.program; + state.updateUBOMapping(uniformsGroup, webglProgram); + const frame2 = info.render.frame; + if (updateList[uniformsGroup.id] !== frame2) { + updateBufferData(uniformsGroup); + updateList[uniformsGroup.id] = frame2; + } + } + function createBuffer(uniformsGroup) { + const bindingPointIndex = allocateBindingPointIndex(); + uniformsGroup.__bindingPointIndex = bindingPointIndex; + const buffer = gl.createBuffer(); + const size = uniformsGroup.__size; + const usage = uniformsGroup.usage; + gl.bindBuffer(35345, buffer); + gl.bufferData(35345, size, usage); + gl.bindBuffer(35345, null); + gl.bindBufferBase(35345, bindingPointIndex, buffer); + return buffer; + } + function allocateBindingPointIndex() { + for (let i = 0; i < maxBindingPoints; i++) { + if (allocatedBindingPoints.indexOf(i) === -1) { + allocatedBindingPoints.push(i); + return i; + } + } + console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."); + return 0; + } + function updateBufferData(uniformsGroup) { + const buffer = buffers[uniformsGroup.id]; + const uniforms = uniformsGroup.uniforms; + const cache = uniformsGroup.__cache; + gl.bindBuffer(35345, buffer); + for (let i = 0, il = uniforms.length; i < il; i++) { + const uniform = uniforms[i]; + if (hasUniformChanged(uniform, i, cache) === true) { + const value = uniform.value; + const offset = uniform.__offset; + if (typeof value === "number") { + uniform.__data[0] = value; + gl.bufferSubData(35345, offset, uniform.__data); + } else { + if (uniform.value.isMatrix3) { + uniform.__data[0] = uniform.value.elements[0]; + uniform.__data[1] = uniform.value.elements[1]; + uniform.__data[2] = uniform.value.elements[2]; + uniform.__data[3] = uniform.value.elements[0]; + uniform.__data[4] = uniform.value.elements[3]; + uniform.__data[5] = uniform.value.elements[4]; + uniform.__data[6] = uniform.value.elements[5]; + uniform.__data[7] = uniform.value.elements[0]; + uniform.__data[8] = uniform.value.elements[6]; + uniform.__data[9] = uniform.value.elements[7]; + uniform.__data[10] = uniform.value.elements[8]; + uniform.__data[11] = uniform.value.elements[0]; + } else { + value.toArray(uniform.__data); + } + gl.bufferSubData(35345, offset, uniform.__data); + } + } + } + gl.bindBuffer(35345, null); + } + function hasUniformChanged(uniform, index5, cache) { + const value = uniform.value; + if (cache[index5] === void 0) { + if (typeof value === "number") { + cache[index5] = value; + } else { + cache[index5] = value.clone(); + } + return true; + } else { + if (typeof value === "number") { + if (cache[index5] !== value) { + cache[index5] = value; + return true; + } + } else { + const cachedObject = cache[index5]; + if (cachedObject.equals(value) === false) { + cachedObject.copy(value); + return true; + } + } + } + return false; + } + function prepareUniformsGroup(uniformsGroup) { + const uniforms = uniformsGroup.uniforms; + let offset = 0; + const chunkSize = 16; + let chunkOffset = 0; + for (let i = 0, l = uniforms.length; i < l; i++) { + const uniform = uniforms[i]; + const info2 = getUniformSize(uniform); + uniform.__data = new Float32Array(info2.storage / Float32Array.BYTES_PER_ELEMENT); + uniform.__offset = offset; + if (i > 0) { + chunkOffset = offset % chunkSize; + const remainingSizeInChunk = chunkSize - chunkOffset; + if (chunkOffset !== 0 && remainingSizeInChunk - info2.boundary < 0) { + offset += chunkSize - chunkOffset; + uniform.__offset = offset; + } + } + offset += info2.storage; + } + chunkOffset = offset % chunkSize; + if (chunkOffset > 0) + offset += chunkSize - chunkOffset; + uniformsGroup.__size = offset; + uniformsGroup.__cache = {}; + return this; + } + function getUniformSize(uniform) { + const value = uniform.value; + const info2 = { + boundary: 0, + storage: 0 + }; + if (typeof value === "number") { + info2.boundary = 4; + info2.storage = 4; + } else if (value.isVector2) { + info2.boundary = 8; + info2.storage = 8; + } else if (value.isVector3 || value.isColor) { + info2.boundary = 16; + info2.storage = 12; + } else if (value.isVector4) { + info2.boundary = 16; + info2.storage = 16; + } else if (value.isMatrix3) { + info2.boundary = 48; + info2.storage = 48; + } else if (value.isMatrix4) { + info2.boundary = 64; + info2.storage = 64; + } else if (value.isTexture) { + console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."); + } else { + console.warn("THREE.WebGLRenderer: Unsupported uniform value type.", value); + } + return info2; + } + function onUniformsGroupsDispose(event) { + const uniformsGroup = event.target; + uniformsGroup.removeEventListener("dispose", onUniformsGroupsDispose); + const index5 = allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex); + allocatedBindingPoints.splice(index5, 1); + gl.deleteBuffer(buffers[uniformsGroup.id]); + delete buffers[uniformsGroup.id]; + delete updateList[uniformsGroup.id]; + } + function dispose() { + for (const id in buffers) { + gl.deleteBuffer(buffers[id]); + } + allocatedBindingPoints = []; + buffers = {}; + updateList = {}; + } + return { + bind, + update: update4, + dispose + }; +} +function createCanvasElement() { + const canvas = createElementNS("canvas"); + canvas.style.display = "block"; + return canvas; +} +function WebGLRenderer(parameters = {}) { + this.isWebGLRenderer = true; + const _canvas2 = parameters.canvas !== void 0 ? parameters.canvas : createCanvasElement(), _context = parameters.context !== void 0 ? parameters.context : null, _depth = parameters.depth !== void 0 ? parameters.depth : true, _stencil = parameters.stencil !== void 0 ? parameters.stencil : true, _antialias = parameters.antialias !== void 0 ? parameters.antialias : false, _premultipliedAlpha = parameters.premultipliedAlpha !== void 0 ? parameters.premultipliedAlpha : true, _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== void 0 ? parameters.preserveDrawingBuffer : false, _powerPreference = parameters.powerPreference !== void 0 ? parameters.powerPreference : "default", _failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== void 0 ? parameters.failIfMajorPerformanceCaveat : false; + let _alpha; + if (_context !== null) { + _alpha = _context.getContextAttributes().alpha; + } else { + _alpha = parameters.alpha !== void 0 ? parameters.alpha : false; + } + let currentRenderList = null; + let currentRenderState = null; + const renderListStack = []; + const renderStateStack = []; + this.domElement = _canvas2; + this.debug = { + checkShaderErrors: true + }; + this.autoClear = true; + this.autoClearColor = true; + this.autoClearDepth = true; + this.autoClearStencil = true; + this.sortObjects = true; + this.clippingPlanes = []; + this.localClippingEnabled = false; + this.outputEncoding = LinearEncoding; + this.physicallyCorrectLights = false; + this.toneMapping = NoToneMapping; + this.toneMappingExposure = 1; + Object.defineProperties(this, { + gammaFactor: { + get: function() { + console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."); + return 2; + }, + set: function() { + console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."); + } + } + }); + const _this = this; + let _isContextLost = false; + let _currentActiveCubeFace = 0; + let _currentActiveMipmapLevel = 0; + let _currentRenderTarget = null; + let _currentMaterialId = -1; + let _currentCamera = null; + const _currentViewport = new Vector4(); + const _currentScissor = new Vector4(); + let _currentScissorTest = null; + let _width = _canvas2.width; + let _height = _canvas2.height; + let _pixelRatio = 1; + let _opaqueSort = null; + let _transparentSort = null; + const _viewport = new Vector4(0, 0, _width, _height); + const _scissor = new Vector4(0, 0, _width, _height); + let _scissorTest = false; + const _frustum = new Frustum(); + let _clippingEnabled = false; + let _localClippingEnabled = false; + let _transmissionRenderTarget = null; + const _projScreenMatrix = new Matrix4(); + const _vector22 = new Vector2(); + const _vector3 = new Vector3(); + const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true }; + function getTargetPixelRatio() { + return _currentRenderTarget === null ? _pixelRatio : 1; + } + let _gl = _context; + function getContext(contextNames, contextAttributes) { + for (let i = 0; i < contextNames.length; i++) { + const contextName = contextNames[i]; + const context = _canvas2.getContext(contextName, contextAttributes); + if (context !== null) + return context; + } + return null; + } + try { + const contextAttributes = { + alpha: true, + depth: _depth, + stencil: _stencil, + antialias: _antialias, + premultipliedAlpha: _premultipliedAlpha, + preserveDrawingBuffer: _preserveDrawingBuffer, + powerPreference: _powerPreference, + failIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat + }; + if ("setAttribute" in _canvas2) + _canvas2.setAttribute("data-engine", `three.js r${REVISION}`); + _canvas2.addEventListener("webglcontextlost", onContextLost, false); + _canvas2.addEventListener("webglcontextrestored", onContextRestore, false); + _canvas2.addEventListener("webglcontextcreationerror", onContextCreationError, false); + if (_gl === null) { + const contextNames = ["webgl2", "webgl", "experimental-webgl"]; + if (_this.isWebGL1Renderer === true) { + contextNames.shift(); + } + _gl = getContext(contextNames, contextAttributes); + if (_gl === null) { + if (getContext(contextNames)) { + throw new Error("Error creating WebGL context with your selected attributes."); + } else { + throw new Error("Error creating WebGL context."); + } + } + } + if (_gl.getShaderPrecisionFormat === void 0) { + _gl.getShaderPrecisionFormat = function() { + return { "rangeMin": 1, "rangeMax": 1, "precision": 1 }; + }; + } + } catch (error) { + console.error("THREE.WebGLRenderer: " + error.message); + throw error; + } + let extensions, capabilities, state, info; + let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects; + let programCache, materials, renderLists, renderStates, clipping, shadowMap; + let background, morphtargets, bufferRenderer, indexedBufferRenderer; + let utils, bindingStates, uniformsGroups; + function initGLContext() { + extensions = new WebGLExtensions(_gl); + capabilities = new WebGLCapabilities(_gl, extensions, parameters); + extensions.init(capabilities); + utils = new WebGLUtils(_gl, extensions, capabilities); + state = new WebGLState(_gl, extensions, capabilities); + info = new WebGLInfo(); + properties = new WebGLProperties(); + textures = new WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info); + cubemaps = new WebGLCubeMaps(_this); + cubeuvmaps = new WebGLCubeUVMaps(_this); + attributes = new WebGLAttributes(_gl, capabilities); + bindingStates = new WebGLBindingStates(_gl, extensions, attributes, capabilities); + geometries = new WebGLGeometries(_gl, attributes, info, bindingStates); + objects = new WebGLObjects(_gl, geometries, attributes, info); + morphtargets = new WebGLMorphtargets(_gl, capabilities, textures); + clipping = new WebGLClipping(properties); + programCache = new WebGLPrograms(_this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping); + materials = new WebGLMaterials(_this, properties); + renderLists = new WebGLRenderLists(); + renderStates = new WebGLRenderStates(extensions, capabilities); + background = new WebGLBackground(_this, cubemaps, state, objects, _alpha, _premultipliedAlpha); + shadowMap = new WebGLShadowMap(_this, objects, capabilities); + uniformsGroups = new WebGLUniformsGroups(_gl, info, capabilities, state); + bufferRenderer = new WebGLBufferRenderer(_gl, extensions, info, capabilities); + indexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions, info, capabilities); + info.programs = programCache.programs; + _this.capabilities = capabilities; + _this.extensions = extensions; + _this.properties = properties; + _this.renderLists = renderLists; + _this.shadowMap = shadowMap; + _this.state = state; + _this.info = info; + } + initGLContext(); + const xr = new WebXRManager(_this, _gl); + this.xr = xr; + this.getContext = function() { + return _gl; + }; + this.getContextAttributes = function() { + return _gl.getContextAttributes(); + }; + this.forceContextLoss = function() { + const extension = extensions.get("WEBGL_lose_context"); + if (extension) + extension.loseContext(); + }; + this.forceContextRestore = function() { + const extension = extensions.get("WEBGL_lose_context"); + if (extension) + extension.restoreContext(); + }; + this.getPixelRatio = function() { + return _pixelRatio; + }; + this.setPixelRatio = function(value) { + if (value === void 0) + return; + _pixelRatio = value; + this.setSize(_width, _height, false); + }; + this.getSize = function(target) { + return target.set(_width, _height); + }; + this.setSize = function(width, height, updateStyle) { + if (xr.isPresenting) { + console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."); + return; + } + _width = width; + _height = height; + _canvas2.width = Math.floor(width * _pixelRatio); + _canvas2.height = Math.floor(height * _pixelRatio); + if (updateStyle !== false) { + _canvas2.style.width = width + "px"; + _canvas2.style.height = height + "px"; + } + this.setViewport(0, 0, width, height); + }; + this.getDrawingBufferSize = function(target) { + return target.set(_width * _pixelRatio, _height * _pixelRatio).floor(); + }; + this.setDrawingBufferSize = function(width, height, pixelRatio) { + _width = width; + _height = height; + _pixelRatio = pixelRatio; + _canvas2.width = Math.floor(width * pixelRatio); + _canvas2.height = Math.floor(height * pixelRatio); + this.setViewport(0, 0, width, height); + }; + this.getCurrentViewport = function(target) { + return target.copy(_currentViewport); + }; + this.getViewport = function(target) { + return target.copy(_viewport); + }; + this.setViewport = function(x2, y2, width, height) { + if (x2.isVector4) { + _viewport.set(x2.x, x2.y, x2.z, x2.w); + } else { + _viewport.set(x2, y2, width, height); + } + state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor()); + }; + this.getScissor = function(target) { + return target.copy(_scissor); + }; + this.setScissor = function(x2, y2, width, height) { + if (x2.isVector4) { + _scissor.set(x2.x, x2.y, x2.z, x2.w); + } else { + _scissor.set(x2, y2, width, height); + } + state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor()); + }; + this.getScissorTest = function() { + return _scissorTest; + }; + this.setScissorTest = function(boolean) { + state.setScissorTest(_scissorTest = boolean); + }; + this.setOpaqueSort = function(method) { + _opaqueSort = method; + }; + this.setTransparentSort = function(method) { + _transparentSort = method; + }; + this.getClearColor = function(target) { + return target.copy(background.getClearColor()); + }; + this.setClearColor = function() { + background.setClearColor.apply(background, arguments); + }; + this.getClearAlpha = function() { + return background.getClearAlpha(); + }; + this.setClearAlpha = function() { + background.setClearAlpha.apply(background, arguments); + }; + this.clear = function(color = true, depth = true, stencil = true) { + let bits = 0; + if (color) + bits |= 16384; + if (depth) + bits |= 256; + if (stencil) + bits |= 1024; + _gl.clear(bits); + }; + this.clearColor = function() { + this.clear(true, false, false); + }; + this.clearDepth = function() { + this.clear(false, true, false); + }; + this.clearStencil = function() { + this.clear(false, false, true); + }; + this.dispose = function() { + _canvas2.removeEventListener("webglcontextlost", onContextLost, false); + _canvas2.removeEventListener("webglcontextrestored", onContextRestore, false); + _canvas2.removeEventListener("webglcontextcreationerror", onContextCreationError, false); + renderLists.dispose(); + renderStates.dispose(); + properties.dispose(); + cubemaps.dispose(); + cubeuvmaps.dispose(); + objects.dispose(); + bindingStates.dispose(); + uniformsGroups.dispose(); + programCache.dispose(); + xr.dispose(); + xr.removeEventListener("sessionstart", onXRSessionStart); + xr.removeEventListener("sessionend", onXRSessionEnd); + if (_transmissionRenderTarget) { + _transmissionRenderTarget.dispose(); + _transmissionRenderTarget = null; + } + animation.stop(); + }; + function onContextLost(event) { + event.preventDefault(); + console.log("THREE.WebGLRenderer: Context Lost."); + _isContextLost = true; + } + function onContextRestore() { + console.log("THREE.WebGLRenderer: Context Restored."); + _isContextLost = false; + const infoAutoReset = info.autoReset; + const shadowMapEnabled = shadowMap.enabled; + const shadowMapAutoUpdate = shadowMap.autoUpdate; + const shadowMapNeedsUpdate = shadowMap.needsUpdate; + const shadowMapType = shadowMap.type; + initGLContext(); + info.autoReset = infoAutoReset; + shadowMap.enabled = shadowMapEnabled; + shadowMap.autoUpdate = shadowMapAutoUpdate; + shadowMap.needsUpdate = shadowMapNeedsUpdate; + shadowMap.type = shadowMapType; + } + function onContextCreationError(event) { + console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ", event.statusMessage); + } + function onMaterialDispose(event) { + const material = event.target; + material.removeEventListener("dispose", onMaterialDispose); + deallocateMaterial(material); + } + function deallocateMaterial(material) { + releaseMaterialProgramReferences(material); + properties.remove(material); + } + function releaseMaterialProgramReferences(material) { + const programs = properties.get(material).programs; + if (programs !== void 0) { + programs.forEach(function(program) { + programCache.releaseProgram(program); + }); + if (material.isShaderMaterial) { + programCache.releaseShaderCache(material); + } + } + } + this.renderBufferDirect = function(camera3, scene3, geometry, material, object, group) { + if (scene3 === null) + scene3 = _emptyScene; + const frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0; + const program = setProgram(camera3, scene3, geometry, material, object); + state.setMaterial(material, frontFaceCW); + let index5 = geometry.index; + const position = geometry.attributes.position; + if (index5 === null) { + if (position === void 0 || position.count === 0) + return; + } else if (index5.count === 0) { + return; + } + let rangeFactor = 1; + if (material.wireframe === true) { + index5 = geometries.getWireframeAttribute(geometry); + rangeFactor = 2; + } + bindingStates.setup(object, material, program, geometry, index5); + let attribute; + let renderer3 = bufferRenderer; + if (index5 !== null) { + attribute = attributes.get(index5); + renderer3 = indexedBufferRenderer; + renderer3.setIndex(attribute); + } + const dataCount = index5 !== null ? index5.count : position.count; + const rangeStart = geometry.drawRange.start * rangeFactor; + const rangeCount = geometry.drawRange.count * rangeFactor; + const groupStart = group !== null ? group.start * rangeFactor : 0; + const groupCount = group !== null ? group.count * rangeFactor : Infinity; + const drawStart = Math.max(rangeStart, groupStart); + const drawEnd = Math.min(dataCount, rangeStart + rangeCount, groupStart + groupCount) - 1; + const drawCount = Math.max(0, drawEnd - drawStart + 1); + if (drawCount === 0) + return; + if (object.isMesh) { + if (material.wireframe === true) { + state.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio()); + renderer3.setMode(1); + } else { + renderer3.setMode(4); + } + } else if (object.isLine) { + let lineWidth = material.linewidth; + if (lineWidth === void 0) + lineWidth = 1; + state.setLineWidth(lineWidth * getTargetPixelRatio()); + if (object.isLineSegments) { + renderer3.setMode(1); + } else if (object.isLineLoop) { + renderer3.setMode(2); + } else { + renderer3.setMode(3); + } + } else if (object.isPoints) { + renderer3.setMode(0); + } else if (object.isSprite) { + renderer3.setMode(4); + } + if (object.isInstancedMesh) { + renderer3.renderInstances(drawStart, drawCount, object.count); + } else if (geometry.isInstancedBufferGeometry) { + const instanceCount = Math.min(geometry.instanceCount, geometry._maxInstanceCount); + renderer3.renderInstances(drawStart, drawCount, instanceCount); + } else { + renderer3.render(drawStart, drawCount); + } + }; + this.compile = function(scene3, camera3) { + currentRenderState = renderStates.get(scene3); + currentRenderState.init(); + renderStateStack.push(currentRenderState); + scene3.traverseVisible(function(object) { + if (object.isLight && object.layers.test(camera3.layers)) { + currentRenderState.pushLight(object); + if (object.castShadow) { + currentRenderState.pushShadow(object); + } + } + }); + currentRenderState.setupLights(_this.physicallyCorrectLights); + scene3.traverse(function(object) { + const material = object.material; + if (material) { + if (Array.isArray(material)) { + for (let i = 0; i < material.length; i++) { + const material2 = material[i]; + getProgram(material2, scene3, object); + } + } else { + getProgram(material, scene3, object); + } + } + }); + renderStateStack.pop(); + currentRenderState = null; + }; + let onAnimationFrameCallback = null; + function onAnimationFrame(time) { + if (onAnimationFrameCallback) + onAnimationFrameCallback(time); + } + function onXRSessionStart() { + animation.stop(); + } + function onXRSessionEnd() { + animation.start(); + } + const animation = new WebGLAnimation(); + animation.setAnimationLoop(onAnimationFrame); + if (typeof self !== "undefined") + animation.setContext(self); + this.setAnimationLoop = function(callback) { + onAnimationFrameCallback = callback; + xr.setAnimationLoop(callback); + callback === null ? animation.stop() : animation.start(); + }; + xr.addEventListener("sessionstart", onXRSessionStart); + xr.addEventListener("sessionend", onXRSessionEnd); + this.render = function(scene3, camera3) { + if (camera3 !== void 0 && camera3.isCamera !== true) { + console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); + return; + } + if (_isContextLost === true) + return; + if (scene3.autoUpdate === true) + scene3.updateMatrixWorld(); + if (camera3.parent === null) + camera3.updateMatrixWorld(); + if (xr.enabled === true && xr.isPresenting === true) { + if (xr.cameraAutoUpdate === true) + xr.updateCamera(camera3); + camera3 = xr.getCamera(); + } + if (scene3.isScene === true) + scene3.onBeforeRender(_this, scene3, camera3, _currentRenderTarget); + currentRenderState = renderStates.get(scene3, renderStateStack.length); + currentRenderState.init(); + renderStateStack.push(currentRenderState); + _projScreenMatrix.multiplyMatrices(camera3.projectionMatrix, camera3.matrixWorldInverse); + _frustum.setFromProjectionMatrix(_projScreenMatrix); + _localClippingEnabled = this.localClippingEnabled; + _clippingEnabled = clipping.init(this.clippingPlanes, _localClippingEnabled, camera3); + currentRenderList = renderLists.get(scene3, renderListStack.length); + currentRenderList.init(); + renderListStack.push(currentRenderList); + projectObject(scene3, camera3, 0, _this.sortObjects); + currentRenderList.finish(); + if (_this.sortObjects === true) { + currentRenderList.sort(_opaqueSort, _transparentSort); + } + if (_clippingEnabled === true) + clipping.beginShadows(); + const shadowsArray = currentRenderState.state.shadowsArray; + shadowMap.render(shadowsArray, scene3, camera3); + if (_clippingEnabled === true) + clipping.endShadows(); + if (this.info.autoReset === true) + this.info.reset(); + background.render(currentRenderList, scene3); + currentRenderState.setupLights(_this.physicallyCorrectLights); + if (camera3.isArrayCamera) { + const cameras = camera3.cameras; + for (let i = 0, l = cameras.length; i < l; i++) { + const camera22 = cameras[i]; + renderScene(currentRenderList, scene3, camera22, camera22.viewport); + } + } else { + renderScene(currentRenderList, scene3, camera3); + } + if (_currentRenderTarget !== null) { + textures.updateMultisampleRenderTarget(_currentRenderTarget); + textures.updateRenderTargetMipmap(_currentRenderTarget); + } + if (scene3.isScene === true) + scene3.onAfterRender(_this, scene3, camera3); + bindingStates.resetDefaultState(); + _currentMaterialId = -1; + _currentCamera = null; + renderStateStack.pop(); + if (renderStateStack.length > 0) { + currentRenderState = renderStateStack[renderStateStack.length - 1]; + } else { + currentRenderState = null; + } + renderListStack.pop(); + if (renderListStack.length > 0) { + currentRenderList = renderListStack[renderListStack.length - 1]; + } else { + currentRenderList = null; + } + }; + function projectObject(object, camera3, groupOrder, sortObjects) { + if (object.visible === false) + return; + const visible = object.layers.test(camera3.layers); + if (visible) { + if (object.isGroup) { + groupOrder = object.renderOrder; + } else if (object.isLOD) { + if (object.autoUpdate === true) + object.update(camera3); + } else if (object.isLight) { + currentRenderState.pushLight(object); + if (object.castShadow) { + currentRenderState.pushShadow(object); + } + } else if (object.isSprite) { + if (!object.frustumCulled || _frustum.intersectsSprite(object)) { + if (sortObjects) { + _vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix); + } + const geometry = objects.update(object); + const material = object.material; + if (material.visible) { + currentRenderList.push(object, geometry, material, groupOrder, _vector3.z, null); + } + } + } else if (object.isMesh || object.isLine || object.isPoints) { + if (object.isSkinnedMesh) { + if (object.skeleton.frame !== info.render.frame) { + object.skeleton.update(); + object.skeleton.frame = info.render.frame; + } + } + if (!object.frustumCulled || _frustum.intersectsObject(object)) { + if (sortObjects) { + _vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix); + } + const geometry = objects.update(object); + const material = object.material; + if (Array.isArray(material)) { + const groups = geometry.groups; + for (let i = 0, l = groups.length; i < l; i++) { + const group = groups[i]; + const groupMaterial = material[group.materialIndex]; + if (groupMaterial && groupMaterial.visible) { + currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector3.z, group); + } + } + } else if (material.visible) { + currentRenderList.push(object, geometry, material, groupOrder, _vector3.z, null); + } + } + } + } + const children = object.children; + for (let i = 0, l = children.length; i < l; i++) { + projectObject(children[i], camera3, groupOrder, sortObjects); + } + } + function renderScene(currentRenderList2, scene3, camera3, viewport) { + const opaqueObjects = currentRenderList2.opaque; + const transmissiveObjects = currentRenderList2.transmissive; + const transparentObjects = currentRenderList2.transparent; + currentRenderState.setupLightsView(camera3); + if (transmissiveObjects.length > 0) + renderTransmissionPass(opaqueObjects, scene3, camera3); + if (viewport) + state.viewport(_currentViewport.copy(viewport)); + if (opaqueObjects.length > 0) + renderObjects(opaqueObjects, scene3, camera3); + if (transmissiveObjects.length > 0) + renderObjects(transmissiveObjects, scene3, camera3); + if (transparentObjects.length > 0) + renderObjects(transparentObjects, scene3, camera3); + state.buffers.depth.setTest(true); + state.buffers.depth.setMask(true); + state.buffers.color.setMask(true); + state.setPolygonOffset(false); + } + function renderTransmissionPass(opaqueObjects, scene3, camera3) { + const isWebGL2 = capabilities.isWebGL2; + if (_transmissionRenderTarget === null) { + _transmissionRenderTarget = new WebGLRenderTarget(1, 1, { + generateMipmaps: true, + type: extensions.has("EXT_color_buffer_half_float") ? HalfFloatType : UnsignedByteType, + minFilter: LinearMipmapLinearFilter, + samples: isWebGL2 && _antialias === true ? 4 : 0 + }); + } + _this.getDrawingBufferSize(_vector22); + if (isWebGL2) { + _transmissionRenderTarget.setSize(_vector22.x, _vector22.y); + } else { + _transmissionRenderTarget.setSize(floorPowerOfTwo(_vector22.x), floorPowerOfTwo(_vector22.y)); + } + const currentRenderTarget = _this.getRenderTarget(); + _this.setRenderTarget(_transmissionRenderTarget); + _this.clear(); + const currentToneMapping = _this.toneMapping; + _this.toneMapping = NoToneMapping; + renderObjects(opaqueObjects, scene3, camera3); + _this.toneMapping = currentToneMapping; + textures.updateMultisampleRenderTarget(_transmissionRenderTarget); + textures.updateRenderTargetMipmap(_transmissionRenderTarget); + _this.setRenderTarget(currentRenderTarget); + } + function renderObjects(renderList, scene3, camera3) { + const overrideMaterial = scene3.isScene === true ? scene3.overrideMaterial : null; + for (let i = 0, l = renderList.length; i < l; i++) { + const renderItem = renderList[i]; + const object = renderItem.object; + const geometry = renderItem.geometry; + const material = overrideMaterial === null ? renderItem.material : overrideMaterial; + const group = renderItem.group; + if (object.layers.test(camera3.layers)) { + renderObject(object, scene3, camera3, geometry, material, group); + } + } + } + function renderObject(object, scene3, camera3, geometry, material, group) { + object.onBeforeRender(_this, scene3, camera3, geometry, material, group); + object.modelViewMatrix.multiplyMatrices(camera3.matrixWorldInverse, object.matrixWorld); + object.normalMatrix.getNormalMatrix(object.modelViewMatrix); + material.onBeforeRender(_this, scene3, camera3, geometry, object, group); + if (material.transparent === true && material.side === DoubleSide) { + material.side = BackSide; + material.needsUpdate = true; + _this.renderBufferDirect(camera3, scene3, geometry, material, object, group); + material.side = FrontSide; + material.needsUpdate = true; + _this.renderBufferDirect(camera3, scene3, geometry, material, object, group); + material.side = DoubleSide; + } else { + _this.renderBufferDirect(camera3, scene3, geometry, material, object, group); + } + object.onAfterRender(_this, scene3, camera3, geometry, material, group); + } + function getProgram(material, scene3, object) { + if (scene3.isScene !== true) + scene3 = _emptyScene; + const materialProperties = properties.get(material); + const lights = currentRenderState.state.lights; + const shadowsArray = currentRenderState.state.shadowsArray; + const lightsStateVersion = lights.state.version; + const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene3, object); + const programCacheKey = programCache.getProgramCacheKey(parameters2); + let programs = materialProperties.programs; + materialProperties.environment = material.isMeshStandardMaterial ? scene3.environment : null; + materialProperties.fog = scene3.fog; + materialProperties.envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || materialProperties.environment); + if (programs === void 0) { + material.addEventListener("dispose", onMaterialDispose); + programs = /* @__PURE__ */ new Map(); + materialProperties.programs = programs; + } + let program = programs.get(programCacheKey); + if (program !== void 0) { + if (materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion) { + updateCommonMaterialProperties(material, parameters2); + return program; + } + } else { + parameters2.uniforms = programCache.getUniforms(material); + material.onBuild(object, parameters2, _this); + material.onBeforeCompile(parameters2, _this); + program = programCache.acquireProgram(parameters2, programCacheKey); + programs.set(programCacheKey, program); + materialProperties.uniforms = parameters2.uniforms; + } + const uniforms = materialProperties.uniforms; + if (!material.isShaderMaterial && !material.isRawShaderMaterial || material.clipping === true) { + uniforms.clippingPlanes = clipping.uniform; + } + updateCommonMaterialProperties(material, parameters2); + materialProperties.needsLights = materialNeedsLights(material); + materialProperties.lightsStateVersion = lightsStateVersion; + if (materialProperties.needsLights) { + uniforms.ambientLightColor.value = lights.state.ambient; + uniforms.lightProbe.value = lights.state.probe; + uniforms.directionalLights.value = lights.state.directional; + uniforms.directionalLightShadows.value = lights.state.directionalShadow; + uniforms.spotLights.value = lights.state.spot; + uniforms.spotLightShadows.value = lights.state.spotShadow; + uniforms.rectAreaLights.value = lights.state.rectArea; + uniforms.ltc_1.value = lights.state.rectAreaLTC1; + uniforms.ltc_2.value = lights.state.rectAreaLTC2; + uniforms.pointLights.value = lights.state.point; + uniforms.pointLightShadows.value = lights.state.pointShadow; + uniforms.hemisphereLights.value = lights.state.hemi; + uniforms.directionalShadowMap.value = lights.state.directionalShadowMap; + uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix; + uniforms.spotShadowMap.value = lights.state.spotShadowMap; + uniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix; + uniforms.pointShadowMap.value = lights.state.pointShadowMap; + uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; + } + const progUniforms = program.getUniforms(); + const uniformsList = WebGLUniforms.seqWithValue(progUniforms.seq, uniforms); + materialProperties.currentProgram = program; + materialProperties.uniformsList = uniformsList; + return program; + } + function updateCommonMaterialProperties(material, parameters2) { + const materialProperties = properties.get(material); + materialProperties.outputEncoding = parameters2.outputEncoding; + materialProperties.instancing = parameters2.instancing; + materialProperties.skinning = parameters2.skinning; + materialProperties.morphTargets = parameters2.morphTargets; + materialProperties.morphNormals = parameters2.morphNormals; + materialProperties.morphColors = parameters2.morphColors; + materialProperties.morphTargetsCount = parameters2.morphTargetsCount; + materialProperties.numClippingPlanes = parameters2.numClippingPlanes; + materialProperties.numIntersection = parameters2.numClipIntersection; + materialProperties.vertexAlphas = parameters2.vertexAlphas; + materialProperties.vertexTangents = parameters2.vertexTangents; + materialProperties.toneMapping = parameters2.toneMapping; + } + function setProgram(camera3, scene3, geometry, material, object) { + if (scene3.isScene !== true) + scene3 = _emptyScene; + textures.resetTextureUnits(); + const fog = scene3.fog; + const environment = material.isMeshStandardMaterial ? scene3.environment : null; + const encoding = _currentRenderTarget === null ? _this.outputEncoding : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding; + const envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment); + const vertexAlphas = material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4; + const vertexTangents = !!material.normalMap && !!geometry.attributes.tangent; + const morphTargets = !!geometry.morphAttributes.position; + const morphNormals = !!geometry.morphAttributes.normal; + const morphColors = !!geometry.morphAttributes.color; + const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping; + const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; + const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0; + const materialProperties = properties.get(material); + const lights = currentRenderState.state.lights; + if (_clippingEnabled === true) { + if (_localClippingEnabled === true || camera3 !== _currentCamera) { + const useCache = camera3 === _currentCamera && material.id === _currentMaterialId; + clipping.setState(material, camera3, useCache); + } + } + let needsProgramChange = false; + if (material.version === materialProperties.__version) { + if (materialProperties.needsLights && materialProperties.lightsStateVersion !== lights.state.version) { + needsProgramChange = true; + } else if (materialProperties.outputEncoding !== encoding) { + needsProgramChange = true; + } else if (object.isInstancedMesh && materialProperties.instancing === false) { + needsProgramChange = true; + } else if (!object.isInstancedMesh && materialProperties.instancing === true) { + needsProgramChange = true; + } else if (object.isSkinnedMesh && materialProperties.skinning === false) { + needsProgramChange = true; + } else if (!object.isSkinnedMesh && materialProperties.skinning === true) { + needsProgramChange = true; + } else if (materialProperties.envMap !== envMap) { + needsProgramChange = true; + } else if (material.fog === true && materialProperties.fog !== fog) { + needsProgramChange = true; + } else if (materialProperties.numClippingPlanes !== void 0 && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) { + needsProgramChange = true; + } else if (materialProperties.vertexAlphas !== vertexAlphas) { + needsProgramChange = true; + } else if (materialProperties.vertexTangents !== vertexTangents) { + needsProgramChange = true; + } else if (materialProperties.morphTargets !== morphTargets) { + needsProgramChange = true; + } else if (materialProperties.morphNormals !== morphNormals) { + needsProgramChange = true; + } else if (materialProperties.morphColors !== morphColors) { + needsProgramChange = true; + } else if (materialProperties.toneMapping !== toneMapping) { + needsProgramChange = true; + } else if (capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount) { + needsProgramChange = true; + } + } else { + needsProgramChange = true; + materialProperties.__version = material.version; + } + let program = materialProperties.currentProgram; + if (needsProgramChange === true) { + program = getProgram(material, scene3, object); + } + let refreshProgram = false; + let refreshMaterial = false; + let refreshLights = false; + const p_uniforms = program.getUniforms(), m_uniforms = materialProperties.uniforms; + if (state.useProgram(program.program)) { + refreshProgram = true; + refreshMaterial = true; + refreshLights = true; + } + if (material.id !== _currentMaterialId) { + _currentMaterialId = material.id; + refreshMaterial = true; + } + if (refreshProgram || _currentCamera !== camera3) { + p_uniforms.setValue(_gl, "projectionMatrix", camera3.projectionMatrix); + if (capabilities.logarithmicDepthBuffer) { + p_uniforms.setValue(_gl, "logDepthBufFC", 2 / (Math.log(camera3.far + 1) / Math.LN2)); + } + if (_currentCamera !== camera3) { + _currentCamera = camera3; + refreshMaterial = true; + refreshLights = true; + } + if (material.isShaderMaterial || material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshStandardMaterial || material.envMap) { + const uCamPos = p_uniforms.map.cameraPosition; + if (uCamPos !== void 0) { + uCamPos.setValue(_gl, _vector3.setFromMatrixPosition(camera3.matrixWorld)); + } + } + if (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial) { + p_uniforms.setValue(_gl, "isOrthographic", camera3.isOrthographicCamera === true); + } + if (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial || material.isShadowMaterial || object.isSkinnedMesh) { + p_uniforms.setValue(_gl, "viewMatrix", camera3.matrixWorldInverse); + } + } + if (object.isSkinnedMesh) { + p_uniforms.setOptional(_gl, object, "bindMatrix"); + p_uniforms.setOptional(_gl, object, "bindMatrixInverse"); + const skeleton = object.skeleton; + if (skeleton) { + if (capabilities.floatVertexTextures) { + if (skeleton.boneTexture === null) + skeleton.computeBoneTexture(); + p_uniforms.setValue(_gl, "boneTexture", skeleton.boneTexture, textures); + p_uniforms.setValue(_gl, "boneTextureSize", skeleton.boneTextureSize); + } else { + console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."); + } + } + } + const morphAttributes = geometry.morphAttributes; + if (morphAttributes.position !== void 0 || morphAttributes.normal !== void 0 || morphAttributes.color !== void 0 && capabilities.isWebGL2 === true) { + morphtargets.update(object, geometry, material, program); + } + if (refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow) { + materialProperties.receiveShadow = object.receiveShadow; + p_uniforms.setValue(_gl, "receiveShadow", object.receiveShadow); + } + if (refreshMaterial) { + p_uniforms.setValue(_gl, "toneMappingExposure", _this.toneMappingExposure); + if (materialProperties.needsLights) { + markUniformsLightsNeedsUpdate(m_uniforms, refreshLights); + } + if (fog && material.fog === true) { + materials.refreshFogUniforms(m_uniforms, fog); + } + materials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget); + WebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures); + } + if (material.isShaderMaterial && material.uniformsNeedUpdate === true) { + WebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures); + material.uniformsNeedUpdate = false; + } + if (material.isSpriteMaterial) { + p_uniforms.setValue(_gl, "center", object.center); + } + p_uniforms.setValue(_gl, "modelViewMatrix", object.modelViewMatrix); + p_uniforms.setValue(_gl, "normalMatrix", object.normalMatrix); + p_uniforms.setValue(_gl, "modelMatrix", object.matrixWorld); + if (material.isShaderMaterial || material.isRawShaderMaterial) { + const groups = material.uniformsGroups; + for (let i = 0, l = groups.length; i < l; i++) { + if (capabilities.isWebGL2) { + const group = groups[i]; + uniformsGroups.update(group, program); + uniformsGroups.bind(group, program); + } else { + console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2."); + } + } + } + return program; + } + function markUniformsLightsNeedsUpdate(uniforms, value) { + uniforms.ambientLightColor.needsUpdate = value; + uniforms.lightProbe.needsUpdate = value; + uniforms.directionalLights.needsUpdate = value; + uniforms.directionalLightShadows.needsUpdate = value; + uniforms.pointLights.needsUpdate = value; + uniforms.pointLightShadows.needsUpdate = value; + uniforms.spotLights.needsUpdate = value; + uniforms.spotLightShadows.needsUpdate = value; + uniforms.rectAreaLights.needsUpdate = value; + uniforms.hemisphereLights.needsUpdate = value; + } + function materialNeedsLights(material) { + return material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || material.isMeshStandardMaterial || material.isShadowMaterial || material.isShaderMaterial && material.lights === true; + } + this.getActiveCubeFace = function() { + return _currentActiveCubeFace; + }; + this.getActiveMipmapLevel = function() { + return _currentActiveMipmapLevel; + }; + this.getRenderTarget = function() { + return _currentRenderTarget; + }; + this.setRenderTargetTextures = function(renderTarget, colorTexture, depthTexture) { + properties.get(renderTarget.texture).__webglTexture = colorTexture; + properties.get(renderTarget.depthTexture).__webglTexture = depthTexture; + const renderTargetProperties = properties.get(renderTarget); + renderTargetProperties.__hasExternalTextures = true; + if (renderTargetProperties.__hasExternalTextures) { + renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === void 0; + if (!renderTargetProperties.__autoAllocateDepthBuffer) { + if (extensions.has("WEBGL_multisampled_render_to_texture") === true) { + console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"); + renderTargetProperties.__useRenderToTexture = false; + } + } + } + }; + this.setRenderTargetFramebuffer = function(renderTarget, defaultFramebuffer) { + const renderTargetProperties = properties.get(renderTarget); + renderTargetProperties.__webglFramebuffer = defaultFramebuffer; + renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === void 0; + }; + this.setRenderTarget = function(renderTarget, activeCubeFace = 0, activeMipmapLevel = 0) { + _currentRenderTarget = renderTarget; + _currentActiveCubeFace = activeCubeFace; + _currentActiveMipmapLevel = activeMipmapLevel; + let useDefaultFramebuffer = true; + if (renderTarget) { + const renderTargetProperties = properties.get(renderTarget); + if (renderTargetProperties.__useDefaultFramebuffer !== void 0) { + state.bindFramebuffer(36160, null); + useDefaultFramebuffer = false; + } else if (renderTargetProperties.__webglFramebuffer === void 0) { + textures.setupRenderTarget(renderTarget); + } else if (renderTargetProperties.__hasExternalTextures) { + textures.rebindTextures(renderTarget, properties.get(renderTarget.texture).__webglTexture, properties.get(renderTarget.depthTexture).__webglTexture); + } + } + let framebuffer = null; + let isCube = false; + let isRenderTarget3D = false; + if (renderTarget) { + const texture = renderTarget.texture; + if (texture.isData3DTexture || texture.isDataArrayTexture) { + isRenderTarget3D = true; + } + const __webglFramebuffer = properties.get(renderTarget).__webglFramebuffer; + if (renderTarget.isWebGLCubeRenderTarget) { + framebuffer = __webglFramebuffer[activeCubeFace]; + isCube = true; + } else if (capabilities.isWebGL2 && renderTarget.samples > 0 && textures.useMultisampledRTT(renderTarget) === false) { + framebuffer = properties.get(renderTarget).__webglMultisampledFramebuffer; + } else { + framebuffer = __webglFramebuffer; + } + _currentViewport.copy(renderTarget.viewport); + _currentScissor.copy(renderTarget.scissor); + _currentScissorTest = renderTarget.scissorTest; + } else { + _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(); + _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(); + _currentScissorTest = _scissorTest; + } + const framebufferBound = state.bindFramebuffer(36160, framebuffer); + if (framebufferBound && capabilities.drawBuffers && useDefaultFramebuffer) { + state.drawBuffers(renderTarget, framebuffer); + } + state.viewport(_currentViewport); + state.scissor(_currentScissor); + state.setScissorTest(_currentScissorTest); + if (isCube) { + const textureProperties = properties.get(renderTarget.texture); + _gl.framebufferTexture2D(36160, 36064, 34069 + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel); + } else if (isRenderTarget3D) { + const textureProperties = properties.get(renderTarget.texture); + const layer = activeCubeFace || 0; + _gl.framebufferTextureLayer(36160, 36064, textureProperties.__webglTexture, activeMipmapLevel || 0, layer); + } + _currentMaterialId = -1; + }; + this.readRenderTargetPixels = function(renderTarget, x2, y2, width, height, buffer, activeCubeFaceIndex) { + if (!(renderTarget && renderTarget.isWebGLRenderTarget)) { + console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); + return; + } + let framebuffer = properties.get(renderTarget).__webglFramebuffer; + if (renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== void 0) { + framebuffer = framebuffer[activeCubeFaceIndex]; + } + if (framebuffer) { + state.bindFramebuffer(36160, framebuffer); + try { + const texture = renderTarget.texture; + const textureFormat = texture.format; + const textureType = texture.type; + if (textureFormat !== RGBAFormat && utils.convert(textureFormat) !== _gl.getParameter(35739)) { + console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); + return; + } + const halfFloatSupportedByExt = textureType === HalfFloatType && (extensions.has("EXT_color_buffer_half_float") || capabilities.isWebGL2 && extensions.has("EXT_color_buffer_float")); + if (textureType !== UnsignedByteType && utils.convert(textureType) !== _gl.getParameter(35738) && !(textureType === FloatType && (capabilities.isWebGL2 || extensions.has("OES_texture_float") || extensions.has("WEBGL_color_buffer_float"))) && !halfFloatSupportedByExt) { + console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); + return; + } + if (x2 >= 0 && x2 <= renderTarget.width - width && (y2 >= 0 && y2 <= renderTarget.height - height)) { + _gl.readPixels(x2, y2, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer); + } + } finally { + const framebuffer2 = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null; + state.bindFramebuffer(36160, framebuffer2); + } + } + }; + this.copyFramebufferToTexture = function(position, texture, level = 0) { + const levelScale = Math.pow(2, -level); + const width = Math.floor(texture.image.width * levelScale); + const height = Math.floor(texture.image.height * levelScale); + textures.setTexture2D(texture, 0); + _gl.copyTexSubImage2D(3553, level, 0, 0, position.x, position.y, width, height); + state.unbindTexture(); + }; + this.copyTextureToTexture = function(position, srcTexture, dstTexture, level = 0) { + const width = srcTexture.image.width; + const height = srcTexture.image.height; + const glFormat = utils.convert(dstTexture.format); + const glType = utils.convert(dstTexture.type); + textures.setTexture2D(dstTexture, 0); + _gl.pixelStorei(37440, dstTexture.flipY); + _gl.pixelStorei(37441, dstTexture.premultiplyAlpha); + _gl.pixelStorei(3317, dstTexture.unpackAlignment); + if (srcTexture.isDataTexture) { + _gl.texSubImage2D(3553, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data); + } else { + if (srcTexture.isCompressedTexture) { + _gl.compressedTexSubImage2D(3553, level, position.x, position.y, srcTexture.mipmaps[0].width, srcTexture.mipmaps[0].height, glFormat, srcTexture.mipmaps[0].data); + } else { + _gl.texSubImage2D(3553, level, position.x, position.y, glFormat, glType, srcTexture.image); + } + } + if (level === 0 && dstTexture.generateMipmaps) + _gl.generateMipmap(3553); + state.unbindTexture(); + }; + this.copyTextureToTexture3D = function(sourceBox, position, srcTexture, dstTexture, level = 0) { + if (_this.isWebGL1Renderer) { + console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2."); + return; + } + const width = sourceBox.max.x - sourceBox.min.x + 1; + const height = sourceBox.max.y - sourceBox.min.y + 1; + const depth = sourceBox.max.z - sourceBox.min.z + 1; + const glFormat = utils.convert(dstTexture.format); + const glType = utils.convert(dstTexture.type); + let glTarget; + if (dstTexture.isData3DTexture) { + textures.setTexture3D(dstTexture, 0); + glTarget = 32879; + } else if (dstTexture.isDataArrayTexture) { + textures.setTexture2DArray(dstTexture, 0); + glTarget = 35866; + } else { + console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray."); + return; + } + _gl.pixelStorei(37440, dstTexture.flipY); + _gl.pixelStorei(37441, dstTexture.premultiplyAlpha); + _gl.pixelStorei(3317, dstTexture.unpackAlignment); + const unpackRowLen = _gl.getParameter(3314); + const unpackImageHeight = _gl.getParameter(32878); + const unpackSkipPixels = _gl.getParameter(3316); + const unpackSkipRows = _gl.getParameter(3315); + const unpackSkipImages = _gl.getParameter(32877); + const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[0] : srcTexture.image; + _gl.pixelStorei(3314, image.width); + _gl.pixelStorei(32878, image.height); + _gl.pixelStorei(3316, sourceBox.min.x); + _gl.pixelStorei(3315, sourceBox.min.y); + _gl.pixelStorei(32877, sourceBox.min.z); + if (srcTexture.isDataTexture || srcTexture.isData3DTexture) { + _gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data); + } else { + if (srcTexture.isCompressedTexture) { + console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."); + _gl.compressedTexSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data); + } else { + _gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image); + } + } + _gl.pixelStorei(3314, unpackRowLen); + _gl.pixelStorei(32878, unpackImageHeight); + _gl.pixelStorei(3316, unpackSkipPixels); + _gl.pixelStorei(3315, unpackSkipRows); + _gl.pixelStorei(32877, unpackSkipImages); + if (level === 0 && dstTexture.generateMipmaps) + _gl.generateMipmap(glTarget); + state.unbindTexture(); + }; + this.initTexture = function(texture) { + if (texture.isCubeTexture) { + textures.setTextureCube(texture, 0); + } else if (texture.isData3DTexture) { + textures.setTexture3D(texture, 0); + } else if (texture.isDataArrayTexture) { + textures.setTexture2DArray(texture, 0); + } else { + textures.setTexture2D(texture, 0); + } + state.unbindTexture(); + }; + this.resetState = function() { + _currentActiveCubeFace = 0; + _currentActiveMipmapLevel = 0; + _currentRenderTarget = null; + state.reset(); + bindingStates.reset(); + }; + if (typeof __THREE_DEVTOOLS__ !== "undefined") { + __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); + } +} +var WebGL1Renderer = class extends WebGLRenderer { +}; +WebGL1Renderer.prototype.isWebGL1Renderer = true; +var Scene = class extends Object3D { + constructor() { + super(); + this.isScene = true; + this.type = "Scene"; + this.background = null; + this.environment = null; + this.fog = null; + this.overrideMaterial = null; + this.autoUpdate = true; + if (typeof __THREE_DEVTOOLS__ !== "undefined") { + __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); + } + } + copy(source, recursive) { + super.copy(source, recursive); + if (source.background !== null) + this.background = source.background.clone(); + if (source.environment !== null) + this.environment = source.environment.clone(); + if (source.fog !== null) + this.fog = source.fog.clone(); + if (source.overrideMaterial !== null) + this.overrideMaterial = source.overrideMaterial.clone(); + this.autoUpdate = source.autoUpdate; + this.matrixAutoUpdate = source.matrixAutoUpdate; + return this; + } + toJSON(meta) { + const data = super.toJSON(meta); + if (this.fog !== null) + data.object.fog = this.fog.toJSON(); + return data; + } +}; +var LineBasicMaterial = class extends Material { + constructor(parameters) { + super(); + this.isLineBasicMaterial = true; + this.type = "LineBasicMaterial"; + this.color = new Color(16777215); + this.linewidth = 1; + this.linecap = "round"; + this.linejoin = "round"; + this.fog = true; + this.setValues(parameters); + } + copy(source) { + super.copy(source); + this.color.copy(source.color); + this.linewidth = source.linewidth; + this.linecap = source.linecap; + this.linejoin = source.linejoin; + this.fog = source.fog; + return this; + } +}; +var _start$1 = /* @__PURE__ */ new Vector3(); +var _end$1 = /* @__PURE__ */ new Vector3(); +var _inverseMatrix$1 = /* @__PURE__ */ new Matrix4(); +var _ray$1 = /* @__PURE__ */ new Ray(); +var _sphere$1 = /* @__PURE__ */ new Sphere(); +var Line = class extends Object3D { + constructor(geometry = new BufferGeometry(), material = new LineBasicMaterial()) { + super(); + this.isLine = true; + this.type = "Line"; + this.geometry = geometry; + this.material = material; + this.updateMorphTargets(); + } + copy(source, recursive) { + super.copy(source, recursive); + this.material = source.material; + this.geometry = source.geometry; + return this; + } + computeLineDistances() { + const geometry = this.geometry; + if (geometry.index === null) { + const positionAttribute = geometry.attributes.position; + const lineDistances = [0]; + for (let i = 1, l = positionAttribute.count; i < l; i++) { + _start$1.fromBufferAttribute(positionAttribute, i - 1); + _end$1.fromBufferAttribute(positionAttribute, i); + lineDistances[i] = lineDistances[i - 1]; + lineDistances[i] += _start$1.distanceTo(_end$1); + } + geometry.setAttribute("lineDistance", new Float32BufferAttribute(lineDistances, 1)); + } else { + console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); + } + return this; + } + raycast(raycaster, intersects) { + const geometry = this.geometry; + const matrixWorld = this.matrixWorld; + const threshold = raycaster.params.Line.threshold; + const drawRange = geometry.drawRange; + if (geometry.boundingSphere === null) + geometry.computeBoundingSphere(); + _sphere$1.copy(geometry.boundingSphere); + _sphere$1.applyMatrix4(matrixWorld); + _sphere$1.radius += threshold; + if (raycaster.ray.intersectsSphere(_sphere$1) === false) + return; + _inverseMatrix$1.copy(matrixWorld).invert(); + _ray$1.copy(raycaster.ray).applyMatrix4(_inverseMatrix$1); + const localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3); + const localThresholdSq = localThreshold * localThreshold; + const vStart = new Vector3(); + const vEnd = new Vector3(); + const interSegment = new Vector3(); + const interRay = new Vector3(); + const step = this.isLineSegments ? 2 : 1; + const index5 = geometry.index; + const attributes = geometry.attributes; + const positionAttribute = attributes.position; + if (index5 !== null) { + const start = Math.max(0, drawRange.start); + const end = Math.min(index5.count, drawRange.start + drawRange.count); + for (let i = start, l = end - 1; i < l; i += step) { + const a2 = index5.getX(i); + const b = index5.getX(i + 1); + vStart.fromBufferAttribute(positionAttribute, a2); + vEnd.fromBufferAttribute(positionAttribute, b); + const distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment); + if (distSq > localThresholdSq) + continue; + interRay.applyMatrix4(this.matrixWorld); + const distance = raycaster.ray.origin.distanceTo(interRay); + if (distance < raycaster.near || distance > raycaster.far) + continue; + intersects.push({ + distance, + point: interSegment.clone().applyMatrix4(this.matrixWorld), + index: i, + face: null, + faceIndex: null, + object: this + }); + } + } else { + const start = Math.max(0, drawRange.start); + const end = Math.min(positionAttribute.count, drawRange.start + drawRange.count); + for (let i = start, l = end - 1; i < l; i += step) { + vStart.fromBufferAttribute(positionAttribute, i); + vEnd.fromBufferAttribute(positionAttribute, i + 1); + const distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment); + if (distSq > localThresholdSq) + continue; + interRay.applyMatrix4(this.matrixWorld); + const distance = raycaster.ray.origin.distanceTo(interRay); + if (distance < raycaster.near || distance > raycaster.far) + continue; + intersects.push({ + distance, + point: interSegment.clone().applyMatrix4(this.matrixWorld), + index: i, + face: null, + faceIndex: null, + object: this + }); + } + } + } + updateMorphTargets() { + const geometry = this.geometry; + const morphAttributes = geometry.morphAttributes; + const keys = Object.keys(morphAttributes); + if (keys.length > 0) { + const morphAttribute = morphAttributes[keys[0]]; + if (morphAttribute !== void 0) { + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; + for (let m2 = 0, ml = morphAttribute.length; m2 < ml; m2++) { + const name = morphAttribute[m2].name || String(m2); + this.morphTargetInfluences.push(0); + this.morphTargetDictionary[name] = m2; + } + } + } + } +}; +var Curve = class { + constructor() { + this.type = "Curve"; + this.arcLengthDivisions = 200; + } + getPoint() { + console.warn("THREE.Curve: .getPoint() not implemented."); + return null; + } + getPointAt(u, optionalTarget) { + const t = this.getUtoTmapping(u); + return this.getPoint(t, optionalTarget); + } + getPoints(divisions = 5) { + const points = []; + for (let d = 0; d <= divisions; d++) { + points.push(this.getPoint(d / divisions)); + } + return points; + } + getSpacedPoints(divisions = 5) { + const points = []; + for (let d = 0; d <= divisions; d++) { + points.push(this.getPointAt(d / divisions)); + } + return points; + } + getLength() { + const lengths = this.getLengths(); + return lengths[lengths.length - 1]; + } + getLengths(divisions = this.arcLengthDivisions) { + if (this.cacheArcLengths && this.cacheArcLengths.length === divisions + 1 && !this.needsUpdate) { + return this.cacheArcLengths; + } + this.needsUpdate = false; + const cache = []; + let current, last = this.getPoint(0); + let sum = 0; + cache.push(0); + for (let p = 1; p <= divisions; p++) { + current = this.getPoint(p / divisions); + sum += current.distanceTo(last); + cache.push(sum); + last = current; + } + this.cacheArcLengths = cache; + return cache; + } + updateArcLengths() { + this.needsUpdate = true; + this.getLengths(); + } + getUtoTmapping(u, distance) { + const arcLengths = this.getLengths(); + let i = 0; + const il = arcLengths.length; + let targetArcLength; + if (distance) { + targetArcLength = distance; + } else { + targetArcLength = u * arcLengths[il - 1]; + } + let low = 0, high = il - 1, comparison; + while (low <= high) { + i = Math.floor(low + (high - low) / 2); + comparison = arcLengths[i] - targetArcLength; + if (comparison < 0) { + low = i + 1; + } else if (comparison > 0) { + high = i - 1; + } else { + high = i; + break; + } + } + i = high; + if (arcLengths[i] === targetArcLength) { + return i / (il - 1); + } + const lengthBefore = arcLengths[i]; + const lengthAfter = arcLengths[i + 1]; + const segmentLength = lengthAfter - lengthBefore; + const segmentFraction = (targetArcLength - lengthBefore) / segmentLength; + const t = (i + segmentFraction) / (il - 1); + return t; + } + getTangent(t, optionalTarget) { + const delta = 1e-4; + let t1 = t - delta; + let t2 = t + delta; + if (t1 < 0) + t1 = 0; + if (t2 > 1) + t2 = 1; + const pt1 = this.getPoint(t1); + const pt2 = this.getPoint(t2); + const tangent = optionalTarget || (pt1.isVector2 ? new Vector2() : new Vector3()); + tangent.copy(pt2).sub(pt1).normalize(); + return tangent; + } + getTangentAt(u, optionalTarget) { + const t = this.getUtoTmapping(u); + return this.getTangent(t, optionalTarget); + } + computeFrenetFrames(segments, closed) { + const normal = new Vector3(); + const tangents = []; + const normals = []; + const binormals = []; + const vec = new Vector3(); + const mat = new Matrix4(); + for (let i = 0; i <= segments; i++) { + const u = i / segments; + tangents[i] = this.getTangentAt(u, new Vector3()); + } + normals[0] = new Vector3(); + binormals[0] = new Vector3(); + let min2 = Number.MAX_VALUE; + const tx = Math.abs(tangents[0].x); + const ty = Math.abs(tangents[0].y); + const tz = Math.abs(tangents[0].z); + if (tx <= min2) { + min2 = tx; + normal.set(1, 0, 0); + } + if (ty <= min2) { + min2 = ty; + normal.set(0, 1, 0); + } + if (tz <= min2) { + normal.set(0, 0, 1); + } + vec.crossVectors(tangents[0], normal).normalize(); + normals[0].crossVectors(tangents[0], vec); + binormals[0].crossVectors(tangents[0], normals[0]); + for (let i = 1; i <= segments; i++) { + normals[i] = normals[i - 1].clone(); + binormals[i] = binormals[i - 1].clone(); + vec.crossVectors(tangents[i - 1], tangents[i]); + if (vec.length() > Number.EPSILON) { + vec.normalize(); + const theta = Math.acos(clamp(tangents[i - 1].dot(tangents[i]), -1, 1)); + normals[i].applyMatrix4(mat.makeRotationAxis(vec, theta)); + } + binormals[i].crossVectors(tangents[i], normals[i]); + } + if (closed === true) { + let theta = Math.acos(clamp(normals[0].dot(normals[segments]), -1, 1)); + theta /= segments; + if (tangents[0].dot(vec.crossVectors(normals[0], normals[segments])) > 0) { + theta = -theta; + } + for (let i = 1; i <= segments; i++) { + normals[i].applyMatrix4(mat.makeRotationAxis(tangents[i], theta * i)); + binormals[i].crossVectors(tangents[i], normals[i]); + } + } + return { + tangents, + normals, + binormals + }; + } + clone() { + return new this.constructor().copy(this); + } + copy(source) { + this.arcLengthDivisions = source.arcLengthDivisions; + return this; + } + toJSON() { + const data = { + metadata: { + version: 4.5, + type: "Curve", + generator: "Curve.toJSON" + } + }; + data.arcLengthDivisions = this.arcLengthDivisions; + data.type = this.type; + return data; + } + fromJSON(json) { + this.arcLengthDivisions = json.arcLengthDivisions; + return this; + } +}; +var EllipseCurve = class extends Curve { + constructor(aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0) { + super(); + this.isEllipseCurve = true; + this.type = "EllipseCurve"; + this.aX = aX; + this.aY = aY; + this.xRadius = xRadius; + this.yRadius = yRadius; + this.aStartAngle = aStartAngle; + this.aEndAngle = aEndAngle; + this.aClockwise = aClockwise; + this.aRotation = aRotation; + } + getPoint(t, optionalTarget) { + const point = optionalTarget || new Vector2(); + const twoPi = Math.PI * 2; + let deltaAngle = this.aEndAngle - this.aStartAngle; + const samePoints = Math.abs(deltaAngle) < Number.EPSILON; + while (deltaAngle < 0) + deltaAngle += twoPi; + while (deltaAngle > twoPi) + deltaAngle -= twoPi; + if (deltaAngle < Number.EPSILON) { + if (samePoints) { + deltaAngle = 0; + } else { + deltaAngle = twoPi; + } + } + if (this.aClockwise === true && !samePoints) { + if (deltaAngle === twoPi) { + deltaAngle = -twoPi; + } else { + deltaAngle = deltaAngle - twoPi; + } + } + const angle = this.aStartAngle + t * deltaAngle; + let x2 = this.aX + this.xRadius * Math.cos(angle); + let y2 = this.aY + this.yRadius * Math.sin(angle); + if (this.aRotation !== 0) { + const cos = Math.cos(this.aRotation); + const sin = Math.sin(this.aRotation); + const tx = x2 - this.aX; + const ty = y2 - this.aY; + x2 = tx * cos - ty * sin + this.aX; + y2 = tx * sin + ty * cos + this.aY; + } + return point.set(x2, y2); + } + copy(source) { + super.copy(source); + this.aX = source.aX; + this.aY = source.aY; + this.xRadius = source.xRadius; + this.yRadius = source.yRadius; + this.aStartAngle = source.aStartAngle; + this.aEndAngle = source.aEndAngle; + this.aClockwise = source.aClockwise; + this.aRotation = source.aRotation; + return this; + } + toJSON() { + const data = super.toJSON(); + data.aX = this.aX; + data.aY = this.aY; + data.xRadius = this.xRadius; + data.yRadius = this.yRadius; + data.aStartAngle = this.aStartAngle; + data.aEndAngle = this.aEndAngle; + data.aClockwise = this.aClockwise; + data.aRotation = this.aRotation; + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.aX = json.aX; + this.aY = json.aY; + this.xRadius = json.xRadius; + this.yRadius = json.yRadius; + this.aStartAngle = json.aStartAngle; + this.aEndAngle = json.aEndAngle; + this.aClockwise = json.aClockwise; + this.aRotation = json.aRotation; + return this; + } +}; +var ArcCurve = class extends EllipseCurve { + constructor(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { + super(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise); + this.isArcCurve = true; + this.type = "ArcCurve"; + } +}; +function CubicPoly() { + let c0 = 0, c1 = 0, c2 = 0, c3 = 0; + function init4(x0, x1, t0, t1) { + c0 = x0; + c1 = t0; + c2 = -3 * x0 + 3 * x1 - 2 * t0 - t1; + c3 = 2 * x0 - 2 * x1 + t0 + t1; + } + return { + initCatmullRom: function(x0, x1, x2, x3, tension) { + init4(x1, x2, tension * (x2 - x0), tension * (x3 - x1)); + }, + initNonuniformCatmullRom: function(x0, x1, x2, x3, dt0, dt1, dt2) { + let t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1; + let t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; + t1 *= dt1; + t2 *= dt1; + init4(x1, x2, t1, t2); + }, + calc: function(t) { + const t2 = t * t; + const t3 = t2 * t; + return c0 + c1 * t + c2 * t2 + c3 * t3; + } + }; +} +var tmp = /* @__PURE__ */ new Vector3(); +var px = /* @__PURE__ */ new CubicPoly(); +var py = /* @__PURE__ */ new CubicPoly(); +var pz = /* @__PURE__ */ new CubicPoly(); +var CatmullRomCurve3 = class extends Curve { + constructor(points = [], closed = false, curveType = "centripetal", tension = 0.5) { + super(); + this.isCatmullRomCurve3 = true; + this.type = "CatmullRomCurve3"; + this.points = points; + this.closed = closed; + this.curveType = curveType; + this.tension = tension; + } + getPoint(t, optionalTarget = new Vector3()) { + const point = optionalTarget; + const points = this.points; + const l = points.length; + const p = (l - (this.closed ? 0 : 1)) * t; + let intPoint = Math.floor(p); + let weight = p - intPoint; + if (this.closed) { + intPoint += intPoint > 0 ? 0 : (Math.floor(Math.abs(intPoint) / l) + 1) * l; + } else if (weight === 0 && intPoint === l - 1) { + intPoint = l - 2; + weight = 1; + } + let p0, p3; + if (this.closed || intPoint > 0) { + p0 = points[(intPoint - 1) % l]; + } else { + tmp.subVectors(points[0], points[1]).add(points[0]); + p0 = tmp; + } + const p1 = points[intPoint % l]; + const p2 = points[(intPoint + 1) % l]; + if (this.closed || intPoint + 2 < l) { + p3 = points[(intPoint + 2) % l]; + } else { + tmp.subVectors(points[l - 1], points[l - 2]).add(points[l - 1]); + p3 = tmp; + } + if (this.curveType === "centripetal" || this.curveType === "chordal") { + const pow = this.curveType === "chordal" ? 0.5 : 0.25; + let dt0 = Math.pow(p0.distanceToSquared(p1), pow); + let dt1 = Math.pow(p1.distanceToSquared(p2), pow); + let dt2 = Math.pow(p2.distanceToSquared(p3), pow); + if (dt1 < 1e-4) + dt1 = 1; + if (dt0 < 1e-4) + dt0 = dt1; + if (dt2 < 1e-4) + dt2 = dt1; + px.initNonuniformCatmullRom(p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2); + py.initNonuniformCatmullRom(p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2); + pz.initNonuniformCatmullRom(p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2); + } else if (this.curveType === "catmullrom") { + px.initCatmullRom(p0.x, p1.x, p2.x, p3.x, this.tension); + py.initCatmullRom(p0.y, p1.y, p2.y, p3.y, this.tension); + pz.initCatmullRom(p0.z, p1.z, p2.z, p3.z, this.tension); + } + point.set(px.calc(weight), py.calc(weight), pz.calc(weight)); + return point; + } + copy(source) { + super.copy(source); + this.points = []; + for (let i = 0, l = source.points.length; i < l; i++) { + const point = source.points[i]; + this.points.push(point.clone()); + } + this.closed = source.closed; + this.curveType = source.curveType; + this.tension = source.tension; + return this; + } + toJSON() { + const data = super.toJSON(); + data.points = []; + for (let i = 0, l = this.points.length; i < l; i++) { + const point = this.points[i]; + data.points.push(point.toArray()); + } + data.closed = this.closed; + data.curveType = this.curveType; + data.tension = this.tension; + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.points = []; + for (let i = 0, l = json.points.length; i < l; i++) { + const point = json.points[i]; + this.points.push(new Vector3().fromArray(point)); + } + this.closed = json.closed; + this.curveType = json.curveType; + this.tension = json.tension; + return this; + } +}; +function CatmullRom(t, p0, p1, p2, p3) { + const v0 = (p2 - p0) * 0.5; + const v1 = (p3 - p1) * 0.5; + const t2 = t * t; + const t3 = t * t2; + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +} +function QuadraticBezierP0(t, p) { + const k = 1 - t; + return k * k * p; +} +function QuadraticBezierP1(t, p) { + return 2 * (1 - t) * t * p; +} +function QuadraticBezierP2(t, p) { + return t * t * p; +} +function QuadraticBezier(t, p0, p1, p2) { + return QuadraticBezierP0(t, p0) + QuadraticBezierP1(t, p1) + QuadraticBezierP2(t, p2); +} +function CubicBezierP0(t, p) { + const k = 1 - t; + return k * k * k * p; +} +function CubicBezierP1(t, p) { + const k = 1 - t; + return 3 * k * k * t * p; +} +function CubicBezierP2(t, p) { + return 3 * (1 - t) * t * t * p; +} +function CubicBezierP3(t, p) { + return t * t * t * p; +} +function CubicBezier(t, p0, p1, p2, p3) { + return CubicBezierP0(t, p0) + CubicBezierP1(t, p1) + CubicBezierP2(t, p2) + CubicBezierP3(t, p3); +} +var CubicBezierCurve = class extends Curve { + constructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2()) { + super(); + this.isCubicBezierCurve = true; + this.type = "CubicBezierCurve"; + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; + } + getPoint(t, optionalTarget = new Vector2()) { + const point = optionalTarget; + const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; + point.set(CubicBezier(t, v0.x, v1.x, v2.x, v3.x), CubicBezier(t, v0.y, v1.y, v2.y, v3.y)); + return point; + } + copy(source) { + super.copy(source); + this.v0.copy(source.v0); + this.v1.copy(source.v1); + this.v2.copy(source.v2); + this.v3.copy(source.v3); + return this; + } + toJSON() { + const data = super.toJSON(); + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + data.v3 = this.v3.toArray(); + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.v0.fromArray(json.v0); + this.v1.fromArray(json.v1); + this.v2.fromArray(json.v2); + this.v3.fromArray(json.v3); + return this; + } +}; +var CubicBezierCurve3 = class extends Curve { + constructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3()) { + super(); + this.isCubicBezierCurve3 = true; + this.type = "CubicBezierCurve3"; + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; + } + getPoint(t, optionalTarget = new Vector3()) { + const point = optionalTarget; + const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; + point.set(CubicBezier(t, v0.x, v1.x, v2.x, v3.x), CubicBezier(t, v0.y, v1.y, v2.y, v3.y), CubicBezier(t, v0.z, v1.z, v2.z, v3.z)); + return point; + } + copy(source) { + super.copy(source); + this.v0.copy(source.v0); + this.v1.copy(source.v1); + this.v2.copy(source.v2); + this.v3.copy(source.v3); + return this; + } + toJSON() { + const data = super.toJSON(); + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + data.v3 = this.v3.toArray(); + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.v0.fromArray(json.v0); + this.v1.fromArray(json.v1); + this.v2.fromArray(json.v2); + this.v3.fromArray(json.v3); + return this; + } +}; +var LineCurve = class extends Curve { + constructor(v1 = new Vector2(), v2 = new Vector2()) { + super(); + this.isLineCurve = true; + this.type = "LineCurve"; + this.v1 = v1; + this.v2 = v2; + } + getPoint(t, optionalTarget = new Vector2()) { + const point = optionalTarget; + if (t === 1) { + point.copy(this.v2); + } else { + point.copy(this.v2).sub(this.v1); + point.multiplyScalar(t).add(this.v1); + } + return point; + } + getPointAt(u, optionalTarget) { + return this.getPoint(u, optionalTarget); + } + getTangent(t, optionalTarget) { + const tangent = optionalTarget || new Vector2(); + tangent.copy(this.v2).sub(this.v1).normalize(); + return tangent; + } + copy(source) { + super.copy(source); + this.v1.copy(source.v1); + this.v2.copy(source.v2); + return this; + } + toJSON() { + const data = super.toJSON(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.v1.fromArray(json.v1); + this.v2.fromArray(json.v2); + return this; + } +}; +var LineCurve3 = class extends Curve { + constructor(v1 = new Vector3(), v2 = new Vector3()) { + super(); + this.isLineCurve3 = true; + this.type = "LineCurve3"; + this.v1 = v1; + this.v2 = v2; + } + getPoint(t, optionalTarget = new Vector3()) { + const point = optionalTarget; + if (t === 1) { + point.copy(this.v2); + } else { + point.copy(this.v2).sub(this.v1); + point.multiplyScalar(t).add(this.v1); + } + return point; + } + getPointAt(u, optionalTarget) { + return this.getPoint(u, optionalTarget); + } + copy(source) { + super.copy(source); + this.v1.copy(source.v1); + this.v2.copy(source.v2); + return this; + } + toJSON() { + const data = super.toJSON(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.v1.fromArray(json.v1); + this.v2.fromArray(json.v2); + return this; + } +}; +var QuadraticBezierCurve = class extends Curve { + constructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2()) { + super(); + this.isQuadraticBezierCurve = true; + this.type = "QuadraticBezierCurve"; + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + } + getPoint(t, optionalTarget = new Vector2()) { + const point = optionalTarget; + const v0 = this.v0, v1 = this.v1, v2 = this.v2; + point.set(QuadraticBezier(t, v0.x, v1.x, v2.x), QuadraticBezier(t, v0.y, v1.y, v2.y)); + return point; + } + copy(source) { + super.copy(source); + this.v0.copy(source.v0); + this.v1.copy(source.v1); + this.v2.copy(source.v2); + return this; + } + toJSON() { + const data = super.toJSON(); + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.v0.fromArray(json.v0); + this.v1.fromArray(json.v1); + this.v2.fromArray(json.v2); + return this; + } +}; +var QuadraticBezierCurve3 = class extends Curve { + constructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3()) { + super(); + this.isQuadraticBezierCurve3 = true; + this.type = "QuadraticBezierCurve3"; + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + } + getPoint(t, optionalTarget = new Vector3()) { + const point = optionalTarget; + const v0 = this.v0, v1 = this.v1, v2 = this.v2; + point.set(QuadraticBezier(t, v0.x, v1.x, v2.x), QuadraticBezier(t, v0.y, v1.y, v2.y), QuadraticBezier(t, v0.z, v1.z, v2.z)); + return point; + } + copy(source) { + super.copy(source); + this.v0.copy(source.v0); + this.v1.copy(source.v1); + this.v2.copy(source.v2); + return this; + } + toJSON() { + const data = super.toJSON(); + data.v0 = this.v0.toArray(); + data.v1 = this.v1.toArray(); + data.v2 = this.v2.toArray(); + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.v0.fromArray(json.v0); + this.v1.fromArray(json.v1); + this.v2.fromArray(json.v2); + return this; + } +}; +var SplineCurve = class extends Curve { + constructor(points = []) { + super(); + this.isSplineCurve = true; + this.type = "SplineCurve"; + this.points = points; + } + getPoint(t, optionalTarget = new Vector2()) { + const point = optionalTarget; + const points = this.points; + const p = (points.length - 1) * t; + const intPoint = Math.floor(p); + const weight = p - intPoint; + const p0 = points[intPoint === 0 ? intPoint : intPoint - 1]; + const p1 = points[intPoint]; + const p2 = points[intPoint > points.length - 2 ? points.length - 1 : intPoint + 1]; + const p3 = points[intPoint > points.length - 3 ? points.length - 1 : intPoint + 2]; + point.set(CatmullRom(weight, p0.x, p1.x, p2.x, p3.x), CatmullRom(weight, p0.y, p1.y, p2.y, p3.y)); + return point; + } + copy(source) { + super.copy(source); + this.points = []; + for (let i = 0, l = source.points.length; i < l; i++) { + const point = source.points[i]; + this.points.push(point.clone()); + } + return this; + } + toJSON() { + const data = super.toJSON(); + data.points = []; + for (let i = 0, l = this.points.length; i < l; i++) { + const point = this.points[i]; + data.points.push(point.toArray()); + } + return data; + } + fromJSON(json) { + super.fromJSON(json); + this.points = []; + for (let i = 0, l = json.points.length; i < l; i++) { + const point = json.points[i]; + this.points.push(new Vector2().fromArray(point)); + } + return this; + } +}; +var Curves = /* @__PURE__ */ Object.freeze({ + __proto__: null, + ArcCurve, + CatmullRomCurve3, + CubicBezierCurve, + CubicBezierCurve3, + EllipseCurve, + LineCurve, + LineCurve3, + QuadraticBezierCurve, + QuadraticBezierCurve3, + SplineCurve +}); +var CylinderGeometry = class extends BufferGeometry { + constructor(radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) { + super(); + this.type = "CylinderGeometry"; + this.parameters = { + radiusTop, + radiusBottom, + height, + radialSegments, + heightSegments, + openEnded, + thetaStart, + thetaLength + }; + const scope = this; + radialSegments = Math.floor(radialSegments); + heightSegments = Math.floor(heightSegments); + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + let index5 = 0; + const indexArray = []; + const halfHeight = height / 2; + let groupStart = 0; + generateTorso(); + if (openEnded === false) { + if (radiusTop > 0) + generateCap(true); + if (radiusBottom > 0) + generateCap(false); + } + this.setIndex(indices); + this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); + this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); + this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); + function generateTorso() { + const normal = new Vector3(); + const vertex2 = new Vector3(); + let groupCount = 0; + const slope = (radiusBottom - radiusTop) / height; + for (let y2 = 0; y2 <= heightSegments; y2++) { + const indexRow = []; + const v = y2 / heightSegments; + const radius = v * (radiusBottom - radiusTop) + radiusTop; + for (let x2 = 0; x2 <= radialSegments; x2++) { + const u = x2 / radialSegments; + const theta = u * thetaLength + thetaStart; + const sinTheta = Math.sin(theta); + const cosTheta = Math.cos(theta); + vertex2.x = radius * sinTheta; + vertex2.y = -v * height + halfHeight; + vertex2.z = radius * cosTheta; + vertices.push(vertex2.x, vertex2.y, vertex2.z); + normal.set(sinTheta, slope, cosTheta).normalize(); + normals.push(normal.x, normal.y, normal.z); + uvs.push(u, 1 - v); + indexRow.push(index5++); + } + indexArray.push(indexRow); + } + for (let x2 = 0; x2 < radialSegments; x2++) { + for (let y2 = 0; y2 < heightSegments; y2++) { + const a2 = indexArray[y2][x2]; + const b = indexArray[y2 + 1][x2]; + const c2 = indexArray[y2 + 1][x2 + 1]; + const d = indexArray[y2][x2 + 1]; + indices.push(a2, b, d); + indices.push(b, c2, d); + groupCount += 6; + } + } + scope.addGroup(groupStart, groupCount, 0); + groupStart += groupCount; + } + function generateCap(top) { + const centerIndexStart = index5; + const uv = new Vector2(); + const vertex2 = new Vector3(); + let groupCount = 0; + const radius = top === true ? radiusTop : radiusBottom; + const sign = top === true ? 1 : -1; + for (let x2 = 1; x2 <= radialSegments; x2++) { + vertices.push(0, halfHeight * sign, 0); + normals.push(0, sign, 0); + uvs.push(0.5, 0.5); + index5++; + } + const centerIndexEnd = index5; + for (let x2 = 0; x2 <= radialSegments; x2++) { + const u = x2 / radialSegments; + const theta = u * thetaLength + thetaStart; + const cosTheta = Math.cos(theta); + const sinTheta = Math.sin(theta); + vertex2.x = radius * sinTheta; + vertex2.y = halfHeight * sign; + vertex2.z = radius * cosTheta; + vertices.push(vertex2.x, vertex2.y, vertex2.z); + normals.push(0, sign, 0); + uv.x = cosTheta * 0.5 + 0.5; + uv.y = sinTheta * 0.5 * sign + 0.5; + uvs.push(uv.x, uv.y); + index5++; + } + for (let x2 = 0; x2 < radialSegments; x2++) { + const c2 = centerIndexStart + x2; + const i = centerIndexEnd + x2; + if (top === true) { + indices.push(i, i + 1, c2); + } else { + indices.push(i + 1, i, c2); + } + groupCount += 3; + } + scope.addGroup(groupStart, groupCount, top === true ? 1 : 2); + groupStart += groupCount; + } + } + static fromJSON(data) { + return new CylinderGeometry(data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength); + } +}; +var ConeGeometry = class extends CylinderGeometry { + constructor(radius = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) { + super(0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength); + this.type = "ConeGeometry"; + this.parameters = { + radius, + height, + radialSegments, + heightSegments, + openEnded, + thetaStart, + thetaLength + }; + } + static fromJSON(data) { + return new ConeGeometry(data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength); + } +}; +var SphereGeometry = class extends BufferGeometry { + constructor(radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI) { + super(); + this.type = "SphereGeometry"; + this.parameters = { + radius, + widthSegments, + heightSegments, + phiStart, + phiLength, + thetaStart, + thetaLength + }; + widthSegments = Math.max(3, Math.floor(widthSegments)); + heightSegments = Math.max(2, Math.floor(heightSegments)); + const thetaEnd = Math.min(thetaStart + thetaLength, Math.PI); + let index5 = 0; + const grid = []; + const vertex2 = new Vector3(); + const normal = new Vector3(); + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + for (let iy = 0; iy <= heightSegments; iy++) { + const verticesRow = []; + const v = iy / heightSegments; + let uOffset = 0; + if (iy == 0 && thetaStart == 0) { + uOffset = 0.5 / widthSegments; + } else if (iy == heightSegments && thetaEnd == Math.PI) { + uOffset = -0.5 / widthSegments; + } + for (let ix = 0; ix <= widthSegments; ix++) { + const u = ix / widthSegments; + vertex2.x = -radius * Math.cos(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength); + vertex2.y = radius * Math.cos(thetaStart + v * thetaLength); + vertex2.z = radius * Math.sin(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength); + vertices.push(vertex2.x, vertex2.y, vertex2.z); + normal.copy(vertex2).normalize(); + normals.push(normal.x, normal.y, normal.z); + uvs.push(u + uOffset, 1 - v); + verticesRow.push(index5++); + } + grid.push(verticesRow); + } + for (let iy = 0; iy < heightSegments; iy++) { + for (let ix = 0; ix < widthSegments; ix++) { + const a2 = grid[iy][ix + 1]; + const b = grid[iy][ix]; + const c2 = grid[iy + 1][ix]; + const d = grid[iy + 1][ix + 1]; + if (iy !== 0 || thetaStart > 0) + indices.push(a2, b, d); + if (iy !== heightSegments - 1 || thetaEnd < Math.PI) + indices.push(b, c2, d); + } + } + this.setIndex(indices); + this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); + this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); + this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); + } + static fromJSON(data) { + return new SphereGeometry(data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength); + } +}; +var TubeGeometry = class extends BufferGeometry { + constructor(path = new QuadraticBezierCurve3(new Vector3(-1, -1, 0), new Vector3(-1, 1, 0), new Vector3(1, 1, 0)), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false) { + super(); + this.type = "TubeGeometry"; + this.parameters = { + path, + tubularSegments, + radius, + radialSegments, + closed + }; + const frames = path.computeFrenetFrames(tubularSegments, closed); + this.tangents = frames.tangents; + this.normals = frames.normals; + this.binormals = frames.binormals; + const vertex2 = new Vector3(); + const normal = new Vector3(); + const uv = new Vector2(); + let P = new Vector3(); + const vertices = []; + const normals = []; + const uvs = []; + const indices = []; + generateBufferData(); + this.setIndex(indices); + this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); + this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); + this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); + function generateBufferData() { + for (let i = 0; i < tubularSegments; i++) { + generateSegment(i); + } + generateSegment(closed === false ? tubularSegments : 0); + generateUVs(); + generateIndices(); + } + function generateSegment(i) { + P = path.getPointAt(i / tubularSegments, P); + const N = frames.normals[i]; + const B = frames.binormals[i]; + for (let j = 0; j <= radialSegments; j++) { + const v = j / radialSegments * Math.PI * 2; + const sin = Math.sin(v); + const cos = -Math.cos(v); + normal.x = cos * N.x + sin * B.x; + normal.y = cos * N.y + sin * B.y; + normal.z = cos * N.z + sin * B.z; + normal.normalize(); + normals.push(normal.x, normal.y, normal.z); + vertex2.x = P.x + radius * normal.x; + vertex2.y = P.y + radius * normal.y; + vertex2.z = P.z + radius * normal.z; + vertices.push(vertex2.x, vertex2.y, vertex2.z); + } + } + function generateIndices() { + for (let j = 1; j <= tubularSegments; j++) { + for (let i = 1; i <= radialSegments; i++) { + const a2 = (radialSegments + 1) * (j - 1) + (i - 1); + const b = (radialSegments + 1) * j + (i - 1); + const c2 = (radialSegments + 1) * j + i; + const d = (radialSegments + 1) * (j - 1) + i; + indices.push(a2, b, d); + indices.push(b, c2, d); + } + } + } + function generateUVs() { + for (let i = 0; i <= tubularSegments; i++) { + for (let j = 0; j <= radialSegments; j++) { + uv.x = i / tubularSegments; + uv.y = j / radialSegments; + uvs.push(uv.x, uv.y); + } + } + } + } + toJSON() { + const data = super.toJSON(); + data.path = this.parameters.path.toJSON(); + return data; + } + static fromJSON(data) { + return new TubeGeometry(new Curves[data.path.type]().fromJSON(data.path), data.tubularSegments, data.radius, data.radialSegments, data.closed); + } +}; +var MeshLambertMaterial = class extends Material { + constructor(parameters) { + super(); + this.isMeshLambertMaterial = true; + this.type = "MeshLambertMaterial"; + this.color = new Color(16777215); + this.map = null; + this.lightMap = null; + this.lightMapIntensity = 1; + this.aoMap = null; + this.aoMapIntensity = 1; + this.emissive = new Color(0); + this.emissiveIntensity = 1; + this.emissiveMap = null; + this.specularMap = null; + this.alphaMap = null; + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = "round"; + this.wireframeLinejoin = "round"; + this.fog = true; + this.setValues(parameters); + } + copy(source) { + super.copy(source); + this.color.copy(source.color); + this.map = source.map; + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + this.emissive.copy(source.emissive); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + this.specularMap = source.specularMap; + this.alphaMap = source.alphaMap; + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + this.fog = source.fog; + return this; + } +}; +function arraySlice(array, from, to) { + if (isTypedArray(array)) { + return new array.constructor(array.subarray(from, to !== void 0 ? to : array.length)); + } + return array.slice(from, to); +} +function convertArray(array, type, forceClone) { + if (!array || !forceClone && array.constructor === type) + return array; + if (typeof type.BYTES_PER_ELEMENT === "number") { + return new type(array); + } + return Array.prototype.slice.call(array); +} +function isTypedArray(object) { + return ArrayBuffer.isView(object) && !(object instanceof DataView); +} +var Interpolant = class { + constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { + this.parameterPositions = parameterPositions; + this._cachedIndex = 0; + this.resultBuffer = resultBuffer !== void 0 ? resultBuffer : new sampleValues.constructor(sampleSize); + this.sampleValues = sampleValues; + this.valueSize = sampleSize; + this.settings = null; + this.DefaultSettings_ = {}; + } + evaluate(t) { + const pp = this.parameterPositions; + let i1 = this._cachedIndex, t1 = pp[i1], t0 = pp[i1 - 1]; + validate_interval: { + seek: { + let right; + linear_scan: { + forward_scan: + if (!(t < t1)) { + for (let giveUpAt = i1 + 2; ; ) { + if (t1 === void 0) { + if (t < t0) + break forward_scan; + i1 = pp.length; + this._cachedIndex = i1; + return this.copySampleValue_(i1 - 1); + } + if (i1 === giveUpAt) + break; + t0 = t1; + t1 = pp[++i1]; + if (t < t1) { + break seek; + } + } + right = pp.length; + break linear_scan; + } + if (!(t >= t0)) { + const t1global = pp[1]; + if (t < t1global) { + i1 = 2; + t0 = t1global; + } + for (let giveUpAt = i1 - 2; ; ) { + if (t0 === void 0) { + this._cachedIndex = 0; + return this.copySampleValue_(0); + } + if (i1 === giveUpAt) + break; + t1 = t0; + t0 = pp[--i1 - 1]; + if (t >= t0) { + break seek; + } + } + right = i1; + i1 = 0; + break linear_scan; + } + break validate_interval; + } + while (i1 < right) { + const mid = i1 + right >>> 1; + if (t < pp[mid]) { + right = mid; + } else { + i1 = mid + 1; + } + } + t1 = pp[i1]; + t0 = pp[i1 - 1]; + if (t0 === void 0) { + this._cachedIndex = 0; + return this.copySampleValue_(0); + } + if (t1 === void 0) { + i1 = pp.length; + this._cachedIndex = i1; + return this.copySampleValue_(i1 - 1); + } + } + this._cachedIndex = i1; + this.intervalChanged_(i1, t0, t1); + } + return this.interpolate_(i1, t0, t, t1); + } + getSettings_() { + return this.settings || this.DefaultSettings_; + } + copySampleValue_(index5) { + const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset = index5 * stride; + for (let i = 0; i !== stride; ++i) { + result[i] = values[offset + i]; + } + return result; + } + interpolate_() { + throw new Error("call to abstract method"); + } + intervalChanged_() { + } +}; +var CubicInterpolant = class extends Interpolant { + constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { + super(parameterPositions, sampleValues, sampleSize, resultBuffer); + this._weightPrev = -0; + this._offsetPrev = -0; + this._weightNext = -0; + this._offsetNext = -0; + this.DefaultSettings_ = { + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding + }; + } + intervalChanged_(i1, t0, t1) { + const pp = this.parameterPositions; + let iPrev = i1 - 2, iNext = i1 + 1, tPrev = pp[iPrev], tNext = pp[iNext]; + if (tPrev === void 0) { + switch (this.getSettings_().endingStart) { + case ZeroSlopeEnding: + iPrev = i1; + tPrev = 2 * t0 - t1; + break; + case WrapAroundEnding: + iPrev = pp.length - 2; + tPrev = t0 + pp[iPrev] - pp[iPrev + 1]; + break; + default: + iPrev = i1; + tPrev = t1; + } + } + if (tNext === void 0) { + switch (this.getSettings_().endingEnd) { + case ZeroSlopeEnding: + iNext = i1; + tNext = 2 * t1 - t0; + break; + case WrapAroundEnding: + iNext = 1; + tNext = t1 + pp[1] - pp[0]; + break; + default: + iNext = i1 - 1; + tNext = t0; + } + } + const halfDt = (t1 - t0) * 0.5, stride = this.valueSize; + this._weightPrev = halfDt / (t0 - tPrev); + this._weightNext = halfDt / (tNext - t1); + this._offsetPrev = iPrev * stride; + this._offsetNext = iNext * stride; + } + interpolate_(i1, t0, t, t1) { + const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, o1 = i1 * stride, o0 = o1 - stride, oP = this._offsetPrev, oN = this._offsetNext, wP = this._weightPrev, wN = this._weightNext, p = (t - t0) / (t1 - t0), pp = p * p, ppp = pp * p; + const sP = -wP * ppp + 2 * wP * pp - wP * p; + const s0 = (1 + wP) * ppp + (-1.5 - 2 * wP) * pp + (-0.5 + wP) * p + 1; + const s1 = (-1 - wN) * ppp + (1.5 + wN) * pp + 0.5 * p; + const sN = wN * ppp - wN * pp; + for (let i = 0; i !== stride; ++i) { + result[i] = sP * values[oP + i] + s0 * values[o0 + i] + s1 * values[o1 + i] + sN * values[oN + i]; + } + return result; + } +}; +var LinearInterpolant = class extends Interpolant { + constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { + super(parameterPositions, sampleValues, sampleSize, resultBuffer); + } + interpolate_(i1, t0, t, t1) { + const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset1 = i1 * stride, offset0 = offset1 - stride, weight1 = (t - t0) / (t1 - t0), weight0 = 1 - weight1; + for (let i = 0; i !== stride; ++i) { + result[i] = values[offset0 + i] * weight0 + values[offset1 + i] * weight1; + } + return result; + } +}; +var DiscreteInterpolant = class extends Interpolant { + constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { + super(parameterPositions, sampleValues, sampleSize, resultBuffer); + } + interpolate_(i1) { + return this.copySampleValue_(i1 - 1); + } +}; +var KeyframeTrack = class { + constructor(name, times, values, interpolation) { + if (name === void 0) + throw new Error("THREE.KeyframeTrack: track name is undefined"); + if (times === void 0 || times.length === 0) + throw new Error("THREE.KeyframeTrack: no keyframes in track named " + name); + this.name = name; + this.times = convertArray(times, this.TimeBufferType); + this.values = convertArray(values, this.ValueBufferType); + this.setInterpolation(interpolation || this.DefaultInterpolation); + } + static toJSON(track) { + const trackType = track.constructor; + let json; + if (trackType.toJSON !== this.toJSON) { + json = trackType.toJSON(track); + } else { + json = { + "name": track.name, + "times": convertArray(track.times, Array), + "values": convertArray(track.values, Array) + }; + const interpolation = track.getInterpolation(); + if (interpolation !== track.DefaultInterpolation) { + json.interpolation = interpolation; + } + } + json.type = track.ValueTypeName; + return json; + } + InterpolantFactoryMethodDiscrete(result) { + return new DiscreteInterpolant(this.times, this.values, this.getValueSize(), result); + } + InterpolantFactoryMethodLinear(result) { + return new LinearInterpolant(this.times, this.values, this.getValueSize(), result); + } + InterpolantFactoryMethodSmooth(result) { + return new CubicInterpolant(this.times, this.values, this.getValueSize(), result); + } + setInterpolation(interpolation) { + let factoryMethod; + switch (interpolation) { + case InterpolateDiscrete: + factoryMethod = this.InterpolantFactoryMethodDiscrete; + break; + case InterpolateLinear: + factoryMethod = this.InterpolantFactoryMethodLinear; + break; + case InterpolateSmooth: + factoryMethod = this.InterpolantFactoryMethodSmooth; + break; + } + if (factoryMethod === void 0) { + const message = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name; + if (this.createInterpolant === void 0) { + if (interpolation !== this.DefaultInterpolation) { + this.setInterpolation(this.DefaultInterpolation); + } else { + throw new Error(message); + } + } + console.warn("THREE.KeyframeTrack:", message); + return this; + } + this.createInterpolant = factoryMethod; + return this; + } + getInterpolation() { + switch (this.createInterpolant) { + case this.InterpolantFactoryMethodDiscrete: + return InterpolateDiscrete; + case this.InterpolantFactoryMethodLinear: + return InterpolateLinear; + case this.InterpolantFactoryMethodSmooth: + return InterpolateSmooth; + } + } + getValueSize() { + return this.values.length / this.times.length; + } + shift(timeOffset) { + if (timeOffset !== 0) { + const times = this.times; + for (let i = 0, n = times.length; i !== n; ++i) { + times[i] += timeOffset; + } + } + return this; + } + scale(timeScale) { + if (timeScale !== 1) { + const times = this.times; + for (let i = 0, n = times.length; i !== n; ++i) { + times[i] *= timeScale; + } + } + return this; + } + trim(startTime, endTime) { + const times = this.times, nKeys = times.length; + let from = 0, to = nKeys - 1; + while (from !== nKeys && times[from] < startTime) { + ++from; + } + while (to !== -1 && times[to] > endTime) { + --to; + } + ++to; + if (from !== 0 || to !== nKeys) { + if (from >= to) { + to = Math.max(to, 1); + from = to - 1; + } + const stride = this.getValueSize(); + this.times = arraySlice(times, from, to); + this.values = arraySlice(this.values, from * stride, to * stride); + } + return this; + } + validate() { + let valid = true; + const valueSize = this.getValueSize(); + if (valueSize - Math.floor(valueSize) !== 0) { + console.error("THREE.KeyframeTrack: Invalid value size in track.", this); + valid = false; + } + const times = this.times, values = this.values, nKeys = times.length; + if (nKeys === 0) { + console.error("THREE.KeyframeTrack: Track is empty.", this); + valid = false; + } + let prevTime = null; + for (let i = 0; i !== nKeys; i++) { + const currTime = times[i]; + if (typeof currTime === "number" && isNaN(currTime)) { + console.error("THREE.KeyframeTrack: Time is not a valid number.", this, i, currTime); + valid = false; + break; + } + if (prevTime !== null && prevTime > currTime) { + console.error("THREE.KeyframeTrack: Out of order keys.", this, i, currTime, prevTime); + valid = false; + break; + } + prevTime = currTime; + } + if (values !== void 0) { + if (isTypedArray(values)) { + for (let i = 0, n = values.length; i !== n; ++i) { + const value = values[i]; + if (isNaN(value)) { + console.error("THREE.KeyframeTrack: Value is not a valid number.", this, i, value); + valid = false; + break; + } + } + } + } + return valid; + } + optimize() { + const times = arraySlice(this.times), values = arraySlice(this.values), stride = this.getValueSize(), smoothInterpolation = this.getInterpolation() === InterpolateSmooth, lastIndex = times.length - 1; + let writeIndex = 1; + for (let i = 1; i < lastIndex; ++i) { + let keep = false; + const time = times[i]; + const timeNext = times[i + 1]; + if (time !== timeNext && (i !== 1 || time !== times[0])) { + if (!smoothInterpolation) { + const offset = i * stride, offsetP = offset - stride, offsetN = offset + stride; + for (let j = 0; j !== stride; ++j) { + const value = values[offset + j]; + if (value !== values[offsetP + j] || value !== values[offsetN + j]) { + keep = true; + break; + } + } + } else { + keep = true; + } + } + if (keep) { + if (i !== writeIndex) { + times[writeIndex] = times[i]; + const readOffset = i * stride, writeOffset = writeIndex * stride; + for (let j = 0; j !== stride; ++j) { + values[writeOffset + j] = values[readOffset + j]; + } + } + ++writeIndex; + } + } + if (lastIndex > 0) { + times[writeIndex] = times[lastIndex]; + for (let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++j) { + values[writeOffset + j] = values[readOffset + j]; + } + ++writeIndex; + } + if (writeIndex !== times.length) { + this.times = arraySlice(times, 0, writeIndex); + this.values = arraySlice(values, 0, writeIndex * stride); + } else { + this.times = times; + this.values = values; + } + return this; + } + clone() { + const times = arraySlice(this.times, 0); + const values = arraySlice(this.values, 0); + const TypedKeyframeTrack = this.constructor; + const track = new TypedKeyframeTrack(this.name, times, values); + track.createInterpolant = this.createInterpolant; + return track; + } +}; +KeyframeTrack.prototype.TimeBufferType = Float32Array; +KeyframeTrack.prototype.ValueBufferType = Float32Array; +KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; +var BooleanKeyframeTrack = class extends KeyframeTrack { +}; +BooleanKeyframeTrack.prototype.ValueTypeName = "bool"; +BooleanKeyframeTrack.prototype.ValueBufferType = Array; +BooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; +BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = void 0; +BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0; +var ColorKeyframeTrack = class extends KeyframeTrack { +}; +ColorKeyframeTrack.prototype.ValueTypeName = "color"; +var NumberKeyframeTrack = class extends KeyframeTrack { +}; +NumberKeyframeTrack.prototype.ValueTypeName = "number"; +var QuaternionLinearInterpolant = class extends Interpolant { + constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { + super(parameterPositions, sampleValues, sampleSize, resultBuffer); + } + interpolate_(i1, t0, t, t1) { + const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, alpha = (t - t0) / (t1 - t0); + let offset = i1 * stride; + for (let end = offset + stride; offset !== end; offset += 4) { + Quaternion.slerpFlat(result, 0, values, offset - stride, values, offset, alpha); + } + return result; + } +}; +var QuaternionKeyframeTrack = class extends KeyframeTrack { + InterpolantFactoryMethodLinear(result) { + return new QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), result); + } +}; +QuaternionKeyframeTrack.prototype.ValueTypeName = "quaternion"; +QuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; +QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0; +var StringKeyframeTrack = class extends KeyframeTrack { +}; +StringKeyframeTrack.prototype.ValueTypeName = "string"; +StringKeyframeTrack.prototype.ValueBufferType = Array; +StringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; +StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = void 0; +StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0; +var VectorKeyframeTrack = class extends KeyframeTrack { +}; +VectorKeyframeTrack.prototype.ValueTypeName = "vector"; +var Cache = { + enabled: false, + files: {}, + add: function(key, file) { + if (this.enabled === false) + return; + this.files[key] = file; + }, + get: function(key) { + if (this.enabled === false) + return; + return this.files[key]; + }, + remove: function(key) { + delete this.files[key]; + }, + clear: function() { + this.files = {}; + } +}; +var LoadingManager = class { + constructor(onLoad, onProgress, onError) { + const scope = this; + let isLoading = false; + let itemsLoaded = 0; + let itemsTotal = 0; + let urlModifier = void 0; + const handlers = []; + this.onStart = void 0; + this.onLoad = onLoad; + this.onProgress = onProgress; + this.onError = onError; + this.itemStart = function(url) { + itemsTotal++; + if (isLoading === false) { + if (scope.onStart !== void 0) { + scope.onStart(url, itemsLoaded, itemsTotal); + } + } + isLoading = true; + }; + this.itemEnd = function(url) { + itemsLoaded++; + if (scope.onProgress !== void 0) { + scope.onProgress(url, itemsLoaded, itemsTotal); + } + if (itemsLoaded === itemsTotal) { + isLoading = false; + if (scope.onLoad !== void 0) { + scope.onLoad(); + } + } + }; + this.itemError = function(url) { + if (scope.onError !== void 0) { + scope.onError(url); + } + }; + this.resolveURL = function(url) { + if (urlModifier) { + return urlModifier(url); + } + return url; + }; + this.setURLModifier = function(transform) { + urlModifier = transform; + return this; + }; + this.addHandler = function(regex, loader) { + handlers.push(regex, loader); + return this; + }; + this.removeHandler = function(regex) { + const index5 = handlers.indexOf(regex); + if (index5 !== -1) { + handlers.splice(index5, 2); + } + return this; + }; + this.getHandler = function(file) { + for (let i = 0, l = handlers.length; i < l; i += 2) { + const regex = handlers[i]; + const loader = handlers[i + 1]; + if (regex.global) + regex.lastIndex = 0; + if (regex.test(file)) { + return loader; + } + } + return null; + }; + } +}; +var DefaultLoadingManager = /* @__PURE__ */ new LoadingManager(); +var Loader = class { + constructor(manager) { + this.manager = manager !== void 0 ? manager : DefaultLoadingManager; + this.crossOrigin = "anonymous"; + this.withCredentials = false; + this.path = ""; + this.resourcePath = ""; + this.requestHeader = {}; + } + load() { + } + loadAsync(url, onProgress) { + const scope = this; + return new Promise(function(resolve, reject) { + scope.load(url, resolve, onProgress, reject); + }); + } + parse() { + } + setCrossOrigin(crossOrigin) { + this.crossOrigin = crossOrigin; + return this; + } + setWithCredentials(value) { + this.withCredentials = value; + return this; + } + setPath(path) { + this.path = path; + return this; + } + setResourcePath(resourcePath) { + this.resourcePath = resourcePath; + return this; + } + setRequestHeader(requestHeader) { + this.requestHeader = requestHeader; + return this; + } +}; +var ImageLoader = class extends Loader { + constructor(manager) { + super(manager); + } + load(url, onLoad, onProgress, onError) { + if (this.path !== void 0) + url = this.path + url; + url = this.manager.resolveURL(url); + const scope = this; + const cached = Cache.get(url); + if (cached !== void 0) { + scope.manager.itemStart(url); + setTimeout(function() { + if (onLoad) + onLoad(cached); + scope.manager.itemEnd(url); + }, 0); + return cached; + } + const image = createElementNS("img"); + function onImageLoad() { + removeEventListeners(); + Cache.add(url, this); + if (onLoad) + onLoad(this); + scope.manager.itemEnd(url); + } + function onImageError(event) { + removeEventListeners(); + if (onError) + onError(event); + scope.manager.itemError(url); + scope.manager.itemEnd(url); + } + function removeEventListeners() { + image.removeEventListener("load", onImageLoad, false); + image.removeEventListener("error", onImageError, false); + } + image.addEventListener("load", onImageLoad, false); + image.addEventListener("error", onImageError, false); + if (url.slice(0, 5) !== "data:") { + if (this.crossOrigin !== void 0) + image.crossOrigin = this.crossOrigin; + } + scope.manager.itemStart(url); + image.src = url; + return image; + } +}; +var TextureLoader = class extends Loader { + constructor(manager) { + super(manager); + } + load(url, onLoad, onProgress, onError) { + const texture = new Texture(); + const loader = new ImageLoader(this.manager); + loader.setCrossOrigin(this.crossOrigin); + loader.setPath(this.path); + loader.load(url, function(image) { + texture.image = image; + texture.needsUpdate = true; + if (onLoad !== void 0) { + onLoad(texture); + } + }, onProgress, onError); + return texture; + } +}; +var Light = class extends Object3D { + constructor(color, intensity = 1) { + super(); + this.isLight = true; + this.type = "Light"; + this.color = new Color(color); + this.intensity = intensity; + } + dispose() { + } + copy(source, recursive) { + super.copy(source, recursive); + this.color.copy(source.color); + this.intensity = source.intensity; + return this; + } + toJSON(meta) { + const data = super.toJSON(meta); + data.object.color = this.color.getHex(); + data.object.intensity = this.intensity; + if (this.groundColor !== void 0) + data.object.groundColor = this.groundColor.getHex(); + if (this.distance !== void 0) + data.object.distance = this.distance; + if (this.angle !== void 0) + data.object.angle = this.angle; + if (this.decay !== void 0) + data.object.decay = this.decay; + if (this.penumbra !== void 0) + data.object.penumbra = this.penumbra; + if (this.shadow !== void 0) + data.object.shadow = this.shadow.toJSON(); + return data; + } +}; +var _projScreenMatrix$1 = /* @__PURE__ */ new Matrix4(); +var _lightPositionWorld$1 = /* @__PURE__ */ new Vector3(); +var _lookTarget$1 = /* @__PURE__ */ new Vector3(); +var LightShadow = class { + constructor(camera3) { + this.camera = camera3; + this.bias = 0; + this.normalBias = 0; + this.radius = 1; + this.blurSamples = 8; + this.mapSize = new Vector2(512, 512); + this.map = null; + this.mapPass = null; + this.matrix = new Matrix4(); + this.autoUpdate = true; + this.needsUpdate = false; + this._frustum = new Frustum(); + this._frameExtents = new Vector2(1, 1); + this._viewportCount = 1; + this._viewports = [ + new Vector4(0, 0, 1, 1) + ]; + } + getViewportCount() { + return this._viewportCount; + } + getFrustum() { + return this._frustum; + } + updateMatrices(light) { + const shadowCamera = this.camera; + const shadowMatrix = this.matrix; + _lightPositionWorld$1.setFromMatrixPosition(light.matrixWorld); + shadowCamera.position.copy(_lightPositionWorld$1); + _lookTarget$1.setFromMatrixPosition(light.target.matrixWorld); + shadowCamera.lookAt(_lookTarget$1); + shadowCamera.updateMatrixWorld(); + _projScreenMatrix$1.multiplyMatrices(shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse); + this._frustum.setFromProjectionMatrix(_projScreenMatrix$1); + shadowMatrix.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1); + shadowMatrix.multiply(shadowCamera.projectionMatrix); + shadowMatrix.multiply(shadowCamera.matrixWorldInverse); + } + getViewport(viewportIndex) { + return this._viewports[viewportIndex]; + } + getFrameExtents() { + return this._frameExtents; + } + dispose() { + if (this.map) { + this.map.dispose(); + } + if (this.mapPass) { + this.mapPass.dispose(); + } + } + copy(source) { + this.camera = source.camera.clone(); + this.bias = source.bias; + this.radius = source.radius; + this.mapSize.copy(source.mapSize); + return this; + } + clone() { + return new this.constructor().copy(this); + } + toJSON() { + const object = {}; + if (this.bias !== 0) + object.bias = this.bias; + if (this.normalBias !== 0) + object.normalBias = this.normalBias; + if (this.radius !== 1) + object.radius = this.radius; + if (this.mapSize.x !== 512 || this.mapSize.y !== 512) + object.mapSize = this.mapSize.toArray(); + object.camera = this.camera.toJSON(false).object; + delete object.camera.matrix; + return object; + } +}; +var DirectionalLightShadow = class extends LightShadow { + constructor() { + super(new OrthographicCamera(-5, 5, 5, -5, 0.5, 500)); + this.isDirectionalLightShadow = true; + } +}; +var DirectionalLight = class extends Light { + constructor(color, intensity) { + super(color, intensity); + this.isDirectionalLight = true; + this.type = "DirectionalLight"; + this.position.copy(Object3D.DefaultUp); + this.updateMatrix(); + this.target = new Object3D(); + this.shadow = new DirectionalLightShadow(); + } + dispose() { + this.shadow.dispose(); + } + copy(source) { + super.copy(source); + this.target = source.target.clone(); + this.shadow = source.shadow.clone(); + return this; + } +}; +var AmbientLight = class extends Light { + constructor(color, intensity) { + super(color, intensity); + this.isAmbientLight = true; + this.type = "AmbientLight"; + } +}; +var Clock = class { + constructor(autoStart = true) { + this.autoStart = autoStart; + this.startTime = 0; + this.oldTime = 0; + this.elapsedTime = 0; + this.running = false; + } + start() { + this.startTime = now(); + this.oldTime = this.startTime; + this.elapsedTime = 0; + this.running = true; + } + stop() { + this.getElapsedTime(); + this.running = false; + this.autoStart = false; + } + getElapsedTime() { + this.getDelta(); + return this.elapsedTime; + } + getDelta() { + let diff = 0; + if (this.autoStart && !this.running) { + this.start(); + return 0; + } + if (this.running) { + const newTime = now(); + diff = (newTime - this.oldTime) / 1e3; + this.oldTime = newTime; + this.elapsedTime += diff; + } + return diff; + } +}; +function now() { + return (typeof performance === "undefined" ? Date : performance).now(); +} +var _RESERVED_CHARS_RE = "\\[\\]\\.:\\/"; +var _reservedRe = new RegExp("[" + _RESERVED_CHARS_RE + "]", "g"); +var _wordChar = "[^" + _RESERVED_CHARS_RE + "]"; +var _wordCharOrDot = "[^" + _RESERVED_CHARS_RE.replace("\\.", "") + "]"; +var _directoryRe = /* @__PURE__ */ /((?:WC+[\/:])*)/.source.replace("WC", _wordChar); +var _nodeRe = /* @__PURE__ */ /(WCOD+)?/.source.replace("WCOD", _wordCharOrDot); +var _objectRe = /* @__PURE__ */ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", _wordChar); +var _propertyRe = /* @__PURE__ */ /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", _wordChar); +var _trackRe = new RegExp("^" + _directoryRe + _nodeRe + _objectRe + _propertyRe + "$"); +var _supportedObjectNames = ["material", "materials", "bones"]; +var Composite = class { + constructor(targetGroup, path, optionalParsedPath) { + const parsedPath = optionalParsedPath || PropertyBinding.parseTrackName(path); + this._targetGroup = targetGroup; + this._bindings = targetGroup.subscribe_(path, parsedPath); + } + getValue(array, offset) { + this.bind(); + const firstValidIndex = this._targetGroup.nCachedObjects_, binding = this._bindings[firstValidIndex]; + if (binding !== void 0) + binding.getValue(array, offset); + } + setValue(array, offset) { + const bindings = this._bindings; + for (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) { + bindings[i].setValue(array, offset); + } + } + bind() { + const bindings = this._bindings; + for (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) { + bindings[i].bind(); + } + } + unbind() { + const bindings = this._bindings; + for (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) { + bindings[i].unbind(); + } + } +}; +var PropertyBinding = class { + constructor(rootNode, path, parsedPath) { + this.path = path; + this.parsedPath = parsedPath || PropertyBinding.parseTrackName(path); + this.node = PropertyBinding.findNode(rootNode, this.parsedPath.nodeName) || rootNode; + this.rootNode = rootNode; + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + } + static create(root, path, parsedPath) { + if (!(root && root.isAnimationObjectGroup)) { + return new PropertyBinding(root, path, parsedPath); + } else { + return new PropertyBinding.Composite(root, path, parsedPath); + } + } + static sanitizeNodeName(name) { + return name.replace(/\s/g, "_").replace(_reservedRe, ""); + } + static parseTrackName(trackName) { + const matches = _trackRe.exec(trackName); + if (matches === null) { + throw new Error("PropertyBinding: Cannot parse trackName: " + trackName); + } + const results = { + nodeName: matches[2], + objectName: matches[3], + objectIndex: matches[4], + propertyName: matches[5], + propertyIndex: matches[6] + }; + const lastDot = results.nodeName && results.nodeName.lastIndexOf("."); + if (lastDot !== void 0 && lastDot !== -1) { + const objectName = results.nodeName.substring(lastDot + 1); + if (_supportedObjectNames.indexOf(objectName) !== -1) { + results.nodeName = results.nodeName.substring(0, lastDot); + results.objectName = objectName; + } + } + if (results.propertyName === null || results.propertyName.length === 0) { + throw new Error("PropertyBinding: can not parse propertyName from trackName: " + trackName); + } + return results; + } + static findNode(root, nodeName) { + if (nodeName === void 0 || nodeName === "" || nodeName === "." || nodeName === -1 || nodeName === root.name || nodeName === root.uuid) { + return root; + } + if (root.skeleton) { + const bone = root.skeleton.getBoneByName(nodeName); + if (bone !== void 0) { + return bone; + } + } + if (root.children) { + const searchNodeSubtree = function(children) { + for (let i = 0; i < children.length; i++) { + const childNode = children[i]; + if (childNode.name === nodeName || childNode.uuid === nodeName) { + return childNode; + } + const result = searchNodeSubtree(childNode.children); + if (result) + return result; + } + return null; + }; + const subTreeNode = searchNodeSubtree(root.children); + if (subTreeNode) { + return subTreeNode; + } + } + return null; + } + _getValue_unavailable() { + } + _setValue_unavailable() { + } + _getValue_direct(buffer, offset) { + buffer[offset] = this.targetObject[this.propertyName]; + } + _getValue_array(buffer, offset) { + const source = this.resolvedProperty; + for (let i = 0, n = source.length; i !== n; ++i) { + buffer[offset++] = source[i]; + } + } + _getValue_arrayElement(buffer, offset) { + buffer[offset] = this.resolvedProperty[this.propertyIndex]; + } + _getValue_toArray(buffer, offset) { + this.resolvedProperty.toArray(buffer, offset); + } + _setValue_direct(buffer, offset) { + this.targetObject[this.propertyName] = buffer[offset]; + } + _setValue_direct_setNeedsUpdate(buffer, offset) { + this.targetObject[this.propertyName] = buffer[offset]; + this.targetObject.needsUpdate = true; + } + _setValue_direct_setMatrixWorldNeedsUpdate(buffer, offset) { + this.targetObject[this.propertyName] = buffer[offset]; + this.targetObject.matrixWorldNeedsUpdate = true; + } + _setValue_array(buffer, offset) { + const dest = this.resolvedProperty; + for (let i = 0, n = dest.length; i !== n; ++i) { + dest[i] = buffer[offset++]; + } + } + _setValue_array_setNeedsUpdate(buffer, offset) { + const dest = this.resolvedProperty; + for (let i = 0, n = dest.length; i !== n; ++i) { + dest[i] = buffer[offset++]; + } + this.targetObject.needsUpdate = true; + } + _setValue_array_setMatrixWorldNeedsUpdate(buffer, offset) { + const dest = this.resolvedProperty; + for (let i = 0, n = dest.length; i !== n; ++i) { + dest[i] = buffer[offset++]; + } + this.targetObject.matrixWorldNeedsUpdate = true; + } + _setValue_arrayElement(buffer, offset) { + this.resolvedProperty[this.propertyIndex] = buffer[offset]; + } + _setValue_arrayElement_setNeedsUpdate(buffer, offset) { + this.resolvedProperty[this.propertyIndex] = buffer[offset]; + this.targetObject.needsUpdate = true; + } + _setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer, offset) { + this.resolvedProperty[this.propertyIndex] = buffer[offset]; + this.targetObject.matrixWorldNeedsUpdate = true; + } + _setValue_fromArray(buffer, offset) { + this.resolvedProperty.fromArray(buffer, offset); + } + _setValue_fromArray_setNeedsUpdate(buffer, offset) { + this.resolvedProperty.fromArray(buffer, offset); + this.targetObject.needsUpdate = true; + } + _setValue_fromArray_setMatrixWorldNeedsUpdate(buffer, offset) { + this.resolvedProperty.fromArray(buffer, offset); + this.targetObject.matrixWorldNeedsUpdate = true; + } + _getValue_unbound(targetArray, offset) { + this.bind(); + this.getValue(targetArray, offset); + } + _setValue_unbound(sourceArray, offset) { + this.bind(); + this.setValue(sourceArray, offset); + } + bind() { + let targetObject = this.node; + const parsedPath = this.parsedPath; + const objectName = parsedPath.objectName; + const propertyName = parsedPath.propertyName; + let propertyIndex = parsedPath.propertyIndex; + if (!targetObject) { + targetObject = PropertyBinding.findNode(this.rootNode, parsedPath.nodeName) || this.rootNode; + this.node = targetObject; + } + this.getValue = this._getValue_unavailable; + this.setValue = this._setValue_unavailable; + if (!targetObject) { + console.error("THREE.PropertyBinding: Trying to update node for track: " + this.path + " but it wasn't found."); + return; + } + if (objectName) { + let objectIndex = parsedPath.objectIndex; + switch (objectName) { + case "materials": + if (!targetObject.material) { + console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this); + return; + } + if (!targetObject.material.materials) { + console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.", this); + return; + } + targetObject = targetObject.material.materials; + break; + case "bones": + if (!targetObject.skeleton) { + console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this); + return; + } + targetObject = targetObject.skeleton.bones; + for (let i = 0; i < targetObject.length; i++) { + if (targetObject[i].name === objectIndex) { + objectIndex = i; + break; + } + } + break; + default: + if (targetObject[objectName] === void 0) { + console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this); + return; + } + targetObject = targetObject[objectName]; + } + if (objectIndex !== void 0) { + if (targetObject[objectIndex] === void 0) { + console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, targetObject); + return; + } + targetObject = targetObject[objectIndex]; + } + } + const nodeProperty = targetObject[propertyName]; + if (nodeProperty === void 0) { + const nodeName = parsedPath.nodeName; + console.error("THREE.PropertyBinding: Trying to update property for track: " + nodeName + "." + propertyName + " but it wasn't found.", targetObject); + return; + } + let versioning = this.Versioning.None; + this.targetObject = targetObject; + if (targetObject.needsUpdate !== void 0) { + versioning = this.Versioning.NeedsUpdate; + } else if (targetObject.matrixWorldNeedsUpdate !== void 0) { + versioning = this.Versioning.MatrixWorldNeedsUpdate; + } + let bindingType = this.BindingType.Direct; + if (propertyIndex !== void 0) { + if (propertyName === "morphTargetInfluences") { + if (!targetObject.geometry) { + console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this); + return; + } + if (!targetObject.geometry.morphAttributes) { + console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this); + return; + } + if (targetObject.morphTargetDictionary[propertyIndex] !== void 0) { + propertyIndex = targetObject.morphTargetDictionary[propertyIndex]; + } + } + bindingType = this.BindingType.ArrayElement; + this.resolvedProperty = nodeProperty; + this.propertyIndex = propertyIndex; + } else if (nodeProperty.fromArray !== void 0 && nodeProperty.toArray !== void 0) { + bindingType = this.BindingType.HasFromToArray; + this.resolvedProperty = nodeProperty; + } else if (Array.isArray(nodeProperty)) { + bindingType = this.BindingType.EntireArray; + this.resolvedProperty = nodeProperty; + } else { + this.propertyName = propertyName; + } + this.getValue = this.GetterByBindingType[bindingType]; + this.setValue = this.SetterByBindingTypeAndVersioning[bindingType][versioning]; + } + unbind() { + this.node = null; + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + } +}; +PropertyBinding.Composite = Composite; +PropertyBinding.prototype.BindingType = { + Direct: 0, + EntireArray: 1, + ArrayElement: 2, + HasFromToArray: 3 +}; +PropertyBinding.prototype.Versioning = { + None: 0, + NeedsUpdate: 1, + MatrixWorldNeedsUpdate: 2 +}; +PropertyBinding.prototype.GetterByBindingType = [ + PropertyBinding.prototype._getValue_direct, + PropertyBinding.prototype._getValue_array, + PropertyBinding.prototype._getValue_arrayElement, + PropertyBinding.prototype._getValue_toArray +]; +PropertyBinding.prototype.SetterByBindingTypeAndVersioning = [ + [ + PropertyBinding.prototype._setValue_direct, + PropertyBinding.prototype._setValue_direct_setNeedsUpdate, + PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate + ], + [ + PropertyBinding.prototype._setValue_array, + PropertyBinding.prototype._setValue_array_setNeedsUpdate, + PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate + ], + [ + PropertyBinding.prototype._setValue_arrayElement, + PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate, + PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate + ], + [ + PropertyBinding.prototype._setValue_fromArray, + PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate, + PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate + ] +]; +var _controlInterpolantsResultBuffer = new Float32Array(1); +var Raycaster = class { + constructor(origin, direction, near = 0, far = Infinity) { + this.ray = new Ray(origin, direction); + this.near = near; + this.far = far; + this.camera = null; + this.layers = new Layers(); + this.params = { + Mesh: {}, + Line: { threshold: 1 }, + LOD: {}, + Points: { threshold: 1 }, + Sprite: {} + }; + } + set(origin, direction) { + this.ray.set(origin, direction); + } + setFromCamera(coords, camera3) { + if (camera3.isPerspectiveCamera) { + this.ray.origin.setFromMatrixPosition(camera3.matrixWorld); + this.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera3).sub(this.ray.origin).normalize(); + this.camera = camera3; + } else if (camera3.isOrthographicCamera) { + this.ray.origin.set(coords.x, coords.y, (camera3.near + camera3.far) / (camera3.near - camera3.far)).unproject(camera3); + this.ray.direction.set(0, 0, -1).transformDirection(camera3.matrixWorld); + this.camera = camera3; + } else { + console.error("THREE.Raycaster: Unsupported camera type: " + camera3.type); + } + } + intersectObject(object, recursive = true, intersects = []) { + intersectObject(object, this, intersects, recursive); + intersects.sort(ascSort); + return intersects; + } + intersectObjects(objects, recursive = true, intersects = []) { + for (let i = 0, l = objects.length; i < l; i++) { + intersectObject(objects[i], this, intersects, recursive); + } + intersects.sort(ascSort); + return intersects; + } +}; +function ascSort(a2, b) { + return a2.distance - b.distance; +} +function intersectObject(object, raycaster, intersects, recursive) { + if (object.layers.test(raycaster.layers)) { + object.raycast(raycaster, intersects); + } + if (recursive === true) { + const children = object.children; + for (let i = 0, l = children.length; i < l; i++) { + intersectObject(children[i], raycaster, intersects, true); + } + } +} +var Spherical = class { + constructor(radius = 1, phi = 0, theta = 0) { + this.radius = radius; + this.phi = phi; + this.theta = theta; + return this; + } + set(radius, phi, theta) { + this.radius = radius; + this.phi = phi; + this.theta = theta; + return this; + } + copy(other) { + this.radius = other.radius; + this.phi = other.phi; + this.theta = other.theta; + return this; + } + makeSafe() { + const EPS = 1e-6; + this.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi)); + return this; + } + setFromVector3(v) { + return this.setFromCartesianCoords(v.x, v.y, v.z); + } + setFromCartesianCoords(x2, y2, z2) { + this.radius = Math.sqrt(x2 * x2 + y2 * y2 + z2 * z2); + if (this.radius === 0) { + this.theta = 0; + this.phi = 0; + } else { + this.theta = Math.atan2(x2, z2); + this.phi = Math.acos(clamp(y2 / this.radius, -1, 1)); + } + return this; + } + clone() { + return new this.constructor().copy(this); + } +}; +if (typeof __THREE_DEVTOOLS__ !== "undefined") { + __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { + revision: REVISION + } })); +} +if (typeof window !== "undefined") { + if (window.__THREE__) { + console.warn("WARNING: Multiple instances of Three.js being imported."); + } else { + window.__THREE__ = REVISION; + } +} + +// node_modules/three/examples/jsm/controls/DragControls.js +var _plane = new Plane(); +var _raycaster = new Raycaster(); +var _pointer = new Vector2(); +var _offset2 = new Vector3(); +var _intersection = new Vector3(); +var _worldPosition = new Vector3(); +var _inverseMatrix = new Matrix4(); +var DragControls = class extends EventDispatcher { + constructor(_objects, _camera3, _domElement) { + super(); + _domElement.style.touchAction = "none"; + let _selected = null, _hovered = null; + const _intersections = []; + const scope = this; + function activate() { + _domElement.addEventListener("pointermove", onPointerMove); + _domElement.addEventListener("pointerdown", onPointerDown); + _domElement.addEventListener("pointerup", onPointerCancel); + _domElement.addEventListener("pointerleave", onPointerCancel); + } + function deactivate() { + _domElement.removeEventListener("pointermove", onPointerMove); + _domElement.removeEventListener("pointerdown", onPointerDown); + _domElement.removeEventListener("pointerup", onPointerCancel); + _domElement.removeEventListener("pointerleave", onPointerCancel); + _domElement.style.cursor = ""; + } + function dispose() { + deactivate(); + } + function getObjects() { + return _objects; + } + function getRaycaster() { + return _raycaster; + } + function onPointerMove(event) { + if (scope.enabled === false) + return; + updatePointer(event); + _raycaster.setFromCamera(_pointer, _camera3); + if (_selected) { + if (_raycaster.ray.intersectPlane(_plane, _intersection)) { + _selected.position.copy(_intersection.sub(_offset2).applyMatrix4(_inverseMatrix)); + } + scope.dispatchEvent({ type: "drag", object: _selected }); + return; + } + if (event.pointerType === "mouse" || event.pointerType === "pen") { + _intersections.length = 0; + _raycaster.setFromCamera(_pointer, _camera3); + _raycaster.intersectObjects(_objects, true, _intersections); + if (_intersections.length > 0) { + const object = _intersections[0].object; + _plane.setFromNormalAndCoplanarPoint(_camera3.getWorldDirection(_plane.normal), _worldPosition.setFromMatrixPosition(object.matrixWorld)); + if (_hovered !== object && _hovered !== null) { + scope.dispatchEvent({ type: "hoveroff", object: _hovered }); + _domElement.style.cursor = "auto"; + _hovered = null; + } + if (_hovered !== object) { + scope.dispatchEvent({ type: "hoveron", object }); + _domElement.style.cursor = "pointer"; + _hovered = object; + } + } else { + if (_hovered !== null) { + scope.dispatchEvent({ type: "hoveroff", object: _hovered }); + _domElement.style.cursor = "auto"; + _hovered = null; + } + } + } + } + function onPointerDown(event) { + if (scope.enabled === false) + return; + updatePointer(event); + _intersections.length = 0; + _raycaster.setFromCamera(_pointer, _camera3); + _raycaster.intersectObjects(_objects, true, _intersections); + if (_intersections.length > 0) { + _selected = scope.transformGroup === true ? _objects[0] : _intersections[0].object; + _plane.setFromNormalAndCoplanarPoint(_camera3.getWorldDirection(_plane.normal), _worldPosition.setFromMatrixPosition(_selected.matrixWorld)); + if (_raycaster.ray.intersectPlane(_plane, _intersection)) { + _inverseMatrix.copy(_selected.parent.matrixWorld).invert(); + _offset2.copy(_intersection).sub(_worldPosition.setFromMatrixPosition(_selected.matrixWorld)); + } + _domElement.style.cursor = "move"; + scope.dispatchEvent({ type: "dragstart", object: _selected }); + } + } + function onPointerCancel() { + if (scope.enabled === false) + return; + if (_selected) { + scope.dispatchEvent({ type: "dragend", object: _selected }); + _selected = null; + } + _domElement.style.cursor = _hovered ? "pointer" : "auto"; + } + function updatePointer(event) { + const rect = _domElement.getBoundingClientRect(); + _pointer.x = (event.clientX - rect.left) / rect.width * 2 - 1; + _pointer.y = -(event.clientY - rect.top) / rect.height * 2 + 1; + } + activate(); + this.enabled = true; + this.transformGroup = false; + this.activate = activate; + this.deactivate = deactivate; + this.dispose = dispose; + this.getObjects = getObjects; + this.getRaycaster = getRaycaster; + } +}; + +// node_modules/d3-force-3d/src/center.js +function center_default(x2, y2, z2) { + var nodes, strength = 1; + if (x2 == null) + x2 = 0; + if (y2 == null) + y2 = 0; + if (z2 == null) + z2 = 0; + function force() { + var i, n = nodes.length, node, sx = 0, sy = 0, sz = 0; + for (i = 0; i < n; ++i) { + node = nodes[i], sx += node.x || 0, sy += node.y || 0, sz += node.z || 0; + } + for (sx = (sx / n - x2) * strength, sy = (sy / n - y2) * strength, sz = (sz / n - z2) * strength, i = 0; i < n; ++i) { + node = nodes[i]; + if (sx) { + node.x -= sx; + } + if (sy) { + node.y -= sy; + } + if (sz) { + node.z -= sz; + } + } + } + force.initialize = function(_) { + nodes = _; + }; + force.x = function(_) { + return arguments.length ? (x2 = +_, force) : x2; + }; + force.y = function(_) { + return arguments.length ? (y2 = +_, force) : y2; + }; + force.z = function(_) { + return arguments.length ? (z2 = +_, force) : z2; + }; + force.strength = function(_) { + return arguments.length ? (strength = +_, force) : strength; + }; + return force; +} + +// node_modules/d3-binarytree/src/add.js +function add_default(d) { + var x2 = +this._x.call(null, d); + return add(this.cover(x2), x2, d); +} +function add(tree, x2, d) { + if (isNaN(x2)) + return tree; + var parent, node = tree._root, leaf = { data: d }, x0 = tree._x0, x1 = tree._x1, xm, xp, right, i, j; + if (!node) + return tree._root = leaf, tree; + while (node.length) { + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (parent = node, !(node = node[i = +right])) + return parent[i] = leaf, tree; + } + xp = +tree._x.call(null, node.data); + if (x2 === xp) + return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree; + do { + parent = parent ? parent[i] = new Array(2) : tree._root = new Array(2); + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + } while ((i = +right) === (j = +(xp >= xm))); + return parent[j] = node, parent[i] = leaf, tree; +} +function addAll(data) { + var i, n = data.length, x2, xz = new Array(n), x0 = Infinity, x1 = -Infinity; + for (i = 0; i < n; ++i) { + if (isNaN(x2 = +this._x.call(null, data[i]))) + continue; + xz[i] = x2; + if (x2 < x0) + x0 = x2; + if (x2 > x1) + x1 = x2; + } + if (x0 > x1) + return this; + this.cover(x0).cover(x1); + for (i = 0; i < n; ++i) { + add(this, xz[i], data[i]); + } + return this; +} + +// node_modules/d3-binarytree/src/cover.js +function cover_default(x2) { + if (isNaN(x2 = +x2)) + return this; + var x0 = this._x0, x1 = this._x1; + if (isNaN(x0)) { + x1 = (x0 = Math.floor(x2)) + 1; + } else { + var z2 = x1 - x0 || 1, node = this._root, parent, i; + while (x0 > x2 || x2 >= x1) { + i = +(x2 < x0); + parent = new Array(2), parent[i] = node, node = parent, z2 *= 2; + switch (i) { + case 0: + x1 = x0 + z2; + break; + case 1: + x0 = x1 - z2; + break; + } + } + if (this._root && this._root.length) + this._root = node; + } + this._x0 = x0; + this._x1 = x1; + return this; +} + +// node_modules/d3-binarytree/src/data.js +function data_default() { + var data = []; + this.visit(function(node) { + if (!node.length) + do + data.push(node.data); + while (node = node.next); + }); + return data; +} + +// node_modules/d3-binarytree/src/extent.js +function extent_default(_) { + return arguments.length ? this.cover(+_[0][0]).cover(+_[1][0]) : isNaN(this._x0) ? void 0 : [[this._x0], [this._x1]]; +} + +// node_modules/d3-binarytree/src/half.js +function half_default(node, x0, x1) { + this.node = node; + this.x0 = x0; + this.x1 = x1; +} + +// node_modules/d3-binarytree/src/find.js +function find_default(x2, radius) { + var data, x0 = this._x0, x1, x22, x3 = this._x1, halves = [], node = this._root, q, i; + if (node) + halves.push(new half_default(node, x0, x3)); + if (radius == null) + radius = Infinity; + else { + x0 = x2 - radius; + x3 = x2 + radius; + } + while (q = halves.pop()) { + if (!(node = q.node) || (x1 = q.x0) > x3 || (x22 = q.x1) < x0) + continue; + if (node.length) { + var xm = (x1 + x22) / 2; + halves.push(new half_default(node[1], xm, x22), new half_default(node[0], x1, xm)); + if (i = +(x2 >= xm)) { + q = halves[halves.length - 1]; + halves[halves.length - 1] = halves[halves.length - 1 - i]; + halves[halves.length - 1 - i] = q; + } + } else { + var d = Math.abs(x2 - +this._x.call(null, node.data)); + if (d < radius) { + radius = d; + x0 = x2 - d; + x3 = x2 + d; + data = node.data; + } + } + } + return data; +} + +// node_modules/d3-binarytree/src/remove.js +function remove_default(d) { + if (isNaN(x2 = +this._x.call(null, d))) + return this; + var parent, node = this._root, retainer, previous, next, x0 = this._x0, x1 = this._x1, x2, xm, right, i, j; + if (!node) + return this; + if (node.length) + while (true) { + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (!(parent = node, node = node[i = +right])) + return this; + if (!node.length) + break; + if (parent[i + 1 & 1]) + retainer = parent, j = i; + } + while (node.data !== d) + if (!(previous = node, node = node.next)) + return this; + if (next = node.next) + delete node.next; + if (previous) + return next ? previous.next = next : delete previous.next, this; + if (!parent) + return this._root = next, this; + next ? parent[i] = next : delete parent[i]; + if ((node = parent[0] || parent[1]) && node === (parent[1] || parent[0]) && !node.length) { + if (retainer) + retainer[j] = node; + else + this._root = node; + } + return this; +} +function removeAll(data) { + for (var i = 0, n = data.length; i < n; ++i) + this.remove(data[i]); + return this; +} + +// node_modules/d3-binarytree/src/root.js +function root_default() { + return this._root; +} + +// node_modules/d3-binarytree/src/size.js +function size_default() { + var size = 0; + this.visit(function(node) { + if (!node.length) + do + ++size; + while (node = node.next); + }); + return size; +} + +// node_modules/d3-binarytree/src/visit.js +function visit_default(callback) { + var halves = [], q, node = this._root, child, x0, x1; + if (node) + halves.push(new half_default(node, this._x0, this._x1)); + while (q = halves.pop()) { + if (!callback(node = q.node, x0 = q.x0, x1 = q.x1) && node.length) { + var xm = (x0 + x1) / 2; + if (child = node[1]) + halves.push(new half_default(child, xm, x1)); + if (child = node[0]) + halves.push(new half_default(child, x0, xm)); + } + } + return this; +} + +// node_modules/d3-binarytree/src/visitAfter.js +function visitAfter_default(callback) { + var halves = [], next = [], q; + if (this._root) + halves.push(new half_default(this._root, this._x0, this._x1)); + while (q = halves.pop()) { + var node = q.node; + if (node.length) { + var child, x0 = q.x0, x1 = q.x1, xm = (x0 + x1) / 2; + if (child = node[0]) + halves.push(new half_default(child, x0, xm)); + if (child = node[1]) + halves.push(new half_default(child, xm, x1)); + } + next.push(q); + } + while (q = next.pop()) { + callback(q.node, q.x0, q.x1); + } + return this; +} + +// node_modules/d3-binarytree/src/x.js +function defaultX(d) { + return d[0]; +} +function x_default(_) { + return arguments.length ? (this._x = _, this) : this._x; +} + +// node_modules/d3-binarytree/src/binarytree.js +function binarytree(nodes, x2) { + var tree = new Binarytree(x2 == null ? defaultX : x2, NaN, NaN); + return nodes == null ? tree : tree.addAll(nodes); +} +function Binarytree(x2, x0, x1) { + this._x = x2; + this._x0 = x0; + this._x1 = x1; + this._root = void 0; +} +function leaf_copy(leaf) { + var copy = { data: leaf.data }, next = copy; + while (leaf = leaf.next) + next = next.next = { data: leaf.data }; + return copy; +} +var treeProto = binarytree.prototype = Binarytree.prototype; +treeProto.copy = function() { + var copy = new Binarytree(this._x, this._x0, this._x1), node = this._root, nodes, child; + if (!node) + return copy; + if (!node.length) + return copy._root = leaf_copy(node), copy; + nodes = [{ source: node, target: copy._root = new Array(2) }]; + while (node = nodes.pop()) { + for (var i = 0; i < 2; ++i) { + if (child = node.source[i]) { + if (child.length) + nodes.push({ source: child, target: node.target[i] = new Array(2) }); + else + node.target[i] = leaf_copy(child); + } + } + } + return copy; +}; +treeProto.add = add_default; +treeProto.addAll = addAll; +treeProto.cover = cover_default; +treeProto.data = data_default; +treeProto.extent = extent_default; +treeProto.find = find_default; +treeProto.remove = remove_default; +treeProto.removeAll = removeAll; +treeProto.root = root_default; +treeProto.size = size_default; +treeProto.visit = visit_default; +treeProto.visitAfter = visitAfter_default; +treeProto.x = x_default; + +// node_modules/d3-quadtree/src/add.js +function add_default2(d) { + const x2 = +this._x.call(null, d), y2 = +this._y.call(null, d); + return add2(this.cover(x2, y2), x2, y2, d); +} +function add2(tree, x2, y2, d) { + if (isNaN(x2) || isNaN(y2)) + return tree; + var parent, node = tree._root, leaf = { data: d }, x0 = tree._x0, y0 = tree._y0, x1 = tree._x1, y1 = tree._y1, xm, ym, xp, yp, right, bottom, i, j; + if (!node) + return tree._root = leaf, tree; + while (node.length) { + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (bottom = y2 >= (ym = (y0 + y1) / 2)) + y0 = ym; + else + y1 = ym; + if (parent = node, !(node = node[i = bottom << 1 | right])) + return parent[i] = leaf, tree; + } + xp = +tree._x.call(null, node.data); + yp = +tree._y.call(null, node.data); + if (x2 === xp && y2 === yp) + return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree; + do { + parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4); + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (bottom = y2 >= (ym = (y0 + y1) / 2)) + y0 = ym; + else + y1 = ym; + } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | xp >= xm)); + return parent[j] = node, parent[i] = leaf, tree; +} +function addAll2(data) { + var d, i, n = data.length, x2, y2, xz = new Array(n), yz = new Array(n), x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity; + for (i = 0; i < n; ++i) { + if (isNaN(x2 = +this._x.call(null, d = data[i])) || isNaN(y2 = +this._y.call(null, d))) + continue; + xz[i] = x2; + yz[i] = y2; + if (x2 < x0) + x0 = x2; + if (x2 > x1) + x1 = x2; + if (y2 < y0) + y0 = y2; + if (y2 > y1) + y1 = y2; + } + if (x0 > x1 || y0 > y1) + return this; + this.cover(x0, y0).cover(x1, y1); + for (i = 0; i < n; ++i) { + add2(this, xz[i], yz[i], data[i]); + } + return this; +} + +// node_modules/d3-quadtree/src/cover.js +function cover_default2(x2, y2) { + if (isNaN(x2 = +x2) || isNaN(y2 = +y2)) + return this; + var x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1; + if (isNaN(x0)) { + x1 = (x0 = Math.floor(x2)) + 1; + y1 = (y0 = Math.floor(y2)) + 1; + } else { + var z2 = x1 - x0 || 1, node = this._root, parent, i; + while (x0 > x2 || x2 >= x1 || y0 > y2 || y2 >= y1) { + i = (y2 < y0) << 1 | x2 < x0; + parent = new Array(4), parent[i] = node, node = parent, z2 *= 2; + switch (i) { + case 0: + x1 = x0 + z2, y1 = y0 + z2; + break; + case 1: + x0 = x1 - z2, y1 = y0 + z2; + break; + case 2: + x1 = x0 + z2, y0 = y1 - z2; + break; + case 3: + x0 = x1 - z2, y0 = y1 - z2; + break; + } + } + if (this._root && this._root.length) + this._root = node; + } + this._x0 = x0; + this._y0 = y0; + this._x1 = x1; + this._y1 = y1; + return this; +} + +// node_modules/d3-quadtree/src/data.js +function data_default2() { + var data = []; + this.visit(function(node) { + if (!node.length) + do + data.push(node.data); + while (node = node.next); + }); + return data; +} + +// node_modules/d3-quadtree/src/extent.js +function extent_default2(_) { + return arguments.length ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]]; +} + +// node_modules/d3-quadtree/src/quad.js +function quad_default(node, x0, y0, x1, y1) { + this.node = node; + this.x0 = x0; + this.y0 = y0; + this.x1 = x1; + this.y1 = y1; +} + +// node_modules/d3-quadtree/src/find.js +function find_default2(x2, y2, radius) { + var data, x0 = this._x0, y0 = this._y0, x1, y1, x22, y22, x3 = this._x1, y3 = this._y1, quads = [], node = this._root, q, i; + if (node) + quads.push(new quad_default(node, x0, y0, x3, y3)); + if (radius == null) + radius = Infinity; + else { + x0 = x2 - radius, y0 = y2 - radius; + x3 = x2 + radius, y3 = y2 + radius; + radius *= radius; + } + while (q = quads.pop()) { + if (!(node = q.node) || (x1 = q.x0) > x3 || (y1 = q.y0) > y3 || (x22 = q.x1) < x0 || (y22 = q.y1) < y0) + continue; + if (node.length) { + var xm = (x1 + x22) / 2, ym = (y1 + y22) / 2; + quads.push(new quad_default(node[3], xm, ym, x22, y22), new quad_default(node[2], x1, ym, xm, y22), new quad_default(node[1], xm, y1, x22, ym), new quad_default(node[0], x1, y1, xm, ym)); + if (i = (y2 >= ym) << 1 | x2 >= xm) { + q = quads[quads.length - 1]; + quads[quads.length - 1] = quads[quads.length - 1 - i]; + quads[quads.length - 1 - i] = q; + } + } else { + var dx = x2 - +this._x.call(null, node.data), dy = y2 - +this._y.call(null, node.data), d2 = dx * dx + dy * dy; + if (d2 < radius) { + var d = Math.sqrt(radius = d2); + x0 = x2 - d, y0 = y2 - d; + x3 = x2 + d, y3 = y2 + d; + data = node.data; + } + } + } + return data; +} + +// node_modules/d3-quadtree/src/remove.js +function remove_default2(d) { + if (isNaN(x2 = +this._x.call(null, d)) || isNaN(y2 = +this._y.call(null, d))) + return this; + var parent, node = this._root, retainer, previous, next, x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1, x2, y2, xm, ym, right, bottom, i, j; + if (!node) + return this; + if (node.length) + while (true) { + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (bottom = y2 >= (ym = (y0 + y1) / 2)) + y0 = ym; + else + y1 = ym; + if (!(parent = node, node = node[i = bottom << 1 | right])) + return this; + if (!node.length) + break; + if (parent[i + 1 & 3] || parent[i + 2 & 3] || parent[i + 3 & 3]) + retainer = parent, j = i; + } + while (node.data !== d) + if (!(previous = node, node = node.next)) + return this; + if (next = node.next) + delete node.next; + if (previous) + return next ? previous.next = next : delete previous.next, this; + if (!parent) + return this._root = next, this; + next ? parent[i] = next : delete parent[i]; + if ((node = parent[0] || parent[1] || parent[2] || parent[3]) && node === (parent[3] || parent[2] || parent[1] || parent[0]) && !node.length) { + if (retainer) + retainer[j] = node; + else + this._root = node; + } + return this; +} +function removeAll2(data) { + for (var i = 0, n = data.length; i < n; ++i) + this.remove(data[i]); + return this; +} + +// node_modules/d3-quadtree/src/root.js +function root_default2() { + return this._root; +} + +// node_modules/d3-quadtree/src/size.js +function size_default2() { + var size = 0; + this.visit(function(node) { + if (!node.length) + do + ++size; + while (node = node.next); + }); + return size; +} + +// node_modules/d3-quadtree/src/visit.js +function visit_default2(callback) { + var quads = [], q, node = this._root, child, x0, y0, x1, y1; + if (node) + quads.push(new quad_default(node, this._x0, this._y0, this._x1, this._y1)); + while (q = quads.pop()) { + if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) { + var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; + if (child = node[3]) + quads.push(new quad_default(child, xm, ym, x1, y1)); + if (child = node[2]) + quads.push(new quad_default(child, x0, ym, xm, y1)); + if (child = node[1]) + quads.push(new quad_default(child, xm, y0, x1, ym)); + if (child = node[0]) + quads.push(new quad_default(child, x0, y0, xm, ym)); + } + } + return this; +} + +// node_modules/d3-quadtree/src/visitAfter.js +function visitAfter_default2(callback) { + var quads = [], next = [], q; + if (this._root) + quads.push(new quad_default(this._root, this._x0, this._y0, this._x1, this._y1)); + while (q = quads.pop()) { + var node = q.node; + if (node.length) { + var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; + if (child = node[0]) + quads.push(new quad_default(child, x0, y0, xm, ym)); + if (child = node[1]) + quads.push(new quad_default(child, xm, y0, x1, ym)); + if (child = node[2]) + quads.push(new quad_default(child, x0, ym, xm, y1)); + if (child = node[3]) + quads.push(new quad_default(child, xm, ym, x1, y1)); + } + next.push(q); + } + while (q = next.pop()) { + callback(q.node, q.x0, q.y0, q.x1, q.y1); + } + return this; +} + +// node_modules/d3-quadtree/src/x.js +function defaultX2(d) { + return d[0]; +} +function x_default2(_) { + return arguments.length ? (this._x = _, this) : this._x; +} + +// node_modules/d3-quadtree/src/y.js +function defaultY(d) { + return d[1]; +} +function y_default(_) { + return arguments.length ? (this._y = _, this) : this._y; +} + +// node_modules/d3-quadtree/src/quadtree.js +function quadtree(nodes, x2, y2) { + var tree = new Quadtree(x2 == null ? defaultX2 : x2, y2 == null ? defaultY : y2, NaN, NaN, NaN, NaN); + return nodes == null ? tree : tree.addAll(nodes); +} +function Quadtree(x2, y2, x0, y0, x1, y1) { + this._x = x2; + this._y = y2; + this._x0 = x0; + this._y0 = y0; + this._x1 = x1; + this._y1 = y1; + this._root = void 0; +} +function leaf_copy2(leaf) { + var copy = { data: leaf.data }, next = copy; + while (leaf = leaf.next) + next = next.next = { data: leaf.data }; + return copy; +} +var treeProto2 = quadtree.prototype = Quadtree.prototype; +treeProto2.copy = function() { + var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), node = this._root, nodes, child; + if (!node) + return copy; + if (!node.length) + return copy._root = leaf_copy2(node), copy; + nodes = [{ source: node, target: copy._root = new Array(4) }]; + while (node = nodes.pop()) { + for (var i = 0; i < 4; ++i) { + if (child = node.source[i]) { + if (child.length) + nodes.push({ source: child, target: node.target[i] = new Array(4) }); + else + node.target[i] = leaf_copy2(child); + } + } + } + return copy; +}; +treeProto2.add = add_default2; +treeProto2.addAll = addAll2; +treeProto2.cover = cover_default2; +treeProto2.data = data_default2; +treeProto2.extent = extent_default2; +treeProto2.find = find_default2; +treeProto2.remove = remove_default2; +treeProto2.removeAll = removeAll2; +treeProto2.root = root_default2; +treeProto2.size = size_default2; +treeProto2.visit = visit_default2; +treeProto2.visitAfter = visitAfter_default2; +treeProto2.x = x_default2; +treeProto2.y = y_default; + +// node_modules/d3-octree/src/add.js +function add_default3(d) { + var x2 = +this._x.call(null, d), y2 = +this._y.call(null, d), z2 = +this._z.call(null, d); + return add3(this.cover(x2, y2, z2), x2, y2, z2, d); +} +function add3(tree, x2, y2, z2, d) { + if (isNaN(x2) || isNaN(y2) || isNaN(z2)) + return tree; + var parent, node = tree._root, leaf = { data: d }, x0 = tree._x0, y0 = tree._y0, z0 = tree._z0, x1 = tree._x1, y1 = tree._y1, z1 = tree._z1, xm, ym, zm, xp, yp, zp, right, bottom, deep, i, j; + if (!node) + return tree._root = leaf, tree; + while (node.length) { + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (bottom = y2 >= (ym = (y0 + y1) / 2)) + y0 = ym; + else + y1 = ym; + if (deep = z2 >= (zm = (z0 + z1) / 2)) + z0 = zm; + else + z1 = zm; + if (parent = node, !(node = node[i = deep << 2 | bottom << 1 | right])) + return parent[i] = leaf, tree; + } + xp = +tree._x.call(null, node.data); + yp = +tree._y.call(null, node.data); + zp = +tree._z.call(null, node.data); + if (x2 === xp && y2 === yp && z2 === zp) + return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree; + do { + parent = parent ? parent[i] = new Array(8) : tree._root = new Array(8); + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (bottom = y2 >= (ym = (y0 + y1) / 2)) + y0 = ym; + else + y1 = ym; + if (deep = z2 >= (zm = (z0 + z1) / 2)) + z0 = zm; + else + z1 = zm; + } while ((i = deep << 2 | bottom << 1 | right) === (j = (zp >= zm) << 2 | (yp >= ym) << 1 | xp >= xm)); + return parent[j] = node, parent[i] = leaf, tree; +} +function addAll3(data) { + var d, i, n = data.length, x2, y2, z2, xz = new Array(n), yz = new Array(n), zz = new Array(n), x0 = Infinity, y0 = Infinity, z0 = Infinity, x1 = -Infinity, y1 = -Infinity, z1 = -Infinity; + for (i = 0; i < n; ++i) { + if (isNaN(x2 = +this._x.call(null, d = data[i])) || isNaN(y2 = +this._y.call(null, d)) || isNaN(z2 = +this._z.call(null, d))) + continue; + xz[i] = x2; + yz[i] = y2; + zz[i] = z2; + if (x2 < x0) + x0 = x2; + if (x2 > x1) + x1 = x2; + if (y2 < y0) + y0 = y2; + if (y2 > y1) + y1 = y2; + if (z2 < z0) + z0 = z2; + if (z2 > z1) + z1 = z2; + } + if (x0 > x1 || y0 > y1 || z0 > z1) + return this; + this.cover(x0, y0, z0).cover(x1, y1, z1); + for (i = 0; i < n; ++i) { + add3(this, xz[i], yz[i], zz[i], data[i]); + } + return this; +} + +// node_modules/d3-octree/src/cover.js +function cover_default3(x2, y2, z2) { + if (isNaN(x2 = +x2) || isNaN(y2 = +y2) || isNaN(z2 = +z2)) + return this; + var x0 = this._x0, y0 = this._y0, z0 = this._z0, x1 = this._x1, y1 = this._y1, z1 = this._z1; + if (isNaN(x0)) { + x1 = (x0 = Math.floor(x2)) + 1; + y1 = (y0 = Math.floor(y2)) + 1; + z1 = (z0 = Math.floor(z2)) + 1; + } else { + var t = x1 - x0 || 1, node = this._root, parent, i; + while (x0 > x2 || x2 >= x1 || y0 > y2 || y2 >= y1 || z0 > z2 || z2 >= z1) { + i = (z2 < z0) << 2 | (y2 < y0) << 1 | x2 < x0; + parent = new Array(8), parent[i] = node, node = parent, t *= 2; + switch (i) { + case 0: + x1 = x0 + t, y1 = y0 + t, z1 = z0 + t; + break; + case 1: + x0 = x1 - t, y1 = y0 + t, z1 = z0 + t; + break; + case 2: + x1 = x0 + t, y0 = y1 - t, z1 = z0 + t; + break; + case 3: + x0 = x1 - t, y0 = y1 - t, z1 = z0 + t; + break; + case 4: + x1 = x0 + t, y1 = y0 + t, z0 = z1 - t; + break; + case 5: + x0 = x1 - t, y1 = y0 + t, z0 = z1 - t; + break; + case 6: + x1 = x0 + t, y0 = y1 - t, z0 = z1 - t; + break; + case 7: + x0 = x1 - t, y0 = y1 - t, z0 = z1 - t; + break; + } + } + if (this._root && this._root.length) + this._root = node; + } + this._x0 = x0; + this._y0 = y0; + this._z0 = z0; + this._x1 = x1; + this._y1 = y1; + this._z1 = z1; + return this; +} + +// node_modules/d3-octree/src/data.js +function data_default3() { + var data = []; + this.visit(function(node) { + if (!node.length) + do + data.push(node.data); + while (node = node.next); + }); + return data; +} + +// node_modules/d3-octree/src/extent.js +function extent_default3(_) { + return arguments.length ? this.cover(+_[0][0], +_[0][1], +_[0][2]).cover(+_[1][0], +_[1][1], +_[1][2]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0, this._z0], [this._x1, this._y1, this._z1]]; +} + +// node_modules/d3-octree/src/octant.js +function octant_default(node, x0, y0, z0, x1, y1, z1) { + this.node = node; + this.x0 = x0; + this.y0 = y0; + this.z0 = z0; + this.x1 = x1; + this.y1 = y1; + this.z1 = z1; +} + +// node_modules/d3-octree/src/find.js +function find_default3(x2, y2, z2, radius) { + var data, x0 = this._x0, y0 = this._y0, z0 = this._z0, x1, y1, z1, x22, y22, z22, x3 = this._x1, y3 = this._y1, z3 = this._z1, octs = [], node = this._root, q, i; + if (node) + octs.push(new octant_default(node, x0, y0, z0, x3, y3, z3)); + if (radius == null) + radius = Infinity; + else { + x0 = x2 - radius, y0 = y2 - radius, z0 = z2 - radius; + x3 = x2 + radius, y3 = y2 + radius, z3 = z2 + radius; + radius *= radius; + } + while (q = octs.pop()) { + if (!(node = q.node) || (x1 = q.x0) > x3 || (y1 = q.y0) > y3 || (z1 = q.z0) > z3 || (x22 = q.x1) < x0 || (y22 = q.y1) < y0 || (z22 = q.z1) < z0) + continue; + if (node.length) { + var xm = (x1 + x22) / 2, ym = (y1 + y22) / 2, zm = (z1 + z22) / 2; + octs.push(new octant_default(node[7], xm, ym, zm, x22, y22, z22), new octant_default(node[6], x1, ym, zm, xm, y22, z22), new octant_default(node[5], xm, y1, zm, x22, ym, z22), new octant_default(node[4], x1, y1, zm, xm, ym, z22), new octant_default(node[3], xm, ym, z1, x22, y22, zm), new octant_default(node[2], x1, ym, z1, xm, y22, zm), new octant_default(node[1], xm, y1, z1, x22, ym, zm), new octant_default(node[0], x1, y1, z1, xm, ym, zm)); + if (i = (z2 >= zm) << 2 | (y2 >= ym) << 1 | x2 >= xm) { + q = octs[octs.length - 1]; + octs[octs.length - 1] = octs[octs.length - 1 - i]; + octs[octs.length - 1 - i] = q; + } + } else { + var dx = x2 - +this._x.call(null, node.data), dy = y2 - +this._y.call(null, node.data), dz = z2 - +this._z.call(null, node.data), d2 = dx * dx + dy * dy + dz * dz; + if (d2 < radius) { + var d = Math.sqrt(radius = d2); + x0 = x2 - d, y0 = y2 - d, z0 = z2 - d; + x3 = x2 + d, y3 = y2 + d, z3 = z2 + d; + data = node.data; + } + } + } + return data; +} + +// node_modules/d3-octree/src/remove.js +function remove_default3(d) { + if (isNaN(x2 = +this._x.call(null, d)) || isNaN(y2 = +this._y.call(null, d)) || isNaN(z2 = +this._z.call(null, d))) + return this; + var parent, node = this._root, retainer, previous, next, x0 = this._x0, y0 = this._y0, z0 = this._z0, x1 = this._x1, y1 = this._y1, z1 = this._z1, x2, y2, z2, xm, ym, zm, right, bottom, deep, i, j; + if (!node) + return this; + if (node.length) + while (true) { + if (right = x2 >= (xm = (x0 + x1) / 2)) + x0 = xm; + else + x1 = xm; + if (bottom = y2 >= (ym = (y0 + y1) / 2)) + y0 = ym; + else + y1 = ym; + if (deep = z2 >= (zm = (z0 + z1) / 2)) + z0 = zm; + else + z1 = zm; + if (!(parent = node, node = node[i = deep << 2 | bottom << 1 | right])) + return this; + if (!node.length) + break; + if (parent[i + 1 & 7] || parent[i + 2 & 7] || parent[i + 3 & 7] || parent[i + 4 & 7] || parent[i + 5 & 7] || parent[i + 6 & 7] || parent[i + 7 & 7]) + retainer = parent, j = i; + } + while (node.data !== d) + if (!(previous = node, node = node.next)) + return this; + if (next = node.next) + delete node.next; + if (previous) + return next ? previous.next = next : delete previous.next, this; + if (!parent) + return this._root = next, this; + next ? parent[i] = next : delete parent[i]; + if ((node = parent[0] || parent[1] || parent[2] || parent[3] || parent[4] || parent[5] || parent[6] || parent[7]) && node === (parent[7] || parent[6] || parent[5] || parent[4] || parent[3] || parent[2] || parent[1] || parent[0]) && !node.length) { + if (retainer) + retainer[j] = node; + else + this._root = node; + } + return this; +} +function removeAll3(data) { + for (var i = 0, n = data.length; i < n; ++i) + this.remove(data[i]); + return this; +} + +// node_modules/d3-octree/src/root.js +function root_default3() { + return this._root; +} + +// node_modules/d3-octree/src/size.js +function size_default3() { + var size = 0; + this.visit(function(node) { + if (!node.length) + do + ++size; + while (node = node.next); + }); + return size; +} + +// node_modules/d3-octree/src/visit.js +function visit_default3(callback) { + var octs = [], q, node = this._root, child, x0, y0, z0, x1, y1, z1; + if (node) + octs.push(new octant_default(node, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1)); + while (q = octs.pop()) { + if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, z0 = q.z0, x1 = q.x1, y1 = q.y1, z1 = q.z1) && node.length) { + var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2, zm = (z0 + z1) / 2; + if (child = node[7]) + octs.push(new octant_default(child, xm, ym, zm, x1, y1, z1)); + if (child = node[6]) + octs.push(new octant_default(child, x0, ym, zm, xm, y1, z1)); + if (child = node[5]) + octs.push(new octant_default(child, xm, y0, zm, x1, ym, z1)); + if (child = node[4]) + octs.push(new octant_default(child, x0, y0, zm, xm, ym, z1)); + if (child = node[3]) + octs.push(new octant_default(child, xm, ym, z0, x1, y1, zm)); + if (child = node[2]) + octs.push(new octant_default(child, x0, ym, z0, xm, y1, zm)); + if (child = node[1]) + octs.push(new octant_default(child, xm, y0, z0, x1, ym, zm)); + if (child = node[0]) + octs.push(new octant_default(child, x0, y0, z0, xm, ym, zm)); + } + } + return this; +} + +// node_modules/d3-octree/src/visitAfter.js +function visitAfter_default3(callback) { + var octs = [], next = [], q; + if (this._root) + octs.push(new octant_default(this._root, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1)); + while (q = octs.pop()) { + var node = q.node; + if (node.length) { + var child, x0 = q.x0, y0 = q.y0, z0 = q.z0, x1 = q.x1, y1 = q.y1, z1 = q.z1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2, zm = (z0 + z1) / 2; + if (child = node[0]) + octs.push(new octant_default(child, x0, y0, z0, xm, ym, zm)); + if (child = node[1]) + octs.push(new octant_default(child, xm, y0, z0, x1, ym, zm)); + if (child = node[2]) + octs.push(new octant_default(child, x0, ym, z0, xm, y1, zm)); + if (child = node[3]) + octs.push(new octant_default(child, xm, ym, z0, x1, y1, zm)); + if (child = node[4]) + octs.push(new octant_default(child, x0, y0, zm, xm, ym, z1)); + if (child = node[5]) + octs.push(new octant_default(child, xm, y0, zm, x1, ym, z1)); + if (child = node[6]) + octs.push(new octant_default(child, x0, ym, zm, xm, y1, z1)); + if (child = node[7]) + octs.push(new octant_default(child, xm, ym, zm, x1, y1, z1)); + } + next.push(q); + } + while (q = next.pop()) { + callback(q.node, q.x0, q.y0, q.z0, q.x1, q.y1, q.z1); + } + return this; +} + +// node_modules/d3-octree/src/x.js +function defaultX3(d) { + return d[0]; +} +function x_default3(_) { + return arguments.length ? (this._x = _, this) : this._x; +} + +// node_modules/d3-octree/src/y.js +function defaultY2(d) { + return d[1]; +} +function y_default2(_) { + return arguments.length ? (this._y = _, this) : this._y; +} + +// node_modules/d3-octree/src/z.js +function defaultZ(d) { + return d[2]; +} +function z_default(_) { + return arguments.length ? (this._z = _, this) : this._z; +} + +// node_modules/d3-octree/src/octree.js +function octree(nodes, x2, y2, z2) { + var tree = new Octree(x2 == null ? defaultX3 : x2, y2 == null ? defaultY2 : y2, z2 == null ? defaultZ : z2, NaN, NaN, NaN, NaN, NaN, NaN); + return nodes == null ? tree : tree.addAll(nodes); +} +function Octree(x2, y2, z2, x0, y0, z0, x1, y1, z1) { + this._x = x2; + this._y = y2; + this._z = z2; + this._x0 = x0; + this._y0 = y0; + this._z0 = z0; + this._x1 = x1; + this._y1 = y1; + this._z1 = z1; + this._root = void 0; +} +function leaf_copy3(leaf) { + var copy = { data: leaf.data }, next = copy; + while (leaf = leaf.next) + next = next.next = { data: leaf.data }; + return copy; +} +var treeProto3 = octree.prototype = Octree.prototype; +treeProto3.copy = function() { + var copy = new Octree(this._x, this._y, this._z, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1), node = this._root, nodes, child; + if (!node) + return copy; + if (!node.length) + return copy._root = leaf_copy3(node), copy; + nodes = [{ source: node, target: copy._root = new Array(8) }]; + while (node = nodes.pop()) { + for (var i = 0; i < 8; ++i) { + if (child = node.source[i]) { + if (child.length) + nodes.push({ source: child, target: node.target[i] = new Array(8) }); + else + node.target[i] = leaf_copy3(child); + } + } + } + return copy; +}; +treeProto3.add = add_default3; +treeProto3.addAll = addAll3; +treeProto3.cover = cover_default3; +treeProto3.data = data_default3; +treeProto3.extent = extent_default3; +treeProto3.find = find_default3; +treeProto3.remove = remove_default3; +treeProto3.removeAll = removeAll3; +treeProto3.root = root_default3; +treeProto3.size = size_default3; +treeProto3.visit = visit_default3; +treeProto3.visitAfter = visitAfter_default3; +treeProto3.x = x_default3; +treeProto3.y = y_default2; +treeProto3.z = z_default; + +// node_modules/d3-force-3d/src/constant.js +function constant_default(x2) { + return function() { + return x2; + }; +} + +// node_modules/d3-force-3d/src/jiggle.js +function jiggle_default(random) { + return (random() - 0.5) * 1e-6; +} + +// node_modules/d3-force-3d/src/link.js +function index(d) { + return d.index; +} +function find(nodeById, nodeId) { + var node = nodeById.get(nodeId); + if (!node) + throw new Error("node not found: " + nodeId); + return node; +} +function link_default(links) { + var id = index, strength = defaultStrength, strengths, distance = constant_default(30), distances, nodes, nDim, count, bias, random, iterations = 1; + if (links == null) + links = []; + function defaultStrength(link) { + return 1 / Math.min(count[link.source.index], count[link.target.index]); + } + function force(alpha) { + for (var k = 0, n = links.length; k < iterations; ++k) { + for (var i = 0, link, source, target, x2 = 0, y2 = 0, z2 = 0, l, b; i < n; ++i) { + link = links[i], source = link.source, target = link.target; + x2 = target.x + target.vx - source.x - source.vx || jiggle_default(random); + if (nDim > 1) { + y2 = target.y + target.vy - source.y - source.vy || jiggle_default(random); + } + if (nDim > 2) { + z2 = target.z + target.vz - source.z - source.vz || jiggle_default(random); + } + l = Math.sqrt(x2 * x2 + y2 * y2 + z2 * z2); + l = (l - distances[i]) / l * alpha * strengths[i]; + x2 *= l, y2 *= l, z2 *= l; + target.vx -= x2 * (b = bias[i]); + if (nDim > 1) { + target.vy -= y2 * b; + } + if (nDim > 2) { + target.vz -= z2 * b; + } + source.vx += x2 * (b = 1 - b); + if (nDim > 1) { + source.vy += y2 * b; + } + if (nDim > 2) { + source.vz += z2 * b; + } + } + } + } + function initialize() { + if (!nodes) + return; + var i, n = nodes.length, m2 = links.length, nodeById = new Map(nodes.map((d, i2) => [id(d, i2, nodes), d])), link; + for (i = 0, count = new Array(n); i < m2; ++i) { + link = links[i], link.index = i; + if (typeof link.source !== "object") + link.source = find(nodeById, link.source); + if (typeof link.target !== "object") + link.target = find(nodeById, link.target); + count[link.source.index] = (count[link.source.index] || 0) + 1; + count[link.target.index] = (count[link.target.index] || 0) + 1; + } + for (i = 0, bias = new Array(m2); i < m2; ++i) { + link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]); + } + strengths = new Array(m2), initializeStrength(); + distances = new Array(m2), initializeDistance(); + } + function initializeStrength() { + if (!nodes) + return; + for (var i = 0, n = links.length; i < n; ++i) { + strengths[i] = +strength(links[i], i, links); + } + } + function initializeDistance() { + if (!nodes) + return; + for (var i = 0, n = links.length; i < n; ++i) { + distances[i] = +distance(links[i], i, links); + } + } + force.initialize = function(_nodes, ...args) { + nodes = _nodes; + random = args.find((arg) => typeof arg === "function") || Math.random; + nDim = args.find((arg) => [1, 2, 3].includes(arg)) || 2; + initialize(); + }; + force.links = function(_) { + return arguments.length ? (links = _, initialize(), force) : links; + }; + force.id = function(_) { + return arguments.length ? (id = _, force) : id; + }; + force.iterations = function(_) { + return arguments.length ? (iterations = +_, force) : iterations; + }; + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initializeStrength(), force) : strength; + }; + force.distance = function(_) { + return arguments.length ? (distance = typeof _ === "function" ? _ : constant_default(+_), initializeDistance(), force) : distance; + }; + return force; +} + +// node_modules/d3-dispatch/src/dispatch.js +var noop = { value: () => { +} }; +function dispatch() { + for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { + if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) + throw new Error("illegal type: " + t); + _[t] = []; + } + return new Dispatch(_); +} +function Dispatch(_) { + this._ = _; +} +function parseTypenames(typenames, types) { + return typenames.trim().split(/^|\s+/).map(function(t) { + var name = "", i = t.indexOf("."); + if (i >= 0) + name = t.slice(i + 1), t = t.slice(0, i); + if (t && !types.hasOwnProperty(t)) + throw new Error("unknown type: " + t); + return { type: t, name }; + }); +} +Dispatch.prototype = dispatch.prototype = { + constructor: Dispatch, + on: function(typename, callback) { + var _ = this._, T = parseTypenames(typename + "", _), t, i = -1, n = T.length; + if (arguments.length < 2) { + while (++i < n) + if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) + return t; + return; + } + if (callback != null && typeof callback !== "function") + throw new Error("invalid callback: " + callback); + while (++i < n) { + if (t = (typename = T[i]).type) + _[t] = set(_[t], typename.name, callback); + else if (callback == null) + for (t in _) + _[t] = set(_[t], typename.name, null); + } + return this; + }, + copy: function() { + var copy = {}, _ = this._; + for (var t in _) + copy[t] = _[t].slice(); + return new Dispatch(copy); + }, + call: function(type, that) { + if ((n = arguments.length - 2) > 0) + for (var args = new Array(n), i = 0, n, t; i < n; ++i) + args[i] = arguments[i + 2]; + if (!this._.hasOwnProperty(type)) + throw new Error("unknown type: " + type); + for (t = this._[type], i = 0, n = t.length; i < n; ++i) + t[i].value.apply(that, args); + }, + apply: function(type, that, args) { + if (!this._.hasOwnProperty(type)) + throw new Error("unknown type: " + type); + for (var t = this._[type], i = 0, n = t.length; i < n; ++i) + t[i].value.apply(that, args); + } +}; +function get(type, name) { + for (var i = 0, n = type.length, c2; i < n; ++i) { + if ((c2 = type[i]).name === name) { + return c2.value; + } + } +} +function set(type, name, callback) { + for (var i = 0, n = type.length; i < n; ++i) { + if (type[i].name === name) { + type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); + break; + } + } + if (callback != null) + type.push({ name, value: callback }); + return type; +} +var dispatch_default = dispatch; + +// node_modules/d3-timer/src/timer.js +var frame = 0; +var timeout = 0; +var interval = 0; +var pokeDelay = 1e3; +var taskHead; +var taskTail; +var clockLast = 0; +var clockNow = 0; +var clockSkew = 0; +var clock = typeof performance === "object" && performance.now ? performance : Date; +var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { + setTimeout(f, 17); +}; +function now2() { + return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); +} +function clearNow() { + clockNow = 0; +} +function Timer() { + this._call = this._time = this._next = null; +} +Timer.prototype = timer.prototype = { + constructor: Timer, + restart: function(callback, delay, time) { + if (typeof callback !== "function") + throw new TypeError("callback is not a function"); + time = (time == null ? now2() : +time) + (delay == null ? 0 : +delay); + if (!this._next && taskTail !== this) { + if (taskTail) + taskTail._next = this; + else + taskHead = this; + taskTail = this; + } + this._call = callback; + this._time = time; + sleep(); + }, + stop: function() { + if (this._call) { + this._call = null; + this._time = Infinity; + sleep(); + } + } +}; +function timer(callback, delay, time) { + var t = new Timer(); + t.restart(callback, delay, time); + return t; +} +function timerFlush() { + now2(); + ++frame; + var t = taskHead, e; + while (t) { + if ((e = clockNow - t._time) >= 0) + t._call.call(void 0, e); + t = t._next; + } + --frame; +} +function wake() { + clockNow = (clockLast = clock.now()) + clockSkew; + frame = timeout = 0; + try { + timerFlush(); + } finally { + frame = 0; + nap(); + clockNow = 0; + } +} +function poke() { + var now4 = clock.now(), delay = now4 - clockLast; + if (delay > pokeDelay) + clockSkew -= delay, clockLast = now4; +} +function nap() { + var t0, t1 = taskHead, t2, time = Infinity; + while (t1) { + if (t1._call) { + if (time > t1._time) + time = t1._time; + t0 = t1, t1 = t1._next; + } else { + t2 = t1._next, t1._next = null; + t1 = t0 ? t0._next = t2 : taskHead = t2; + } + } + taskTail = t0; + sleep(time); +} +function sleep(time) { + if (frame) + return; + if (timeout) + timeout = clearTimeout(timeout); + var delay = time - clockNow; + if (delay > 24) { + if (time < Infinity) + timeout = setTimeout(wake, time - clock.now() - clockSkew); + if (interval) + interval = clearInterval(interval); + } else { + if (!interval) + clockLast = clock.now(), interval = setInterval(poke, pokeDelay); + frame = 1, setFrame(wake); + } +} + +// node_modules/d3-force-3d/src/lcg.js +var a = 1664525; +var c = 1013904223; +var m = 4294967296; +function lcg_default() { + let s = 1; + return () => (s = (a * s + c) % m) / m; +} + +// node_modules/d3-force-3d/src/simulation.js +var MAX_DIMENSIONS = 3; +function x(d) { + return d.x; +} +function y(d) { + return d.y; +} +function z(d) { + return d.z; +} +var initialRadius = 10; +var initialAngleRoll = Math.PI * (3 - Math.sqrt(5)); +var initialAngleYaw = Math.PI * 20 / (9 + Math.sqrt(221)); +function simulation_default(nodes, numDimensions) { + numDimensions = numDimensions || 2; + var nDim = Math.min(MAX_DIMENSIONS, Math.max(1, Math.round(numDimensions))), simulation, alpha = 1, alphaMin = 1e-3, alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), alphaTarget = 0, velocityDecay = 0.6, forces = /* @__PURE__ */ new Map(), stepper = timer(step), event = dispatch_default("tick", "end"), random = lcg_default(); + if (nodes == null) + nodes = []; + function step() { + tick2(); + event.call("tick", simulation); + if (alpha < alphaMin) { + stepper.stop(); + event.call("end", simulation); + } + } + function tick2(iterations) { + var i, n = nodes.length, node; + if (iterations === void 0) + iterations = 1; + for (var k = 0; k < iterations; ++k) { + alpha += (alphaTarget - alpha) * alphaDecay; + forces.forEach(function(force) { + force(alpha); + }); + for (i = 0; i < n; ++i) { + node = nodes[i]; + if (node.fx == null) + node.x += node.vx *= velocityDecay; + else + node.x = node.fx, node.vx = 0; + if (nDim > 1) { + if (node.fy == null) + node.y += node.vy *= velocityDecay; + else + node.y = node.fy, node.vy = 0; + } + if (nDim > 2) { + if (node.fz == null) + node.z += node.vz *= velocityDecay; + else + node.z = node.fz, node.vz = 0; + } + } + } + return simulation; + } + function initializeNodes() { + for (var i = 0, n = nodes.length, node; i < n; ++i) { + node = nodes[i], node.index = i; + if (node.fx != null) + node.x = node.fx; + if (node.fy != null) + node.y = node.fy; + if (node.fz != null) + node.z = node.fz; + if (isNaN(node.x) || nDim > 1 && isNaN(node.y) || nDim > 2 && isNaN(node.z)) { + var radius = initialRadius * (nDim > 2 ? Math.cbrt(0.5 + i) : nDim > 1 ? Math.sqrt(0.5 + i) : i), rollAngle = i * initialAngleRoll, yawAngle = i * initialAngleYaw; + if (nDim === 1) { + node.x = radius; + } else if (nDim === 2) { + node.x = radius * Math.cos(rollAngle); + node.y = radius * Math.sin(rollAngle); + } else { + node.x = radius * Math.sin(rollAngle) * Math.cos(yawAngle); + node.y = radius * Math.cos(rollAngle); + node.z = radius * Math.sin(rollAngle) * Math.sin(yawAngle); + } + } + if (isNaN(node.vx) || nDim > 1 && isNaN(node.vy) || nDim > 2 && isNaN(node.vz)) { + node.vx = 0; + if (nDim > 1) { + node.vy = 0; + } + if (nDim > 2) { + node.vz = 0; + } + } + } + } + function initializeForce(force) { + if (force.initialize) + force.initialize(nodes, random, nDim); + return force; + } + initializeNodes(); + return simulation = { + tick: tick2, + restart: function() { + return stepper.restart(step), simulation; + }, + stop: function() { + return stepper.stop(), simulation; + }, + numDimensions: function(_) { + return arguments.length ? (nDim = Math.min(MAX_DIMENSIONS, Math.max(1, Math.round(_))), forces.forEach(initializeForce), simulation) : nDim; + }, + nodes: function(_) { + return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes; + }, + alpha: function(_) { + return arguments.length ? (alpha = +_, simulation) : alpha; + }, + alphaMin: function(_) { + return arguments.length ? (alphaMin = +_, simulation) : alphaMin; + }, + alphaDecay: function(_) { + return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay; + }, + alphaTarget: function(_) { + return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget; + }, + velocityDecay: function(_) { + return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay; + }, + randomSource: function(_) { + return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random; + }, + force: function(name, _) { + return arguments.length > 1 ? (_ == null ? forces.delete(name) : forces.set(name, initializeForce(_)), simulation) : forces.get(name); + }, + find: function() { + var args = Array.prototype.slice.call(arguments); + var x2 = args.shift() || 0, y2 = (nDim > 1 ? args.shift() : null) || 0, z2 = (nDim > 2 ? args.shift() : null) || 0, radius = args.shift() || Infinity; + var i = 0, n = nodes.length, dx, dy, dz, d2, node, closest; + radius *= radius; + for (i = 0; i < n; ++i) { + node = nodes[i]; + dx = x2 - node.x; + dy = y2 - (node.y || 0); + dz = z2 - (node.z || 0); + d2 = dx * dx + dy * dy + dz * dz; + if (d2 < radius) + closest = node, radius = d2; + } + return closest; + }, + on: function(name, _) { + return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name); + } + }; +} + +// node_modules/d3-force-3d/src/manyBody.js +function manyBody_default() { + var nodes, nDim, node, random, alpha, strength = constant_default(-30), strengths, distanceMin2 = 1, distanceMax2 = Infinity, theta2 = 0.81; + function force(_) { + var i, n = nodes.length, tree = (nDim === 1 ? binarytree(nodes, x) : nDim === 2 ? quadtree(nodes, x, y) : nDim === 3 ? octree(nodes, x, y, z) : null).visitAfter(accumulate); + for (alpha = _, i = 0; i < n; ++i) + node = nodes[i], tree.visit(apply); + } + function initialize() { + if (!nodes) + return; + var i, n = nodes.length, node2; + strengths = new Array(n); + for (i = 0; i < n; ++i) + node2 = nodes[i], strengths[node2.index] = +strength(node2, i, nodes); + } + function accumulate(treeNode) { + var strength2 = 0, q, c2, weight = 0, x2, y2, z2, i; + var numChildren = treeNode.length; + if (numChildren) { + for (x2 = y2 = z2 = i = 0; i < numChildren; ++i) { + if ((q = treeNode[i]) && (c2 = Math.abs(q.value))) { + strength2 += q.value, weight += c2, x2 += c2 * (q.x || 0), y2 += c2 * (q.y || 0), z2 += c2 * (q.z || 0); + } + } + strength2 *= Math.sqrt(4 / numChildren); + treeNode.x = x2 / weight; + if (nDim > 1) { + treeNode.y = y2 / weight; + } + if (nDim > 2) { + treeNode.z = z2 / weight; + } + } else { + q = treeNode; + q.x = q.data.x; + if (nDim > 1) { + q.y = q.data.y; + } + if (nDim > 2) { + q.z = q.data.z; + } + do + strength2 += strengths[q.data.index]; + while (q = q.next); + } + treeNode.value = strength2; + } + function apply(treeNode, x1, arg1, arg2, arg3) { + if (!treeNode.value) + return true; + var x2 = [arg1, arg2, arg3][nDim - 1]; + var x3 = treeNode.x - node.x, y2 = nDim > 1 ? treeNode.y - node.y : 0, z2 = nDim > 2 ? treeNode.z - node.z : 0, w = x2 - x1, l = x3 * x3 + y2 * y2 + z2 * z2; + if (w * w / theta2 < l) { + if (l < distanceMax2) { + if (x3 === 0) + x3 = jiggle_default(random), l += x3 * x3; + if (nDim > 1 && y2 === 0) + y2 = jiggle_default(random), l += y2 * y2; + if (nDim > 2 && z2 === 0) + z2 = jiggle_default(random), l += z2 * z2; + if (l < distanceMin2) + l = Math.sqrt(distanceMin2 * l); + node.vx += x3 * treeNode.value * alpha / l; + if (nDim > 1) { + node.vy += y2 * treeNode.value * alpha / l; + } + if (nDim > 2) { + node.vz += z2 * treeNode.value * alpha / l; + } + } + return true; + } else if (treeNode.length || l >= distanceMax2) + return; + if (treeNode.data !== node || treeNode.next) { + if (x3 === 0) + x3 = jiggle_default(random), l += x3 * x3; + if (nDim > 1 && y2 === 0) + y2 = jiggle_default(random), l += y2 * y2; + if (nDim > 2 && z2 === 0) + z2 = jiggle_default(random), l += z2 * z2; + if (l < distanceMin2) + l = Math.sqrt(distanceMin2 * l); + } + do + if (treeNode.data !== node) { + w = strengths[treeNode.data.index] * alpha / l; + node.vx += x3 * w; + if (nDim > 1) { + node.vy += y2 * w; + } + if (nDim > 2) { + node.vz += z2 * w; + } + } + while (treeNode = treeNode.next); + } + force.initialize = function(_nodes, ...args) { + nodes = _nodes; + random = args.find((arg) => typeof arg === "function") || Math.random; + nDim = args.find((arg) => [1, 2, 3].includes(arg)) || 2; + initialize(); + }; + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : strength; + }; + force.distanceMin = function(_) { + return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2); + }; + force.distanceMax = function(_) { + return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2); + }; + force.theta = function(_) { + return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2); + }; + return force; +} + +// node_modules/d3-force-3d/src/radial.js +function radial_default(radius, x2, y2, z2) { + var nodes, nDim, strength = constant_default(0.1), strengths, radiuses; + if (typeof radius !== "function") + radius = constant_default(+radius); + if (x2 == null) + x2 = 0; + if (y2 == null) + y2 = 0; + if (z2 == null) + z2 = 0; + function force(alpha) { + for (var i = 0, n = nodes.length; i < n; ++i) { + var node = nodes[i], dx = node.x - x2 || 1e-6, dy = (node.y || 0) - y2 || 1e-6, dz = (node.z || 0) - z2 || 1e-6, r = Math.sqrt(dx * dx + dy * dy + dz * dz), k = (radiuses[i] - r) * strengths[i] * alpha / r; + node.vx += dx * k; + if (nDim > 1) { + node.vy += dy * k; + } + if (nDim > 2) { + node.vz += dz * k; + } + } + } + function initialize() { + if (!nodes) + return; + var i, n = nodes.length; + strengths = new Array(n); + radiuses = new Array(n); + for (i = 0; i < n; ++i) { + radiuses[i] = +radius(nodes[i], i, nodes); + strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes); + } + } + force.initialize = function(initNodes, ...args) { + nodes = initNodes; + nDim = args.find((arg) => [1, 2, 3].includes(arg)) || 2; + initialize(); + }; + force.strength = function(_) { + return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : strength; + }; + force.radius = function(_) { + return arguments.length ? (radius = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : radius; + }; + force.x = function(_) { + return arguments.length ? (x2 = +_, force) : x2; + }; + force.y = function(_) { + return arguments.length ? (y2 = +_, force) : y2; + }; + force.z = function(_) { + return arguments.length ? (z2 = +_, force) : z2; + }; + return force; +} + +// node_modules/three-forcegraph/dist/three-forcegraph.module.js +var import_ngraph = __toESM(require_ngraph2()); +var import_ngraph2 = __toESM(require_ngraph5()); + +// node_modules/kapsule/dist/kapsule.module.js +var import_debounce = __toESM(require_debounce()); +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} +function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); +} +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; +} +function _iterableToArrayLimit(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; +} +function _unsupportedIterableToArray(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray(o, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +var Prop = /* @__PURE__ */ _createClass(function Prop2(name, _ref) { + var _ref$default = _ref["default"], defaultVal = _ref$default === void 0 ? null : _ref$default, _ref$triggerUpdate = _ref.triggerUpdate, triggerUpdate = _ref$triggerUpdate === void 0 ? true : _ref$triggerUpdate, _ref$onChange = _ref.onChange, onChange13 = _ref$onChange === void 0 ? function(newVal, state) { + } : _ref$onChange; + _classCallCheck(this, Prop2); + this.name = name; + this.defaultVal = defaultVal; + this.triggerUpdate = triggerUpdate; + this.onChange = onChange13; +}); +function index2(_ref2) { + var _ref2$stateInit = _ref2.stateInit, stateInit4 = _ref2$stateInit === void 0 ? function() { + return {}; + } : _ref2$stateInit, _ref2$props = _ref2.props, rawProps = _ref2$props === void 0 ? {} : _ref2$props, _ref2$methods = _ref2.methods, methods = _ref2$methods === void 0 ? {} : _ref2$methods, _ref2$aliases = _ref2.aliases, aliases = _ref2$aliases === void 0 ? {} : _ref2$aliases, _ref2$init = _ref2.init, initFn = _ref2$init === void 0 ? function() { + } : _ref2$init, _ref2$update = _ref2.update, updateFn = _ref2$update === void 0 ? function() { + } : _ref2$update; + var props = Object.keys(rawProps).map(function(propName) { + return new Prop(propName, rawProps[propName]); + }); + return function() { + var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var state = Object.assign({}, stateInit4 instanceof Function ? stateInit4(options) : stateInit4, { + initialised: false + }); + var changedProps = {}; + function comp(nodeElement) { + initStatic(nodeElement, options); + digest(); + return comp; + } + var initStatic = function initStatic2(nodeElement, options2) { + initFn.call(comp, nodeElement, state, options2); + state.initialised = true; + }; + var digest = (0, import_debounce.default)(function() { + if (!state.initialised) { + return; + } + updateFn.call(comp, state, changedProps); + changedProps = {}; + }, 1); + props.forEach(function(prop) { + comp[prop.name] = getSetProp(prop); + function getSetProp(_ref3) { + var prop2 = _ref3.name, _ref3$triggerUpdate = _ref3.triggerUpdate, redigest = _ref3$triggerUpdate === void 0 ? false : _ref3$triggerUpdate, _ref3$onChange = _ref3.onChange, onChange13 = _ref3$onChange === void 0 ? function(newVal, state2) { + } : _ref3$onChange, _ref3$defaultVal = _ref3.defaultVal, defaultVal = _ref3$defaultVal === void 0 ? null : _ref3$defaultVal; + return function(_) { + var curVal = state[prop2]; + if (!arguments.length) { + return curVal; + } + var val = _ === void 0 ? defaultVal : _; + state[prop2] = val; + onChange13.call(comp, val, state, curVal); + !changedProps.hasOwnProperty(prop2) && (changedProps[prop2] = curVal); + if (redigest) { + digest(); + } + return comp; + }; + } + }); + Object.keys(methods).forEach(function(methodName) { + comp[methodName] = function() { + var _methods$methodName; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return (_methods$methodName = methods[methodName]).call.apply(_methods$methodName, [comp, state].concat(args)); + }; + }); + Object.entries(aliases).forEach(function(_ref4) { + var _ref5 = _slicedToArray(_ref4, 2), alias = _ref5[0], target = _ref5[1]; + return comp[alias] = comp[target]; + }); + comp.resetProps = function() { + props.forEach(function(prop) { + comp[prop.name](prop.defaultVal); + }); + return comp; + }; + comp.resetProps(); + state._rerender = digest; + return comp; + }; +} + +// node_modules/accessor-fn/dist/accessor-fn.module.js +var index3 = function(p) { + return p instanceof Function ? p : typeof p === "string" ? function(obj) { + return obj[p]; + } : function(obj) { + return p; + }; +}; +var accessor_fn_module_default = index3; + +// node_modules/internmap/src/index.js +var InternMap = class extends Map { + constructor(entries, key = keyof) { + super(); + Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); + if (entries != null) + for (const [key2, value] of entries) + this.set(key2, value); + } + get(key) { + return super.get(intern_get(this, key)); + } + has(key) { + return super.has(intern_get(this, key)); + } + set(key, value) { + return super.set(intern_set(this, key), value); + } + delete(key) { + return super.delete(intern_delete(this, key)); + } +}; +function intern_get({ _intern, _key }, value) { + const key = _key(value); + return _intern.has(key) ? _intern.get(key) : value; +} +function intern_set({ _intern, _key }, value) { + const key = _key(value); + if (_intern.has(key)) + return _intern.get(key); + _intern.set(key, value); + return value; +} +function intern_delete({ _intern, _key }, value) { + const key = _key(value); + if (_intern.has(key)) { + value = _intern.get(key); + _intern.delete(key); + } + return value; +} +function keyof(value) { + return value !== null && typeof value === "object" ? value.valueOf() : value; +} + +// node_modules/d3-array/src/max.js +function max(values, valueof) { + let max2; + if (valueof === void 0) { + for (const value of values) { + if (value != null && (max2 < value || max2 === void 0 && value >= value)) { + max2 = value; + } + } + } else { + let index5 = -1; + for (let value of values) { + if ((value = valueof(value, ++index5, values)) != null && (max2 < value || max2 === void 0 && value >= value)) { + max2 = value; + } + } + } + return max2; +} + +// node_modules/d3-array/src/min.js +function min(values, valueof) { + let min2; + if (valueof === void 0) { + for (const value of values) { + if (value != null && (min2 > value || min2 === void 0 && value >= value)) { + min2 = value; + } + } + } else { + let index5 = -1; + for (let value of values) { + if ((value = valueof(value, ++index5, values)) != null && (min2 > value || min2 === void 0 && value >= value)) { + min2 = value; + } + } + } + return min2; +} + +// node_modules/index-array-by/dist/index-array-by.module.js +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; +} +function _objectWithoutProperties(source, excluded) { + if (source == null) + return {}; + var target = _objectWithoutPropertiesLoose(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) + continue; + target[key] = source[key]; + } + } + return target; +} +function _slicedToArray2(arr, i) { + return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2(); +} +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread(); +} +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray2(arr); +} +function _arrayWithHoles2(arr) { + if (Array.isArray(arr)) + return arr; +} +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _iterableToArrayLimit2(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; +} +function _unsupportedIterableToArray2(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray2(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray2(o, minLen); +} +function _arrayLikeToArray2(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _nonIterableRest2() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); +} +function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); +} +var index4 = function() { + var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; + var keyAccessors = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; + var multiItem = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; + var flattenKeys = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; + var keys = (keyAccessors instanceof Array ? keyAccessors.length ? keyAccessors : [void 0] : [keyAccessors]).map(function(key) { + return { + keyAccessor: key, + isProp: !(key instanceof Function) + }; + }); + var indexedResult = list.reduce(function(res, item) { + var iterObj = res; + var itemVal = item; + keys.forEach(function(_ref, idx) { + var keyAccessor = _ref.keyAccessor, isProp = _ref.isProp; + var key; + if (isProp) { + var _itemVal = itemVal, propVal = _itemVal[keyAccessor], rest = _objectWithoutProperties(_itemVal, [keyAccessor].map(_toPropertyKey)); + key = propVal; + itemVal = rest; + } else { + key = keyAccessor(itemVal, idx); + } + if (idx + 1 < keys.length) { + if (!iterObj.hasOwnProperty(key)) { + iterObj[key] = {}; + } + iterObj = iterObj[key]; + } else { + if (multiItem) { + if (!iterObj.hasOwnProperty(key)) { + iterObj[key] = []; + } + iterObj[key].push(itemVal); + } else { + iterObj[key] = itemVal; + } + } + }); + return res; + }, {}); + if (multiItem instanceof Function) { + (function reduce(node) { + var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; + if (level === keys.length) { + Object.keys(node).forEach(function(k) { + return node[k] = multiItem(node[k]); + }); + } else { + Object.values(node).forEach(function(child) { + return reduce(child, level + 1); + }); + } + })(indexedResult); + } + var result = indexedResult; + if (flattenKeys) { + result = []; + (function flatten2(node) { + var accKeys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; + if (accKeys.length === keys.length) { + result.push({ + keys: accKeys, + vals: node + }); + } else { + Object.entries(node).forEach(function(_ref2) { + var _ref3 = _slicedToArray2(_ref2, 2), key = _ref3[0], val = _ref3[1]; + return flatten2(val, [].concat(_toConsumableArray(accKeys), [key])); + }); + } + })(indexedResult); + if (keyAccessors instanceof Array && keyAccessors.length === 0 && result.length === 1) { + result[0].keys = []; + } + } + return result; +}; + +// node_modules/data-joint/dist/data-joint.module.js +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; +} +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; +} +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +function _objectWithoutPropertiesLoose2(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; +} +function _objectWithoutProperties2(source, excluded) { + if (source == null) + return {}; + var target = _objectWithoutPropertiesLoose2(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) + continue; + target[key] = source[key]; + } + } + return target; +} +function _slicedToArray3(arr, i) { + return _arrayWithHoles3(arr) || _iterableToArrayLimit3(arr, i) || _unsupportedIterableToArray3(arr, i) || _nonIterableRest3(); +} +function _toConsumableArray2(arr) { + return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray3(arr) || _nonIterableSpread2(); +} +function _arrayWithoutHoles2(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray3(arr); +} +function _arrayWithHoles3(arr) { + if (Array.isArray(arr)) + return arr; +} +function _iterableToArray2(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _iterableToArrayLimit3(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; +} +function _unsupportedIterableToArray3(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray3(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray3(o, minLen); +} +function _arrayLikeToArray3(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread2() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _nonIterableRest3() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +var _excluded = ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"]; +function diffArrays(prev, next, idAccessor) { + var result = { + enter: [], + update: [], + exit: [] + }; + if (!idAccessor) { + var prevSet = new Set(prev); + var nextSet = new Set(next); + new Set([].concat(_toConsumableArray2(prevSet), _toConsumableArray2(nextSet))).forEach(function(item) { + var type = !prevSet.has(item) ? "enter" : !nextSet.has(item) ? "exit" : "update"; + result[type].push(type === "update" ? [item, item] : item); + }); + } else { + var prevById = index4(prev, idAccessor, false); + var nextById = index4(next, idAccessor, false); + var byId = Object.assign({}, prevById, nextById); + Object.entries(byId).forEach(function(_ref) { + var _ref2 = _slicedToArray3(_ref, 2), id = _ref2[0], item = _ref2[1]; + var type = !prevById.hasOwnProperty(id) ? "enter" : !nextById.hasOwnProperty(id) ? "exit" : "update"; + result[type].push(type === "update" ? [prevById[id], nextById[id]] : item); + }); + } + return result; +} +function dataBindDiff(data, existingObjs, _ref3) { + var _ref3$objBindAttr = _ref3.objBindAttr, objBindAttr = _ref3$objBindAttr === void 0 ? "__obj" : _ref3$objBindAttr, _ref3$dataBindAttr = _ref3.dataBindAttr, dataBindAttr = _ref3$dataBindAttr === void 0 ? "__data" : _ref3$dataBindAttr, idAccessor = _ref3.idAccessor, _ref3$purge = _ref3.purge, purge = _ref3$purge === void 0 ? false : _ref3$purge; + var isObjValid = function isObjValid2(obj) { + return obj.hasOwnProperty(dataBindAttr); + }; + var removeObjs = existingObjs.filter(function(obj) { + return !isObjValid(obj); + }); + var prevD = existingObjs.filter(isObjValid).map(function(obj) { + return obj[dataBindAttr]; + }); + var nextD = data; + var diff = purge ? { + enter: nextD, + exit: prevD, + update: [] + } : diffArrays(prevD, nextD, idAccessor); + diff.update = diff.update.map(function(_ref4) { + var _ref5 = _slicedToArray3(_ref4, 2), prevD2 = _ref5[0], nextD2 = _ref5[1]; + if (prevD2 !== nextD2) { + nextD2[objBindAttr] = prevD2[objBindAttr]; + nextD2[objBindAttr][dataBindAttr] = nextD2; + } + return nextD2; + }); + diff.exit = diff.exit.concat(removeObjs.map(function(obj) { + return _defineProperty({}, objBindAttr, obj); + })); + return diff; +} +function viewDigest(data, existingObjs, appendObj, removeObj, _ref7) { + var _ref7$createObj = _ref7.createObj, createObj = _ref7$createObj === void 0 ? function(d) { + return {}; + } : _ref7$createObj, _ref7$updateObj = _ref7.updateObj, updateObj = _ref7$updateObj === void 0 ? function(obj, d) { + } : _ref7$updateObj, _ref7$exitObj = _ref7.exitObj, exitObj = _ref7$exitObj === void 0 ? function(obj) { + } : _ref7$exitObj, _ref7$objBindAttr = _ref7.objBindAttr, objBindAttr = _ref7$objBindAttr === void 0 ? "__obj" : _ref7$objBindAttr, _ref7$dataBindAttr = _ref7.dataBindAttr, dataBindAttr = _ref7$dataBindAttr === void 0 ? "__data" : _ref7$dataBindAttr, dataDiffOptions = _objectWithoutProperties2(_ref7, _excluded); + var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2({ + objBindAttr, + dataBindAttr + }, dataDiffOptions)), enter = _dataBindDiff.enter, update4 = _dataBindDiff.update, exit = _dataBindDiff.exit; + exit.forEach(function(d) { + var obj = d[objBindAttr]; + delete d[objBindAttr]; + exitObj(obj); + removeObj(obj); + }); + var newObjs = createObjs(enter); + var pointsData = [].concat(_toConsumableArray2(enter), _toConsumableArray2(update4)); + updateObjs(pointsData); + newObjs.forEach(appendObj); + function createObjs(data2) { + var newObjs2 = []; + data2.forEach(function(d) { + var obj = createObj(d); + if (obj) { + obj[dataBindAttr] = d; + d[objBindAttr] = obj; + newObjs2.push(obj); + } + }); + return newObjs2; + } + function updateObjs(data2) { + data2.forEach(function(d) { + var obj = d[objBindAttr]; + if (obj) { + obj[dataBindAttr] = d; + updateObj(obj, d); + } + }); + } +} + +// node_modules/d3-scale/src/init.js +function initRange(domain, range) { + switch (arguments.length) { + case 0: + break; + case 1: + this.range(domain); + break; + default: + this.range(range).domain(domain); + break; + } + return this; +} + +// node_modules/d3-scale/src/ordinal.js +var implicit = Symbol("implicit"); +function ordinal() { + var index5 = new InternMap(), domain = [], range = [], unknown = implicit; + function scale(d) { + let i = index5.get(d); + if (i === void 0) { + if (unknown !== implicit) + return unknown; + index5.set(d, i = domain.push(d) - 1); + } + return range[i % range.length]; + } + scale.domain = function(_) { + if (!arguments.length) + return domain.slice(); + domain = [], index5 = new InternMap(); + for (const value of _) { + if (index5.has(value)) + continue; + index5.set(value, domain.push(value) - 1); + } + return scale; + }; + scale.range = function(_) { + return arguments.length ? (range = Array.from(_), scale) : range.slice(); + }; + scale.unknown = function(_) { + return arguments.length ? (unknown = _, scale) : unknown; + }; + scale.copy = function() { + return ordinal(domain, range).unknown(unknown); + }; + initRange.apply(scale, arguments); + return scale; +} + +// node_modules/d3-scale-chromatic/src/colors.js +function colors_default(specifier) { + var n = specifier.length / 6 | 0, colors = new Array(n), i = 0; + while (i < n) + colors[i] = "#" + specifier.slice(i * 6, ++i * 6); + return colors; +} + +// node_modules/d3-scale-chromatic/src/categorical/Paired.js +var Paired_default = colors_default("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"); + +// node_modules/three-forcegraph/dist/three-forcegraph.module.js +var import_tinycolor2 = __toESM(require_tinycolor()); +function ownKeys2(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; +} +function _objectSpread22(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + i % 2 ? ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty2(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; +} +function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); +} +function _classCallCheck2(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} +function _defineProperties2(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} +function _createClass2(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties2(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties2(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} +function _defineProperty2(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) + _setPrototypeOf(subClass, superClass); +} +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); +} +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); +} +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } +} +function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct3(Parent2, args2, Class2) { + var a2 = [null]; + a2.push.apply(a2, args2); + var Constructor = Function.bind.apply(Parent2, a2); + var instance = new Constructor(); + if (Class2) + _setPrototypeOf(instance, Class2.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); +} +function _objectWithoutPropertiesLoose3(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; +} +function _objectWithoutProperties3(source, excluded) { + if (source == null) + return {}; + var target = _objectWithoutPropertiesLoose3(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) + continue; + target[key] = source[key]; + } + } + return target; +} +function _assertThisInitialized(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; +} +function _possibleConstructorReturn(self2, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); +} +function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; +} +function _slicedToArray4(arr, i) { + return _arrayWithHoles4(arr) || _iterableToArrayLimit4(arr, i) || _unsupportedIterableToArray4(arr, i) || _nonIterableRest4(); +} +function _toConsumableArray3(arr) { + return _arrayWithoutHoles3(arr) || _iterableToArray3(arr) || _unsupportedIterableToArray4(arr) || _nonIterableSpread3(); +} +function _arrayWithoutHoles3(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray4(arr); +} +function _arrayWithHoles4(arr) { + if (Array.isArray(arr)) + return arr; +} +function _iterableToArray3(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _iterableToArrayLimit4(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; +} +function _unsupportedIterableToArray4(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray4(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray4(o, minLen); +} +function _arrayLikeToArray4(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread3() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _nonIterableRest4() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +var materialDispose = function materialDispose2(material) { + if (material instanceof Array) { + material.forEach(materialDispose2); + } else { + if (material.map) { + material.map.dispose(); + } + material.dispose(); + } +}; +var deallocate = function deallocate2(obj) { + if (obj.geometry) { + obj.geometry.dispose(); + } + if (obj.material) { + materialDispose(obj.material); + } + if (obj.texture) { + obj.texture.dispose(); + } + if (obj.children) { + obj.children.forEach(deallocate2); + } +}; +var emptyObject = function emptyObject2(obj) { + while (obj.children.length) { + var childObj = obj.children[0]; + obj.remove(childObj); + deallocate(childObj); + } +}; +var _excluded2 = ["objFilter"]; +function threeDigest(data, scene3) { + var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var _ref$objFilter = _ref.objFilter, objFilter = _ref$objFilter === void 0 ? function() { + return true; + } : _ref$objFilter, options = _objectWithoutProperties3(_ref, _excluded2); + return viewDigest(data, scene3.children.filter(objFilter), function(obj) { + return scene3.add(obj); + }, function(obj) { + scene3.remove(obj); + emptyObject(obj); + }, _objectSpread22({ + objBindAttr: "__threeObj" + }, options)); +} +var colorStr2Hex = function colorStr2Hex2(str) { + return isNaN(str) ? parseInt((0, import_tinycolor2.default)(str).toHex(), 16) : str; +}; +var colorAlpha = function colorAlpha2(str) { + return isNaN(str) ? (0, import_tinycolor2.default)(str).getAlpha() : 1; +}; +var autoColorScale = ordinal(Paired_default); +function autoColorObjects(objects, colorByAccessor, colorField) { + if (!colorByAccessor || typeof colorField !== "string") + return; + objects.filter(function(obj) { + return !obj[colorField]; + }).forEach(function(obj) { + obj[colorField] = autoColorScale(colorByAccessor(obj)); + }); +} +function getDagDepths(_ref, idAccessor) { + var nodes = _ref.nodes, links = _ref.links; + var _ref2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, _ref2$nodeFilter = _ref2.nodeFilter, nodeFilter = _ref2$nodeFilter === void 0 ? function() { + return true; + } : _ref2$nodeFilter, _ref2$onLoopError = _ref2.onLoopError, onLoopError = _ref2$onLoopError === void 0 ? function(loopIds) { + throw "Invalid DAG structure! Found cycle in node path: ".concat(loopIds.join(" -> "), "."); + } : _ref2$onLoopError; + var graph2 = {}; + nodes.forEach(function(node) { + return graph2[idAccessor(node)] = { + data: node, + out: [], + depth: -1, + skip: !nodeFilter(node) + }; + }); + links.forEach(function(_ref3) { + var source = _ref3.source, target = _ref3.target; + var sourceId = getNodeId(source); + var targetId = getNodeId(target); + if (!graph2.hasOwnProperty(sourceId)) + throw "Missing source node with id: ".concat(sourceId); + if (!graph2.hasOwnProperty(targetId)) + throw "Missing target node with id: ".concat(targetId); + var sourceNode = graph2[sourceId]; + var targetNode = graph2[targetId]; + sourceNode.out.push(targetNode); + function getNodeId(node) { + return _typeof(node) === "object" ? idAccessor(node) : node; + } + }); + var foundLoops = []; + traverse(Object.values(graph2)); + var nodeDepths = Object.assign.apply(Object, [{}].concat(_toConsumableArray3(Object.entries(graph2).filter(function(_ref4) { + var _ref5 = _slicedToArray4(_ref4, 2), node = _ref5[1]; + return !node.skip; + }).map(function(_ref6) { + var _ref7 = _slicedToArray4(_ref6, 2), id = _ref7[0], node = _ref7[1]; + return _defineProperty2({}, id, node.depth); + })))); + return nodeDepths; + function traverse(nodes2) { + var nodeStack = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; + var currentDepth = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0; + for (var i = 0, l = nodes2.length; i < l; i++) { + var node = nodes2[i]; + if (nodeStack.indexOf(node) !== -1) { + var _ret = function() { + var loop = [].concat(_toConsumableArray3(nodeStack.slice(nodeStack.indexOf(node))), [node]).map(function(d) { + return idAccessor(d.data); + }); + if (!foundLoops.some(function(foundLoop) { + return foundLoop.length === loop.length && foundLoop.every(function(id, idx) { + return id === loop[idx]; + }); + })) { + foundLoops.push(loop); + onLoopError(loop); + } + return "continue"; + }(); + if (_ret === "continue") + continue; + } + if (currentDepth > node.depth) { + node.depth = currentDepth; + traverse(node.out, [].concat(_toConsumableArray3(nodeStack), [node]), currentDepth + (node.skip ? 0 : 1)); + } + } + } +} +var three$1 = window.THREE ? window.THREE : { + Group, + Mesh, + MeshLambertMaterial, + Color, + BufferGeometry, + BufferAttribute, + Matrix4, + Vector3, + SphereBufferGeometry: SphereGeometry, + CylinderBufferGeometry: CylinderGeometry, + TubeBufferGeometry: TubeGeometry, + ConeBufferGeometry: ConeGeometry, + Line, + LineBasicMaterial, + QuadraticBezierCurve3, + CubicBezierCurve3, + Box3 +}; +var ngraph = { + graph: import_ngraph.default, + forcelayout: import_ngraph2.default +}; +var DAG_LEVEL_NODE_RATIO = 2; +var setAttributeFn = new three$1.BufferGeometry().setAttribute ? "setAttribute" : "addAttribute"; +var applyMatrix4Fn = new three$1.BufferGeometry().applyMatrix4 ? "applyMatrix4" : "applyMatrix"; +var ForceGraph = index2({ + props: { + jsonUrl: { + onChange: function onChange(jsonUrl, state) { + var _this = this; + if (jsonUrl && !state.fetchingJson) { + state.fetchingJson = true; + state.onLoading(); + fetch(jsonUrl).then(function(r) { + return r.json(); + }).then(function(json) { + state.fetchingJson = false; + state.onFinishLoading(json); + _this.graphData(json); + }); + } + }, + triggerUpdate: false + }, + graphData: { + "default": { + nodes: [], + links: [] + }, + onChange: function onChange2(graphData, state) { + state.engineRunning = false; + } + }, + numDimensions: { + "default": 3, + onChange: function onChange3(numDim, state) { + var chargeForce = state.d3ForceLayout.force("charge"); + if (chargeForce) { + chargeForce.strength(numDim > 2 ? -60 : -30); + } + if (numDim < 3) { + eraseDimension(state.graphData.nodes, "z"); + } + if (numDim < 2) { + eraseDimension(state.graphData.nodes, "y"); + } + function eraseDimension(nodes, dim) { + nodes.forEach(function(d) { + delete d[dim]; + delete d["v".concat(dim)]; + }); + } + } + }, + dagMode: { + onChange: function onChange4(dagMode, state) { + !dagMode && state.forceEngine === "d3" && (state.graphData.nodes || []).forEach(function(n) { + return n.fx = n.fy = n.fz = void 0; + }); + } + }, + dagLevelDistance: {}, + dagNodeFilter: { + "default": function _default(node) { + return true; + } + }, + onDagError: { + triggerUpdate: false + }, + nodeRelSize: { + "default": 4 + }, + nodeId: { + "default": "id" + }, + nodeVal: { + "default": "val" + }, + nodeResolution: { + "default": 8 + }, + nodeColor: { + "default": "color" + }, + nodeAutoColorBy: {}, + nodeOpacity: { + "default": 0.75 + }, + nodeVisibility: { + "default": true + }, + nodeThreeObject: {}, + nodeThreeObjectExtend: { + "default": false + }, + linkSource: { + "default": "source" + }, + linkTarget: { + "default": "target" + }, + linkVisibility: { + "default": true + }, + linkColor: { + "default": "color" + }, + linkAutoColorBy: {}, + linkOpacity: { + "default": 0.2 + }, + linkWidth: {}, + linkResolution: { + "default": 6 + }, + linkCurvature: { + "default": 0, + triggerUpdate: false + }, + linkCurveRotation: { + "default": 0, + triggerUpdate: false + }, + linkMaterial: {}, + linkThreeObject: {}, + linkThreeObjectExtend: { + "default": false + }, + linkPositionUpdate: { + triggerUpdate: false + }, + linkDirectionalArrowLength: { + "default": 0 + }, + linkDirectionalArrowColor: {}, + linkDirectionalArrowRelPos: { + "default": 0.5, + triggerUpdate: false + }, + linkDirectionalArrowResolution: { + "default": 8 + }, + linkDirectionalParticles: { + "default": 0 + }, + linkDirectionalParticleSpeed: { + "default": 0.01, + triggerUpdate: false + }, + linkDirectionalParticleWidth: { + "default": 0.5 + }, + linkDirectionalParticleColor: {}, + linkDirectionalParticleResolution: { + "default": 4 + }, + forceEngine: { + "default": "d3" + }, + d3AlphaMin: { + "default": 0 + }, + d3AlphaDecay: { + "default": 0.0228, + triggerUpdate: false, + onChange: function onChange5(alphaDecay, state) { + state.d3ForceLayout.alphaDecay(alphaDecay); + } + }, + d3AlphaTarget: { + "default": 0, + triggerUpdate: false, + onChange: function onChange6(alphaTarget, state) { + state.d3ForceLayout.alphaTarget(alphaTarget); + } + }, + d3VelocityDecay: { + "default": 0.4, + triggerUpdate: false, + onChange: function onChange7(velocityDecay, state) { + state.d3ForceLayout.velocityDecay(velocityDecay); + } + }, + ngraphPhysics: { + "default": { + timeStep: 20, + gravity: -1.2, + theta: 0.8, + springLength: 30, + springCoefficient: 8e-4, + dragCoefficient: 0.02 + } + }, + warmupTicks: { + "default": 0, + triggerUpdate: false + }, + cooldownTicks: { + "default": Infinity, + triggerUpdate: false + }, + cooldownTime: { + "default": 15e3, + triggerUpdate: false + }, + onLoading: { + "default": function _default2() { + }, + triggerUpdate: false + }, + onFinishLoading: { + "default": function _default3() { + }, + triggerUpdate: false + }, + onUpdate: { + "default": function _default4() { + }, + triggerUpdate: false + }, + onFinishUpdate: { + "default": function _default5() { + }, + triggerUpdate: false + }, + onEngineTick: { + "default": function _default6() { + }, + triggerUpdate: false + }, + onEngineStop: { + "default": function _default7() { + }, + triggerUpdate: false + } + }, + methods: { + refresh: function refresh(state) { + state._flushObjects = true; + state._rerender(); + return this; + }, + d3Force: function d3Force(state, forceName, forceFn) { + if (forceFn === void 0) { + return state.d3ForceLayout.force(forceName); + } + state.d3ForceLayout.force(forceName, forceFn); + return this; + }, + d3ReheatSimulation: function d3ReheatSimulation(state) { + state.d3ForceLayout.alpha(1); + this.resetCountdown(); + return this; + }, + resetCountdown: function resetCountdown(state) { + state.cntTicks = 0; + state.startTickTime = new Date(); + state.engineRunning = true; + return this; + }, + tickFrame: function tickFrame(state) { + var isD3Sim = state.forceEngine !== "ngraph"; + if (state.engineRunning) { + layoutTick(); + } + updateArrows(); + updatePhotons(); + return this; + function layoutTick() { + if (++state.cntTicks > state.cooldownTicks || new Date() - state.startTickTime > state.cooldownTime || isD3Sim && state.d3AlphaMin > 0 && state.d3ForceLayout.alpha() < state.d3AlphaMin) { + state.engineRunning = false; + state.onEngineStop(); + } else { + state.layout[isD3Sim ? "tick" : "step"](); + state.onEngineTick(); + } + state.graphData.nodes.forEach(function(node) { + var obj = node.__threeObj; + if (!obj) + return; + var pos = isD3Sim ? node : state.layout.getNodePosition(node[state.nodeId]); + obj.position.x = pos.x; + obj.position.y = pos.y || 0; + obj.position.z = pos.z || 0; + }); + var linkWidthAccessor = accessor_fn_module_default(state.linkWidth); + var linkCurvatureAccessor = accessor_fn_module_default(state.linkCurvature); + var linkCurveRotationAccessor = accessor_fn_module_default(state.linkCurveRotation); + var linkThreeObjectExtendAccessor = accessor_fn_module_default(state.linkThreeObjectExtend); + state.graphData.links.forEach(function(link) { + var lineObj = link.__lineObj; + if (!lineObj) + return; + var pos = isD3Sim ? link : state.layout.getLinkPosition(state.layout.graph.getLink(link.source, link.target).id); + var start = pos[isD3Sim ? "source" : "from"]; + var end = pos[isD3Sim ? "target" : "to"]; + if (!start || !end || !start.hasOwnProperty("x") || !end.hasOwnProperty("x")) + return; + calcLinkCurve(link); + var extendedObj = linkThreeObjectExtendAccessor(link); + if (state.linkPositionUpdate && state.linkPositionUpdate(extendedObj ? lineObj.children[1] : lineObj, { + start: { + x: start.x, + y: start.y, + z: start.z + }, + end: { + x: end.x, + y: end.y, + z: end.z + } + }, link) && !extendedObj) { + return; + } + var curveResolution = 30; + var curve = link.__curve; + var line = lineObj.children.length ? lineObj.children[0] : lineObj; + if (line.type === "Line") { + if (!curve) { + var linePos = line.geometry.getAttribute("position"); + if (!linePos || !linePos.array || linePos.array.length !== 6) { + line.geometry[setAttributeFn]("position", linePos = new three$1.BufferAttribute(new Float32Array(2 * 3), 3)); + } + linePos.array[0] = start.x; + linePos.array[1] = start.y || 0; + linePos.array[2] = start.z || 0; + linePos.array[3] = end.x; + linePos.array[4] = end.y || 0; + linePos.array[5] = end.z || 0; + linePos.needsUpdate = true; + } else { + line.geometry.setFromPoints(curve.getPoints(curveResolution)); + } + line.geometry.computeBoundingSphere(); + } else if (line.type === "Mesh") { + if (!curve) { + if (!line.geometry.type.match(/^Cylinder(Buffer)?Geometry$/)) { + var linkWidth = Math.ceil(linkWidthAccessor(link) * 10) / 10; + var r = linkWidth / 2; + var geometry = new three$1.CylinderBufferGeometry(r, r, 1, state.linkResolution, 1, false); + geometry[applyMatrix4Fn](new three$1.Matrix4().makeTranslation(0, 1 / 2, 0)); + geometry[applyMatrix4Fn](new three$1.Matrix4().makeRotationX(Math.PI / 2)); + line.geometry.dispose(); + line.geometry = geometry; + } + var vStart = new three$1.Vector3(start.x, start.y || 0, start.z || 0); + var vEnd = new three$1.Vector3(end.x, end.y || 0, end.z || 0); + var distance = vStart.distanceTo(vEnd); + line.position.x = vStart.x; + line.position.y = vStart.y; + line.position.z = vStart.z; + line.scale.z = distance; + line.parent.localToWorld(vEnd); + line.lookAt(vEnd); + } else { + if (!line.geometry.type.match(/^Tube(Buffer)?Geometry$/)) { + line.position.set(0, 0, 0); + line.rotation.set(0, 0, 0); + line.scale.set(1, 1, 1); + } + var _linkWidth = Math.ceil(linkWidthAccessor(link) * 10) / 10; + var _r = _linkWidth / 2; + var _geometry3 = new three$1.TubeBufferGeometry(curve, curveResolution, _r, state.linkResolution, false); + line.geometry.dispose(); + line.geometry = _geometry3; + } + } + }); + function calcLinkCurve(link) { + var pos = isD3Sim ? link : state.layout.getLinkPosition(state.layout.graph.getLink(link.source, link.target).id); + var start = pos[isD3Sim ? "source" : "from"]; + var end = pos[isD3Sim ? "target" : "to"]; + if (!start || !end || !start.hasOwnProperty("x") || !end.hasOwnProperty("x")) + return; + var curvature = linkCurvatureAccessor(link); + if (!curvature) { + link.__curve = null; + } else { + var vStart = new three$1.Vector3(start.x, start.y || 0, start.z || 0); + var vEnd = new three$1.Vector3(end.x, end.y || 0, end.z || 0); + var l = vStart.distanceTo(vEnd); + var curve; + var curveRotation = linkCurveRotationAccessor(link); + if (l > 0) { + var dx = end.x - start.x; + var dy = end.y - start.y || 0; + var vLine = new three$1.Vector3().subVectors(vEnd, vStart); + var cp = vLine.clone().multiplyScalar(curvature).cross(dx !== 0 || dy !== 0 ? new three$1.Vector3(0, 0, 1) : new three$1.Vector3(0, 1, 0)).applyAxisAngle(vLine.normalize(), curveRotation).add(new three$1.Vector3().addVectors(vStart, vEnd).divideScalar(2)); + curve = new three$1.QuadraticBezierCurve3(vStart, cp, vEnd); + } else { + var d = curvature * 70; + var endAngle = -curveRotation; + var startAngle = endAngle + Math.PI / 2; + curve = new three$1.CubicBezierCurve3(vStart, new three$1.Vector3(d * Math.cos(startAngle), d * Math.sin(startAngle), 0).add(vStart), new three$1.Vector3(d * Math.cos(endAngle), d * Math.sin(endAngle), 0).add(vStart), vEnd); + } + link.__curve = curve; + } + } + } + function updateArrows() { + var arrowRelPosAccessor = accessor_fn_module_default(state.linkDirectionalArrowRelPos); + var arrowLengthAccessor = accessor_fn_module_default(state.linkDirectionalArrowLength); + var nodeValAccessor = accessor_fn_module_default(state.nodeVal); + state.graphData.links.forEach(function(link) { + var arrowObj = link.__arrowObj; + if (!arrowObj) + return; + var pos = isD3Sim ? link : state.layout.getLinkPosition(state.layout.graph.getLink(link.source, link.target).id); + var start = pos[isD3Sim ? "source" : "from"]; + var end = pos[isD3Sim ? "target" : "to"]; + if (!start || !end || !start.hasOwnProperty("x") || !end.hasOwnProperty("x")) + return; + var startR = Math.sqrt(Math.max(0, nodeValAccessor(start) || 1)) * state.nodeRelSize; + var endR = Math.sqrt(Math.max(0, nodeValAccessor(end) || 1)) * state.nodeRelSize; + var arrowLength = arrowLengthAccessor(link); + var arrowRelPos = arrowRelPosAccessor(link); + var getPosAlongLine = link.__curve ? function(t) { + return link.__curve.getPoint(t); + } : function(t) { + var iplt = function iplt2(dim, start2, end2, t2) { + return start2[dim] + (end2[dim] - start2[dim]) * t2 || 0; + }; + return { + x: iplt("x", start, end, t), + y: iplt("y", start, end, t), + z: iplt("z", start, end, t) + }; + }; + var lineLen = link.__curve ? link.__curve.getLength() : Math.sqrt(["x", "y", "z"].map(function(dim) { + return Math.pow((end[dim] || 0) - (start[dim] || 0), 2); + }).reduce(function(acc, v) { + return acc + v; + }, 0)); + var posAlongLine = startR + arrowLength + (lineLen - startR - endR - arrowLength) * arrowRelPos; + var arrowHead = getPosAlongLine(posAlongLine / lineLen); + var arrowTail = getPosAlongLine((posAlongLine - arrowLength) / lineLen); + ["x", "y", "z"].forEach(function(dim) { + return arrowObj.position[dim] = arrowTail[dim]; + }); + var headVec = _construct(three$1.Vector3, _toConsumableArray3(["x", "y", "z"].map(function(c2) { + return arrowHead[c2]; + }))); + arrowObj.parent.localToWorld(headVec); + arrowObj.lookAt(headVec); + }); + } + function updatePhotons() { + var particleSpeedAccessor = accessor_fn_module_default(state.linkDirectionalParticleSpeed); + state.graphData.links.forEach(function(link) { + var cyclePhotons = link.__photonsObj && link.__photonsObj.children; + var singleHopPhotons = link.__singleHopPhotonsObj && link.__singleHopPhotonsObj.children; + if ((!singleHopPhotons || !singleHopPhotons.length) && (!cyclePhotons || !cyclePhotons.length)) + return; + var pos = isD3Sim ? link : state.layout.getLinkPosition(state.layout.graph.getLink(link.source, link.target).id); + var start = pos[isD3Sim ? "source" : "from"]; + var end = pos[isD3Sim ? "target" : "to"]; + if (!start || !end || !start.hasOwnProperty("x") || !end.hasOwnProperty("x")) + return; + var particleSpeed = particleSpeedAccessor(link); + var getPhotonPos = link.__curve ? function(t) { + return link.__curve.getPoint(t); + } : function(t) { + var iplt = function iplt2(dim, start2, end2, t2) { + return start2[dim] + (end2[dim] - start2[dim]) * t2 || 0; + }; + return { + x: iplt("x", start, end, t), + y: iplt("y", start, end, t), + z: iplt("z", start, end, t) + }; + }; + var photons = [].concat(_toConsumableArray3(cyclePhotons || []), _toConsumableArray3(singleHopPhotons || [])); + photons.forEach(function(photon, idx) { + var singleHop = photon.parent.__linkThreeObjType === "singleHopPhotons"; + if (!photon.hasOwnProperty("__progressRatio")) { + photon.__progressRatio = singleHop ? 0 : idx / cyclePhotons.length; + } + photon.__progressRatio += particleSpeed; + if (photon.__progressRatio >= 1) { + if (!singleHop) { + photon.__progressRatio = photon.__progressRatio % 1; + } else { + photon.parent.remove(photon); + emptyObject(photon); + return; + } + } + var photonPosRatio = photon.__progressRatio; + var pos2 = getPhotonPos(photonPosRatio); + ["x", "y", "z"].forEach(function(dim) { + return photon.position[dim] = pos2[dim]; + }); + }); + }); + } + }, + emitParticle: function emitParticle(state, link) { + if (link) { + if (!link.__singleHopPhotonsObj) { + var obj = new three$1.Group(); + obj.__linkThreeObjType = "singleHopPhotons"; + link.__singleHopPhotonsObj = obj; + state.graphScene.add(obj); + } + var particleWidthAccessor = accessor_fn_module_default(state.linkDirectionalParticleWidth); + var photonR = Math.ceil(particleWidthAccessor(link) * 10) / 10 / 2; + var numSegments = state.linkDirectionalParticleResolution; + var particleGeometry = new three$1.SphereBufferGeometry(photonR, numSegments, numSegments); + var linkColorAccessor = accessor_fn_module_default(state.linkColor); + var particleColorAccessor = accessor_fn_module_default(state.linkDirectionalParticleColor); + var photonColor = particleColorAccessor(link) || linkColorAccessor(link) || "#f0f0f0"; + var materialColor = new three$1.Color(colorStr2Hex(photonColor)); + var opacity = state.linkOpacity * 3; + var particleMaterial = new three$1.MeshLambertMaterial({ + color: materialColor, + transparent: true, + opacity + }); + link.__singleHopPhotonsObj.add(new three$1.Mesh(particleGeometry, particleMaterial)); + } + return this; + }, + getGraphBbox: function getGraphBbox(state) { + var nodeFilter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { + return true; + }; + if (!state.initialised) + return null; + var bboxes = function getBboxes(obj) { + var bboxes2 = []; + if (obj.geometry) { + obj.geometry.computeBoundingBox(); + var box = new three$1.Box3(); + box.copy(obj.geometry.boundingBox).applyMatrix4(obj.matrixWorld); + bboxes2.push(box); + } + return bboxes2.concat.apply(bboxes2, _toConsumableArray3((obj.children || []).filter(function(obj2) { + return !obj2.hasOwnProperty("__graphObjType") || obj2.__graphObjType === "node" && nodeFilter(obj2.__data); + }).map(getBboxes))); + }(state.graphScene); + if (!bboxes.length) + return null; + return Object.assign.apply(Object, _toConsumableArray3(["x", "y", "z"].map(function(c2) { + return _defineProperty2({}, c2, [min(bboxes, function(bb) { + return bb.min[c2]; + }), max(bboxes, function(bb) { + return bb.max[c2]; + })]); + }))); + } + }, + stateInit: function stateInit() { + return { + d3ForceLayout: simulation_default().force("link", link_default()).force("charge", manyBody_default()).force("center", center_default()).force("dagRadial", null).stop(), + engineRunning: false + }; + }, + init: function init(threeObj, state) { + state.graphScene = threeObj; + }, + update: function update(state, changedProps) { + var hasAnyPropChanged = function hasAnyPropChanged2(propList) { + return propList.some(function(p) { + return changedProps.hasOwnProperty(p); + }); + }; + state.engineRunning = false; + state.onUpdate(); + if (state.nodeAutoColorBy !== null && hasAnyPropChanged(["nodeAutoColorBy", "graphData", "nodeColor"])) { + autoColorObjects(state.graphData.nodes, accessor_fn_module_default(state.nodeAutoColorBy), state.nodeColor); + } + if (state.linkAutoColorBy !== null && hasAnyPropChanged(["linkAutoColorBy", "graphData", "linkColor"])) { + autoColorObjects(state.graphData.links, accessor_fn_module_default(state.linkAutoColorBy), state.linkColor); + } + if (state._flushObjects || hasAnyPropChanged(["graphData", "nodeThreeObject", "nodeThreeObjectExtend", "nodeVal", "nodeColor", "nodeVisibility", "nodeRelSize", "nodeResolution", "nodeOpacity"])) { + var customObjectAccessor = accessor_fn_module_default(state.nodeThreeObject); + var customObjectExtendAccessor = accessor_fn_module_default(state.nodeThreeObjectExtend); + var valAccessor = accessor_fn_module_default(state.nodeVal); + var colorAccessor = accessor_fn_module_default(state.nodeColor); + var visibilityAccessor = accessor_fn_module_default(state.nodeVisibility); + var sphereGeometries = {}; + var sphereMaterials = {}; + threeDigest(state.graphData.nodes.filter(visibilityAccessor), state.graphScene, { + purge: state._flushObjects || hasAnyPropChanged([ + "nodeThreeObject", + "nodeThreeObjectExtend" + ]), + objFilter: function objFilter(obj) { + return obj.__graphObjType === "node"; + }, + createObj: function createObj(node) { + var customObj = customObjectAccessor(node); + var extendObj = customObjectExtendAccessor(node); + if (customObj && state.nodeThreeObject === customObj) { + customObj = customObj.clone(); + } + var obj; + if (customObj && !extendObj) { + obj = customObj; + } else { + obj = new three$1.Mesh(); + obj.__graphDefaultObj = true; + if (customObj && extendObj) { + obj.add(customObj); + } + } + obj.__graphObjType = "node"; + return obj; + }, + updateObj: function updateObj(obj, node) { + if (obj.__graphDefaultObj) { + var val = valAccessor(node) || 1; + var radius = Math.cbrt(val) * state.nodeRelSize; + var numSegments = state.nodeResolution; + if (!obj.geometry.type.match(/^Sphere(Buffer)?Geometry$/) || obj.geometry.parameters.radius !== radius || obj.geometry.parameters.widthSegments !== numSegments) { + if (!sphereGeometries.hasOwnProperty(val)) { + sphereGeometries[val] = new three$1.SphereBufferGeometry(radius, numSegments, numSegments); + } + obj.geometry.dispose(); + obj.geometry = sphereGeometries[val]; + } + var color = colorAccessor(node); + var materialColor = new three$1.Color(colorStr2Hex(color || "#ffffaa")); + var opacity = state.nodeOpacity * colorAlpha(color); + if (obj.material.type !== "MeshLambertMaterial" || !obj.material.color.equals(materialColor) || obj.material.opacity !== opacity) { + if (!sphereMaterials.hasOwnProperty(color)) { + sphereMaterials[color] = new three$1.MeshLambertMaterial({ + color: materialColor, + transparent: true, + opacity + }); + } + obj.material.dispose(); + obj.material = sphereMaterials[color]; + } + } + } + }); + } + if (state._flushObjects || hasAnyPropChanged(["graphData", "linkThreeObject", "linkThreeObjectExtend", "linkMaterial", "linkColor", "linkWidth", "linkVisibility", "linkResolution", "linkOpacity", "linkDirectionalArrowLength", "linkDirectionalArrowColor", "linkDirectionalArrowResolution", "linkDirectionalParticles", "linkDirectionalParticleWidth", "linkDirectionalParticleColor", "linkDirectionalParticleResolution"])) { + var _customObjectAccessor = accessor_fn_module_default(state.linkThreeObject); + var _customObjectExtendAccessor = accessor_fn_module_default(state.linkThreeObjectExtend); + var customMaterialAccessor = accessor_fn_module_default(state.linkMaterial); + var _visibilityAccessor = accessor_fn_module_default(state.linkVisibility); + var _colorAccessor = accessor_fn_module_default(state.linkColor); + var widthAccessor = accessor_fn_module_default(state.linkWidth); + var cylinderGeometries = {}; + var lambertLineMaterials = {}; + var basicLineMaterials = {}; + var visibleLinks = state.graphData.links.filter(_visibilityAccessor); + threeDigest(visibleLinks, state.graphScene, { + objBindAttr: "__lineObj", + purge: state._flushObjects || hasAnyPropChanged([ + "linkThreeObject", + "linkThreeObjectExtend", + "linkWidth" + ]), + objFilter: function objFilter(obj) { + return obj.__graphObjType === "link"; + }, + createObj: function createObj(link) { + var customObj = _customObjectAccessor(link); + var extendObj = _customObjectExtendAccessor(link); + if (customObj && state.linkThreeObject === customObj) { + customObj = customObj.clone(); + } + var defaultObj; + if (!customObj || extendObj) { + var useCylinder = !!widthAccessor(link); + if (useCylinder) { + defaultObj = new three$1.Mesh(); + } else { + var lineGeometry = new three$1.BufferGeometry(); + lineGeometry[setAttributeFn]("position", new three$1.BufferAttribute(new Float32Array(2 * 3), 3)); + defaultObj = new three$1.Line(lineGeometry); + } + } + var obj; + if (!customObj) { + obj = defaultObj; + obj.__graphDefaultObj = true; + } else { + if (!extendObj) { + obj = customObj; + } else { + obj = new three$1.Group(); + obj.__graphDefaultObj = true; + obj.add(defaultObj); + obj.add(customObj); + } + } + obj.renderOrder = 10; + obj.__graphObjType = "link"; + return obj; + }, + updateObj: function updateObj(updObj, link) { + if (updObj.__graphDefaultObj) { + var obj = updObj.children.length ? updObj.children[0] : updObj; + var linkWidth = Math.ceil(widthAccessor(link) * 10) / 10; + var useCylinder = !!linkWidth; + if (useCylinder) { + var r = linkWidth / 2; + var numSegments = state.linkResolution; + if (!obj.geometry.type.match(/^Cylinder(Buffer)?Geometry$/) || obj.geometry.parameters.radiusTop !== r || obj.geometry.parameters.radialSegments !== numSegments) { + if (!cylinderGeometries.hasOwnProperty(linkWidth)) { + var geometry = new three$1.CylinderBufferGeometry(r, r, 1, numSegments, 1, false); + geometry[applyMatrix4Fn](new three$1.Matrix4().makeTranslation(0, 1 / 2, 0)); + geometry[applyMatrix4Fn](new three$1.Matrix4().makeRotationX(Math.PI / 2)); + cylinderGeometries[linkWidth] = geometry; + } + obj.geometry.dispose(); + obj.geometry = cylinderGeometries[linkWidth]; + } + } + var customMaterial = customMaterialAccessor(link); + if (customMaterial) { + obj.material = customMaterial; + } else { + var color = _colorAccessor(link); + var materialColor = new three$1.Color(colorStr2Hex(color || "#f0f0f0")); + var opacity = state.linkOpacity * colorAlpha(color); + var materialType = useCylinder ? "MeshLambertMaterial" : "LineBasicMaterial"; + if (obj.material.type !== materialType || !obj.material.color.equals(materialColor) || obj.material.opacity !== opacity) { + var lineMaterials = useCylinder ? lambertLineMaterials : basicLineMaterials; + if (!lineMaterials.hasOwnProperty(color)) { + lineMaterials[color] = new three$1[materialType]({ + color: materialColor, + transparent: opacity < 1, + opacity, + depthWrite: opacity >= 1 + }); + } + obj.material.dispose(); + obj.material = lineMaterials[color]; + } + } + } + } + }); + if (state.linkDirectionalArrowLength || changedProps.hasOwnProperty("linkDirectionalArrowLength")) { + var arrowLengthAccessor = accessor_fn_module_default(state.linkDirectionalArrowLength); + var arrowColorAccessor = accessor_fn_module_default(state.linkDirectionalArrowColor); + threeDigest(visibleLinks.filter(arrowLengthAccessor), state.graphScene, { + objBindAttr: "__arrowObj", + objFilter: function objFilter(obj) { + return obj.__linkThreeObjType === "arrow"; + }, + createObj: function createObj() { + var obj = new three$1.Mesh(void 0, new three$1.MeshLambertMaterial({ + transparent: true + })); + obj.__linkThreeObjType = "arrow"; + return obj; + }, + updateObj: function updateObj(obj, link) { + var arrowLength = arrowLengthAccessor(link); + var numSegments = state.linkDirectionalArrowResolution; + if (!obj.geometry.type.match(/^Cone(Buffer)?Geometry$/) || obj.geometry.parameters.height !== arrowLength || obj.geometry.parameters.radialSegments !== numSegments) { + var coneGeometry = new three$1.ConeBufferGeometry(arrowLength * 0.25, arrowLength, numSegments); + coneGeometry.translate(0, arrowLength / 2, 0); + coneGeometry.rotateX(Math.PI / 2); + obj.geometry.dispose(); + obj.geometry = coneGeometry; + } + obj.material.color = new three$1.Color(arrowColorAccessor(link) || _colorAccessor(link) || "#f0f0f0"); + obj.material.opacity = state.linkOpacity * 3; + } + }); + } + if (state.linkDirectionalParticles || changedProps.hasOwnProperty("linkDirectionalParticles")) { + var particlesAccessor = accessor_fn_module_default(state.linkDirectionalParticles); + var particleWidthAccessor = accessor_fn_module_default(state.linkDirectionalParticleWidth); + var particleColorAccessor = accessor_fn_module_default(state.linkDirectionalParticleColor); + var particleMaterials = {}; + var particleGeometries = {}; + threeDigest(visibleLinks.filter(particlesAccessor), state.graphScene, { + objBindAttr: "__photonsObj", + objFilter: function objFilter(obj) { + return obj.__linkThreeObjType === "photons"; + }, + createObj: function createObj() { + var obj = new three$1.Group(); + obj.__linkThreeObjType = "photons"; + return obj; + }, + updateObj: function updateObj(obj, link) { + var numPhotons = Math.round(Math.abs(particlesAccessor(link))); + var curPhoton = !!obj.children.length && obj.children[0]; + var photonR = Math.ceil(particleWidthAccessor(link) * 10) / 10 / 2; + var numSegments = state.linkDirectionalParticleResolution; + var particleGeometry; + if (curPhoton && curPhoton.geometry.parameters.radius === photonR && curPhoton.geometry.parameters.widthSegments === numSegments) { + particleGeometry = curPhoton.geometry; + } else { + if (!particleGeometries.hasOwnProperty(photonR)) { + particleGeometries[photonR] = new three$1.SphereBufferGeometry(photonR, numSegments, numSegments); + } + particleGeometry = particleGeometries[photonR]; + curPhoton && curPhoton.geometry.dispose(); + } + var photonColor = particleColorAccessor(link) || _colorAccessor(link) || "#f0f0f0"; + var materialColor = new three$1.Color(colorStr2Hex(photonColor)); + var opacity = state.linkOpacity * 3; + var particleMaterial; + if (curPhoton && curPhoton.material.color.equals(materialColor) && curPhoton.material.opacity === opacity) { + particleMaterial = curPhoton.material; + } else { + if (!particleMaterials.hasOwnProperty(photonColor)) { + particleMaterials[photonColor] = new three$1.MeshLambertMaterial({ + color: materialColor, + transparent: true, + opacity + }); + } + particleMaterial = particleMaterials[photonColor]; + curPhoton && curPhoton.material.dispose(); + } + threeDigest(_toConsumableArray3(new Array(numPhotons)).map(function(_, idx) { + return { + idx + }; + }), obj, { + idAccessor: function idAccessor(d) { + return d.idx; + }, + createObj: function createObj() { + return new three$1.Mesh(particleGeometry, particleMaterial); + }, + updateObj: function updateObj2(obj2) { + obj2.geometry = particleGeometry; + obj2.material = particleMaterial; + } + }); + } + }); + } + } + state._flushObjects = false; + if (hasAnyPropChanged(["graphData", "nodeId", "linkSource", "linkTarget", "numDimensions", "forceEngine", "dagMode", "dagNodeFilter", "dagLevelDistance"])) { + state.engineRunning = false; + state.graphData.links.forEach(function(link) { + link.source = link[state.linkSource]; + link.target = link[state.linkTarget]; + }); + var isD3Sim = state.forceEngine !== "ngraph"; + var layout; + if (isD3Sim) { + (layout = state.d3ForceLayout).stop().alpha(1).numDimensions(state.numDimensions).nodes(state.graphData.nodes); + var linkForce = state.d3ForceLayout.force("link"); + if (linkForce) { + linkForce.id(function(d) { + return d[state.nodeId]; + }).links(state.graphData.links); + } + var nodeDepths = state.dagMode && getDagDepths(state.graphData, function(node) { + return node[state.nodeId]; + }, { + nodeFilter: state.dagNodeFilter, + onLoopError: state.onDagError || void 0 + }); + var maxDepth = Math.max.apply(Math, _toConsumableArray3(Object.values(nodeDepths || []))); + var dagLevelDistance = state.dagLevelDistance || state.graphData.nodes.length / (maxDepth || 1) * DAG_LEVEL_NODE_RATIO * (["radialin", "radialout"].indexOf(state.dagMode) !== -1 ? 0.7 : 1); + if (state.dagMode) { + var getFFn = function getFFn2(fix, invert) { + return function(node) { + return !fix ? void 0 : (nodeDepths[node[state.nodeId]] - maxDepth / 2) * dagLevelDistance * (invert ? -1 : 1); + }; + }; + var fxFn = getFFn(["lr", "rl"].indexOf(state.dagMode) !== -1, state.dagMode === "rl"); + var fyFn = getFFn(["td", "bu"].indexOf(state.dagMode) !== -1, state.dagMode === "td"); + var fzFn = getFFn(["zin", "zout"].indexOf(state.dagMode) !== -1, state.dagMode === "zout"); + state.graphData.nodes.filter(state.dagNodeFilter).forEach(function(node) { + node.fx = fxFn(node); + node.fy = fyFn(node); + node.fz = fzFn(node); + }); + } + state.d3ForceLayout.force("dagRadial", ["radialin", "radialout"].indexOf(state.dagMode) !== -1 ? radial_default(function(node) { + var nodeDepth = nodeDepths[node[state.nodeId]] || -1; + return (state.dagMode === "radialin" ? maxDepth - nodeDepth : nodeDepth) * dagLevelDistance; + }).strength(function(node) { + return state.dagNodeFilter(node) ? 1 : 0; + }) : null); + } else { + var _graph = ngraph.graph(); + state.graphData.nodes.forEach(function(node) { + _graph.addNode(node[state.nodeId]); + }); + state.graphData.links.forEach(function(link) { + _graph.addLink(link.source, link.target); + }); + layout = ngraph.forcelayout(_graph, _objectSpread22({ + dimensions: state.numDimensions + }, state.ngraphPhysics)); + layout.graph = _graph; + } + for (var i = 0; i < state.warmupTicks && !(isD3Sim && state.d3AlphaMin > 0 && state.d3ForceLayout.alpha() < state.d3AlphaMin); i++) { + layout[isD3Sim ? "tick" : "step"](); + } + state.layout = layout; + this.resetCountdown(); + } + state.engineRunning = true; + state.onFinishUpdate(); + } +}); +function fromKapsule(kapsule) { + var baseClass = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Object; + var initKapsuleWithSelf = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; + var FromKapsule = /* @__PURE__ */ function(_baseClass) { + _inherits(FromKapsule2, _baseClass); + var _super = _createSuper(FromKapsule2); + function FromKapsule2() { + var _this; + _classCallCheck2(this, FromKapsule2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _this.__kapsuleInstance = kapsule().apply(void 0, [].concat(_toConsumableArray3(initKapsuleWithSelf ? [_assertThisInitialized(_this)] : []), args)); + return _this; + } + return _createClass2(FromKapsule2); + }(baseClass); + Object.keys(kapsule()).forEach(function(m2) { + return FromKapsule.prototype[m2] = function() { + var _this$__kapsuleInstan; + var returnVal = (_this$__kapsuleInstan = this.__kapsuleInstance)[m2].apply(_this$__kapsuleInstan, arguments); + return returnVal === this.__kapsuleInstance ? this : returnVal; + }; + }); + return FromKapsule; +} +var three = window.THREE ? window.THREE : { + Group +}; +var threeForcegraph = fromKapsule(ForceGraph, three.Group, true); + +// node_modules/three/examples/jsm/controls/TrackballControls.js +var _changeEvent = { type: "change" }; +var _startEvent = { type: "start" }; +var _endEvent = { type: "end" }; +var TrackballControls = class extends EventDispatcher { + constructor(object, domElement) { + super(); + if (domElement === void 0) + console.warn('THREE.TrackballControls: The second parameter "domElement" is now mandatory.'); + if (domElement === document) + console.error('THREE.TrackballControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'); + const scope = this; + const STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 }; + this.object = object; + this.domElement = domElement; + this.domElement.style.touchAction = "none"; + this.enabled = true; + this.screen = { left: 0, top: 0, width: 0, height: 0 }; + this.rotateSpeed = 1; + this.zoomSpeed = 1.2; + this.panSpeed = 0.3; + this.noRotate = false; + this.noZoom = false; + this.noPan = false; + this.staticMoving = false; + this.dynamicDampingFactor = 0.2; + this.minDistance = 0; + this.maxDistance = Infinity; + this.keys = ["KeyA", "KeyS", "KeyD"]; + this.mouseButtons = { LEFT: MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN }; + this.target = new Vector3(); + const EPS = 1e-6; + const lastPosition = new Vector3(); + let lastZoom = 1; + let _state = STATE.NONE, _keyState = STATE.NONE, _touchZoomDistanceStart = 0, _touchZoomDistanceEnd = 0, _lastAngle = 0; + const _eye = new Vector3(), _movePrev = new Vector2(), _moveCurr = new Vector2(), _lastAxis = new Vector3(), _zoomStart = new Vector2(), _zoomEnd = new Vector2(), _panStart = new Vector2(), _panEnd = new Vector2(), _pointers = [], _pointerPositions = {}; + this.target0 = this.target.clone(); + this.position0 = this.object.position.clone(); + this.up0 = this.object.up.clone(); + this.zoom0 = this.object.zoom; + this.handleResize = function() { + const box = scope.domElement.getBoundingClientRect(); + const d = scope.domElement.ownerDocument.documentElement; + scope.screen.left = box.left + window.pageXOffset - d.clientLeft; + scope.screen.top = box.top + window.pageYOffset - d.clientTop; + scope.screen.width = box.width; + scope.screen.height = box.height; + }; + const getMouseOnScreen = function() { + const vector = new Vector2(); + return function getMouseOnScreen2(pageX, pageY) { + vector.set((pageX - scope.screen.left) / scope.screen.width, (pageY - scope.screen.top) / scope.screen.height); + return vector; + }; + }(); + const getMouseOnCircle = function() { + const vector = new Vector2(); + return function getMouseOnCircle2(pageX, pageY) { + vector.set((pageX - scope.screen.width * 0.5 - scope.screen.left) / (scope.screen.width * 0.5), (scope.screen.height + 2 * (scope.screen.top - pageY)) / scope.screen.width); + return vector; + }; + }(); + this.rotateCamera = function() { + const axis = new Vector3(), quaternion = new Quaternion(), eyeDirection = new Vector3(), objectUpDirection = new Vector3(), objectSidewaysDirection = new Vector3(), moveDirection = new Vector3(); + return function rotateCamera() { + moveDirection.set(_moveCurr.x - _movePrev.x, _moveCurr.y - _movePrev.y, 0); + let angle = moveDirection.length(); + if (angle) { + _eye.copy(scope.object.position).sub(scope.target); + eyeDirection.copy(_eye).normalize(); + objectUpDirection.copy(scope.object.up).normalize(); + objectSidewaysDirection.crossVectors(objectUpDirection, eyeDirection).normalize(); + objectUpDirection.setLength(_moveCurr.y - _movePrev.y); + objectSidewaysDirection.setLength(_moveCurr.x - _movePrev.x); + moveDirection.copy(objectUpDirection.add(objectSidewaysDirection)); + axis.crossVectors(moveDirection, _eye).normalize(); + angle *= scope.rotateSpeed; + quaternion.setFromAxisAngle(axis, angle); + _eye.applyQuaternion(quaternion); + scope.object.up.applyQuaternion(quaternion); + _lastAxis.copy(axis); + _lastAngle = angle; + } else if (!scope.staticMoving && _lastAngle) { + _lastAngle *= Math.sqrt(1 - scope.dynamicDampingFactor); + _eye.copy(scope.object.position).sub(scope.target); + quaternion.setFromAxisAngle(_lastAxis, _lastAngle); + _eye.applyQuaternion(quaternion); + scope.object.up.applyQuaternion(quaternion); + } + _movePrev.copy(_moveCurr); + }; + }(); + this.zoomCamera = function() { + let factor; + if (_state === STATE.TOUCH_ZOOM_PAN) { + factor = _touchZoomDistanceStart / _touchZoomDistanceEnd; + _touchZoomDistanceStart = _touchZoomDistanceEnd; + if (scope.object.isPerspectiveCamera) { + _eye.multiplyScalar(factor); + } else if (scope.object.isOrthographicCamera) { + scope.object.zoom /= factor; + scope.object.updateProjectionMatrix(); + } else { + console.warn("THREE.TrackballControls: Unsupported camera type"); + } + } else { + factor = 1 + (_zoomEnd.y - _zoomStart.y) * scope.zoomSpeed; + if (factor !== 1 && factor > 0) { + if (scope.object.isPerspectiveCamera) { + _eye.multiplyScalar(factor); + } else if (scope.object.isOrthographicCamera) { + scope.object.zoom /= factor; + scope.object.updateProjectionMatrix(); + } else { + console.warn("THREE.TrackballControls: Unsupported camera type"); + } + } + if (scope.staticMoving) { + _zoomStart.copy(_zoomEnd); + } else { + _zoomStart.y += (_zoomEnd.y - _zoomStart.y) * this.dynamicDampingFactor; + } + } + }; + this.panCamera = function() { + const mouseChange = new Vector2(), objectUp = new Vector3(), pan = new Vector3(); + return function panCamera() { + mouseChange.copy(_panEnd).sub(_panStart); + if (mouseChange.lengthSq()) { + if (scope.object.isOrthographicCamera) { + const scale_x = (scope.object.right - scope.object.left) / scope.object.zoom / scope.domElement.clientWidth; + const scale_y = (scope.object.top - scope.object.bottom) / scope.object.zoom / scope.domElement.clientWidth; + mouseChange.x *= scale_x; + mouseChange.y *= scale_y; + } + mouseChange.multiplyScalar(_eye.length() * scope.panSpeed); + pan.copy(_eye).cross(scope.object.up).setLength(mouseChange.x); + pan.add(objectUp.copy(scope.object.up).setLength(mouseChange.y)); + scope.object.position.add(pan); + scope.target.add(pan); + if (scope.staticMoving) { + _panStart.copy(_panEnd); + } else { + _panStart.add(mouseChange.subVectors(_panEnd, _panStart).multiplyScalar(scope.dynamicDampingFactor)); + } + } + }; + }(); + this.checkDistances = function() { + if (!scope.noZoom || !scope.noPan) { + if (_eye.lengthSq() > scope.maxDistance * scope.maxDistance) { + scope.object.position.addVectors(scope.target, _eye.setLength(scope.maxDistance)); + _zoomStart.copy(_zoomEnd); + } + if (_eye.lengthSq() < scope.minDistance * scope.minDistance) { + scope.object.position.addVectors(scope.target, _eye.setLength(scope.minDistance)); + _zoomStart.copy(_zoomEnd); + } + } + }; + this.update = function() { + _eye.subVectors(scope.object.position, scope.target); + if (!scope.noRotate) { + scope.rotateCamera(); + } + if (!scope.noZoom) { + scope.zoomCamera(); + } + if (!scope.noPan) { + scope.panCamera(); + } + scope.object.position.addVectors(scope.target, _eye); + if (scope.object.isPerspectiveCamera) { + scope.checkDistances(); + scope.object.lookAt(scope.target); + if (lastPosition.distanceToSquared(scope.object.position) > EPS) { + scope.dispatchEvent(_changeEvent); + lastPosition.copy(scope.object.position); + } + } else if (scope.object.isOrthographicCamera) { + scope.object.lookAt(scope.target); + if (lastPosition.distanceToSquared(scope.object.position) > EPS || lastZoom !== scope.object.zoom) { + scope.dispatchEvent(_changeEvent); + lastPosition.copy(scope.object.position); + lastZoom = scope.object.zoom; + } + } else { + console.warn("THREE.TrackballControls: Unsupported camera type"); + } + }; + this.reset = function() { + _state = STATE.NONE; + _keyState = STATE.NONE; + scope.target.copy(scope.target0); + scope.object.position.copy(scope.position0); + scope.object.up.copy(scope.up0); + scope.object.zoom = scope.zoom0; + scope.object.updateProjectionMatrix(); + _eye.subVectors(scope.object.position, scope.target); + scope.object.lookAt(scope.target); + scope.dispatchEvent(_changeEvent); + lastPosition.copy(scope.object.position); + lastZoom = scope.object.zoom; + }; + function onPointerDown(event) { + if (scope.enabled === false) + return; + if (_pointers.length === 0) { + scope.domElement.setPointerCapture(event.pointerId); + scope.domElement.addEventListener("pointermove", onPointerMove); + scope.domElement.addEventListener("pointerup", onPointerUp); + } + addPointer(event); + if (event.pointerType === "touch") { + onTouchStart(event); + } else { + onMouseDown(event); + } + } + function onPointerMove(event) { + if (scope.enabled === false) + return; + if (event.pointerType === "touch") { + onTouchMove(event); + } else { + onMouseMove(event); + } + } + function onPointerUp(event) { + if (scope.enabled === false) + return; + if (event.pointerType === "touch") { + onTouchEnd(event); + } else { + onMouseUp(); + } + removePointer(event); + if (_pointers.length === 0) { + scope.domElement.releasePointerCapture(event.pointerId); + scope.domElement.removeEventListener("pointermove", onPointerMove); + scope.domElement.removeEventListener("pointerup", onPointerUp); + } + } + function onPointerCancel(event) { + removePointer(event); + } + function keydown(event) { + if (scope.enabled === false) + return; + window.removeEventListener("keydown", keydown); + if (_keyState !== STATE.NONE) { + return; + } else if (event.code === scope.keys[STATE.ROTATE] && !scope.noRotate) { + _keyState = STATE.ROTATE; + } else if (event.code === scope.keys[STATE.ZOOM] && !scope.noZoom) { + _keyState = STATE.ZOOM; + } else if (event.code === scope.keys[STATE.PAN] && !scope.noPan) { + _keyState = STATE.PAN; + } + } + function keyup() { + if (scope.enabled === false) + return; + _keyState = STATE.NONE; + window.addEventListener("keydown", keydown); + } + function onMouseDown(event) { + if (_state === STATE.NONE) { + switch (event.button) { + case scope.mouseButtons.LEFT: + _state = STATE.ROTATE; + break; + case scope.mouseButtons.MIDDLE: + _state = STATE.ZOOM; + break; + case scope.mouseButtons.RIGHT: + _state = STATE.PAN; + break; + } + } + const state = _keyState !== STATE.NONE ? _keyState : _state; + if (state === STATE.ROTATE && !scope.noRotate) { + _moveCurr.copy(getMouseOnCircle(event.pageX, event.pageY)); + _movePrev.copy(_moveCurr); + } else if (state === STATE.ZOOM && !scope.noZoom) { + _zoomStart.copy(getMouseOnScreen(event.pageX, event.pageY)); + _zoomEnd.copy(_zoomStart); + } else if (state === STATE.PAN && !scope.noPan) { + _panStart.copy(getMouseOnScreen(event.pageX, event.pageY)); + _panEnd.copy(_panStart); + } + scope.dispatchEvent(_startEvent); + } + function onMouseMove(event) { + const state = _keyState !== STATE.NONE ? _keyState : _state; + if (state === STATE.ROTATE && !scope.noRotate) { + _movePrev.copy(_moveCurr); + _moveCurr.copy(getMouseOnCircle(event.pageX, event.pageY)); + } else if (state === STATE.ZOOM && !scope.noZoom) { + _zoomEnd.copy(getMouseOnScreen(event.pageX, event.pageY)); + } else if (state === STATE.PAN && !scope.noPan) { + _panEnd.copy(getMouseOnScreen(event.pageX, event.pageY)); + } + } + function onMouseUp() { + _state = STATE.NONE; + scope.dispatchEvent(_endEvent); + } + function onMouseWheel(event) { + if (scope.enabled === false) + return; + if (scope.noZoom === true) + return; + event.preventDefault(); + switch (event.deltaMode) { + case 2: + _zoomStart.y -= event.deltaY * 0.025; + break; + case 1: + _zoomStart.y -= event.deltaY * 0.01; + break; + default: + _zoomStart.y -= event.deltaY * 25e-5; + break; + } + scope.dispatchEvent(_startEvent); + scope.dispatchEvent(_endEvent); + } + function onTouchStart(event) { + trackPointer(event); + switch (_pointers.length) { + case 1: + _state = STATE.TOUCH_ROTATE; + _moveCurr.copy(getMouseOnCircle(_pointers[0].pageX, _pointers[0].pageY)); + _movePrev.copy(_moveCurr); + break; + default: + _state = STATE.TOUCH_ZOOM_PAN; + const dx = _pointers[0].pageX - _pointers[1].pageX; + const dy = _pointers[0].pageY - _pointers[1].pageY; + _touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt(dx * dx + dy * dy); + const x2 = (_pointers[0].pageX + _pointers[1].pageX) / 2; + const y2 = (_pointers[0].pageY + _pointers[1].pageY) / 2; + _panStart.copy(getMouseOnScreen(x2, y2)); + _panEnd.copy(_panStart); + break; + } + scope.dispatchEvent(_startEvent); + } + function onTouchMove(event) { + trackPointer(event); + switch (_pointers.length) { + case 1: + _movePrev.copy(_moveCurr); + _moveCurr.copy(getMouseOnCircle(event.pageX, event.pageY)); + break; + default: + const position = getSecondPointerPosition(event); + const dx = event.pageX - position.x; + const dy = event.pageY - position.y; + _touchZoomDistanceEnd = Math.sqrt(dx * dx + dy * dy); + const x2 = (event.pageX + position.x) / 2; + const y2 = (event.pageY + position.y) / 2; + _panEnd.copy(getMouseOnScreen(x2, y2)); + break; + } + } + function onTouchEnd(event) { + switch (_pointers.length) { + case 0: + _state = STATE.NONE; + break; + case 1: + _state = STATE.TOUCH_ROTATE; + _moveCurr.copy(getMouseOnCircle(event.pageX, event.pageY)); + _movePrev.copy(_moveCurr); + break; + case 2: + _state = STATE.TOUCH_ZOOM_PAN; + _moveCurr.copy(getMouseOnCircle(event.pageX - _movePrev.x, event.pageY - _movePrev.y)); + _movePrev.copy(_moveCurr); + break; + } + scope.dispatchEvent(_endEvent); + } + function contextmenu2(event) { + if (scope.enabled === false) + return; + event.preventDefault(); + } + function addPointer(event) { + _pointers.push(event); + } + function removePointer(event) { + delete _pointerPositions[event.pointerId]; + for (let i = 0; i < _pointers.length; i++) { + if (_pointers[i].pointerId == event.pointerId) { + _pointers.splice(i, 1); + return; + } + } + } + function trackPointer(event) { + let position = _pointerPositions[event.pointerId]; + if (position === void 0) { + position = new Vector2(); + _pointerPositions[event.pointerId] = position; + } + position.set(event.pageX, event.pageY); + } + function getSecondPointerPosition(event) { + const pointer = event.pointerId === _pointers[0].pointerId ? _pointers[1] : _pointers[0]; + return _pointerPositions[pointer.pointerId]; + } + this.dispose = function() { + scope.domElement.removeEventListener("contextmenu", contextmenu2); + scope.domElement.removeEventListener("pointerdown", onPointerDown); + scope.domElement.removeEventListener("pointercancel", onPointerCancel); + scope.domElement.removeEventListener("wheel", onMouseWheel); + scope.domElement.removeEventListener("pointermove", onPointerMove); + scope.domElement.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("keydown", keydown); + window.removeEventListener("keyup", keyup); + }; + this.domElement.addEventListener("contextmenu", contextmenu2); + this.domElement.addEventListener("pointerdown", onPointerDown); + this.domElement.addEventListener("pointercancel", onPointerCancel); + this.domElement.addEventListener("wheel", onMouseWheel, { passive: false }); + window.addEventListener("keydown", keydown); + window.addEventListener("keyup", keyup); + this.handleResize(); + this.update(); + } +}; + +// node_modules/three/examples/jsm/controls/OrbitControls.js +var _changeEvent2 = { type: "change" }; +var _startEvent2 = { type: "start" }; +var _endEvent2 = { type: "end" }; +var OrbitControls = class extends EventDispatcher { + constructor(object, domElement) { + super(); + if (domElement === void 0) + console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'); + if (domElement === document) + console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'); + this.object = object; + this.domElement = domElement; + this.domElement.style.touchAction = "none"; + this.enabled = true; + this.target = new Vector3(); + this.minDistance = 0; + this.maxDistance = Infinity; + this.minZoom = 0; + this.maxZoom = Infinity; + this.minPolarAngle = 0; + this.maxPolarAngle = Math.PI; + this.minAzimuthAngle = -Infinity; + this.maxAzimuthAngle = Infinity; + this.enableDamping = false; + this.dampingFactor = 0.05; + this.enableZoom = true; + this.zoomSpeed = 1; + this.enableRotate = true; + this.rotateSpeed = 1; + this.enablePan = true; + this.panSpeed = 1; + this.screenSpacePanning = true; + this.keyPanSpeed = 7; + this.autoRotate = false; + this.autoRotateSpeed = 2; + this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }; + this.mouseButtons = { LEFT: MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN }; + this.touches = { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN }; + this.target0 = this.target.clone(); + this.position0 = this.object.position.clone(); + this.zoom0 = this.object.zoom; + this._domElementKeyEvents = null; + this.getPolarAngle = function() { + return spherical.phi; + }; + this.getAzimuthalAngle = function() { + return spherical.theta; + }; + this.getDistance = function() { + return this.object.position.distanceTo(this.target); + }; + this.listenToKeyEvents = function(domElement2) { + domElement2.addEventListener("keydown", onKeyDown); + this._domElementKeyEvents = domElement2; + }; + this.saveState = function() { + scope.target0.copy(scope.target); + scope.position0.copy(scope.object.position); + scope.zoom0 = scope.object.zoom; + }; + this.reset = function() { + scope.target.copy(scope.target0); + scope.object.position.copy(scope.position0); + scope.object.zoom = scope.zoom0; + scope.object.updateProjectionMatrix(); + scope.dispatchEvent(_changeEvent2); + scope.update(); + state = STATE.NONE; + }; + this.update = function() { + const offset = new Vector3(); + const quat = new Quaternion().setFromUnitVectors(object.up, new Vector3(0, 1, 0)); + const quatInverse = quat.clone().invert(); + const lastPosition = new Vector3(); + const lastQuaternion = new Quaternion(); + const twoPI = 2 * Math.PI; + return function update4() { + const position = scope.object.position; + offset.copy(position).sub(scope.target); + offset.applyQuaternion(quat); + spherical.setFromVector3(offset); + if (scope.autoRotate && state === STATE.NONE) { + rotateLeft(getAutoRotationAngle()); + } + if (scope.enableDamping) { + spherical.theta += sphericalDelta.theta * scope.dampingFactor; + spherical.phi += sphericalDelta.phi * scope.dampingFactor; + } else { + spherical.theta += sphericalDelta.theta; + spherical.phi += sphericalDelta.phi; + } + let min2 = scope.minAzimuthAngle; + let max2 = scope.maxAzimuthAngle; + if (isFinite(min2) && isFinite(max2)) { + if (min2 < -Math.PI) + min2 += twoPI; + else if (min2 > Math.PI) + min2 -= twoPI; + if (max2 < -Math.PI) + max2 += twoPI; + else if (max2 > Math.PI) + max2 -= twoPI; + if (min2 <= max2) { + spherical.theta = Math.max(min2, Math.min(max2, spherical.theta)); + } else { + spherical.theta = spherical.theta > (min2 + max2) / 2 ? Math.max(min2, spherical.theta) : Math.min(max2, spherical.theta); + } + } + spherical.phi = Math.max(scope.minPolarAngle, Math.min(scope.maxPolarAngle, spherical.phi)); + spherical.makeSafe(); + spherical.radius *= scale; + spherical.radius = Math.max(scope.minDistance, Math.min(scope.maxDistance, spherical.radius)); + if (scope.enableDamping === true) { + scope.target.addScaledVector(panOffset, scope.dampingFactor); + } else { + scope.target.add(panOffset); + } + offset.setFromSpherical(spherical); + offset.applyQuaternion(quatInverse); + position.copy(scope.target).add(offset); + scope.object.lookAt(scope.target); + if (scope.enableDamping === true) { + sphericalDelta.theta *= 1 - scope.dampingFactor; + sphericalDelta.phi *= 1 - scope.dampingFactor; + panOffset.multiplyScalar(1 - scope.dampingFactor); + } else { + sphericalDelta.set(0, 0, 0); + panOffset.set(0, 0, 0); + } + scale = 1; + if (zoomChanged || lastPosition.distanceToSquared(scope.object.position) > EPS || 8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS) { + scope.dispatchEvent(_changeEvent2); + lastPosition.copy(scope.object.position); + lastQuaternion.copy(scope.object.quaternion); + zoomChanged = false; + return true; + } + return false; + }; + }(); + this.dispose = function() { + scope.domElement.removeEventListener("contextmenu", onContextMenu); + scope.domElement.removeEventListener("pointerdown", onPointerDown); + scope.domElement.removeEventListener("pointercancel", onPointerCancel); + scope.domElement.removeEventListener("wheel", onMouseWheel); + scope.domElement.removeEventListener("pointermove", onPointerMove); + scope.domElement.removeEventListener("pointerup", onPointerUp); + if (scope._domElementKeyEvents !== null) { + scope._domElementKeyEvents.removeEventListener("keydown", onKeyDown); + } + }; + const scope = this; + const STATE = { + NONE: -1, + ROTATE: 0, + DOLLY: 1, + PAN: 2, + TOUCH_ROTATE: 3, + TOUCH_PAN: 4, + TOUCH_DOLLY_PAN: 5, + TOUCH_DOLLY_ROTATE: 6 + }; + let state = STATE.NONE; + const EPS = 1e-6; + const spherical = new Spherical(); + const sphericalDelta = new Spherical(); + let scale = 1; + const panOffset = new Vector3(); + let zoomChanged = false; + const rotateStart = new Vector2(); + const rotateEnd = new Vector2(); + const rotateDelta = new Vector2(); + const panStart = new Vector2(); + const panEnd = new Vector2(); + const panDelta = new Vector2(); + const dollyStart = new Vector2(); + const dollyEnd = new Vector2(); + const dollyDelta = new Vector2(); + const pointers = []; + const pointerPositions = {}; + function getAutoRotationAngle() { + return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed; + } + function getZoomScale() { + return Math.pow(0.95, scope.zoomSpeed); + } + function rotateLeft(angle) { + sphericalDelta.theta -= angle; + } + function rotateUp(angle) { + sphericalDelta.phi -= angle; + } + const panLeft = function() { + const v = new Vector3(); + return function panLeft2(distance, objectMatrix) { + v.setFromMatrixColumn(objectMatrix, 0); + v.multiplyScalar(-distance); + panOffset.add(v); + }; + }(); + const panUp = function() { + const v = new Vector3(); + return function panUp2(distance, objectMatrix) { + if (scope.screenSpacePanning === true) { + v.setFromMatrixColumn(objectMatrix, 1); + } else { + v.setFromMatrixColumn(objectMatrix, 0); + v.crossVectors(scope.object.up, v); + } + v.multiplyScalar(distance); + panOffset.add(v); + }; + }(); + const pan = function() { + const offset = new Vector3(); + return function pan2(deltaX, deltaY) { + const element = scope.domElement; + if (scope.object.isPerspectiveCamera) { + const position = scope.object.position; + offset.copy(position).sub(scope.target); + let targetDistance = offset.length(); + targetDistance *= Math.tan(scope.object.fov / 2 * Math.PI / 180); + panLeft(2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix); + panUp(2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix); + } else if (scope.object.isOrthographicCamera) { + panLeft(deltaX * (scope.object.right - scope.object.left) / scope.object.zoom / element.clientWidth, scope.object.matrix); + panUp(deltaY * (scope.object.top - scope.object.bottom) / scope.object.zoom / element.clientHeight, scope.object.matrix); + } else { + console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."); + scope.enablePan = false; + } + }; + }(); + function dollyOut(dollyScale) { + if (scope.object.isPerspectiveCamera) { + scale /= dollyScale; + } else if (scope.object.isOrthographicCamera) { + scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom * dollyScale)); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + } else { + console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."); + scope.enableZoom = false; + } + } + function dollyIn(dollyScale) { + if (scope.object.isPerspectiveCamera) { + scale *= dollyScale; + } else if (scope.object.isOrthographicCamera) { + scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / dollyScale)); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + } else { + console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."); + scope.enableZoom = false; + } + } + function handleMouseDownRotate(event) { + rotateStart.set(event.clientX, event.clientY); + } + function handleMouseDownDolly(event) { + dollyStart.set(event.clientX, event.clientY); + } + function handleMouseDownPan(event) { + panStart.set(event.clientX, event.clientY); + } + function handleMouseMoveRotate(event) { + rotateEnd.set(event.clientX, event.clientY); + rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed); + const element = scope.domElement; + rotateLeft(2 * Math.PI * rotateDelta.x / element.clientHeight); + rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight); + rotateStart.copy(rotateEnd); + scope.update(); + } + function handleMouseMoveDolly(event) { + dollyEnd.set(event.clientX, event.clientY); + dollyDelta.subVectors(dollyEnd, dollyStart); + if (dollyDelta.y > 0) { + dollyOut(getZoomScale()); + } else if (dollyDelta.y < 0) { + dollyIn(getZoomScale()); + } + dollyStart.copy(dollyEnd); + scope.update(); + } + function handleMouseMovePan(event) { + panEnd.set(event.clientX, event.clientY); + panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed); + pan(panDelta.x, panDelta.y); + panStart.copy(panEnd); + scope.update(); + } + function handleMouseWheel(event) { + if (event.deltaY < 0) { + dollyIn(getZoomScale()); + } else if (event.deltaY > 0) { + dollyOut(getZoomScale()); + } + scope.update(); + } + function handleKeyDown(event) { + let needsUpdate = false; + switch (event.code) { + case scope.keys.UP: + pan(0, scope.keyPanSpeed); + needsUpdate = true; + break; + case scope.keys.BOTTOM: + pan(0, -scope.keyPanSpeed); + needsUpdate = true; + break; + case scope.keys.LEFT: + pan(scope.keyPanSpeed, 0); + needsUpdate = true; + break; + case scope.keys.RIGHT: + pan(-scope.keyPanSpeed, 0); + needsUpdate = true; + break; + } + if (needsUpdate) { + event.preventDefault(); + scope.update(); + } + } + function handleTouchStartRotate() { + if (pointers.length === 1) { + rotateStart.set(pointers[0].pageX, pointers[0].pageY); + } else { + const x2 = 0.5 * (pointers[0].pageX + pointers[1].pageX); + const y2 = 0.5 * (pointers[0].pageY + pointers[1].pageY); + rotateStart.set(x2, y2); + } + } + function handleTouchStartPan() { + if (pointers.length === 1) { + panStart.set(pointers[0].pageX, pointers[0].pageY); + } else { + const x2 = 0.5 * (pointers[0].pageX + pointers[1].pageX); + const y2 = 0.5 * (pointers[0].pageY + pointers[1].pageY); + panStart.set(x2, y2); + } + } + function handleTouchStartDolly() { + const dx = pointers[0].pageX - pointers[1].pageX; + const dy = pointers[0].pageY - pointers[1].pageY; + const distance = Math.sqrt(dx * dx + dy * dy); + dollyStart.set(0, distance); + } + function handleTouchStartDollyPan() { + if (scope.enableZoom) + handleTouchStartDolly(); + if (scope.enablePan) + handleTouchStartPan(); + } + function handleTouchStartDollyRotate() { + if (scope.enableZoom) + handleTouchStartDolly(); + if (scope.enableRotate) + handleTouchStartRotate(); + } + function handleTouchMoveRotate(event) { + if (pointers.length == 1) { + rotateEnd.set(event.pageX, event.pageY); + } else { + const position = getSecondPointerPosition(event); + const x2 = 0.5 * (event.pageX + position.x); + const y2 = 0.5 * (event.pageY + position.y); + rotateEnd.set(x2, y2); + } + rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed); + const element = scope.domElement; + rotateLeft(2 * Math.PI * rotateDelta.x / element.clientHeight); + rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight); + rotateStart.copy(rotateEnd); + } + function handleTouchMovePan(event) { + if (pointers.length === 1) { + panEnd.set(event.pageX, event.pageY); + } else { + const position = getSecondPointerPosition(event); + const x2 = 0.5 * (event.pageX + position.x); + const y2 = 0.5 * (event.pageY + position.y); + panEnd.set(x2, y2); + } + panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed); + pan(panDelta.x, panDelta.y); + panStart.copy(panEnd); + } + function handleTouchMoveDolly(event) { + const position = getSecondPointerPosition(event); + const dx = event.pageX - position.x; + const dy = event.pageY - position.y; + const distance = Math.sqrt(dx * dx + dy * dy); + dollyEnd.set(0, distance); + dollyDelta.set(0, Math.pow(dollyEnd.y / dollyStart.y, scope.zoomSpeed)); + dollyOut(dollyDelta.y); + dollyStart.copy(dollyEnd); + } + function handleTouchMoveDollyPan(event) { + if (scope.enableZoom) + handleTouchMoveDolly(event); + if (scope.enablePan) + handleTouchMovePan(event); + } + function handleTouchMoveDollyRotate(event) { + if (scope.enableZoom) + handleTouchMoveDolly(event); + if (scope.enableRotate) + handleTouchMoveRotate(event); + } + function onPointerDown(event) { + if (scope.enabled === false) + return; + if (pointers.length === 0) { + scope.domElement.setPointerCapture(event.pointerId); + scope.domElement.addEventListener("pointermove", onPointerMove); + scope.domElement.addEventListener("pointerup", onPointerUp); + } + addPointer(event); + if (event.pointerType === "touch") { + onTouchStart(event); + } else { + onMouseDown(event); + } + } + function onPointerMove(event) { + if (scope.enabled === false) + return; + if (event.pointerType === "touch") { + onTouchMove(event); + } else { + onMouseMove(event); + } + } + function onPointerUp(event) { + removePointer(event); + if (pointers.length === 0) { + scope.domElement.releasePointerCapture(event.pointerId); + scope.domElement.removeEventListener("pointermove", onPointerMove); + scope.domElement.removeEventListener("pointerup", onPointerUp); + } + scope.dispatchEvent(_endEvent2); + state = STATE.NONE; + } + function onPointerCancel(event) { + removePointer(event); + } + function onMouseDown(event) { + let mouseAction; + switch (event.button) { + case 0: + mouseAction = scope.mouseButtons.LEFT; + break; + case 1: + mouseAction = scope.mouseButtons.MIDDLE; + break; + case 2: + mouseAction = scope.mouseButtons.RIGHT; + break; + default: + mouseAction = -1; + } + switch (mouseAction) { + case MOUSE.DOLLY: + if (scope.enableZoom === false) + return; + handleMouseDownDolly(event); + state = STATE.DOLLY; + break; + case MOUSE.ROTATE: + if (event.ctrlKey || event.metaKey || event.shiftKey) { + if (scope.enablePan === false) + return; + handleMouseDownPan(event); + state = STATE.PAN; + } else { + if (scope.enableRotate === false) + return; + handleMouseDownRotate(event); + state = STATE.ROTATE; + } + break; + case MOUSE.PAN: + if (event.ctrlKey || event.metaKey || event.shiftKey) { + if (scope.enableRotate === false) + return; + handleMouseDownRotate(event); + state = STATE.ROTATE; + } else { + if (scope.enablePan === false) + return; + handleMouseDownPan(event); + state = STATE.PAN; + } + break; + default: + state = STATE.NONE; + } + if (state !== STATE.NONE) { + scope.dispatchEvent(_startEvent2); + } + } + function onMouseMove(event) { + switch (state) { + case STATE.ROTATE: + if (scope.enableRotate === false) + return; + handleMouseMoveRotate(event); + break; + case STATE.DOLLY: + if (scope.enableZoom === false) + return; + handleMouseMoveDolly(event); + break; + case STATE.PAN: + if (scope.enablePan === false) + return; + handleMouseMovePan(event); + break; + } + } + function onMouseWheel(event) { + if (scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE) + return; + event.preventDefault(); + scope.dispatchEvent(_startEvent2); + handleMouseWheel(event); + scope.dispatchEvent(_endEvent2); + } + function onKeyDown(event) { + if (scope.enabled === false || scope.enablePan === false) + return; + handleKeyDown(event); + } + function onTouchStart(event) { + trackPointer(event); + switch (pointers.length) { + case 1: + switch (scope.touches.ONE) { + case TOUCH.ROTATE: + if (scope.enableRotate === false) + return; + handleTouchStartRotate(); + state = STATE.TOUCH_ROTATE; + break; + case TOUCH.PAN: + if (scope.enablePan === false) + return; + handleTouchStartPan(); + state = STATE.TOUCH_PAN; + break; + default: + state = STATE.NONE; + } + break; + case 2: + switch (scope.touches.TWO) { + case TOUCH.DOLLY_PAN: + if (scope.enableZoom === false && scope.enablePan === false) + return; + handleTouchStartDollyPan(); + state = STATE.TOUCH_DOLLY_PAN; + break; + case TOUCH.DOLLY_ROTATE: + if (scope.enableZoom === false && scope.enableRotate === false) + return; + handleTouchStartDollyRotate(); + state = STATE.TOUCH_DOLLY_ROTATE; + break; + default: + state = STATE.NONE; + } + break; + default: + state = STATE.NONE; + } + if (state !== STATE.NONE) { + scope.dispatchEvent(_startEvent2); + } + } + function onTouchMove(event) { + trackPointer(event); + switch (state) { + case STATE.TOUCH_ROTATE: + if (scope.enableRotate === false) + return; + handleTouchMoveRotate(event); + scope.update(); + break; + case STATE.TOUCH_PAN: + if (scope.enablePan === false) + return; + handleTouchMovePan(event); + scope.update(); + break; + case STATE.TOUCH_DOLLY_PAN: + if (scope.enableZoom === false && scope.enablePan === false) + return; + handleTouchMoveDollyPan(event); + scope.update(); + break; + case STATE.TOUCH_DOLLY_ROTATE: + if (scope.enableZoom === false && scope.enableRotate === false) + return; + handleTouchMoveDollyRotate(event); + scope.update(); + break; + default: + state = STATE.NONE; + } + } + function onContextMenu(event) { + if (scope.enabled === false) + return; + event.preventDefault(); + } + function addPointer(event) { + pointers.push(event); + } + function removePointer(event) { + delete pointerPositions[event.pointerId]; + for (let i = 0; i < pointers.length; i++) { + if (pointers[i].pointerId == event.pointerId) { + pointers.splice(i, 1); + return; + } + } + } + function trackPointer(event) { + let position = pointerPositions[event.pointerId]; + if (position === void 0) { + position = new Vector2(); + pointerPositions[event.pointerId] = position; + } + position.set(event.pageX, event.pageY); + } + function getSecondPointerPosition(event) { + const pointer = event.pointerId === pointers[0].pointerId ? pointers[1] : pointers[0]; + return pointerPositions[pointer.pointerId]; + } + scope.domElement.addEventListener("contextmenu", onContextMenu); + scope.domElement.addEventListener("pointerdown", onPointerDown); + scope.domElement.addEventListener("pointercancel", onPointerCancel); + scope.domElement.addEventListener("wheel", onMouseWheel, { passive: false }); + this.update(); + } +}; + +// node_modules/three/examples/jsm/controls/FlyControls.js +var _changeEvent3 = { type: "change" }; +var FlyControls = class extends EventDispatcher { + constructor(object, domElement) { + super(); + if (domElement === void 0) { + console.warn('THREE.FlyControls: The second parameter "domElement" is now mandatory.'); + domElement = document; + } + this.object = object; + this.domElement = domElement; + this.movementSpeed = 1; + this.rollSpeed = 5e-3; + this.dragToLook = false; + this.autoForward = false; + const scope = this; + const EPS = 1e-6; + const lastQuaternion = new Quaternion(); + const lastPosition = new Vector3(); + this.tmpQuaternion = new Quaternion(); + this.mouseStatus = 0; + this.moveState = { up: 0, down: 0, left: 0, right: 0, forward: 0, back: 0, pitchUp: 0, pitchDown: 0, yawLeft: 0, yawRight: 0, rollLeft: 0, rollRight: 0 }; + this.moveVector = new Vector3(0, 0, 0); + this.rotationVector = new Vector3(0, 0, 0); + this.keydown = function(event) { + if (event.altKey) { + return; + } + switch (event.code) { + case "ShiftLeft": + case "ShiftRight": + this.movementSpeedMultiplier = 0.1; + break; + case "KeyW": + this.moveState.forward = 1; + break; + case "KeyS": + this.moveState.back = 1; + break; + case "KeyA": + this.moveState.left = 1; + break; + case "KeyD": + this.moveState.right = 1; + break; + case "KeyR": + this.moveState.up = 1; + break; + case "KeyF": + this.moveState.down = 1; + break; + case "ArrowUp": + this.moveState.pitchUp = 1; + break; + case "ArrowDown": + this.moveState.pitchDown = 1; + break; + case "ArrowLeft": + this.moveState.yawLeft = 1; + break; + case "ArrowRight": + this.moveState.yawRight = 1; + break; + case "KeyQ": + this.moveState.rollLeft = 1; + break; + case "KeyE": + this.moveState.rollRight = 1; + break; + } + this.updateMovementVector(); + this.updateRotationVector(); + }; + this.keyup = function(event) { + switch (event.code) { + case "ShiftLeft": + case "ShiftRight": + this.movementSpeedMultiplier = 1; + break; + case "KeyW": + this.moveState.forward = 0; + break; + case "KeyS": + this.moveState.back = 0; + break; + case "KeyA": + this.moveState.left = 0; + break; + case "KeyD": + this.moveState.right = 0; + break; + case "KeyR": + this.moveState.up = 0; + break; + case "KeyF": + this.moveState.down = 0; + break; + case "ArrowUp": + this.moveState.pitchUp = 0; + break; + case "ArrowDown": + this.moveState.pitchDown = 0; + break; + case "ArrowLeft": + this.moveState.yawLeft = 0; + break; + case "ArrowRight": + this.moveState.yawRight = 0; + break; + case "KeyQ": + this.moveState.rollLeft = 0; + break; + case "KeyE": + this.moveState.rollRight = 0; + break; + } + this.updateMovementVector(); + this.updateRotationVector(); + }; + this.mousedown = function(event) { + if (this.dragToLook) { + this.mouseStatus++; + } else { + switch (event.button) { + case 0: + this.moveState.forward = 1; + break; + case 2: + this.moveState.back = 1; + break; + } + this.updateMovementVector(); + } + }; + this.mousemove = function(event) { + if (!this.dragToLook || this.mouseStatus > 0) { + const container = this.getContainerDimensions(); + const halfWidth = container.size[0] / 2; + const halfHeight = container.size[1] / 2; + this.moveState.yawLeft = -(event.pageX - container.offset[0] - halfWidth) / halfWidth; + this.moveState.pitchDown = (event.pageY - container.offset[1] - halfHeight) / halfHeight; + this.updateRotationVector(); + } + }; + this.mouseup = function(event) { + if (this.dragToLook) { + this.mouseStatus--; + this.moveState.yawLeft = this.moveState.pitchDown = 0; + } else { + switch (event.button) { + case 0: + this.moveState.forward = 0; + break; + case 2: + this.moveState.back = 0; + break; + } + this.updateMovementVector(); + } + this.updateRotationVector(); + }; + this.update = function(delta) { + const moveMult = delta * scope.movementSpeed; + const rotMult = delta * scope.rollSpeed; + scope.object.translateX(scope.moveVector.x * moveMult); + scope.object.translateY(scope.moveVector.y * moveMult); + scope.object.translateZ(scope.moveVector.z * moveMult); + scope.tmpQuaternion.set(scope.rotationVector.x * rotMult, scope.rotationVector.y * rotMult, scope.rotationVector.z * rotMult, 1).normalize(); + scope.object.quaternion.multiply(scope.tmpQuaternion); + if (lastPosition.distanceToSquared(scope.object.position) > EPS || 8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS) { + scope.dispatchEvent(_changeEvent3); + lastQuaternion.copy(scope.object.quaternion); + lastPosition.copy(scope.object.position); + } + }; + this.updateMovementVector = function() { + const forward = this.moveState.forward || this.autoForward && !this.moveState.back ? 1 : 0; + this.moveVector.x = -this.moveState.left + this.moveState.right; + this.moveVector.y = -this.moveState.down + this.moveState.up; + this.moveVector.z = -forward + this.moveState.back; + }; + this.updateRotationVector = function() { + this.rotationVector.x = -this.moveState.pitchDown + this.moveState.pitchUp; + this.rotationVector.y = -this.moveState.yawRight + this.moveState.yawLeft; + this.rotationVector.z = -this.moveState.rollRight + this.moveState.rollLeft; + }; + this.getContainerDimensions = function() { + if (this.domElement != document) { + return { + size: [this.domElement.offsetWidth, this.domElement.offsetHeight], + offset: [this.domElement.offsetLeft, this.domElement.offsetTop] + }; + } else { + return { + size: [window.innerWidth, window.innerHeight], + offset: [0, 0] + }; + } + }; + this.dispose = function() { + this.domElement.removeEventListener("contextmenu", contextmenu); + this.domElement.removeEventListener("mousedown", _mousedown); + this.domElement.removeEventListener("mousemove", _mousemove); + this.domElement.removeEventListener("mouseup", _mouseup); + window.removeEventListener("keydown", _keydown); + window.removeEventListener("keyup", _keyup); + }; + const _mousemove = this.mousemove.bind(this); + const _mousedown = this.mousedown.bind(this); + const _mouseup = this.mouseup.bind(this); + const _keydown = this.keydown.bind(this); + const _keyup = this.keyup.bind(this); + this.domElement.addEventListener("contextmenu", contextmenu); + this.domElement.addEventListener("mousemove", _mousemove); + this.domElement.addEventListener("mousedown", _mousedown); + this.domElement.addEventListener("mouseup", _mouseup); + window.addEventListener("keydown", _keydown); + window.addEventListener("keyup", _keyup); + this.updateMovementVector(); + this.updateRotationVector(); + } +}; +function contextmenu(event) { + event.preventDefault(); +} + +// node_modules/three/examples/jsm/shaders/CopyShader.js +var CopyShader = { + uniforms: { + "tDiffuse": { value: null }, + "opacity": { value: 1 } + }, + vertexShader: ` + + varying vec2 vUv; + + void main() { + + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + }`, + fragmentShader: ` + + uniform float opacity; + + uniform sampler2D tDiffuse; + + varying vec2 vUv; + + void main() { + + gl_FragColor = texture2D( tDiffuse, vUv ); + gl_FragColor.a *= opacity; + + + }` +}; + +// node_modules/three/examples/jsm/postprocessing/Pass.js +var Pass = class { + constructor() { + this.enabled = true; + this.needsSwap = true; + this.clear = false; + this.renderToScreen = false; + } + setSize() { + } + render() { + console.error("THREE.Pass: .render() must be implemented in derived pass."); + } +}; +var _camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1); +var _geometry = new BufferGeometry(); +_geometry.setAttribute("position", new Float32BufferAttribute([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)); +_geometry.setAttribute("uv", new Float32BufferAttribute([0, 2, 0, 0, 2, 0], 2)); +var FullScreenQuad = class { + constructor(material) { + this._mesh = new Mesh(_geometry, material); + } + dispose() { + this._mesh.geometry.dispose(); + } + render(renderer3) { + renderer3.render(this._mesh, _camera); + } + get material() { + return this._mesh.material; + } + set material(value) { + this._mesh.material = value; + } +}; + +// node_modules/three/examples/jsm/postprocessing/ShaderPass.js +var ShaderPass = class extends Pass { + constructor(shader, textureID) { + super(); + this.textureID = textureID !== void 0 ? textureID : "tDiffuse"; + if (shader instanceof ShaderMaterial) { + this.uniforms = shader.uniforms; + this.material = shader; + } else if (shader) { + this.uniforms = UniformsUtils.clone(shader.uniforms); + this.material = new ShaderMaterial({ + defines: Object.assign({}, shader.defines), + uniforms: this.uniforms, + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader + }); + } + this.fsQuad = new FullScreenQuad(this.material); + } + render(renderer3, writeBuffer, readBuffer) { + if (this.uniforms[this.textureID]) { + this.uniforms[this.textureID].value = readBuffer.texture; + } + this.fsQuad.material = this.material; + if (this.renderToScreen) { + renderer3.setRenderTarget(null); + this.fsQuad.render(renderer3); + } else { + renderer3.setRenderTarget(writeBuffer); + if (this.clear) + renderer3.clear(renderer3.autoClearColor, renderer3.autoClearDepth, renderer3.autoClearStencil); + this.fsQuad.render(renderer3); + } + } +}; + +// node_modules/three/examples/jsm/postprocessing/MaskPass.js +var MaskPass = class extends Pass { + constructor(scene3, camera3) { + super(); + this.scene = scene3; + this.camera = camera3; + this.clear = true; + this.needsSwap = false; + this.inverse = false; + } + render(renderer3, writeBuffer, readBuffer) { + const context = renderer3.getContext(); + const state = renderer3.state; + state.buffers.color.setMask(false); + state.buffers.depth.setMask(false); + state.buffers.color.setLocked(true); + state.buffers.depth.setLocked(true); + let writeValue, clearValue; + if (this.inverse) { + writeValue = 0; + clearValue = 1; + } else { + writeValue = 1; + clearValue = 0; + } + state.buffers.stencil.setTest(true); + state.buffers.stencil.setOp(context.REPLACE, context.REPLACE, context.REPLACE); + state.buffers.stencil.setFunc(context.ALWAYS, writeValue, 4294967295); + state.buffers.stencil.setClear(clearValue); + state.buffers.stencil.setLocked(true); + renderer3.setRenderTarget(readBuffer); + if (this.clear) + renderer3.clear(); + renderer3.render(this.scene, this.camera); + renderer3.setRenderTarget(writeBuffer); + if (this.clear) + renderer3.clear(); + renderer3.render(this.scene, this.camera); + state.buffers.color.setLocked(false); + state.buffers.depth.setLocked(false); + state.buffers.stencil.setLocked(false); + state.buffers.stencil.setFunc(context.EQUAL, 1, 4294967295); + state.buffers.stencil.setOp(context.KEEP, context.KEEP, context.KEEP); + state.buffers.stencil.setLocked(true); + } +}; +var ClearMaskPass = class extends Pass { + constructor() { + super(); + this.needsSwap = false; + } + render(renderer3) { + renderer3.state.buffers.stencil.setLocked(false); + renderer3.state.buffers.stencil.setTest(false); + } +}; + +// node_modules/three/examples/jsm/postprocessing/EffectComposer.js +var EffectComposer = class { + constructor(renderer3, renderTarget) { + this.renderer = renderer3; + if (renderTarget === void 0) { + const size = renderer3.getSize(new Vector2()); + this._pixelRatio = renderer3.getPixelRatio(); + this._width = size.width; + this._height = size.height; + renderTarget = new WebGLRenderTarget(this._width * this._pixelRatio, this._height * this._pixelRatio); + renderTarget.texture.name = "EffectComposer.rt1"; + } else { + this._pixelRatio = 1; + this._width = renderTarget.width; + this._height = renderTarget.height; + } + this.renderTarget1 = renderTarget; + this.renderTarget2 = renderTarget.clone(); + this.renderTarget2.texture.name = "EffectComposer.rt2"; + this.writeBuffer = this.renderTarget1; + this.readBuffer = this.renderTarget2; + this.renderToScreen = true; + this.passes = []; + if (CopyShader === void 0) { + console.error("THREE.EffectComposer relies on CopyShader"); + } + if (ShaderPass === void 0) { + console.error("THREE.EffectComposer relies on ShaderPass"); + } + this.copyPass = new ShaderPass(CopyShader); + this.clock = new Clock(); + } + swapBuffers() { + const tmp2 = this.readBuffer; + this.readBuffer = this.writeBuffer; + this.writeBuffer = tmp2; + } + addPass(pass) { + this.passes.push(pass); + pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio); + } + insertPass(pass, index5) { + this.passes.splice(index5, 0, pass); + pass.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio); + } + removePass(pass) { + const index5 = this.passes.indexOf(pass); + if (index5 !== -1) { + this.passes.splice(index5, 1); + } + } + isLastEnabledPass(passIndex) { + for (let i = passIndex + 1; i < this.passes.length; i++) { + if (this.passes[i].enabled) { + return false; + } + } + return true; + } + render(deltaTime) { + if (deltaTime === void 0) { + deltaTime = this.clock.getDelta(); + } + const currentRenderTarget = this.renderer.getRenderTarget(); + let maskActive = false; + for (let i = 0, il = this.passes.length; i < il; i++) { + const pass = this.passes[i]; + if (pass.enabled === false) + continue; + pass.renderToScreen = this.renderToScreen && this.isLastEnabledPass(i); + pass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive); + if (pass.needsSwap) { + if (maskActive) { + const context = this.renderer.getContext(); + const stencil = this.renderer.state.buffers.stencil; + stencil.setFunc(context.NOTEQUAL, 1, 4294967295); + this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime); + stencil.setFunc(context.EQUAL, 1, 4294967295); + } + this.swapBuffers(); + } + if (MaskPass !== void 0) { + if (pass instanceof MaskPass) { + maskActive = true; + } else if (pass instanceof ClearMaskPass) { + maskActive = false; + } + } + } + this.renderer.setRenderTarget(currentRenderTarget); + } + reset(renderTarget) { + if (renderTarget === void 0) { + const size = this.renderer.getSize(new Vector2()); + this._pixelRatio = this.renderer.getPixelRatio(); + this._width = size.width; + this._height = size.height; + renderTarget = this.renderTarget1.clone(); + renderTarget.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio); + } + this.renderTarget1.dispose(); + this.renderTarget2.dispose(); + this.renderTarget1 = renderTarget; + this.renderTarget2 = renderTarget.clone(); + this.writeBuffer = this.renderTarget1; + this.readBuffer = this.renderTarget2; + } + setSize(width, height) { + this._width = width; + this._height = height; + const effectiveWidth = this._width * this._pixelRatio; + const effectiveHeight = this._height * this._pixelRatio; + this.renderTarget1.setSize(effectiveWidth, effectiveHeight); + this.renderTarget2.setSize(effectiveWidth, effectiveHeight); + for (let i = 0; i < this.passes.length; i++) { + this.passes[i].setSize(effectiveWidth, effectiveHeight); + } + } + setPixelRatio(pixelRatio) { + this._pixelRatio = pixelRatio; + this.setSize(this._width, this._height); + } +}; +var _camera2 = new OrthographicCamera(-1, 1, 1, -1, 0, 1); +var _geometry2 = new BufferGeometry(); +_geometry2.setAttribute("position", new Float32BufferAttribute([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)); +_geometry2.setAttribute("uv", new Float32BufferAttribute([0, 2, 0, 0, 2, 0], 2)); + +// node_modules/three/examples/jsm/postprocessing/RenderPass.js +var RenderPass = class extends Pass { + constructor(scene3, camera3, overrideMaterial, clearColor, clearAlpha) { + super(); + this.scene = scene3; + this.camera = camera3; + this.overrideMaterial = overrideMaterial; + this.clearColor = clearColor; + this.clearAlpha = clearAlpha !== void 0 ? clearAlpha : 0; + this.clear = true; + this.clearDepth = false; + this.needsSwap = false; + this._oldClearColor = new Color(); + } + render(renderer3, writeBuffer, readBuffer) { + const oldAutoClear = renderer3.autoClear; + renderer3.autoClear = false; + let oldClearAlpha, oldOverrideMaterial; + if (this.overrideMaterial !== void 0) { + oldOverrideMaterial = this.scene.overrideMaterial; + this.scene.overrideMaterial = this.overrideMaterial; + } + if (this.clearColor) { + renderer3.getClearColor(this._oldClearColor); + oldClearAlpha = renderer3.getClearAlpha(); + renderer3.setClearColor(this.clearColor, this.clearAlpha); + } + if (this.clearDepth) { + renderer3.clearDepth(); + } + renderer3.setRenderTarget(this.renderToScreen ? null : readBuffer); + if (this.clear) + renderer3.clear(renderer3.autoClearColor, renderer3.autoClearDepth, renderer3.autoClearStencil); + renderer3.render(this.scene, this.camera); + if (this.clearColor) { + renderer3.setClearColor(this._oldClearColor, oldClearAlpha); + } + if (this.overrideMaterial !== void 0) { + this.scene.overrideMaterial = oldOverrideMaterial; + } + renderer3.autoClear = oldAutoClear; + } +}; + +// node_modules/@babel/runtime/helpers/esm/extends.js +function _extends() { + _extends = Object.assign ? Object.assign.bind() : function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); +} + +// node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +function _assertThisInitialized2(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; +} + +// node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +function _setPrototypeOf2(o, p) { + _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf2(o, p); +} + +// node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf2(subClass, superClass); +} + +// node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +function _getPrototypeOf2(o) { + _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf2(o); +} + +// node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} + +// node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +function _isNativeReflectConstruct2() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } +} + +// node_modules/@babel/runtime/helpers/esm/construct.js +function _construct2(Parent, args, Class) { + if (_isNativeReflectConstruct2()) { + _construct2 = Reflect.construct.bind(); + } else { + _construct2 = function _construct3(Parent2, args2, Class2) { + var a2 = [null]; + a2.push.apply(a2, args2); + var Constructor = Function.bind.apply(Parent2, a2); + var instance = new Constructor(); + if (Class2) + _setPrototypeOf2(instance, Class2.prototype); + return instance; + }; + } + return _construct2.apply(null, arguments); +} + +// node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; + _wrapNativeSuper = function _wrapNativeSuper2(Class2) { + if (Class2 === null || !_isNativeFunction(Class2)) + return Class2; + if (typeof Class2 !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class2)) + return _cache.get(Class2); + _cache.set(Class2, Wrapper); + } + function Wrapper() { + return _construct2(Class2, arguments, _getPrototypeOf2(this).constructor); + } + Wrapper.prototype = Object.create(Class2.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf2(Wrapper, Class2); + }; + return _wrapNativeSuper(Class); +} + +// node_modules/polished/dist/polished.esm.js +var ERRORS = { + "1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n", + "2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n", + "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n", + "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n", + "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n", + "6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n", + "7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n", + "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n", + "9": "Please provide a number of steps to the modularScale helper.\n\n", + "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n", + "11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n', + "12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n', + "13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n', + "14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n', + "15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n', + "16": "You must provide a template to this method.\n\n", + "17": "You passed an unsupported selector state to this method.\n\n", + "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n", + "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n", + "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n", + "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n", + "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n", + "23": "fontFace expects a name of a font-family.\n\n", + "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n", + "25": "fontFace expects localFonts to be an array.\n\n", + "26": "fontFace expects fileFormats to be an array.\n\n", + "27": "radialGradient requries at least 2 color-stops to properly render.\n\n", + "28": "Please supply a filename to retinaImage() as the first argument.\n\n", + "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n", + "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n", + "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n", + "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n", + "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n", + "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n", + "35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n', + "36": "Property must be a string value.\n\n", + "37": "Syntax Error at %s.\n\n", + "38": "Formula contains a function that needs parentheses at %s.\n\n", + "39": "Formula is missing closing parenthesis at %s.\n\n", + "40": "Formula has too many closing parentheses at %s.\n\n", + "41": "All values in a formula must have the same unit or be unitless.\n\n", + "42": "Please provide a number of steps to the modularScale helper.\n\n", + "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n", + "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n", + "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n", + "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n", + "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n", + "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n", + "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n", + "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n", + "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n", + "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n", + "53": "fontFace expects localFonts to be an array.\n\n", + "54": "fontFace expects fileFormats to be an array.\n\n", + "55": "fontFace expects a name of a font-family.\n\n", + "56": "linearGradient requries at least 2 color-stops to properly render.\n\n", + "57": "radialGradient requries at least 2 color-stops to properly render.\n\n", + "58": "Please supply a filename to retinaImage() as the first argument.\n\n", + "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n", + "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n", + "61": "Property must be a string value.\n\n", + "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n", + "63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n', + "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n", + "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n", + "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n", + "67": "You must provide a template to this method.\n\n", + "68": "You passed an unsupported selector state to this method.\n\n", + "69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n', + "70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n', + "71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n', + "72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n', + "73": "Please provide a valid CSS variable.\n\n", + "74": "CSS variable not found and no default was provided.\n\n", + "75": "important requires a valid style object, got a %s instead.\n\n", + "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n", + "77": 'remToPx expects a value in "rem" but you provided it in "%s".\n\n', + "78": 'base must be set in "px" or "%" but you set it in "%s".\n' +}; +function format() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var a2 = args[0]; + var b = []; + var c2; + for (c2 = 1; c2 < args.length; c2 += 1) { + b.push(args[c2]); + } + b.forEach(function(d) { + a2 = a2.replace(/%[a-z]/, d); + }); + return a2; +} +var PolishedError = /* @__PURE__ */ function(_Error) { + _inheritsLoose(PolishedError2, _Error); + function PolishedError2(code) { + var _this; + if (false) { + _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this; + } else { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this; + } + return _assertThisInitialized2(_this); + } + return PolishedError2; +}(/* @__PURE__ */ _wrapNativeSuper(Error)); +function colorToInt(color) { + return Math.round(color * 255); +} +function convertToInt(red, green, blue) { + return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue); +} +function hslToRgb(hue, saturation, lightness, convert) { + if (convert === void 0) { + convert = convertToInt; + } + if (saturation === 0) { + return convert(lightness, lightness, lightness); + } + var huePrime = (hue % 360 + 360) % 360 / 60; + var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation; + var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)); + var red = 0; + var green = 0; + var blue = 0; + if (huePrime >= 0 && huePrime < 1) { + red = chroma; + green = secondComponent; + } else if (huePrime >= 1 && huePrime < 2) { + red = secondComponent; + green = chroma; + } else if (huePrime >= 2 && huePrime < 3) { + green = chroma; + blue = secondComponent; + } else if (huePrime >= 3 && huePrime < 4) { + green = secondComponent; + blue = chroma; + } else if (huePrime >= 4 && huePrime < 5) { + red = secondComponent; + blue = chroma; + } else if (huePrime >= 5 && huePrime < 6) { + red = chroma; + blue = secondComponent; + } + var lightnessModification = lightness - chroma / 2; + var finalRed = red + lightnessModification; + var finalGreen = green + lightnessModification; + var finalBlue = blue + lightnessModification; + return convert(finalRed, finalGreen, finalBlue); +} +var namedColorMap = { + aliceblue: "f0f8ff", + antiquewhite: "faebd7", + aqua: "00ffff", + aquamarine: "7fffd4", + azure: "f0ffff", + beige: "f5f5dc", + bisque: "ffe4c4", + black: "000", + blanchedalmond: "ffebcd", + blue: "0000ff", + blueviolet: "8a2be2", + brown: "a52a2a", + burlywood: "deb887", + cadetblue: "5f9ea0", + chartreuse: "7fff00", + chocolate: "d2691e", + coral: "ff7f50", + cornflowerblue: "6495ed", + cornsilk: "fff8dc", + crimson: "dc143c", + cyan: "00ffff", + darkblue: "00008b", + darkcyan: "008b8b", + darkgoldenrod: "b8860b", + darkgray: "a9a9a9", + darkgreen: "006400", + darkgrey: "a9a9a9", + darkkhaki: "bdb76b", + darkmagenta: "8b008b", + darkolivegreen: "556b2f", + darkorange: "ff8c00", + darkorchid: "9932cc", + darkred: "8b0000", + darksalmon: "e9967a", + darkseagreen: "8fbc8f", + darkslateblue: "483d8b", + darkslategray: "2f4f4f", + darkslategrey: "2f4f4f", + darkturquoise: "00ced1", + darkviolet: "9400d3", + deeppink: "ff1493", + deepskyblue: "00bfff", + dimgray: "696969", + dimgrey: "696969", + dodgerblue: "1e90ff", + firebrick: "b22222", + floralwhite: "fffaf0", + forestgreen: "228b22", + fuchsia: "ff00ff", + gainsboro: "dcdcdc", + ghostwhite: "f8f8ff", + gold: "ffd700", + goldenrod: "daa520", + gray: "808080", + green: "008000", + greenyellow: "adff2f", + grey: "808080", + honeydew: "f0fff0", + hotpink: "ff69b4", + indianred: "cd5c5c", + indigo: "4b0082", + ivory: "fffff0", + khaki: "f0e68c", + lavender: "e6e6fa", + lavenderblush: "fff0f5", + lawngreen: "7cfc00", + lemonchiffon: "fffacd", + lightblue: "add8e6", + lightcoral: "f08080", + lightcyan: "e0ffff", + lightgoldenrodyellow: "fafad2", + lightgray: "d3d3d3", + lightgreen: "90ee90", + lightgrey: "d3d3d3", + lightpink: "ffb6c1", + lightsalmon: "ffa07a", + lightseagreen: "20b2aa", + lightskyblue: "87cefa", + lightslategray: "789", + lightslategrey: "789", + lightsteelblue: "b0c4de", + lightyellow: "ffffe0", + lime: "0f0", + limegreen: "32cd32", + linen: "faf0e6", + magenta: "f0f", + maroon: "800000", + mediumaquamarine: "66cdaa", + mediumblue: "0000cd", + mediumorchid: "ba55d3", + mediumpurple: "9370db", + mediumseagreen: "3cb371", + mediumslateblue: "7b68ee", + mediumspringgreen: "00fa9a", + mediumturquoise: "48d1cc", + mediumvioletred: "c71585", + midnightblue: "191970", + mintcream: "f5fffa", + mistyrose: "ffe4e1", + moccasin: "ffe4b5", + navajowhite: "ffdead", + navy: "000080", + oldlace: "fdf5e6", + olive: "808000", + olivedrab: "6b8e23", + orange: "ffa500", + orangered: "ff4500", + orchid: "da70d6", + palegoldenrod: "eee8aa", + palegreen: "98fb98", + paleturquoise: "afeeee", + palevioletred: "db7093", + papayawhip: "ffefd5", + peachpuff: "ffdab9", + peru: "cd853f", + pink: "ffc0cb", + plum: "dda0dd", + powderblue: "b0e0e6", + purple: "800080", + rebeccapurple: "639", + red: "f00", + rosybrown: "bc8f8f", + royalblue: "4169e1", + saddlebrown: "8b4513", + salmon: "fa8072", + sandybrown: "f4a460", + seagreen: "2e8b57", + seashell: "fff5ee", + sienna: "a0522d", + silver: "c0c0c0", + skyblue: "87ceeb", + slateblue: "6a5acd", + slategray: "708090", + slategrey: "708090", + snow: "fffafa", + springgreen: "00ff7f", + steelblue: "4682b4", + tan: "d2b48c", + teal: "008080", + thistle: "d8bfd8", + tomato: "ff6347", + turquoise: "40e0d0", + violet: "ee82ee", + wheat: "f5deb3", + white: "fff", + whitesmoke: "f5f5f5", + yellow: "ff0", + yellowgreen: "9acd32" +}; +function nameToHex(color) { + if (typeof color !== "string") + return color; + var normalizedColorName = color.toLowerCase(); + return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color; +} +var hexRegex = /^#[a-fA-F0-9]{6}$/; +var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/; +var reducedHexRegex = /^#[a-fA-F0-9]{3}$/; +var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/; +var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i; +var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; +var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i; +var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i; +function parseToRgb(color) { + if (typeof color !== "string") { + throw new PolishedError(3); + } + var normalizedColor = nameToHex(color); + if (normalizedColor.match(hexRegex)) { + return { + red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), + green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), + blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16) + }; + } + if (normalizedColor.match(hexRgbaRegex)) { + var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2)); + return { + red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16), + green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16), + blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16), + alpha + }; + } + if (normalizedColor.match(reducedHexRegex)) { + return { + red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), + green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), + blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16) + }; + } + if (normalizedColor.match(reducedRgbaHexRegex)) { + var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2)); + return { + red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16), + green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16), + blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16), + alpha: _alpha + }; + } + var rgbMatched = rgbRegex.exec(normalizedColor); + if (rgbMatched) { + return { + red: parseInt("" + rgbMatched[1], 10), + green: parseInt("" + rgbMatched[2], 10), + blue: parseInt("" + rgbMatched[3], 10) + }; + } + var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50)); + if (rgbaMatched) { + return { + red: parseInt("" + rgbaMatched[1], 10), + green: parseInt("" + rgbaMatched[2], 10), + blue: parseInt("" + rgbaMatched[3], 10), + alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4]) + }; + } + var hslMatched = hslRegex.exec(normalizedColor); + if (hslMatched) { + var hue = parseInt("" + hslMatched[1], 10); + var saturation = parseInt("" + hslMatched[2], 10) / 100; + var lightness = parseInt("" + hslMatched[3], 10) / 100; + var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")"; + var hslRgbMatched = rgbRegex.exec(rgbColorString); + if (!hslRgbMatched) { + throw new PolishedError(4, normalizedColor, rgbColorString); + } + return { + red: parseInt("" + hslRgbMatched[1], 10), + green: parseInt("" + hslRgbMatched[2], 10), + blue: parseInt("" + hslRgbMatched[3], 10) + }; + } + var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50)); + if (hslaMatched) { + var _hue = parseInt("" + hslaMatched[1], 10); + var _saturation = parseInt("" + hslaMatched[2], 10) / 100; + var _lightness = parseInt("" + hslaMatched[3], 10) / 100; + var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")"; + var _hslRgbMatched = rgbRegex.exec(_rgbColorString); + if (!_hslRgbMatched) { + throw new PolishedError(4, normalizedColor, _rgbColorString); + } + return { + red: parseInt("" + _hslRgbMatched[1], 10), + green: parseInt("" + _hslRgbMatched[2], 10), + blue: parseInt("" + _hslRgbMatched[3], 10), + alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4]) + }; + } + throw new PolishedError(5); +} +var reduceHexValue = function reduceHexValue2(value) { + if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) { + return "#" + value[1] + value[3] + value[5]; + } + return value; +}; +var reduceHexValue$1 = reduceHexValue; +function numberToHex(value) { + var hex = value.toString(16); + return hex.length === 1 ? "0" + hex : hex; +} +function rgb(value, green, blue) { + if (typeof value === "number" && typeof green === "number" && typeof blue === "number") { + return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue)); + } else if (typeof value === "object" && green === void 0 && blue === void 0) { + return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue)); + } + throw new PolishedError(6); +} +function rgba(firstValue, secondValue, thirdValue, fourthValue) { + if (typeof firstValue === "string" && typeof secondValue === "number") { + var rgbValue = parseToRgb(firstValue); + return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")"; + } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") { + return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")"; + } else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) { + return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")"; + } + throw new PolishedError(7); +} +function curried(f, length, acc) { + return function fn() { + var combined = acc.concat(Array.prototype.slice.call(arguments)); + return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined); + }; +} +function curry(f) { + return curried(f, f.length, []); +} +function guard(lowerBoundary, upperBoundary, value) { + return Math.max(lowerBoundary, Math.min(upperBoundary, value)); +} +function opacify(amount, color) { + if (color === "transparent") + return color; + var parsedColor = parseToRgb(color); + var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1; + var colorWithAlpha = _extends({}, parsedColor, { + alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100) + }); + return rgba(colorWithAlpha); +} +var curriedOpacify = /* @__PURE__ */ curry(opacify); +var curriedOpacify$1 = curriedOpacify; + +// node_modules/@tweenjs/tween.js/dist/tween.esm.js +var Easing = { + Linear: { + None: function(amount) { + return amount; + } + }, + Quadratic: { + In: function(amount) { + return amount * amount; + }, + Out: function(amount) { + return amount * (2 - amount); + }, + InOut: function(amount) { + if ((amount *= 2) < 1) { + return 0.5 * amount * amount; + } + return -0.5 * (--amount * (amount - 2) - 1); + } + }, + Cubic: { + In: function(amount) { + return amount * amount * amount; + }, + Out: function(amount) { + return --amount * amount * amount + 1; + }, + InOut: function(amount) { + if ((amount *= 2) < 1) { + return 0.5 * amount * amount * amount; + } + return 0.5 * ((amount -= 2) * amount * amount + 2); + } + }, + Quartic: { + In: function(amount) { + return amount * amount * amount * amount; + }, + Out: function(amount) { + return 1 - --amount * amount * amount * amount; + }, + InOut: function(amount) { + if ((amount *= 2) < 1) { + return 0.5 * amount * amount * amount * amount; + } + return -0.5 * ((amount -= 2) * amount * amount * amount - 2); + } + }, + Quintic: { + In: function(amount) { + return amount * amount * amount * amount * amount; + }, + Out: function(amount) { + return --amount * amount * amount * amount * amount + 1; + }, + InOut: function(amount) { + if ((amount *= 2) < 1) { + return 0.5 * amount * amount * amount * amount * amount; + } + return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2); + } + }, + Sinusoidal: { + In: function(amount) { + return 1 - Math.cos(amount * Math.PI / 2); + }, + Out: function(amount) { + return Math.sin(amount * Math.PI / 2); + }, + InOut: function(amount) { + return 0.5 * (1 - Math.cos(Math.PI * amount)); + } + }, + Exponential: { + In: function(amount) { + return amount === 0 ? 0 : Math.pow(1024, amount - 1); + }, + Out: function(amount) { + return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount); + }, + InOut: function(amount) { + if (amount === 0) { + return 0; + } + if (amount === 1) { + return 1; + } + if ((amount *= 2) < 1) { + return 0.5 * Math.pow(1024, amount - 1); + } + return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2); + } + }, + Circular: { + In: function(amount) { + return 1 - Math.sqrt(1 - amount * amount); + }, + Out: function(amount) { + return Math.sqrt(1 - --amount * amount); + }, + InOut: function(amount) { + if ((amount *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - amount * amount) - 1); + } + return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1); + } + }, + Elastic: { + In: function(amount) { + if (amount === 0) { + return 0; + } + if (amount === 1) { + return 1; + } + return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI); + }, + Out: function(amount) { + if (amount === 0) { + return 0; + } + if (amount === 1) { + return 1; + } + return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1; + }, + InOut: function(amount) { + if (amount === 0) { + return 0; + } + if (amount === 1) { + return 1; + } + amount *= 2; + if (amount < 1) { + return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI); + } + return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1; + } + }, + Back: { + In: function(amount) { + var s = 1.70158; + return amount * amount * ((s + 1) * amount - s); + }, + Out: function(amount) { + var s = 1.70158; + return --amount * amount * ((s + 1) * amount + s) + 1; + }, + InOut: function(amount) { + var s = 1.70158 * 1.525; + if ((amount *= 2) < 1) { + return 0.5 * (amount * amount * ((s + 1) * amount - s)); + } + return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2); + } + }, + Bounce: { + In: function(amount) { + return 1 - Easing.Bounce.Out(1 - amount); + }, + Out: function(amount) { + if (amount < 1 / 2.75) { + return 7.5625 * amount * amount; + } else if (amount < 2 / 2.75) { + return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75; + } else if (amount < 2.5 / 2.75) { + return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375; + } else { + return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375; + } + }, + InOut: function(amount) { + if (amount < 0.5) { + return Easing.Bounce.In(amount * 2) * 0.5; + } + return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5; + } + } +}; +var now3; +if (typeof self === "undefined" && typeof process !== "undefined" && process.hrtime) { + now3 = function() { + var time = process.hrtime(); + return time[0] * 1e3 + time[1] / 1e6; + }; +} else if (typeof self !== "undefined" && self.performance !== void 0 && self.performance.now !== void 0) { + now3 = self.performance.now.bind(self.performance); +} else if (Date.now !== void 0) { + now3 = Date.now; +} else { + now3 = function() { + return new Date().getTime(); + }; +} +var now$1 = now3; +var Group2 = function() { + function Group3() { + this._tweens = {}; + this._tweensAddedDuringUpdate = {}; + } + Group3.prototype.getAll = function() { + var _this = this; + return Object.keys(this._tweens).map(function(tweenId) { + return _this._tweens[tweenId]; + }); + }; + Group3.prototype.removeAll = function() { + this._tweens = {}; + }; + Group3.prototype.add = function(tween) { + this._tweens[tween.getId()] = tween; + this._tweensAddedDuringUpdate[tween.getId()] = tween; + }; + Group3.prototype.remove = function(tween) { + delete this._tweens[tween.getId()]; + delete this._tweensAddedDuringUpdate[tween.getId()]; + }; + Group3.prototype.update = function(time, preserve) { + if (time === void 0) { + time = now$1(); + } + if (preserve === void 0) { + preserve = false; + } + var tweenIds = Object.keys(this._tweens); + if (tweenIds.length === 0) { + return false; + } + while (tweenIds.length > 0) { + this._tweensAddedDuringUpdate = {}; + for (var i = 0; i < tweenIds.length; i++) { + var tween = this._tweens[tweenIds[i]]; + var autoStart = !preserve; + if (tween && tween.update(time, autoStart) === false && !preserve) { + delete this._tweens[tweenIds[i]]; + } + } + tweenIds = Object.keys(this._tweensAddedDuringUpdate); + } + return true; + }; + return Group3; +}(); +var Interpolation = { + Linear: function(v, k) { + var m2 = v.length - 1; + var f = m2 * k; + var i = Math.floor(f); + var fn = Interpolation.Utils.Linear; + if (k < 0) { + return fn(v[0], v[1], f); + } + if (k > 1) { + return fn(v[m2], v[m2 - 1], m2 - f); + } + return fn(v[i], v[i + 1 > m2 ? m2 : i + 1], f - i); + }, + Bezier: function(v, k) { + var b = 0; + var n = v.length - 1; + var pw = Math.pow; + var bn = Interpolation.Utils.Bernstein; + for (var i = 0; i <= n; i++) { + b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i); + } + return b; + }, + CatmullRom: function(v, k) { + var m2 = v.length - 1; + var f = m2 * k; + var i = Math.floor(f); + var fn = Interpolation.Utils.CatmullRom; + if (v[0] === v[m2]) { + if (k < 0) { + i = Math.floor(f = m2 * (1 + k)); + } + return fn(v[(i - 1 + m2) % m2], v[i], v[(i + 1) % m2], v[(i + 2) % m2], f - i); + } else { + if (k < 0) { + return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]); + } + if (k > 1) { + return v[m2] - (fn(v[m2], v[m2], v[m2 - 1], v[m2 - 1], f - m2) - v[m2]); + } + return fn(v[i ? i - 1 : 0], v[i], v[m2 < i + 1 ? m2 : i + 1], v[m2 < i + 2 ? m2 : i + 2], f - i); + } + }, + Utils: { + Linear: function(p0, p1, t) { + return (p1 - p0) * t + p0; + }, + Bernstein: function(n, i) { + var fc = Interpolation.Utils.Factorial; + return fc(n) / fc(i) / fc(n - i); + }, + Factorial: function() { + var a2 = [1]; + return function(n) { + var s = 1; + if (a2[n]) { + return a2[n]; + } + for (var i = n; i > 1; i--) { + s *= i; + } + a2[n] = s; + return s; + }; + }(), + CatmullRom: function(p0, p1, p2, p3, t) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; + } + } +}; +var Sequence = function() { + function Sequence2() { + } + Sequence2.nextId = function() { + return Sequence2._nextId++; + }; + Sequence2._nextId = 0; + return Sequence2; +}(); +var mainGroup = new Group2(); +var Tween = function() { + function Tween2(_object, _group) { + if (_group === void 0) { + _group = mainGroup; + } + this._object = _object; + this._group = _group; + this._isPaused = false; + this._pauseStart = 0; + this._valuesStart = {}; + this._valuesEnd = {}; + this._valuesStartRepeat = {}; + this._duration = 1e3; + this._initialRepeat = 0; + this._repeat = 0; + this._yoyo = false; + this._isPlaying = false; + this._reversed = false; + this._delayTime = 0; + this._startTime = 0; + this._easingFunction = Easing.Linear.None; + this._interpolationFunction = Interpolation.Linear; + this._chainedTweens = []; + this._onStartCallbackFired = false; + this._id = Sequence.nextId(); + this._isChainStopped = false; + this._goToEnd = false; + } + Tween2.prototype.getId = function() { + return this._id; + }; + Tween2.prototype.isPlaying = function() { + return this._isPlaying; + }; + Tween2.prototype.isPaused = function() { + return this._isPaused; + }; + Tween2.prototype.to = function(properties, duration) { + this._valuesEnd = Object.create(properties); + if (duration !== void 0) { + this._duration = duration; + } + return this; + }; + Tween2.prototype.duration = function(d) { + this._duration = d; + return this; + }; + Tween2.prototype.start = function(time) { + if (this._isPlaying) { + return this; + } + this._group && this._group.add(this); + this._repeat = this._initialRepeat; + if (this._reversed) { + this._reversed = false; + for (var property in this._valuesStartRepeat) { + this._swapEndStartRepeatValues(property); + this._valuesStart[property] = this._valuesStartRepeat[property]; + } + } + this._isPlaying = true; + this._isPaused = false; + this._onStartCallbackFired = false; + this._isChainStopped = false; + this._startTime = time !== void 0 ? typeof time === "string" ? now$1() + parseFloat(time) : time : now$1(); + this._startTime += this._delayTime; + this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat); + return this; + }; + Tween2.prototype._setupProperties = function(_object, _valuesStart, _valuesEnd, _valuesStartRepeat) { + for (var property in _valuesEnd) { + var startValue = _object[property]; + var startValueIsArray = Array.isArray(startValue); + var propType = startValueIsArray ? "array" : typeof startValue; + var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]); + if (propType === "undefined" || propType === "function") { + continue; + } + if (isInterpolationList) { + var endValues = _valuesEnd[property]; + if (endValues.length === 0) { + continue; + } + endValues = endValues.map(this._handleRelativeValue.bind(this, startValue)); + _valuesEnd[property] = [startValue].concat(endValues); + } + if ((propType === "object" || startValueIsArray) && startValue && !isInterpolationList) { + _valuesStart[property] = startValueIsArray ? [] : {}; + for (var prop in startValue) { + _valuesStart[property][prop] = startValue[prop]; + } + _valuesStartRepeat[property] = startValueIsArray ? [] : {}; + this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]); + } else { + if (typeof _valuesStart[property] === "undefined") { + _valuesStart[property] = startValue; + } + if (!startValueIsArray) { + _valuesStart[property] *= 1; + } + if (isInterpolationList) { + _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse(); + } else { + _valuesStartRepeat[property] = _valuesStart[property] || 0; + } + } + } + }; + Tween2.prototype.stop = function() { + if (!this._isChainStopped) { + this._isChainStopped = true; + this.stopChainedTweens(); + } + if (!this._isPlaying) { + return this; + } + this._group && this._group.remove(this); + this._isPlaying = false; + this._isPaused = false; + if (this._onStopCallback) { + this._onStopCallback(this._object); + } + return this; + }; + Tween2.prototype.end = function() { + this._goToEnd = true; + this.update(Infinity); + return this; + }; + Tween2.prototype.pause = function(time) { + if (time === void 0) { + time = now$1(); + } + if (this._isPaused || !this._isPlaying) { + return this; + } + this._isPaused = true; + this._pauseStart = time; + this._group && this._group.remove(this); + return this; + }; + Tween2.prototype.resume = function(time) { + if (time === void 0) { + time = now$1(); + } + if (!this._isPaused || !this._isPlaying) { + return this; + } + this._isPaused = false; + this._startTime += time - this._pauseStart; + this._pauseStart = 0; + this._group && this._group.add(this); + return this; + }; + Tween2.prototype.stopChainedTweens = function() { + for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) { + this._chainedTweens[i].stop(); + } + return this; + }; + Tween2.prototype.group = function(group) { + this._group = group; + return this; + }; + Tween2.prototype.delay = function(amount) { + this._delayTime = amount; + return this; + }; + Tween2.prototype.repeat = function(times) { + this._initialRepeat = times; + this._repeat = times; + return this; + }; + Tween2.prototype.repeatDelay = function(amount) { + this._repeatDelayTime = amount; + return this; + }; + Tween2.prototype.yoyo = function(yoyo) { + this._yoyo = yoyo; + return this; + }; + Tween2.prototype.easing = function(easingFunction) { + this._easingFunction = easingFunction; + return this; + }; + Tween2.prototype.interpolation = function(interpolationFunction) { + this._interpolationFunction = interpolationFunction; + return this; + }; + Tween2.prototype.chain = function() { + var tweens = []; + for (var _i = 0; _i < arguments.length; _i++) { + tweens[_i] = arguments[_i]; + } + this._chainedTweens = tweens; + return this; + }; + Tween2.prototype.onStart = function(callback) { + this._onStartCallback = callback; + return this; + }; + Tween2.prototype.onUpdate = function(callback) { + this._onUpdateCallback = callback; + return this; + }; + Tween2.prototype.onRepeat = function(callback) { + this._onRepeatCallback = callback; + return this; + }; + Tween2.prototype.onComplete = function(callback) { + this._onCompleteCallback = callback; + return this; + }; + Tween2.prototype.onStop = function(callback) { + this._onStopCallback = callback; + return this; + }; + Tween2.prototype.update = function(time, autoStart) { + if (time === void 0) { + time = now$1(); + } + if (autoStart === void 0) { + autoStart = true; + } + if (this._isPaused) + return true; + var property; + var elapsed; + var endTime = this._startTime + this._duration; + if (!this._goToEnd && !this._isPlaying) { + if (time > endTime) + return false; + if (autoStart) + this.start(time); + } + this._goToEnd = false; + if (time < this._startTime) { + return true; + } + if (this._onStartCallbackFired === false) { + if (this._onStartCallback) { + this._onStartCallback(this._object); + } + this._onStartCallbackFired = true; + } + elapsed = (time - this._startTime) / this._duration; + elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed; + var value = this._easingFunction(elapsed); + this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value); + if (this._onUpdateCallback) { + this._onUpdateCallback(this._object, elapsed); + } + if (elapsed === 1) { + if (this._repeat > 0) { + if (isFinite(this._repeat)) { + this._repeat--; + } + for (property in this._valuesStartRepeat) { + if (!this._yoyo && typeof this._valuesEnd[property] === "string") { + this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]); + } + if (this._yoyo) { + this._swapEndStartRepeatValues(property); + } + this._valuesStart[property] = this._valuesStartRepeat[property]; + } + if (this._yoyo) { + this._reversed = !this._reversed; + } + if (this._repeatDelayTime !== void 0) { + this._startTime = time + this._repeatDelayTime; + } else { + this._startTime = time + this._delayTime; + } + if (this._onRepeatCallback) { + this._onRepeatCallback(this._object); + } + return true; + } else { + if (this._onCompleteCallback) { + this._onCompleteCallback(this._object); + } + for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) { + this._chainedTweens[i].start(this._startTime + this._duration); + } + this._isPlaying = false; + return false; + } + } + return true; + }; + Tween2.prototype._updateProperties = function(_object, _valuesStart, _valuesEnd, value) { + for (var property in _valuesEnd) { + if (_valuesStart[property] === void 0) { + continue; + } + var start = _valuesStart[property] || 0; + var end = _valuesEnd[property]; + var startIsArray = Array.isArray(_object[property]); + var endIsArray = Array.isArray(end); + var isInterpolationList = !startIsArray && endIsArray; + if (isInterpolationList) { + _object[property] = this._interpolationFunction(end, value); + } else if (typeof end === "object" && end) { + this._updateProperties(_object[property], start, end, value); + } else { + end = this._handleRelativeValue(start, end); + if (typeof end === "number") { + _object[property] = start + (end - start) * value; + } + } + } + }; + Tween2.prototype._handleRelativeValue = function(start, end) { + if (typeof end !== "string") { + return end; + } + if (end.charAt(0) === "+" || end.charAt(0) === "-") { + return start + parseFloat(end); + } else { + return parseFloat(end); + } + }; + Tween2.prototype._swapEndStartRepeatValues = function(property) { + var tmp2 = this._valuesStartRepeat[property]; + var endValue = this._valuesEnd[property]; + if (typeof endValue === "string") { + this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue); + } else { + this._valuesStartRepeat[property] = this._valuesEnd[property]; + } + this._valuesEnd[property] = tmp2; + }; + return Tween2; +}(); +var VERSION = "18.6.4"; +var nextId = Sequence.nextId; +var TWEEN = mainGroup; +var getAll = TWEEN.getAll.bind(TWEEN); +var removeAll4 = TWEEN.removeAll.bind(TWEEN); +var add4 = TWEEN.add.bind(TWEEN); +var remove = TWEEN.remove.bind(TWEEN); +var update2 = TWEEN.update.bind(TWEEN); +var exports = { + Easing, + Group: Group2, + Interpolation, + now: now$1, + Sequence, + nextId, + Tween, + VERSION, + getAll, + removeAll: removeAll4, + add: add4, + remove, + update: update2 +}; +var tween_esm_default = exports; + +// node_modules/three-render-objects/dist/three-render-objects.module.js +function styleInject(css, ref) { + if (ref === void 0) + ref = {}; + var insertAt = ref.insertAt; + if (!css || typeof document === "undefined") { + return; + } + var head = document.head || document.getElementsByTagName("head")[0]; + var style = document.createElement("style"); + style.type = "text/css"; + if (insertAt === "top") { + if (head.firstChild) { + head.insertBefore(style, head.firstChild); + } else { + head.appendChild(style); + } + } else { + head.appendChild(style); + } + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } +} +var css_248z = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}"; +styleInject(css_248z); +function _defineProperty3(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +function _slicedToArray5(arr, i) { + return _arrayWithHoles5(arr) || _iterableToArrayLimit5(arr, i) || _unsupportedIterableToArray5(arr, i) || _nonIterableRest5(); +} +function _toConsumableArray4(arr) { + return _arrayWithoutHoles4(arr) || _iterableToArray4(arr) || _unsupportedIterableToArray5(arr) || _nonIterableSpread4(); +} +function _arrayWithoutHoles4(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray5(arr); +} +function _arrayWithHoles5(arr) { + if (Array.isArray(arr)) + return arr; +} +function _iterableToArray4(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _iterableToArrayLimit5(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; +} +function _unsupportedIterableToArray5(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray5(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray5(o, minLen); +} +function _arrayLikeToArray5(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread4() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _nonIterableRest5() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +var three2 = window.THREE ? window.THREE : { + WebGLRenderer, + Scene, + PerspectiveCamera, + Raycaster, + TextureLoader, + Vector2, + Vector3, + Box3, + Color, + Mesh, + SphereGeometry, + MeshBasicMaterial, + BackSide, + EventDispatcher, + MOUSE, + Quaternion, + Spherical, + Clock +}; +var threeRenderObjects = index2({ + props: { + width: { + "default": window.innerWidth, + onChange: function onChange8(width, state, prevWidth) { + isNaN(width) && (state.width = prevWidth); + } + }, + height: { + "default": window.innerHeight, + onChange: function onChange9(height, state, prevHeight) { + isNaN(height) && (state.height = prevHeight); + } + }, + backgroundColor: { + "default": "#000011" + }, + backgroundImageUrl: {}, + onBackgroundImageLoaded: {}, + showNavInfo: { + "default": true + }, + skyRadius: { + "default": 5e4 + }, + objects: { + "default": [] + }, + enablePointerInteraction: { + "default": true, + onChange: function onChange10(_, state) { + state.hoverObj = null; + if (state.toolTipElem) + state.toolTipElem.innerHTML = ""; + }, + triggerUpdate: false + }, + lineHoverPrecision: { + "default": 1, + triggerUpdate: false + }, + hoverOrderComparator: { + "default": function _default8() { + return -1; + }, + triggerUpdate: false + }, + hoverFilter: { + "default": function _default9() { + return true; + }, + triggerUpdate: false + }, + tooltipContent: { + triggerUpdate: false + }, + hoverDuringDrag: { + "default": false, + triggerUpdate: false + }, + clickAfterDrag: { + "default": false, + triggerUpdate: false + }, + onHover: { + "default": function _default10() { + }, + triggerUpdate: false + }, + onClick: { + "default": function _default11() { + }, + triggerUpdate: false + }, + onRightClick: { + triggerUpdate: false + } + }, + methods: { + tick: function tick(state) { + if (state.initialised) { + state.controls.update && state.controls.update(state.clock.getDelta()); + state.postProcessingComposer ? state.postProcessingComposer.render() : state.renderer.render(state.scene, state.camera); + state.extraRenderers.forEach(function(r) { + return r.render(state.scene, state.camera); + }); + if (state.enablePointerInteraction) { + var topObject = null; + if (state.hoverDuringDrag || !state.isPointerDragging) { + var intersects = this.intersectingObjects(state.pointerPos.x, state.pointerPos.y).filter(function(d) { + return state.hoverFilter(d.object); + }).sort(function(a2, b) { + return state.hoverOrderComparator(a2.object, b.object); + }); + var topIntersect = intersects.length ? intersects[0] : null; + topObject = topIntersect ? topIntersect.object : null; + state.intersectionPoint = topIntersect ? topIntersect.point : null; + } + if (topObject !== state.hoverObj) { + state.onHover(topObject, state.hoverObj); + state.toolTipElem.innerHTML = topObject ? accessor_fn_module_default(state.tooltipContent)(topObject) || "" : ""; + state.hoverObj = topObject; + } + } + tween_esm_default.update(); + } + return this; + }, + getPointerPos: function getPointerPos(state) { + var _state$pointerPos = state.pointerPos, x2 = _state$pointerPos.x, y2 = _state$pointerPos.y; + return { + x: x2, + y: y2 + }; + }, + cameraPosition: function cameraPosition(state, position, lookAt, transitionDuration) { + var camera3 = state.camera; + if (position && state.initialised) { + var finalPos = position; + var finalLookAt = lookAt || { + x: 0, + y: 0, + z: 0 + }; + if (!transitionDuration) { + setCameraPos(finalPos); + setLookAt(finalLookAt); + } else { + var camPos = Object.assign({}, camera3.position); + var camLookAt = getLookAt(); + new tween_esm_default.Tween(camPos).to(finalPos, transitionDuration).easing(tween_esm_default.Easing.Quadratic.Out).onUpdate(setCameraPos).start(); + new tween_esm_default.Tween(camLookAt).to(finalLookAt, transitionDuration / 3).easing(tween_esm_default.Easing.Quadratic.Out).onUpdate(setLookAt).start(); + } + return this; + } + return Object.assign({}, camera3.position, { + lookAt: getLookAt() + }); + function setCameraPos(pos) { + var x2 = pos.x, y2 = pos.y, z2 = pos.z; + if (x2 !== void 0) + camera3.position.x = x2; + if (y2 !== void 0) + camera3.position.y = y2; + if (z2 !== void 0) + camera3.position.z = z2; + } + function setLookAt(lookAt2) { + var lookAtVect = new three2.Vector3(lookAt2.x, lookAt2.y, lookAt2.z); + if (state.controls.target) { + state.controls.target = lookAtVect; + } else { + camera3.lookAt(lookAtVect); + } + } + function getLookAt() { + return Object.assign(new three2.Vector3(0, 0, -1e3).applyQuaternion(camera3.quaternion).add(camera3.position)); + } + }, + zoomToFit: function zoomToFit(state) { + var transitionDuration = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; + var padding = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 10; + for (var _len = arguments.length, bboxArgs = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { + bboxArgs[_key - 3] = arguments[_key]; + } + return this.fitToBbox(this.getBbox.apply(this, bboxArgs), transitionDuration, padding); + }, + fitToBbox: function fitToBbox(state, bbox) { + var transitionDuration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0; + var padding = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 10; + var camera3 = state.camera; + if (bbox) { + var center = new three2.Vector3(0, 0, 0); + var maxBoxSide = Math.max.apply(Math, _toConsumableArray4(Object.entries(bbox).map(function(_ref) { + var _ref2 = _slicedToArray5(_ref, 2), coordType = _ref2[0], coords = _ref2[1]; + return Math.max.apply(Math, _toConsumableArray4(coords.map(function(c2) { + return Math.abs(center[coordType] - c2); + }))); + }))) * 2; + var paddedFov = (1 - padding * 2 / state.height) * camera3.fov; + var fitHeightDistance = maxBoxSide / Math.atan(paddedFov * Math.PI / 180); + var fitWidthDistance = fitHeightDistance / camera3.aspect; + var distance = Math.max(fitHeightDistance, fitWidthDistance); + if (distance > 0) { + var newCameraPosition = center.clone().sub(camera3.position).normalize().multiplyScalar(-distance); + this.cameraPosition(newCameraPosition, center, transitionDuration); + } + } + return this; + }, + getBbox: function getBbox(state) { + var objFilter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { + return true; + }; + var box = new three2.Box3(new three2.Vector3(0, 0, 0), new three2.Vector3(0, 0, 0)); + var objs = state.objects.filter(objFilter); + if (!objs.length) + return null; + objs.forEach(function(obj) { + return box.expandByObject(obj); + }); + return Object.assign.apply(Object, _toConsumableArray4(["x", "y", "z"].map(function(c2) { + return _defineProperty3({}, c2, [box.min[c2], box.max[c2]]); + }))); + }, + getScreenCoords: function getScreenCoords(state, x2, y2, z2) { + var vec = new three2.Vector3(x2, y2, z2); + vec.project(this.camera()); + return { + x: (vec.x + 1) * state.width / 2, + y: -(vec.y - 1) * state.height / 2 + }; + }, + getSceneCoords: function getSceneCoords(state, screenX, screenY) { + var distance = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0; + var relCoords = new three2.Vector2(screenX / state.width * 2 - 1, -(screenY / state.height) * 2 + 1); + var raycaster = new three2.Raycaster(); + raycaster.setFromCamera(relCoords, state.camera); + return Object.assign({}, raycaster.ray.at(distance, new three2.Vector3())); + }, + intersectingObjects: function intersectingObjects(state, x2, y2) { + var relCoords = new three2.Vector2(x2 / state.width * 2 - 1, -(y2 / state.height) * 2 + 1); + var raycaster = new three2.Raycaster(); + raycaster.params.Line.threshold = state.lineHoverPrecision; + raycaster.setFromCamera(relCoords, state.camera); + return raycaster.intersectObjects(state.objects, true); + }, + renderer: function renderer(state) { + return state.renderer; + }, + scene: function scene(state) { + return state.scene; + }, + camera: function camera(state) { + return state.camera; + }, + postProcessingComposer: function postProcessingComposer(state) { + return state.postProcessingComposer; + }, + controls: function controls(state) { + return state.controls; + }, + tbControls: function tbControls(state) { + return state.controls; + } + }, + stateInit: function stateInit2() { + return { + scene: new three2.Scene(), + camera: new three2.PerspectiveCamera(), + clock: new three2.Clock() + }; + }, + init: function init2(domNode, state) { + var _ref4 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, _ref4$controlType = _ref4.controlType, controlType = _ref4$controlType === void 0 ? "trackball" : _ref4$controlType, _ref4$rendererConfig = _ref4.rendererConfig, rendererConfig = _ref4$rendererConfig === void 0 ? {} : _ref4$rendererConfig, _ref4$extraRenderers = _ref4.extraRenderers, extraRenderers = _ref4$extraRenderers === void 0 ? [] : _ref4$extraRenderers, _ref4$waitForLoadComp = _ref4.waitForLoadComplete, waitForLoadComplete = _ref4$waitForLoadComp === void 0 ? true : _ref4$waitForLoadComp; + domNode.innerHTML = ""; + domNode.appendChild(state.container = document.createElement("div")); + state.container.className = "scene-container"; + state.container.style.position = "relative"; + state.container.appendChild(state.navInfo = document.createElement("div")); + state.navInfo.className = "scene-nav-info"; + state.navInfo.textContent = { + orbit: "Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan", + trackball: "Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan", + fly: "WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw" + }[controlType] || ""; + state.navInfo.style.display = state.showNavInfo ? null : "none"; + state.toolTipElem = document.createElement("div"); + state.toolTipElem.classList.add("scene-tooltip"); + state.container.appendChild(state.toolTipElem); + state.pointerPos = new three2.Vector2(); + state.pointerPos.x = -2; + state.pointerPos.y = -2; + ["pointermove", "pointerdown"].forEach(function(evType) { + return state.container.addEventListener(evType, function(ev) { + evType === "pointerdown" && (state.isPointerPressed = true); + !state.isPointerDragging && ev.type === "pointermove" && (ev.pressure > 0 || state.isPointerPressed) && (ev.pointerType !== "touch" || ev.movementX === void 0 || [ev.movementX, ev.movementY].some(function(m2) { + return Math.abs(m2) > 1; + })) && (state.isPointerDragging = true); + if (state.enablePointerInteraction) { + var offset = getOffset(state.container); + state.pointerPos.x = ev.pageX - offset.left; + state.pointerPos.y = ev.pageY - offset.top; + state.toolTipElem.style.top = "".concat(state.pointerPos.y, "px"); + state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px"); + state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat(state.height - state.pointerPos.y < 100 ? "calc(-100% - 8px)" : "21px", ")"); + } + function getOffset(el) { + var rect = el.getBoundingClientRect(), scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, scrollTop = window.pageYOffset || document.documentElement.scrollTop; + return { + top: rect.top + scrollTop, + left: rect.left + scrollLeft + }; + } + }, { + passive: true + }); + }); + state.container.addEventListener("pointerup", function(ev) { + state.isPointerPressed = false; + if (state.isPointerDragging) { + state.isPointerDragging = false; + if (!state.clickAfterDrag) + return; + } + requestAnimationFrame(function() { + if (ev.button === 0) { + state.onClick(state.hoverObj || null, ev, state.intersectionPoint); + } + if (ev.button === 2 && state.onRightClick) { + state.onRightClick(state.hoverObj || null, ev, state.intersectionPoint); + } + }); + }, { + passive: true, + capture: true + }); + state.container.addEventListener("contextmenu", function(ev) { + if (state.onRightClick) + ev.preventDefault(); + }); + state.renderer = new three2.WebGLRenderer(Object.assign({ + antialias: true, + alpha: true + }, rendererConfig)); + state.renderer.setPixelRatio(Math.min(2, window.devicePixelRatio)); + state.container.appendChild(state.renderer.domElement); + state.extraRenderers = extraRenderers; + state.extraRenderers.forEach(function(r) { + r.domElement.style.position = "absolute"; + r.domElement.style.top = "0px"; + r.domElement.style.pointerEvents = "none"; + state.container.appendChild(r.domElement); + }); + state.postProcessingComposer = new EffectComposer(state.renderer); + state.postProcessingComposer.addPass(new RenderPass(state.scene, state.camera)); + state.controls = new { + trackball: TrackballControls, + orbit: OrbitControls, + fly: FlyControls + }[controlType](state.camera, state.renderer.domElement); + if (controlType === "fly") { + state.controls.movementSpeed = 300; + state.controls.rollSpeed = Math.PI / 6; + state.controls.dragToLook = true; + } + if (controlType === "trackball" || controlType === "orbit") { + state.controls.minDistance = 0.1; + state.controls.maxDistance = state.skyRadius; + state.controls.addEventListener("start", function() { + state.controlsEngaged = true; + }); + state.controls.addEventListener("change", function() { + if (state.controlsEngaged) { + state.controlsDragging = true; + } + }); + state.controls.addEventListener("end", function() { + state.controlsEngaged = false; + state.controlsDragging = false; + }); + } + [state.renderer, state.postProcessingComposer].concat(_toConsumableArray4(state.extraRenderers)).forEach(function(r) { + return r.setSize(state.width, state.height); + }); + state.camera.aspect = state.width / state.height; + state.camera.updateProjectionMatrix(); + state.camera.position.z = 1e3; + state.scene.add(state.skysphere = new three2.Mesh()); + state.skysphere.visible = false; + state.loadComplete = state.scene.visible = !waitForLoadComplete; + window.scene = state.scene; + }, + update: function update3(state, changedProps) { + if (state.width && state.height && (changedProps.hasOwnProperty("width") || changedProps.hasOwnProperty("height"))) { + state.container.style.width = "".concat(state.width, "px"); + state.container.style.height = "".concat(state.height, "px"); + [state.renderer, state.postProcessingComposer].concat(_toConsumableArray4(state.extraRenderers)).forEach(function(r) { + return r.setSize(state.width, state.height); + }); + state.camera.aspect = state.width / state.height; + state.camera.updateProjectionMatrix(); + } + if (changedProps.hasOwnProperty("skyRadius") && state.skyRadius) { + state.controls.hasOwnProperty("maxDistance") && changedProps.skyRadius && (state.controls.maxDistance = state.skyRadius); + state.camera.far = state.skyRadius * 2.5; + state.camera.updateProjectionMatrix(); + state.skysphere.geometry = new three2.SphereGeometry(state.skyRadius); + } + if (changedProps.hasOwnProperty("backgroundColor")) { + var alpha = parseToRgb(state.backgroundColor).alpha; + if (alpha === void 0) + alpha = 1; + state.renderer.setClearColor(new three2.Color(curriedOpacify$1(1, state.backgroundColor)), alpha); + } + if (changedProps.hasOwnProperty("backgroundImageUrl")) { + if (!state.backgroundImageUrl) { + state.skysphere.visible = false; + state.skysphere.material.map = null; + !state.loadComplete && finishLoad(); + } else { + new three2.TextureLoader().load(state.backgroundImageUrl, function(texture) { + state.skysphere.material = new three2.MeshBasicMaterial({ + map: texture, + side: three2.BackSide + }); + state.skysphere.visible = true; + state.onBackgroundImageLoaded && setTimeout(state.onBackgroundImageLoaded); + !state.loadComplete && finishLoad(); + }); + } + } + changedProps.hasOwnProperty("showNavInfo") && (state.navInfo.style.display = state.showNavInfo ? null : "none"); + if (changedProps.hasOwnProperty("objects")) { + (changedProps.objects || []).forEach(function(obj) { + return state.scene.remove(obj); + }); + state.objects.forEach(function(obj) { + return state.scene.add(obj); + }); + } + function finishLoad() { + state.loadComplete = state.scene.visible = true; + } + } +}); + +// node_modules/3d-force-graph/dist/3d-force-graph.module.js +function styleInject2(css, ref) { + if (ref === void 0) + ref = {}; + var insertAt = ref.insertAt; + if (!css || typeof document === "undefined") { + return; + } + var head = document.head || document.getElementsByTagName("head")[0]; + var style = document.createElement("style"); + style.type = "text/css"; + if (insertAt === "top") { + if (head.firstChild) { + head.insertBefore(style, head.firstChild); + } else { + head.appendChild(style); + } + } else { + head.appendChild(style); + } + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } +} +var css_248z2 = ".graph-info-msg {\n top: 50%;\n width: 100%;\n text-align: center;\n color: lavender;\n opacity: 0.7;\n font-size: 22px;\n position: absolute;\n font-family: Sans-serif;\n}\n\n.scene-container .clickable {\n cursor: pointer;\n}\n\n.scene-container .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n.scene-container .grabbable:active {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}"; +styleInject2(css_248z2); +function ownKeys3(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; +} +function _objectSpread23(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + i % 2 ? ownKeys3(Object(source), true).forEach(function(key) { + _defineProperty4(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys3(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; +} +function _defineProperty4(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} +function _toConsumableArray5(arr) { + return _arrayWithoutHoles5(arr) || _iterableToArray5(arr) || _unsupportedIterableToArray6(arr) || _nonIterableSpread5(); +} +function _arrayWithoutHoles5(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray6(arr); +} +function _iterableToArray5(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _unsupportedIterableToArray6(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray6(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray6(o, minLen); +} +function _arrayLikeToArray6(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread5() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function linkKapsule(kapsulePropName, kapsuleType) { + var dummyK = new kapsuleType(); + return { + linkProp: function linkProp(prop) { + return { + "default": dummyK[prop](), + onChange: function onChange13(v, state) { + state[kapsulePropName][prop](v); + }, + triggerUpdate: false + }; + }, + linkMethod: function linkMethod(method) { + return function(state) { + var kapsuleInstance = state[kapsulePropName]; + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + var returnVal = kapsuleInstance[method].apply(kapsuleInstance, args); + return returnVal === kapsuleInstance ? this : returnVal; + }; + } + }; +} +var three3 = window.THREE ? window.THREE : { + AmbientLight, + DirectionalLight, + Vector3 +}; +var CAMERA_DISTANCE2NODES_FACTOR = 170; +var bindFG = linkKapsule("forceGraph", threeForcegraph); +var linkedFGProps = Object.assign.apply(Object, _toConsumableArray5(["jsonUrl", "graphData", "numDimensions", "dagMode", "dagLevelDistance", "dagNodeFilter", "onDagError", "nodeRelSize", "nodeId", "nodeVal", "nodeResolution", "nodeColor", "nodeAutoColorBy", "nodeOpacity", "nodeVisibility", "nodeThreeObject", "nodeThreeObjectExtend", "linkSource", "linkTarget", "linkVisibility", "linkColor", "linkAutoColorBy", "linkOpacity", "linkWidth", "linkResolution", "linkCurvature", "linkCurveRotation", "linkMaterial", "linkThreeObject", "linkThreeObjectExtend", "linkPositionUpdate", "linkDirectionalArrowLength", "linkDirectionalArrowColor", "linkDirectionalArrowRelPos", "linkDirectionalArrowResolution", "linkDirectionalParticles", "linkDirectionalParticleSpeed", "linkDirectionalParticleWidth", "linkDirectionalParticleColor", "linkDirectionalParticleResolution", "forceEngine", "d3AlphaDecay", "d3VelocityDecay", "d3AlphaMin", "ngraphPhysics", "warmupTicks", "cooldownTicks", "cooldownTime", "onEngineTick", "onEngineStop"].map(function(p) { + return _defineProperty4({}, p, bindFG.linkProp(p)); +}))); +var linkedFGMethods = Object.assign.apply(Object, _toConsumableArray5(["refresh", "getGraphBbox", "d3Force", "d3ReheatSimulation", "emitParticle"].map(function(p) { + return _defineProperty4({}, p, bindFG.linkMethod(p)); +}))); +var bindRenderObjs = linkKapsule("renderObjs", threeRenderObjects); +var linkedRenderObjsProps = Object.assign.apply(Object, _toConsumableArray5(["width", "height", "backgroundColor", "showNavInfo", "enablePointerInteraction"].map(function(p) { + return _defineProperty4({}, p, bindRenderObjs.linkProp(p)); +}))); +var linkedRenderObjsMethods = Object.assign.apply(Object, _toConsumableArray5(["cameraPosition", "postProcessingComposer"].map(function(p) { + return _defineProperty4({}, p, bindRenderObjs.linkMethod(p)); +})).concat([{ + graph2ScreenCoords: bindRenderObjs.linkMethod("getScreenCoords"), + screen2GraphCoords: bindRenderObjs.linkMethod("getSceneCoords") +}])); +var _3dForceGraph = index2({ + props: _objectSpread23(_objectSpread23({ + nodeLabel: { + "default": "name", + triggerUpdate: false + }, + linkLabel: { + "default": "name", + triggerUpdate: false + }, + linkHoverPrecision: { + "default": 1, + onChange: function onChange11(p, state) { + return state.renderObjs.lineHoverPrecision(p); + }, + triggerUpdate: false + }, + enableNavigationControls: { + "default": true, + onChange: function onChange12(enable, state) { + var controls3 = state.renderObjs.controls(); + if (controls3) { + controls3.enabled = enable; + } + }, + triggerUpdate: false + }, + enableNodeDrag: { + "default": true, + triggerUpdate: false + }, + onNodeDrag: { + "default": function _default12() { + }, + triggerUpdate: false + }, + onNodeDragEnd: { + "default": function _default13() { + }, + triggerUpdate: false + }, + onNodeClick: { + triggerUpdate: false + }, + onNodeRightClick: { + triggerUpdate: false + }, + onNodeHover: { + triggerUpdate: false + }, + onLinkClick: { + triggerUpdate: false + }, + onLinkRightClick: { + triggerUpdate: false + }, + onLinkHover: { + triggerUpdate: false + }, + onBackgroundClick: { + triggerUpdate: false + }, + onBackgroundRightClick: { + triggerUpdate: false + } + }, linkedFGProps), linkedRenderObjsProps), + methods: _objectSpread23(_objectSpread23({ + zoomToFit: function zoomToFit2(state, transitionDuration, padding) { + var _state$forceGraph; + for (var _len = arguments.length, bboxArgs = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { + bboxArgs[_key - 3] = arguments[_key]; + } + state.renderObjs.fitToBbox((_state$forceGraph = state.forceGraph).getGraphBbox.apply(_state$forceGraph, bboxArgs), transitionDuration, padding); + return this; + }, + pauseAnimation: function pauseAnimation(state) { + if (state.animationFrameRequestId !== null) { + cancelAnimationFrame(state.animationFrameRequestId); + state.animationFrameRequestId = null; + } + return this; + }, + resumeAnimation: function resumeAnimation(state) { + if (state.animationFrameRequestId === null) { + this._animationCycle(); + } + return this; + }, + _animationCycle: function _animationCycle(state) { + if (state.enablePointerInteraction) { + this.renderer().domElement.style.cursor = null; + } + state.forceGraph.tickFrame(); + state.renderObjs.tick(); + state.animationFrameRequestId = requestAnimationFrame(this._animationCycle); + }, + scene: function scene2(state) { + return state.renderObjs.scene(); + }, + camera: function camera2(state) { + return state.renderObjs.camera(); + }, + renderer: function renderer2(state) { + return state.renderObjs.renderer(); + }, + controls: function controls2(state) { + return state.renderObjs.controls(); + }, + tbControls: function tbControls2(state) { + return state.renderObjs.tbControls(); + }, + _destructor: function _destructor() { + this.pauseAnimation(); + this.graphData({ + nodes: [], + links: [] + }); + } + }, linkedFGMethods), linkedRenderObjsMethods), + stateInit: function stateInit3(_ref5) { + var controlType = _ref5.controlType, rendererConfig = _ref5.rendererConfig, extraRenderers = _ref5.extraRenderers; + return { + forceGraph: new threeForcegraph(), + renderObjs: threeRenderObjects({ + controlType, + rendererConfig, + extraRenderers + }) + }; + }, + init: function init3(domNode, state) { + domNode.innerHTML = ""; + domNode.appendChild(state.container = document.createElement("div")); + state.container.style.position = "relative"; + var roDomNode = document.createElement("div"); + state.container.appendChild(roDomNode); + state.renderObjs(roDomNode); + var camera3 = state.renderObjs.camera(); + var renderer3 = state.renderObjs.renderer(); + var controls3 = state.renderObjs.controls(); + controls3.enabled = !!state.enableNavigationControls; + state.lastSetCameraZ = camera3.position.z; + var infoElem; + state.container.appendChild(infoElem = document.createElement("div")); + infoElem.className = "graph-info-msg"; + infoElem.textContent = ""; + state.forceGraph.onLoading(function() { + infoElem.textContent = "Loading..."; + }).onFinishLoading(function() { + infoElem.textContent = ""; + }).onUpdate(function() { + state.graphData = state.forceGraph.graphData(); + if (camera3.position.x === 0 && camera3.position.y === 0 && camera3.position.z === state.lastSetCameraZ && state.graphData.nodes.length) { + camera3.lookAt(state.forceGraph.position); + state.lastSetCameraZ = camera3.position.z = Math.cbrt(state.graphData.nodes.length) * CAMERA_DISTANCE2NODES_FACTOR; + } + }).onFinishUpdate(function() { + if (state._dragControls) { + var curNodeDrag = state.graphData.nodes.find(function(node) { + return node.__initialFixedPos && !node.__disposeControlsAfterDrag; + }); + if (curNodeDrag) { + curNodeDrag.__disposeControlsAfterDrag = true; + } else { + state._dragControls.dispose(); + } + state._dragControls = void 0; + } + if (state.enableNodeDrag && state.enablePointerInteraction && state.forceEngine === "d3") { + var dragControls = state._dragControls = new DragControls(state.graphData.nodes.map(function(node) { + return node.__threeObj; + }).filter(function(obj) { + return obj; + }), camera3, renderer3.domElement); + dragControls.addEventListener("dragstart", function(event) { + controls3.enabled = false; + event.object.__initialPos = event.object.position.clone(); + event.object.__prevPos = event.object.position.clone(); + var node = getGraphObj(event.object).__data; + !node.__initialFixedPos && (node.__initialFixedPos = { + fx: node.fx, + fy: node.fy, + fz: node.fz + }); + !node.__initialPos && (node.__initialPos = { + x: node.x, + y: node.y, + z: node.z + }); + ["x", "y", "z"].forEach(function(c2) { + return node["f".concat(c2)] = node[c2]; + }); + renderer3.domElement.classList.add("grabbable"); + }); + dragControls.addEventListener("drag", function(event) { + var nodeObj = getGraphObj(event.object); + if (!event.object.hasOwnProperty("__graphObjType")) { + var initPos = event.object.__initialPos; + var prevPos = event.object.__prevPos; + var _newPos = event.object.position; + nodeObj.position.add(_newPos.clone().sub(prevPos)); + prevPos.copy(_newPos); + _newPos.copy(initPos); + } + var node = nodeObj.__data; + var newPos = nodeObj.position; + var translate = { + x: newPos.x - node.x, + y: newPos.y - node.y, + z: newPos.z - node.z + }; + ["x", "y", "z"].forEach(function(c2) { + return node["f".concat(c2)] = node[c2] = newPos[c2]; + }); + state.forceGraph.d3AlphaTarget(0.3).resetCountdown(); + node.__dragged = true; + state.onNodeDrag(node, translate); + }); + dragControls.addEventListener("dragend", function(event) { + delete event.object.__initialPos; + delete event.object.__prevPos; + var node = getGraphObj(event.object).__data; + if (node.__disposeControlsAfterDrag) { + dragControls.dispose(); + delete node.__disposeControlsAfterDrag; + } + var initFixedPos = node.__initialFixedPos; + var initPos = node.__initialPos; + var translate = { + x: initPos.x - node.x, + y: initPos.y - node.y, + z: initPos.z - node.z + }; + if (initFixedPos) { + ["x", "y", "z"].forEach(function(c2) { + var fc = "f".concat(c2); + if (initFixedPos[fc] === void 0) { + delete node[fc]; + } + }); + delete node.__initialFixedPos; + delete node.__initialPos; + if (node.__dragged) { + delete node.__dragged; + state.onNodeDragEnd(node, translate); + } + } + state.forceGraph.d3AlphaTarget(0).resetCountdown(); + if (state.enableNavigationControls) { + controls3.enabled = true; + controls3.domElement && controls3.domElement.ownerDocument && controls3.domElement.ownerDocument.dispatchEvent(new PointerEvent("pointerup", { + pointerType: "touch" + })); + } + renderer3.domElement.classList.remove("grabbable"); + }); + } + }); + state.renderObjs.objects([ + new three3.AmbientLight(12303291), + new three3.DirectionalLight(16777215, 0.6), + state.forceGraph + ]).hoverOrderComparator(function(a2, b) { + var aObj = getGraphObj(a2); + if (!aObj) + return 1; + var bObj = getGraphObj(b); + if (!bObj) + return -1; + var isNode = function isNode2(o) { + return o.__graphObjType === "node"; + }; + return isNode(bObj) - isNode(aObj); + }).tooltipContent(function(obj) { + var graphObj = getGraphObj(obj); + return graphObj ? accessor_fn_module_default(state["".concat(graphObj.__graphObjType, "Label")])(graphObj.__data) || "" : ""; + }).hoverDuringDrag(false).onHover(function(obj) { + var hoverObj = getGraphObj(obj); + if (hoverObj !== state.hoverObj) { + var prevObjType = state.hoverObj ? state.hoverObj.__graphObjType : null; + var prevObjData = state.hoverObj ? state.hoverObj.__data : null; + var objType = hoverObj ? hoverObj.__graphObjType : null; + var objData = hoverObj ? hoverObj.__data : null; + if (prevObjType && prevObjType !== objType) { + var fn = state["on".concat(prevObjType === "node" ? "Node" : "Link", "Hover")]; + fn && fn(null, prevObjData); + } + if (objType) { + var _fn = state["on".concat(objType === "node" ? "Node" : "Link", "Hover")]; + _fn && _fn(objData, prevObjType === objType ? prevObjData : null); + } + renderer3.domElement.classList[hoverObj && state["on".concat(objType === "node" ? "Node" : "Link", "Click")] || !hoverObj && state.onBackgroundClick ? "add" : "remove"]("clickable"); + state.hoverObj = hoverObj; + } + }).clickAfterDrag(false).onClick(function(obj, ev) { + var graphObj = getGraphObj(obj); + if (graphObj) { + var fn = state["on".concat(graphObj.__graphObjType === "node" ? "Node" : "Link", "Click")]; + fn && fn(graphObj.__data, ev); + } else { + state.onBackgroundClick && state.onBackgroundClick(ev); + } + }).onRightClick(function(obj, ev) { + var graphObj = getGraphObj(obj); + if (graphObj) { + var fn = state["on".concat(graphObj.__graphObjType === "node" ? "Node" : "Link", "RightClick")]; + fn && fn(graphObj.__data, ev); + } else { + state.onBackgroundRightClick && state.onBackgroundRightClick(ev); + } + }); + this._animationCycle(); + } +}); +function getGraphObj(object) { + var obj = object; + while (obj && !obj.hasOwnProperty("__graphObjType")) { + obj = obj.parent; + } + return obj; +} + +// src/settings/categories/GroupSettings.ts +var GroupSettings = class { + constructor(groups) { + this.groups = []; + this.groups = groups || this.groups; + } +}; +var NodeGroup = class { + constructor(query, color) { + this.query = query; + this.color = color; + } + static getRegex(query) { + return new RegExp(query); + } + static matches(query, node) { + return node.path.startsWith(this.sanitizeQuery(query)); + } + static sanitizeQuery(query) { + const trimmedQuery = query.trim(); + if (trimmedQuery.startsWith("./")) + return trimmedQuery.slice(1); + else + return trimmedQuery; + } +}; + +// src/util/EventBus.ts +var import_obsidian = require("obsidian"); +var EventBus = class extends import_obsidian.Events { + constructor() { + super(); + } +}; +var EventBus_default = new EventBus(); + +// src/views/graph/ForceGraph.ts +var ForceGraph2 = class { + constructor(rootHtmlElement, isLocalGraph) { + this.highlightedNodes = /* @__PURE__ */ new Set(); + this.highlightedLinks = /* @__PURE__ */ new Set(); + this.getGraphData = () => { + if (this.isLocalGraph && Graph3dPlugin.openFileState.value) { + this.graph = Graph3dPlugin.globalGraph.clone().getLocalGraph(Graph3dPlugin.openFileState.value); + } else { + this.graph = Graph3dPlugin.globalGraph.clone(); + } + return this.graph; + }; + this.refreshGraphData = () => { + this.instance.graphData(this.getGraphData()); + }; + this.onSettingsStateChanged = (data) => { + if (data.currentPath === "display.nodeSize") { + this.instance.nodeRelSize(data.newValue); + } else if (data.currentPath === "display.linkWidth") { + this.instance.linkWidth(data.newValue); + } else if (data.currentPath === "display.particleSize") { + this.instance.linkDirectionalParticleWidth(Graph3dPlugin.getSettings().display.particleSize); + } + this.instance.refresh(); + }; + this.createNodes = () => { + this.instance.nodeColor((node) => this.getNodeColor(node)).nodeVisibility(this.doShowNode).onNodeHover(this.onNodeHover); + }; + this.getNodeColor = (node) => { + if (this.isHighlightedNode(node)) { + return node === this.hoveredNode ? Graph3dPlugin.theme.interactiveAccentHover : Graph3dPlugin.theme.interactiveAccent; + } else { + let color = Graph3dPlugin.theme.textMuted; + Graph3dPlugin.getSettings().groups.groups.forEach((group) => { + if (NodeGroup.matches(group.query, node)) + color = group.color; + }); + return color; + } + }; + this.doShowNode = (node) => { + return Graph3dPlugin.getSettings().filters.doShowOrphans || node.links.length > 0; + }; + this.onNodeHover = (node) => { + if (!node && !this.highlightedNodes.size || node && this.hoveredNode === node) + return; + this.clearHighlights(); + if (node) { + this.highlightedNodes.add(node.id); + node.neighbors.forEach((neighbor) => this.highlightedNodes.add(neighbor.id)); + const nodeLinks = this.graph.getLinksWithNode(node.id); + if (nodeLinks) + nodeLinks.forEach((link) => this.highlightedLinks.add(link)); + } + this.hoveredNode = node || null; + this.updateHighlight(); + }; + this.isHighlightedLink = (link) => { + return this.highlightedLinks.has(link); + }; + this.isHighlightedNode = (node) => { + return this.highlightedNodes.has(node.id); + }; + this.createLinks = () => { + this.instance.linkWidth((link) => this.isHighlightedLink(link) ? Graph3dPlugin.getSettings().display.linkThickness * 1.5 : Graph3dPlugin.getSettings().display.linkThickness).linkDirectionalParticles((link) => this.isHighlightedLink(link) ? Graph3dPlugin.getSettings().display.particleCount : 0).linkDirectionalParticleWidth(Graph3dPlugin.getSettings().display.particleSize).onLinkHover(this.onLinkHover).linkColor((link) => this.isHighlightedLink(link) ? Graph3dPlugin.theme.interactiveAccent : Graph3dPlugin.theme.textMuted); + }; + this.onLinkHover = (link) => { + this.clearHighlights(); + if (link) { + this.highlightedLinks.add(link); + this.highlightedNodes.add(link.source); + this.highlightedNodes.add(link.target); + } + this.updateHighlight(); + }; + this.clearHighlights = () => { + this.highlightedNodes.clear(); + this.highlightedLinks.clear(); + }; + this.rootHtmlElement = rootHtmlElement; + this.isLocalGraph = isLocalGraph; + this.createGraph(); + this.initListeners(); + } + initListeners() { + Graph3dPlugin.settingsState.onChange(this.onSettingsStateChanged); + if (this.isLocalGraph) + Graph3dPlugin.openFileState.onChange(this.refreshGraphData); + EventBus_default.on("graph-changed", this.refreshGraphData); + } + createGraph() { + this.createInstance(); + this.createNodes(); + this.createLinks(); + } + createInstance() { + const [width, height] = [ + this.rootHtmlElement.innerWidth, + this.rootHtmlElement.innerHeight + ]; + this.instance = _3dForceGraph()(this.rootHtmlElement).graphData(this.getGraphData()).nodeLabel((node) => `
${node.name}
`).nodeRelSize(Graph3dPlugin.getSettings().display.nodeSize).backgroundColor(rgba(0, 0, 0, 0)).width(width).height(height); + } + update_dimensions() { + const [width, height] = [ + this.rootHtmlElement.offsetWidth, + this.rootHtmlElement.offsetHeight + ]; + this.set_dimensions(width, height); + } + set_dimensions(width, height) { + this.instance.width(width); + this.instance.height(height); + } + updateHighlight() { + this.instance.nodeColor(this.instance.nodeColor()).linkColor(this.instance.linkColor()).linkDirectionalParticles(this.instance.linkDirectionalParticles()); + } + getInstance() { + return this.instance; + } +}; + +// src/views/atomics/TreeItem.ts +var TreeItem = class extends HTMLDivElement { + constructor($inner, children) { + super(); + this.appendSelf = () => { + ["graph-control-section", "tree-item"].forEach((className) => this.classList.add(className)); + const $self = createDiv({ cls: "tree-item-self" }); + $self.addEventListener("click", () => { + this.toggleCollapse(); + }); + const $inner = createDiv({ cls: "tree-item-inner" }); + $inner.append(this.$inner); + $self.append($inner); + this.append($self); + }; + this.appendChildren = () => { + const $children = createDiv({ cls: "tree-item-children" }); + this.childrenBuilders.forEach((build) => build($children)); + this.append($children); + }; + this.toggleCollapse = (doCollapse) => { + if (doCollapse === void 0) { + doCollapse = !this.classList.contains("is-collapsed"); + } + this.classList.toggle("is-collapsed", doCollapse); + }; + this.$inner = $inner; + this.childrenBuilders = children; + } + async connectedCallback() { + this.appendSelf(); + this.appendChildren(); + } +}; +try { + if (customElements.get("tree-item") === void 0) { + customElements.define("tree-item", TreeItem, { extends: "div" }); + } +} catch (e) { +} + +// src/views/atomics/SimpleSliderSetting.ts +var import_obsidian2 = require("obsidian"); +var SimpleSliderSetting = (containerEl, options, onChange13) => { + const slider = new import_obsidian2.Setting(containerEl).setName(options.name).setClass("mod-slider").addSlider((slider2) => { + slider2.setLimits(options.stepOptions.min, options.stepOptions.max, options.stepOptions.step).setValue(options.value).onChange(async (value) => { + onChange13(value); + }); + }); + return slider; +}; +var DEFAULT_SLIDER_STEP_OPTIONS = { + min: 1, + max: 20, + step: 1 +}; +var SimpleSliderSetting_default = SimpleSliderSetting; + +// src/views/settings/categories/DisplaySettingsView.ts +var DisplaySettingsView = (displaySettings, containerEl) => { + NodeSizeSetting(displaySettings, containerEl); + LinkThicknessSetting(displaySettings, containerEl); + ParticleSizeSetting(displaySettings, containerEl); + ParticleCountSetting(displaySettings, containerEl); +}; +var NodeSizeSetting = (displaySettings, containerEl) => { + const options = { + name: "Node Size", + value: displaySettings.value.nodeSize, + stepOptions: DEFAULT_SLIDER_STEP_OPTIONS + }; + return SimpleSliderSetting_default(containerEl, options, (value) => { + displaySettings.value.nodeSize = value; + }); +}; +var LinkThicknessSetting = (displaySettings, containerEl) => { + const options = { + name: "Link Thickness", + value: displaySettings.value.linkThickness, + stepOptions: DEFAULT_SLIDER_STEP_OPTIONS + }; + return SimpleSliderSetting_default(containerEl, options, (value) => { + displaySettings.value.linkThickness = value; + }); +}; +var ParticleSizeSetting = (displaySettings, containerEl) => { + const options = { + name: "Particle Size", + value: displaySettings.value.particleSize, + stepOptions: DEFAULT_SLIDER_STEP_OPTIONS + }; + return SimpleSliderSetting_default(containerEl, options, (value) => { + displaySettings.value.particleSize = value; + }); +}; +var ParticleCountSetting = (displaySettings, containerEl) => { + const options = { + name: "Particle Count", + value: displaySettings.value.particleCount, + stepOptions: DEFAULT_SLIDER_STEP_OPTIONS + }; + return SimpleSliderSetting_default(containerEl, options, (value) => { + displaySettings.value.particleCount = value; + }); +}; +var DisplaySettingsView_default = DisplaySettingsView; + +// src/settings/categories/FilterSettings.ts +var FilterSettings = class { + constructor(doShowOrphans) { + this.doShowOrphans = true; + this.doShowOrphans = doShowOrphans || this.doShowOrphans; + } +}; + +// src/settings/categories/DisplaySettings.ts +var DisplaySettings = class { + constructor(nodeSize, linkThickness, particleSize, particleCount) { + this.nodeSize = 4; + this.linkThickness = 5; + this.particleSize = 6; + this.particleCount = 4; + this.nodeSize = nodeSize || this.nodeSize; + this.linkThickness = linkThickness || this.linkThickness; + this.particleSize = particleSize || this.particleSize; + this.particleCount = particleCount || this.particleCount; + } +}; + +// src/views/settings/GraphSettingsView.ts +var import_obsidian5 = require("obsidian"); + +// src/util/State.ts +var import_observable_slim = __toESM(require_observable_slim()); +var _State = class { + constructor(value) { + this.listeners = /* @__PURE__ */ new Map(); + this.onChange = (callback) => { + const listenerId = this.generateListenerId(); + this.listeners.set(listenerId, callback); + return () => this.unsubscribe(listenerId); + }; + this.generateListenerId = () => { + _State.listener_count++; + return _State.listener_count; + }; + this.unsubscribe = (listenerId) => { + this.listeners.delete(listenerId); + }; + this.notifyAll = (changeData) => { + this.listeners.forEach((listener) => listener(changeData)); + }; + this.onValueChange = (changes) => { + changes.forEach((change) => { + this.notifyAll(Object.assign({}, change, { triggerStateId: this.id })); + }); + }; + _State.stateCount++; + this.id = _State.stateCount; + this.val = typeof value === "object" ? import_observable_slim.default.create(value, false, this.onValueChange) : value; + } + get value() { + return this.val; + } + set value(val) { + const previousValue = this.val; + if (typeof val !== "object") { + this.val = val; + } else { + this.val = import_observable_slim.default.create(val, false, this.onValueChange); + } + this.onValueChange([ + { + type: "update", + property: "", + currentPath: "", + jsonPointer: "", + target: this.val, + proxy: this.val.__getProxy, + previousValue, + newValue: this.val + } + ]); + } + createSubState(key, type) { + const subStateKeys = key.split("."), subStateValue = subStateKeys.reduce((obj, key2) => { + const val = obj[key2]; + if (val !== void 0) { + return val; + } + throw new InvalidStateKeyError(key2, this); + }, this); + if (typeof subStateValue === "object") { + if (subStateValue instanceof type) { + return new _State(subStateValue.__getTarget); + } else { + throw new Error(`Substate ${key} of state ${this.id} is not of type ${type.name}`); + } + } else + throw new Error("SubStates of properties that are Primitives are not supported yet."); + } + getRawValue() { + if (typeof this.val === "object") { + return this.val.__getTarget; + } + return this.val; + } +}; +var State = _State; +State.listener_count = 0; +State.stateCount = 0; +var InvalidStateKeyError = class extends Error { + constructor(subStateKey, state) { + super(); + this.message = `Key does not exist! + Detailed error: + ${subStateKey} could not be found in "value":${JSON.stringify(state.value)} + `; + } +}; + +// src/views/settings/categories/GroupSettingsView.ts +var import_obsidian3 = require("obsidian"); + +// src/views/atomics/ColorPicker.ts +var ColorPicker = (containerEl, value, onChange13) => { + const input = document.createElement("input"); + input.type = "color"; + input.value = value; + input.addEventListener("change", () => { + onChange13(input.value); + }); + containerEl.appendChild(input); +}; +var ColorPicker_default = ColorPicker; + +// src/views/settings/categories/GroupSettingsView.ts +var GroupSettingsView = (groupSettings, containerEl) => { + NodeGroups(groupSettings, containerEl); + AddNodeGroupButton(groupSettings, containerEl); + groupSettings.onChange((change) => { + if (change.currentPath === "groups" && change.type === "add" || change.type === "delete") { + containerEl.empty(); + NodeGroups(groupSettings, containerEl); + AddNodeGroupButton(groupSettings, containerEl); + } + }); +}; +var NodeGroups = (groupSettings, containerEl) => { + var _a; + (_a = containerEl.querySelector(".node-group-container")) == null ? void 0 : _a.remove(); + const nodeGroupContainerEl = containerEl.createDiv({ + cls: "graph-color-groups-container" + }); + groupSettings.value.groups.forEach((group, index5) => { + const groupState = groupSettings.createSubState(`value.groups.${index5}`, NodeGroup); + GroupSettingItem(groupState, nodeGroupContainerEl, () => { + groupSettings.value.groups.splice(index5, 1); + }); + }); +}; +var AddNodeGroupButton = (groupSettings, containerEl) => { + var _a; + (_a = containerEl.querySelector(".graph-color-button-container")) == null ? void 0 : _a.remove(); + const buttonContainer = containerEl.createDiv({ + cls: "graph-color-button-container" + }); + new import_obsidian3.ButtonComponent(buttonContainer).setClass("mod-cta").setButtonText("Add Group").onClick(() => { + groupSettings.value.groups.push(new NodeGroup("", Graph3dPlugin.theme.textMuted)); + containerEl.empty(); + GroupSettingsView(groupSettings, containerEl); + }); +}; +var GroupSettingItem = (group, containerEl, onDelete) => { + const groupEl = containerEl.createDiv({ cls: "graph-color-group" }); + new import_obsidian3.TextComponent(groupEl).setValue(group.value.query).onChange((value) => { + group.value.query = value; + }); + ColorPicker_default(groupEl, group.value.color, (value) => { + group.value.color = value; + }); + new import_obsidian3.ExtraButtonComponent(groupEl).setIcon("cross").setTooltip("Delete Group").onClick(onDelete); +}; +var GroupSettingsView_default = GroupSettingsView; + +// src/views/settings/categories/FilterSettingsView.ts +var import_obsidian4 = require("obsidian"); +var FilterSettingsView = (filterSettings, containerEl) => { + new import_obsidian4.Setting(containerEl).setName("Show Orphans").addToggle((toggle) => { + toggle.setValue(filterSettings.value.doShowOrphans || false).onChange(async (value) => { + filterSettings.value.doShowOrphans = value; + }); + }); +}; +var FilterSettingsView_default = FilterSettingsView; + +// src/views/settings/GraphSettingsView.ts +var GraphSettingsView = class extends HTMLDivElement { + constructor() { + super(...arguments); + this.isCollapsedState = new State(true); + this.callbackUnregisterHandles = []; + this.onIsCollapsedChanged = (stateChange) => { + const collapsed = stateChange.newValue; + this.toggleCollapsed(collapsed); + }; + this.onSettingsButtonClicked = () => { + this.isCollapsedState.value = !this.isCollapsedState.value; + }; + } + async connectedCallback() { + this.classList.add("graph-settings-view"); + this.settingsButton = new import_obsidian5.ExtraButtonComponent(this).setIcon("settings").setTooltip("Open graph settings").onClick(this.onSettingsButtonClicked); + this.graphControls = this.createDiv({ cls: "graph-controls" }); + this.appendGraphControlsItems(this.graphControls.createDiv({ cls: "control-buttons" })); + this.appendSetting(Graph3dPlugin.settingsState.createSubState("value.filters", FilterSettings), "Filters", FilterSettingsView_default); + this.appendSetting(Graph3dPlugin.settingsState.createSubState("value.groups", GroupSettings), "Groups", GroupSettingsView_default); + this.appendSetting(Graph3dPlugin.settingsState.createSubState("value.display", DisplaySettings), "Display", DisplaySettingsView_default); + this.initListeners(); + this.toggleCollapsed(this.isCollapsedState.value); + } + initListeners() { + EventBus_default.on("did-reset-settings", () => { + this.disconnectedCallback(); + this.connectedCallback(); + }); + this.callbackUnregisterHandles.push(this.isCollapsedState.onChange(this.onIsCollapsedChanged)); + } + toggleCollapsed(collapsed) { + if (collapsed) { + this.settingsButton.setDisabled(false); + this.graphControls.classList.add("hidden"); + } else { + this.settingsButton.setDisabled(true); + this.graphControls.classList.remove("hidden"); + } + } + appendGraphControlsItems(containerEl) { + this.appendResetButton(containerEl); + this.appendMinimizeButton(containerEl); + } + appendResetButton(containerEl) { + new import_obsidian5.ExtraButtonComponent(containerEl).setIcon("eraser").setTooltip("Reset to default").onClick(() => EventBus_default.trigger("do-reset-settings")); + } + appendMinimizeButton(containerEl) { + new import_obsidian5.ExtraButtonComponent(containerEl).setIcon("x").setTooltip("Close").onClick(() => this.isCollapsedState.value = true); + } + appendSetting(setting, title, view) { + const header = document.createElement("header"); + header.classList.add("graph-control-section-header"); + header.innerHTML = title; + const item = new TreeItem(header, [ + (containerEl) => view(setting, containerEl) + ]); + item.classList.add("is-collapsed"); + this.graphControls.append(item); + } + async disconnectedCallback() { + this.empty(); + this.callbackUnregisterHandles.forEach((handle) => handle()); + } +}; +try { + if (customElements.get("graph-settings-view") == null) { + customElements.define("graph-settings-view", GraphSettingsView, { + extends: "div" + }); + } +} catch (e) { +} + +// src/views/graph/Graph3dView.ts +var Graph3dView = class extends import_obsidian6.ItemView { + constructor(leaf, isLocalGraph = false) { + super(leaf); + this.isLocalGraph = isLocalGraph; + } + onload() { + super.onload(); + const viewContent = this.getViewContent(); + if (viewContent) { + viewContent.classList.add("graph-3d-view"); + this.appendGraph(viewContent); + const settings = new GraphSettingsView(); + viewContent.appendChild(settings); + } else { + console.error("Could not find view content"); + } + } + onunload() { + super.onunload(); + console.log("Unloading 3D Graph"); + this.forceGraph.getInstance()._destructor(); + } + getDisplayText() { + return "3D-Graph"; + } + getViewType() { + return "3d_graph_view"; + } + onResize() { + super.onResize(); + const viewContent = this.getViewContent(); + if (viewContent) { + this.forceGraph.update_dimensions(); + } + } + getViewContent() { + return this.containerEl.querySelector(".view-content"); + } + appendGraph(viewContent) { + this.forceGraph = new ForceGraph2(viewContent, this.isLocalGraph); + this.forceGraph.getInstance().onNodeClick((node, mouseEvent) => { + const clickedNodeFile = this.app.vault.getFiles().find((f) => f.path === node.path); + if (clickedNodeFile) { + if (this.isLocalGraph) { + this.app.workspace.getLeaf(false).openFile(clickedNodeFile); + } else { + this.leaf.openFile(clickedNodeFile); + } + } + }); + } +}; + +// src/settings/GraphSettings.ts +var GraphSettings = class { + constructor(filterOptions, groupOptions, displayOptions) { + this.filters = filterOptions; + this.groups = groupOptions; + this.display = displayOptions; + } + reset() { + this.filters = new FilterSettings(); + this.groups = new GroupSettings(); + this.display = new DisplaySettings(); + } +}; +var DEFAULT_SETTINGS = () => new GraphSettings(new FilterSettings(), new GroupSettings(), new DisplaySettings()); + +// src/graph/Link.ts +var Link = class { + constructor(sourceId, targetId) { + this.source = sourceId; + this.target = targetId; + } + static createLinkIndex(links) { + const linkIndex = /* @__PURE__ */ new Map(); + links.forEach((link, index5) => { + var _a; + if (!linkIndex.has(link.source)) { + linkIndex.set(link.source, /* @__PURE__ */ new Map()); + } + (_a = linkIndex.get(link.source)) == null ? void 0 : _a.set(link.target, index5); + }); + return linkIndex; + } + static createFromCache(cache, nodes, nodeIndex) { + const links = Object.keys(cache).map((node1Id) => { + return Object.keys(cache[node1Id]).map((node2Id) => { + const [node1Index, node2Index] = [ + nodeIndex.get(node1Id), + nodeIndex.get(node2Id) + ]; + if (node1Index !== void 0 && node2Index !== void 0) { + return nodes[node1Index].addNeighbor(nodes[node2Index]); + } + return null; + }).flat(); + }).flat().filter((link, index5, self2) => link && link.source !== link.target && index5 === self2.findIndex((l) => l && l.source === link.source && l.target === link.target)); + return [links, Link.createLinkIndex(links)]; + } +}; + +// src/graph/Node.ts +var Node = class { + constructor(name, path, val = 10, neighbors = [], links = []) { + this.id = path; + this.name = name; + this.path = path; + this.val = val; + this.neighbors = neighbors; + this.links = links; + } + static createFromFiles(files) { + const nodeMap = /* @__PURE__ */ new Map(); + return [ + files.map((file, index5) => { + const node = new Node(file.name, file.path); + if (!nodeMap.has(node.id)) { + nodeMap.set(node.id, index5); + return node; + } + return null; + }).filter((node) => node !== null), + nodeMap + ]; + } + addNeighbor(neighbor) { + if (!this.isNeighborOf(neighbor)) { + const link = new Link(this.id, neighbor.id); + this.neighbors.push(neighbor); + this.addLink(link); + neighbor.neighbors.push(this); + neighbor.addLink(link); + return link; + } + return null; + } + addLink(link) { + if (!this.links.some((l) => l.source === link.source && l.target === link.target)) { + this.links.push(link); + } + } + isNeighborOf(node) { + if (node instanceof Node) + return this.neighbors.includes(node); + else + return this.neighbors.some((neighbor) => neighbor.id === node); + } +}; + +// src/graph/Graph.ts +var _Graph = class { + constructor(nodes, links, nodeIndex, linkIndex) { + this.clone = () => { + return new _Graph(structuredClone(this.nodes), structuredClone(this.links), structuredClone(this.nodeIndex), structuredClone(this.linkIndex)); + }; + this.update = (app) => { + const newGraph = _Graph.createFromApp(app); + this.nodes.splice(0, this.nodes.length, ...newGraph.nodes); + this.links.splice(0, this.nodes.length, ...newGraph.links); + this.nodeIndex.clear(); + newGraph.nodeIndex.forEach((value, key) => { + this.nodeIndex.set(key, value); + }); + this.linkIndex.clear(); + newGraph.linkIndex.forEach((value, key) => { + this.linkIndex.set(key, value); + }); + }; + this.nodes = nodes; + this.links = links; + this.nodeIndex = nodeIndex || /* @__PURE__ */ new Map(); + this.linkIndex = linkIndex || /* @__PURE__ */ new Map(); + } + getNodeById(id) { + const index5 = this.nodeIndex.get(id); + if (index5 !== void 0) { + return this.nodes[index5]; + } + return null; + } + getLinkByIds(sourceNodeId, targetNodeId) { + const sourceLinkMap = this.linkIndex.get(sourceNodeId); + if (sourceLinkMap) { + const index5 = sourceLinkMap.get(targetNodeId); + if (index5 !== void 0) { + return this.links[index5]; + } + } + return null; + } + getLinksFromNode(sourceNodeId) { + const sourceLinkMap = this.linkIndex.get(sourceNodeId); + if (sourceLinkMap) { + return Array.from(sourceLinkMap.values()).map((index5) => this.links[index5]); + } + return []; + } + getLinksWithNode(nodeId) { + var _a, _b; + if ((_b = (_a = this.links[0]) == null ? void 0 : _a.source) == null ? void 0 : _b.id) { + return this.links.filter((link) => link.source.id === nodeId || link.target.id === nodeId); + } else { + return this.links.filter((link) => link.source === nodeId || link.target === nodeId); + } + } + getLocalGraph(nodeId) { + const node = this.getNodeById(nodeId); + if (node) { + const nodes = [node, ...node.neighbors]; + const links = []; + const nodeIndex = /* @__PURE__ */ new Map(); + nodes.forEach((node2, index5) => { + nodeIndex.set(node2.id, index5); + }); + nodes.forEach((node2, index5) => { + const filteredLinks = node2.links.filter((link) => nodeIndex.has(link.target) && nodeIndex.has(link.source)).map((link) => { + if (!links.includes(link) && nodeIndex.has(link.target) && nodeIndex.has(link.source)) + links.push(link); + return link; + }); + node2.links.splice(0, node2.links.length, ...filteredLinks); + }); + const linkIndex = Link.createLinkIndex(links); + return new _Graph(nodes, links, nodeIndex, linkIndex); + } else { + return new _Graph([], [], /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + } + } +}; +var Graph = _Graph; +Graph.createFromApp = (app) => { + const [nodes, nodeIndex] = Node.createFromFiles(app.vault.getFiles()), [links, linkIndex] = Link.createFromCache(app.metadataCache.resolvedLinks, nodes, nodeIndex); + return new _Graph(nodes, links, nodeIndex, linkIndex); +}; + +// src/util/ObsidianTheme.ts +var ObsidianTheme = class { + constructor(root) { + this.backgroundPrimary = getComputedStyle(root).getPropertyValue("--background-primary").trim(); + this.backgroundPrimaryAlt = getComputedStyle(root).getPropertyValue("--background-primary-alt").trim(); + this.backgroundSecondary = getComputedStyle(root).getPropertyValue("--background-secondary").trim(); + this.backgroundSecondaryAlt = getComputedStyle(root).getPropertyValue("--background-secondary-alt").trim(); + this.backgroundModifierBorder = getComputedStyle(root).getPropertyValue("--background-modifier-border").trim(); + this.backgroundModifierSuccess = getComputedStyle(root).getPropertyValue("--background-modifier-success").trim(); + this.backgroundModifierError = getComputedStyle(root).getPropertyValue("--background-modifier-error").trim(); + this.textAccent = getComputedStyle(root).getPropertyValue("--text-accent").trim(); + this.textAccentHover = getComputedStyle(root).getPropertyValue("--text-accent-hover").trim(); + this.textNormal = getComputedStyle(root).getPropertyValue("--text-normal").trim(); + this.textMuted = getComputedStyle(root).getPropertyValue("--text-muted").trim(); + this.textFaint = getComputedStyle(root).getPropertyValue("--text-faint").trim(); + this.interactiveAccent = getComputedStyle(root).getPropertyValue("--interactive-accent").trim(); + this.interactiveAccentHover = getComputedStyle(root).getPropertyValue("--interactive-accent-hover").trim(); + } +}; + +// src/util/ShallowCompare.ts +var shallowCompare = (obj1, obj2) => { + if (!obj1 || !obj2) + return obj1 == obj2; + else if (obj1 instanceof Object && obj2 instanceof Object) { + return Object.keys(obj1).length === Object.keys(obj2).length && Object.keys(obj1).every((key) => obj2.hasOwnProperty(key) && shallowCompare(obj1[key], obj2[key])); + } else + return obj1 == obj2; +}; +var ShallowCompare_default = shallowCompare; + +// src/main.ts +var _Graph3dPlugin = class extends import_obsidian7.Plugin { + constructor() { + super(...arguments); + this.callbackUnregisterHandles = []; + this.onGraphCacheReady = () => { + _Graph3dPlugin.cacheIsReady.value = true; + this.onGraphCacheChanged(); + }; + this.onGraphCacheChanged = () => { + if (_Graph3dPlugin.cacheIsReady.value && !ShallowCompare_default(this._resolvedCache, this.app.metadataCache.resolvedLinks)) { + this._resolvedCache = structuredClone(this.app.metadataCache.resolvedLinks); + _Graph3dPlugin.globalGraph = Graph.createFromApp(this.app); + } + }; + this.onDoResetSettings = () => { + _Graph3dPlugin.settingsState.value.reset(); + EventBus_default.trigger("did-reset-settings"); + }; + this.openLocalGraph = () => { + var _a; + const newFilePath = (_a = this.app.workspace.getActiveFile()) == null ? void 0 : _a.path; + if (newFilePath) { + _Graph3dPlugin.openFileState.value = newFilePath; + this.openGraph(true); + } else { + new import_obsidian7.Notice("No file is currently open"); + } + }; + this.openGlobalGraph = () => { + this.openGraph(false); + }; + this.openGraph = (isLocalGraph) => { + const leaf = this.app.workspace.getLeaf(isLocalGraph); + if (_Graph3dPlugin.cacheIsReady.value) { + leaf == null ? void 0 : leaf.open(new Graph3dView(leaf, isLocalGraph)); + } else { + _Graph3dPlugin.queuedGraphs.push([leaf, isLocalGraph]); + } + }; + } + async onload() { + await this.init(); + this.addRibbonIcon("glasses", "3D Graph", this.openGlobalGraph); + this.addCommand({ + id: "open-3d-graph-global", + name: "Open Global 3D Graph", + callback: this.openGlobalGraph + }); + this.addCommand({ + id: "open-3d-graph-local", + name: "Open Local 3D Graph", + callback: this.openLocalGraph + }); + } + async init() { + await this.loadSettings(); + this.initStates(); + this.initListeners(); + } + initStates() { + _Graph3dPlugin.settingsState = new State(this.settings); + _Graph3dPlugin.theme = new ObsidianTheme(this.app.workspace.containerEl); + _Graph3dPlugin.app = this.app; + } + initListeners() { + this.callbackUnregisterHandles.push(_Graph3dPlugin.settingsState.onChange(() => this.saveSettings())); + EventBus_default.on("do-reset-settings", this.onDoResetSettings); + this.registerEvent(this.app.workspace.on("file-menu", (menu, file) => { + if (!file) + return; + menu.addItem((item) => { + item.setTitle("Open in local 3D Graph").setIcon("glasses").onClick(() => this.openLocalGraph()); + }); + })); + this.registerEvent(this.app.workspace.on("file-open", (file) => { + if (file) + _Graph3dPlugin.openFileState.value = file.path; + })); + this.callbackUnregisterHandles.push(_Graph3dPlugin.cacheIsReady.onChange((isReady) => { + if (isReady) { + this.openQueuedGraphs(); + } + })); + this.app.metadataCache.on("resolved", this.onGraphCacheReady); + this.app.metadataCache.on("resolve", this.onGraphCacheChanged); + } + openQueuedGraphs() { + _Graph3dPlugin.queuedGraphs.forEach(([leaf, isLocalGraph]) => { + leaf == null ? void 0 : leaf.open(new Graph3dView(leaf, isLocalGraph)); + }); + _Graph3dPlugin.queuedGraphs = []; + } + async loadSettings() { + var _a; + const loadedData = await this.loadData(), defaultSettings = DEFAULT_SETTINGS(); + if (loadedData == null ? void 0 : loadedData.display) { + Object.assign(defaultSettings.display, loadedData.display); + } + if (loadedData == null ? void 0 : loadedData.filters) { + Object.assign(defaultSettings.filters, loadedData.filters); + } + if ((_a = loadedData == null ? void 0 : loadedData.groups) == null ? void 0 : _a.groups) { + defaultSettings.groups.groups = loadedData.groups.groups.map((groupObj) => Object.assign(new NodeGroup("", ""), groupObj)); + } + this.settings = defaultSettings; + } + async saveSettings() { + await this.saveData(this.settings); + } + onunload() { + super.onunload(); + this.callbackUnregisterHandles.forEach((handle) => handle()); + EventBus_default.off("do-reset-settings", this.onDoResetSettings); + } + static getSettings() { + return _Graph3dPlugin.settingsState.value; + } +}; +var Graph3dPlugin = _Graph3dPlugin; +Graph3dPlugin.openFileState = new State(void 0); +Graph3dPlugin.cacheIsReady = new State(false); +Graph3dPlugin.queuedGraphs = []; +/** + * @license + * Copyright 2010-2022 Three.js Authors + * SPDX-License-Identifier: MIT + */ diff --git a/.obsidian/plugins/obsidian-3d-graph/manifest.json b/.obsidian/plugins/obsidian-3d-graph/manifest.json new file mode 100644 index 00000000..08c93423 --- /dev/null +++ b/.obsidian/plugins/obsidian-3d-graph/manifest.json @@ -0,0 +1,9 @@ +{ + "id": "obsidian-3d-graph", + "name": "3D Graph", + "version": "1.0.0", + "description": "A 3D Graph for Obsidian", + "author": "Alexander Weichart", + "authorUrl": "https://github.com/AlexW00", + "isDesktopOnly": false +} diff --git a/.obsidian/plugins/obsidian-3d-graph/obisidian-3d-graph-1.0.0.zip b/.obsidian/plugins/obsidian-3d-graph/obisidian-3d-graph-1.0.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..56f67c1cab91e72210fea8cabfcddb930fe72f64 GIT binary patch literal 410744 zcma&P1(#jdl{H$-%*@Qp%*rjG3x+YobNW=t}MNwUC_ELpO^_Sch&s z^w{+9LSp(@;^fNk(o}M1hpmbEfBo_IK4zuywNWGtG6IVa>00=3s)NP^rRaEW^3D`9MgwH8FSSKyrz{axcZ6=uXU`8 z!ZYMIMT4u2Ovrdbb7-QWBi?ZXW*7IeQlpL=Za)vx)DMie41fR?#joFl9>O)!!ocDN zn|yL0d2DW!PY>m4ZJ}Vms^g_MM2mzN$%+>Pyb3g>TT@-S3dI^Uc60!`C5Vp{cumjd z>qZTx+UO8?i6G!>ASG-DKb0;K057Uit0Or?3wu<0I-E^g(t3A41 zw76bKWxy?Cd!3t-*R9Z9EyVkbg0546R1Pk+Rx^O>a zUqX8+BXP*9yFoyO8`wrhuSYsB-;qJfuit<&R1W3>@*1l?w(n{B>8-4O9ZZnUp~X4V zQy&+|U?RlOH?L0jaic&CsAyC4IT7IXx&~z`1T5ZV&b&}Y>$!`F0q-%^+PT{*6Jr@F zV3Xk*zW9(>9=n?n&>{}SoS$MUtk2bsEqFlbO9iu&DR5O^x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g0hxby>`n_XmOL!7c_Z zI%h8~iv}|>x*R0fhN9=o-4bL%r7~T|s|NEbfTbw9BUMZlMLvmmP9ni5{wO|FRnEP*<0qsEgAc9YS%bzhn zI}Ylf|KhI7KKjo7+_QEy(4l2~f#a0Ra6>FtqrKTBILuo4k>#(0{T}FA_~sR{xJU-C zL>=L!xMBh8WXhKhKkYj}pm|zhVUWE$v@?Wm&OZv$;Z)3PG}Hwifg1Pd0du0Dieo|d z!1*V{nyF@P0{b81EF;E>{`m9_#zp%)BCBaRBxY6)KizwXMZ@&`==s(RIbur54O_;Q_oISe>|_G1_uW2MfM`=6-Rf{Aqq?{CG^1YuAO zZkaOhfZ~q>!1}R^?;Feezxp|B-XbNvH4uvB%Mj(Wld@t3s;V(yyjz_3v4<|YL!Bfx_zP-(cm#uPdKaB7sA7*aJ;%#)oU0N2RC za6jYBoRl`uxgT<^Kx7~5Ct3T;CYf;+1x^?evxeSR*~qolrk{NQ>c$&0rluliI`%;? ziw!QjdLQ^(?OR1SWuJ z2>m4pf|_SJw4{KJw#qD*td{C##+_EO19r&4*wRk(bY{7ajE$m%tG5H#{kRl?bA)a( zmD%-5t~|jsu?+J~XW9#DYL1?J8D^qetxQW+`MC(%1_EDjP(D10c+tJ*H+Jg!RJIQm4Xdhp1d0Whi3zKmcoVkF`C^ z{1l8p^?!MiAykfm_0>Cau;tv#SutV;Ui>)>?ik?pa{W^Rx@CCjC!)D5;4}IepzlIi zBi#$2sqcRETN~&}$U#`~Ar-FAeE0n~#jfO%Dj{4j`<)>!t7otZ22caZKlLsT`z5vW zlC?4PB>k-x%uqHSD=dT>U>ZajK;GTjd+}fa>kt

.+))?/,H0=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+)(?:\]\]|\))\|?(?.+)?/;var Le="dice-roller-icon",De="dice-roller-copy";var v4=Z2(require("obsidian"));var de=(a=>(a.None="None",a.Normal="Normal",a.Up="Up",a.Down="Down",a))(de||{}),f2=(i=>(i.None="None",i.Average="Average",i.Roll="Roll",i))(f2||{});function Ma(n,e,t){[...n].slice(e).reverse().forEach(([a,r])=>{n.set(a+1,r)}),n.set(e,t)}var R4=Z2(require("obsidian"));var V0=class extends R4.Events{constructor(e,t="",i=e.data.showDice){super();this.plugin=e;this.original=t;this.loaded=!1;this.containerEl=createDiv({cls:"dice-roller",attr:{"aria-label-position":"top","data-dice":this.original}});this.resultEl=this.containerEl.createDiv("dice-roller-result");if(i){let a=this.containerEl.createDiv({cls:"dice-roller-button"});(0,R4.setIcon)(a,Le),a.onclick=this.onClick.bind(this)}else this.containerEl.addClass("no-icon");this.containerEl.onclick=this.onClick.bind(this)}setTooltip(){this.plugin.data.displayResultsInline||this.containerEl.setAttrs({"aria-label":this.tooltip})}getRandomBetween(e,t){let i=new Uint32Array(1);crypto.getRandomValues(i);let a=i[0]/(4294967295+1);return Math.floor(a*(t-e+1))+e}async render(){this.setTooltip(),await this.build()}async onClick(e){e.stopPropagation(),e.stopImmediatePropagation(),window.getSelection()?.isCollapsed&&await this.roll()}},ba=class extends V0{constructor(e,t,i,a=e.data.showDice){super(e,t,a);this.plugin=e;this.original=t;this.lexemes=i;this.showDice=a;this.save=!1}get inlineText(){return`${this.tooltip.split(` +}`;function zc(){var n=Wi,e=ji,t=T2.familyPrefix,i=T2.replacementClass,a=Cc;if(t!==n||i!==e){var r=new RegExp("\\.".concat(n,"\\-"),"g"),s=new RegExp("\\--".concat(n,"\\-"),"g"),o=new RegExp("\\.".concat(e),"g");a=a.replace(r,".".concat(t,"-")).replace(s,"--".concat(t,"-")).replace(o,".".concat(i))}return a}var Ac=function(){function n(){ko(this,n),this.definitions={}}return Uo(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,a=new Array(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:ma(e||{}),a=t.mask;return a&&(a=(a||{}).icon?a:ma(a||{})),n(i,F1({},t,{mask:a}))}}var Ec=new Ac;var va=!1;var L0=Sc(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,i=t===void 0?N4:t,a=e.symbol,r=a===void 0?!1:a,s=e.mask,o=s===void 0?null:s,l=e.maskId,c=l===void 0?null:l,u=e.title,f=u===void 0?null:u,h=e.titleId,m=h===void 0?null:h,v=e.classes,g=v===void 0?[]:v,x=e.attributes,p=x===void 0?{}:x,d=e.styles,z=d===void 0?{}:d;if(!!n){var b=n.prefix,C=n.iconName,E=n.icon;return _c(F1({type:"icon"},n),function(){return wc(),T2.autoA11y&&(f?p["aria-labelledby"]="".concat(T2.replacementClass,"-title-").concat(m||t6()):(p["aria-hidden"]="true",p.focusable="false")),vc({icons:{main:pa(E),mask:o?pa(o.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:C,transform:F1({},N4,i),symbol:r,title:f,maskId:c,titleId:m,extra:{attributes:p,styles:z,classes:g}})})}});function D0(n,e){let t=Object.keys(e).map(i=>Lc(n,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}function Lc(n,e,t){let i=n[e],a=n.hasOwnProperty(e),r=t(i);return i&&Object.setPrototypeOf(r,i),Object.setPrototypeOf(s,r),n[e]=s,o;function s(...l){return r===i&&n[e]===s&&o(),r.apply(this,l)}function o(){n[e]===s&&(a?n[e]=i:delete n[e]),r!==i&&(r=i,Object.setPrototypeOf(s,i||Function))}}var Ti=Z2(ga());var T0=/(?:(?\d+)[Dd])?#(?[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,xa=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+?)#?\^(?.+?)(?:\]\]|\))(?:\|(?
.+))?/,H0=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+)(?:\]\]|\))\|?(?.+)?/;var Le="dice-roller-icon",De="dice-roller-copy";var v4=Z2(require("obsidian"));var de=(a=>(a.None="None",a.Normal="Normal",a.Up="Up",a.Down="Down",a))(de||{}),f2=(i=>(i.None="None",i.Average="Average",i.Roll="Roll",i))(f2||{});function Ma(n,e,t){[...n].slice(e).reverse().forEach(([a,r])=>{n.set(a+1,r)}),n.set(e,t)}var R4=Z2(require("obsidian"));var V0=class extends R4.Events{constructor(e,t="",i=e.data.showDice){super();this.plugin=e;this.original=t;this.loaded=!1;this.containerEl=createSpan({cls:"dice-roller",attr:{"aria-label-position":"top","data-dice":this.original}});this.resultEl=this.containerEl.createSpan("dice-roller-result");if(i){let a=this.containerEl.createSpan({cls:"dice-roller-button"});(0,R4.setIcon)(a,Le),a.onclick=this.onClick.bind(this)}else this.containerEl.addClass("no-icon");this.containerEl.onclick=this.onClick.bind(this)}setTooltip(){this.plugin.data.displayResultsInline||this.containerEl.setAttrs({"aria-label":this.tooltip})}getRandomBetween(e,t){let i=new Uint32Array(1);crypto.getRandomValues(i);let a=i[0]/(4294967295+1);return Math.floor(a*(t-e+1))+e}async render(){this.setTooltip(),await this.build()}async onClick(e){e.stopPropagation(),e.stopImmediatePropagation(),window.getSelection()?.isCollapsed&&await this.roll()}},ba=class extends V0{constructor(e,t,i,a=e.data.showDice){super(e,t,a);this.plugin=e;this.original=t;this.lexemes=i;this.showDice=a;this.save=!1}get inlineText(){return`${this.tooltip.split(` `).join(" -> ")} -> `}},m4=class extends ba{},F4=class extends m4{constructor(e,t,i,a,r=e.data.showDice){super(e,t,[i],r);this.plugin=e;this.original=t;this.lexeme=i;this.source=a;this.watch=!0;this.getPath(),this.init=this.getFile()}async getFile(){if(this.file=this.plugin.app.metadataCache.getFirstLinkpathDest(this.path,this.source),!this.file||!(this.file instanceof R4.TFile))throw new Error("Could not load file.");await this.load(),this.registerFileWatcher()}registerFileWatcher(){this.plugin.registerEvent(this.plugin.app.vault.on("modify",async e=>{!this.watch||this.save||e===this.file&&await this.getOptions()}))}},N0=class extends V0{constructor(e,t,i){super(e,"");this.options=t;this.rolls=i}get tooltip(){return`${this.options.toString()} ${this.results.toString()}`}async roll(){let e=[...this.options];return this.results=[...Array(this.rolls)].map(()=>{let t=e[this.getRandomBetween(0,e.length-1)];return e.splice(e.indexOf(t),1),t}).filter(t=>t),this.render(),this.trigger("new-result"),this.result=this.results[0],this.results[0]}async build(){this.resultEl.empty(),this.resultEl.setText(this.results.toString())}};var P2=class{constructor(e,t={value:e,conditions:[],type:"dice"}){this.lexeme=t;this.modifiers=new Map;this.modifiersAllowed=!0;this.static=!1;this.conditions=[];this.fudge=!1;if(!/(\-?\d+)[dD]?(\d+|%|\[\d+,\s?\d+\])?/.test(e))throw new Error("Non parseable dice string passed to DiceRoll.");this.dice=e.split(" ").join(""),/^-?\d+(?:\.\d+)?$/.test(this.dice)&&(this.static=!0,this.modifiersAllowed=!1);let[,i,a=null,r=1]=this.dice.match(/(\-?\d+)[dD]\[?(?:(-?\d+)\s?,)?\s?(-?\d+|%|F)\]?/)||[,1,null,1];this.multiplier=i<0?-1:1,this.rolls=Math.abs(Number(i))||1,Number(r)<0&&!a&&(a=-1),r==="%"&&(r=100),r==="F"&&(r=1,a=-1,this.fudge=!0),Number(r)[o,{usable:!0,value:s,display:`${s}`,modifiers:new Set}]))}get text(){return`${this.result}`}get result(){return this.static?Number(this.dice):[...this.results].map(([,{usable:t,value:i}])=>t?i:0).reduce((t,i)=>t+i,0)}get display(){return this.static?`${this.result}`:`[${[...this.results].map(([,{modifiers:e,display:t}])=>`${t}${[...e].join("")}`).join(", ")}]`}get modifierText(){if(!this.modifiers.size)return"";let e=[...this.conditions].map(({value:i})=>i).join(""),t=[...this.modifiers].map(([i,{conditionals:a,value:r}])=>{let s=a.map(o=>o.value);return`${r}${s.join("")}`}).join("");return`${e}${t}`}keepLow(e=1){if(!this.modifiersAllowed){new v4.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>t[1].value-i[1].value).slice(e-this.results.size).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}keepHigh(e=1){if(!this.modifiersAllowed){new v4.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>i[1].value-t[1].value).slice(e).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}reroll(e,t){if(!this.modifiersAllowed){new v4.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.min,value:""});let i=0,a=[...this.results].filter(([,{value:r}])=>this.checkCondition(r,t));for(;ithis.checkCondition(r,t)).length>0;)i++,a.map(([,r])=>{r.modifiers.add("r"),r.value=this.getRandomBetween(this.faces.min,this.faces.max)});a.forEach(([r,s])=>{this.results.set(r,s)})}explodeAndCombine(e,t){if(!this.modifiersAllowed){new v4.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.max,value:""});let i=0;[...this.results].filter(([,{value:r}])=>this.checkCondition(r,t)).forEach(([r,s])=>{let o=this.getRandomBetween(this.faces.min,this.faces.max);for(i++,s.modifiers.add("!"),s.value+=o,s.display=`${s.value}`,this.results.set(r,s);ithis.checkCondition(r,t)),a=0;i.forEach(([r,s])=>{let o=s.value,l=0;for(;lthis.multiplier*this.getRandomBetween(this.faces.min,this.faces.max))}setResults(e){this.results=new Map([...e].map((t,i)=>[i,{usable:!0,value:t,display:`${t}`,modifiers:new Set}]))}applyModifiers(){for(let[e,t]of this.modifiers)this.applyModifier(e,t)}roll(){let e=this._roll();return this.results=new Map([...e].map((t,i)=>[i,{usable:!0,value:t,display:`${t}`,modifiers:new Set}])),this.applyModifiers(),this.conditions?.length&&this.applyConditions(),e}applyConditions(){for(let[e,t]of this.results){let i=this.conditions.find(({operator:r})=>r==="-="||r==="=-");if(i&&t.value===i.comparer){t.value=-1,t.modifiers.add("-");continue}this.checkCondition(t.value,this.conditions)?(t.modifiers.add("*"),t.value=1):t.usable=!1}}applyModifier(e,t){switch(e){case"kh":{this.keepHigh(t.data);break}case"kl":{this.keepLow(t.data);break}case"!":{this.explode(t.data,t.conditionals);break}case"!!":{this.explodeAndCombine(t.data,t.conditionals);break}case"r":{this.reroll(t.data,t.conditionals);break}case"condition":}}checkCondition(e,t){return!t||!t.length?e:t.some(({operator:i,comparer:a})=>{if(Number.isNaN(e)||Number.isNaN(a))return!1;let r=!1;switch(i){case"=":r=e===a;break;case"!=":case"=!":r=e!==a;break;case"<":r=e":r=e>a;break;case">=":r=e>=a;break}return r})}allowAverage(){return!0}average(){return(this.faces.min+this.faces.max)/2}getRandomBetween(e,t){return Math.floor(Math.random()*(t-e+1))+e}},xt=class extends P2{constructor(e,t){super("3d6",t);this.dice=e;this.lexeme=t}get doubles(){return new Set([...this.results].map(([,{usable:e,value:t}])=>e?t:0)).size<3}get result(){return this.static?Number(this.dice):[...this.results].map(([,{usable:t,value:i}])=>t?i:0).reduce((t,i)=>t+i,0)}get display(){let e=[];for(let t of this.results){if(t[0]==0&&this.doubles){e.push(`${t[1].value}S`);continue}e.push(`${t[1].value}`)}return`[${e.join(", ")}]`}allowAverage(){return!1}},ya=class extends P2{constructor(e,t){super(e,t);this.dice=e;this.lexeme=t;this.stack=[];let i=`${this.faces.max}`.split("");for(let a=0;aNumber(e.map(t=>t.result).join(""))).reduce((e,t)=>e+t)}get display(){return this.stack.map(e=>e.map(t=>t.result).join(",")).join("|")}roll(){return!this.stack||!this.stack.length?super.roll():(this.stack.forEach(e=>e.map(t=>t.roll())),[...this.stack.map(e=>e.map(t=>t.result)).flat()])}allowAverage(){return!1}},I2=class extends m4{constructor(e,t,i,a=e.data.showDice,r,s){super(e,t,i,a);this.plugin=e;this.original=t;this.lexemes=i;this.displayFixedText=!1;this.stunted="";this.shouldRender=!1;this.showFormula=!1;this.operators={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"^":(e,t)=>Math.pow(e,t)};this.stack=[];this.stackCopy=[];this.dice=[];this.fixedText=r,this.expectedValue=s,this.displayFixedText=this.fixedText!=="",this.loaded=!0,this.trigger("loaded")}get replacer(){return`${this.result}`}get resultText(){let e=[],t=0;return this.dice.forEach(i=>{let a=this.original.slice(t);e.push(a.slice(0,a.indexOf(i.lexeme.text)),i.display),t+=a.indexOf(i.lexeme.text)+i.lexeme.text.length+i.modifierText.length}),e.push(this.original.slice(t)),e.join("")}get tooltip(){return this._tooltip?this._tooltip:this.expectedValue===f2.Roll||this.shouldRender?this.displayFixedText?`${this.original} @@ -494,7 +494,7 @@ ${this.result.basename}`}async roll(){return new Promise((e,t)=>{this.loaded?(th `+this.tag);this.links=Array.from(t).map(i=>this.plugin.app.metadataCache.getFirstLinkpathDest(i,this.source)),this.loaded=!0,this.trigger("loaded")}toResult(){return{type:"link",result:this.result.path}}async applyResult(e){if(e.type==="link"){if(e.result){let t=this.plugin.app.vault.getAbstractFileByPath(e.result);t&&t instanceof n2.TFile&&(this.result=t)}await this.render()}}},s6=class extends F4{constructor(e,t,i,a,r=!0,s=e.data.showDice){super(e,t,i,a,s);this.plugin=e;this.original=t;this.lexeme=i;this.inline=r;this.containerEl.addClasses(["has-embed","markdown-embed"]),this.resultEl.addClass("internal-embed"),this.resultEl.setAttrs({src:a}),this.copy=this.containerEl.createDiv({cls:"dice-content-copy dice-roller-button no-show",attr:{"aria-label":"Copy Contents"}}),this.copy.addEventListener("click",o=>{o.stopPropagation(),navigator.clipboard.writeText(this.results.join(` `)).then(async()=>{new n2.Notice("Result copied to clipboard.")})}),(0,n2.setIcon)(this.copy,De)}get replacer(){return this.result}get tooltip(){return`${this.original} ${this.path}`}async build(){if(this.resultEl.empty(),this.plugin.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.plugin.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:"markdown-embed"});if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(n2.MarkdownRenderer.renderMarkdown(e,t.createDiv(),this.source,null),this.plugin.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",a=>{a.stopPropagation(),navigator.clipboard.writeText(e).then(async()=>{new n2.Notice("Result copied to clipboard.")})}),(0,n2.setIcon)(i,De)}}}async load(){await this.getOptions()}getPath(){let{groups:e}=this.lexeme.value.match(H0),{roll:t=1,link:i,types:a}=e;if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=i.replace(/(\[|\])/g,""),this.types=a?.split(",")}async getOptions(){if(this.content=await this.plugin.app.vault.cachedRead(this.file),!this.content)throw new Error("Could not read file cache.");this.options=this.content.trim().split(` -`).map(e=>e.trim()).filter(e=>e&&e.length),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])}})}toResult(){return{type:"section",result:this.results}}async applyResult(e){e.type==="section"&&(e.result&&(this.results=e.result),await this.render())}},Ca=(n,e)=>n.start.col==e.start.col&&n.start.line==e.start.line&&n.start.offset==e.start.offset;var o6=Z2(require("obsidian"));var za=class{constructor(){this.result="";this.combinedTooltip=""}},B4=class extends F4{constructor(){super(...arguments);this.combinedTooltip="";this.prettyTooltip=""}getPath(){let{groups:e}=this.lexeme.value.match(xa),{roll:t=1,link:i,block:a,header:r}=e;if(!i||!a)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.block=a.replace(/(\^|#)/g,"").trim().toLowerCase(),this.header=r}get tooltip(){return this.prettyTooltip}get replacer(){return this.result}async build(){this.resultEl.empty();let e=[this.result];this.plugin.data.displayResultsInline&&e.unshift(this.inlineText),o6.MarkdownRenderer.renderMarkdown(e.join(""),this.resultEl.createSpan("embedded-table-result"),this.source,null)}prettify(e){let t=/(.*?)(\(|\)|;|\|\|)(.*)/,i=" ",a=0,r="",s=e,o;for(;o=s.match(t);){let[,l,c,u]=o;r+=l,c==")"?(a--,r+=` +`).map(e=>e.trim()).filter(e=>e&&e.length),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let a=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(a),1),a}).filter(a=>a),this.render(),this.trigger("new-result"),e(this.results[0])}})}toResult(){return{type:"section",result:this.results}}async applyResult(e){e.type==="section"&&(e.result&&(this.results=e.result),await this.render())}},Ca=(n,e)=>n.start.col==e.start.col&&n.start.line==e.start.line&&n.start.offset==e.start.offset;var o6=Z2(require("obsidian"));var za=class{constructor(){this.result="";this.combinedTooltip=""}},B4=class extends F4{constructor(){super(...arguments);this.combinedTooltip="";this.prettyTooltip=""}getPath(){let{groups:e}=this.lexeme.value.match(xa),{roll:t=1,link:i,block:a,header:r}=e;if(!i||!a)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.block=a.replace(/(\^|#)/g,"").trim().toLowerCase(),this.header=r}get tooltip(){return this.prettyTooltip}get replacer(){return this.result}async build(){this.resultEl.empty();let e=[this.result];this.plugin.data.displayResultsInline&&e.unshift(this.inlineText);let t=createSpan();await o6.MarkdownRenderer.renderMarkdown(e.join(""),t,this.source,null);let i=this.resultEl.createSpan("embedded-table-result");t.childElementCount==1&&t.firstElementChild instanceof HTMLParagraphElement?i.append(...Array.from(t.firstElementChild.childNodes)):i.append(...Array.from(t.childNodes))}prettify(e){let t=/(.*?)(\(|\)|;|\|\|)(.*)/,i=" ",a=0,r="",s=e,o;for(;o=s.match(t);){let[,l,c,u]=o;r+=l,c==")"?(a--,r+=` `,r+=i.repeat(a),r+=")"):(c=="("?(a++,r+="("):c==";"?r+=",":c=="||"&&(r+="|"),r+=` `,r+=i.repeat(a)),s=u}return r+=s,r}async getSubResult(e){let t=new za;typeof e=="number"?t.result=e.toString():t.result=e;let i=[];if(typeof e=="string"){let a=/(?:\`dice:)(.*?)(?:\`)/g,r=e.matchAll(a);for(let s of r){let o=s[1].trim(),l=await this.plugin.getRoller(o,this.source);await l.roll();let c=await this.getSubResult(l.result),u;if(c.result instanceof o6.TFile?u=c.result.basename:u=c.result,t.result=t.result.replace(s[0],u),l instanceof B4)i.push(l.combinedTooltip);else{let[f,h]=l.tooltip.split(` `);i.push(f+" --> "+h)}}}return t.combinedTooltip=i.join(";"),t}async getResult(){let e=[],t=[];for(let i=0;ic[1]===void 0&&o===c[0]||o>=c[0]&&c[1]>=o);l&&(a=this.lookupRoller.original.trim()+" --> "+`${this.lookupRoller.resultText}${this.header?" | "+this.header:""}`.trim(),s=l[1])}else{let o=[...this.options],l=this.getRandomBetween(0,o.length-1);a=o.length+" rows --> [row "+(l+1)+"]",s=o[l]}r=await this.getSubResult(s),e.push(r.result),r.combinedTooltip&&(a+=" > ("+r.combinedTooltip+")"),t.push(a)}return t.length==0?this.combinedTooltip=this.original:t.length==1?this.combinedTooltip=this.original+" "+t.join(""):this.combinedTooltip=this.original+" ==> ("+t.join(" ||")+")",this.prettyTooltip=this.prettify(this.combinedTooltip),e.join("||")}async roll(){return new Promise(async e=>{this.loaded?(this.result=await this.getResult(),this.render(),this.trigger("new-result"),e(this.result)):this.on("loaded",async()=>{this.result=await this.getResult(),this.render(),this.trigger("new-result"),e(this.result)})})}async load(){await this.getOptions()}async getOptions(){if(this.cache=this.plugin.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.blocks||!(this.block in this.cache.blocks))throw new Error(`Could not read file cache. Does the block reference exist? diff --git a/.obsidian/plugins/obsidian-dice-roller/manifest.json b/.obsidian/plugins/obsidian-dice-roller/manifest.json index 022114b0..217cb8b5 100644 --- a/.obsidian/plugins/obsidian-dice-roller/manifest.json +++ b/.obsidian/plugins/obsidian-dice-roller/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-dice-roller", "name": "Dice Roller", - "version": "8.6.6", + "version": "8.6.7", "minAppVersion": "0.12.15", "description": "Inline dice rolling for Obsidian.md", "author": "Jeremy Valentine", diff --git a/.obsidian/plugins/obsidian-kanban/main.js b/.obsidian/plugins/obsidian-kanban/main.js index afa4ddb9..8a366a31 100644 --- a/.obsidian/plugins/obsidian-kanban/main.js +++ b/.obsidian/plugins/obsidian-kanban/main.js @@ -60,14 +60,14 @@ Output: `),!0;if(Ia.test(n)){let a=n.match(/^(\s*[-*+]\s+(?:\[[^\]]\]\s*)?)/)[1];return _a(e,` ${a.replace(/^(\s*[-*+]\s+)\[[^\]]\]/,"$1[ ]")}`),!0}if(Ma.test(n)){let s=n.match(/^(\s*\d+[.)]\s+(?:\[[^\]]\]\s*)?)/)[1].replace(/^(\s*\d+[.)]\s+)\[[^\]]\]/,"$1[ ]").replace(/^(\s*)(\d+)/,(u,l,c)=>`${l}${parseInt(c)+1}`);return _a(e,` ${s}`),!0}return!1}function Xn(e,t){return od.Platform.isMobile?e.key==="Enter"&&!0:t.getSetting("new-line-trigger")==="enter"?e.key==="Enter"&&!(e.shiftKey||e.metaKey||e.ctrlKey):e.key==="Enter"&&e.shiftKey}var Er=F.forwardRef(function({onEnter:t,onEscape:r,onSubmit:n,...i},a){let{view:o,stateManager:s}=F.useContext(Ve),u=app.vault.getConfig("autoPairMarkdown"),l=app.vault.getConfig("autoPairBrackets"),c=app.vault.getConfig("useTab"),d=app.vault.getConfig("tabSize"),f=!!app.vault.getConfig("useMarkdownLinks"),p=by({isInputVisible:!0,onEnter:t,onEscape:r,onKeyDown:m=>{if(m.key==="Backspace"){let y=Dy(m.target);return y||My(m.target)}if(Xn(m,s)){let y=Ay(m.target);if(y)return m.preventDefault(),y}if(m.key==="Tab")return m.preventDefault(),Iy(m.target,m.shiftKey,c,d);if(u){let y=ad[m.key];if(y&&y(m.target))return m.preventDefault(),!0}if(l){if(f&&m.key==="[")return!1;let y=id[m.key];if(y&&y(m.target))return m.preventDefault(),!0}return!1}});return F.useEffect(()=>{let m=y=>{let b=Cy[y];b&&b(p.ref.current)};return o.emitter.on("hotkey",m),()=>{o.emitter.off("hotkey",m)}},[o]),g(S,null,g("div",{"data-replicated-value":i.value,className:$("grow-wrap")},g("textarea",{"data-ignore-drag":!0,rows:1,className:$("item-input"),...i,...p,ref:m=>{p.ref.current=m,a&&typeof a=="function"?a(m):a&&(a.current=m)}})),od.Platform.isMobile&&g("button",{onPointerDown:n,className:$("item-submit-button")},B("Submit")))});h();var cd=ge(Ly());h();var xr=ge(require("obsidian"));var $_=["bmp","png","jpg","jpeg","gif","svg"],U_=["mp3","wav","m4a","3gp","flac","ogg","oga"],W_=["mp4","webm","ogv"],V_=/\u00A0/g,z_=/[!"#$%&()*+,.:;<=>?@^`{|}~/[\]\\]/g;function Py(e){return e.replace(z_," ").replace(/\s+/g," ").trim()}function Ur(e){let r=e.replace(V_," ").normalize("NFC").split(/\|(.*)/),n=r[0].split(/#(.*)/);return{root:n[0],subpath:n[1]?"#"+n[1]:"",alias:r[1]||""}}function j_(e,t){if(!e||!t)return null;let r=t.split("#").filter(l=>!!l);if(!r||r.length===0)return null;if(r.length===1){let l=r[0];if(l.startsWith("^")){let c=l.slice(1).toLowerCase(),d=e.blocks;if(d&&d[c]){let f=d[c];return{type:"block",block:f,start:f.position.start.offset,end:f.position.end.offset,startLine:f.position.start.line,endLine:f.position.end.line}}else return null}}let n=e.headings;if(!n||n.length===0)return null;let i=0,a=0,o=0,s=null,u=null;for(;ao&&Py(l.heading).toLowerCase()===Py(r[i]).toLowerCase()&&(i++,o=l.level,i===r.length&&(s=l))}return s?{type:"heading",current:s,next:u,start:s.position.start.offset,end:u?u.position.start.offset:null,startLine:s.position.start.line,endLine:u?u.position.end.line:null}:null}function q_(e){e.querySelectorAll(".task-list-item-checkbox").forEach((r,n)=>{r.dataset.checkboxIndex=n.toString()})}function Y_(e,t){e.querySelectorAll(".internal-link").forEach(n=>{let i=Ur(n.getAttr("href"));t.app.metadataCache.getFirstLinkpathDest(i.root,t.file.path)||n.addClass("is-unresolved")})}function J_(e,t,r){e.empty(),e.createEl("img",{attr:{src:r.app.vault.getResourcePath(t)}},n=>{e.hasAttribute("width")&&n.setAttribute("width",e.getAttribute("width")),e.hasAttribute("height")&&n.setAttribute("height",e.getAttribute("height")),e.hasAttribute("alt")&&n.setAttribute("alt",e.getAttribute("alt"))}),e.addClasses(["image-embed","is-loaded"])}function Fy(e,t,r){e.empty(),e.createEl("audio",{attr:{controls:"",src:r.app.vault.getResourcePath(t)}}),e.addClasses(["media-embed","is-loaded"])}function G_(e,t,r){e.empty(),e.createEl("video",{attr:{controls:"",src:r.app.vault.getResourcePath(t)}},n=>{let i=()=>{n.removeEventListener("loadedmetadata",i),n.videoWidth===0&&n.videoHeight===0&&(e.empty(),Fy(e,t,r))};n.addEventListener("loadedmetadata",i)}),e.addClasses(["media-embed","is-loaded"])}async function Ny(e,t,r){let n=r.app.metadataCache.getFileCache(e);if(!n)return null;let i=await r.app.vault.cachedRead(e);if(!t.subpath)return{markdown:i,boundary:null};let a=j_(n,t.subpath);if(a)return{markdown:i.substring(a.start,a.end===null?void 0:a.end),boundary:a};if(t.subpath)return{markdown:`${B("Unable to find")} ${t.root}${t.subpath}`,boundary:null}}function Oy(e,t,r,n){r.getWindow().setTimeout(async()=>{if(!r.plugin.windowRegistry.has(r.getWindow()))return;if(r.plugin.windowRegistry.get(r.getWindow()).viewMap.has(r.id)){let{markdown:a}=await Ny(e,t,r);if(!a)return;a.startsWith(B("Unable to find"))?n>0&&Oy(e,t,r,--n):r.plugin.stateManagers.forEach(o=>{o.onFileMetadataChange()})}},2e3)}async function Q_(e,t,r,n,i){var u;let{markdown:a,boundary:o}=await Ny(t,r,n);if(!a)return;e.empty();let s=e.createDiv();if(s.addClasses(["markdown-preview-view",$("markdown-preview-view")]),s.createDiv($("embed-link-wrapper"),l=>{l.createEl("a",{href:e.getAttr("src")||t.basename,cls:`internal-link ${$("embed-link")}`},c=>{(0,xr.setIcon)(c,"link"),c.setAttr("aria-label",t.basename)})}),await xr.MarkdownRenderer.renderMarkdown(a,s.createDiv(),t.path,n),e.addClass("is-loaded"),a.startsWith(B("Unable to find"))&&r.subpath&&r.subpath!=="#")Oy(t,r,n,4);else{let l=e.findAll(".task-list-item-checkbox");(l==null?void 0:l.length)&&((u=app.metadataCache.getFileCache(t).listItems)==null||u.filter(d=>o?d.position.start.line>=o.startLine&&d.position.end.line<=o.endLine:!0).forEach((d,f)=>{l[f]&&(l[f].dataset.oStart=d.position.start.offset.toString(),l[f].dataset.oEnd=d.position.end.offset.toString(),l[f].dataset.src=t.path)}))}i>0&&await Ry(s,n,--i)}function X_(e,t){e.addClass("is-loaded"),e.empty(),e.createEl("a",{cls:"file-link",href:e.getAttribute("src"),text:t.name},r=>{r.setAttribute("aria-label",B("Open in default app")),r.createSpan({},n=>(0,xr.setIcon)(n,"open-elsewhere-glyph"))})}function Ry(e,t,r){return Promise.all(e.findAll(".internal-embed").map(async n=>{let i=n.getAttribute("src"),a=Ur(i),o=typeof i=="string"&&t.app.metadataCache.getFirstLinkpathDest(a.root,t.file.path);if(o instanceof xr.TFile)return $_.contains(o.extension)?J_(n,o,t):U_.contains(o.extension)?Fy(n,o,t):W_.contains(o.extension)?G_(n,o,t):o.extension==="md"?await Q_(n,o,a,t,r):X_(n,o)}))}async function Aa(e,t){let r=e.getWindow().document.body.createDiv();r.detach();try{await xr.MarkdownRenderer.renderMarkdown(t,r,e.file.path,e),q_(r),Y_(r,e),await Ry(r,e,5)}catch(n){console.error(n)}return r}function ud(e,t){!t||!e||(e&&!e.firstChild?e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.replaceChild(t,e.firstChild))}var La=F.memo(function({className:t,markdownString:r,searchQuery:n,...i}){let{stateManager:a}=F.useContext(Ve),o=F.useRef(),s=F.useRef(),u=F.useRef();return F.useEffect(()=>{Aa(a.getAView(),r).then(l=>{s.current=l,u.current=new cd.default(l),o.current&&ud(o.current,l)}).catch(l=>{a.setError(l),console.error(l)})},[a,r]),F.useEffect(()=>{var l,c;(l=u.current)==null||l.unmark(),n&&n.trim()&&((c=u.current)==null||c.mark(n))},[n]),g("div",{ref:l=>{o.current=l,ud(l,s.current)},className:mt(["markdown-preview-view",$("markdown-preview-view"),t]),...i})}),Hy=F.memo(function({dom:t,className:r,searchQuery:n,...i}){let{stateManager:a}=F.useContext(Ve),o=F.useMemo(()=>t.cloneNode(!0),[t,a]),s=F.useMemo(()=>new cd.default(o),[o]);return F.useEffect(()=>{s.unmark(),n&&n.trim()&&s.mark(n)},[s,n]),g("div",{ref:u=>{ud(u,o)},className:mt(["markdown-preview-view",$("markdown-preview-view"),r]),...i})});h();var Pa=ge(require("obsidian"));function Z_(e,t){if(t)return t.from((0,Pa.moment)());let r=(0,Pa.moment)().startOf("day");if(r.isSame(e,"day"))return B("today");let n=e.diff(r,"day");return n===-1?B("yesterday"):n===1?B("tomorrow"):e.from(r)}function By({item:e,stateManager:t}){if(!t.useSetting("show-relative-date")||!e.data.metadata.date)return null;let n=Z_(e.data.metadata.date,e.data.metadata.time);return g("span",{className:$("item-metadata-date-relative")},n)}function Ky({item:e,stateManager:t,filePath:r,onEditDate:n,onEditTime:i}){let a=t.useSetting("hide-date-display"),o=t.useSetting("date-format"),s=t.useSetting("time-format"),u=t.useSetting("date-display-format"),l=t.useSetting("link-date-to-daily-note");if(a||!e.data.metadata.date)return null;let c=e.data.metadata.date.format(o);if(!c)return null;let d=!!e.data.metadata.time,f=e.data.metadata.date.format(u),p=d?e.data.metadata.time.format(s):null,m=c?(0,Pa.getLinkpath)(c):null,y=c?t.app.metadataCache.getFirstLinkpathDest(m,r):null,b=m&&l?g("a",{href:m,"data-href":m,className:`internal-link ${y?"":"is-unresolved"}`,target:"blank",rel:"noopener"},f):f,x={};return l||(x["aria-label"]=B("Change date"),x.onClick=n),g("span",{"aria-label":"hello",className:$("item-metadata-date-wrapper")},g("span",{...x,className:`${$("item-metadata-date")} ${l?"":"is-button"}`},b)," ",d&&g("span",{onClick:i,className:`${$("item-metadata-time")} is-button`,"aria-label":B("Change time")},p))}function eC(e){let{stateManager:t,boardModifiers:r}=F.useContext(Ve),n=Vn();return F.useMemo(()=>({onEditDate:o=>{var s;ns(o.view,t,{x:o.clientX,y:o.clientY},rs({stateManager:t,boardModifiers:r,item:e,hasDate:!0,path:n}),(s=e.data.metadata.date)==null?void 0:s.toDate())},onEditTime:o=>{is(o.view,t,{x:o.clientX,y:o.clientY},as({stateManager:t,boardModifiers:r,item:e,hasTime:!0,path:n}),e.data.metadata.time)}}),[r,n,e,t])}function tC(e){return(e.useSetting("tag-colors")||[]).reduce((r,n)=>(n.tagKey&&(r[n.tagKey]=n),r),{})}function nC(e,t){let r=0;return e.replace(/^(\s*[-+*]\s+?\[)([^\]])(\]\s+)/gm,(n,i,a,o)=>{let s=n;return r===t&&(a===" "?s=`${i}x${o}`:s=`${i} ${o}`),r++,s})}async function rC(e){let t=app.vault.getAbstractFileByPath(e.dataset.src);if(!(t instanceof $y.TFile))return;let r=await app.vault.cachedRead(t),n=parseInt(e.dataset.oStart),i=parseInt(e.dataset.oEnd),o=r.substring(n,i).replace(/^(.+?)\[(.)\](.+)$/,(s,u,l,c)=>l!==" "?(e.parentElement.removeClass("is-checked"),e.parentElement.dataset.task="",`${u}[ ]${c}`):(e.parentElement.addClass("is-checked"),e.parentElement.dataset.task="x",`${u}[x]${c}`));await app.vault.modify(t,`${r.substring(0,n)}${o}${r.substring(i)}`)}var Uy=F.memo(function({item:t,isEditing:r,setIsEditing:n,searchQuery:i}){var A;let[a,o]=F.useState(t.data.titleRaw),{stateManager:s,filePath:u,boardModifiers:l,view:c}=F.useContext(Ve),d=s.useSetting("hide-tags-display"),f=tC(s),p=Vn(),{onEditDate:m,onEditTime:y}=eC(t);F.useEffect(()=>{r&&o(t.data.titleRaw)},[r]);let b=F.useCallback(N=>{if(!Xn(N,s))return N.preventDefault(),s.updateItemContent(t,a).then(T=>{l.updateItem(p,T)}).catch(T=>{s.setError(T),console.error(T)}),n(!1),!0},[s,a,t,p]),x=F.useCallback(()=>{s.updateItemContent(t,a).then(N=>{l.updateItem(p,N)}).catch(N=>{s.setError(N),console.error(N)}),n(!1)},[s,a,t,p]),D=F.useCallback(()=>(n(!1),o(t.data.titleRaw),!0),[t]),C=F.useCallback(N=>{let T=N.target;if(T.hasClass("task-list-item-checkbox")){if(T.dataset.src)return rC(T);let O=parseInt(T.dataset.checkboxIndex,10);s.updateItemContent(t,nC(t.data.titleRaw,O)).then(W=>{l.updateItem(p,W)}).catch(W=>{s.setError(W),console.error(W)})}},[p,l,s,t]);return r?g("div",{className:$("item-input-wrapper")},g(Er,{className:$("item-input"),onChange:N=>o(N.target.value),onEnter:b,onEscape:D,onSubmit:x,value:a,onPaste:N=>{ms(N,s,c.getWindow())}})):g("div",{className:$("item-title")},g(Hy,{className:$("item-markdown"),dom:t.data.dom,searchQuery:i,onPointerDown:C}),g("div",{className:$("item-metadata")},g(By,{item:t,stateManager:s}),g(Ky,{item:t,stateManager:s,filePath:u,onEditDate:m,onEditTime:y}),!d&&!!((A=t.data.metadata.tags)==null?void 0:A.length)&&g("div",{className:$("item-tags")},t.data.metadata.tags.map((N,T)=>g("a",{href:N,key:T,className:`tag ${$("item-tag")} ${N.toLocaleLowerCase().contains(i)?"is-search-match":""}`,style:!!f[N]&&{"--tag-color":f[N].color,"--tag-background-color":f[N].backgroundColor}},g("span",null,N[0]),N.slice(1))))))});h();var ks=ge(require("obsidian"));var iC=/[\\/:"*?<>|]+/g,aC=/!?\[\[([^\]]*)\.[^\]]+\]\]/g,oC=/!?\[\[([^\]]*)\]\]/g,sC=/!?\[([^\]]*)\]\([^)]*\)/g;function Wy({setIsEditing:e,item:t,path:r,boardModifiers:n,stateManager:i}){return F.useCallback((a,o)=>{if(o)app.workspace.onLinkContextMenu(a,(0,ks.getLinkpath)(o),i.file.path);else{let s={x:a.clientX,y:a.clientY},u=!!t.data.metadata.date,l=!!t.data.metadata.time,c=new ks.Menu().addItem(d=>{d.setIcon("pencil").setTitle(B("Edit card")).onClick(()=>e(!0))});c.addItem(d=>{d.setIcon("create-new").setTitle(B("New note from card")).onClick(async()=>{let f=t.data.title.split(` -`)[0].trim(),p=f.replace(aC,"$1").replace(oC,"$1").replace(sC,"$1").replace(iC," ").trim(),m=i.getSetting("new-note-folder"),y=i.getSetting("new-note-template"),b=m?i.app.vault.getAbstractFileByPath(m):i.app.fileManager.getNewFileParent(i.file.path),x=await i.app.fileManager.createNewMarkdownFile(b,p),D=i.app.workspace.splitActiveLeaf();await D.openFile(x),i.app.workspace.setActiveLeaf(D,!1,!0),await _p(i,y);let C=t.data.titleRaw.replace(f,i.app.fileManager.generateMarkdownLink(x,i.file.path));i.updateItemContent(t,C).then(A=>{n.updateItem(r,A)}).catch(A=>{i.setError(A),console.error(A)})})}).addItem(d=>{d.setIcon("links-coming-in").setTitle(B("Copy link to card")).onClick(()=>{if(t.data.blockId)navigator.clipboard.writeText(`${this.app.fileManager.generateMarkdownLink(i.file,"","#^"+t.data.blockId)}`);else{let f=Re(6);navigator.clipboard.writeText(`${this.app.fileManager.generateMarkdownLink(i.file,"","#^"+f)}`),i.updateItemContent(t,`${t.data.titleRaw} ^${f}`).then(p=>{n.updateItem(r,p)}).catch(p=>{i.setError(p),console.error(p)})}})}).addSeparator(),/\n/.test(t.data.titleRaw)&&c.addItem(d=>{d.setIcon("split").setTitle(B("Split card")).onClick(async()=>{let f=t.data.titleRaw.split(/[\r\n]+/g).map(m=>m.trim()),p=await Promise.all(f.map(m=>i.getNewItem(m)));n.splitItem(r,p)})}),c.addItem(d=>{d.setIcon("documents").setTitle(B("Duplicate card")).onClick(()=>n.duplicateEntity(r))}).addItem(d=>{d.setIcon("plus-with-circle").setTitle(B("Insert card before")).onClick(async()=>n.insertItems(r,[await i.getNewItem("",!1,!0)]))}).addItem(d=>{d.setIcon("plus-with-circle").setTitle(B("Insert card after")).onClick(async()=>{let f=[...r];f[f.length-1]=f[f.length-1]+1,n.insertItems(f,[await i.getNewItem("",!1,!0)])})}).addItem(d=>{d.setIcon("sheets-in-box").setTitle(B("Archive card")).onClick(()=>n.archiveItem(r))}).addItem(d=>{d.setIcon("trash").setTitle(B("Delete card")).onClick(()=>n.deleteEntity(r))}).addSeparator().addItem(d=>{d.setIcon("calendar-with-checkmark").setTitle(u?B("Edit date"):B("Add date")).onClick(()=>{var f;ns(a.view,i,s,rs({stateManager:i,boardModifiers:n,item:t,hasDate:u,path:r}),(f=t.data.metadata.date)==null?void 0:f.toDate())})}),u&&(c.addItem(d=>{d.setIcon("cross").setTitle(B("Remove date")).onClick(()=>{let f=i.getSetting("link-date-to-daily-note"),p=i.getSetting("date-trigger"),m=f?"(?:\\[[^\\]]+\\]\\([^\\)]+\\)|\\[\\[[^\\]]+\\]\\])":"{[^}]+}",y=new RegExp(`(^|\\s)${Ln(p)}${m}`),b=t.data.titleRaw.replace(y,"").trim();i.updateItemContent(t,b).then(x=>{n.updateItem(r,x)}).catch(x=>{i.setError(x),console.error(x)})})}),c.addItem(d=>{d.setIcon("clock").setTitle(l?B("Edit time"):B("Add time")).onClick(()=>{is(a.view,i,s,as({stateManager:i,boardModifiers:n,item:t,hasTime:l,path:r}),t.data.metadata.time)})}),l&&c.addItem(d=>{d.setIcon("cross").setTitle(B("Remove time")).onClick(()=>{let f=i.getSetting("time-trigger"),p=new RegExp(`(^|\\s)${Ln(f)}{([^}]+)}`),m=t.data.titleRaw.replace(p,"").trim();i.updateItemContent(t,m).then(y=>{n.updateItem(r,y)}).catch(y=>{i.setError(y),console.error(y)})})})),c.showAtPosition(s)}},[e,t,r,n,i])}h();var Vy=F.memo(function({isEditing:t,setIsEditing:r,showMenu:n}){let i=F.useMemo(()=>t?{"data-ignore-drag":!0}:{},[t]);return g("div",{...i,className:$("item-postfix-button-wrapper")},t?g("button",{"data-ignore-drag":!0,onPointerDown:a=>{a.preventDefault()},onClick:()=>{r(!1)},className:`${$("item-postfix-button")} is-enabled`,"aria-label":B("Cancel")},g(Kt,{name:"cross"})):g("button",{"data-ignore-drag":!0,onPointerDown:a=>a.preventDefault(),onClick:n,className:$("item-postfix-button"),"aria-label":B("More options")},g(Kt,{name:"vertical-three-dots"})))});h();var Ss=ge(require("obsidian"));function zy({item:e,isSettingsVisible:t,searchQuery:r}){return t||!e.data.metadata.fileMetadata?null:g("div",{className:$("item-metadata-wrapper")},g(cC,{metadata:e.data.metadata.fileMetadata,order:e.data.metadata.fileMetadataOrder,searchQuery:r}))}function jy(e,t){if(e.ts){let r=t.getSetting("date-display-format");return(0,Ss.moment)(e.ts).format(r)}return null}function qy(e,t){if(!e.path)return null;let r=app.vault.getAbstractFileByPath(e.path);if(r&&r instanceof Ss.TFile){let n=app.fileManager.generateMarkdownLink(r,t.file.path,e.subpath,e.display);return`${e.embed?"!":""}${n}`}return`${e.embed?"!":""}[[${e.path}${e.display?`|${e.display}`:""}]]`}function lC({data:e,searchQuery:t}){let{view:r,stateManager:n}=F.useContext(Ve);if(Array.isArray(e.value))return g("span",{className:$("meta-value")},e.value.map((s,u,l)=>{let c=`${s}`,d=typeof s=="object"&&!Array.isArray(s)&&(jy(s,n)||qy(s,r)),f=c.toLocaleLowerCase().contains(t);return g(S,null,d||e.containsMarkdown?g(La,{className:"inline",markdownString:d||c,searchQuery:t}):f?g("span",{className:"is-search-match"},c):c,u{let a=t[i];return g("tr",{key:i,className:$("meta-row")},!a.shouldHideLabel&&g("td",{className:`${$("meta-key")} ${(a.label||i).toLocaleLowerCase().contains(n)?"is-search-match":""}`,"data-key":i},g("span",null,a.label||i)),g("td",{colSpan:a.shouldHideLabel?2:1,className:$("meta-value-wrapper"),"data-value":Array.isArray(a.value)?a.value.join(", "):`${a.value}`},i==="tags"?a.value.map((o,s)=>g("a",{href:o,key:s,className:`tag ${$("item-tag")} ${o.toLocaleLowerCase().contains(n)?"is-search-match":""}`},g("span",null,o[0]),o.slice(1))):g(lC,{data:a,searchQuery:n})))})))});var Yy=F.memo(function({item:t,shouldMarkItemsComplete:r,isMatch:n,searchQuery:i}){let{stateManager:a,boardModifiers:o}=F.useContext(Ve),[s,u]=F.useState(!1),l=F.useContext(kt);F.useEffect(()=>{let y=()=>{s&&u(!1)};return l.dragManager.emitter.on("dragStart",y),()=>{l.dragManager.emitter.off("dragStart",y)}},[l,s]),F.useEffect(()=>{t.data.forceEditMode&&u(!0)},[t.data.forceEditMode]);let c=Vn(),d=Wy({boardModifiers:o,item:t,setIsEditing:u,stateManager:a,path:c}),f=F.useCallback(y=>{if(y.target instanceof y.view.HTMLTextAreaElement)return;y.preventDefault(),y.stopPropagation();let b=y.target instanceof y.view.HTMLAnchorElement&&y.target.hasClass("internal-link")?y.target.dataset.href:void 0;d(y,b)},[d]),p=F.useCallback(()=>{u(!0)},[u]),m=F.useMemo(()=>s?{"data-ignore-drag":!0}:{},[s]);return g("div",{onContextMenu:f,onDblClick:p,className:$("item-content-wrapper"),...m},g("div",{className:$("item-title-wrapper"),...m},g(sv,{boardModifiers:o,item:t,path:c,shouldMarkItemsComplete:r,stateManager:a}),g(Uy,{isEditing:s,item:t,searchQuery:n?i:void 0,setIsEditing:u}),g(Vy,{isEditing:s,setIsEditing:u,showMenu:d})),g(zy,{searchQuery:n?i:void 0,isSettingsVisible:s,item:t}))}),dd=F.memo(function(t){let r=F.useRef(null),n=F.useRef(null),i=F.useContext(po),{itemIndex:a,...o}=t;Ti(n,n);let s=i?o.item.data.titleSearch.contains(i):!1,u=Xg(o.item);return i&&(s?u.push("is-search-hit"):u.push("is-search-miss")),g("div",{ref:n,className:$("item-wrapper")},g("div",{ref:r,className:mt([$("item"),...u])},t.isStatic?g(Yy,{...o,isMatch:s,searchQuery:i}):g(hr,{elementRef:r,measureRef:n,id:t.item.id,index:a,data:t.item},g(Yy,{...o,isMatch:s,searchQuery:i}))))}),Jy=F.memo(function({isStatic:t,items:r,shouldMarkItemsComplete:n}){return g(S,null,r.map((i,a)=>g(dd,{key:i.id,item:i,itemIndex:a,shouldMarkItemsComplete:n,isStatic:t})))});h();h();var uC=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{l(n.next(c))}catch(d){o(d)}}function u(c){try{l(n.throw(c))}catch(d){o(d)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((n=n.apply(e,t||[])).next())})};function _s(e){let t=0,r=0,n=e;do t+=n.offsetTop||0,r+=n.offsetLeft||0,n=n.offsetParent;while(n);return{top:t,left:r}}var Gy=class{constructor(t){this.element=t}getHorizontalScroll(){return this.element.scrollLeft}getVerticalScroll(){return this.element.scrollTop}getMaxHorizontalScroll(){return this.element.scrollWidth-this.element.clientWidth}getMaxVerticalScroll(){return this.element.scrollHeight-this.element.clientHeight}getHorizontalElementScrollOffset(t,r){return _s(t).left-_s(r).left}getVerticalElementScrollOffset(t,r){return _s(t).top-_s(r).top}scrollTo(t,r){this.element.scrollLeft=t,this.element.scrollTop=r}},Qy=class{constructor(){this.element=window}getHorizontalScroll(){return window.scrollX||document.documentElement.scrollLeft}getVerticalScroll(){return window.scrollY||document.documentElement.scrollTop}getMaxHorizontalScroll(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth)-window.innerWidth}getMaxVerticalScroll(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-window.innerHeight}getHorizontalElementScrollOffset(t){return(window.scrollX||document.documentElement.scrollLeft)+t.getBoundingClientRect().left}getVerticalElementScrollOffset(t){return(window.scrollY||document.documentElement.scrollTop)+t.getBoundingClientRect().top}scrollTo(t,r){window.scrollTo(t,r)}},Zn={elements:[],cancelMethods:[],add:(e,t)=>{Zn.elements.push(e),Zn.cancelMethods.push(t)},remove:(e,t)=>{let r=Zn.elements.indexOf(e);r>-1&&(t&&Zn.cancelMethods[r](),Zn.elements.splice(r,1),Zn.cancelMethods.splice(r,1))}},Xy=typeof window!="undefined",dC={cancelOnUserAction:!0,easing:e=>--e*e*e+1,elementToScroll:Xy?window:null,horizontalOffset:0,maxDuration:3e3,minDuration:250,speed:500,verticalOffset:0};function fC(e,t={}){return uC(this,void 0,void 0,function*(){if(Xy){if(!window.Promise)throw"Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill."}else return new Promise(A=>{A(!1)});let r,n,i,a=Object.assign(Object.assign({},dC),t),o=a.elementToScroll===window,s=!!a.elementToScroll.nodeName;if(!o&&!s)throw"Element to scroll needs to be either window or DOM element.";let u=o?document.documentElement:a.elementToScroll;getComputedStyle(u).getPropertyValue("scroll-behavior")==="smooth"&&console.warn(`${u.tagName} has "scroll-behavior: smooth" which can mess up with animated-scroll-to's animations`);let c=o?new Qy:new Gy(a.elementToScroll);if(e instanceof Element){if(i=e,s&&(!a.elementToScroll.contains(i)||a.elementToScroll.isSameNode(i)))throw"options.elementToScroll has to be a parent of scrollToElement";r=c.getHorizontalElementScrollOffset(i,a.elementToScroll),n=c.getVerticalElementScrollOffset(i,a.elementToScroll)}else if(typeof e=="number")r=c.getHorizontalScroll(),n=e;else if(Array.isArray(e)&&e.length===2)r=e[0]===null?c.getHorizontalScroll():e[0],n=e[1]===null?c.getVerticalScroll():e[1];else throw`Wrong function signature. Check documentation. +`)[0].trim(),p=f.replace(aC,"$1").replace(oC,"$1").replace(sC,"$1").replace(iC," ").trim(),m=i.getSetting("new-note-folder"),y=i.getSetting("new-note-template"),b=m?i.app.vault.getAbstractFileByPath(m):i.app.fileManager.getNewFileParent(i.file.path),x=await i.app.fileManager.createNewMarkdownFile(b,p),D=i.app.workspace.splitActiveLeaf();await D.openFile(x),i.app.workspace.setActiveLeaf(D,!1,!0),await _p(i,y);let C=t.data.titleRaw.replace(f,i.app.fileManager.generateMarkdownLink(x,i.file.path));i.updateItemContent(t,C).then(A=>{n.updateItem(r,A)}).catch(A=>{i.setError(A),console.error(A)})})}).addItem(d=>{d.setIcon("links-coming-in").setTitle(B("Copy link to card")).onClick(()=>{if(t.data.blockId)navigator.clipboard.writeText(`${this.app.fileManager.generateMarkdownLink(i.file,"","#^"+t.data.blockId)}`);else{let f=Re(6);navigator.clipboard.writeText(`${this.app.fileManager.generateMarkdownLink(i.file,"","#^"+f)}`),i.updateItemContent(t,`${t.data.titleRaw} ^${f}`).then(p=>{n.updateItem(r,p)}).catch(p=>{i.setError(p),console.error(p)})}})}).addSeparator(),/\n/.test(t.data.titleRaw)&&c.addItem(d=>{d.setIcon("split").setTitle(B("Split card")).onClick(async()=>{let f=t.data.titleRaw.split(/[\r\n]+/g).map(m=>m.trim()),p=await Promise.all(f.map(m=>i.getNewItem(m)));n.splitItem(r,p)})}),c.addItem(d=>{d.setIcon("documents").setTitle(B("Duplicate card")).onClick(()=>n.duplicateEntity(r))}).addItem(d=>{d.setIcon("plus-with-circle").setTitle(B("Insert card before")).onClick(async()=>n.insertItems(r,[await i.getNewItem("",!1,!0)]))}).addItem(d=>{d.setIcon("plus-with-circle").setTitle(B("Insert card after")).onClick(async()=>{let f=[...r];f[f.length-1]=f[f.length-1]+1,n.insertItems(f,[await i.getNewItem("",!1,!0)])})}).addItem(d=>{d.setIcon("sheets-in-box").setTitle(B("Archive card")).onClick(()=>n.archiveItem(r))}).addItem(d=>{d.setIcon("trash").setTitle(B("Delete card")).onClick(()=>n.deleteEntity(r))}).addSeparator().addItem(d=>{d.setIcon("calendar-with-checkmark").setTitle(u?B("Edit date"):B("Add date")).onClick(()=>{var f;ns(a.view,i,s,rs({stateManager:i,boardModifiers:n,item:t,hasDate:u,path:r}),(f=t.data.metadata.date)==null?void 0:f.toDate())})}),u&&(c.addItem(d=>{d.setIcon("cross").setTitle(B("Remove date")).onClick(()=>{let f=i.getSetting("link-date-to-daily-note"),p=i.getSetting("date-trigger"),m=f?"(?:\\[[^\\]]+\\]\\([^\\)]+\\)|\\[\\[[^\\]]+\\]\\])":"{[^}]+}",y=new RegExp(`(^|\\s)${Ln(p)}${m}`),b=t.data.titleRaw.replace(y,"").trim();i.updateItemContent(t,b).then(x=>{n.updateItem(r,x)}).catch(x=>{i.setError(x),console.error(x)})})}),c.addItem(d=>{d.setIcon("clock").setTitle(l?B("Edit time"):B("Add time")).onClick(()=>{is(a.view,i,s,as({stateManager:i,boardModifiers:n,item:t,hasTime:l,path:r}),t.data.metadata.time)})}),l&&c.addItem(d=>{d.setIcon("cross").setTitle(B("Remove time")).onClick(()=>{let f=i.getSetting("time-trigger"),p=new RegExp(`(^|\\s)${Ln(f)}{([^}]+)}`),m=t.data.titleRaw.replace(p,"").trim();i.updateItemContent(t,m).then(y=>{n.updateItem(r,y)}).catch(y=>{i.setError(y),console.error(y)})})})),c.showAtPosition(s)}},[e,t,r,n,i])}h();var Vy=F.memo(function({isEditing:t,setIsEditing:r,showMenu:n}){let i=F.useMemo(()=>t?{"data-ignore-drag":!0}:{},[t]);return g("div",{...i,className:$("item-postfix-button-wrapper")},t?g("button",{"data-ignore-drag":!0,onPointerDown:a=>{a.preventDefault()},onClick:()=>{r(!1)},className:`${$("item-postfix-button")} is-enabled`,"aria-label":B("Cancel")},g(Kt,{name:"cross"})):g("button",{"data-ignore-drag":!0,onPointerDown:a=>a.preventDefault(),onClick:n,className:$("item-postfix-button"),"aria-label":B("More options")},g(Kt,{name:"vertical-three-dots"})))});h();var Ss=ge(require("obsidian"));function zy({item:e,isSettingsVisible:t,searchQuery:r}){return t||!e.data.metadata.fileMetadata?null:g("div",{className:$("item-metadata-wrapper")},g(cC,{metadata:e.data.metadata.fileMetadata,order:e.data.metadata.fileMetadataOrder,searchQuery:r}))}function jy(e,t){if(e.ts){let r=t.getSetting("date-display-format");return(0,Ss.moment)(e.ts).format(r)}return null}function qy(e,t){if(!e.path)return null;let r=app.vault.getAbstractFileByPath(e.path);if(r&&r instanceof Ss.TFile){let n=app.fileManager.generateMarkdownLink(r,t.file.path,e.subpath,e.display);return`${e.embed&&n[0]!=="!"?"!":""}${n}`}return`${e.embed?"!":""}[[${e.path}${e.display?`|${e.display}`:""}]]`}function lC({data:e,searchQuery:t}){let{view:r,stateManager:n}=F.useContext(Ve);if(Array.isArray(e.value))return g("span",{className:$("meta-value")},e.value.map((s,u,l)=>{let c=`${s}`,d=typeof s=="object"&&!Array.isArray(s)&&(jy(s,n)||qy(s,r)),f=c.toLocaleLowerCase().contains(t);return g(S,null,d||e.containsMarkdown?g(La,{className:"inline",markdownString:d||c,searchQuery:t}):f?g("span",{className:"is-search-match"},c):c,u{let a=t[i];return g("tr",{key:i,className:$("meta-row")},!a.shouldHideLabel&&g("td",{className:`${$("meta-key")} ${(a.label||i).toLocaleLowerCase().contains(n)?"is-search-match":""}`,"data-key":i},g("span",null,a.label||i)),g("td",{colSpan:a.shouldHideLabel?2:1,className:$("meta-value-wrapper"),"data-value":Array.isArray(a.value)?a.value.join(", "):`${a.value}`},i==="tags"?a.value.map((o,s)=>g("a",{href:o,key:s,className:`tag ${$("item-tag")} ${o.toLocaleLowerCase().contains(n)?"is-search-match":""}`},g("span",null,o[0]),o.slice(1))):g(lC,{data:a,searchQuery:n})))})))});var Yy=F.memo(function({item:t,shouldMarkItemsComplete:r,isMatch:n,searchQuery:i}){let{stateManager:a,boardModifiers:o}=F.useContext(Ve),[s,u]=F.useState(!1),l=F.useContext(kt);F.useEffect(()=>{let y=()=>{s&&u(!1)};return l.dragManager.emitter.on("dragStart",y),()=>{l.dragManager.emitter.off("dragStart",y)}},[l,s]),F.useEffect(()=>{t.data.forceEditMode&&u(!0)},[t.data.forceEditMode]);let c=Vn(),d=Wy({boardModifiers:o,item:t,setIsEditing:u,stateManager:a,path:c}),f=F.useCallback(y=>{if(y.target instanceof y.view.HTMLTextAreaElement)return;y.preventDefault(),y.stopPropagation();let b=y.target instanceof y.view.HTMLAnchorElement&&y.target.hasClass("internal-link")?y.target.dataset.href:void 0;d(y,b)},[d]),p=F.useCallback(()=>{u(!0)},[u]),m=F.useMemo(()=>s?{"data-ignore-drag":!0}:{},[s]);return g("div",{onContextMenu:f,onDblClick:p,className:$("item-content-wrapper"),...m},g("div",{className:$("item-title-wrapper"),...m},g(sv,{boardModifiers:o,item:t,path:c,shouldMarkItemsComplete:r,stateManager:a}),g(Uy,{isEditing:s,item:t,searchQuery:n?i:void 0,setIsEditing:u}),g(Vy,{isEditing:s,setIsEditing:u,showMenu:d})),g(zy,{searchQuery:n?i:void 0,isSettingsVisible:s,item:t}))}),dd=F.memo(function(t){let r=F.useRef(null),n=F.useRef(null),i=F.useContext(po),{itemIndex:a,...o}=t;Ti(n,n);let s=i?o.item.data.titleSearch.contains(i):!1,u=Xg(o.item);return i&&(s?u.push("is-search-hit"):u.push("is-search-miss")),g("div",{ref:n,className:$("item-wrapper")},g("div",{ref:r,className:mt([$("item"),...u])},t.isStatic?g(Yy,{...o,isMatch:s,searchQuery:i}):g(hr,{elementRef:r,measureRef:n,id:t.item.id,index:a,data:t.item},g(Yy,{...o,isMatch:s,searchQuery:i}))))}),Jy=F.memo(function({isStatic:t,items:r,shouldMarkItemsComplete:n}){return g(S,null,r.map((i,a)=>g(dd,{key:i.id,item:i,itemIndex:a,shouldMarkItemsComplete:n,isStatic:t})))});h();h();var uC=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{l(n.next(c))}catch(d){o(d)}}function u(c){try{l(n.throw(c))}catch(d){o(d)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((n=n.apply(e,t||[])).next())})};function _s(e){let t=0,r=0,n=e;do t+=n.offsetTop||0,r+=n.offsetLeft||0,n=n.offsetParent;while(n);return{top:t,left:r}}var Gy=class{constructor(t){this.element=t}getHorizontalScroll(){return this.element.scrollLeft}getVerticalScroll(){return this.element.scrollTop}getMaxHorizontalScroll(){return this.element.scrollWidth-this.element.clientWidth}getMaxVerticalScroll(){return this.element.scrollHeight-this.element.clientHeight}getHorizontalElementScrollOffset(t,r){return _s(t).left-_s(r).left}getVerticalElementScrollOffset(t,r){return _s(t).top-_s(r).top}scrollTo(t,r){this.element.scrollLeft=t,this.element.scrollTop=r}},Qy=class{constructor(){this.element=window}getHorizontalScroll(){return window.scrollX||document.documentElement.scrollLeft}getVerticalScroll(){return window.scrollY||document.documentElement.scrollTop}getMaxHorizontalScroll(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth)-window.innerWidth}getMaxVerticalScroll(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-window.innerHeight}getHorizontalElementScrollOffset(t){return(window.scrollX||document.documentElement.scrollLeft)+t.getBoundingClientRect().left}getVerticalElementScrollOffset(t){return(window.scrollY||document.documentElement.scrollTop)+t.getBoundingClientRect().top}scrollTo(t,r){window.scrollTo(t,r)}},Zn={elements:[],cancelMethods:[],add:(e,t)=>{Zn.elements.push(e),Zn.cancelMethods.push(t)},remove:(e,t)=>{let r=Zn.elements.indexOf(e);r>-1&&(t&&Zn.cancelMethods[r](),Zn.elements.splice(r,1),Zn.cancelMethods.splice(r,1))}},Xy=typeof window!="undefined",dC={cancelOnUserAction:!0,easing:e=>--e*e*e+1,elementToScroll:Xy?window:null,horizontalOffset:0,maxDuration:3e3,minDuration:250,speed:500,verticalOffset:0};function fC(e,t={}){return uC(this,void 0,void 0,function*(){if(Xy){if(!window.Promise)throw"Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill."}else return new Promise(A=>{A(!1)});let r,n,i,a=Object.assign(Object.assign({},dC),t),o=a.elementToScroll===window,s=!!a.elementToScroll.nodeName;if(!o&&!s)throw"Element to scroll needs to be either window or DOM element.";let u=o?document.documentElement:a.elementToScroll;getComputedStyle(u).getPropertyValue("scroll-behavior")==="smooth"&&console.warn(`${u.tagName} has "scroll-behavior: smooth" which can mess up with animated-scroll-to's animations`);let c=o?new Qy:new Gy(a.elementToScroll);if(e instanceof Element){if(i=e,s&&(!a.elementToScroll.contains(i)||a.elementToScroll.isSameNode(i)))throw"options.elementToScroll has to be a parent of scrollToElement";r=c.getHorizontalElementScrollOffset(i,a.elementToScroll),n=c.getVerticalElementScrollOffset(i,a.elementToScroll)}else if(typeof e=="number")r=c.getHorizontalScroll(),n=e;else if(Array.isArray(e)&&e.length===2)r=e[0]===null?c.getHorizontalScroll():e[0],n=e[1]===null?c.getVerticalScroll():e[1];else throw`Wrong function signature. Check documentation. Available method signatures are: animateScrollTo(y:number, options) animateScrollTo([x:number | null, y:number | null], options) animateScrollTo(scrollToElement:Element, options)`;r+=a.horizontalOffset,n+=a.verticalOffset;let d=c.getMaxHorizontalScroll(),f=c.getHorizontalScroll();r>d&&(r=d);let p=r-f,m=c.getMaxVerticalScroll(),y=c.getVerticalScroll();n>m&&(n=m);let b=n-y,x=Math.abs(Math.round(p/1e3*a.speed)),D=Math.abs(Math.round(b/1e3*a.speed)),C=x>D?x:D;return Ca.maxDuration&&(C=a.maxDuration),new Promise((A,N)=>{p===0&&b===0&&A(!0),Zn.remove(c.element,!0);let T,O=()=>{le(),cancelAnimationFrame(T),A(!1)};Zn.add(c.element,O);let W=re=>re.preventDefault(),z=a.cancelOnUserAction?O:W,ee=a.cancelOnUserAction?{passive:!0}:{passive:!1},Z=["wheel","touchstart","keydown","mousedown"],le=()=>{Z.forEach(re=>{c.element.removeEventListener(re,z,ee)})};Z.forEach(re=>{c.element.addEventListener(re,z,ee)});let X=Date.now(),G=()=>{var re=Date.now()-X,pe=re/C;let he=Math.round(f+p*a.easing(pe)),ve=Math.round(y+b*a.easing(pe));re{this.activeScroll.size===0&&(this.scrollState=Kl(this.scrollEl),this.handleEntityRegistration())};this.onDragEnd=()=>{this.activeScroll.clear()};this.handleBeginDragScroll=({scrollEntitySide:t,scrollStrength:r})=>{this.isDoneScrolling(t)||(this.activeScroll.set(t,r),this.handleDragScroll())};this.handleUpdateDragScroll=({scrollEntitySide:t,scrollStrength:r})=>{this.isDoneScrolling(t)||this.activeScroll.set(t,r)};this.handleEndDragScroll=({scrollEntitySide:t})=>{this.activeScroll.delete(t)};this.dndManager=t,this.instanceId=Re(),this.scopeId=r,this.triggerTypes=n,this.scrollState=on,this.parent=i,this.activeScroll=new Map,this.pollForNodes(a)}pollForNodes(t){!t()||this.parent&&!this.parent.observerHandlers?this.dndManager.win.requestAnimationFrame(()=>this.pollForNodes(t)):this.initNodes(t())}initNodes(t){this.scrollEl=t,this.scrollEl.dataset.hitboxid=this.instanceId,this.scrollEl.dataset.scrollid=this.instanceId,this.top=this.createScrollEntity("top"),this.right=this.createScrollEntity("right"),this.bottom=this.createScrollEntity("bottom"),this.left=this.createScrollEntity("left"),this.bindScrollHandlers(),this.observerHandlers=new Map,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{var a;let i=(a=n.target.dataset)==null?void 0:a.hitboxid;if(i&&this.observerHandlers.has(i)){let o=this.observerHandlers.get(i);o&&o(n)}})},{root:t,threshold:.1}),this.scrollEl.addEventListener("scroll",this.onScroll,{passive:!0,capture:!1}),this.dndManager.emitter.on("scrollResize",this.onScroll),this.scrollEl.win.setTimeout(()=>{this.onScroll()}),this.dndManager.observeResize(this.scrollEl),this.parent?this.parent.registerObserverHandler(this.instanceId,this.scrollEl,r=>{r.isIntersecting?this.handleEntityRegistration():this.handleEntityUnregistration()}):this.handleEntityRegistration()}destroy(){var t;this.handleEntityUnregistration(),this.observer.disconnect(),this.unbindScrollHandlers(),this.scrollEl.removeEventListener("scroll",this.onScroll),this.dndManager.emitter.off("scrollResize",this.onScroll),(t=this.parent)==null||t.unregisterObserverHandler(this.instanceId,this.scrollEl),this.dndManager.unobserveResize(this.scrollEl)}handleEntityRegistration(){Ds.forEach(t=>{let r=Ze(this.scrollEl),n=this.getId(t),i=this.dndManager.scrollEntities.has(n),a=this.isDoneScrolling(t);!a&&!i?this.dndManager.registerScrollEntity(n,this[t],r):a&&i&&this.dndManager.unregisterScrollEntity(n,r)})}handleEntityUnregistration(){Ds.forEach(t=>{let r=Ze(this.scrollEl),n=this.getId(t);this.dndManager.unregisterScrollEntity(n,r)})}registerObserverHandler(t,r,n){this.observerHandlers.set(t,n),this.observer.observe(r)}unregisterObserverHandler(t,r){this.observerHandlers.delete(t),this.observer.unobserve(r)}bindScrollHandlers(){Ds.forEach(t=>{let r=this.getId(t);this.dndManager.dragManager.emitter.on("beginDragScroll",this.handleBeginDragScroll,r),this.dndManager.dragManager.emitter.on("updateDragScroll",this.handleUpdateDragScroll,r),this.dndManager.dragManager.emitter.on("endDragScroll",this.handleEndDragScroll,r),this.dndManager.dragManager.emitter.on("dragEnd",this.onDragEnd)})}unbindScrollHandlers(){Ds.forEach(t=>{let r=this.getId(t);this.dndManager.dragManager.emitter.off("beginDragScroll",this.handleBeginDragScroll,r),this.dndManager.dragManager.emitter.off("updateDragScroll",this.handleUpdateDragScroll,r),this.dndManager.dragManager.emitter.off("endDragScroll",this.handleEndDragScroll,r),this.dndManager.dragManager.emitter.off("dragEnd",this.onDragEnd)})}isDoneScrolling(t){switch(t){case"top":return this.scrollState.y===0;case"right":return this.scrollState.x===this.scrollState.maxX;case"bottom":return this.scrollState.y===this.scrollState.maxY;case"left":return this.scrollState.x===0}}handleDragScroll(){this.activeScroll.size!==0&&this.scrollEl.win.requestAnimationFrame(()=>{let t={left:0,top:0};this.activeScroll.forEach((r,n)=>{if(this.isDoneScrolling(n))return this.activeScroll.delete(n);let i=["left","right"].includes(n)?"left":"top",a=["right","bottom"].includes(n);t[i]=a?Math.max(Ts-Ts*r/35,0):Math.min(-Ts+Ts*r/35,0)}),this.scrollEl.scrollBy(t),this.scrollState=Kl(this.scrollEl),this.handleEntityRegistration(),this.handleDragScroll()})}getId(t){return`${this.instanceId}-${t}`}getPath(t){var r,n,i,a;switch(t){case"right":return[...((r=this.parent)==null?void 0:r.getPath())||[],1];case"bottom":return[...((n=this.parent)==null?void 0:n.getPath())||[],2];case"left":return[...((i=this.parent)==null?void 0:i.getPath())||[],3]}return[...((a=this.parent)==null?void 0:a.getPath())||[],0]}getScrollShift(){var r,n,i;let t=(r=this.parent)==null?void 0:r.getScrollShift();return{x:Xe((n=this.parent)==null?void 0:n.scrollState.x)+Xe(t==null?void 0:t.x),y:Xe((i=this.parent)==null?void 0:i.scrollState.y)+Xe(t==null?void 0:t.y)}}createScrollEntity(t){var n,i;let r=this;return{scopeId:this.scopeId,entityId:r.getId(t),initial:Hl(this.scrollEl.getBoundingClientRect(),((n=this.parent)==null?void 0:n.scrollState)||on,((i=this.parent)==null?void 0:i.getScrollShift())||Pn,t),getParentScrollState(){var a;return((a=r.parent)==null?void 0:a.scrollState)||on},getParentScrollShift(){var a;return((a=r.parent)==null?void 0:a.getScrollShift())||Pn},recalcInitial(){var a,o;this.initial=Hl(r.scrollEl.getBoundingClientRect(),((a=r.parent)==null?void 0:a.scrollState)||on,((o=r.parent)==null?void 0:o.getScrollShift())||Pn,t)},getHitbox(){return wo(this.initial[0],this.initial[1],this.initial[2],this.initial[3],this.getParentScrollState(),this.getParentScrollShift())},getPath(){return r.getPath(t)},getData(){return{id:r.getId(t),type:pC,side:t,accepts:r.triggerTypes||[],scrollContainer:r.scrollEl,win:Ze(r.scrollEl)}}}}};function Zy({scrollRef:e,triggerTypes:t,children:r}){let n=F.useContext(kt),i=F.useContext(pr),a=F.useContext(aa),o=F.useRef(),s=F.useMemo(()=>{if(n){o.current&&o.current.destroy();let u=new fd(n,i,t||[],a,()=>e.current);return o.current=u,u}return null},[n,i,e,t,a]);return F.useEffect(()=>()=>{var u;return(u=o.current)==null?void 0:u.destroy()},[]),s?g(aa.Provider,{value:s},r):null}h();function eb({children:e}){let t=F.useMemo(()=>new ia,[]);return g(oa.Provider,{value:t},e)}function tb(e,t){let r=F.useContext(pr),n=F.useRef(null),i=F.useContext(oa),a=o=>{n.current=o,n.current&&o.win.requestAnimationFrame(()=>{let s=i.getScrollState(e);s&&(s.x!==0||s.y!==0)&&(n.current.scrollLeft=s.x,n.current.scrollTop=s.y)})};return F.useEffect(()=>{let o=n.current;if(!o)return;let s=ss(o.win,u=>{let l=u.target;i.setScrollState(r,e,{x:l.scrollLeft,y:l.scrollTop})});return o.addEventListener("scroll",s),()=>{o.removeEventListener("scroll",s)}},[i,e,t]),{setRef:a,scrollRef:n}}function Ms({className:e,children:t,triggerTypes:r,isStatic:n,id:i,index:a}){let{setRef:o,scrollRef:s}=tb(i,a);return g("div",{ref:o,className:mt([e,$("scroll-container")])},n?t:g(Zy,{scrollRef:s,triggerTypes:r},t))}h();h();var pd={width:0,height:0},hC=100,hd=class{constructor(t,r,n){this.hitboxDimensions=pd;this.handleDragStart=({dragEntity:t,dragEntityMargin:r,dragOriginHitbox:n})=>{let i=t==null?void 0:t.entityId,a=i?this.sortables.has(i):null;!t||!a||!n||(this.setSortState(!0),this.hitboxDimensions=$l(n,r),this.activatePlaceholder(this.hitboxDimensions,ln.none),this.sortables.forEach(([o,s,u])=>{let l=ta(t.getPath(),o.getPath()),c=o.entityId;if(l===an.Self)return this.hidden.add(c),this.hideDraggingEntity(u);l===an.After&&(this.shifted.has(c)||this.shifted.add(c),this.shiftEl(s,ln.none,this.hitboxDimensions))}))};this.dragEndTimeout=0;this.handleDragEnd=({primaryIntersection:t,dragPosition:r,dragOriginHitbox:n,dragEntity:i})=>{if(!this.isSorting||!r||!n||!i){if(!t&&i&&this.sortables.has(i.entityId))return this.resetSelf({maintainHidden:!1});if(t&&i){let s=(t==null?void 0:t.getHitbox())||n,u=_i({position:r,destination:{x:s[0],y:s[1]}});return this.dndManager.win.setTimeout(()=>{this.resetSelf({maintainHidden:!1})},u)}return this.resetSelf({maintainHidden:!0})}this.dndManager.win.clearTimeout(this.dragEnterTimeout),this.dndManager.win.clearTimeout(this.dragLeaveTimeout),this.dndManager.win.clearTimeout(this.dragEndTimeout);let a=(t==null?void 0:t.getHitbox())||n,o=i.scopeId==="htmldnd"?0:_i({position:r,destination:{x:a[0],y:a[1]}});this.dragEndTimeout=this.dndManager.win.setTimeout(()=>{let s=i.entityId.split(":::").pop(),u=t==null?void 0:t.entityId.split(":::").pop();t&&this.sortables.has(t.entityId)&&u!==s&&this.dndManager.onDrop(i,t),this.resetSelf({maintainHidden:!1,shiftTransition:ln.none,placeholderTransition:ln.none})},o),this.hitboxDimensions=pd};this.dragEnterTimeout=0;this.handleDragEnter=({dragEntity:t,dragEntityMargin:r,dragOriginHitbox:n,primaryIntersection:i})=>{let a=i==null?void 0:i.entityId,o=a?this.sortables.has(a):null;if(!t||!i||!o||!n){!o&&this.isSorting&&this.resetSelf({maintainHidden:!0,maintainPlaceholder:!0});return}t.entityId!==i.entityId&&(this.dndManager.win.clearTimeout(this.dragLeaveTimeout),this.dndManager.win.clearTimeout(this.dragEnterTimeout),this.dragEnterTimeout=this.dndManager.win.setTimeout(()=>{this.setSortState(!0),this.hitboxDimensions=$l(n,r),this.activatePlaceholder(this.hitboxDimensions,ln.placeholder),this.sortables.forEach(([s,u])=>{let l=ta(i.getPath(),s.getPath()),c=s.entityId;!this.hidden.has(c)&&(l===an.Self||l===an.After)?this.shifted.has(c)||(this.shifted.add(c),this.shiftEl(u,ln.outOfTheWay,this.hitboxDimensions)):this.shifted.has(c)&&(this.shifted.delete(c),this.resetEl(u))})},10))};this.dragLeaveTimeout=0;this.handleDragLeave=()=>{!this.isSorting||(this.dndManager.win.clearTimeout(this.dragLeaveTimeout),this.dndManager.win.clearTimeout(this.dragEnterTimeout),this.dragLeaveTimeout=this.dndManager.win.setTimeout(()=>{this.resetSelf({maintainHidden:!0,maintainPlaceholder:!0})},hC),this.hitboxDimensions=pd)};this.instanceId=Re(),this.dndManager=t,this.sortables=new Map,this.shifted=new Set,this.hidden=new Set,this.isSorting=!1,this.axis=r,this.placeholder=null,this.sortListeners=n?[n]:[],t.dragManager.emitter.on("dragStart",this.handleDragStart),t.dragManager.emitter.on("dragEnd",this.handleDragEnd),t.dragManager.emitter.on("dragEnter",this.handleDragEnter),t.dragManager.emitter.on("dragLeave",this.handleDragLeave)}destroy(){this.dndManager.win.clearTimeout(this.dragLeaveTimeout),this.dndManager.win.clearTimeout(this.dragEndTimeout),this.dndManager.dragManager.emitter.off("dragStart",this.handleDragStart),this.dndManager.dragManager.emitter.off("dragEnd",this.handleDragEnd),this.dndManager.dragManager.emitter.off("dragEnter",this.handleDragEnter),this.dndManager.dragManager.emitter.off("dragLeave",this.handleDragLeave)}registerSortable(t,r,n,i){let a=r.getData().type==="placeholder";this.sortables.set(t,[r,n,i]),a?(this.placeholder=[r,n,i],i.dataset.axis=this.axis,Dn(i,"transition",ln.none)):Dn(n,"transition",ln.none)}unregisterSortable(t){this.sortables.delete(t)}resetSelf({maintainHidden:t,maintainPlaceholder:r,shiftTransition:n,placeholderTransition:i}){this.isSorting&&this.setSortState(!1),this.isPlaceholderActive&&!r&&this.deactivatePlaceholder(i),this.shifted.size>0&&(this.shifted.forEach(a=>{if(this.sortables.has(a)){let[,o]=this.sortables.get(a);this.resetEl(o,n)}}),this.shifted.clear()),!t&&this.hidden.size>0&&(this.hidden.forEach(a=>{if(this.sortables.has(a)){let[,,o]=this.sortables.get(a);this.resetEl(o,n)}}),this.hidden.clear())}activatePlaceholder(t,r){if(this.placeholder){let n=this.axis==="horizontal",[,,i]=this.placeholder;Dn(i,"transition",r),Dn(i,n?"width":"height",`${n?t.width:t.height}px`),this.isPlaceholderActive=!0}}deactivatePlaceholder(t=ln.placeholder){if(this.placeholder){let[,,r]=this.placeholder;Dn(r,"transition",t),ls(r,"width"),ls(r,"height"),this.isPlaceholderActive=!1}}hideDraggingEntity(t){Dn(t,"display","none")}shiftEl(t,r,n){let i=this.axis==="horizontal"?`translate3d(${n.width}px, 0, 0)`:`translate3d(0, ${n.height}px, 0)`;Dn(t,"transition",r),Dn(t,"transform",i)}resetEl(t,r=ln.outOfTheWay){Dn(t,"transition",r),Dn(t,"transform","translate3d(0, 0, 0)"),ls(t,"display")}addSortNotifier(t){this.sortListeners.push(t)}removeSortNotifier(t){this.sortListeners=this.sortListeners.filter(r=>r!==t)}setSortState(t){this.isSorting!==t&&(this.isSorting=t,this.sortListeners.forEach(r=>r(t)))}};function Ii({axis:e,children:t,onSortChange:r}){let n=F.useContext(kt),i=F.useRef(),a=F.useMemo(()=>{if(n){i.current&&i.current.destroy();let o=new hd(n,e,r);return i.current=o,o}return null},[n,e,r]);return F.useEffect(()=>()=>{var o;return(o=i.current)==null?void 0:o.destroy()},[]),a?g(vo.Provider,{value:a},t):null}h();function Ai({index:e,accepts:t,className:r,isStatic:n}){let i=F.useRef(null),a=F.useRef(null),o=F.useMemo(()=>({id:Re(),type:"placeholder",accepts:t}),t);return g("div",{ref:a,className:mt([r,$("placeholder")])},g("div",{ref:i},!n&&g(hr,{elementRef:i,measureRef:a,id:o.id,index:e,data:o})))}h();h();h();Mr();Mr();function nb(e,t){for(var r in t)e[r]=t[r];return e}function md(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function gd(e){this.props=e}function mC(e,t){function r(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,i)||!o:md(this.props,i)}function n(i){return this.shouldComponentUpdate=r,g(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(gd.prototype=new pt).isPureReactComponent=!0,gd.prototype.shouldComponentUpdate=function(e,t){return md(this.props,e)||md(this.state,t)};var rb=fe.__b;fe.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),rb&&rb(e)};var gC=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function vC(e){function t(r){var n=nb({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=gC,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var ib=function(e,t){return e==null?null:wt(wt(e).map(t))},yC={map:ib,forEach:ib,count:function(e){return e?wt(e).length:0},only:function(e){var t=wt(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:wt},bC=fe.__e;fe.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}bC(e,t,r,n)};var ab=fe.unmount;function Is(){this.__u=0,this.t=null,this.__b=null}function ob(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function wC(e){var t,r,n;function i(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){n=o}),n)throw n;if(!r)throw t;return g(r,a)}return i.displayName="Lazy",i.__f=!0,i}function Fa(){this.u=null,this.o=null}fe.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),ab&&ab(e)},(Is.prototype=new pt).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var i=ob(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__e){var l=n.state.__e;n.__v.__k[0]=function d(f,p,m){return f&&(f.__v=null,f.__k=f.__k&&f.__k.map(function(y){return d(y,p,m)}),f.__c&&f.__c.__P===p&&(f.__e&&m.insertBefore(f.__e,f.__d),f.__c.__e=!0,f.__c.__P=m)),f}(l,l.__c.__P,l.__c.__O)}var c;for(n.setState({__e:n.__b=null});c=n.t.pop();)c.forceUpdate()}},u=t.__h===!0;n.__u++||u||n.setState({__e:n.__b=n.__v.__k[0]}),e.then(o,o)},Is.prototype.componentWillUnmount=function(){this.t=[]},Is.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function a(o,s,u){return o&&(o.__c&&o.__c.__H&&(o.__c.__H.__.forEach(function(l){typeof l.__c=="function"&&l.__c()}),o.__c.__H=null),(o=nb({},o)).__c!=null&&(o.__c.__P===u&&(o.__c.__P=s),o.__c=null),o.__k=o.__k&&o.__k.map(function(l){return a(l,s,u)})),o}(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__e&&g(S,null,e.fallback);return i&&(i.__h=null),[g(S,null,t.__e?null:e.children),i]};var sb=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]>>1,1),t.i.removeChild(n)}}),kn(g(EC,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function kC(e,t){var r=g(xC,{__v:e,i:t});return r.containerInfo=t,r}(Fa.prototype=new pt).__e=function(e){var t=this,r=ob(t.__v),n=t.o.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),sb(t,e,n)):i()};r?r(a):a()}},Fa.prototype.render=function(e){this.u=null,this.o=new Map;var t=wt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Fa.prototype.componentDidUpdate=Fa.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){sb(e,r,t)})};var lb=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,SC=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|shape|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,_C=typeof document!="undefined",CC=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function TC(e,t,r){return t.__k==null&&(t.textContent=""),kn(e,t),typeof r=="function"&&r(),e?e.__c:null}function DC(e,t,r){return Ji(e,t),typeof r=="function"&&r(),e?e.__c:null}pt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(pt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var cb=fe.event;function MC(){}function IC(){return this.cancelBubble}function AC(){return this.defaultPrevented}fe.event=function(e){return cb&&(e=cb(e)),e.persist=MC,e.isPropagationStopped=IC,e.isDefaultPrevented=AC,e.nativeEvent=e};var ub,db={configurable:!0,get:function(){return this.class}},fb=fe.vnode;fe.vnode=function(e){var t=e.type,r=e.props,n=r;if(typeof t=="string"){var i=t.indexOf("-")===-1;for(var a in n={},r){var o=r[a];_C&&a==="children"&&t==="noscript"||a==="value"&&"defaultValue"in r&&o==null||(a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":/ondoubleclick/i.test(a)?a="ondblclick":/^onchange(textarea|input)/i.test(a+t)&&!CC(r.type)?a="oninput":/^onfocus$/i.test(a)?a="onfocusin":/^onblur$/i.test(a)?a="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():i&&SC.test(a)?a=a.replace(/[A-Z0-9]/,"-$&").toLowerCase():o===null&&(o=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),n[a]&&(a="oninputCapture")),n[a]=o)}t=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=wt(r.children).forEach(function(s){s.props.selected=n.value.indexOf(s.props.value)!=-1})),t=="select"&&n.defaultValue!=null&&(n.value=wt(r.children).forEach(function(s){s.props.selected=n.multiple?n.defaultValue.indexOf(s.props.value)!=-1:n.defaultValue==s.props.value})),e.props=n,r.class!=r.className&&(db.enumerable="className"in r,r.className!=null&&(n.class=r.className),Object.defineProperty(n,"className",db))}e.$$typeof=lb,fb&&fb(e)};var pb=fe.__r;fe.__r=function(e){pb&&pb(e),ub=e.__c};var LC={ReactCurrentDispatcher:{current:{readContext:function(e){return ub.__n[e.__c].props.value}}}};function PC(e){return g.bind(null,e)}function hb(e){return!!e&&e.$$typeof===lb}function FC(e){return hb(e)?io.apply(null,arguments):e}function NC(e){return!!e.__k&&(kn(null,e),!0)}function OC(e){return e&&(e.base||e.nodeType===1&&e)||null}var RC=function(e,t){return e(t)},HC=function(e,t){return e(t)};var it={useState:sr,useReducer:Qi,useEffect:Sn,useLayoutEffect:Ir,useRef:Xt,useImperativeHandle:oo,useMemo:lr,useCallback:cr,useContext:so,useDebugValue:lo,version:"17.0.2",Children:yC,render:TC,hydrate:DC,unmountComponentAtNode:NC,createPortal:kC,createElement:g,createContext:ni,createFactory:PC,cloneElement:FC,createRef:ei,Fragment:S,isValidElement:hb,findDOMNode:OC,Component:pt,PureComponent:gd,memo:mC,forwardRef:vC,flushSync:HC,unstable_batchedUpdates:RC,StrictMode:S,Suspense:Is,SuspenseList:Fa,lazy:wC,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:LC};var BC=function(){if(typeof window=="undefined"||typeof window.addEventListener!="function")return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}}),r=function(){return null};return window.addEventListener("test",r,t),window.removeEventListener("test",r,t),e},KC="ignore-onclickoutside",mb=function(t,r){var n;return(n=t.classList)==null?void 0:n.contains(r)},gb=function(t,r){for(var n=t.target||t;n;){if(Array.isArray(r)){if(r.some(function(i){return mb(n,i)}))return!0}else if(mb(n,r))return!0;n=n.parentElement}return!1},$C=function(t){return document.documentElement.clientWidth<=t.clientX||document.documentElement.clientHeight<=t.clientY},vb=function(t){return t.includes("touch")&&BC()?{passive:!0}:!1},UC=function(t,r){var n=r===void 0?{}:r,i=n.refs,a=n.disabled,o=n.eventTypes,s=o===void 0?["mousedown","touchstart"]:o,u=n.excludeScrollbar,l=n.ignoreClass,c=l===void 0?KC:l,d=n.detectIFrame,f=d===void 0?!0:d,p=sr([]),m=p[0],y=p[1],b=Xt(t);b.current=t;var x=cr(function(D){return y(function(C){return[].concat(C,[{current:D}])})},[]);return Sn(function(){if(!(!(i!=null&&i.length)&&!m.length)){var D=function(){var O=[];return(i||m).forEach(function(W){var z=W.current;return z&&O.push(z)}),O},C=function(O){!gb(O,c)&&!(u&&$C(O))&&D().every(function(W){return!W.contains(O.target)})&&b.current(O)},A=function(O){return setTimeout(function(){var W=document,z=W.activeElement;(z==null?void 0:z.tagName)==="IFRAME"&&!gb(z,c)&&!D().includes(z)&&b.current(O)},0)},N=function(){s.forEach(function(O){return document.removeEventListener(O,C,vb(O))}),f&&window.removeEventListener("blur",A)};if(a){N();return}return s.forEach(function(T){return document.addEventListener(T,C,vb(T))}),f&&window.addEventListener("blur",A),function(){return N()}}},[m,c,u,a,f,JSON.stringify(s)]),x},Li=UC;function vd({addItems:e,isInputVisible:t,setIsInputVisible:r,hideButton:n}){let[i,a]=F.useState(""),{stateManager:o,view:s}=F.useContext(Ve),u=F.useRef(),l=Li(()=>{r(!1)},{ignoreClass:$("ignore-click-outside")}),c=F.useCallback(()=>{a(""),r(!1)},[]),d=async m=>{try{e(await Promise.all(m.map(y=>o.getNewItem(y))))}catch(y){o.setError(y)}},f=m=>{if(!Xn(m,o)){m.preventDefault();let y=i.trim();y&&(d([y]),a(""))}},p=()=>{let m=i.trim();m&&(d([m]),a(""))};return t?g("div",{className:$("item-form"),ref:l},g("div",{className:$("item-input-wrapper")},g(Er,{ref:u,className:$("item-input"),placeholder:B("Card title..."),onEnter:f,onEscape:c,onSubmit:p,value:i,onChange:m=>{a(m.target.value)},onPaste:m=>{ms(m,o,s.getWindow())}}))):n?null:g("div",{className:$("item-button-wrapper")},g("button",{className:$("new-item-button"),onClick:()=>r(!0),onDragOver:m=>{hs(o,m.dataTransfer)&&r(!0)}},g("span",{className:$("item-button-plus")},"+")," ",B("Add a card")))}h();var Db=ge(xt());h();function As(e,t){let r=t.end-t.start;return e.slice(0,t.start)+"\0".repeat(r)+e.slice(t.end)}function yb(e){return e.replace(/\s*\0+\s*/g," ").trim()}function Na(e){return e.trim().replace(/(\r\n|\n)/g,"
")}function Ls(e){return e.replace(/
/g,` `).trim()}function Wr(e){e=Ls(e);let t=e.match(/^(.*?)\s*\((\d+)\)$/);return t==null?{title:e,maxItems:0}:{title:t[1],maxItems:Number(t[2])}}h();function bb(e){return g("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},g("path",{fill:"currentColor",d:"M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z"}))}h();var yd=ge(xt()),wb=ge(require("obsidian"));var Eb={delete:{description:B("Are you sure you want to delete this list and all its cards?"),confirm:B("Yes, delete list")},archive:{description:B("Are you sure you want to archive this list and all its cards?"),confirm:B("Yes, archive list")},"archive-items":{description:B("Are you sure you want to archive all cards in this list?"),confirm:B("Yes, archive cards")}};function xb({action:e,cancel:t,onAction:r,lane:n}){return F.useEffect(()=>{e&&n.children.length===0&&r()},[e,n.children.length]),!e||e&&n.children.length===0?null:g("div",{className:$("action-confirm-wrapper")},g("div",{className:$("action-confirm-text")},Eb[e].description),g("div",null,g("button",{onClick:r,className:$("confirm-action-button")},Eb[e].confirm),g("button",{onClick:t,className:$("cancel-action-button")},"Cancel")))}function kb({setIsEditing:e,path:t,lane:r}){let{stateManager:n,boardModifiers:i}=F.useContext(Ve),[a,o]=F.useState(null);return{settingsMenu:F.useMemo(()=>new wb.Menu().addItem(u=>{u.setIcon("pencil").setTitle(B("Edit list")).onClick(()=>e(!0))}).addItem(u=>{u.setIcon("documents").setTitle(B("Archive cards")).onClick(()=>o("archive-items"))}).addSeparator().addItem(u=>{u.setIcon("up-and-down-arrows").setTitle(B("Sort by card text")).onClick(()=>{let l=r.children.slice(),c=r.data.sorted===Mn.TitleAsc;l.sort((d,f)=>c?f.data.titleSearch.localeCompare(d.data.titleSearch):d.data.titleSearch.localeCompare(f.data.titleSearch)),i.updateLane(t,(0,yd.default)(r,{children:{$set:l},data:{sorted:{$set:r.data.sorted===Mn.TitleAsc?Mn.TitleDsc:Mn.TitleAsc}}}))})}).addItem(u=>{u.setIcon("up-and-down-arrows").setTitle(B("Sort by date")).onClick(()=>{let l=r.children.slice(),c=r.data.sorted===Mn.DateAsc?-1:1;l.sort((d,f)=>{let p=d.data.metadata.time||d.data.metadata.date,m=f.data.metadata.time||f.data.metadata.date;return p&&!m?-1*c:m&&!p?1*c:!p&&!m?0:(p.isBefore(m)?-1:1)*c}),i.updateLane(t,(0,yd.default)(r,{children:{$set:l},data:{sorted:{$set:r.data.sorted===Mn.DateAsc?Mn.DateDsc:Mn.DateAsc}}}))})}).addSeparator().addItem(u=>{u.setIcon("plus-with-circle").setTitle(B("Insert list before")).onClick(()=>i.insertLane(t,{...wr,id:Re(),children:[],data:{title:"",shouldMarkItemsComplete:!1,forceEditMode:!0}}))}).addItem(u=>{u.setIcon("plus-with-circle").setTitle(B("Insert list after")).onClick(()=>{let l=[...t];l[l.length-1]=l[l.length-1]+1,i.insertLane(l,{...wr,id:Re(),children:[],data:{title:"",shouldMarkItemsComplete:!1,forceEditMode:!0}})})}).addSeparator().addItem(u=>{u.setIcon("sheets-in-box").setTitle(B("Archive list")).onClick(()=>o("archive"))}).addItem(u=>{u.setIcon("trash").setTitle(B("Delete list")).onClick(()=>o("delete"))}),[n,o,t,r]),confirmAction:a,setConfirmAction:o}}h();var Sb=ge(xt());function _b({lane:e,lanePath:t}){let{boardModifiers:r}=F.useContext(Ve);return g("div",{className:$("lane-setting-wrapper")},g("div",{className:$("checkbox-wrapper")},g("div",{className:$("checkbox-label")},B("Mark cards in this list as complete")),g("div",{onClick:()=>r.updateLane(t,(0,Sb.default)(e,{data:{$toggle:["shouldMarkItemsComplete"]}})),className:`checkbox-container ${e.data.shouldMarkItemsComplete?"is-enabled":""}`})))}h();var Cb=ge(require("obsidian"));function Tb({itemCount:e,maxItems:t,isEditing:r,setIsEditing:n,title:i,onChange:a}){let{stateManager:o}=F.useContext(Ve),s=F.useRef(),u=o.getSetting("hide-card-count"),l=p=>{Xn(p,o)||(p.preventDefault(),r&&n(!1))},c=()=>{r&&n(!1)},d=()=>{r&&n(!1)};F.useEffect(()=>{if(r&&s.current){let p=s.current;s.current.focus(),p.selectionStart=p.selectionEnd=p.value.length}},[r]);let f=[$("lane-title-count")];return t&&t{p.preventDefault(),p.stopPropagation();let m=p.target instanceof p.view.HTMLAnchorElement&&p.target.hasClass("internal-link")?p.target.dataset.href:void 0;m&&o.app.workspace.onLinkContextMenu(p,(0,Cb.getLinkpath)(m),o.file.path)}},g(La,{markdownString:i})))),!r&&!u&&g("div",{className:mt(f)},e,t>0&&g(S,null,g("span",{className:$("lane-title-count-separator")},"/"),g("span",{className:$("lane-title-count-limit")},t))))}var Mb=F.memo(function({lane:t,laneIndex:r,dragHandleRef:n,setIsItemInputVisible:i}){let{boardModifiers:a,stateManager:o}=F.useContext(Ve),[s,u]=F.useState(!1),l=Vn(r),{settingsMenu:c,confirmAction:d,setConfirmAction:f}=kb({setIsEditing:u,path:l,lane:t});return F.useEffect(()=>{t.data.forceEditMode&&u(!0)},[t.data.forceEditMode]),g(S,null,g("div",{onDblClick:()=>u(!0),className:$("lane-header-wrapper")},g("div",{className:$("lane-grip"),ref:n},g(bb,null)),g(Tb,{isEditing:s,setIsEditing:u,itemCount:t.children.length,maxItems:t.data.maxItems,title:t.data.title,onChange:p=>{let{title:m,maxItems:y}=Wr(p.target.value);a.updateLane(l,(0,Db.default)(t,{data:{title:{$set:m},maxItems:{$set:y}}}))}}),g("div",{className:$("lane-settings-button-wrapper")},s?g("button",{onClick:()=>{u(!1)},"aria-label":"Close",className:`${$("lane-settings-button")} is-enabled`},g(Kt,{name:"cross"})):g(S,null,i&&g("button",{"aria-label":B("Add a card"),className:$("lane-settings-button"),onClick:()=>{i(!0)},onDragOver:p=>{hs(o,p.dataTransfer)&&i(!0)}},g(Kt,{name:"plus-with-circle"})),g("button",{"aria-label":B("More options"),className:$("lane-settings-button"),onClick:p=>{c.showAtPosition({x:p.clientX,y:p.clientY})}},g(Kt,{name:"vertical-three-dots"}))))),s&&g(_b,{lane:t,lanePath:l}),d&&g(xb,{lane:t,action:d,onAction:()=>{switch(d){case"archive":a.archiveLane(l);break;case"archive-items":a.archiveLaneItems(l);break;case"delete":a.deleteEntity(l);break}f(null)},cancel:()=>f(null)}))});var Ab=[Ge.Item],bd=F.memo(function({isStatic:t,lane:r,laneIndex:n}){let{stateManager:i,boardModifiers:a,view:o}=F.useContext(Ve),[s,u]=F.useState(!1),l=Vn(n),c=i.useSetting("lane-width"),d=i.useSetting("new-card-insertion-method"),f=!!r.data.shouldMarkItemsComplete,p=c?{width:`${c}px`}:void 0,m=F.useRef(null),y=F.useRef(null),b=F.useRef(null),[x,D]=F.useState(!1),C=d==="prepend-compact",A=C||d==="prepend";Ti(y,b);let N=W=>{a[A?"prependItems":"appendItems"]([...l,r.children.length-1],W.map(z=>(0,Ib.default)(z,{data:{isComplete:{$set:f}}}))),o.getWindow().setTimeout(()=>{var ee;let z=(ee=m.current)==null?void 0:ee.getElementsByClassName($("lane-items"));z.length&&Cs([0,A?0:z[0].scrollHeight],{elementToScroll:z[0],speed:200,minDuration:150,easing:Z=>Z===1?1:1-Math.pow(2,-10*Z)})})},T=g(S,null,g(Jy,{items:r.children,isStatic:t,shouldMarkItemsComplete:f}),g(Ai,{accepts:Ab,index:r.children.length,isStatic:t})),O=g(Ms,{id:r.id,index:n,className:mt([$("lane-items"),$("vertical")]),triggerTypes:Ab,isStatic:t},t?T:g(Ii,{onSortChange:D,axis:"vertical"},T));return g("div",{ref:y,className:mt([$("lane-wrapper"),{"is-sorting":x}]),style:p},g("div",{"data-count":r.children.length,ref:m,className:mt([$("lane"),{"will-prepend":A}])},g(Mb,{dragHandleRef:b,laneIndex:n,lane:r,setIsItemInputVisible:C?u:void 0}),A&&g(vd,{addItems:N,hideButton:C,isInputVisible:s,setIsInputVisible:u}),t?O:g(hr,{elementRef:m,measureRef:y,id:r.id,index:n,data:r},O),!A&&g(vd,{addItems:N,isInputVisible:s,setIsInputVisible:u})))}),Lb=F.memo(function({lanes:t}){return g(S,null,t.map((r,n)=>g(bd,{lane:r,laneIndex:n,key:r.id})))});h();h();var Pb=ge(require("obsidian"));h();function Ps(){return{events:{},emit(e,t,r){let n=`${String(e)}${r||""}`,i=this.events[e],a=this.events[n];if(!i&&!a){console.warn("Event emitted with no handler",e,r);return}r&&a&&a.forEach(o=>o(t)),i&&i.forEach(o=>o(t))},on(e,t,r){let n=`${String(e)}${r||""}`,i=this.events[n];return i||(this.events[n]=i=[]),i.push(t),()=>this.off(e,t,r)},off(e,t,r){let n=`${String(e)}${r||""}`,i=this.events[n];i&&(i.splice(i.indexOf(t)>>>0,1),i.length===0&&delete this.events[n])}}}var wd=class{constructor(t,r){this.scrollResizeDebounce=0;this.handleResize=t=>{let r=!1;t.forEach(n=>{let i=Ze(n.target);this.win===i&&(r=!0,n.target.dataset.scrollid&&(this.win.clearTimeout(this.scrollResizeDebounce),this.scrollResizeDebounce=this.win.setTimeout(()=>{var a;((a=this.emitter.events.scrollResize)==null?void 0:a.length)&&this.emitter.emit("scrollResize",null)},50)))}),!!r&&(this.hitboxEntities.forEach(n=>{n.recalcInitial()}),this.scrollEntities.forEach(n=>{n.recalcInitial()}))};this.win=t,this.emitter=Ps(),this.hitboxEntities=new Map,this.scrollEntities=new Map,this.onDrop=r,this.resizeObserver=new ResizeObserver((0,Pb.debounce)(this.handleResize,100,!0)),this.dragManager=new Mu(t,this.emitter,this.hitboxEntities,this.scrollEntities)}destroy(){this.resizeObserver.disconnect()}observeResize(t){this.resizeObserver.observe(t,{box:"border-box"})}unobserveResize(t){this.resizeObserver.unobserve(t)}registerHitboxEntity(t,r,n){n===this.win&&this.hitboxEntities.set(t,r)}registerScrollEntity(t,r,n){n===this.win&&this.scrollEntities.set(t,r)}unregisterHitboxEntity(t,r){r===this.win&&this.hitboxEntities.delete(t)}unregisterScrollEntity(t,r){r===this.win&&this.scrollEntities.delete(t)}};function Fs({win:e,children:t,onDrop:r}){let n=F.useRef(r);n.current=r;let i=F.useMemo(()=>new wd(e,(a,o)=>n.current(a,o)),[]);return F.useEffect(()=>()=>{i.destroy()},[i]),g(kt.Provider,{value:i},g(eb,null,t))}h();function Ed(e,t,r,n,i,a){let o=[r[0]-n[0],r[1]-n[1],r[2]+n[2],r[3]+n[3]];return{transform:a||`translate3d(${e.x-t.x+o[0]}px, ${e.y-t.y+o[1]}px, 0px)`,width:`${o[2]-o[0]}px`,height:`${o[3]-o[1]}px`,transition:i}}function Ns({children:e}){let t=F.useContext(kt),[r,n]=F.useState(),[i,a]=F.useState();return F.useEffect(()=>{if(!t)return;let o=Dp,s=({dragEntity:c,dragOrigin:d,dragPosition:f,dragEntityMargin:p})=>{!c||!f||!d||(o=c.getHitbox(),n(c),a(Ed(f,d,o,p)))},u=({dragOrigin:c,dragPosition:d,dragEntityMargin:f})=>{!d||!c||a(Ed(d,c,o,f))},l=({dragOrigin:c,primaryIntersection:d,dragPosition:f,dragEntityMargin:p})=>{if(d&&f&&c){let m=d.getHitbox(),y={x:m[0],y:m[1]},b=_i({position:f,destination:y}),x=ln.drop(b),D=nv.drop(y);a(Ed(f,c,o,p,x,D)),activeWindow.setTimeout(()=>{n(void 0),a(void 0)},b)}else n(void 0),a(void 0)};return t.dragManager.emitter.on("dragStart",s),t.dragManager.emitter.on("dragMove",u),t.dragManager.emitter.on("dragEnd",l),()=>{t.dragManager.emitter.off("dragStart",s),t.dragManager.emitter.off("dragMove",u),t.dragManager.emitter.off("dragEnd",l)}},[t]),!r||!i?null:F.createPortal(e(r,i),r.getData().win.document.body)}function Fb(){let e=F.useContext(kt),[t,r]=F.useState(!1);return F.useEffect(()=>{let n=()=>{r(!0)},i=({primaryIntersection:a,dragPosition:o})=>{let s=(a==null?void 0:a.getHitbox())||[0,0],u={x:s[0],y:s[1]},l=_i({position:o||u,destination:u});activeWindow.setTimeout(()=>{r(!1)},l)};return e.dragManager.emitter.on("dragStart",n),e.dragManager.emitter.on("dragEnd",i),()=>{e.dragManager.emitter.off("dragStart",n),e.dragManager.emitter.off("dragEnd",i)}},[e]),t}h();var Oa=ge(xt()),Nb=ge(require("obsidian"));function Os(e){let t=r=>{let n=e.getSetting("prepend-archive-format"),i=e.getSetting("prepend-archive-separator"),a=[(0,Nb.moment)().format(n)];i&&a.push(i),a.push(r.data.titleRaw);let o=a.join(" ");return e.updateItemContent(r,o)};return{appendItems:(r,n)=>{n.forEach(i=>e.app.workspace.trigger("kanban:card-added",e.file,i)),e.setState(i=>Pl(i,r,n))},prependItems:(r,n)=>{n.forEach(i=>e.app.workspace.trigger("kanban:card-added",e.file,i)),e.setState(i=>kp(i,r,n))},insertItems:(r,n)=>{n.forEach(i=>e.app.workspace.trigger("kanban:card-added",e.file,i)),e.setState(i=>fr(i,r,n))},splitItem:(r,n)=>{n.forEach(i=>e.app.workspace.trigger("kanban:card-added",e.file,i)),e.setState(i=>fr(Lr(i,r),r,n))},addLane:r=>{e.app.workspace.trigger("kanban:lane-added",e.file,r),e.setState(n=>Pl(n,[],[r]))},insertLane:(r,n)=>{e.app.workspace.trigger("kanban:lane-added",e.file,n),e.setState(i=>fr(i,r,[n]))},updateLane:(r,n)=>{e.app.workspace.trigger("kanban:lane-updated",e.file,n),e.setState(i=>Fl(i,r,{children:{[r[r.length-1]]:{$set:n}}}))},archiveLane:r=>{e.setState(async n=>{let i=ht(n,r),a=i.children;e.app.workspace.trigger("kanban:lane-archived",e.file,i);try{return(0,Oa.default)(Lr(n,r),{data:{archive:{$unshift:e.getSetting("prepend-archive-date")?await Promise.all(a.map(t)):a}}})}catch(o){return e.setError(o),n}})},archiveLaneItems:r=>{e.setState(async n=>{let a=ht(n,r).children;e.app.workspace.trigger("kanban:lane-cards-archived",e.file,a);try{return(0,Oa.default)(ho(n,r,{children:{$set:[]}}),{data:{archive:{$unshift:e.getSetting("prepend-archive-date")?await Promise.all(a.map(t)):a}}})}catch(o){return e.setError(o),n}})},deleteEntity:r=>{e.setState(n=>{let i=ht(n,r);return e.app.workspace.trigger(`kanban:${i.type}-deleted`,e.file,i),Lr(n,r)})},updateItem:(r,n)=>{e.setState(i=>{let a=ht(i,r);return e.app.workspace.trigger("kanban:card-updated",e.file,a,n),Fl(i,r,{children:{[r[r.length-1]]:{$set:n}}})})},archiveItem:r=>{e.setState(async n=>{let i=ht(n,r);e.app.workspace.trigger("kanban:card-archived",e.file,r,i);try{return(0,Oa.default)(Lr(n,r),{data:{archive:{$push:[e.getSetting("prepend-archive-date")?await t(i):i]}}})}catch(a){return e.setError(a),n}})},duplicateEntity:r=>{e.setState(n=>{let i=ht(n,r);e.app.workspace.trigger(`kanban:${i.type}-duplicated`,e.file,r,i);let a=(0,Oa.default)(i,{id:{$set:Re()}});return fr(n,r,[a])})}}}function Rb(e,t){return g(VC,{win:e,plugin:t})}var WC=F.memo(function({view:t}){return F.createPortal(t.getPortal(),t.contentEl)});function VC({win:e,plugin:t}){let r=t.useViewState(e),n=r.map(a=>g(WC,{key:a.id,view:a})),i=F.useCallback((a,o)=>{if(!a||!o)return;if(a.scopeId==="htmldnd"){let y=a.getData(),b=t.getStateManagerFromViewID(y.viewId,y.win),x=o.getPath(),D=ht(b.state,x.slice(0,-1));(A=>Promise.all(A.map(N=>b.getNewItem(N))))(y.content).then(A=>{let N=A.map(T=>{var O;return(0,Ob.default)(T,{data:{isComplete:{$set:!!((O=D==null?void 0:D.data)==null?void 0:O.shouldMarkItemsComplete)}}})});return b.setState(T=>fr(T,x,N))}).catch(A=>{b.setError(A),console.error(A)});return}let s=a.getPath(),u=o.getPath(),[,l]=a.scopeId.split(":::"),[,c]=o.scopeId.split(":::"),d=a.getData(),f=o.getData();if(l===c){let y=t.getStateManagerFromViewID(a.scopeId,d.win);return t.app.workspace.trigger("kanban:card-moved",y.file,s,u,d),y.setState(b=>{var N;let x=!1,D=xp(b,s,u,T=>T.type===Ge.Item?(x=!0,Ol(b,s,b,u,T)):T);if(!x)return D;let C=u.slice(0,-1),A=ht(b,C);return((N=A==null?void 0:A.data)==null?void 0:N.sorted)!==void 0?ho(D,C,{data:{$unset:["sorted"]}}):D})}let p=t.getStateManagerFromViewID(a.scopeId,d.win),m=t.getStateManagerFromViewID(o.scopeId,f.win);p.setState(y=>{let b=ht(y,s);return m.setState(x=>{let D=b.type===Ge.Item?Ol(y,s,x,u,b):b;return fr(x,u,[D])}),Lr(y,s)})},[r]);if(n.length)return g(Fs,{win:e,onDrop:i},n,g(Ns,null,(a,o)=>{let[s,u]=F.useMemo(()=>{if(a.scopeId==="htmldnd")return[null,null];let l=a.getData(),c=t.getKanbanView(a.scopeId,l.win),d=t.stateManagers.get(c.file),f=ht(d.state,a.getPath()),p=Os(d),m=c.file.path;return[f,{view:c,stateManager:d,boardModifiers:p,filePath:m}]},[a]);return(s==null?void 0:s.type)===Ge.Lane?g(Ve.Provider,{value:u},g("div",{className:$("drag-container"),style:o},g(bd,{lane:s,laneIndex:0,isStatic:!0}))):(s==null?void 0:s.type)===Ge.Item?g(Ve.Provider,{value:u},g("div",{className:$("drag-container"),style:o},g(dd,{item:s,itemIndex:0,isStatic:!0}))):g("div",null)}))}h();var Rd=ge(xt()),_w=ge(require("obsidian"));h();var jb=ge(xt()),qb=ge(require("obsidian")),Hs=ge(fc());h();function Rs({id:e,children:t}){let r=F.useContext(oa),n=F.useMemo(()=>e||Re(),[e]);return F.useEffect(()=>()=>{r.unmountScope(e)},[e]),g(pr.Provider,{value:n},t)}h();var gn="kanban-plugin",Hb;(function(t){t[t.List=0]="List"})(Hb||(Hb={}));var Bb=`**${B("Complete")}**`,Kb="***",xd=["---","",`${gn}: basic`,"","---","",""].join(` `);function $b(e){return["","","%% kanban:settings","```",JSON.stringify(e),"```","%%"].join(` -`)}function Ub(e,t,r){let n=e.innerText.trim();if((t==null?void 0:t.length)&&(n+=" "+t.join(" ")),r){let i=Object.keys(r).join(" "),a=Object.values(r).map(o=>Array.isArray(o.value)?o.value.join(" "):o.value.toString()).join(" ");n+=" "+i+" "+a}return n.toLocaleLowerCase()}function zC(e,t,r){var n,i,a;if(e.plugins.enabledPlugins.has("dataview")&&((a=(i=(n=e.plugins)==null?void 0:n.plugins)==null?void 0:i.dataview)==null?void 0:a.api))return e.plugins.plugins.dataview.api.page(t.path,r.path)}function Wb(e,t){if(!e)return null;if(e[t])return e[t];let r=t.split("."),n=e;for(let i of r)if(typeof n=="object"&&i in n)n=n[i];else{n=null;break}return n}function kd(e,t){let r=e.getSetting("metadata-keys");if(!r.length)return{};if(!t)return{};let n=e.app.metadataCache.getFileCache(t),i=zC(e.app,t,e.file);if(!n&&!i)return{};let a={},o={},s={},u=[],l=!1;return r.forEach(c=>{var p;if(s[c.metadataKey])return;if(s[c.metadataKey]=!0,c.metadataKey==="tags"){let m=(n==null?void 0:n.tags)||[];if(Array.isArray((p=n==null?void 0:n.frontmatter)==null?void 0:p.tags)&&(m=[].concat(m,n.frontmatter.tags.map(y=>({tag:`#${y}`})))),(m==null?void 0:m.length)===0)return;u.push(c.metadataKey),a.tags={...c,value:m.map(y=>y.tag).filter(y=>o[y]?!1:(o[y]=!0,!0))},l=!0;return}let d=Wb(n==null?void 0:n.frontmatter,c.metadataKey),f=Wb(i,c.metadataKey);if(d)u.push(c.metadataKey),a[c.metadataKey]={...c,value:d},l=!0;else if(f){let m=i[c.metadataKey],y=m.values||m.val||m;if(y===m&&typeof y=="object")y={...m};else if(!Array.isArray(y)&&typeof y!="string"&&typeof y!="number")return;u.push(c.metadataKey),a[c.metadataKey]={...c,value:y},l=!0}}),{fileMetadata:l?a:void 0,fileMetadataOrder:u}}function Vb(e,t){return!e&&t?!0:!["metadata-keys","date-trigger","time-trigger","link-date-to-daily-note","date-format","time-format","hide-date-in-title","hide-tags-in-title","hide-card-count"].every(n=>e[n]===t[n])}h();function zb({onNewLane:e,closeLaneForm:t}){let{boardModifiers:r,stateManager:n}=F.useContext(Ve),[i,a]=F.useState(!1),[o,s]=F.useState(""),u=F.useRef(),l=Li(()=>{t()},{ignoreClass:$("ignore-click-outside")});F.useLayoutEffect(()=>{var d;(d=u.current)==null||d.focus()},[]);let c=()=>{r.addLane({...wr,id:Re(),children:[],data:{...Wr(o),shouldMarkItemsComplete:i}}),s(""),a(!1),e()};return g("div",{ref:l,className:$("lane-form-wrapper")},g("div",{className:$("lane-input-wrapper")},g(Er,{ref:u,className:$("lane-input"),onChange:d=>s(d.target.value),onEnter:d=>{Xn(d,n)||(d.preventDefault(),c())},onSubmit:()=>{c()},onEscape:t,value:o})),g("div",{className:$("checkbox-wrapper")},g("div",{className:$("checkbox-label")},B("Mark cards in this list as complete")),g("div",{onClick:()=>a(!i),className:`checkbox-container ${i?"is-enabled":""}`})),g("div",{className:$("lane-input-actions")},g("button",{className:$("lane-action-add"),onClick:c},B("Add list")),g("button",{className:$("lane-action-cancel"),onClick:t},B("Cancel"))))}var jC=[Ge.Item,Ge.Lane],qC=[Ge.Lane],Yb=({view:e,stateManager:t})=>{let r=t.useState(),n=Fb(),i=F.useRef(null),a=F.useRef(null),[o,s]=F.useState(""),[u,l]=F.useState(!1),[c,d]=F.useState(""),[f,p]=F.useState((r==null?void 0:r.children.length)===0),m=t.file.path,y=t.useSetting("max-archive-size"),b=F.useCallback(()=>{(r==null?void 0:r.children.length)>0&&p(!1)},[r==null?void 0:r.children.length]);F.useEffect(()=>{(r==null?void 0:r.children.length)===0&&!t.hasError()&&p(!0)},[r==null?void 0:r.children.length,t]);let x=F.useCallback(()=>{var O;(O=i.current)==null||O.win.setTimeout(()=>{var z;let W=(z=i.current)==null?void 0:z.getElementsByClassName($("board"));(W==null?void 0:W.length)&&Cs([W[0].scrollWidth,0],{elementToScroll:W[0],speed:300,minDuration:150,easing:ee=>ee===1?1:1-Math.pow(2,-10*ee)})})},[]);F.useEffect(()=>{let O=z=>{z==="editor:open-search"&&l(ee=>!ee)},W=()=>{p(!0)};return e.emitter.on("hotkey",O),e.emitter.on("showLaneForm",W),()=>{e.emitter.off("hotkey",O),e.emitter.off("showLaneForm",W)}},[e]),F.useEffect(()=>{var O;u&&((O=a.current)==null||O.focus())},[u]),F.useEffect(()=>{let O=e.getWindow(),W=o.trim(),z;return W?z=O.setTimeout(()=>{d(W)},250):d(""),()=>{O.clearTimeout(z)}},[o,e]),F.useEffect(()=>{y===void 0||y===-1||typeof y=="number"&&(r==null?void 0:r.data.archive.length)>y&&t.setState(O=>(0,jb.default)(O,{data:{archive:{$set:O.data.archive.slice(y*-1)}}}))},[r==null?void 0:r.data.archive.length,y]);let D=F.useMemo(()=>Os(t),[t]),C=F.useCallback(O=>{let W=O.target;W.tagName==="A"&&W.hasClass("internal-link")&&e.app.workspace.trigger("hover-link",{event:O,source:gn,hoverParent:e,targetEl:W,linktext:W.getAttr("href"),sourcePath:e.file.path})},[e]),A=F.useCallback(async O=>{if(O.type==="auxclick"||O.button===2)return;let W=O.target,z=W.tagName==="A"?W:W.closest("a");if(!!z){if(z.hasClass("file-link")){O.preventDefault();let ee=z.getAttribute("href"),Z=Ur(ee),le=typeof ee=="string"&&e.app.metadataCache.getFirstLinkpathDest(Z.root,e.file.path);if(!le)return;t.app.openWithDefaultApp(le.path);return}if(z.hasClass("internal-link")){O.preventDefault();let ee=z.getAttr("href"),Z=O.button===1||O.ctrlKey||O.metaKey;if(z.hasClass("is-unresolved")&&(0,Hs.appHasDailyNotesPluginLoaded)()){let X=t.getSetting("date-format"),G=(0,qb.moment)(ee,X,!0);if(G.isValid()){try{let re=await(0,Hs.createDailyNote)(G);await(Z?app.workspace.getLeaf(!0):app.workspace.getLeaf(!1)).openFile(re,{active:!0})}catch(re){console.error(re),t.setError(re)}return}}t.app.workspace.openLinkText(ee,m,Z);return}if(z.hasClass("tag")){O.preventDefault(),t.app.internalPlugins.getPluginById("global-search").instance.openGlobalSearch(`tag:${z.getAttr("href")}`);return}z.hasClass("external-link")&&(O.preventDefault(),window.open(z.getAttr("href"),"_blank"))}},[t,m]),N=F.useMemo(()=>({view:e,stateManager:t,boardModifiers:D,filePath:m}),[e,t,D,m]),T=iv(t);return r==null?g("div",{className:$("loading")},g("div",{className:"sk-pulse"})):r.data.errors.length>0?g("div",null,g("div",null,"Error:"),r.data.errors.map((O,W)=>g("div",{key:W},g("div",null,O.description),g("pre",null,O.stack)))):g(Rs,{id:e.id},g(Ve.Provider,{value:N},g(po.Provider,{value:c?c.toLocaleLowerCase():null},g("div",{ref:i,className:mt([Nl,{"something-is-dragging":n}]),onMouseOver:C,onPointerDown:A,onClick:A,onAuxClick:A,...T},(f||r.children.length===0)&&g(zb,{onNewLane:x,closeLaneForm:b}),u&&g("div",{className:$("search-wrapper")},g("input",{ref:a,value:o,onChange:O=>{s(O.target.value)},onKeyDown:O=>{O.key==="Escape"&&(s(""),d(""),O.target.blur(),l(!1))},type:"text",className:$("filter-input"),placeholder:B("Search...")}),g("button",{className:$("search-cancel-button"),onClick:()=>{s(""),d(""),l(!1)},"aria-label":B("Cancel")},g(Kt,{name:"cross"}))),g(Ms,{id:e.id,className:mt([$("board"),$("horizontal"),{"is-adding-lane":f}]),triggerTypes:jC},g("div",null,g(Ii,{axis:"horizontal"},g(Lb,{lanes:r.children}),g(Ai,{className:$("lane-placeholder"),accepts:qC,index:r.children.length}))))))))};h();var xw=ge(xt()),$e=ge(require("obsidian"));h();var Gb=ge(Jb()),Ks=ge(xt()),kr=ge(require("obsidian"));var $s="@",Us="@@";function YC(e){let t=[];return kr.Vault.recurseChildren(e.vault.getRoot(),r=>{r instanceof kr.TFolder&&t.push({value:r.path,label:r.path,selected:!1,disabled:!1})}),t}function JC(e,t){let r=[],n=t?e.vault.getAbstractFileByPath(t):null;return(!n||!(n instanceof kr.TFolder))&&(n=e.vault.getRoot()),kr.Vault.recurseChildren(n,i=>{i instanceof kr.TFile&&r.push({value:i.path,label:i.basename,selected:!1,disabled:!1})}),r}function Qb(e){let{templateFolder:t,templatesEnabled:r,templaterPlugin:n}=Rl(e),i=JC(e,t),a=YC(e),o="";return!r&&!n&&(o=B("Note: No template plugins are currently enabled.")),{templateFiles:i,vaultFolders:a,templateWarning:o}}function _d({choices:e,key:t,warningText:r,local:n,placeHolderStr:i,manager:a}){return o=>{o.controlEl.createEl("select",{},s=>{s.win.setTimeout(()=>{let u=e,[l,c]=a.getSetting(t,n);if(c){let p=e.findIndex(y=>y.value===c),m=e[p];u=(0,Ks.default)(u,{$splice:[[p,1]],$unshift:[(0,Ks.default)(m,{placeholder:{$set:!0},value:{$set:""},label:{$apply:y=>`${y} (${B("default")})`}})]})}else u=(0,Ks.default)(u,{$unshift:[{placeholder:!0,value:"",label:i,selected:!1,disabled:!1}]});let d=new Gb.default(s,{placeholder:!0,position:"bottom",searchPlaceholderValue:B("Search..."),searchEnabled:u.length>10,choices:u}).setChoiceByValue("");l&&typeof l=="string"&&d.setChoiceByValue(l);let f=p=>{let m=p.detail.value;m?a.applySettingsUpdate({[t]:{$set:m}}):a.applySettingsUpdate({$unset:[t]})};s.addEventListener("change",f),a.cleanupFns.push(()=>{d.destroy(),s.removeEventListener("change",f)})}),r&&o.descEl.createDiv({},u=>{u.createEl("strong",{text:r})})})}}h();var Vr=ge(xt());function Xb({isStatic:e,itemIndex:t,item:r,toggleShouldHideLabel:n,toggleContainsMarkdown:i,deleteKey:a,updateKey:o,updateLabel:s}){let u=F.useRef(null),l=F.useRef(null),c=F.useRef(null);Ti(l,c);let d=g("div",{className:$("setting-controls-wrapper")},g("div",{className:$("setting-input-wrapper")},g("div",null,g("div",{className:$("setting-item-label")},B("Metadata key")),g("input",{type:"text",value:r.data.metadataKey,onChange:f=>o(f.target.value)})),g("div",null,g("div",{className:$("setting-item-label")},B("Display label")),g("input",{type:"text",value:r.data.label,onChange:f=>s(f.target.value)}))),g("div",{className:$("setting-toggle-wrapper")},g("div",null,g("div",{className:`checkbox-container ${r.data.shouldHideLabel?"is-enabled":""}`,onClick:n,"aria-label":B("Hide label")}),g("div",{className:$("setting-item-label")},B("Hide label"))),g("div",null,g("div",{className:`checkbox-container ${r.data.containsMarkdown?"is-enabled":""}`,onClick:i,"aria-label":B("Field contains markdown")}),g("div",{className:$("setting-item-label")},B("Field contains markdown")))));return g("div",{ref:l,className:$("setting-item-wrapper")},g("div",{ref:u,className:$("setting-item")},e?d:g(hr,{elementRef:u,measureRef:l,id:r.id,index:t,data:r},d),g("div",{className:$("setting-button-wrapper")},g("div",{onClick:a,"aria-label":B("Delete")},g(Kt,{name:"cross"})),g("div",{className:"mobile-option-setting-drag-icon","aria-label":B("Drag to rearrange"),ref:c},g(Kt,{name:"three-horizontal-bars"})))))}function GC({onChange:e,inputValue:t,keys:r,setKeys:n}){let i=a=>{e(a),n(a)};return{updateKey:a=>o=>{i((0,Vr.default)(r,{[a]:{data:{metadataKey:{$set:o}}}}))},updateLabel:a=>o=>{i((0,Vr.default)(r,{[a]:{data:{label:{$set:o}}}}))},toggleShouldHideLabel:a=>()=>{i((0,Vr.default)(r,{[a]:{data:{$toggle:["shouldHideLabel"]}}}))},toggleContainsMarkdown:a=>()=>{i((0,Vr.default)(r,{[a]:{data:{$toggle:["containsMarkdown"]}}}))},deleteKey:a=>()=>{i((0,Vr.default)(r,{$splice:[[a,1]]}))},newKey:()=>{i((0,Vr.default)(r,{$push:[{...ds,id:Re(),data:{metadataKey:t,label:"",shouldHideLabel:!1,containsMarkdown:!1}}]}))},moveKey:(a,o)=>{let s=a.getPath(),u=o.getPath(),l=s[s.length-1],c=u[u.length-1];if(l===c)return;let d=r.slice(),[f]=d.splice(l,1);d.splice(c,0,f),i(d)}}}var QC=[Ge.MetadataSetting];function XC({keys:e,portalContainer:t}){return F.createPortal(g(Ns,null,(r,n)=>{let a=r.getPath()[0],o=e[a];return g("div",{className:$("drag-container"),style:n},g(Xb,{item:o,itemIndex:a,updateKey:si,updateLabel:si,toggleShouldHideLabel:si,toggleContainsMarkdown:si,deleteKey:si,isStatic:!0}))}),t)}function ZC({scrollEl:e}){let t=F.useContext(kt);return F.useEffect(()=>{let r=0,n=()=>{e.win.clearTimeout(r),r=e.win.setTimeout(()=>{t.hitboxEntities.forEach(i=>{i.recalcInitial()})},100)};return e.addEventListener("scroll",n,{passive:!0,capture:!1}),()=>{e.removeEventListener("scroll",n)}},[e,t]),null}function e1(e){let[t,r]=F.useState(e.dataKeys),[n,i]=F.useState(""),{getShouldIMEBlockAction:a,...o}=go(),s=Ze(e.scrollEl),{updateKey:u,updateLabel:l,toggleShouldHideLabel:c,toggleContainsMarkdown:d,deleteKey:f,newKey:p,moveKey:m}=GC({onChange:e.onChange,inputValue:n,keys:t,setKeys:r,win:s});return g(S,null,g(Fs,{win:s,onDrop:m},g(ZC,{scrollEl:e.scrollEl}),g(Rs,null,g(Ii,{axis:"vertical"},t.map((y,b)=>g(Xb,{key:y.id,item:y,itemIndex:b,updateKey:u(b),updateLabel:l(b),toggleShouldHideLabel:c(b),toggleContainsMarkdown:d(b),deleteKey:f(b)})),g(Ai,{accepts:QC,index:t.length}))),g(XC,{keys:t,portalContainer:e.portalContainer})),g("div",{className:$("setting-key-input-wrapper")},g("input",{placeholder:B("Metadata key"),type:"text",value:n,onChange:y=>i(y.target.value),onKeyDown:y=>{if(!a()){if(y.key==="Enter"){p(),i("");let b=y.target;b.win.setTimeout(()=>{b.scrollIntoView()});return}y.key==="Escape"&&(i(""),y.target.blur())}},...o}),g("button",{onClick:y=>{p(),i("");let b=y.target;b.win.setTimeout(()=>{b.scrollIntoView()})}},B("Add key"))))}function Zb(e,t,r,n){F.render(g(e1,{dataKeys:r,scrollEl:t,onChange:n,portalContainer:ai(e)}),e)}function ew(e){F.unmountComponentAtNode(e)}h();h();var t1={grad:.9,turn:360,rad:360/(2*Math.PI)},er=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},_t=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},vn=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},tw=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},nw=function(e){return{r:vn(e.r,0,255),g:vn(e.g,0,255),b:vn(e.b,0,255),a:vn(e.a)}},Cd=function(e){return{r:_t(e.r),g:_t(e.g),b:_t(e.b),a:_t(e.a,3)}},n1=/^#([0-9a-f]{3,8})$/i,Ws=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rw=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},iw=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),u=n*(1-(1-t+a)*r),l=a%6;return{r:255*[n,s,o,o,u,n][l],g:255*[u,n,n,s,o,o][l],b:255*[o,o,u,n,n,s][l],a:i}},aw=function(e){return{h:tw(e.h),s:vn(e.s,0,100),l:vn(e.l,0,100),a:vn(e.a)}},ow=function(e){return{h:_t(e.h),s:_t(e.s),l:_t(e.l),a:_t(e.a,3)}},sw=function(e){return iw((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},Ra=function(e){return{h:(t=rw(e)).h,s:(i=(200-(r=t.s))*(n=t.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,r,n,i},r1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,i1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,a1=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,o1=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lw={string:[[function(e){var t=n1.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?_t(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?_t(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=a1.exec(e)||o1.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:nw({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=r1.exec(e)||i1.exec(e);if(!t)return null;var r,n,i=aw({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(t1[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return sw(i)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i===void 0?1:i;return er(t)&&er(r)&&er(n)?nw({r:Number(t),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,i=e.a,a=i===void 0?1:i;if(!er(t)||!er(r)||!er(n))return null;var o=aw({h:Number(t),s:Number(r),l:Number(n),a:Number(a)});return sw(o)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,a=i===void 0?1:i;if(!er(t)||!er(r)||!er(n))return null;var o=function(s){return{h:tw(s.h),s:vn(s.s,0,100),v:vn(s.v,0,100),a:vn(s.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(a)});return iw(o)},"hsv"]]},cw=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=Cd(this.rgba),r=t.r,n=t.g,i=t.b,o=(a=t.a)<1?Ws(_t(255*a)):"","#"+Ws(r)+Ws(n)+Ws(i)+o;var t,r,n,i,a,o},e.prototype.toRgb=function(){return Cd(this.rgba)},e.prototype.toRgbString=function(){return t=Cd(this.rgba),r=t.r,n=t.g,i=t.b,(a=t.a)<1?"rgba("+r+", "+n+", "+i+", "+a+")":"rgb("+r+", "+n+", "+i+")";var t,r,n,i,a},e.prototype.toHsl=function(){return ow(Ra(this.rgba))},e.prototype.toHslString=function(){return t=ow(Ra(this.rgba)),r=t.h,n=t.s,i=t.l,(a=t.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+a+")":"hsl("+r+", "+n+"%, "+i+"%)";var t,r,n,i,a},e.prototype.toHsv=function(){return t=rw(this.rgba),{h:_t(t.h),s:_t(t.s),v:_t(t.v),a:_t(t.a,3)};var t},e.prototype.invert=function(){return In({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),In(Td(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),In(Td(this.rgba,-t))},e.prototype.grayscale=function(){return In(Td(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),In(uw(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),In(uw(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?In({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):_t(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=Ra(this.rgba);return typeof t=="number"?In({h:t,s:r.s,l:r.l,a:r.a}):_t(r.h)},e.prototype.isEqual=function(t){return this.toHex()===In(t).toHex()},e}(),In=function(e){return e instanceof dw?e:new dw(e)};var js=ge(xt());h();function Vs(){return(Vs=Object.assign||function(e){for(var t=1;t=0||(i[r]=e[r]);return i}function Md(e){var t=Xt(e),r=Xt(function(n){t.current&&t.current(n)});return t.current=e,r.current}var Pi=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e0:b.buttons>0)&&i.current?a(pw(i.current,b,s.current)):y(!1)},m=function(){return y(!1)};function y(b){var x=u.current,D=Id(i.current),C=b?D.addEventListener:D.removeEventListener;C(x?"touchmove":"mousemove",p),C(x?"touchend":"mouseup",m)}return[function(b){var x=b.nativeEvent,D=i.current;if(D&&(hw(x),!function(A,N){return N&&!Ha(A)}(x,u.current)&&D)){if(Ha(x)){u.current=!0;var C=x.changedTouches||[];C.length&&(s.current=C[0].identifier)}D.focus(),a(pw(D,x,s.current)),y(!0)}},function(b){var x=b.which||b.keyCode;x<37||x>40||(b.preventDefault(),o({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},y]},[o,a]),c=l[0],d=l[1],f=l[2];return Sn(function(){return f},[f]),it.createElement("div",Vs({},n,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),zs=function(e){return e.filter(Boolean).join(" ")},Ld=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,a=zs(["react-colorful__pointer",e.className]);return it.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},it.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Yt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},t$={grad:.9,turn:360,rad:360/(2*Math.PI)};var mw=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:Yt(e.h),s:Yt(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:Yt(i/2),a:Yt(n,2)}},Pd=function(e){var t=mw(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Fd=function(e){var t=mw(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},l1=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),u=n*(1-(1-t+a)*r),l=a%6;return{r:Yt(255*[n,s,o,o,u,n][l]),g:Yt(255*[u,n,n,s,o,o][l]),b:Yt(255*[o,o,u,n,n,s][l]),a:Yt(i,2)}};var c1=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?u1({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}};var u1=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:Yt(60*(s<0?s+6:s)),s:Yt(a?o/a*100:0),v:Yt(a/255*100),a:i}};var d1=it.memo(function(e){var t=e.hue,r=e.onChange,n=zs(["react-colorful__hue",e.className]);return it.createElement("div",{className:n},it.createElement(Ad,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:Pi(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Yt(t),"aria-valuemax":"360","aria-valuemin":"0"},it.createElement(Ld,{className:"react-colorful__hue-pointer",left:t/360,color:Pd({h:t,s:100,v:100,a:1})})))}),f1=it.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:Pd({h:t.h,s:100,v:100,a:1})};return it.createElement("div",{className:"react-colorful__saturation",style:n},it.createElement(Ad,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:Pi(t.s+100*i.left,0,100),v:Pi(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Yt(t.s)+"%, Brightness "+Yt(t.v)+"%"},it.createElement(Ld,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Pd(t)})))}),p1=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},h1=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function m1(e,t,r){var n=Md(r),i=sr(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=Xt({color:t,hsva:a});Sn(function(){if(!e.equal(t,s.current.color)){var l=e.toHsva(t);s.current={hsva:l,color:t},o(l)}},[t,e]),Sn(function(){var l;p1(a,s.current.hsva)||e.equal(l=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:l},n(l))},[a,e,n]);var u=cr(function(l){o(function(c){return Object.assign({},c,l)})},[]);return[a,u]}var g1,v1=typeof window!="undefined"?Ir:Sn,y1=function(){return g1||(typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0)};var gw=new Map,b1=function(e){v1(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!gw.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,gw.set(t,r);var n=y1();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])};var w1=function(e){var t=e.className,r=e.hsva,n=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+Fd(Object.assign({},r,{a:0}))+", "+Fd(Object.assign({},r,{a:1}))+")"},a=zs(["react-colorful__alpha",t]),o=Yt(100*r.a);return it.createElement("div",{className:a},it.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),it.createElement(Ad,{onMove:function(s){n({a:s.left})},onKey:function(s){n({a:Pi(r.a+s.left)})},"aria-label":"Alpha","aria-valuetext":o+"%","aria-valuenow":o,"aria-valuemin":"0","aria-valuemax":"100"},it.createElement(Ld,{className:"react-colorful__alpha-pointer",left:r.a,color:Fd(r)})))},E1=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,a=e.onChange,o=fw(e,["className","colorModel","color","onChange"]),s=Xt(null);b1(s);var u=m1(r,i,a),l=u[0],c=u[1],d=zs(["react-colorful",t]);return it.createElement("div",Vs({},o,{ref:s,className:d}),it.createElement(f1,{hsva:l,onChange:c}),it.createElement(d1,{hue:l.h,onChange:c}),it.createElement(w1,{hsva:l,onChange:c,className:"react-colorful__last-control"}))};var x1={defaultColor:"rgba(0, 0, 0, 1)",toHsva:c1,fromHsva:function(e){var t=l1(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:h1},vw=function(e){return it.createElement(E1,Vs({},e,{colorModel:x1}))};function yw(e){let t=In(e);if(!t.isValid())return null;let r=t.toRgb();return{rgba:`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`,hexa:t.toHex()}}function bw({color:e,setColor:t}){let[r,n]=F.useState(e),[i,a]=F.useState(e),[o,s]=F.useState(!1),u=F.useCallback(c=>{let d=yw(c);d&&(a(d.hexa),n(d.rgba),t(d.rgba))},[t]);F.useEffect(()=>{if(!e)return;let c=yw(e);c&&(n(c.rgba),a(c.hexa))},[]);let l=Li(()=>{s(!1)});return g("div",{ref:l,className:$("color-picker-wrapper")},o&&g("div",{className:$("color-picker")},g(vw,{color:r,onChange:u})),g("input",{type:"text",value:i,onChange:c=>u(c.target.value),onFocus:()=>{s(!0)}}))}function k1({tagColorKey:e,deleteKey:t,updateKey:r}){return g("div",{className:$("setting-item-wrapper")},g("div",{className:$("setting-item")},g("div",{className:`${$("setting-controls-wrapper")} ${$("tag-color-input")}`},g("div",{className:$("setting-input-wrapper")},g("div",null,g("div",{className:$("setting-item-label")},B("Tag")),g("input",{type:"text",placeholder:"#tag",value:e.tagKey,onChange:n=>{r(n.currentTarget.value,e.color,e.backgroundColor)}})),g("div",null,g("div",{className:$("setting-item-label")},B("Background color")),g(bw,{color:e.backgroundColor,setColor:n=>{r(e.tagKey,e.color,n)}})),g("div",null,g("div",{className:$("setting-item-label")},B("Text color")),g(bw,{color:e.color,setColor:n=>{r(e.tagKey,n,e.backgroundColor)}}))),g("div",{className:$("setting-toggle-wrapper")},g("div",null,g("div",{className:$("item-tags")},g("a",{className:`tag ${$("item-tag")}`},"#tag1"),g("a",{className:`tag ${$("item-tag")}`,style:{"--tag-color":e.color,"--tag-background-color":e.backgroundColor}},e.tagKey),g("a",{className:`tag ${$("item-tag")}`},"#tag2"))))),g("div",{className:$("setting-button-wrapper")},g("div",{onClick:t,"aria-label":B("Delete")},g(Kt,{name:"cross"})))))}function S1({dataKeys:e,onChange:t}){let[r,n]=F.useState(e),i=u=>{t(u),n(u)},a=()=>{i((0,js.default)(r,{$push:[{...fs,id:Re(),data:{tagKey:"",color:"",backgroundColor:""}}]}))},o=u=>{i((0,js.default)(r,{$splice:[[u,1]]}))},s=u=>(l,c,d)=>{i((0,js.default)(r,{[u]:{data:{tagKey:{$set:l},color:{$set:c},backgroundColor:{$set:d}}}}))};return g("div",{className:$("tag-color-input-wrapper")},g("div",{className:"setting-item-info"},g("div",{className:"setting-item-name"},B("Display tag colors")),g("div",{className:"setting-item-description"},B("Set colors for the tags displayed below the card title."))),r.map((u,l)=>g(k1,{key:u.id,tagColorKey:u.data,deleteKey:()=>o(l),updateKey:s(l)})),g("button",{className:$("add-tag-color-button"),onClick:()=>{a()}},B("Add tag color")))}function ww(e,t,r){F.render(g(S1,{dataKeys:t,onChange:r,portalContainer:ai(e)}),e)}function Ew(e){F.unmountComponentAtNode(e)}var kw=/^\d+(?:\.\d+)?$/,Sw={[gn]:!0,"date-display-format":!0,"date-format":!0,"date-picker-week-start":!0,"date-time-display-format":!0,"date-trigger":!0,"hide-card-count":!0,"hide-date-display":!0,"hide-date-in-title":!0,"hide-tags-display":!0,"hide-tags-in-title":!0,"lane-width":!0,"link-date-to-daily-note":!0,"max-archive-size":!0,"metadata-keys":!0,"new-card-insertion-method":!0,"new-line-trigger":!0,"new-note-folder":!0,"new-note-template":!0,"prepend-archive-date":!0,"prepend-archive-format":!0,"prepend-archive-separator":!0,"show-checkboxes":!0,"show-relative-date":!0,"time-format":!0,"time-trigger":!0,"show-add-list":!0,"show-archive-all":!0,"show-view-as-markdown":!0,"show-board-settings":!0,"show-search":!0,"tag-colors":!0},Nd=class{constructor(t,r,n){this.cleanupFns=[];this.applyDebounceTimer=0;this.app=t.app,this.plugin=t,this.config=r,this.settings=n}applySettingsUpdate(t){this.win.clearTimeout(this.applyDebounceTimer),this.applyDebounceTimer=this.win.setTimeout(()=>{this.settings=(0,xw.default)(this.settings,t),this.config.onSettingsChange(this.settings)},200)}getSetting(t,r){return r?[this.settings[t],this.plugin.settings[t]]:[this.settings[t],null]}constructUI(t,r,n){this.win=t.win;let{templateFiles:i,vaultFolders:a,templateWarning:o}=Qb(this.app);t.createEl("h3",{text:r}),n?t.createEl("p",{text:B("These settings will take precedence over the default Kanban board settings.")}):t.createEl("p",{text:B("Set the default Kanban board settings. Settings can be overridden on a board-by-board basis.")}),new $e.Setting(t).setName(B("New line trigger")).setDesc(B("Select whether Enter or Shift+Enter creates a new line. The opposite of what you choose will create and complete editing of cards and lists.")).addDropdown(s=>{s.addOption("shift-enter",B("Shift + Enter")),s.addOption("enter",B("Enter"));let[u,l]=this.getSetting("new-line-trigger",n);s.setValue(u||l||"shift-enter"),s.onChange(c=>{this.applySettingsUpdate({"new-line-trigger":{$set:c}})})}),new $e.Setting(t).setName(B("Prepend / append new cards")).setDesc(B("This setting controls whether new cards are added to the beginning or end of the list.")).addDropdown(s=>{s.addOption("prepend",B("Prepend")),s.addOption("prepend-compact",B("Prepend (compact)")),s.addOption("append",B("Append"));let[u,l]=this.getSetting("new-card-insertion-method",n);s.setValue(u||l||"append"),s.onChange(c=>{this.applySettingsUpdate({"new-card-insertion-method":{$set:c}})})}),new $e.Setting(t).setName(B("Note template")).setDesc(B("This template will be used when creating new notes from Kanban cards.")).then(_d({choices:i,key:"new-note-template",warningText:o,local:n,placeHolderStr:B("No template"),manager:this})),new $e.Setting(t).setName(B("Note folder")).setDesc(B("Notes created from Kanban cards will be placed in this folder. If blank, they will be placed in the default location for this vault.")).then(_d({choices:a,key:"new-note-folder",local:n,placeHolderStr:B("Default folder"),manager:this})),new $e.Setting(t).setName(B("Hide card counts in list titles")).setDesc(B("When toggled, card counts are hidden from the list title")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-card-count",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-card-count":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-card-count",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-card-count"]})})})}),new $e.Setting(t).setName(B("List width")).setDesc(B("Enter a number to set the list width in pixels.")).addText(s=>{let[u,l]=this.getSetting("lane-width",n);s.inputEl.setAttr("type","number"),s.inputEl.placeholder=`${l||"272"} (default)`,s.inputEl.value=u?u.toString():"",s.onChange(c=>{if(c&&kw.test(c)){s.inputEl.removeClass("error"),this.applySettingsUpdate({"lane-width":{$set:parseInt(c)}});return}c&&s.inputEl.addClass("error"),this.applySettingsUpdate({$unset:["lane-width"]})})}),new $e.Setting(t).setName(B("Maximum number of archived cards")).setDesc(B("Archived cards can be viewed in markdown mode. This setting will begin removing old cards once the limit is reached. Setting this value to -1 will allow a board's archive to grow infinitely.")).addText(s=>{let[u,l]=this.getSetting("max-archive-size",n);s.inputEl.setAttr("type","number"),s.inputEl.placeholder=`${l||"-1"} (default)`,s.inputEl.value=u?u.toString():"",s.onChange(c=>{if(c&&kw.test(c)){s.inputEl.removeClass("error"),this.applySettingsUpdate({"max-archive-size":{$set:parseInt(c)}});return}c&&s.inputEl.addClass("error"),this.applySettingsUpdate({$unset:["max-archive-size"]})})}),new $e.Setting(t).setName(B("Display card checkbox")).setDesc(B("When toggled, a checkbox will be displayed with each card")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-checkboxes",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"show-checkboxes":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-checkboxes",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-checkboxes"]})})})}),new $e.Setting(t).setName(B("Hide tags in card titles")).setDesc(B("When toggled, tags will be hidden card titles. This will prevent tags from being included in the title when creating new notes.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-tags-in-title",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-tags-in-title":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-tags-in-title",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-tags-in-title"]})})})}),new $e.Setting(t).setName(B("Hide card display tags")).setDesc(B("When toggled, tags will not be displayed below the card title.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-tags-display",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-tags-display":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-tags-display",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-tags-display"]})})})}),new $e.Setting(t).setName(B("Display tag colors")).setDesc(B("Set colors for the tags displayed below the card title.")).then(s=>{let[u]=this.getSetting("tag-colors",n),l=(u||[]).map(c=>({...fs,id:Re(),data:c}));ww(s.settingEl,l,c=>this.applySettingsUpdate({"tag-colors":{$set:c.map(d=>d.data)}})),this.cleanupFns.push(()=>{s.settingEl&&Ew(s.settingEl)})}),t.createEl("h4",{text:B("Board Header Buttons")}),new $e.Setting(t).setName(B("Add a list")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-add-list",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-add-list":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-add-list",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-add-list"]})})})}),new $e.Setting(t).setName(B("Archive completed cards")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-archive-all",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-archive-all":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-archive-all",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-archive-all"]})})})}),new $e.Setting(t).setName(B("Open as markdown")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-view-as-markdown",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-view-as-markdown":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-view-as-markdown",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-view-as-markdown"]})})})}),new $e.Setting(t).setName(B("Open board settings")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-board-settings",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-board-settings":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-board-settings",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-board-settings"]})})})}),new $e.Setting(t).setName(B("Search...")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-search",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-search":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-search",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-search"]})})})}),t.createEl("h4",{text:B("Date & Time")}),new $e.Setting(t).setName(B("Date trigger")).setDesc(B("When this is typed, it will trigger the date selector")).addText(s=>{let[u,l]=this.getSetting("date-trigger",n);(u||l)&&s.setValue(u||l),s.setPlaceholder(l||$s),s.onChange(c=>{c?this.applySettingsUpdate({"date-trigger":{$set:c}}):this.applySettingsUpdate({$unset:["date-trigger"]})})}),new $e.Setting(t).setName(B("Time trigger")).setDesc(B("When this is typed, it will trigger the time selector")).addText(s=>{let[u,l]=this.getSetting("time-trigger",n);(u||l)&&s.setValue(u||l),s.setPlaceholder(l||Us),s.onChange(c=>{c?this.applySettingsUpdate({"time-trigger":{$set:c}}):this.applySettingsUpdate({$unset:["time-trigger"]})})}),new $e.Setting(t).setName(B("Date format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(f=>{f.appendText(B("This format will be used when saving dates in markdown.")),f.createEl("br"),f.appendText(B("For more syntax, refer to")+" "),f.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},p=>{p.setAttr("target","_blank")}),f.createEl("br"),f.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(f.createEl("b",{cls:"u-pop"})),f.createEl("br")}));let[l,c]=this.getSetting("date-format",n),d=li(this.app);u.setPlaceholder(d),u.setDefaultFormat(d),(l||c)&&u.setValue(l||c),u.onChange(f=>{f?this.applySettingsUpdate({"date-format":{$set:f}}):this.applySettingsUpdate({$unset:["date-format"]})})})}),new $e.Setting(t).setName(B("Time format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(f=>{f.appendText(B("For more syntax, refer to")+" "),f.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},p=>{p.setAttr("target","_blank")}),f.createEl("br"),f.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(f.createEl("b",{cls:"u-pop"})),f.createEl("br")}));let[l,c]=this.getSetting("time-format",n),d=ra(this.app);u.setPlaceholder(d),u.setDefaultFormat(d),(l||c)&&u.setValue(l||c),u.onChange(f=>{f?this.applySettingsUpdate({"time-format":{$set:f}}):this.applySettingsUpdate({$unset:["time-format"]})})})}),new $e.Setting(t).setName(B("Date display format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(f=>{f.appendText(B("This format will be used when displaying dates in Kanban cards.")),f.createEl("br"),f.appendText(B("For more syntax, refer to")+" "),f.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},p=>{p.setAttr("target","_blank")}),f.createEl("br"),f.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(f.createEl("b",{cls:"u-pop"})),f.createEl("br")}));let[l,c]=this.getSetting("date-display-format",n),d=li(this.app);u.setPlaceholder(d),u.setDefaultFormat(d),(l||c)&&u.setValue(l||c),u.onChange(f=>{f?this.applySettingsUpdate({"date-display-format":{$set:f}}):this.applySettingsUpdate({$unset:["date-display-format"]})})})}),new $e.Setting(t).setName(B("Show relative date")).setDesc(B("When toggled, cards will display the distance between today and the card's date. eg. 'In 3 days', 'A month ago'")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-relative-date",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"show-relative-date":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-relative-date",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-relative-date"]})})})}),new $e.Setting(t).setName(B("Hide card display dates")).setDesc(B("When toggled, formatted dates will not be displayed on the card. Relative dates will still be displayed if they are enabled.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-date-display",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-date-display":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-date-display",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-date-display"]})})})}),new $e.Setting(t).setName(B("Hide dates in card titles")).setDesc(B("When toggled, dates will be hidden card titles. This will prevent dates from being included in the title when creating new notes.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-date-in-title",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-date-in-title":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-date-in-title",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-date-in-title"]})})})}),new $e.Setting(t).setName(B("Link dates to daily notes")).setDesc(B("When toggled, dates will link to daily notes. Eg. [[2021-04-26]]")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("link-date-to-daily-note",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"link-date-to-daily-note":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("link-date-to-daily-note",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["link-date-to-daily-note"]})})})}),new $e.Setting(t).setName(B("Add date and time to archived cards")).setDesc(B("When toggled, the current date and time will be added to the beginning of a card when it is archived. Eg. - [ ] 2021-05-14 10:00am My card title")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("prepend-archive-date",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"prepend-archive-date":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("prepend-archive-date",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["prepend-archive-date"]})})})}),new $e.Setting(t).setName(B("Archive date/time separator")).setDesc(B("This will be used to separate the archived date/time from the title")).addText(s=>{let[u,l]=this.getSetting("prepend-archive-separator",n);s.inputEl.placeholder=l?`${l} (default)`:"",s.inputEl.value=u||"",s.onChange(c=>{if(c){this.applySettingsUpdate({"prepend-archive-separator":{$set:c}});return}this.applySettingsUpdate({$unset:["prepend-archive-separator"]})})}),new $e.Setting(t).setName(B("Archive date/time format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(D=>{D.appendText(B("For more syntax, refer to")+" "),D.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},C=>{C.setAttr("target","_blank")}),D.createEl("br"),D.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(D.createEl("b",{cls:"u-pop"})),D.createEl("br")}));let[l,c]=this.getSetting("prepend-archive-format",n),[d,f]=this.getSetting("date-format",n),p=d||f||li(this.app),[m,y]=this.getSetting("time-format",n),b=m||y||ra(this.app),x=`${p} ${b}`;u.setPlaceholder(x),u.setDefaultFormat(x),(l||c)&&u.setValue(l||c),u.onChange(D=>{D?this.applySettingsUpdate({"prepend-archive-format":{$set:D}}):this.applySettingsUpdate({$unset:["prepend-archive-format"]})})})}),new $e.Setting(t).setName(B("Calendar: first day of week")).setDesc(B("Override which day is used as the start of the week")).addDropdown(s=>{s.addOption("",B("default")),s.addOption("0",B("Sunday")),s.addOption("1",B("Monday")),s.addOption("2",B("Tuesday")),s.addOption("3",B("Wednesday")),s.addOption("4",B("Thursday")),s.addOption("5",B("Friday")),s.addOption("6",B("Saturday"));let[u,l]=this.getSetting("date-picker-week-start",n);s.setValue((u==null?void 0:u.toString())||(l==null?void 0:l.toString())||""),s.onChange(c=>{c?this.applySettingsUpdate({"date-picker-week-start":{$set:Number(c)}}):this.applySettingsUpdate({$unset:["date-picker-week-start"]})})}),t.createEl("br"),t.createEl("h4",{text:B("Linked Page Metadata")}),t.createEl("p",{cls:$("metadata-setting-desc"),text:B("Display metadata for the first note linked within a card. Specify which metadata keys to display below. An optional label can be provided, and labels can be hidden altogether.")}),new $e.Setting(t).then(s=>{s.settingEl.addClass($("draggable-setting-container"));let[u]=this.getSetting("metadata-keys",n),l=(u||[]).map(c=>({...ds,id:Re(),data:c,win:Ze(t)}));Zb(s.settingEl,t,l,c=>this.applySettingsUpdate({"metadata-keys":{$set:c.map(d=>d.data)}})),this.cleanupFns.push(()=>{s.settingEl&&ew(s.settingEl)})})}cleanUp(){this.win=null,this.cleanupFns.forEach(t=>t()),this.cleanupFns=[]}},qs=class extends $e.Modal{constructor(t,r,n){super(t.app);this.view=t,this.settingsManager=new Nd(t.plugin,r,n)}onOpen(){let{contentEl:t,modalEl:r}=this;r.addClass($("board-settings-modal")),this.settingsManager.constructUI(t,this.view.file.basename,!0)}onClose(){let{contentEl:t}=this;this.settingsManager.cleanUp(),t.empty()}},Od=class extends $e.PluginSettingTab{constructor(t,r){super(t.app,t);this.plugin=t,this.settingsManager=new Nd(t,r,t.settings)}display(){let{containerEl:t}=this;t.empty(),t.addClass($("board-settings-modal")),this.settingsManager.constructUI(t,B("Kanban Plugin"),!1)}};var yn="kanban",Ba="blocks",tr=class extends _w.TextFileView{constructor(t,r){super(t);this.actionButtons={};this.plugin=r,this.emitter=Ps(),this.emitter.on("hotkey",n=>{switch(n){case"daily-notes:goto-prev":{Rm(this.app,this.file);break}case"daily-notes:goto-next":{Om(this.app,this.file);break}}}),this.register(this.containerEl.onWindowMigrated(()=>{this.plugin.removeView(this),this.plugin.addView(this,this.data,this.isPrimary)}))}get isPrimary(){var t;return((t=this.plugin.getStateManager(this.file))==null?void 0:t.getAView())===this}get id(){var t;return`${this.leaf.id}:::${(t=this.file)==null?void 0:t.path}`}get isShiftPressed(){return this.plugin.isShiftPressed}setBoard(t,r=!0){this.plugin.stateManagers.get(this.file).setState(t,r)}getBoard(){return this.plugin.stateManagers.get(this.file).state}getViewType(){return yn}getIcon(){return Ba}getDisplayText(){var t;return((t=this.file)==null?void 0:t.basename)||"Kanban"}getWindow(){return Ze(this.containerEl)}async onLoadFile(t){try{return await super.onLoadFile(t)}catch(r){throw this.plugin.stateManagers.get(this.file).setError(r),r}}destroy(){this.plugin.removeView(this),Object.values(this.actionButtons).forEach(t=>t.remove()),this.actionButtons={}}async onClose(){this.destroy()}async onUnloadFile(t){return this.destroy(),await super.onUnloadFile(t)}handleRename(t,r){this.file.path===t&&this.plugin.handleViewFileRename(this,r)}requestSaveToDisk(t){this.data!==t&&this.isPrimary?(this.data=t,this.requestSave()):this.data=t}getViewData(){return this.data}setViewData(t,r){if(!Hm(t)){this.plugin.kanbanFileModes[this.leaf.id||this.file.path]="markdown",this.plugin.removeView(this),this.plugin.setMarkdownView(this.leaf,!1);return}this.plugin.addView(this,t,!r&&this.isPrimary)}getPortal(){let t=this.plugin.stateManagers.get(this.file);return g(Yb,{stateManager:t,view:this})}onPaneMenu(t,r,n=!0){if(r!=="more-options"){super.onPaneMenu(t,r);return}t.addItem(i=>{i.setTitle(B("Open as markdown")).setIcon("document").setSection("pane").onClick(()=>{this.plugin.kanbanFileModes[this.leaf.id||this.file.path]="markdown",this.plugin.setMarkdownView(this.leaf)})}).addItem(i=>{i.setTitle(B("Open board settings")).setIcon("gear").setSection("pane").onClick(()=>{let a=this.plugin.stateManagers.get(this.file),o=a.state;new qs(this,{onSettingsChange:s=>{let u=(0,Rd.default)(o,{data:{settings:{$set:s}}});a.setState(u)}},o.data.settings).open()})}).addItem(i=>{i.setTitle(B("Archive completed cards")).setIcon("sheets-in-box").setSection("pane").onClick(()=>{this.plugin.stateManagers.get(this.file).archiveCompletedCards()})}),n&&super.onPaneMenu(t,r)}initHeaderButtons(){let t=this.plugin.getStateManager(this.file);if(!!t)if(t.getSetting("show-board-settings")&&!this.actionButtons["show-board-settings"]?this.actionButtons["show-board-settings"]=this.addAction("gear",B("Open board settings"),()=>{let r=this.plugin.stateManagers.get(this.file),n=r.state;new qs(this,{onSettingsChange:i=>{let a=(0,Rd.default)(n,{data:{settings:{$set:i}}});r.setState(a)}},n.data.settings).open()}):!t.getSetting("show-board-settings")&&this.actionButtons["show-board-settings"]&&(this.actionButtons["show-board-settings"].remove(),delete this.actionButtons["show-board-settings"]),t.getSetting("show-search")&&!this.actionButtons["show-search"]?this.actionButtons["show-search"]=this.addAction("search",B("Search..."),()=>{this.emitter.emit("hotkey","editor:open-search")}):!t.getSetting("show-search")&&this.actionButtons["show-search"]&&(this.actionButtons["show-search"].remove(),delete this.actionButtons["show-search"]),t.getSetting("show-view-as-markdown")&&!this.actionButtons["show-view-as-markdown"]?this.actionButtons["show-view-as-markdown"]=this.addAction("document",B("Open as markdown"),()=>{this.plugin.kanbanFileModes[this.leaf.id||this.file.path]="markdown",this.plugin.setMarkdownView(this.leaf)}):!t.getSetting("show-view-as-markdown")&&this.actionButtons["show-view-as-markdown"]&&(this.actionButtons["show-view-as-markdown"].remove(),delete this.actionButtons["show-view-as-markdown"]),t.getSetting("show-archive-all")&&!this.actionButtons["show-archive-all"]?this.actionButtons["show-archive-all"]=this.addAction("sheets-in-box",B("Archive completed cards"),()=>{this.plugin.stateManagers.get(this.file).archiveCompletedCards()}):!t.getSetting("show-archive-all")&&this.actionButtons["show-archive-all"]&&(this.actionButtons["show-archive-all"].remove(),delete this.actionButtons["show-archive-all"]),t.getSetting("show-add-list")&&!this.actionButtons["show-add-list"]){let r=this.addAction("plus-with-circle",B("Add a list"),()=>{this.emitter.emit("showLaneForm",void 0)});r.addClass($("ignore-click-outside")),this.actionButtons["show-add-list"]=r}else!t.getSetting("show-add-list")&&this.actionButtons["show-add-list"]&&(this.actionButtons["show-add-list"].remove(),delete this.actionButtons["show-add-list"])}clear(){}};h();var $i=ge(xt()),$E=ge(require("obsidian"));h();h();var Hd={};zi(Hd,{JsonPatchError:()=>at,_areEquals:()=>Ua,applyOperation:()=>zr,applyPatch:()=>Zs,applyReducer:()=>M1,deepClone:()=>T1,getValueByPointer:()=>Xs,validate:()=>Tw,validator:()=>el});h();h();var _1=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),C1=Object.prototype.hasOwnProperty;function Ys(e,t){return C1.call(e,t)}function Js(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r=48&&n<=57){t++;continue}return!1}return!0}function Hn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ka(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qs(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;tArray.isArray(o.value)?o.value.join(" "):o.value.toString()).join(" ");n+=" "+i+" "+a}return n.toLocaleLowerCase()}function zC(e,t,r){var n,i,a;if(e.plugins.enabledPlugins.has("dataview")&&((a=(i=(n=e.plugins)==null?void 0:n.plugins)==null?void 0:i.dataview)==null?void 0:a.api))return e.plugins.plugins.dataview.api.page(t.path,r.path)}function Wb(e,t){if(!e)return null;if(e[t])return e[t];let r=t.split("."),n=e;for(let i of r)if(typeof n=="object"&&i in n)n=n[i];else{n=null;break}return n}function kd(e,t){let r=e.getSetting("metadata-keys");if(!r.length)return{};if(!t)return{};let n=e.app.metadataCache.getFileCache(t),i=zC(e.app,t,e.file);if(!n&&!i)return{};let a={},o={},s={},u=[],l=!1;return r.forEach(c=>{var p;if(s[c.metadataKey])return;if(s[c.metadataKey]=!0,c.metadataKey==="tags"){let m=(n==null?void 0:n.tags)||[];if(Array.isArray((p=n==null?void 0:n.frontmatter)==null?void 0:p.tags)&&(m=[].concat(m,n.frontmatter.tags.map(y=>({tag:`#${y}`})))),(m==null?void 0:m.length)===0)return;u.push(c.metadataKey),a.tags={...c,value:m.map(y=>y.tag).filter(y=>o[y]?!1:(o[y]=!0,!0))},l=!0;return}let d=Wb(n==null?void 0:n.frontmatter,c.metadataKey),f=Wb(i,c.metadataKey);if(d)u.push(c.metadataKey),a[c.metadataKey]={...c,value:d},l=!0;else if(f){let m=i[c.metadataKey],y=m.values||m.val||m;if(y===m&&typeof y=="object")y={...m};else if(!Array.isArray(y)&&typeof y!="string"&&typeof y!="number")return;u.push(c.metadataKey),a[c.metadataKey]={...c,value:y},l=!0}}),{fileMetadata:l?a:void 0,fileMetadataOrder:u}}function Vb(e,t){return!e&&t?!0:!["metadata-keys","date-trigger","time-trigger","link-date-to-daily-note","date-format","time-format","hide-date-in-title","hide-tags-in-title","hide-card-count"].every(n=>e[n]===t[n])}h();function zb({onNewLane:e,closeLaneForm:t}){let{boardModifiers:r,stateManager:n}=F.useContext(Ve),[i,a]=F.useState(!1),[o,s]=F.useState(""),u=F.useRef(),l=Li(()=>{t()},{ignoreClass:$("ignore-click-outside")});F.useLayoutEffect(()=>{var d;(d=u.current)==null||d.focus()},[]);let c=()=>{r.addLane({...wr,id:Re(),children:[],data:{...Wr(o),shouldMarkItemsComplete:i}}),s(""),a(!1),e()};return g("div",{ref:l,className:$("lane-form-wrapper")},g("div",{className:$("lane-input-wrapper")},g(Er,{ref:u,className:$("lane-input"),onChange:d=>s(d.target.value),onEnter:d=>{Xn(d,n)||(d.preventDefault(),c())},onSubmit:()=>{c()},onEscape:t,value:o})),g("div",{className:$("checkbox-wrapper")},g("div",{className:$("checkbox-label")},B("Mark cards in this list as complete")),g("div",{onClick:()=>a(!i),className:`checkbox-container ${i?"is-enabled":""}`})),g("div",{className:$("lane-input-actions")},g("button",{className:$("lane-action-add"),onClick:c},B("Add list")),g("button",{className:$("lane-action-cancel"),onClick:t},B("Cancel"))))}var jC=[Ge.Item,Ge.Lane],qC=[Ge.Lane],Yb=({view:e,stateManager:t})=>{let r=t.useState(),n=Fb(),i=F.useRef(null),a=F.useRef(null),[o,s]=F.useState(""),[u,l]=F.useState(!1),[c,d]=F.useState(""),[f,p]=F.useState((r==null?void 0:r.children.length)===0),m=t.file.path,y=t.useSetting("max-archive-size"),b=F.useCallback(()=>{(r==null?void 0:r.children.length)>0&&p(!1)},[r==null?void 0:r.children.length]);F.useEffect(()=>{(r==null?void 0:r.children.length)===0&&!t.hasError()&&p(!0)},[r==null?void 0:r.children.length,t]);let x=F.useCallback(()=>{var O;(O=i.current)==null||O.win.setTimeout(()=>{var z;let W=(z=i.current)==null?void 0:z.getElementsByClassName($("board"));(W==null?void 0:W.length)&&Cs([W[0].scrollWidth,0],{elementToScroll:W[0],speed:300,minDuration:150,easing:ee=>ee===1?1:1-Math.pow(2,-10*ee)})})},[]);F.useEffect(()=>{let O=z=>{z==="editor:open-search"&&l(ee=>!ee)},W=()=>{p(!0)};return e.emitter.on("hotkey",O),e.emitter.on("showLaneForm",W),()=>{e.emitter.off("hotkey",O),e.emitter.off("showLaneForm",W)}},[e]),F.useEffect(()=>{var O;u&&((O=a.current)==null||O.focus())},[u]),F.useEffect(()=>{let O=e.getWindow(),W=o.trim(),z;return W?z=O.setTimeout(()=>{d(W)},250):d(""),()=>{O.clearTimeout(z)}},[o,e]),F.useEffect(()=>{y===void 0||y===-1||typeof y=="number"&&(r==null?void 0:r.data.archive.length)>y&&t.setState(O=>(0,jb.default)(O,{data:{archive:{$set:O.data.archive.slice(y*-1)}}}))},[r==null?void 0:r.data.archive.length,y]);let D=F.useMemo(()=>Os(t),[t]),C=F.useCallback(O=>{let W=O.target;W.tagName==="A"&&W.hasClass("internal-link")&&e.app.workspace.trigger("hover-link",{event:O,source:gn,hoverParent:e,targetEl:W,linktext:W.getAttr("href"),sourcePath:e.file.path})},[e]),A=F.useCallback(async O=>{if(O.type==="auxclick"||O.button===2)return;let W=O.target,z=W.tagName==="A"?W:W.closest("a");if(!!z){if(z.hasClass("file-link")){O.preventDefault();let ee=z.getAttribute("href"),Z=Ur(ee),le=typeof ee=="string"&&e.app.metadataCache.getFirstLinkpathDest(Z.root,e.file.path);if(!le)return;t.app.openWithDefaultApp(le.path);return}if(z.hasClass("internal-link")){O.preventDefault();let ee=z.getAttr("href"),Z=O.button===1||O.ctrlKey||O.metaKey;if(z.hasClass("is-unresolved")&&(0,Hs.appHasDailyNotesPluginLoaded)()){let X=t.getSetting("date-format"),G=(0,qb.moment)(ee,X,!0);if(G.isValid()){try{let re=await(0,Hs.createDailyNote)(G);await(Z?app.workspace.getLeaf(!0):app.workspace.getLeaf(!1)).openFile(re,{active:!0})}catch(re){console.error(re),t.setError(re)}return}}t.app.workspace.openLinkText(ee,m,Z);return}if(z.hasClass("tag")){O.preventDefault(),t.app.internalPlugins.getPluginById("global-search").instance.openGlobalSearch(`tag:${z.getAttr("href")}`);return}z.hasClass("external-link")&&(O.preventDefault(),window.open(z.getAttr("href"),"_blank"))}},[t,m]),N=F.useMemo(()=>({view:e,stateManager:t,boardModifiers:D,filePath:m}),[e,t,D,m]),T=iv(t);return r==null?g("div",{className:$("loading")},g("div",{className:"sk-pulse"})):r.data.errors.length>0?g("div",null,g("div",null,"Error:"),r.data.errors.map((O,W)=>g("div",{key:W},g("div",null,O.description),g("pre",null,O.stack)))):g(Rs,{id:e.id},g(Ve.Provider,{value:N},g(po.Provider,{value:c?c.toLocaleLowerCase():null},g("div",{ref:i,className:mt([Nl,{"something-is-dragging":n}]),onMouseOver:C,onPointerDown:A,onClick:A,onAuxClick:A,...T},(f||r.children.length===0)&&g(zb,{onNewLane:x,closeLaneForm:b}),u&&g("div",{className:$("search-wrapper")},g("input",{ref:a,value:o,onChange:O=>{s(O.target.value)},onKeyDown:O=>{O.key==="Escape"&&(s(""),d(""),O.target.blur(),l(!1))},type:"text",className:$("filter-input"),placeholder:B("Search...")}),g("button",{className:$("search-cancel-button"),onClick:()=>{s(""),d(""),l(!1)},"aria-label":B("Cancel")},g(Kt,{name:"cross"}))),g(Ms,{id:e.id,className:mt([$("board"),$("horizontal"),{"is-adding-lane":f}]),triggerTypes:jC},g("div",null,g(Ii,{axis:"horizontal"},g(Lb,{lanes:r.children}),g(Ai,{className:$("lane-placeholder"),accepts:qC,index:r.children.length}))))))))};h();var xw=ge(xt()),$e=ge(require("obsidian"));h();var Gb=ge(Jb()),Ks=ge(xt()),kr=ge(require("obsidian"));var $s="@",Us="@@";function YC(e){let t=[];return kr.Vault.recurseChildren(e.vault.getRoot(),r=>{r instanceof kr.TFolder&&t.push({value:r.path,label:r.path,selected:!1,disabled:!1})}),t}function JC(e,t){let r=[],n=t?e.vault.getAbstractFileByPath(t):null;return(!n||!(n instanceof kr.TFolder))&&(n=e.vault.getRoot()),kr.Vault.recurseChildren(n,i=>{i instanceof kr.TFile&&r.push({value:i.path,label:i.basename,selected:!1,disabled:!1})}),r}function Qb(e){let{templateFolder:t,templatesEnabled:r,templaterPlugin:n}=Rl(e),i=JC(e,t),a=YC(e),o="";return!r&&!n&&(o=B("Note: No template plugins are currently enabled.")),{templateFiles:i,vaultFolders:a,templateWarning:o}}function _d({choices:e,key:t,warningText:r,local:n,placeHolderStr:i,manager:a}){return o=>{o.controlEl.createEl("select",{},s=>{s.win.setTimeout(()=>{let u=e,[l,c]=a.getSetting(t,n);if(c){let p=e.findIndex(y=>y.value===c),m=e[p];u=(0,Ks.default)(u,{$splice:[[p,1]],$unshift:[(0,Ks.default)(m,{placeholder:{$set:!0},value:{$set:""},label:{$apply:y=>`${y} (${B("default")})`}})]})}else u=(0,Ks.default)(u,{$unshift:[{placeholder:!0,value:"",label:i,selected:!1,disabled:!1}]});let d=new Gb.default(s,{placeholder:!0,position:"bottom",searchPlaceholderValue:B("Search..."),searchEnabled:u.length>10,choices:u}).setChoiceByValue("");l&&typeof l=="string"&&d.setChoiceByValue(l);let f=p=>{let m=p.detail.value;m?a.applySettingsUpdate({[t]:{$set:m}}):a.applySettingsUpdate({$unset:[t]})};s.addEventListener("change",f),a.cleanupFns.push(()=>{d.destroy(),s.removeEventListener("change",f)})}),r&&o.descEl.createDiv({},u=>{u.createEl("strong",{text:r})})})}}h();var Vr=ge(xt());function Xb({isStatic:e,itemIndex:t,item:r,toggleShouldHideLabel:n,toggleContainsMarkdown:i,deleteKey:a,updateKey:o,updateLabel:s}){let u=F.useRef(null),l=F.useRef(null),c=F.useRef(null);Ti(l,c);let d=g("div",{className:$("setting-controls-wrapper")},g("div",{className:$("setting-input-wrapper")},g("div",null,g("div",{className:$("setting-item-label")},B("Metadata key")),g("input",{type:"text",value:r.data.metadataKey,onChange:f=>o(f.target.value)})),g("div",null,g("div",{className:$("setting-item-label")},B("Display label")),g("input",{type:"text",value:r.data.label,onChange:f=>s(f.target.value)}))),g("div",{className:$("setting-toggle-wrapper")},g("div",null,g("div",{className:`checkbox-container ${r.data.shouldHideLabel?"is-enabled":""}`,onClick:n,"aria-label":B("Hide label")}),g("div",{className:$("setting-item-label")},B("Hide label"))),g("div",null,g("div",{className:`checkbox-container ${r.data.containsMarkdown?"is-enabled":""}`,onClick:i,"aria-label":B("Field contains markdown")}),g("div",{className:$("setting-item-label")},B("Field contains markdown")))));return g("div",{ref:l,className:$("setting-item-wrapper")},g("div",{ref:u,className:$("setting-item")},e?d:g(hr,{elementRef:u,measureRef:l,id:r.id,index:t,data:r},d),g("div",{className:$("setting-button-wrapper")},g("div",{onClick:a,"aria-label":B("Delete")},g(Kt,{name:"cross"})),g("div",{className:"mobile-option-setting-drag-icon","aria-label":B("Drag to rearrange"),ref:c},g(Kt,{name:"three-horizontal-bars"})))))}function GC({onChange:e,inputValue:t,keys:r,setKeys:n}){let i=a=>{e(a),n(a)};return{updateKey:a=>o=>{i((0,Vr.default)(r,{[a]:{data:{metadataKey:{$set:o}}}}))},updateLabel:a=>o=>{i((0,Vr.default)(r,{[a]:{data:{label:{$set:o}}}}))},toggleShouldHideLabel:a=>()=>{i((0,Vr.default)(r,{[a]:{data:{$toggle:["shouldHideLabel"]}}}))},toggleContainsMarkdown:a=>()=>{i((0,Vr.default)(r,{[a]:{data:{$toggle:["containsMarkdown"]}}}))},deleteKey:a=>()=>{i((0,Vr.default)(r,{$splice:[[a,1]]}))},newKey:()=>{i((0,Vr.default)(r,{$push:[{...ds,id:Re(),data:{metadataKey:t,label:"",shouldHideLabel:!1,containsMarkdown:!1}}]}))},moveKey:(a,o)=>{let s=a.getPath(),u=o.getPath(),l=s[s.length-1],c=u[u.length-1];if(l===c)return;let d=r.slice(),[f]=d.splice(l,1);d.splice(c,0,f),i(d)}}}var QC=[Ge.MetadataSetting];function XC({keys:e,portalContainer:t}){return F.createPortal(g(Ns,null,(r,n)=>{let a=r.getPath()[0],o=e[a];return g("div",{className:$("drag-container"),style:n},g(Xb,{item:o,itemIndex:a,updateKey:si,updateLabel:si,toggleShouldHideLabel:si,toggleContainsMarkdown:si,deleteKey:si,isStatic:!0}))}),t)}function ZC({scrollEl:e}){let t=F.useContext(kt);return F.useEffect(()=>{let r=0,n=()=>{e.win.clearTimeout(r),r=e.win.setTimeout(()=>{t.hitboxEntities.forEach(i=>{i.recalcInitial()})},100)};return e.addEventListener("scroll",n,{passive:!0,capture:!1}),()=>{e.removeEventListener("scroll",n)}},[e,t]),null}function e1(e){let[t,r]=F.useState(e.dataKeys),[n,i]=F.useState(""),{getShouldIMEBlockAction:a,...o}=go(),s=Ze(e.scrollEl),{updateKey:u,updateLabel:l,toggleShouldHideLabel:c,toggleContainsMarkdown:d,deleteKey:f,newKey:p,moveKey:m}=GC({onChange:e.onChange,inputValue:n,keys:t,setKeys:r,win:s});return g(S,null,g(Fs,{win:s,onDrop:m},g(ZC,{scrollEl:e.scrollEl}),g(Rs,null,g(Ii,{axis:"vertical"},t.map((y,b)=>g(Xb,{key:y.id,item:y,itemIndex:b,updateKey:u(b),updateLabel:l(b),toggleShouldHideLabel:c(b),toggleContainsMarkdown:d(b),deleteKey:f(b)})),g(Ai,{accepts:QC,index:t.length}))),g(XC,{keys:t,portalContainer:e.portalContainer})),g("div",{className:$("setting-key-input-wrapper")},g("input",{placeholder:B("Metadata key"),type:"text",value:n,onChange:y=>i(y.target.value),onKeyDown:y=>{if(!a()){if(y.key==="Enter"){p(),i("");let b=y.target;b.win.setTimeout(()=>{b.scrollIntoView()});return}y.key==="Escape"&&(i(""),y.target.blur())}},...o}),g("button",{onClick:y=>{p(),i("");let b=y.target;b.win.setTimeout(()=>{b.scrollIntoView()})}},B("Add key"))))}function Zb(e,t,r,n){F.render(g(e1,{dataKeys:r,scrollEl:t,onChange:n,portalContainer:ai(e)}),e)}function ew(e){F.unmountComponentAtNode(e)}h();h();var t1={grad:.9,turn:360,rad:360/(2*Math.PI)},er=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},_t=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},vn=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},tw=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},nw=function(e){return{r:vn(e.r,0,255),g:vn(e.g,0,255),b:vn(e.b,0,255),a:vn(e.a)}},Cd=function(e){return{r:_t(e.r),g:_t(e.g),b:_t(e.b),a:_t(e.a,3)}},n1=/^#([0-9a-f]{3,8})$/i,Ws=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rw=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},iw=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),u=n*(1-(1-t+a)*r),l=a%6;return{r:255*[n,s,o,o,u,n][l],g:255*[u,n,n,s,o,o][l],b:255*[o,o,u,n,n,s][l],a:i}},aw=function(e){return{h:tw(e.h),s:vn(e.s,0,100),l:vn(e.l,0,100),a:vn(e.a)}},ow=function(e){return{h:_t(e.h),s:_t(e.s),l:_t(e.l),a:_t(e.a,3)}},sw=function(e){return iw((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},Ra=function(e){return{h:(t=rw(e)).h,s:(i=(200-(r=t.s))*(n=t.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,r,n,i},r1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,i1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,a1=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,o1=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lw={string:[[function(e){var t=n1.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?_t(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?_t(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=a1.exec(e)||o1.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:nw({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=r1.exec(e)||i1.exec(e);if(!t)return null;var r,n,i=aw({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(t1[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return sw(i)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i===void 0?1:i;return er(t)&&er(r)&&er(n)?nw({r:Number(t),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,i=e.a,a=i===void 0?1:i;if(!er(t)||!er(r)||!er(n))return null;var o=aw({h:Number(t),s:Number(r),l:Number(n),a:Number(a)});return sw(o)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,i=e.a,a=i===void 0?1:i;if(!er(t)||!er(r)||!er(n))return null;var o=function(s){return{h:tw(s.h),s:vn(s.s,0,100),v:vn(s.v,0,100),a:vn(s.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(a)});return iw(o)},"hsv"]]},cw=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=Cd(this.rgba),r=t.r,n=t.g,i=t.b,o=(a=t.a)<1?Ws(_t(255*a)):"","#"+Ws(r)+Ws(n)+Ws(i)+o;var t,r,n,i,a,o},e.prototype.toRgb=function(){return Cd(this.rgba)},e.prototype.toRgbString=function(){return t=Cd(this.rgba),r=t.r,n=t.g,i=t.b,(a=t.a)<1?"rgba("+r+", "+n+", "+i+", "+a+")":"rgb("+r+", "+n+", "+i+")";var t,r,n,i,a},e.prototype.toHsl=function(){return ow(Ra(this.rgba))},e.prototype.toHslString=function(){return t=ow(Ra(this.rgba)),r=t.h,n=t.s,i=t.l,(a=t.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+a+")":"hsl("+r+", "+n+"%, "+i+"%)";var t,r,n,i,a},e.prototype.toHsv=function(){return t=rw(this.rgba),{h:_t(t.h),s:_t(t.s),v:_t(t.v),a:_t(t.a,3)};var t},e.prototype.invert=function(){return In({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),In(Td(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),In(Td(this.rgba,-t))},e.prototype.grayscale=function(){return In(Td(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),In(uw(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),In(uw(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?In({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):_t(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=Ra(this.rgba);return typeof t=="number"?In({h:t,s:r.s,l:r.l,a:r.a}):_t(r.h)},e.prototype.isEqual=function(t){return this.toHex()===In(t).toHex()},e}(),In=function(e){return e instanceof dw?e:new dw(e)};var js=ge(xt());h();function Vs(){return(Vs=Object.assign||function(e){for(var t=1;t=0||(i[r]=e[r]);return i}function Md(e){var t=Xt(e),r=Xt(function(n){t.current&&t.current(n)});return t.current=e,r.current}var Pi=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e0:b.buttons>0)&&i.current?a(pw(i.current,b,s.current)):y(!1)},m=function(){return y(!1)};function y(b){var x=u.current,D=Id(i.current),C=b?D.addEventListener:D.removeEventListener;C(x?"touchmove":"mousemove",p),C(x?"touchend":"mouseup",m)}return[function(b){var x=b.nativeEvent,D=i.current;if(D&&(hw(x),!function(A,N){return N&&!Ha(A)}(x,u.current)&&D)){if(Ha(x)){u.current=!0;var C=x.changedTouches||[];C.length&&(s.current=C[0].identifier)}D.focus(),a(pw(D,x,s.current)),y(!0)}},function(b){var x=b.which||b.keyCode;x<37||x>40||(b.preventDefault(),o({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},y]},[o,a]),c=l[0],d=l[1],f=l[2];return Sn(function(){return f},[f]),it.createElement("div",Vs({},n,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),zs=function(e){return e.filter(Boolean).join(" ")},Ld=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,a=zs(["react-colorful__pointer",e.className]);return it.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},it.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Yt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},t$={grad:.9,turn:360,rad:360/(2*Math.PI)};var mw=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:Yt(e.h),s:Yt(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:Yt(i/2),a:Yt(n,2)}},Pd=function(e){var t=mw(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Fd=function(e){var t=mw(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},l1=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),u=n*(1-(1-t+a)*r),l=a%6;return{r:Yt(255*[n,s,o,o,u,n][l]),g:Yt(255*[u,n,n,s,o,o][l]),b:Yt(255*[o,o,u,n,n,s][l]),a:Yt(i,2)}};var c1=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?u1({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}};var u1=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:Yt(60*(s<0?s+6:s)),s:Yt(a?o/a*100:0),v:Yt(a/255*100),a:i}};var d1=it.memo(function(e){var t=e.hue,r=e.onChange,n=zs(["react-colorful__hue",e.className]);return it.createElement("div",{className:n},it.createElement(Ad,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:Pi(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Yt(t),"aria-valuemax":"360","aria-valuemin":"0"},it.createElement(Ld,{className:"react-colorful__hue-pointer",left:t/360,color:Pd({h:t,s:100,v:100,a:1})})))}),f1=it.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:Pd({h:t.h,s:100,v:100,a:1})};return it.createElement("div",{className:"react-colorful__saturation",style:n},it.createElement(Ad,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:Pi(t.s+100*i.left,0,100),v:Pi(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Yt(t.s)+"%, Brightness "+Yt(t.v)+"%"},it.createElement(Ld,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Pd(t)})))}),p1=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},h1=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function m1(e,t,r){var n=Md(r),i=sr(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=Xt({color:t,hsva:a});Sn(function(){if(!e.equal(t,s.current.color)){var l=e.toHsva(t);s.current={hsva:l,color:t},o(l)}},[t,e]),Sn(function(){var l;p1(a,s.current.hsva)||e.equal(l=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:l},n(l))},[a,e,n]);var u=cr(function(l){o(function(c){return Object.assign({},c,l)})},[]);return[a,u]}var g1,v1=typeof window!="undefined"?Ir:Sn,y1=function(){return g1||(typeof __webpack_nonce__!="undefined"?__webpack_nonce__:void 0)};var gw=new Map,b1=function(e){v1(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!gw.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,gw.set(t,r);var n=y1();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])};var w1=function(e){var t=e.className,r=e.hsva,n=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+Fd(Object.assign({},r,{a:0}))+", "+Fd(Object.assign({},r,{a:1}))+")"},a=zs(["react-colorful__alpha",t]),o=Yt(100*r.a);return it.createElement("div",{className:a},it.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),it.createElement(Ad,{onMove:function(s){n({a:s.left})},onKey:function(s){n({a:Pi(r.a+s.left)})},"aria-label":"Alpha","aria-valuetext":o+"%","aria-valuenow":o,"aria-valuemin":"0","aria-valuemax":"100"},it.createElement(Ld,{className:"react-colorful__alpha-pointer",left:r.a,color:Fd(r)})))},E1=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,a=e.onChange,o=fw(e,["className","colorModel","color","onChange"]),s=Xt(null);b1(s);var u=m1(r,i,a),l=u[0],c=u[1],d=zs(["react-colorful",t]);return it.createElement("div",Vs({},o,{ref:s,className:d}),it.createElement(f1,{hsva:l,onChange:c}),it.createElement(d1,{hue:l.h,onChange:c}),it.createElement(w1,{hsva:l,onChange:c,className:"react-colorful__last-control"}))};var x1={defaultColor:"rgba(0, 0, 0, 1)",toHsva:c1,fromHsva:function(e){var t=l1(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:h1},vw=function(e){return it.createElement(E1,Vs({},e,{colorModel:x1}))};function yw(e){let t=In(e);if(!t.isValid())return null;let r=t.toRgb();return{rgba:`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`,hexa:t.toHex()}}function bw({color:e,setColor:t,defaultColor:r}){let[n,i]=F.useState(e||r),[a,o]=F.useState(e||r),[s,u]=F.useState(!1),l=F.useCallback(d=>{let f=yw(d||r);f&&(o(f.hexa),i(f.rgba),t(f.rgba))},[t]);F.useEffect(()=>{if(!e||!r)return;let d=yw(e||r);d&&(i(d.rgba),o(d.hexa))},[]);let c=Li(()=>{u(!1)});return g("div",{ref:c,className:$("color-picker-wrapper")},s&&g("div",{className:$("color-picker")},g(vw,{color:n,onChange:l})),g("input",{type:"text",value:a,onChange:d=>l(d.target.value),onFocus:()=>{u(!0)}}))}function k1({tagColorKey:e,deleteKey:t,updateKey:r,defaultColors:n}){return g("div",{className:$("setting-item-wrapper")},g("div",{className:$("setting-item")},g("div",{className:`${$("setting-controls-wrapper")} ${$("tag-color-input")}`},g("div",{className:$("setting-input-wrapper")},g("div",null,g("div",{className:$("setting-item-label")},B("Tag")),g("input",{type:"text",placeholder:"#tag",value:e.tagKey,onChange:i=>{r(i.currentTarget.value,e.color,e.backgroundColor)}})),g("div",null,g("div",{className:$("setting-item-label")},B("Background color")),g(bw,{color:e.backgroundColor,setColor:i=>{r(e.tagKey,e.color,i)},defaultColor:n.backgroundColor})),g("div",null,g("div",{className:$("setting-item-label")},B("Text color")),g(bw,{color:e.color,setColor:i=>{r(e.tagKey,i,e.backgroundColor)},defaultColor:n.color}))),g("div",{className:$("setting-toggle-wrapper")},g("div",null,g("div",{className:$("item-tags")},g("a",{className:`tag ${$("item-tag")}`},"#tag1"),g("a",{className:`tag ${$("item-tag")}`,style:{"--tag-color":e.color,"--tag-background-color":e.backgroundColor}},e.tagKey),g("a",{className:`tag ${$("item-tag")}`},"#tag2"))))),g("div",{className:$("setting-button-wrapper")},g("div",{onClick:t,"aria-label":B("Delete")},g(Kt,{name:"cross"})))))}function S1({dataKeys:e,onChange:t}){let[r,n]=F.useState(e),i=F.useMemo(()=>{let l=createDiv($("item-tags")),c=l.createEl("a",$("item-tag"));l.style.position="absolute",l.style.visibility="hidden",activeDocument.body.append(l);let d=activeWindow.getComputedStyle(c),f=d.getPropertyValue("color").trim(),p=d.getPropertyValue("background-color").trim();return l.remove(),{color:f,backgroundColor:p}},[]),a=l=>{t(l),n(l)},o=()=>{a((0,js.default)(r,{$push:[{...fs,id:Re(),data:{tagKey:"",color:"",backgroundColor:""}}]}))},s=l=>{a((0,js.default)(r,{$splice:[[l,1]]}))},u=l=>(c,d,f)=>{a((0,js.default)(r,{[l]:{data:{tagKey:{$set:c},color:{$set:d},backgroundColor:{$set:f}}}}))};return g("div",{className:$("tag-color-input-wrapper")},g("div",{className:"setting-item-info"},g("div",{className:"setting-item-name"},B("Display tag colors")),g("div",{className:"setting-item-description"},B("Set colors for the tags displayed below the card title."))),r.map((l,c)=>g(k1,{key:l.id,tagColorKey:l.data,deleteKey:()=>s(c),updateKey:u(c),defaultColors:i})),g("button",{className:$("add-tag-color-button"),onClick:()=>{o()}},B("Add tag color")))}function ww(e,t,r){F.render(g(S1,{dataKeys:t,onChange:r,portalContainer:ai(e)}),e)}function Ew(e){F.unmountComponentAtNode(e)}var kw=/^\d+(?:\.\d+)?$/,Sw={[gn]:!0,"date-display-format":!0,"date-format":!0,"date-picker-week-start":!0,"date-time-display-format":!0,"date-trigger":!0,"hide-card-count":!0,"hide-date-display":!0,"hide-date-in-title":!0,"hide-tags-display":!0,"hide-tags-in-title":!0,"lane-width":!0,"link-date-to-daily-note":!0,"max-archive-size":!0,"metadata-keys":!0,"new-card-insertion-method":!0,"new-line-trigger":!0,"new-note-folder":!0,"new-note-template":!0,"prepend-archive-date":!0,"prepend-archive-format":!0,"prepend-archive-separator":!0,"show-checkboxes":!0,"show-relative-date":!0,"time-format":!0,"time-trigger":!0,"show-add-list":!0,"show-archive-all":!0,"show-view-as-markdown":!0,"show-board-settings":!0,"show-search":!0,"tag-colors":!0},Nd=class{constructor(t,r,n){this.cleanupFns=[];this.applyDebounceTimer=0;this.app=t.app,this.plugin=t,this.config=r,this.settings=n}applySettingsUpdate(t){this.win.clearTimeout(this.applyDebounceTimer),this.applyDebounceTimer=this.win.setTimeout(()=>{this.settings=(0,xw.default)(this.settings,t),this.config.onSettingsChange(this.settings)},200)}getSetting(t,r){return r?[this.settings[t],this.plugin.settings[t]]:[this.settings[t],null]}constructUI(t,r,n){this.win=t.win;let{templateFiles:i,vaultFolders:a,templateWarning:o}=Qb(this.app);t.createEl("h3",{text:r}),n?t.createEl("p",{text:B("These settings will take precedence over the default Kanban board settings.")}):t.createEl("p",{text:B("Set the default Kanban board settings. Settings can be overridden on a board-by-board basis.")}),new $e.Setting(t).setName(B("New line trigger")).setDesc(B("Select whether Enter or Shift+Enter creates a new line. The opposite of what you choose will create and complete editing of cards and lists.")).addDropdown(s=>{s.addOption("shift-enter",B("Shift + Enter")),s.addOption("enter",B("Enter"));let[u,l]=this.getSetting("new-line-trigger",n);s.setValue(u||l||"shift-enter"),s.onChange(c=>{this.applySettingsUpdate({"new-line-trigger":{$set:c}})})}),new $e.Setting(t).setName(B("Prepend / append new cards")).setDesc(B("This setting controls whether new cards are added to the beginning or end of the list.")).addDropdown(s=>{s.addOption("prepend",B("Prepend")),s.addOption("prepend-compact",B("Prepend (compact)")),s.addOption("append",B("Append"));let[u,l]=this.getSetting("new-card-insertion-method",n);s.setValue(u||l||"append"),s.onChange(c=>{this.applySettingsUpdate({"new-card-insertion-method":{$set:c}})})}),new $e.Setting(t).setName(B("Note template")).setDesc(B("This template will be used when creating new notes from Kanban cards.")).then(_d({choices:i,key:"new-note-template",warningText:o,local:n,placeHolderStr:B("No template"),manager:this})),new $e.Setting(t).setName(B("Note folder")).setDesc(B("Notes created from Kanban cards will be placed in this folder. If blank, they will be placed in the default location for this vault.")).then(_d({choices:a,key:"new-note-folder",local:n,placeHolderStr:B("Default folder"),manager:this})),new $e.Setting(t).setName(B("Hide card counts in list titles")).setDesc(B("When toggled, card counts are hidden from the list title")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-card-count",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-card-count":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-card-count",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-card-count"]})})})}),new $e.Setting(t).setName(B("List width")).setDesc(B("Enter a number to set the list width in pixels.")).addText(s=>{let[u,l]=this.getSetting("lane-width",n);s.inputEl.setAttr("type","number"),s.inputEl.placeholder=`${l||"272"} (default)`,s.inputEl.value=u?u.toString():"",s.onChange(c=>{if(c&&kw.test(c)){s.inputEl.removeClass("error"),this.applySettingsUpdate({"lane-width":{$set:parseInt(c)}});return}c&&s.inputEl.addClass("error"),this.applySettingsUpdate({$unset:["lane-width"]})})}),new $e.Setting(t).setName(B("Maximum number of archived cards")).setDesc(B("Archived cards can be viewed in markdown mode. This setting will begin removing old cards once the limit is reached. Setting this value to -1 will allow a board's archive to grow infinitely.")).addText(s=>{let[u,l]=this.getSetting("max-archive-size",n);s.inputEl.setAttr("type","number"),s.inputEl.placeholder=`${l||"-1"} (default)`,s.inputEl.value=u?u.toString():"",s.onChange(c=>{if(c&&kw.test(c)){s.inputEl.removeClass("error"),this.applySettingsUpdate({"max-archive-size":{$set:parseInt(c)}});return}c&&s.inputEl.addClass("error"),this.applySettingsUpdate({$unset:["max-archive-size"]})})}),new $e.Setting(t).setName(B("Display card checkbox")).setDesc(B("When toggled, a checkbox will be displayed with each card")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-checkboxes",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"show-checkboxes":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-checkboxes",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-checkboxes"]})})})}),new $e.Setting(t).setName(B("Hide tags in card titles")).setDesc(B("When toggled, tags will be hidden card titles. This will prevent tags from being included in the title when creating new notes.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-tags-in-title",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-tags-in-title":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-tags-in-title",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-tags-in-title"]})})})}),new $e.Setting(t).setName(B("Hide card display tags")).setDesc(B("When toggled, tags will not be displayed below the card title.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-tags-display",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-tags-display":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-tags-display",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-tags-display"]})})})}),new $e.Setting(t).setName(B("Display tag colors")).setDesc(B("Set colors for the tags displayed below the card title.")).then(s=>{let[u]=this.getSetting("tag-colors",n),l=(u||[]).map(c=>({...fs,id:Re(),data:c}));ww(s.settingEl,l,c=>this.applySettingsUpdate({"tag-colors":{$set:c.map(d=>d.data)}})),this.cleanupFns.push(()=>{s.settingEl&&Ew(s.settingEl)})}),t.createEl("h4",{text:B("Board Header Buttons")}),new $e.Setting(t).setName(B("Add a list")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-add-list",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-add-list":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-add-list",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-add-list"]})})})}),new $e.Setting(t).setName(B("Archive completed cards")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-archive-all",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-archive-all":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-archive-all",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-archive-all"]})})})}),new $e.Setting(t).setName(B("Open as markdown")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-view-as-markdown",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-view-as-markdown":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-view-as-markdown",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-view-as-markdown"]})})})}),new $e.Setting(t).setName(B("Open board settings")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-board-settings",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-board-settings":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-board-settings",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-board-settings"]})})})}),new $e.Setting(t).setName(B("Search...")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-search",n);c!=null?l.setValue(c):d!=null?l.setValue(d):l.setValue(!0),l.onChange(f=>{this.applySettingsUpdate({"show-search":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-search",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-search"]})})})}),t.createEl("h4",{text:B("Date & Time")}),new $e.Setting(t).setName(B("Date trigger")).setDesc(B("When this is typed, it will trigger the date selector")).addText(s=>{let[u,l]=this.getSetting("date-trigger",n);(u||l)&&s.setValue(u||l),s.setPlaceholder(l||$s),s.onChange(c=>{c?this.applySettingsUpdate({"date-trigger":{$set:c}}):this.applySettingsUpdate({$unset:["date-trigger"]})})}),new $e.Setting(t).setName(B("Time trigger")).setDesc(B("When this is typed, it will trigger the time selector")).addText(s=>{let[u,l]=this.getSetting("time-trigger",n);(u||l)&&s.setValue(u||l),s.setPlaceholder(l||Us),s.onChange(c=>{c?this.applySettingsUpdate({"time-trigger":{$set:c}}):this.applySettingsUpdate({$unset:["time-trigger"]})})}),new $e.Setting(t).setName(B("Date format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(f=>{f.appendText(B("This format will be used when saving dates in markdown.")),f.createEl("br"),f.appendText(B("For more syntax, refer to")+" "),f.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},p=>{p.setAttr("target","_blank")}),f.createEl("br"),f.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(f.createEl("b",{cls:"u-pop"})),f.createEl("br")}));let[l,c]=this.getSetting("date-format",n),d=li(this.app);u.setPlaceholder(d),u.setDefaultFormat(d),(l||c)&&u.setValue(l||c),u.onChange(f=>{f?this.applySettingsUpdate({"date-format":{$set:f}}):this.applySettingsUpdate({$unset:["date-format"]})})})}),new $e.Setting(t).setName(B("Time format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(f=>{f.appendText(B("For more syntax, refer to")+" "),f.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},p=>{p.setAttr("target","_blank")}),f.createEl("br"),f.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(f.createEl("b",{cls:"u-pop"})),f.createEl("br")}));let[l,c]=this.getSetting("time-format",n),d=ra(this.app);u.setPlaceholder(d),u.setDefaultFormat(d),(l||c)&&u.setValue(l||c),u.onChange(f=>{f?this.applySettingsUpdate({"time-format":{$set:f}}):this.applySettingsUpdate({$unset:["time-format"]})})})}),new $e.Setting(t).setName(B("Date display format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(f=>{f.appendText(B("This format will be used when displaying dates in Kanban cards.")),f.createEl("br"),f.appendText(B("For more syntax, refer to")+" "),f.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},p=>{p.setAttr("target","_blank")}),f.createEl("br"),f.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(f.createEl("b",{cls:"u-pop"})),f.createEl("br")}));let[l,c]=this.getSetting("date-display-format",n),d=li(this.app);u.setPlaceholder(d),u.setDefaultFormat(d),(l||c)&&u.setValue(l||c),u.onChange(f=>{f?this.applySettingsUpdate({"date-display-format":{$set:f}}):this.applySettingsUpdate({$unset:["date-display-format"]})})})}),new $e.Setting(t).setName(B("Show relative date")).setDesc(B("When toggled, cards will display the distance between today and the card's date. eg. 'In 3 days', 'A month ago'")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("show-relative-date",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"show-relative-date":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("show-relative-date",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["show-relative-date"]})})})}),new $e.Setting(t).setName(B("Hide card display dates")).setDesc(B("When toggled, formatted dates will not be displayed on the card. Relative dates will still be displayed if they are enabled.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-date-display",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-date-display":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-date-display",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-date-display"]})})})}),new $e.Setting(t).setName(B("Hide dates in card titles")).setDesc(B("When toggled, dates will be hidden card titles. This will prevent dates from being included in the title when creating new notes.")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("hide-date-in-title",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"hide-date-in-title":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("hide-date-in-title",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["hide-date-in-title"]})})})}),new $e.Setting(t).setName(B("Link dates to daily notes")).setDesc(B("When toggled, dates will link to daily notes. Eg. [[2021-04-26]]")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("link-date-to-daily-note",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"link-date-to-daily-note":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("link-date-to-daily-note",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["link-date-to-daily-note"]})})})}),new $e.Setting(t).setName(B("Add date and time to archived cards")).setDesc(B("When toggled, the current date and time will be added to the beginning of a card when it is archived. Eg. - [ ] 2021-05-14 10:00am My card title")).then(s=>{let u;s.addToggle(l=>{u=l;let[c,d]=this.getSetting("prepend-archive-date",n);c!==void 0?l.setValue(c):d!==void 0&&l.setValue(d),l.onChange(f=>{this.applySettingsUpdate({"prepend-archive-date":{$set:f}})})}).addExtraButton(l=>{l.setIcon("reset").setTooltip(B("Reset to default")).onClick(()=>{let[,c]=this.getSetting("prepend-archive-date",n);u.setValue(!!c),this.applySettingsUpdate({$unset:["prepend-archive-date"]})})})}),new $e.Setting(t).setName(B("Archive date/time separator")).setDesc(B("This will be used to separate the archived date/time from the title")).addText(s=>{let[u,l]=this.getSetting("prepend-archive-separator",n);s.inputEl.placeholder=l?`${l} (default)`:"",s.inputEl.value=u||"",s.onChange(c=>{if(c){this.applySettingsUpdate({"prepend-archive-separator":{$set:c}});return}this.applySettingsUpdate({$unset:["prepend-archive-separator"]})})}),new $e.Setting(t).setName(B("Archive date/time format")).then(s=>{s.addMomentFormat(u=>{s.descEl.appendChild(createFragment(D=>{D.appendText(B("For more syntax, refer to")+" "),D.createEl("a",{text:B("format reference"),href:"https://momentjs.com/docs/#/displaying/format/"},C=>{C.setAttr("target","_blank")}),D.createEl("br"),D.appendText(B("Your current syntax looks like this")+": "),u.setSampleEl(D.createEl("b",{cls:"u-pop"})),D.createEl("br")}));let[l,c]=this.getSetting("prepend-archive-format",n),[d,f]=this.getSetting("date-format",n),p=d||f||li(this.app),[m,y]=this.getSetting("time-format",n),b=m||y||ra(this.app),x=`${p} ${b}`;u.setPlaceholder(x),u.setDefaultFormat(x),(l||c)&&u.setValue(l||c),u.onChange(D=>{D?this.applySettingsUpdate({"prepend-archive-format":{$set:D}}):this.applySettingsUpdate({$unset:["prepend-archive-format"]})})})}),new $e.Setting(t).setName(B("Calendar: first day of week")).setDesc(B("Override which day is used as the start of the week")).addDropdown(s=>{s.addOption("",B("default")),s.addOption("0",B("Sunday")),s.addOption("1",B("Monday")),s.addOption("2",B("Tuesday")),s.addOption("3",B("Wednesday")),s.addOption("4",B("Thursday")),s.addOption("5",B("Friday")),s.addOption("6",B("Saturday"));let[u,l]=this.getSetting("date-picker-week-start",n);s.setValue((u==null?void 0:u.toString())||(l==null?void 0:l.toString())||""),s.onChange(c=>{c?this.applySettingsUpdate({"date-picker-week-start":{$set:Number(c)}}):this.applySettingsUpdate({$unset:["date-picker-week-start"]})})}),t.createEl("br"),t.createEl("h4",{text:B("Linked Page Metadata")}),t.createEl("p",{cls:$("metadata-setting-desc"),text:B("Display metadata for the first note linked within a card. Specify which metadata keys to display below. An optional label can be provided, and labels can be hidden altogether.")}),new $e.Setting(t).then(s=>{s.settingEl.addClass($("draggable-setting-container"));let[u]=this.getSetting("metadata-keys",n),l=(u||[]).map(c=>({...ds,id:Re(),data:c,win:Ze(t)}));Zb(s.settingEl,t,l,c=>this.applySettingsUpdate({"metadata-keys":{$set:c.map(d=>d.data)}})),this.cleanupFns.push(()=>{s.settingEl&&ew(s.settingEl)})})}cleanUp(){this.win=null,this.cleanupFns.forEach(t=>t()),this.cleanupFns=[]}},qs=class extends $e.Modal{constructor(t,r,n){super(t.app);this.view=t,this.settingsManager=new Nd(t.plugin,r,n)}onOpen(){let{contentEl:t,modalEl:r}=this;r.addClass($("board-settings-modal")),this.settingsManager.constructUI(t,this.view.file.basename,!0)}onClose(){let{contentEl:t}=this;this.settingsManager.cleanUp(),t.empty()}},Od=class extends $e.PluginSettingTab{constructor(t,r){super(t.app,t);this.plugin=t,this.settingsManager=new Nd(t,r,t.settings)}display(){let{containerEl:t}=this;t.empty(),t.addClass($("board-settings-modal")),this.settingsManager.constructUI(t,B("Kanban Plugin"),!1)}};var yn="kanban",Ba="blocks",tr=class extends _w.TextFileView{constructor(t,r){super(t);this.actionButtons={};this.plugin=r,this.emitter=Ps(),this.emitter.on("hotkey",n=>{switch(n){case"daily-notes:goto-prev":{Rm(this.app,this.file);break}case"daily-notes:goto-next":{Om(this.app,this.file);break}}}),this.register(this.containerEl.onWindowMigrated(()=>{this.plugin.removeView(this),this.plugin.addView(this,this.data,this.isPrimary)}))}get isPrimary(){var t;return((t=this.plugin.getStateManager(this.file))==null?void 0:t.getAView())===this}get id(){var t;return`${this.leaf.id}:::${(t=this.file)==null?void 0:t.path}`}get isShiftPressed(){return this.plugin.isShiftPressed}setBoard(t,r=!0){this.plugin.stateManagers.get(this.file).setState(t,r)}getBoard(){return this.plugin.stateManagers.get(this.file).state}getViewType(){return yn}getIcon(){return Ba}getDisplayText(){var t;return((t=this.file)==null?void 0:t.basename)||"Kanban"}getWindow(){return Ze(this.containerEl)}async onLoadFile(t){try{return await super.onLoadFile(t)}catch(r){throw this.plugin.stateManagers.get(this.file).setError(r),r}}destroy(){this.plugin.removeView(this),Object.values(this.actionButtons).forEach(t=>t.remove()),this.actionButtons={}}async onClose(){this.destroy()}async onUnloadFile(t){return this.destroy(),await super.onUnloadFile(t)}handleRename(t,r){this.file.path===t&&this.plugin.handleViewFileRename(this,r)}requestSaveToDisk(t){this.data!==t&&this.isPrimary?(this.data=t,this.requestSave()):this.data=t}getViewData(){return this.data}setViewData(t,r){if(!Hm(t)){this.plugin.kanbanFileModes[this.leaf.id||this.file.path]="markdown",this.plugin.removeView(this),this.plugin.setMarkdownView(this.leaf,!1);return}this.plugin.addView(this,t,!r&&this.isPrimary)}getPortal(){let t=this.plugin.stateManagers.get(this.file);return g(Yb,{stateManager:t,view:this})}onPaneMenu(t,r,n=!0){if(r!=="more-options"){super.onPaneMenu(t,r);return}t.addItem(i=>{i.setTitle(B("Open as markdown")).setIcon("document").setSection("pane").onClick(()=>{this.plugin.kanbanFileModes[this.leaf.id||this.file.path]="markdown",this.plugin.setMarkdownView(this.leaf)})}).addItem(i=>{i.setTitle(B("Open board settings")).setIcon("gear").setSection("pane").onClick(()=>{let a=this.plugin.stateManagers.get(this.file),o=a.state;new qs(this,{onSettingsChange:s=>{let u=(0,Rd.default)(o,{data:{settings:{$set:s}}});a.setState(u)}},o.data.settings).open()})}).addItem(i=>{i.setTitle(B("Archive completed cards")).setIcon("sheets-in-box").setSection("pane").onClick(()=>{this.plugin.stateManagers.get(this.file).archiveCompletedCards()})}),n&&super.onPaneMenu(t,r)}initHeaderButtons(){let t=this.plugin.getStateManager(this.file);if(!!t)if(t.getSetting("show-board-settings")&&!this.actionButtons["show-board-settings"]?this.actionButtons["show-board-settings"]=this.addAction("gear",B("Open board settings"),()=>{let r=this.plugin.stateManagers.get(this.file),n=r.state;new qs(this,{onSettingsChange:i=>{let a=(0,Rd.default)(n,{data:{settings:{$set:i}}});r.setState(a)}},n.data.settings).open()}):!t.getSetting("show-board-settings")&&this.actionButtons["show-board-settings"]&&(this.actionButtons["show-board-settings"].remove(),delete this.actionButtons["show-board-settings"]),t.getSetting("show-search")&&!this.actionButtons["show-search"]?this.actionButtons["show-search"]=this.addAction("search",B("Search..."),()=>{this.emitter.emit("hotkey","editor:open-search")}):!t.getSetting("show-search")&&this.actionButtons["show-search"]&&(this.actionButtons["show-search"].remove(),delete this.actionButtons["show-search"]),t.getSetting("show-view-as-markdown")&&!this.actionButtons["show-view-as-markdown"]?this.actionButtons["show-view-as-markdown"]=this.addAction("document",B("Open as markdown"),()=>{this.plugin.kanbanFileModes[this.leaf.id||this.file.path]="markdown",this.plugin.setMarkdownView(this.leaf)}):!t.getSetting("show-view-as-markdown")&&this.actionButtons["show-view-as-markdown"]&&(this.actionButtons["show-view-as-markdown"].remove(),delete this.actionButtons["show-view-as-markdown"]),t.getSetting("show-archive-all")&&!this.actionButtons["show-archive-all"]?this.actionButtons["show-archive-all"]=this.addAction("sheets-in-box",B("Archive completed cards"),()=>{this.plugin.stateManagers.get(this.file).archiveCompletedCards()}):!t.getSetting("show-archive-all")&&this.actionButtons["show-archive-all"]&&(this.actionButtons["show-archive-all"].remove(),delete this.actionButtons["show-archive-all"]),t.getSetting("show-add-list")&&!this.actionButtons["show-add-list"]){let r=this.addAction("plus-with-circle",B("Add a list"),()=>{this.emitter.emit("showLaneForm",void 0)});r.addClass($("ignore-click-outside")),this.actionButtons["show-add-list"]=r}else!t.getSetting("show-add-list")&&this.actionButtons["show-add-list"]&&(this.actionButtons["show-add-list"].remove(),delete this.actionButtons["show-add-list"])}clear(){}};h();var $i=ge(xt()),$E=ge(require("obsidian"));h();h();var Hd={};zi(Hd,{JsonPatchError:()=>at,_areEquals:()=>Ua,applyOperation:()=>zr,applyPatch:()=>Zs,applyReducer:()=>M1,deepClone:()=>T1,getValueByPointer:()=>Xs,validate:()=>Tw,validator:()=>el});h();h();var _1=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),C1=Object.prototype.hasOwnProperty;function Ys(e,t){return C1.call(e,t)}function Js(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r=48&&n<=57){t++;continue}return!1}return!0}function Hn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ka(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qs(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&f===void 0&&(l[p]===void 0?f=u.slice(0,c).join("/"):c==d-1&&(f=t.path),f!==void 0&&m(t,0,e,f)),c++,Array.isArray(l)){if(p==="-")p=l.length;else{if(r&&!Gs(p))throw new at("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);Gs(p)&&(p=~~p)}if(c>=d){if(r&&t.op==="add"&&p>l.length)throw new at("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var o=D1[t.op].call(t,l,p,e);if(o.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return o}}else if(c>=d){var o=Fi[t.op].call(t,l,p,e);if(o.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return o}if(l=l[p],r&&c0)throw new at('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new at("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Qs(e.value))throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var i=e.path.split("/").length,a=n.split("/").length;if(i!==a+1&&i!==a)throw new at("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new at("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},s=Tw([o],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Tw(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Zs(Pt(t),Pt(e),r||!0);else{r=r||el;for(var n=0;nUd,generate:()=>Kd,observe:()=>O1,unobserve:()=>N1});h();var Bd=new WeakMap,I1=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),A1=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function L1(e){return Bd.get(e)}function P1(e,t){return e.observers.get(t)}function F1(e,t){e.observers.delete(t.callback)}function N1(e,t){t.unobserve()}function O1(e,t){var r=[],n,i=L1(e);if(!i)i=new I1(e),Bd.set(e,i);else{var a=P1(i,t);n=a&&a.observer}if(n)return n;if(n={},i.value=Pt(e),t){n.callback=t,n.next=null;var o=function(){Kd(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(o)};typeof window!="undefined"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){Kd(n),clearTimeout(n.next),F1(i,n),typeof window!="undefined"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},i.observers.set(t,new A1(t,n)),n}function Kd(e,t){t===void 0&&(t=!1);var r=Bd.get(e.object);$d(r.value,e.object,e.patches,"",t),e.patches.length&&Zs(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function $d(e,t,r,n,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Js(t),o=Js(e),s=!1,u=!1,l=o.length-1;l>=0;l--){var c=o[l],d=e[c];if(Ys(t,c)&&!(t[c]===void 0&&d!==void 0&&Array.isArray(t)===!1)){var f=t[c];typeof d=="object"&&d!=null&&typeof f=="object"&&f!=null&&Array.isArray(d)===Array.isArray(f)?$d(d,f,r,n+"/"+Hn(c),i):d!==f&&(s=!0,i&&r.push({op:"test",path:n+"/"+Hn(c),value:Pt(d)}),r.push({op:"replace",path:n+"/"+Hn(c),value:Pt(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+Hn(c),value:Pt(d)}),r.push({op:"remove",path:n+"/"+Hn(c)}),u=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!u&&a.length==o.length))for(var l=0;l":""))+")"})),f;function f(){let p=[],m,y,b;if((!t||i(s,u,l[l.length-1]||null))&&(p=$1(r(s,l)),p[0]===zd))return p;if(s.children&&p[0]!==Fw)for(y=(n?s.children.length:-1)+a,b=l.concat(s);y>-1&&y!0){for(let i=t+1,a=e.length;i{try{await Bw(e,r),await Promise.all(r.children.map(n=>Va(e,n)))}catch(n){throw e.setError(n),n}}))}catch(r){throw e.setError(r),r}return t}function U1(e){return(e.op==="add"||e.op==="replace")&&["/title","/titleRaw","/dateStr","/timeStr",/\d$/,/\/fileAccessor\/.+$/].some(t=>typeof t=="string"?e.path.endsWith(t):t.test(e.path))}async function $w(e,t,r){let n={},i=r.reduce((a,o)=>{if(!U1(o))return a;let s=o.path.split("/").reduce((l,c)=>(/\d+/.test(c)&&l.push(Number(c)),l),[]),u=s.join(",");return n[u]||(n[u]=!0,a.push(s)),a},[]);try{await Promise.all(i.map(a=>{let o=ht(t,a);if(o.type===Ge.Lane)return Bw(e,o);if(o.type===Ge.Item)return Va(e,o)}))}catch(a){throw e.setError(a),a}return t}h();h();h();h();h();h();function Ft(e,t,r,n){let i=e.length,a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(t,r),[].splice.apply(e,o);else for(r&&[].splice.apply(e,[t,r]);a0?(Ft(e,e.length,0,t),e):t}var Uw={}.hasOwnProperty;function Ww(e){let t={},r=-1;for(;++ro))return;let O=t.events.length,W=O,z,ee;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(z){ee=t.events[W][1].end;break}z=!0}for(x(n),T=O;TC;){let N=r[A];t.containerState=N[1],N[0].exit.call(t,e)}r.length=C}function D(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function q1(e,t,r){return Se(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}h();h();h();h();function Gd(e){if(e===null||Qe(e)||qw(e))return 1;if(Yw(e))return 2}h();function Ni(e,t,r){let n=[],i=-1;for(;++i1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let d=Object.assign({},e[n][1].end),f=Object.assign({},e[r][1].start);Xw(d,-u),Xw(f,u),o={type:u>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[r][1].start),end:f},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[r][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[n][1].end=Object.assign({},o.start),e[r][1].start=Object.assign({},s.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Jt(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Jt(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),l=Jt(l,Ni(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),l=Jt(l,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(c=2,l=Jt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])):c=0,Ft(e,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var nT={}.hasOwnProperty;function Oi(e){return nT.call(Xd,e)?Xd[e]:!1}var al={name:"characterReference",tokenize:rT};function rT(e,t,r){let n=this,i=0,a,o;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,o=Gt,c(d))}function l(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=zw,c):(e.enter("characterReferenceValue"),a=7,o=za,c(d))}function c(d){let f;return d===59&&i?(f=e.exit("characterReferenceValue"),o===Gt&&!Oi(n.sliceSerialize(f))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)):o(d)&&i++=4?o(l):r(l)}function o(l){return l===null?u(l):ce(l)?e.attempt(aT,o,u)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||ce(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),s)}function u(l){return e.exit("codeIndented"),t(l)}}function sT(e,t,r){let n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Se(e,a,"linePrefix",4+1)(o)}function a(o){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):ce(o)?i(o):r(o)}}h();var Zd={name:"codeText",tokenize:uT,resolve:lT,previous:cT};function lT(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n=4?t(o):e.interrupt(n.parser.constructs.flow,r,t)(o)}}h();h();function ll(e,t,r,n,i,a,o,s,u){let l=u||Number.POSITIVE_INFINITY,c=0;return d;function d(x){return x===60?(e.enter(n),e.enter(i),e.enter(a),e.consume(x),e.exit(a),f):x===null||x===41||ja(x)?r(x):(e.enter(n),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(x))}function f(x){return x===62?(e.enter(a),e.consume(x),e.exit(a),e.exit(i),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(s),f(x)):x===null||x===60||ce(x)?r(x):(e.consume(x),x===92?m:p)}function m(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function y(x){return x===40?++c>l?r(x):(e.consume(x),y):x===41?c--?(e.consume(x),y):(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(n),t(x)):x===null||Qe(x)?c?r(x):(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(n),t(x)):ja(x)?r(x):(e.consume(x),x===92?b:y)}function b(x){return x===40||x===41||x===92?(e.consume(x),y):y(x)}}h();function cl(e,t,r,n,i,a){let o=this,s=0,u;return l;function l(p){return e.enter(n),e.enter(i),e.consume(p),e.exit(i),e.enter(a),c}function c(p){return p===null||p===91||p===93&&!u||p===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs||s>999?r(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(n),t):ce(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||ce(p)||s++>999?(e.exit("chunkString"),c(p)):(e.consume(p),u=u||!Be(p),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}h();function ul(e,t,r,n,i,a){let o;return s;function s(f){return e.enter(n),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,u}function u(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(n),t):(e.enter(a),l(f))}function l(f){return f===o?(e.exit(a),u(o)):f===null?r(f):ce(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Se(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===o||f===null||ce(f)?(e.exit("chunkString"),l(f)):(e.consume(f),f===92?d:c)}function d(f){return f===o||f===92?(e.consume(f),c):c(f)}}h();function jr(e,t){let r;return n;function n(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):Be(i)?Se(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}h();function nr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var tf={name:"definition",tokenize:vT},gT={tokenize:yT,partial:!0};function vT(e,t,r){let n=this,i;return a;function a(u){return e.enter("definition"),cl.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function o(u){return i=nr(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),jr(e,ll(e,e.attempt(gT,Se(e,s,"whitespace"),Se(e,s,"whitespace")),r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):r(u)}function s(u){return u===null||ce(u)?(e.exit("definition"),n.parser.defined.includes(i)||n.parser.defined.push(i),t(u)):r(u)}}function yT(e,t,r){return n;function n(o){return Qe(o)?jr(e,i)(o):r(o)}function i(o){return o===34||o===39||o===40?ul(e,Se(e,a,"whitespace"),r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o):r(o)}function a(o){return o===null||ce(o)?t(o):r(o)}}h();var nf={name:"hardBreakEscape",tokenize:bT};function bT(e,t,r){return n;function n(a){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(a),i}function i(a){return ce(a)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(a)):r(a)}}h();var rf={name:"headingAtx",tokenize:ET,resolve:wT};function wT(e,t){let r=e.length-2,n=3,i,a;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},a={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Ft(e,n,r-n+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function ET(e,t,r){let n=this,i=0;return a;function a(c){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&i++<6?(e.consume(c),o):c===null||Qe(c)?(e.exit("atxHeadingSequence"),n.interrupt?t(c):s(c)):r(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||ce(c)?(e.exit("atxHeading"),t(c)):Be(c)?Se(e,s,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),s(c))}function l(c){return c===null||c===35||Qe(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),l)}}h();h();var Zw=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],af=["pre","script","style","textarea"];var of={name:"htmlFlow",tokenize:ST,resolveTo:kT,concrete:!0},xT={tokenize:_T,partial:!0};function kT(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ST(e,t,r){let n=this,i,a,o,s,u;return l;function l(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),c}function c(P){return P===33?(e.consume(P),d):P===47?(e.consume(P),m):P===63?(e.consume(P),i=3,n.interrupt?t:be):dn(P)?(e.consume(P),o=String.fromCharCode(P),a=!0,y):r(P)}function d(P){return P===45?(e.consume(P),i=2,f):P===91?(e.consume(P),i=5,o="CDATA[",s=0,p):dn(P)?(e.consume(P),i=4,n.interrupt?t:be):r(P)}function f(P){return P===45?(e.consume(P),n.interrupt?t:be):r(P)}function p(P){return P===o.charCodeAt(s++)?(e.consume(P),s===o.length?n.interrupt?t:Z:p):r(P)}function m(P){return dn(P)?(e.consume(P),o=String.fromCharCode(P),y):r(P)}function y(P){return P===null||P===47||P===62||Qe(P)?P!==47&&a&&af.includes(o.toLowerCase())?(i=1,n.interrupt?t(P):Z(P)):Zw.includes(o.toLowerCase())?(i=6,P===47?(e.consume(P),b):n.interrupt?t(P):Z(P)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(P):a?D(P):x(P)):P===45||Gt(P)?(e.consume(P),o+=String.fromCharCode(P),y):r(P)}function b(P){return P===62?(e.consume(P),n.interrupt?t:Z):r(P)}function x(P){return Be(P)?(e.consume(P),x):z(P)}function D(P){return P===47?(e.consume(P),z):P===58||P===95||dn(P)?(e.consume(P),C):Be(P)?(e.consume(P),D):z(P)}function C(P){return P===45||P===46||P===58||P===95||Gt(P)?(e.consume(P),C):A(P)}function A(P){return P===61?(e.consume(P),N):Be(P)?(e.consume(P),A):D(P)}function N(P){return P===null||P===60||P===61||P===62||P===96?r(P):P===34||P===39?(e.consume(P),u=P,T):Be(P)?(e.consume(P),N):(u=null,O(P))}function T(P){return P===null||ce(P)?r(P):P===u?(e.consume(P),W):(e.consume(P),T)}function O(P){return P===null||P===34||P===39||P===60||P===61||P===62||P===96||Qe(P)?A(P):(e.consume(P),O)}function W(P){return P===47||P===62||Be(P)?D(P):r(P)}function z(P){return P===62?(e.consume(P),ee):r(P)}function ee(P){return Be(P)?(e.consume(P),ee):P===null||ce(P)?Z(P):r(P)}function Z(P){return P===45&&i===2?(e.consume(P),re):P===60&&i===1?(e.consume(P),pe):P===62&&i===4?(e.consume(P),De):P===63&&i===3?(e.consume(P),be):P===93&&i===5?(e.consume(P),ve):ce(P)&&(i===6||i===7)?e.check(xT,De,le)(P):P===null||ce(P)?le(P):(e.consume(P),Z)}function le(P){return e.exit("htmlFlowData"),X(P)}function X(P){return P===null?L(P):ce(P)?e.attempt({tokenize:G,partial:!0},X,L)(P):(e.enter("htmlFlowData"),Z(P))}function G(P,ct,Je){return V;function V(q){return P.enter("lineEnding"),P.consume(q),P.exit("lineEnding"),j}function j(q){return n.parser.lazy[n.now().line]?Je(q):ct(q)}}function re(P){return P===45?(e.consume(P),be):Z(P)}function pe(P){return P===47?(e.consume(P),o="",he):Z(P)}function he(P){return P===62&&af.includes(o.toLowerCase())?(e.consume(P),De):dn(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),he):Z(P)}function ve(P){return P===93?(e.consume(P),be):Z(P)}function be(P){return P===62?(e.consume(P),De):P===45&&i===2?(e.consume(P),be):Z(P)}function De(P){return P===null||ce(P)?(e.exit("htmlFlowData"),L(P)):(e.consume(P),De)}function L(P){return e.exit("htmlFlow"),t(P)}}function _T(e,t,r){return n;function n(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(_r,t,r)}}h();var sf={name:"htmlText",tokenize:CT};function CT(e,t,r){let n=this,i,a,o,s;return u;function u(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),c):L===47?(e.consume(L),O):L===63?(e.consume(L),N):dn(L)?(e.consume(L),ee):r(L)}function c(L){return L===45?(e.consume(L),d):L===91?(e.consume(L),a="CDATA[",o=0,b):dn(L)?(e.consume(L),A):r(L)}function d(L){return L===45?(e.consume(L),f):r(L)}function f(L){return L===null||L===62?r(L):L===45?(e.consume(L),p):m(L)}function p(L){return L===null||L===62?r(L):m(L)}function m(L){return L===null?r(L):L===45?(e.consume(L),y):ce(L)?(s=m,ve(L)):(e.consume(L),m)}function y(L){return L===45?(e.consume(L),De):m(L)}function b(L){return L===a.charCodeAt(o++)?(e.consume(L),o===a.length?x:b):r(L)}function x(L){return L===null?r(L):L===93?(e.consume(L),D):ce(L)?(s=x,ve(L)):(e.consume(L),x)}function D(L){return L===93?(e.consume(L),C):x(L)}function C(L){return L===62?De(L):L===93?(e.consume(L),C):x(L)}function A(L){return L===null||L===62?De(L):ce(L)?(s=A,ve(L)):(e.consume(L),A)}function N(L){return L===null?r(L):L===63?(e.consume(L),T):ce(L)?(s=N,ve(L)):(e.consume(L),N)}function T(L){return L===62?De(L):N(L)}function O(L){return dn(L)?(e.consume(L),W):r(L)}function W(L){return L===45||Gt(L)?(e.consume(L),W):z(L)}function z(L){return ce(L)?(s=z,ve(L)):Be(L)?(e.consume(L),z):De(L)}function ee(L){return L===45||Gt(L)?(e.consume(L),ee):L===47||L===62||Qe(L)?Z(L):r(L)}function Z(L){return L===47?(e.consume(L),De):L===58||L===95||dn(L)?(e.consume(L),le):ce(L)?(s=Z,ve(L)):Be(L)?(e.consume(L),Z):De(L)}function le(L){return L===45||L===46||L===58||L===95||Gt(L)?(e.consume(L),le):X(L)}function X(L){return L===61?(e.consume(L),G):ce(L)?(s=X,ve(L)):Be(L)?(e.consume(L),X):Z(L)}function G(L){return L===null||L===60||L===61||L===62||L===96?r(L):L===34||L===39?(e.consume(L),i=L,re):ce(L)?(s=G,ve(L)):Be(L)?(e.consume(L),G):(e.consume(L),i=void 0,he)}function re(L){return L===i?(e.consume(L),pe):L===null?r(L):ce(L)?(s=re,ve(L)):(e.consume(L),re)}function pe(L){return L===62||L===47||Qe(L)?Z(L):r(L)}function he(L){return L===null||L===34||L===39||L===60||L===61||L===96?r(L):L===62||Qe(L)?Z(L):(e.consume(L),he)}function ve(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Se(e,be,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function be(L){return e.enter("htmlTextData"),s(L)}function De(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):r(L)}}h();var qr={name:"labelEnd",tokenize:LT,resolveTo:AT,resolveAll:IT},TT={tokenize:PT},DT={tokenize:FT},MT={tokenize:NT};function IT(e){let t=-1,r;for(;++t-1&&(o[0]=o[0].slice(n)),a>0&&o.push(e[i].slice(0,a))),o}function XT(e,t){let r=-1,n=[],i;for(;++rsvg{width:1em;height:1em}.kanban-plugin__board{display:flex;width:100%;height:100%}.kanban-plugin__board>div{display:flex;align-items:flex-start;justify-content:flex-start;padding:1rem;width:fit-content;height:100%}.kanban-plugin__board.is-adding-lane>div{padding-right:calc(250px + 1rem)}.kanban-plugin__lane-wrapper{display:flex;flex-shrink:0;margin-right:10px;max-height:100%;width:var(--lane-width)}.kanban-plugin__lane{width:100%;display:flex;flex-direction:column;background-color:var(--background-secondary);border-radius:6px;border:1px solid var(--background-modifier-border)}.kanban-plugin__placeholder.kanban-plugin__lane-placeholder{height:100%;flex-grow:1;margin-right:5px}.kanban-plugin__lane.is-hidden{display:none}.kanban-plugin__lane button{padding:8px 10px}.kanban-plugin__lane-form-wrapper{position:absolute;top:1rem;right:1rem;width:250px;background-color:var(--background-secondary);border-radius:6px;border:2px solid rgba(var(--interactive-accent-rgb),.7);z-index:var(--layer-popover);box-shadow:0 .5px 1px .5px #0000001a,0 2px 10px #0000001a,0 10px 20px #0000001a}.kanban-plugin__lane-input-wrapper{padding:10px}.kanban-plugin__item-input-actions,.kanban-plugin__lane-input-actions{display:flex;align-items:flex-start;justify-content:flex-start;padding:0 10px 10px}.kanban-plugin__item-input-actions button,.kanban-plugin__lane-input-actions button{display:block;margin-right:5px}.kanban-plugin__item-action-add,.kanban-plugin__lane-action-add{background-color:var(--interactive-accent);color:var(--text-on-accent)}.kanban-plugin__item-action-add:hover,.kanban-plugin__lane-action-add:hover{background-color:var(--interactive-accent-hover)}.kanban-plugin__lane-header-wrapper{padding:10px 11px;display:flex;align-items:center;flex-shrink:0;flex-grow:0;border-bottom:1px solid var(--background-modifier-border)}.will-prepend .kanban-plugin__lane-header-wrapper{border-bottom:none}.kanban-plugin__lane-grip{cursor:grab;flex-grow:0;margin-right:5px;color:var(--text-faint)}.kanban-plugin__lane-grip>svg{display:block;height:1rem}.kanban-plugin__lane-title{font-weight:600;font-size:.875rem;flex-grow:1;width:100%;display:flex;flex-direction:column}.kanban-plugin__lane-title-text{flex-grow:1}div.kanban-plugin__markdown-preview-view>div>*{overflow-wrap:anywhere}div.kanban-plugin__lane-title-count{background-color:var(--background-secondary-alt);border-radius:3px;color:var(--text-muted);display:block;font-size:13px;line-height:1;padding:4px;margin-left:5px}div.kanban-plugin__lane-title-count.wip-exceeded{font-weight:bold;color:var(--text-normal);background-color:rgba(var(--background-modifier-error-rgb),.25)}.kanban-plugin__item button.kanban-plugin__item-prefix-button,.kanban-plugin__item button.kanban-plugin__item-postfix-button,.kanban-plugin__lane button.kanban-plugin__lane-settings-button{font-size:13px;line-height:1;color:var(--text-muted);padding:4px;display:flex;margin-left:5px;background-color:transparent;margin-right:-4px}.kanban-plugin__item button.kanban-plugin__item-prefix-button{margin:4px 7px 4px 0;padding:0}.kanban-plugin__item button.kanban-plugin__item-prefix-button.is-enabled,.kanban-plugin__item button.kanban-plugin__item-postfix-button.is-enabled,.kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled{color:var(--text-accent)}.kanban-plugin__item button.kanban-plugin__item-prefix-button:hover,.kanban-plugin__item button.kanban-plugin__item-postfix-button:hover,.kanban-plugin__lane button.kanban-plugin__lane-settings-button:hover{background-color:transparent;color:var(--text-normal)}.kanban-plugin__lane-action-wrapper,.kanban-plugin__item-edit-archive-button,.kanban-plugin__item-settings-actions .kanban-plugin__icon,.kanban-plugin__item-edit-archive-button>.kanban-plugin__icon,.kanban-plugin__item-prefix-button>.kanban-plugin__icon,.kanban-plugin__item-postfix-button>.kanban-plugin__icon,.kanban-plugin__lane-settings-button>.kanban-plugin__icon{display:flex}.kanban-plugin__lane-settings-button-wrapper{display:flex}button.kanban-plugin__lane-settings-button+button.kanban-plugin__lane-settings-button{margin-left:2px}.kanban-plugin__lane-settings-button svg{width:1em;height:1em}.kanban-plugin__lane-items-wrapper{margin:4px;height:100%}.kanban-plugin__lane-items{padding:4px;margin:0 4px;display:flex;flex-direction:column}.kanban-plugin__lane-items>.kanban-plugin__placeholder{flex-grow:1}.kanban-plugin__lane-items>.kanban-plugin__placeholder:only-child{height:2.55em;border:3px dashed rgba(var(--text-muted-rgb),.1);margin-bottom:4px;border-radius:6px;transition:border .2s ease}.is-sorting .kanban-plugin__lane-items>.kanban-plugin__placeholder:only-child{border-color:rgba(var(--interactive-accent-rgb),.6)}.kanban-plugin__lane-items>div{margin-top:4px}.kanban-plugin__item-button-wrapper{border-top:1px solid var(--background-modifier-border);padding:8px;flex-shrink:0;flex-grow:0}.kanban-plugin__lane-header-wrapper+.kanban-plugin__item-button-wrapper{border-top:none;border-bottom:1px solid var(--background-modifier-border);padding:4px 8px 8px}.kanban-plugin__item-button-wrapper>button{text-align:left;width:100%}.kanban-plugin__item-form{border-top:1px solid var(--background-modifier-border);padding:8px}.kanban-plugin__lane-header-wrapper+.kanban-plugin__item-form{border-top:none;border-bottom:1px solid var(--background-modifier-border);padding:4px 8px 8px}.kanban-plugin__item-input-wrapper{display:flex;flex-direction:column}.kanban-plugin button.kanban-plugin__item-submit-button{background-color:var(--background-secondary-alt);flex-grow:0;flex-shrink:1;width:auto;margin-top:5px;line-height:1;font-size:14px}button.kanban-plugin__new-item-button{background-color:transparent;color:var(--text-muted)}.kanban-plugin__new-item-button:hover{color:var(--text-on-accent);background-color:var(--interactive-accent-hover)}.kanban-plugin__item{font-size:.875rem;border:1px solid var(--background-modifier-border);border-radius:6px;overflow:hidden;transition:.3s opacity cubic-bezier(.25,1,.5,1)}.kanban-plugin__drag-container>.kanban-plugin__item-wrapper .kanban-plugin__item{border-color:var(--interactive-accent);box-shadow:0 15px 25px #0003,0 0 0 2px rgba(var(--interactive-accent-rgb),.8)}.kanban-plugin__item.is-search-hit{box-shadow:0 15px 25px #0003,0 0 0 1px var(--background-modifier-border)}.kanban-plugin__item.is-search-miss{font-size:.75rem;opacity:.5}.kanban-plugin__item.is-search-miss .kanban-plugin__item-metadata-wrapper{display:none}.kanban-plugin__item-content-wrapper{background:var(--background-primary)}.kanban-plugin__item-title-wrapper{background:var(--background-primary);display:flex;padding:6px 8px}.kanban-plugin__item-title-wrapper:not(:only-child){border-bottom:1px solid var(--background-modifier-border)}.kanban-plugin__item-title{width:100%;line-height:1.5;overflow:hidden}.kanban-plugin__markdown-preview-view{font-family:var(--font-text, var(--default-font));font-size:.875rem;padding:unset;width:unset;height:unset;position:unset;overflow-y:unset;overflow-wrap:unset;color:unset;user-select:unset;-webkit-user-select:unset}.kanban-plugin__markdown-preview-view p,.kanban-plugin__markdown-preview-view ul,.kanban-plugin__markdown-preview-view ol,.kanban-plugin__markdown-preview-view blockquote{margin-block-start:.66em;margin-block-end:.66em}.kanban-plugin__markdown-preview-view blockquote{margin-inline-start:0;margin-inline-end:0}.kanban-plugin__markdown-preview-view ul ol,.kanban-plugin__markdown-preview-view ol ul,.kanban-plugin__markdown-preview-view ul ul,.kanban-plugin__markdown-preview-view ol ol{margin-block-start:0em;margin-block-end:0em}.kanban-plugin__markdown-preview-view>div>*{overflow-x:auto;overflow-wrap:break-word}.kanban-plugin__markdown-preview-view>div>*:first-child,.kanban-plugin__markdown-preview-view>div>.frontmatter-container+*{margin-top:0}.kanban-plugin__markdown-preview-view>div>*:last-child{margin-bottom:0}.kanban-plugin__markdown-preview-view ul,.kanban-plugin__markdown-preview-view ol{padding-inline-start:24px}.kanban-plugin__meta-value .kanban-plugin__markdown-preview-view p,.kanban-plugin__meta-value .kanban-plugin__markdown-preview-view{font-size:inherit;color:inherit;line-height:inherit}.kanban-plugin__markdown-preview-view.inline p,.kanban-plugin__markdown-preview-view.inline{display:inline-block}.kanban-plugin__markdown-preview-view .frontmatter,.kanban-plugin__markdown-preview-view .frontmatter-container{display:none}.kanban-plugin__markdown-preview-view .file-link span{display:inline-flex;align-items:center;justify-content:center;color:var(--text-faint);margin-left:2px;position:relative;top:3px}.kanban-plugin__embed-link-wrapper{padding:2px;float:right}.kanban-plugin__item-metadata-wrapper:not(:empty){background-color:var(--background-primary-alt);padding:6px 8px}.kanban-plugin__item-metadata:not(:empty){padding-top:5px;font-size:12px;font-weight:500;color:var(--text-muted)}.kanban-plugin__item-metadata>span{display:block}.kanban-plugin__item-metadata .is-button{cursor:pointer}.kanban-plugin__item-metadata .is-button:hover{color:var(--text-normal)}.kanban-plugin__item-metadata-date-relative:first-letter{text-transform:uppercase}.kanban-plugin__item-metadata a{text-decoration:none}.kanban-plugin__item-metadata-time:before{content:" \2022 "}.kanban-plugin__item-metadata-time.is-button:hover:before{color:var(--text-muted)}.kanban-plugin__item-metadata-date-wrapper{padding-top:2px}.kanban-plugin__item-tags:not(:empty){padding-top:2px}.kanban-plugin__item-tag{display:inline-block;margin-right:4px}.kanban-plugin__item-tags .kanban-plugin__item-tag{background-color:var( --tag-background-color, rgba(var(--interactive-accent-rgb), .1) );color:var(--tag-color, var(--text-accent));padding:1px 4px;border-radius:6px;margin:3px 3px 0 0}.kanban-plugin__item-tag.is-search-match,.kanban-plugin__item-tags .kanban-plugin__item-tag.is-search-match{background-color:var(--text-highlight-bg);color:var(--text-normal)}.kanban-plugin__meta-table{width:100%;margin:0;line-height:1.5;font-size:.75rem}.kanban-plugin__meta-table td{vertical-align:top;padding:3px 0;width:10%}.kanban-plugin__meta-table td+td{width:90%}.kanban-plugin__meta-table td:only-child{width:100%}.kanban-plugin__meta-table td.kanban-plugin__meta-key{white-space:nowrap;padding-right:5px;color:var(--text-muted)}.kanban-plugin__meta-table td.kanban-plugin__meta-key.is-search-match>span{background-color:var(--text-highlight-bg);color:var(--text-normal)}.kanban-plugin__meta-value{white-space:pre-wrap;display:flex}.kanban-plugin__meta-value>.is-search-match,.kanban-plugin__meta-value.is-search-match{background-color:var(--text-highlight-bg);color:var(--text-normal)}.kanban-plugin__item-prefix-button-wrapper,.kanban-plugin__item-postfix-button-wrapper{display:flex;flex-grow:0;flex-shrink:0}.kanban-plugin__item-prefix-button-wrapper{flex-direction:column}.kanban-plugin__item-prefix-button-wrapper input[type=checkbox]{margin:4px 7px 4px 0;width:15px;height:15px;filter:hue-rotate(42deg)}.kanban-plugin__item-prefix-button-wrapper input[type=checkbox]+button{margin-top:10px}button.kanban-plugin__item-postfix-button{visibility:hidden;opacity:0;transition:.1s opacity;display:flex;align-self:flex-start}button.kanban-plugin__item-postfix-button.is-enabled,.kanban-plugin__item:hover button.kanban-plugin__item-postfix-button{visibility:visible;opacity:1}.kanban-plugin__item-settings-actions{padding:5px;display:flex}.kanban-plugin__item-settings-actions>button{line-height:1;display:flex;align-items:center;justify-content:center;font-size:.75rem;width:100%}.kanban-plugin__lane-action-wrapper button>.kanban-plugin__icon,.kanban-plugin__item-settings-actions button>.kanban-plugin__icon{margin-right:5px}.kanban-plugin__item-settings-actions>button:first-child,.kanban-plugin__lane-action-wrapper>button:first-child{margin-right:2.5px}.kanban-plugin__item-settings-actions>button:last-child,.kanban-plugin__lane-action-wrapper>button:last-child{margin-left:2.5px}.kanban-plugin__archive-lane-button,.kanban-plugin__item-button-archive{color:var(--text-muted);border:1px solid var(--background-modifier-border)}.kanban-plugin__archive-lane-button:hover,.kanban-plugin__item-button-archive:hover{color:var(--text-normal)}.kanban-plugin__item-button-delete{border:1px solid rgba(var(--background-modifier-error-rgb),.15);color:rgba(var(--background-modifier-error-rgb),1)}.kanban-plugin__item-button-delete:hover{background-color:rgba(var(--background-modifier-error-rgb),.2);color:var(--text-error)}.theme-dark .kanban-plugin__item-button-delete{background-color:transparent;border:1px solid rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.theme-dark .kanban-plugin__item-button-delete:hover{background-color:rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.kanban-plugin__checkbox-wrapper{border-top:1px solid var(--background-modifier-border);border-bottom:1px solid var(--background-modifier-border);padding:10px;margin-bottom:10px;display:flex;align-items:center}.kanban-plugin__checkbox-wrapper .checkbox-container{flex-shrink:0;flex-grow:0;margin-left:15px}.kanban-plugin__checkbox-label{font-size:.8125rem;line-height:1.4}.kanban-plugin__lane-setting-wrapper>div{border-top:none;border-bottom:none;padding:10px 15px;margin-bottom:0}.kanban-plugin__lane-setting-wrapper>div:last-child{border-bottom:1px solid var(--background-modifier-border);margin-bottom:10px}.kanban-plugin__action-confirm-wrapper{border:1px solid rgba(var(--background-modifier-error-rgb),.2);background-color:rgba(var(--background-modifier-error-rgb),.1);border-radius:4px;padding:10px;margin:5px 10px}.theme-dark .kanban-plugin__action-confirm-wrapper{border:1px solid rgba(var(--background-modifier-error-rgb),1)}.kanban-plugin__delete-lane-button,.kanban-plugin__archive-lane-button{display:flex;align-items:center;justify-content:center;font-size:.75rem;width:50%}.kanban-plugin__delete-lane-button{border:1px solid rgba(var(--background-modifier-error-rgb),.15);color:rgba(var(--background-modifier-error-rgb),1)}.kanban-plugin__delete-lane-button:hover{background-color:rgba(var(--background-modifier-error-rgb),.2);color:var(--text-error)}.theme-dark .kanban-plugin__delete-lane-button{background-color:transparent;border:1px solid rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.theme-dark .kanban-plugin__delete-lane-button:hover{background-color:rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.kanban-plugin__action-confirm-text{font-size:.875rem;color:var(--text-error);margin-bottom:10px;line-height:1.4}button.kanban-plugin__confirm-action-button{border:1px solid rgba(var(--background-modifier-error-rgb),.2);margin-right:5px;color:var(--text-error)}button.kanban-plugin__confirm-action-button:hover{background-color:rgba(var(--background-modifier-error-rgb),.5)}button.kanban-plugin__cancel-action-button{border:1px solid var(--background-modifier-border)}.kanban-plugin__grow-wrap{width:100%;display:grid}.kanban-plugin__grow-wrap:after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.kanban-plugin__grow-wrap>textarea{resize:none;overflow:hidden;tab-size:2}.kanban-plugin__grow-wrap>textarea:focus{border-color:var(--interactive-accent)}.kanban-plugin__grow-wrap>textarea,.kanban-plugin__grow-wrap:after{border:1px solid var(--background-modifier-border);padding:5px 7px;font:inherit;line-height:1.5;grid-area:1 / 1 / 2 / 2;font-size:.875rem;overflow:hidden;overflow-wrap:break-word;white-space:pre-wrap}.kanban-plugin__autocomplete{font-size:.875rem;border:1px solid var(--background-modifier-border);background-color:var(--background-primary);list-style:none;padding:0;margin:0;min-width:20ch;max-width:40ch;max-height:200px;border-radius:6px;box-shadow:0 15px 25px #0003;overflow-x:hidden;overflow-y:auto}.kanban-plugin__autocomplete li{margin:0}.kanban-plugin__autocomplete li em{opacity:.6}.kanban-plugin .textcomplete-footer,.kanban-plugin .textcomplete-header{display:none}.kanban-plugin__autocomplete-item-active,.kanban-plugin__autocomplete-item{border-top:1px solid var(--background-modifier-border);padding:4px 6px;cursor:pointer}.kanban-plugin__autocomplete .textcomplete-header+.kanban-plugin__autocomplete-item,.kanban-plugin__autocomplete .textcomplete-header+.kanban-plugin__autocomplete-item-active{border-top:none}.kanban-plugin__autocomplete-item:hover,.kanban-plugin__autocomplete-item-active{color:var(--text-on-accent);background-color:var(--interactive-accent-hover)}.kanban-plugin__file-suggestion-wrapper{display:flex;line-height:1.2}.kanban-plugin__file-suggestion-icon{flex-shrink:0;flex-grow:0;padding-right:4px}.kanban-plugin__file-suggestion-subtitle{font-size:.875em;color:var(--text-muted)}.kanban-plugin__autocomplete-item:hover .kanban-plugin__file-suggestion-subtitle,.kanban-plugin__autocomplete-item-active .kanban-plugin__file-suggestion-subtitle{color:var(--text-on-accent)}.modal.kanban-plugin__board-settings-modal{max-height:90vh;padding:0;display:flex;flex-direction:column}.modal.kanban-plugin__board-settings-modal .modal-content{padding:30px 50px;height:100%;overflow-y:auto;overflow-x:hidden;margin:0}.kanban-plugin__board-settings-modal .setting-item-info{width:100%}.kanban-plugin__board-settings-modal .setting-item-control{min-width:300px;flex-shrink:0}.kanban-plugin__board-settings-modal .choices{width:100%;text-align:left}.kanban-plugin__board-settings-modal .choices[data-type*=select-one] .choices__inner{background-color:var(--background-primary);border-color:var(--background-modifier-border);padding:0;min-height:0}.kanban-plugin__board-settings-modal .choices[data-type*=select-one] .choices__input{background-color:var(--background-primary);border-bottom-color:var(--background-modifier-border);font-size:14px}.kanban-plugin__board-settings-modal .choices__input{border-radius:0;border-top:none;border-left:none;border-right:none}.kanban-plugin__board-settings-modal .choices__list[role=listbox]{overflow-x:hidden}.kanban-plugin__board-settings-modal .choices__list--single{padding:4px 20px 4px 6px}.kanban-plugin__board-settings-modal .is-open .choices__list--dropdown,.kanban-plugin__board-settings-modal .choices__list--dropdown{background-color:var(--background-primary);border-color:var(--background-modifier-border);word-break:normal;max-height:200px;display:flex;flex-direction:column}.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item--selectable:after{display:none}.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item--selectable{padding:4px 6px}.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item.is-highlighted{background-color:var(--background-primary-alt)}.kanban-plugin__board-settings-modal .choices__placeholder{opacity:1;color:var(--text-muted)}.kanban-plugin__board-settings-modal .error{border-color:var(--background-modifier-error-hover)!important}.kanban-plugin__date-picker{position:absolute;z-index:var(--layer-popover);--cell-size: 2.4em}.kanban-plugin__date-picker .flatpickr-input{width:0;height:0;opacity:0;border:none;padding:0;display:block;margin-bottom:-1px}.kanban-plugin__date-picker .flatpickr-current-month{color:var(--text-normal);font-weight:600;font-size:inherit;width:100%;position:static;height:auto;display:flex;align-items:center;justify-content:center;padding:0}.kanban-plugin__date-picker .flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:var(--text-normal)}.kanban-plugin__date-picker .flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:var(--text-normal)}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{fill:currentColor}.kanban-plugin__date-picker .flatpickr-calendar{font-size:13px;overflow:hidden;background-color:var(--background-primary);width:calc(var(--cell-size) * 7 + 8px);box-shadow:0 0 0 1px var(--background-modifier-border),0 15px 25px #0003}.kanban-plugin__date-picker .flatpickr-months{font-size:13px;padding:2px 2px 4px;align-items:center}.kanban-plugin__date-picker .flatpickr-months .flatpickr-current-month input.cur-year,.kanban-plugin__date-picker .flatpickr-months select{border-radius:4px;padding:4px}.kanban-plugin__date-picker .flatpickr-months .numInputWrapper{border-radius:4px}.kanban-plugin__date-picker .flatpickr-months .flatpickr-month{width:100%;height:auto}.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month,.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month{color:var(--text-normal);fill:currentColor;border-radius:4px;display:flex;align-items:center;justify-content:center;line-height:1;height:auto;padding:5px;position:static;flex-shrink:0}.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month:hover,.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month:hover{background-color:var(--background-primary-alt);color:var(--text-normal)}.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month:hover svg,.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month:hover svg{fill:currentColor}.kanban-plugin__date-picker .flatpickr-current-month .flatpickr-monthDropdown-months{color:var(--text-normal);font-weight:inherit;margin-right:5px}.kanban-plugin__date-picker .flatpickr-current-month input.cur-year{color:var(--text-normal);font-weight:inherit}.kanban-plugin__date-picker .flatpickr-weekdays{height:auto;padding:8px 0 12px}.kanban-plugin__date-picker span.flatpickr-weekday{font-weight:400;color:var(--text-muted)}.kanban-plugin__date-picker .flatpickr-innerContainer{padding:4px}.kanban-plugin__date-picker .flatpickr-day{color:var(--text-normal);display:inline-flex;align-items:center;justify-content:center;width:var(--cell-size);height:var(--cell-size);line-height:1;border-radius:6px}.kanban-plugin__date-picker .flatpickr-day.today{border-color:var(--interactive-accent)}.kanban-plugin__date-picker .flatpickr-day.today:hover{color:var(--text-normal);border-color:var(--interactive-accent);background-color:var(--background-primary-alt)}.kanban-plugin__date-picker .flatpickr-day.selected{border-color:var(--interactive-accent);background-color:var(--interactive-accent);color:var(--text-on-accent)}.kanban-plugin__date-picker .flatpickr-day.selected:hover{border-color:var(--interactive-accent);background-color:var(--interactive-accent)}.kanban-plugin__date-picker .flatpickr-days{width:calc(var(--cell-size) * 7)}.kanban-plugin__date-picker .dayContainer{width:calc(var(--cell-size) * 7);min-width:calc(var(--cell-size) * 7);max-width:calc(var(--cell-size) * 7)}.kanban-plugin__date-picker .flatpickr-day.inRange,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay.inRange,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay.inRange,.kanban-plugin__date-picker .flatpickr-day.today.inRange,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay.today.inRange,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay.today.inRange,.kanban-plugin__date-picker .flatpickr-day:hover,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay:hover,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay:hover,.kanban-plugin__date-picker .flatpickr-day:focus,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay:focus,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay:focus{background-color:var(--background-primary-alt);border-color:var(--background-primary-alt)}.kanban-plugin__date-picker .flatpickr-day.flatpickr-disabled,.kanban-plugin__date-picker .flatpickr-day.flatpickr-disabled:hover,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay,.kanban-plugin__date-picker .flatpickr-day.notAllowed,.kanban-plugin__date-picker .flatpickr-day.notAllowed.prevMonthDay,.kanban-plugin__date-picker .flatpickr-day.notAllowed.nextMonthDay{color:var(--text-faint)}.kanban-plugin__time-picker{position:absolute;max-height:250px;overflow:auto;border-radius:4px;border:1px solid var(--background-modifier-border);box-shadow:0 2px 8px var(--background-modifier-box-shadow);background:var(--background-primary);color:var(--text-normal);font-size:14px;z-index:var(--layer-menu)}.kanban-plugin__time-picker-item{display:flex;align-items:center;color:var(--text-muted);cursor:pointer;line-height:1;padding:6px 8px}.kanban-plugin__time-picker-check{visibility:hidden;display:inline-flex;margin-right:5px}.kanban-plugin__time-picker-item.is-hour{color:var(--text-normal);font-weight:600}.kanban-plugin__time-picker-item.is-selected .kanban-plugin__time-picker-check{visibility:visible}.kanban-plugin__time-picker-item:hover,.kanban-plugin__time-picker-item.is-selected{background:var(--background-secondary)}.kanban-plugin mark{background-color:var(--text-highlight-bg)}.kanban-plugin__draggable-setting-container{border-top:0;padding:0;flex-direction:column}.kanban-plugin__draggable-setting-container>div{width:100%;margin-right:0!important}.kanban-plugin__setting-item-wrapper{border-top:1px solid var(--background-modifier-border)}.kanban-plugin__draggable-setting-container>.kanban-plugin__placeholder{border-top:1px solid var(--background-modifier-border)}.kanban-plugin__setting-item{background-color:var(--background-secondary);width:100%;font-size:16px;display:flex;align-items:flex-start;padding:12px;color:var(--text-muted)}.kanban-plugin__drag-container .kanban-plugin__setting-item{border:1px solid rgba(var(--interactive-accent-rgb),.8);box-shadow:0 15px 25px #0003,0 0 0 2px rgba(var(--interactive-accent-rgb),.8)}.kanban-plugin__setting-controls-wrapper{flex-grow:1;flex-shrink:0}.kanban-plugin__setting-input-wrapper{display:flex;margin-bottom:1rem}.kanban-plugin__setting-input-wrapper>div{margin-right:10px}.kanban-plugin__setting-toggle-wrapper>div{display:flex;align-items:center;line-height:1;margin-bottom:10px}.kanban-plugin__setting-toggle-wrapper .checkbox-container{margin-right:10px}.kanban-plugin__setting-button-wrapper{display:flex;justify-content:flex-end;flex-grow:1;flex-shrink:0}.kanban-plugin__setting-button-wrapper>div{margin-left:12px}.kanban-plugin__setting-key-input-wrapper{margin:1rem 0}.kanban-plugin__setting-key-input-wrapper>input{margin-right:10px}.kanban-plugin__tag-color-input-wrapper{display:flex;flex-direction:column;flex-grow:1;gap:1rem}.kanban-plugin__add-tag-color-button{align-self:baseline;margin:0}.kanban-plugin__tag-color-input .kanban-plugin__item-tags{background-color:var(--background-primary);padding:10px;margin:0;border-radius:4px}.kanban-plugin__tag-color-input .kanban-plugin__item-tag{margin-top:0;font-size:13px;font-weight:500;line-height:1.5}.kanban-plugin__metadata-setting-desc{font-size:14px}.kanban-plugin__setting-button-spacer{visibility:hidden}.kanban-plugin__setting-item-label{font-size:12px;font-weight:bold;margin-bottom:5px}.kanban-plugin__setting-toggle-wrapper .kanban-plugin__setting-item-label{margin-bottom:0}.kanban-plugin__hitbox{border:2px dashed tomato}.kanban-plugin__placeholder{flex-grow:0;flex-shrink:0;width:0;height:0;pointer-events:none}.kanban-plugin__placeholder[data-axis=horizontal]{height:100%}.kanban-plugin__placeholder[data-axis=vertical]{width:100%}body:not(.native-scrollbars) .kanban-plugin__scroll-container::-webkit-scrollbar{background-color:transparent;width:16px;height:16px}body:not(.native-scrollbars) .kanban-plugin__scroll-container::-webkit-scrollbar-thumb{border:4px solid transparent;background-clip:content-box}.kanban-plugin__scroll-container{will-change:transform}.kanban-plugin__scroll-container.kanban-plugin__horizontal{overflow-y:hidden;overflow-x:auto}.kanban-plugin__scroll-container.kanban-plugin__vertical{overflow-y:auto;overflow-x:hidden}.kanban-plugin__drag-container{contain:layout size;z-index:10000;pointer-events:none;position:fixed;top:0;left:0}.kanban-plugin__loading{background-color:var(--background-secondary-alt);width:100%;height:100%;display:flex;justify-content:center;align-items:center}.sk-pulse{width:60px;height:60px;background-color:var(--text-faint);border-radius:100%;animation:sk-pulse 1.2s infinite cubic-bezier(.455,.03,.515,.955)}@keyframes sk-pulse{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}.kanban-plugin__color-picker-wrapper{position:relative}.kanban-plugin__color-picker{position:absolute;top:-5px;left:0;transform:translateY(-100%)} +.choices{position:relative;margin-bottom:24px;font-size:16px}.choices:focus{outline:none}.choices:last-child{margin-bottom:0}.choices.is-disabled .choices__inner,.choices.is-disabled .choices__input{background-color:#eaeaea;cursor:not-allowed;-webkit-user-select:none;-ms-user-select:none;user-select:none}.choices.is-disabled .choices__item{cursor:not-allowed}.choices [hidden]{display:none!important}.choices[data-type*=select-one]{cursor:pointer}.choices[data-type*=select-one] .choices__inner{padding-bottom:7.5px}.choices[data-type*=select-one] .choices__input{display:block;width:100%;padding:10px;border-bottom:1px solid #dddddd;background-color:#fff;margin:0}.choices[data-type*=select-one] .choices__button{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==);padding:0;background-size:8px;position:absolute;top:50%;right:0;margin-top:-10px;margin-right:25px;height:20px;width:20px;border-radius:10em;opacity:.5}.choices[data-type*=select-one] .choices__button:hover,.choices[data-type*=select-one] .choices__button:focus{opacity:1}.choices[data-type*=select-one] .choices__button:focus{box-shadow:0 0 0 2px #00bcd4}.choices[data-type*=select-one] .choices__item[data-value=""] .choices__button{display:none}.choices[data-type*=select-one]:after{content:"";height:0;width:0;border-style:solid;border-color:#333333 transparent transparent transparent;border-width:5px;position:absolute;right:11.5px;top:50%;margin-top:-2.5px;pointer-events:none}.choices[data-type*=select-one].is-open:after{border-color:transparent transparent #333333 transparent;margin-top:-7.5px}.choices[data-type*=select-one][dir=rtl]:after{left:11.5px;right:auto}.choices[data-type*=select-one][dir=rtl] .choices__button{right:auto;left:0;margin-left:25px;margin-right:0}.choices[data-type*=select-multiple] .choices__inner,.choices[data-type*=text] .choices__inner{cursor:text}.choices[data-type*=select-multiple] .choices__button,.choices[data-type*=text] .choices__button{position:relative;display:inline-block;margin:0 -4px 0 8px;padding-left:16px;border-left:1px solid #008fa1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==);background-size:8px;width:8px;line-height:1;opacity:.75;border-radius:0}.choices[data-type*=select-multiple] .choices__button:hover,.choices[data-type*=select-multiple] .choices__button:focus,.choices[data-type*=text] .choices__button:hover,.choices[data-type*=text] .choices__button:focus{opacity:1}.choices__inner{display:inline-block;vertical-align:top;width:100%;background-color:#f9f9f9;padding:7.5px 7.5px 3.75px;border:1px solid #dddddd;border-radius:2.5px;font-size:14px;min-height:44px;overflow:hidden}.is-focused .choices__inner,.is-open .choices__inner{border-color:#b7b7b7}.is-open .choices__inner{border-radius:2.5px 2.5px 0 0}.is-flipped.is-open .choices__inner{border-radius:0 0 2.5px 2.5px}.choices__list{margin:0;padding-left:0;list-style:none}.choices__list--single{display:inline-block;padding:4px 16px 4px 4px;width:100%}[dir=rtl] .choices__list--single{padding-right:4px;padding-left:16px}.choices__list--single .choices__item{width:100%}.choices__list--multiple{display:inline}.choices__list--multiple .choices__item{display:inline-block;vertical-align:middle;border-radius:20px;padding:4px 10px;font-size:12px;font-weight:500;margin-right:3.75px;margin-bottom:3.75px;background-color:#00bcd4;border:1px solid #00a5bb;color:#fff;word-break:break-all;box-sizing:border-box}.choices__list--multiple .choices__item[data-deletable]{padding-right:5px}[dir=rtl] .choices__list--multiple .choices__item{margin-right:0;margin-left:3.75px}.choices__list--multiple .choices__item.is-highlighted{background-color:#00a5bb;border:1px solid #008fa1}.is-disabled .choices__list--multiple .choices__item{background-color:#aaa;border:1px solid #919191}.choices__list--dropdown{visibility:hidden;z-index:1;position:absolute;width:100%;background-color:#fff;border:1px solid #dddddd;top:100%;margin-top:-1px;border-bottom-left-radius:2.5px;border-bottom-right-radius:2.5px;overflow:hidden;word-break:break-all;will-change:visibility}.choices__list--dropdown.is-active{visibility:visible}.is-open .choices__list--dropdown{border-color:#b7b7b7}.is-flipped .choices__list--dropdown{top:auto;bottom:100%;margin-top:0;margin-bottom:-1px;border-radius:.25rem .25rem 0 0}.choices__list--dropdown .choices__list{position:relative;max-height:300px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:scroll-position}.choices__list--dropdown .choices__item{position:relative;padding:10px;font-size:14px}[dir=rtl] .choices__list--dropdown .choices__item{text-align:right}@media (min-width: 640px){.choices__list--dropdown .choices__item--selectable{padding-right:100px}.choices__list--dropdown .choices__item--selectable:after{content:attr(data-select-text);font-size:12px;opacity:0;position:absolute;right:10px;top:50%;transform:translateY(-50%)}[dir=rtl] .choices__list--dropdown .choices__item--selectable{text-align:right;padding-left:100px;padding-right:10px}[dir=rtl] .choices__list--dropdown .choices__item--selectable:after{right:auto;left:10px}}.choices__list--dropdown .choices__item--selectable.is-highlighted{background-color:#f2f2f2}.choices__list--dropdown .choices__item--selectable.is-highlighted:after{opacity:.5}.choices__item{cursor:default}.choices__item--selectable{cursor:pointer}.choices__item--disabled{cursor:not-allowed;-webkit-user-select:none;-ms-user-select:none;user-select:none;opacity:.5}.choices__heading{font-weight:600;font-size:12px;padding:10px;border-bottom:1px solid #f7f7f7;color:gray}.choices__button{text-indent:-9999px;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;background-color:transparent;background-repeat:no-repeat;background-position:center;cursor:pointer}.choices__button:focus{outline:none}.choices__input{display:inline-block;vertical-align:baseline;background-color:#f9f9f9;font-size:14px;margin-bottom:5px;border:0;border-radius:0;max-width:100%;padding:4px 0 4px 2px}.choices__input:focus{outline:0}[dir=rtl] .choices__input{padding-right:2px;padding-left:0}.choices__placeholder{opacity:.5}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 #e6e6e6,-1px 0 #e6e6e6,0 1px #e6e6e6,0 -1px #e6e6e6,0 3px 13px #00000014}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:#000000e6;fill:#000000e6;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#000000e6;fill:#000000e6}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#00000080}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\fffd;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#000000e6}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#000000e6}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#00000080;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:#0000008a;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#3939394d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#3939391a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 #569ff7,5px 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#3939394d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate(0)}}.workspace-leaf-content[data-type=kanban] .view-content{padding:0}.kanban-plugin{--lane-width: 272px}.kanban-plugin{contain:content;background-color:var(--background-secondary-alt);height:100%;width:100%;position:relative;display:flex;flex-direction:column}.kanban-plugin.something-is-dragging *{pointer-events:none}.kanban-plugin__item button,.kanban-plugin__lane button,.kanban-plugin button{line-height:1;padding:10px 12px;margin:0;transition:.1s color,.1s background-color}.kanban-plugin__search-wrapper{width:100%;position:sticky;top:0;left:0;padding:10px 13px;display:flex;justify-content:flex-end;align-items:center;z-index:2;background-color:var(--background-secondary);border-bottom:1px solid var(--background-modifier-border)}button.kanban-plugin__search-cancel-button{display:flex;line-height:1;padding:6px;border:1px solid var(--background-modifier-border);background:var(--background-secondary-alt);color:var(--text-muted);margin:0 0 0 5px;font-size:16px}button.kanban-plugin__search-cancel-button .kanban-plugin__icon{display:flex}.kanban-plugin__icon{display:inline-block;line-height:1}.kanban-plugin__icon>svg{width:1em;height:1em}.kanban-plugin__board{display:flex;width:100%;height:100%}.kanban-plugin__board>div{display:flex;align-items:flex-start;justify-content:flex-start;padding:1rem;width:fit-content;height:100%}.kanban-plugin__board.is-adding-lane>div{padding-right:calc(250px + 1rem)}.kanban-plugin__lane-wrapper{display:flex;flex-shrink:0;margin-right:10px;max-height:100%;width:var(--lane-width)}.kanban-plugin__lane{width:100%;display:flex;flex-direction:column;background-color:var(--background-secondary);border-radius:6px;border:1px solid var(--background-modifier-border)}.kanban-plugin__placeholder.kanban-plugin__lane-placeholder{height:100%;flex-grow:1;margin-right:5px}.kanban-plugin__lane.is-hidden{display:none}.kanban-plugin__lane button{padding:8px 10px}.kanban-plugin__lane-form-wrapper{position:absolute;top:1rem;right:1rem;width:250px;background-color:var(--background-secondary);border-radius:6px;border:2px solid rgba(var(--interactive-accent-rgb),.7);z-index:var(--layer-popover);box-shadow:0 .5px 1px .5px #0000001a,0 2px 10px #0000001a,0 10px 20px #0000001a}.kanban-plugin__lane-input-wrapper{padding:10px}.kanban-plugin__item-input-actions,.kanban-plugin__lane-input-actions{display:flex;align-items:flex-start;justify-content:flex-start;padding:0 10px 10px}.kanban-plugin__item-input-actions button,.kanban-plugin__lane-input-actions button{display:block;margin-right:5px}.kanban-plugin__item-action-add,.kanban-plugin__lane-action-add{background-color:var(--interactive-accent);color:var(--text-on-accent)}.kanban-plugin__item-action-add:hover,.kanban-plugin__lane-action-add:hover{background-color:var(--interactive-accent-hover)}.kanban-plugin__lane-header-wrapper{padding:10px 11px;display:flex;align-items:center;flex-shrink:0;flex-grow:0;border-bottom:1px solid var(--background-modifier-border)}.will-prepend .kanban-plugin__lane-header-wrapper{border-bottom:none}.kanban-plugin__lane-grip{cursor:grab;flex-grow:0;margin-right:5px;color:var(--text-faint)}.kanban-plugin__lane-grip>svg{display:block;height:1rem}.kanban-plugin__lane-title{font-weight:600;font-size:.875rem;flex-grow:1;width:100%;display:flex;flex-direction:column}.kanban-plugin__lane-title-text{flex-grow:1}div.kanban-plugin__markdown-preview-view>div>*{overflow-wrap:anywhere}div.kanban-plugin__lane-title-count{background-color:var(--background-secondary-alt);border-radius:3px;color:var(--text-muted);display:block;font-size:13px;line-height:1;padding:4px;margin-left:5px}div.kanban-plugin__lane-title-count.wip-exceeded{font-weight:bold;color:var(--text-normal);background-color:rgba(var(--background-modifier-error-rgb),.25)}.kanban-plugin__item button.kanban-plugin__item-prefix-button,.kanban-plugin__item button.kanban-plugin__item-postfix-button,.kanban-plugin__lane button.kanban-plugin__lane-settings-button{font-size:13px;line-height:1;color:var(--text-muted);padding:4px;display:flex;margin-left:5px;background-color:transparent;margin-right:-4px}.kanban-plugin__item button.kanban-plugin__item-prefix-button{margin:4px 7px 4px 0;padding:0}.kanban-plugin__item button.kanban-plugin__item-prefix-button.is-enabled,.kanban-plugin__item button.kanban-plugin__item-postfix-button.is-enabled,.kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled{color:var(--text-accent)}.kanban-plugin__item button.kanban-plugin__item-prefix-button:hover,.kanban-plugin__item button.kanban-plugin__item-postfix-button:hover,.kanban-plugin__lane button.kanban-plugin__lane-settings-button:hover{background-color:transparent;color:var(--text-normal)}.kanban-plugin__lane-action-wrapper,.kanban-plugin__item-edit-archive-button,.kanban-plugin__item-settings-actions .kanban-plugin__icon,.kanban-plugin__item-edit-archive-button>.kanban-plugin__icon,.kanban-plugin__item-prefix-button>.kanban-plugin__icon,.kanban-plugin__item-postfix-button>.kanban-plugin__icon,.kanban-plugin__lane-settings-button>.kanban-plugin__icon{display:flex}.kanban-plugin__lane-settings-button-wrapper{display:flex}button.kanban-plugin__lane-settings-button+button.kanban-plugin__lane-settings-button{margin-left:2px}.kanban-plugin__lane-settings-button svg{width:1em;height:1em}.kanban-plugin__lane-items-wrapper{margin:4px;height:100%}.kanban-plugin__lane-items{padding:4px;margin:0 4px;display:flex;flex-direction:column}.kanban-plugin__lane-items>.kanban-plugin__placeholder{flex-grow:1}.kanban-plugin__lane-items>.kanban-plugin__placeholder:only-child{height:2.55em;border:3px dashed rgba(var(--text-muted-rgb),.1);margin-bottom:4px;border-radius:6px;transition:border .2s ease}.is-sorting .kanban-plugin__lane-items>.kanban-plugin__placeholder:only-child{border-color:rgba(var(--interactive-accent-rgb),.6)}.kanban-plugin__lane-items>div{margin-top:4px}.kanban-plugin__item-button-wrapper{border-top:1px solid var(--background-modifier-border);padding:8px;flex-shrink:0;flex-grow:0}.kanban-plugin__lane-header-wrapper+.kanban-plugin__item-button-wrapper{border-top:none;border-bottom:1px solid var(--background-modifier-border);padding:4px 8px 8px}.kanban-plugin__item-button-wrapper>button{text-align:left;width:100%}.kanban-plugin__item-form{border-top:1px solid var(--background-modifier-border);padding:8px}.kanban-plugin__lane-header-wrapper+.kanban-plugin__item-form{border-top:none;border-bottom:1px solid var(--background-modifier-border);padding:4px 8px 8px}.kanban-plugin__item-input-wrapper{display:flex;flex-direction:column}.kanban-plugin button.kanban-plugin__item-submit-button{background-color:var(--background-secondary-alt);flex-grow:0;flex-shrink:1;width:auto;margin-top:5px;line-height:1;font-size:14px}button.kanban-plugin__new-item-button{background-color:transparent;color:var(--text-muted)}.kanban-plugin__new-item-button:hover{color:var(--text-on-accent);background-color:var(--interactive-accent-hover)}.kanban-plugin__item{font-size:.875rem;border:1px solid var(--background-modifier-border);border-radius:6px;overflow:hidden;transition:.3s opacity cubic-bezier(.25,1,.5,1)}.kanban-plugin__drag-container>.kanban-plugin__item-wrapper .kanban-plugin__item{border-color:var(--interactive-accent);box-shadow:0 15px 25px #0003,0 0 0 2px rgba(var(--interactive-accent-rgb),.8)}.kanban-plugin__item.is-search-hit{box-shadow:0 15px 25px #0003,0 0 0 1px var(--background-modifier-border)}.kanban-plugin__item.is-search-miss{font-size:.75rem;opacity:.5}.kanban-plugin__item.is-search-miss .kanban-plugin__item-metadata-wrapper{display:none}.kanban-plugin__item-content-wrapper{background:var(--background-primary)}.kanban-plugin__item-title-wrapper{background:var(--background-primary);display:flex;padding:6px 8px}.kanban-plugin__item-title-wrapper:not(:only-child){border-bottom:1px solid var(--background-modifier-border)}.kanban-plugin__item-title{width:100%;line-height:1.5;overflow:hidden}.kanban-plugin__markdown-preview-view{font-family:var(--font-text, var(--default-font));font-size:.875rem;padding:unset;width:unset;height:unset;position:unset;overflow-y:unset;overflow-wrap:unset;color:unset;user-select:unset;-webkit-user-select:unset}.kanban-plugin__markdown-preview-view p,.kanban-plugin__markdown-preview-view ul,.kanban-plugin__markdown-preview-view ol,.kanban-plugin__markdown-preview-view blockquote{margin-block-start:.66em;margin-block-end:.66em}.kanban-plugin__markdown-preview-view blockquote{margin-inline-start:0;margin-inline-end:0}.kanban-plugin__markdown-preview-view ul ol,.kanban-plugin__markdown-preview-view ol ul,.kanban-plugin__markdown-preview-view ul ul,.kanban-plugin__markdown-preview-view ol ol{margin-block-start:0em;margin-block-end:0em}.kanban-plugin__markdown-preview-view>div>*{overflow-x:auto;overflow-wrap:break-word}.kanban-plugin__markdown-preview-view>div>*:first-child,.kanban-plugin__markdown-preview-view>div>.frontmatter-container+*{margin-top:0}.kanban-plugin__markdown-preview-view>div>*:last-child{margin-bottom:0}.kanban-plugin__markdown-preview-view ul,.kanban-plugin__markdown-preview-view ol{padding-inline-start:24px}.kanban-plugin__meta-value .kanban-plugin__markdown-preview-view p,.kanban-plugin__meta-value .kanban-plugin__markdown-preview-view{font-size:inherit;color:inherit;line-height:inherit}.kanban-plugin__markdown-preview-view.inline p,.kanban-plugin__markdown-preview-view.inline{display:inline-block}.kanban-plugin__markdown-preview-view .frontmatter,.kanban-plugin__markdown-preview-view .frontmatter-container{display:none}.kanban-plugin__markdown-preview-view .file-link span{display:inline-flex;align-items:center;justify-content:center;color:var(--text-faint);margin-left:2px;position:relative;top:3px}.kanban-plugin__embed-link-wrapper{padding:2px;float:right}.kanban-plugin__item-metadata-wrapper:not(:empty){background-color:var(--background-primary-alt);padding:6px 8px}.kanban-plugin__item-metadata:not(:empty){padding-top:5px;font-size:12px;font-weight:500;color:var(--text-muted)}.kanban-plugin__item-metadata>span{display:block}.kanban-plugin__item-metadata .is-button{cursor:pointer}.kanban-plugin__item-metadata .is-button:hover{color:var(--text-normal)}.kanban-plugin__item-metadata-date-relative:first-letter{text-transform:uppercase}.kanban-plugin__item-metadata a{text-decoration:none}.kanban-plugin__item-metadata-time:before{content:" \2022 "}.kanban-plugin__item-metadata-time.is-button:hover:before{color:var(--text-muted)}.kanban-plugin__item-metadata-date-wrapper{padding-top:2px}.kanban-plugin__item-tags:not(:empty){padding-top:2px}.kanban-plugin__item-tag{display:inline-block;margin-right:4px}.kanban-plugin__item-tags .kanban-plugin__item-tag{background-color:var( --tag-background-color, rgba(var(--interactive-accent-rgb), .1) );color:var(--tag-color, var(--text-accent));padding:1px 4px;border-radius:6px;margin:3px 3px 0 0}.kanban-plugin__item-tag.is-search-match,.kanban-plugin__item-tags .kanban-plugin__item-tag.is-search-match{background-color:var(--text-highlight-bg);color:var(--text-normal)}.kanban-plugin__meta-table{width:100%;margin:0;line-height:1.5;font-size:.75rem}.kanban-plugin__meta-table td{vertical-align:top;padding:3px 0;width:10%}.kanban-plugin__meta-table td+td{width:90%}.kanban-plugin__meta-table td:only-child{width:100%}.kanban-plugin__meta-table td.kanban-plugin__meta-key{white-space:nowrap;padding-right:5px;color:var(--text-muted)}.kanban-plugin__meta-table td.kanban-plugin__meta-key.is-search-match>span{background-color:var(--text-highlight-bg);color:var(--text-normal)}.kanban-plugin__meta-value{white-space:pre-wrap;display:flex}.kanban-plugin__meta-value>.is-search-match,.kanban-plugin__meta-value.is-search-match{background-color:var(--text-highlight-bg);color:var(--text-normal)}.kanban-plugin__item-prefix-button-wrapper,.kanban-plugin__item-postfix-button-wrapper{display:flex;flex-grow:0;flex-shrink:0}.kanban-plugin__item-prefix-button-wrapper{flex-direction:column}.kanban-plugin__item-prefix-button-wrapper input[type=checkbox]{margin:4px 7px 4px 0;width:15px;height:15px;filter:hue-rotate(42deg)}.kanban-plugin__item-prefix-button-wrapper input[type=checkbox]+button{margin-top:10px}button.kanban-plugin__item-postfix-button{visibility:hidden;opacity:0;transition:.1s opacity;display:flex;align-self:flex-start}button.kanban-plugin__item-postfix-button.is-enabled,.kanban-plugin__item:hover button.kanban-plugin__item-postfix-button{visibility:visible;opacity:1}.kanban-plugin__item-settings-actions{padding:5px;display:flex}.kanban-plugin__item-settings-actions>button{line-height:1;display:flex;align-items:center;justify-content:center;font-size:.75rem;width:100%}.kanban-plugin__lane-action-wrapper button>.kanban-plugin__icon,.kanban-plugin__item-settings-actions button>.kanban-plugin__icon{margin-right:5px}.kanban-plugin__item-settings-actions>button:first-child,.kanban-plugin__lane-action-wrapper>button:first-child{margin-right:2.5px}.kanban-plugin__item-settings-actions>button:last-child,.kanban-plugin__lane-action-wrapper>button:last-child{margin-left:2.5px}.kanban-plugin__archive-lane-button,.kanban-plugin__item-button-archive{color:var(--text-muted);border:1px solid var(--background-modifier-border)}.kanban-plugin__archive-lane-button:hover,.kanban-plugin__item-button-archive:hover{color:var(--text-normal)}.kanban-plugin__item-button-delete{border:1px solid rgba(var(--background-modifier-error-rgb),.15);color:rgba(var(--background-modifier-error-rgb),1)}.kanban-plugin__item-button-delete:hover{background-color:rgba(var(--background-modifier-error-rgb),.2);color:var(--text-error)}.theme-dark .kanban-plugin__item-button-delete{background-color:transparent;border:1px solid rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.theme-dark .kanban-plugin__item-button-delete:hover{background-color:rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.kanban-plugin__checkbox-wrapper{border-top:1px solid var(--background-modifier-border);border-bottom:1px solid var(--background-modifier-border);padding:10px;margin-bottom:10px;display:flex;align-items:center}.kanban-plugin__checkbox-wrapper .checkbox-container{flex-shrink:0;flex-grow:0;margin-left:15px}.kanban-plugin__checkbox-label{font-size:.8125rem;line-height:1.4}.kanban-plugin__lane-setting-wrapper>div{border-top:none;border-bottom:none;padding:10px 15px;margin-bottom:0}.kanban-plugin__lane-setting-wrapper>div:last-child{border-bottom:1px solid var(--background-modifier-border);margin-bottom:10px}.kanban-plugin__action-confirm-wrapper{border:1px solid rgba(var(--background-modifier-error-rgb),.2);background-color:rgba(var(--background-modifier-error-rgb),.1);border-radius:4px;padding:10px;margin:5px 10px}.theme-dark .kanban-plugin__action-confirm-wrapper{border:1px solid rgba(var(--background-modifier-error-rgb),1)}.kanban-plugin__delete-lane-button,.kanban-plugin__archive-lane-button{display:flex;align-items:center;justify-content:center;font-size:.75rem;width:50%}.kanban-plugin__delete-lane-button{border:1px solid rgba(var(--background-modifier-error-rgb),.15);color:rgba(var(--background-modifier-error-rgb),1)}.kanban-plugin__delete-lane-button:hover{background-color:rgba(var(--background-modifier-error-rgb),.2);color:var(--text-error)}.theme-dark .kanban-plugin__delete-lane-button{background-color:transparent;border:1px solid rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.theme-dark .kanban-plugin__delete-lane-button:hover{background-color:rgba(var(--background-modifier-error-rgb),1);color:var(--text-error)}.kanban-plugin__action-confirm-text{font-size:.875rem;color:var(--text-error);margin-bottom:10px;line-height:1.4}button.kanban-plugin__confirm-action-button{border:1px solid rgba(var(--background-modifier-error-rgb),.2);margin-right:5px;color:var(--text-error)}button.kanban-plugin__confirm-action-button:hover{background-color:rgba(var(--background-modifier-error-rgb),.5)}button.kanban-plugin__cancel-action-button{border:1px solid var(--background-modifier-border)}.kanban-plugin__grow-wrap{width:100%;display:grid}.kanban-plugin__grow-wrap:after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.kanban-plugin__grow-wrap>textarea{resize:none;overflow:hidden;tab-size:2}.kanban-plugin__grow-wrap>textarea:focus{border-color:var(--interactive-accent)}.kanban-plugin__grow-wrap>textarea,.kanban-plugin__grow-wrap:after{border:1px solid var(--background-modifier-border);padding:5px 7px;font:inherit;line-height:1.5;grid-area:1 / 1 / 2 / 2;font-size:.875rem;overflow:hidden;overflow-wrap:break-word;white-space:pre-wrap}.kanban-plugin__autocomplete{font-size:.875rem;border:1px solid var(--background-modifier-border);background-color:var(--background-primary);list-style:none;padding:0;margin:0;min-width:20ch;max-width:40ch;max-height:200px;border-radius:6px;box-shadow:0 15px 25px #0003;overflow-x:hidden;overflow-y:auto}.kanban-plugin__autocomplete li{margin:0}.kanban-plugin__autocomplete li em{opacity:.6}.kanban-plugin .textcomplete-footer,.kanban-plugin .textcomplete-header{display:none}.kanban-plugin__autocomplete-item-active,.kanban-plugin__autocomplete-item{border-top:1px solid var(--background-modifier-border);padding:4px 6px;cursor:pointer}.kanban-plugin__autocomplete .textcomplete-header+.kanban-plugin__autocomplete-item,.kanban-plugin__autocomplete .textcomplete-header+.kanban-plugin__autocomplete-item-active{border-top:none}.kanban-plugin__autocomplete-item:hover,.kanban-plugin__autocomplete-item-active{color:var(--text-on-accent);background-color:var(--interactive-accent-hover)}.kanban-plugin__file-suggestion-wrapper{display:flex;line-height:1.2}.kanban-plugin__file-suggestion-icon{flex-shrink:0;flex-grow:0;padding-right:4px}.kanban-plugin__file-suggestion-subtitle{font-size:.875em;color:var(--text-muted)}.kanban-plugin__autocomplete-item:hover .kanban-plugin__file-suggestion-subtitle,.kanban-plugin__autocomplete-item-active .kanban-plugin__file-suggestion-subtitle{color:var(--text-on-accent)}.modal.kanban-plugin__board-settings-modal{max-height:90vh;padding:0;display:flex;flex-direction:column}.modal.kanban-plugin__board-settings-modal .modal-content{padding:30px 50px;height:100%;overflow-y:auto;overflow-x:hidden;margin:0}.kanban-plugin__board-settings-modal .setting-item{flex-wrap:wrap;justify-content:space-between}.kanban-plugin__board-settings-modal .setting-item-info{max-width:400px;min-width:300px;width:50%}.kanban-plugin__board-settings-modal .setting-item-control{min-width:300px;flex-shrink:0}.kanban-plugin__board-settings-modal .choices{width:100%;text-align:left}.kanban-plugin__board-settings-modal .choices[data-type*=select-one] .choices__inner{background-color:var(--background-primary);border-color:var(--background-modifier-border);padding:0;min-height:0}.kanban-plugin__board-settings-modal .choices[data-type*=select-one] .choices__input{background-color:var(--background-primary);border-bottom-color:var(--background-modifier-border);font-size:14px}.kanban-plugin__board-settings-modal .choices__input{border-radius:0;border-top:none;border-left:none;border-right:none}.kanban-plugin__board-settings-modal .choices__list[role=listbox]{overflow-x:hidden}.kanban-plugin__board-settings-modal .choices__list--single{padding:4px 20px 4px 6px}.kanban-plugin__board-settings-modal .is-open .choices__list--dropdown,.kanban-plugin__board-settings-modal .choices__list--dropdown{background-color:var(--background-primary);border-color:var(--background-modifier-border);word-break:normal;max-height:200px;display:flex;flex-direction:column}.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item--selectable:after{display:none}.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item--selectable{padding:4px 6px}.kanban-plugin__board-settings-modal .choices__list--dropdown .choices__item.is-highlighted{background-color:var(--background-primary-alt)}.kanban-plugin__board-settings-modal .choices__placeholder{opacity:1;color:var(--text-muted)}.kanban-plugin__board-settings-modal .error{border-color:var(--background-modifier-error-hover)!important}.kanban-plugin__date-picker{position:absolute;z-index:var(--layer-popover);--cell-size: 2.4em}.kanban-plugin__date-picker .flatpickr-input{width:0;height:0;opacity:0;border:none;padding:0;display:block;margin-bottom:-1px}.kanban-plugin__date-picker .flatpickr-current-month{color:var(--text-normal);font-weight:600;font-size:inherit;width:100%;position:static;height:auto;display:flex;align-items:center;justify-content:center;padding:0}.kanban-plugin__date-picker .flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:var(--text-normal)}.kanban-plugin__date-picker .flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:var(--text-normal)}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{fill:currentColor}.kanban-plugin__date-picker .flatpickr-calendar{font-size:13px;overflow:hidden;background-color:var(--background-primary);width:calc(var(--cell-size) * 7 + 8px);box-shadow:0 0 0 1px var(--background-modifier-border),0 15px 25px #0003}.kanban-plugin__date-picker .flatpickr-months{font-size:13px;padding:2px 2px 4px;align-items:center}.kanban-plugin__date-picker .flatpickr-months .flatpickr-current-month input.cur-year,.kanban-plugin__date-picker .flatpickr-months select{border-radius:4px;padding:4px}.kanban-plugin__date-picker .flatpickr-months .numInputWrapper{border-radius:4px}.kanban-plugin__date-picker .flatpickr-months .flatpickr-month{width:100%;height:auto}.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month,.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month{color:var(--text-normal);fill:currentColor;border-radius:4px;display:flex;align-items:center;justify-content:center;line-height:1;height:auto;padding:5px;position:static;flex-shrink:0}.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month:hover,.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month:hover{background-color:var(--background-primary-alt);color:var(--text-normal)}.kanban-plugin__date-picker .flatpickr-months .flatpickr-prev-month:hover svg,.kanban-plugin__date-picker .flatpickr-months .flatpickr-next-month:hover svg{fill:currentColor}.kanban-plugin__date-picker .flatpickr-current-month .flatpickr-monthDropdown-months{color:var(--text-normal);font-weight:inherit;margin-right:5px}.kanban-plugin__date-picker .flatpickr-current-month input.cur-year{color:var(--text-normal);font-weight:inherit}.kanban-plugin__date-picker .flatpickr-weekdays{height:auto;padding:8px 0 12px}.kanban-plugin__date-picker span.flatpickr-weekday{font-weight:400;color:var(--text-muted)}.kanban-plugin__date-picker .flatpickr-innerContainer{padding:4px}.kanban-plugin__date-picker .flatpickr-day{color:var(--text-normal);display:inline-flex;align-items:center;justify-content:center;width:var(--cell-size);height:var(--cell-size);line-height:1;border-radius:6px}.kanban-plugin__date-picker .flatpickr-day.today{border-color:var(--interactive-accent)}.kanban-plugin__date-picker .flatpickr-day.today:hover{color:var(--text-normal);border-color:var(--interactive-accent);background-color:var(--background-primary-alt)}.kanban-plugin__date-picker .flatpickr-day.selected{border-color:var(--interactive-accent);background-color:var(--interactive-accent);color:var(--text-on-accent)}.kanban-plugin__date-picker .flatpickr-day.selected:hover{border-color:var(--interactive-accent);background-color:var(--interactive-accent)}.kanban-plugin__date-picker .flatpickr-days{width:calc(var(--cell-size) * 7)}.kanban-plugin__date-picker .dayContainer{width:calc(var(--cell-size) * 7);min-width:calc(var(--cell-size) * 7);max-width:calc(var(--cell-size) * 7)}.kanban-plugin__date-picker .flatpickr-day.inRange,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay.inRange,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay.inRange,.kanban-plugin__date-picker .flatpickr-day.today.inRange,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay.today.inRange,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay.today.inRange,.kanban-plugin__date-picker .flatpickr-day:hover,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay:hover,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay:hover,.kanban-plugin__date-picker .flatpickr-day:focus,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay:focus,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay:focus{background-color:var(--background-primary-alt);border-color:var(--background-primary-alt)}.kanban-plugin__date-picker .flatpickr-day.flatpickr-disabled,.kanban-plugin__date-picker .flatpickr-day.flatpickr-disabled:hover,.kanban-plugin__date-picker .flatpickr-day.prevMonthDay,.kanban-plugin__date-picker .flatpickr-day.nextMonthDay,.kanban-plugin__date-picker .flatpickr-day.notAllowed,.kanban-plugin__date-picker .flatpickr-day.notAllowed.prevMonthDay,.kanban-plugin__date-picker .flatpickr-day.notAllowed.nextMonthDay{color:var(--text-faint)}.kanban-plugin__time-picker{position:absolute;max-height:250px;overflow:auto;border-radius:4px;border:1px solid var(--background-modifier-border);box-shadow:0 2px 8px var(--background-modifier-box-shadow);background:var(--background-primary);color:var(--text-normal);font-size:14px;z-index:var(--layer-menu)}.kanban-plugin__time-picker-item{display:flex;align-items:center;color:var(--text-muted);cursor:pointer;line-height:1;padding:6px 8px}.kanban-plugin__time-picker-check{visibility:hidden;display:inline-flex;margin-right:5px}.kanban-plugin__time-picker-item.is-hour{color:var(--text-normal);font-weight:600}.kanban-plugin__time-picker-item.is-selected .kanban-plugin__time-picker-check{visibility:visible}.kanban-plugin__time-picker-item:hover,.kanban-plugin__time-picker-item.is-selected{background:var(--background-secondary)}.kanban-plugin mark{background-color:var(--text-highlight-bg)}.kanban-plugin__draggable-setting-container{border-top:0;padding:0;flex-direction:column}.kanban-plugin__draggable-setting-container>div{width:100%;margin-right:0!important}.kanban-plugin__setting-item-wrapper{border-top:1px solid var(--background-modifier-border)}.kanban-plugin__draggable-setting-container>.kanban-plugin__placeholder{border-top:1px solid var(--background-modifier-border)}.kanban-plugin__setting-item{background-color:var(--background-secondary);width:100%;font-size:16px;display:flex;align-items:flex-start;padding:12px;color:var(--text-muted)}.kanban-plugin__drag-container .kanban-plugin__setting-item{border:1px solid rgba(var(--interactive-accent-rgb),.8);box-shadow:0 15px 25px #0003,0 0 0 2px rgba(var(--interactive-accent-rgb),.8)}.kanban-plugin__setting-controls-wrapper{flex-grow:1;flex-shrink:1}.kanban-plugin__setting-input-wrapper{display:flex;flex-wrap:wrap;margin-bottom:1rem}.kanban-plugin__setting-input-wrapper>div{margin-right:10px}.kanban-plugin__setting-toggle-wrapper>div{display:flex;align-items:center;line-height:1;margin-bottom:10px}.kanban-plugin__setting-toggle-wrapper .checkbox-container{margin-right:10px}.kanban-plugin__setting-button-wrapper{display:flex;justify-content:flex-end;flex-grow:1;flex-shrink:0;max-width:25px}.kanban-plugin__setting-button-wrapper>div{margin-left:12px}.kanban-plugin__setting-key-input-wrapper{margin:1rem 0}.kanban-plugin__setting-key-input-wrapper>input{margin-right:10px}.kanban-plugin__tag-color-input-wrapper{display:flex;flex-direction:column;flex-grow:1;gap:1rem}.kanban-plugin__add-tag-color-button{align-self:baseline;margin:0}.kanban-plugin__tag-color-input .kanban-plugin__item-tags{background-color:var(--background-primary);padding:10px;margin:0;border-radius:4px}.kanban-plugin__tag-color-input .kanban-plugin__item-tag{margin-top:0;font-size:13px;font-weight:500;line-height:1.5}.kanban-plugin__metadata-setting-desc{font-size:14px}.kanban-plugin__setting-button-spacer{visibility:hidden}.kanban-plugin__setting-item-label{font-size:12px;font-weight:bold;margin-bottom:5px}.kanban-plugin__setting-toggle-wrapper .kanban-plugin__setting-item-label{margin-bottom:0}.kanban-plugin__hitbox{border:2px dashed tomato}.kanban-plugin__placeholder{flex-grow:0;flex-shrink:0;width:0;height:0;pointer-events:none}.kanban-plugin__placeholder[data-axis=horizontal]{height:100%}.kanban-plugin__placeholder[data-axis=vertical]{width:100%}body:not(.native-scrollbars) .kanban-plugin__scroll-container::-webkit-scrollbar{background-color:transparent;width:16px;height:16px}body:not(.native-scrollbars) .kanban-plugin__scroll-container::-webkit-scrollbar-thumb{border:4px solid transparent;background-clip:content-box}.kanban-plugin__scroll-container{will-change:transform}.kanban-plugin__scroll-container.kanban-plugin__horizontal{overflow-y:hidden;overflow-x:auto}.kanban-plugin__scroll-container.kanban-plugin__vertical{overflow-y:auto;overflow-x:hidden}.kanban-plugin__drag-container{contain:layout size;z-index:10000;pointer-events:none;position:fixed;top:0;left:0}.kanban-plugin__loading{background-color:var(--background-secondary-alt);width:100%;height:100%;display:flex;justify-content:center;align-items:center}.sk-pulse{width:60px;height:60px;background-color:var(--text-faint);border-radius:100%;animation:sk-pulse 1.2s infinite cubic-bezier(.455,.03,.515,.955)}@keyframes sk-pulse{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}.kanban-plugin__color-picker-wrapper{position:relative}.kanban-plugin__color-picker{position:absolute;top:-5px;left:0;transform:translateY(-100%)} diff --git a/.obsidian/plugins/obsidian-map-view/data.json b/.obsidian/plugins/obsidian-map-view/data.json index 1b3160fe..5719e580 100644 --- a/.obsidian/plugins/obsidian-map-view/data.json +++ b/.obsidian/plugins/obsidian-map-view/data.json @@ -21,7 +21,7 @@ } }, { - "ruleName": "*Coffee", + "ruleName": "#Coffee", "preset": false, "iconDetails": { "prefix": "fas", @@ -30,7 +30,7 @@ } }, { - "ruleName": "*Investment", + "ruleName": "#Investment", "preset": false, "iconDetails": { "prefix": "fas", @@ -39,7 +39,7 @@ } }, { - "ruleName": "*Hotel", + "ruleName": "#Hotel", "preset": false, "iconDetails": { "prefix": "fas", @@ -47,7 +47,7 @@ } }, { - "ruleName": "*Restaurant", + "ruleName": "#Restaurant", "preset": false, "iconDetails": { "prefix": "fas", @@ -56,7 +56,7 @@ } }, { - "ruleName": "*Bar", + "ruleName": "#Bar", "preset": false, "iconDetails": { "prefix": "fas", @@ -65,7 +65,7 @@ } }, { - "ruleName": "*Sport", + "ruleName": "#Horse", "preset": false, "iconDetails": { "prefix": "fas", @@ -74,13 +74,31 @@ } }, { - "ruleName": "*Person", + "ruleName": "#Person", "preset": false, "iconDetails": { "prefix": "fas", "markerColor": "pink", "icon": "fa-user-secret" } + }, + { + "ruleName": "#Service", + "preset": false, + "iconDetails": { + "prefix": "fas", + "markerColor": "yellow", + "icon": "fa-shop" + } + }, + { + "ruleName": "#Football", + "preset": false, + "iconDetails": { + "prefix": "fas", + "markerColor": "green", + "icon": "fa-futbol" + } } ], "zoomOnGoFromNote": 15, @@ -103,6 +121,12 @@ "regExp": "https:\\/\\/www.openstreetmap.org\\S*query=([0-9\\.\\-]+%2C[0-9\\.\\-]+)\\S*", "preset": true, "ruleType": "latLng" + }, + { + "name": "Generic Lat,Lng", + "regExp": "([0-9\\.\\-]+), ([0-9\\.\\-]+)", + "ruleType": "latLng", + "preset": true } ], "mapControls": { @@ -126,6 +150,7 @@ "chosenMapMode": "auto", "saveHistory": true, "letZoomBeyondMax": false, + "queryForFollowActiveNote": "path:\"$PATH$\"", "tilesUrl": null, "snippetLines": 3, "darkMode": false, diff --git a/.obsidian/plugins/obsidian-reminder-plugin/data.json b/.obsidian/plugins/obsidian-reminder-plugin/data.json index 089cdc84..5af64cda 100644 --- a/.obsidian/plugins/obsidian-reminder-plugin/data.json +++ b/.obsidian/plugins/obsidian-reminder-plugin/data.json @@ -87,15 +87,15 @@ } ], "05.02 Networks/Server VPN.md": [ - { - "title": ":shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard %%done_del%%", - "time": "2022-09-18", - "rowNumber": 292 - }, { "title": ":shield: [[Server VPN]]: Backup server %%done_del%%", "time": "2022-10-04", "rowNumber": 287 + }, + { + "title": ":shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard %%done_del%%", + "time": "2022-12-18", + "rowNumber": 292 } ], "04.01 lebv.org/Hosting Tasks.md": [ @@ -341,25 +341,15 @@ } ], "01.02 Home/Household.md": [ - { - "title": ":bed: [[Household]] Change bedsheets %%done_del%%", - "time": "2022-09-17", - "rowNumber": 92 - }, - { - "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", - "time": "2022-09-20", - "rowNumber": 78 - }, { "title": "🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%%", "time": "2022-09-24", - "rowNumber": 85 + "rowNumber": 86 }, { "title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%", "time": "2022-09-26", - "rowNumber": 87 + "rowNumber": 88 }, { "title": "♻ [[Household]]: *Paper* recycling collection %%done_del%%", @@ -369,22 +359,32 @@ { "title": "🛌 [[Household]]: Buy new bed clothes", "time": "2022-09-30", - "rowNumber": 57 + "rowNumber": 61 + }, + { + "title": ":bed: [[Household]] Change bedsheets %%done_del%%", + "time": "2022-10-01", + "rowNumber": 93 + }, + { + "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", + "time": "2022-10-04", + "rowNumber": 78 }, { "title": ":bed: [[Household]]: Buy bed-side tables", "time": "2022-10-31", - "rowNumber": 56 + "rowNumber": 60 }, { "title": ":coffee: [[Household]]: Buy a Cappuccino machine", "time": "2022-11-30", - "rowNumber": 54 + "rowNumber": 58 }, { "title": ":couch_and_lamp: [[Household]]: Replace the sofa", "time": "2022-12-31", - "rowNumber": 55 + "rowNumber": 59 } ], "01.03 Family/Pia Bousquié.md": [ @@ -580,25 +580,13 @@ "00.01 Admin/Calendars/2022-09-12.md": [ { "title": "10:50 :couch_and_lamp: [[2022-09-12|Memo]], [[@Lifestyle]]: sofa options at the border", - "time": "2022-09-17", + "time": "2022-09-25", "rowNumber": 80 }, { "title": "10:50 :chair: [[2022-09-12|Memo]], [[@Lifestyle]]: armchair options at the border", - "time": "2022-09-17", - "rowNumber": 81 - } - ], - "00.01 Admin/Calendars/2022-09-14.md": [ - { - "title": "12:03 :small_airplane: [[2022-09-14|Memo]], [[Geneva]]: reserver un hotel/airbnb pour Geneve", - "time": "2022-09-18", + "time": "2022-09-25", "rowNumber": 81 - }, - { - "title": "12:04 :small_airplane: [[2022-09-14|Memo]], [[@@Paris|Paris]]: reserver billets de train + accommodation pour weekend a Paris", - "time": "2022-09-18", - "rowNumber": 82 } ] }, diff --git a/.obsidian/plugins/plugins-galore/data.json b/.obsidian/plugins/plugins-galore/data.json new file mode 100644 index 00000000..cad5ace3 --- /dev/null +++ b/.obsidian/plugins/plugins-galore/data.json @@ -0,0 +1,24 @@ +{ + "plugins": { + "plugins-galore": { + "repo": { + "domain": "github.com", + "owner": "dylanpizzo", + "name": "obsidian-plugins-galore", + "url": "https://github.com/dylanpizzo/obsidian-plugins-galore", + "type": "github" + }, + "version": "0.1.1" + }, + "obsidian-3d-graph": { + "repo": { + "domain": "github.com", + "owner": "AlexW00", + "name": "obsidian-3d-graph", + "url": "https://github.com/AlexW00/obsidian-3d-graph", + "type": "github" + }, + "version": "1.0.0" + } + } +} \ No newline at end of file diff --git a/.obsidian/plugins/plugins-galore/main.js b/.obsidian/plugins/plugins-galore/main.js new file mode 100644 index 00000000..d69da27d --- /dev/null +++ b/.obsidian/plugins/plugins-galore/main.js @@ -0,0 +1,388 @@ +/* + * THIS IS A GENERATED/BUNDLED FILE. + * The source is available at https://github.com/dylanpizzo/obsidian-plugins-galore. + * Contributions are very welcome! + */ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/main.ts +__export(exports, { + default: () => Galore +}); +var import_obsidian7 = __toModule(require("obsidian")); + +// src/util/cacheRequest.ts +var import_obsidian = __toModule(require("obsidian")); +var cache = []; +var cacheRequest = (req) => __async(void 0, null, function* () { + const filteredCache = cache.filter((item) => item.req === JSON.stringify(req)); + if (filteredCache.length) { + return filteredCache[0].res; + } + const res = yield (0, import_obsidian.request)(req); + cache.push({ req: JSON.stringify(req), res }); + return res; +}); + +// src/util/gitServerInterface.ts +var countRegexInString = (str, re) => ((str || "").match(re) || []).length; +var getKeyWithMax = (obj) => Object.keys(obj).reduce((a, b) => obj[a] >= obj[b] ? a : b, null); +var parseRepoURL = (url) => __async(void 0, null, function* () { + let urlObj = null; + try { + urlObj = new URL(url); + } catch (e) { + urlObj = new URL("https://" + url); + } + const domain = urlObj.hostname; + let path = urlObj.pathname; + if (path[0] === "/") { + path = path.slice(1); + } + const pathParts = path.split("/"); + const owner = pathParts[0]; + const name = pathParts[1]; + const originBody = yield cacheRequest({ url: urlObj.origin }); + const typeScores = { + github: countRegexInString(originBody, /github/gi), + gitea: countRegexInString(originBody, /gitea/gi), + gitlab: countRegexInString(originBody, /gitlab/gi) + }; + const type = getKeyWithMax(typeScores); + return { + domain, + owner, + name, + url, + type + }; +}); +var getRelease = (repo, options) => __async(void 0, null, function* () { + const { type, domain, owner, name } = repo; + const { allowPrerelease = false } = options || {}; + let release = null; + if (type === "github") { + const rawReleases = JSON.parse(yield cacheRequest({ + url: `https://api.${domain}/repos/${owner}/${name}/releases` + })); + const rawRelease = rawReleases.filter((x) => !x.draft && (allowPrerelease || !x.prerelease)).sort((x) => x.published_at)[0]; + release = { + version: rawRelease.tag_name, + assets: rawRelease.assets.map((asset) => ({ + name: asset.name, + url: asset.browser_download_url + })) + }; + } else if (type === "gitea") { + const rawReleases = JSON.parse(yield cacheRequest({ + url: `https://${domain}/api/v1/repos/${owner}/${name}/releases` + })); + const rawRelease = rawReleases.filter((x) => !x.draft && (allowPrerelease || !x.prerelease)).sort((x) => x.published_at)[0]; + release = { + version: rawRelease.tag_name, + assets: rawRelease.assets.map((asset) => ({ + name: asset.name, + url: asset.browser_download_url + })) + }; + } else if (type === "gitlab") { + const rawReleases = JSON.parse(yield cacheRequest({ + url: `https://${domain}/api/v4/projects/${owner}%2F${name}/releases` + })); + const rawRelease = rawReleases.filter((x) => allowPrerelease || !x.upcoming_release).sort((x) => x.published_at)[0]; + release = { + version: rawRelease.tag_name, + assets: rawRelease.assets.links.map((asset) => ({ + name: asset.name, + url: asset.direct_asset_url + })) + }; + } + return release; +}); +var getAsset = (release, name) => __async(void 0, null, function* () { + const asset = release.assets.filter((asset2) => asset2.name === name)[0]; + if (!asset) { + return null; + } + return cacheRequest({ + url: asset.url + }); +}); +var getAssets = (release, names) => __async(void 0, null, function* () { + const assets = names ? release.assets.filter((asset) => names.includes(asset.name)) : release.assets; + return Promise.all(assets.map((asset) => __async(void 0, null, function* () { + return { name: asset.name, content: yield cacheRequest({ url: asset.url }) }; + }))); +}); + +// src/ui/settingsPage.ts +var import_obsidian6 = __toModule(require("obsidian")); + +// src/util/pluginActions.ts +var import_obsidian3 = __toModule(require("obsidian")); + +// src/ui/errorModal.ts +var import_obsidian2 = __toModule(require("obsidian")); +var GaloreErrorModal = class extends import_obsidian2.Modal { + constructor(app2, error) { + super(app2); + this.error = null; + this.error = error; + } + onOpen() { + const { contentEl } = this; + contentEl.setText("Oops. Something went wrong!"); + } + onClose() { + const { contentEl } = this; + contentEl.empty(); + } +}; + +// src/util/pluginActions.ts +var getPluginsDir = (app2) => { + return (0, import_obsidian3.normalizePath)(app2.vault.configDir + "/plugins") + "/"; +}; +var getPluginPath = (app2, pluginID) => { + return getPluginsDir(app2) + pluginID + "/"; +}; +var getRemotePluginMeta = (repo) => __async(void 0, null, function* () { + try { + const release = yield getRelease(repo); + return { repo, version: release.version }; + } catch (error) { + console.error(error); + new GaloreErrorModal(app, error).open(); + } +}); +var getRemotePlugin = (repo) => __async(void 0, null, function* () { + try { + const release = yield getRelease(repo); + const galore = { repo, version: release.version }; + const rawManifest = yield getAsset(release, "manifest.json"); + const manifest = JSON.parse(yield getAsset(release, "manifest.json")); + const assets = yield getAssets(release); + return { + galore, + manifest, + assets + }; + } catch (error) { + console.error(error); + new GaloreErrorModal(app, error).open(); + } +}); +var getLocalPluginMeta = (pluginsGalore, pluginID) => { + return pluginsGalore.galoreData.plugins[pluginID]; +}; +var writePlugin = (pluginsGalore, plugin) => __async(void 0, null, function* () { + try { + const path = getPluginPath(app, plugin.manifest.id); + const adapter = app.vault.adapter; + if (!(yield adapter.exists(path))) { + yield adapter.mkdir(path); + } + pluginsGalore.galoreData.plugins[plugin.manifest.id] = plugin.galore; + yield pluginsGalore.saveGaloreData(); + yield Promise.all(plugin.assets.map((asset) => __async(void 0, null, function* () { + return adapter.write(path + asset.name, asset.content); + }))); + } catch (error) { + console.error(error); + new GaloreErrorModal(app, error).open(); + } +}); +var installPluginFromRepo = (pluginsGalore, repo) => __async(void 0, null, function* () { + const plugin = yield getRemotePlugin(repo); + yield writePlugin(pluginsGalore, plugin); + return plugin; +}); +var getGalorePlugins = (pluginsGalore) => __async(void 0, null, function* () { + try { + const app2 = pluginsGalore.app; + const adapter = app2.vault.adapter; + const pluginsDir = getPluginsDir(app2); + const galorePluginPaths = Object.keys(pluginsGalore.galoreData.plugins).map((pluginID) => pluginsDir + "/" + pluginID + "/"); + const galorePlugins = yield Promise.all(galorePluginPaths.map((path) => __async(void 0, null, function* () { + const localManifest = JSON.parse(yield adapter.read(path + "manifest.json")); + const localGalore = getLocalPluginMeta(pluginsGalore, localManifest.id); + const remoteGalore = yield getRemotePluginMeta(localGalore.repo); + return { + manifest: localManifest, + repo: localGalore.repo, + localVersion: localGalore.version, + remoteVersion: remoteGalore.version, + canUpdate: localGalore.version !== remoteGalore.version + }; + }))); + return galorePlugins; + } catch (error) { + console.error(error); + new GaloreErrorModal(app, error).open(); + } +}); + +// src/ui/updateModal.ts +var import_obsidian4 = __toModule(require("obsidian")); +var GaloreUpdateModal = class extends import_obsidian4.Modal { + constructor(plugin, galorePlugins) { + super(app); + this.galorePlugins = null; + this.plugin = plugin; + this.app = plugin.app; + this.galorePlugins = galorePlugins; + } + onOpen() { + const { contentEl } = this; + contentEl.createEl("h2", { text: "Plugins Galore: Update Plugins" }); + new import_obsidian4.Setting(contentEl).setName("Select the plugins below to update, and then click Update.").setDesc("").addButton((button) => button.setButtonText("Cancel").onClick((ev) => { + this.close(); + })).addButton((button) => button.setButtonText("Update").setCta().onClick((ev) => __async(this, null, function* () { + const pluginsToUpdate = this.galorePlugins.filter((plugin) => plugin.toggle.getValue()); + for (const plugin of pluginsToUpdate) { + yield installPluginFromRepo(this.plugin, plugin.repo); + } + new import_obsidian4.Notice(`Updated ${pluginsToUpdate.length} plugins`); + this.close(); + }))); + for (const plugin of this.galorePlugins) { + new import_obsidian4.Setting(contentEl).setName(plugin.manifest.name).setDesc(`Version: ${plugin.localVersion} -> ${plugin.remoteVersion}`).addToggle((toggle) => { + plugin.toggle = toggle; + toggle.setValue(true); + }); + } + } + onClose() { + const { contentEl } = this; + contentEl.empty(); + } +}; + +// src/ui/addModal.ts +var import_obsidian5 = __toModule(require("obsidian")); +var GaloreAddModal = class extends import_obsidian5.Modal { + constructor(plugin) { + super(app); + this.plugin = plugin; + this.app = plugin.app; + } + onOpen() { + const { contentEl } = this; + contentEl.empty(); + contentEl.createEl("h2", { text: "Plugins Galore: Add a Plugin" }); + let repoURL = ""; + let siteType = "github"; + new import_obsidian5.Setting(contentEl).setName("Repo URL").setDesc("").addText((text) => text.setPlaceholder("https://github.com/{owner}/{plugin-repo}").setValue(repoURL).onChange((value) => { + repoURL = value; + })); + new import_obsidian5.Setting(contentEl).setName("Install the plugin").setDesc("").addButton((button) => button.setButtonText("Install").setCta().onClick((ev) => __async(this, null, function* () { + const repo = yield parseRepoURL(repoURL); + const plugin = yield installPluginFromRepo(this.plugin, repo); + new import_obsidian5.Notice(`Installed ${plugin.manifest.name}.`); + this.close(); + }))); + } + onClose() { + const { contentEl } = this; + contentEl.empty(); + } +}; + +// src/ui/settingsPage.ts +var GaloreSettingTab = class extends import_obsidian6.PluginSettingTab { + constructor(plugin) { + super(app, plugin); + this.plugin = plugin; + this.app = plugin.app; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl("h2", { text: "Plugins Galore" }); + let repoURL = ""; + let repoInput = null; + new import_obsidian6.Setting(containerEl).setName("Add a plugin").setDesc("").addButton((button) => button.setButtonText("Add a plugin").setCta().onClick((ev) => __async(this, null, function* () { + new GaloreAddModal(this.plugin).open(); + }))); + new import_obsidian6.Setting(containerEl).setName("Installed Plugins").setDesc("This only checks for updates on plugins installed through Plugins Galore.").addButton((button) => button.setButtonText("Check for updates").setCta().onClick((ev) => __async(this, null, function* () { + const galorePlugins = yield getGalorePlugins(this.plugin); + const galorePluginsThatCanUpdate = galorePlugins.filter((x) => x.canUpdate); + if (galorePluginsThatCanUpdate.length) { + new GaloreUpdateModal(this.plugin, galorePluginsThatCanUpdate).open(); + } else { + new import_obsidian6.Notice("No plugins updates found."); + } + }))); + } +}; + +// src/main.ts +var Galore = class extends import_obsidian7.Plugin { + onload() { + return __async(this, null, function* () { + yield this.loadGaloreData(); + this.addSettingTab(new GaloreSettingTab(this)); + }); + } + loadGaloreData() { + return __async(this, null, function* () { + this.galoreData = Object.assign({}, { + plugins: { + "plugins-galore": { + repo: yield parseRepoURL("https://github.com/dylanpizzo/obsidian-plugins-galore"), + version: this.manifest.version + } + } + }, yield this.loadData()); + }); + } + saveGaloreData() { + return __async(this, null, function* () { + yield this.saveData(this.galoreData); + }); + } +}; diff --git a/.obsidian/plugins/plugins-galore/manifest.json b/.obsidian/plugins/plugins-galore/manifest.json new file mode 100644 index 00000000..558284b7 --- /dev/null +++ b/.obsidian/plugins/plugins-galore/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "plugins-galore", + "name": "Plugins Galore", + "version": "0.1.1", + "minAppVersion": "0.14.0", + "description": "This is an Obsidian plugin to allow easily sideloading other plugins.", + "author": "Dylan Pizzo", + "authorUrl": "https://github.com/dylanpizzo", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/.obsidian/plugins/podnotes/data.json b/.obsidian/plugins/podnotes/data.json index 1f85fc69..49136443 100644 --- a/.obsidian/plugins/podnotes/data.json +++ b/.obsidian/plugins/podnotes/data.json @@ -155,9 +155,9 @@ "How Queen Elizabeth II Preserved the Monarchy": { "title": "How Queen Elizabeth II Preserved the Monarchy", "podcastName": "The Daily", - "time": 2138.305979181796, - "duration": 2138.3314285714287, - "finished": false + "time": 0, + "duration": 0, + "finished": true }, "Serena Williams’s Final Run": { "title": "Serena Williams’s Final Run", @@ -179,6 +179,20 @@ "time": 2138.305979181796, "duration": 2138.3314285714287, "finished": false + }, + "Can the U.K. Remain United Without the Queen?": { + "title": "Can the U.K. Remain United Without the Queen?", + "podcastName": "The Daily", + "time": 0, + "duration": 2195.16, + "finished": false + }, + "Saladin Takes Back the Holy City": { + "title": "Saladin Takes Back the Holy City", + "podcastName": "HISTORY This Week", + "time": 1826.168163265306, + "duration": 1826.168163265306, + "finished": true } }, "favorites": { @@ -194,6 +208,16 @@ "shouldEpisodeRemoveAfterPlay": true, "shouldRepeat": false, "episodes": [ + { + "title": "How Queen Elizabeth II Preserved the Monarchy", + "streamUrl": "https://dts.podtrac.com/redirect.mp3/chrt.fm/track/8DB4DB/pdst.fm/e/nyt.simplecastaudio.com/03d8b493-87fc-4bd1-931f-8a8e9b945d8a/episodes/e39b8c80-d74f-48f0-880d-78b71cb3c7ff/audio/128/default.mp3?aid=rss_feed&awCollectionId=03d8b493-87fc-4bd1-931f-8a8e9b945d8a&awEpisodeId=e39b8c80-d74f-48f0-880d-78b71cb3c7ff&feed=54nAGcIl", + "url": "https://www.nytimes.com/the-daily", + "description": "

The death of Queen Elizabeth II on Thursday brought to an end a remarkable reign that spanned seven decades, 15 prime ministers and 14 American presidents.

During her time on the throne, which saw the crumbling of the British Empire and the buffeting of the royal family by scandals, Elizabeth’s courtly and reserved manner helped to shore up the monarchy and provided an unwavering constant for her country, the Commonwealth and the wider world.

Guest: Alan Cowell, a contributor to The New York Times and a former Times foreign correspondent.

Background reading: 

For more information on today’s episode, visit nytimes.com/thedaily. Transcripts of each episode will be made available by the next workday. 

\n", + "podcastName": "The Daily", + "artworkUrl": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/1c/ac/04/1cac0421-4483-ff09-4f80-19710d9feda4/mza_12421371692158516891.jpeg/100x100bb.jpg", + "episodeDate": "2022-09-09T09:50:00.000Z", + "feedUrl": "https://feeds.simplecast.com/54nAGcIl" + }, { "title": "A User's Guide to the Midterm Elections", "streamUrl": "https://dts.podtrac.com/redirect.mp3/chrt.fm/track/8DB4DB/pdst.fm/e/nyt.simplecastaudio.com/03d8b493-87fc-4bd1-931f-8a8e9b945d8a/episodes/59692fff-0662-460a-a1a9-7fbc81c0c960/audio/128/default.mp3?aid=rss_feed&awCollectionId=03d8b493-87fc-4bd1-931f-8a8e9b945d8a&awEpisodeId=59692fff-0662-460a-a1a9-7fbc81c0c960&feed=54nAGcIl", @@ -278,13 +302,13 @@ "skipBackwardLength": 15, "skipForwardLength": 15, "currentEpisode": { - "title": "How Queen Elizabeth II Preserved the Monarchy", - "streamUrl": "https://dts.podtrac.com/redirect.mp3/chrt.fm/track/8DB4DB/pdst.fm/e/nyt.simplecastaudio.com/03d8b493-87fc-4bd1-931f-8a8e9b945d8a/episodes/e39b8c80-d74f-48f0-880d-78b71cb3c7ff/audio/128/default.mp3?aid=rss_feed&awCollectionId=03d8b493-87fc-4bd1-931f-8a8e9b945d8a&awEpisodeId=e39b8c80-d74f-48f0-880d-78b71cb3c7ff&feed=54nAGcIl", + "title": "Can the U.K. Remain United Without the Queen?", + "streamUrl": "https://dts.podtrac.com/redirect.mp3/chrt.fm/track/8DB4DB/pdst.fm/e/nyt.simplecastaudio.com/03d8b493-87fc-4bd1-931f-8a8e9b945d8a/episodes/cbe25511-3623-4092-b274-c9bf5cd0c36b/audio/128/default.mp3?aid=rss_feed&awCollectionId=03d8b493-87fc-4bd1-931f-8a8e9b945d8a&awEpisodeId=cbe25511-3623-4092-b274-c9bf5cd0c36b&feed=54nAGcIl", "url": "https://www.nytimes.com/the-daily", - "description": "

The death of Queen Elizabeth II on Thursday brought to an end a remarkable reign that spanned seven decades, 15 prime ministers and 14 American presidents.

During her time on the throne, which saw the crumbling of the British Empire and the buffeting of the royal family by scandals, Elizabeth’s courtly and reserved manner helped to shore up the monarchy and provided an unwavering constant for her country, the Commonwealth and the wider world.

Guest: Alan Cowell, a contributor to The New York Times and a former Times foreign correspondent.

Background reading: 

For more information on today’s episode, visit nytimes.com/thedaily. Transcripts of each episode will be made available by the next workday. 

\n", + "description": "

The funeral of Queen Elizabeth today will be one of the most extraordinary public spectacles of the last several decades in Britain, accompanied by an outpouring of sadness, reverence and respect.

But the end of the queen’s 70-year reign has also prompted long-delayed conversations about the future of the Commonwealth and of the four nations that make up the United Kingdom.

Guest: Mark Landler, the London bureau chief for The New York Times.

Background reading: 

For more information on today’s episode, visit nytimes.com/thedaily. Transcripts of each episode will be made available by the next workday. 

\n", "podcastName": "The Daily", "artworkUrl": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/1c/ac/04/1cac0421-4483-ff09-4f80-19710d9feda4/mza_12421371692158516891.jpeg/100x100bb.jpg", - "episodeDate": "2022-09-09T09:50:00.000Z", + "episodeDate": "2022-09-19T09:50:00.000Z", "feedUrl": "https://feeds.simplecast.com/54nAGcIl" }, "timestamp": { diff --git a/.obsidian/plugins/templater-obsidian/main.js b/.obsidian/plugins/templater-obsidian/main.js index 5b3ee468..d7c5a176 100644 --- a/.obsidian/plugins/templater-obsidian/main.js +++ b/.obsidian/plugins/templater-obsidian/main.js @@ -1765,8 +1765,7 @@ var Suggest = class { } }; var TextInputSuggest = class { - constructor(app, inputEl) { - this.app = app; + constructor(inputEl) { this.inputEl = inputEl; this.scope = new import_obsidian2.Scope(); this.suggestEl = createDiv("suggestion-container"); @@ -1789,13 +1788,13 @@ var TextInputSuggest = class { } if (suggestions.length > 0) { this.suggest.setSuggestions(suggestions); - this.open(this.app.dom.appContainerEl, this.inputEl); + this.open(app.dom.appContainerEl, this.inputEl); } else { this.close(); } } open(container, inputEl) { - this.app.keymap.pushScope(this.scope); + app.keymap.pushScope(this.scope); container.appendChild(this.suggestEl); this.popper = createPopper(inputEl, this.suggestEl, { placement: "bottom-start", @@ -1818,7 +1817,7 @@ var TextInputSuggest = class { }); } close() { - this.app.keymap.popScope(this.scope); + app.keymap.popScope(this.scope); this.suggest.setSuggestions([]); if (this.popper) this.popper.destroy(); @@ -1829,7 +1828,7 @@ var TextInputSuggest = class { // src/settings/suggesters/FolderSuggester.ts var FolderSuggest = class extends TextInputSuggest { getSuggestions(inputStr) { - const abstractFiles = this.app.vault.getAllLoadedFiles(); + const abstractFiles = app.vault.getAllLoadedFiles(); const folders = []; const lowerCaseInputStr = inputStr.toLowerCase(); abstractFiles.forEach((folder) => { @@ -1863,7 +1862,7 @@ function escape_RegExp(str) { function generate_dynamic_command_regex() { return /(<%(?:-|_)?\s*[*~]{0,1})\+((?:.|\s)*?%>)/g; } -function resolve_tfolder(app, folder_str) { +function resolve_tfolder(folder_str) { folder_str = (0, import_obsidian4.normalizePath)(folder_str); const folder = app.vault.getAbstractFileByPath(folder_str); if (!folder) { @@ -1874,7 +1873,7 @@ function resolve_tfolder(app, folder_str) { } return folder; } -function resolve_tfile(app, file_str) { +function resolve_tfile(file_str) { file_str = (0, import_obsidian4.normalizePath)(file_str); const file = app.vault.getAbstractFileByPath(file_str); if (!file) { @@ -1885,8 +1884,8 @@ function resolve_tfile(app, file_str) { } return file; } -function get_tfiles_from_folder(app, folder_str) { - const folder = resolve_tfolder(app, folder_str); +function get_tfiles_from_folder(folder_str) { + const folder = resolve_tfolder(folder_str); const files = []; import_obsidian4.Vault.recurseChildren(folder, (file) => { if (file instanceof import_obsidian4.TFile) { @@ -1914,9 +1913,8 @@ var FileSuggestMode; FileSuggestMode2[FileSuggestMode2["ScriptFiles"] = 1] = "ScriptFiles"; })(FileSuggestMode || (FileSuggestMode = {})); var FileSuggest = class extends TextInputSuggest { - constructor(app, inputEl, plugin, mode) { - super(app, inputEl); - this.app = app; + constructor(inputEl, plugin, mode) { + super(inputEl); this.inputEl = inputEl; this.plugin = plugin; this.mode = mode; @@ -1938,7 +1936,7 @@ var FileSuggest = class extends TextInputSuggest { } } getSuggestions(input_str) { - const all_files = errorWrapperSync(() => get_tfiles_from_folder(this.app, this.get_folder(this.mode)), this.get_error_msg(this.mode)); + const all_files = errorWrapperSync(() => get_tfiles_from_folder(this.get_folder(this.mode)), this.get_error_msg(this.mode)); if (!all_files) { return []; } @@ -1979,9 +1977,8 @@ var DEFAULT_SETTINGS = { enable_ribbon_icon: true }; var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { - constructor(app, plugin) { + constructor(plugin) { super(app, plugin); - this.app = app; this.plugin = plugin; } display() { @@ -2006,7 +2003,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { } add_template_folder_setting() { new import_obsidian6.Setting(this.containerEl).setName("Template folder location").setDesc("Files in this folder will be available as templates.").addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); + new FolderSuggest(cb.inputEl); cb.setPlaceholder("Example: folder1/folder2").setValue(this.plugin.settings.templates_folder).onChange((new_folder) => { this.plugin.settings.templates_folder = new_folder; this.plugin.save_settings(); @@ -2067,7 +2064,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { this.plugin.save_settings(); if (this.plugin.settings.enable_ribbon_icon) { this.plugin.addRibbonIcon("templater-icon", "Templater", () => __async(this, null, function* () { - this.fuzzy_suggester.insert_template(); + this.plugin.fuzzy_suggester.insert_template(); })).setAttribute("id", "rb-templater-icon"); } else { (_a = document.getElementById("rb-templater-icon")) == null ? void 0 : _a.remove(); @@ -2082,7 +2079,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { new import_obsidian6.Setting(this.containerEl).setDesc(desc); this.plugin.settings.enabled_templates_hotkeys.forEach((template, index) => { const s = new import_obsidian6.Setting(this.containerEl).addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl, this.plugin, FileSuggestMode.TemplateFiles); + new FileSuggest(cb.inputEl, this.plugin, FileSuggestMode.TemplateFiles); cb.setPlaceholder("Example: folder1/template_file").setValue(template).onChange((new_template) => { if (new_template && this.plugin.settings.enabled_templates_hotkeys.contains(new_template)) { log_error(new TemplaterError("This template is already bound to a hotkey")); @@ -2095,8 +2092,8 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { cb.containerEl.addClass("templater_search"); }).addExtraButton((cb) => { cb.setIcon("any-key").setTooltip("Configure Hotkey").onClick(() => { - this.app.setting.openTabById("hotkeys"); - const tab = this.app.setting.activeTab; + app.setting.openTabById("hotkeys"); + const tab = app.setting.activeTab; tab.searchInputEl.value = "Templater: Insert"; tab.updateHotkeyVisibility(); }); @@ -2159,7 +2156,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { }); this.plugin.settings.folder_templates.forEach((folder_template, index) => { const s = new import_obsidian6.Setting(this.containerEl).addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); + new FolderSuggest(cb.inputEl); cb.setPlaceholder("Folder").setValue(folder_template.folder).onChange((new_folder) => { if (new_folder && this.plugin.settings.folder_templates.some((e) => e.folder == new_folder)) { log_error(new TemplaterError("This folder already has a template associated with it")); @@ -2170,7 +2167,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { }); cb.containerEl.addClass("templater_search"); }).addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl, this.plugin, FileSuggestMode.TemplateFiles); + new FileSuggest(cb.inputEl, this.plugin, FileSuggestMode.TemplateFiles); cb.setPlaceholder("Template").setValue(folder_template.template).onChange((new_template) => { this.plugin.settings.folder_templates[index].template = new_template; this.plugin.save_settings(); @@ -2205,7 +2202,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { new import_obsidian6.Setting(this.containerEl).setDesc(desc); this.plugin.settings.startup_templates.forEach((template, index) => { const s = new import_obsidian6.Setting(this.containerEl).addSearch((cb) => { - new FileSuggest(this.app, cb.inputEl, this.plugin, FileSuggestMode.TemplateFiles); + new FileSuggest(cb.inputEl, this.plugin, FileSuggestMode.TemplateFiles); cb.setPlaceholder("Example: folder1/template_file").setValue(template).onChange((new_template) => { if (new_template && this.plugin.settings.startup_templates.contains(new_template)) { log_error(new TemplaterError("This startup template already exist")); @@ -2240,7 +2237,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { text: "documentation" }), " for more information."); new import_obsidian6.Setting(this.containerEl).setName("Script files folder location").setDesc(desc).addSearch((cb) => { - new FolderSuggest(this.app, cb.inputEl); + new FolderSuggest(cb.inputEl); cb.setPlaceholder("Example: folder1/folder2").setValue(this.plugin.settings.user_scripts_folder).onChange((new_folder) => { this.plugin.settings.user_scripts_folder = new_folder; this.plugin.save_settings(); @@ -2252,7 +2249,7 @@ var TemplaterSettingTab = class extends import_obsidian6.PluginSettingTab { if (!this.plugin.settings.user_scripts_folder) { name = "No User Scripts folder set"; } else { - const files = errorWrapperSync(() => get_tfiles_from_folder(this.app, this.plugin.settings.user_scripts_folder), `User Scripts folder doesn't exist`); + const files = errorWrapperSync(() => get_tfiles_from_folder(this.plugin.settings.user_scripts_folder), `User Scripts folder doesn't exist`); if (!files || files.length === 0) { name = "No User Scripts detected"; } else { @@ -2376,17 +2373,16 @@ var OpenMode; OpenMode2[OpenMode2["CreateNoteTemplate"] = 1] = "CreateNoteTemplate"; })(OpenMode || (OpenMode = {})); var FuzzySuggester = class extends import_obsidian7.FuzzySuggestModal { - constructor(app, plugin) { + constructor(plugin) { super(app); - this.app = app; this.plugin = plugin; this.setPlaceholder("Type name of a template..."); } getItems() { if (!this.plugin.settings.templates_folder) { - return this.app.vault.getMarkdownFiles(); + return app.vault.getMarkdownFiles(); } - const files = errorWrapperSync(() => get_tfiles_from_folder(this.app, this.plugin.settings.templates_folder), `Couldn't retrieve template files from templates folder ${this.plugin.settings.templates_folder}`); + const files = errorWrapperSync(() => get_tfiles_from_folder(this.plugin.settings.templates_folder), `Couldn't retrieve template files from templates folder ${this.plugin.settings.templates_folder}`); if (!files) { return []; } @@ -2432,8 +2428,7 @@ var import_obsidian13 = __toModule(require("obsidian")); // src/core/functions/internal_functions/InternalModule.ts var InternalModule = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; this.static_functions = new Map(); this.dynamic_functions = new Map(); @@ -2545,7 +2540,7 @@ var InternalModuleFile = class extends InternalModule { } generate_content() { return __async(this, null, function* () { - return yield this.app.vault.read(this.config.target_file); + return yield app.vault.read(this.config.target_file); }); } generate_create_new() { @@ -2572,7 +2567,7 @@ var InternalModuleFile = class extends InternalModule { } generate_cursor_append() { return (content) => { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian8.MarkdownView); + const active_view = app.workspace.getActiveViewOfType(import_obsidian8.MarkdownView); if (active_view === null) { log_error(new TemplaterError("No active view, can't append to cursor.")); return; @@ -2584,19 +2579,14 @@ var InternalModuleFile = class extends InternalModule { }; } generate_exists() { - return (filename) => { - let match; - if ((match = this.linkpath_regex.exec(filename)) !== null) { - filename = match[1]; - } - const file = this.app.metadataCache.getFirstLinkpathDest(filename, ""); - return file != null; - }; + return (filename) => __async(this, null, function* () { + return yield app.vault.exists(filename); + }); } generate_find_tfile() { return (filename) => { const path = (0, import_obsidian8.normalizePath)(filename); - return this.app.metadataCache.getFirstLinkpathDest(path, ""); + return app.metadataCache.getFirstLinkpathDest(path, ""); }; } generate_folder() { @@ -2621,7 +2611,7 @@ var InternalModuleFile = class extends InternalModule { } let inc_file_content; if (include_link instanceof import_obsidian8.TFile) { - inc_file_content = yield this.app.vault.read(include_link); + inc_file_content = yield app.vault.read(include_link); } else { let match; if ((match = this.linkpath_regex.exec(include_link)) === null) { @@ -2629,14 +2619,14 @@ var InternalModuleFile = class extends InternalModule { throw new TemplaterError("Invalid file format, provide an obsidian link between quotes."); } const { path, subpath } = (0, import_obsidian8.parseLinktext)(match[1]); - const inc_file = this.app.metadataCache.getFirstLinkpathDest(path, ""); + const inc_file = app.metadataCache.getFirstLinkpathDest(path, ""); if (!inc_file) { this.include_depth -= 1; throw new TemplaterError(`File ${include_link} doesn't exist`); } - inc_file_content = yield this.app.vault.read(inc_file); + inc_file_content = yield app.vault.read(inc_file); if (subpath) { - const cache = this.app.metadataCache.getFileCache(inc_file); + const cache = app.metadataCache.getFileCache(inc_file); if (cache) { const result = (0, import_obsidian8.resolveSubpath)(cache, subpath); if (result) { @@ -2672,19 +2662,24 @@ var InternalModuleFile = class extends InternalModule { yield window.app.vault.createFolder(dir); } } - yield this.app.fileManager.renameFile(file, new_path); + yield app.fileManager.renameFile(file, new_path); return ""; }); } generate_path() { return (relative = false) => { + let vault_path = ""; if (import_obsidian8.Platform.isMobileApp) { - return UNSUPPORTED_MOBILE_TEMPLATE; - } - if (!(this.app.vault.adapter instanceof import_obsidian8.FileSystemAdapter)) { - throw new TemplaterError("app.vault is not a FileSystemAdapter instance"); + const vault_adapter = app.vault.adapter.fs.uri; + const vault_base = app.vault.adapter.basePath; + vault_path = `${vault_adapter}/${vault_base}`; + } else { + if (app.vault.adapter instanceof import_obsidian8.FileSystemAdapter) { + vault_path = app.vault.adapter.getBasePath(); + } else { + throw new TemplaterError("app.vault is not a FileSystemAdapter instance"); + } } - const vault_path = this.app.vault.adapter.getBasePath(); if (relative) { return this.config.target_file.path; } else { @@ -2698,13 +2693,13 @@ var InternalModuleFile = class extends InternalModule { throw new TemplaterError("File name cannot contain any of these characters: \\ / :"); } const new_path = (0, import_obsidian8.normalizePath)(`${this.config.target_file.parent.path}/${new_title}.${this.config.target_file.extension}`); - yield this.app.fileManager.renameFile(this.config.target_file, new_path); + yield app.fileManager.renameFile(this.config.target_file, new_path); return ""; }); } generate_selection() { return () => { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian8.MarkdownView); + const active_view = app.workspace.getActiveViewOfType(import_obsidian8.MarkdownView); if (active_view == null) { throw new TemplaterError("Active view is null, can't read selection."); } @@ -2713,8 +2708,11 @@ var InternalModuleFile = class extends InternalModule { }; } generate_tags() { - const cache = this.app.metadataCache.getFileCache(this.config.target_file); - return (0, import_obsidian8.getAllTags)(cache); + const cache = app.metadataCache.getFileCache(this.config.target_file); + if (cache) { + return (0, import_obsidian8.getAllTags)(cache); + } + return null; } generate_title() { return this.config.target_file.basename; @@ -2769,12 +2767,20 @@ var InternalModuleWeb = class extends InternalModule { generate_random_picture() { return (size, query, include_size = false) => __async(this, null, function* () { try { - const response = yield this.getRequest(`https://source.unsplash.com/random/${size != null ? size : ""}?${query != null ? query : ""}`); - const url = response.url; + const response = yield this.getRequest(`https://templater-unsplash.fly.dev/${query ? "?q=" + query : ""}`).then((res) => res.json()); + let url = response.full; + if (size && !include_size) { + if (size.includes("x")) { + const [width, height] = size.split("x"); + url = url.concat(`&w=${width}&h=${height}`); + } else { + url = url.concat(`&w=${size}`); + } + } if (include_size) { - return `![tp.web.random_picture|${size}](${url})`; + return `![photo by ${response.photog} on Unsplash|${size}](${url})`; } - return `![tp.web.random_picture](${url})`; + return `![photo by ${response.photog} on Unsplash](${url})`; } catch (error) { new TemplaterError("Error generating random picture"); return "Error generating random picture"; @@ -2795,7 +2801,7 @@ var InternalModuleFrontmatter = class extends InternalModule { } create_dynamic_templates() { return __async(this, null, function* () { - const cache = this.app.metadataCache.getFileCache(this.config.target_file); + const cache = app.metadataCache.getFileCache(this.config.target_file); this.dynamic_functions = new Map(Object.entries((cache == null ? void 0 : cache.frontmatter) || {})); }); } @@ -2807,7 +2813,7 @@ var import_obsidian11 = __toModule(require("obsidian")); // src/core/functions/internal_functions/system/PromptModal.ts var import_obsidian9 = __toModule(require("obsidian")); var PromptModal = class extends import_obsidian9.Modal { - constructor(app, prompt_text, default_value, multi_line) { + constructor(prompt_text, default_value, multi_line) { super(app); this.prompt_text = prompt_text; this.default_value = default_value; @@ -2884,13 +2890,13 @@ var PromptModal = class extends import_obsidian9.Modal { // src/core/functions/internal_functions/system/SuggesterModal.ts var import_obsidian10 = __toModule(require("obsidian")); var SuggesterModal = class extends import_obsidian10.FuzzySuggestModal { - constructor(app, text_items, items, placeholder, limit) { + constructor(text_items, items, placeholder, limit) { super(app); this.text_items = text_items; this.items = items; this.submitted = false; this.setPlaceholder(placeholder); - this.limit = limit; + limit && (this.limit = limit); } getItems() { return this.items; @@ -2950,7 +2956,7 @@ var InternalModuleSystem = class extends InternalModule { } generate_prompt() { return (prompt_text, default_value, throw_on_cancel = false, multi_line = false) => __async(this, null, function* () { - const prompt = new PromptModal(this.app, prompt_text, default_value, multi_line); + const prompt = new PromptModal(prompt_text, default_value, multi_line); const promise = new Promise((resolve2, reject) => prompt.openAndGetValue(resolve2, reject)); try { return yield promise; @@ -2964,7 +2970,7 @@ var InternalModuleSystem = class extends InternalModule { } generate_suggester() { return (text_items, items, throw_on_cancel = false, placeholder = "", limit) => __async(this, null, function* () { - const suggester = new SuggesterModal(this.app, text_items, items, placeholder, limit); + const suggester = new SuggesterModal(text_items, items, placeholder, limit); const promise = new Promise((resolve2, reject) => suggester.openAndGetValue(resolve2, reject)); try { return yield promise; @@ -3001,16 +3007,15 @@ var InternalModuleConfig = class extends InternalModule { // src/core/functions/internal_functions/InternalFunctions.ts var InternalFunctions = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; this.modules_array = []; - this.modules_array.push(new InternalModuleDate(this.app, this.plugin)); - this.modules_array.push(new InternalModuleFile(this.app, this.plugin)); - this.modules_array.push(new InternalModuleWeb(this.app, this.plugin)); - this.modules_array.push(new InternalModuleFrontmatter(this.app, this.plugin)); - this.modules_array.push(new InternalModuleSystem(this.app, this.plugin)); - this.modules_array.push(new InternalModuleConfig(this.app, this.plugin)); + this.modules_array.push(new InternalModuleDate(this.plugin)); + this.modules_array.push(new InternalModuleFile(this.plugin)); + this.modules_array.push(new InternalModuleWeb(this.plugin)); + this.modules_array.push(new InternalModuleFrontmatter(this.plugin)); + this.modules_array.push(new InternalModuleSystem(this.plugin)); + this.modules_array.push(new InternalModuleConfig(this.plugin)); } init() { return __async(this, null, function* () { @@ -3035,7 +3040,7 @@ var import_child_process = __toModule(require("child_process")); var import_util = __toModule(require("util")); var import_obsidian12 = __toModule(require("obsidian")); var UserSystemFunctions = class { - constructor(app, plugin) { + constructor(plugin) { this.plugin = plugin; if (import_obsidian12.Platform.isMobileApp || !(app.vault.adapter instanceof import_obsidian12.FileSystemAdapter)) { this.cwd = ""; @@ -3091,14 +3096,13 @@ var UserSystemFunctions = class { // src/core/functions/user_functions/UserScriptFunctions.ts var UserScriptFunctions = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; } generate_user_script_functions() { return __async(this, null, function* () { const user_script_functions = new Map(); - const files = errorWrapperSync(() => get_tfiles_from_folder(this.app, this.plugin.settings.user_scripts_folder), `Couldn't find user script folder "${this.plugin.settings.user_scripts_folder}"`); + const files = errorWrapperSync(() => get_tfiles_from_folder(this.plugin.settings.user_scripts_folder), `Couldn't find user script folder "${this.plugin.settings.user_scripts_folder}"`); if (!files) { return new Map(); } @@ -3112,14 +3116,14 @@ var UserScriptFunctions = class { } load_user_script_function(file, user_script_functions) { return __async(this, null, function* () { - let req = (s) => { + const req = (s) => { return window.require && window.require(s); }; - let exp = {}; - let mod = { + const exp = {}; + const mod = { exports: exp }; - const file_content = yield this.app.vault.read(file); + const file_content = yield app.vault.read(file); const wrapping_fn = window.eval("(function anonymous(require, module, exports){" + file_content + "\n})"); wrapping_fn(req, mod, exp); const user_function = exp["default"] || mod.exports; @@ -3142,10 +3146,10 @@ var UserScriptFunctions = class { // src/core/functions/user_functions/UserFunctions.ts var UserFunctions = class { - constructor(app, plugin) { + constructor(plugin) { this.plugin = plugin; - this.user_system_functions = new UserSystemFunctions(app, plugin); - this.user_script_functions = new UserScriptFunctions(app, plugin); + this.user_system_functions = new UserSystemFunctions(plugin); + this.user_script_functions = new UserScriptFunctions(plugin); } generate_object(config2) { return __async(this, null, function* () { @@ -3155,7 +3159,7 @@ var UserFunctions = class { user_system_functions = yield this.user_system_functions.generate_object(config2); } if (this.plugin.settings.user_scripts_folder) { - user_script_functions = yield this.user_script_functions.generate_object(config2); + user_script_functions = yield this.user_script_functions.generate_object(); } return __spreadValues(__spreadValues({}, user_system_functions), user_script_functions); }); @@ -3170,11 +3174,10 @@ var FunctionsMode; FunctionsMode2[FunctionsMode2["USER_INTERNAL"] = 1] = "USER_INTERNAL"; })(FunctionsMode || (FunctionsMode = {})); var FunctionsGenerator = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; - this.internal_functions = new InternalFunctions(this.app, this.plugin); - this.user_functions = new UserFunctions(this.app, this.plugin); + this.internal_functions = new InternalFunctions(this.plugin); + this.user_functions = new UserFunctions(this.plugin); } init() { return __async(this, null, function* () { @@ -3750,10 +3753,9 @@ var RunMode; RunMode2[RunMode2["StartupTemplate"] = 5] = "StartupTemplate"; })(RunMode || (RunMode = {})); var Templater = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; - this.functions_generator = new FunctionsGenerator(this.app, this.plugin); + this.functions_generator = new FunctionsGenerator(this.plugin); this.parser = new Parser(); } setup() { @@ -3763,7 +3765,7 @@ var Templater = class { }); } create_running_config(template_file, target_file, run_mode) { - const active_file = this.app.workspace.getActiveFile(); + const active_file = app.workspace.getActiveFile(); return { template_file, target_file, @@ -3773,7 +3775,7 @@ var Templater = class { } read_and_parse_template(config2) { return __async(this, null, function* () { - const template_content = yield this.app.vault.read(config2.template_file); + const template_content = yield app.vault.read(config2.template_file); return this.parse_template(config2, template_content); }); } @@ -3788,26 +3790,26 @@ var Templater = class { create_new_note_from_template(template, folder, filename, open_new_note = true) { return __async(this, null, function* () { if (!folder) { - const new_file_location = this.app.vault.getConfig("newFileLocation"); + const new_file_location = app.vault.getConfig("newFileLocation"); switch (new_file_location) { case "current": { - const active_file = this.app.workspace.getActiveFile(); + const active_file = app.workspace.getActiveFile(); if (active_file) { folder = active_file.parent; } break; } case "folder": - folder = this.app.fileManager.getNewFileParent(""); + folder = app.fileManager.getNewFileParent(""); break; case "root": - folder = this.app.vault.getRoot(); + folder = app.vault.getRoot(); break; default: break; } } - const created_note = yield this.app.fileManager.createNewMarkdownFile(folder, filename != null ? filename : "Untitled"); + const created_note = yield app.fileManager.createNewMarkdownFile(folder, filename != null ? filename : "Untitled"); let running_config; let output_content; if (template instanceof import_obsidian13.TFile) { @@ -3822,16 +3824,16 @@ var Templater = class { }), "Template parsing error, aborting."); } if (output_content == null) { - yield this.app.vault.delete(created_note); + yield app.vault.delete(created_note); return; } - yield this.app.vault.modify(created_note, output_content); - this.app.workspace.trigger("templater:new-note-from-template", { + yield app.vault.modify(created_note, output_content); + app.workspace.trigger("templater:new-note-from-template", { file: created_note, content: output_content }); if (open_new_note) { - const active_leaf = this.app.workspace.getLeaf(false); + const active_leaf = app.workspace.getLeaf(false); if (!active_leaf) { log_error(new TemplaterError("No active leaf")); return; @@ -3849,7 +3851,7 @@ var Templater = class { } append_template_to_active_file(template_file) { return __async(this, null, function* () { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView); + const active_view = app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView); if (active_view === null) { log_error(new TemplaterError("No active view, can't append templates.")); return; @@ -3865,7 +3867,7 @@ var Templater = class { const doc = editor.getDoc(); const oldSelections = doc.listSelections(); doc.replaceSelection(output_content); - this.app.workspace.trigger("templater:template-appended", { + app.workspace.trigger("templater:template-appended", { view: active_view, content: output_content, oldSelections, @@ -3883,8 +3885,8 @@ var Templater = class { if (output_content == null) { return; } - yield this.app.vault.modify(file, output_content); - this.app.workspace.trigger("templater:new-note-from-template", { + yield app.vault.modify(file, output_content); + app.workspace.trigger("templater:new-note-from-template", { file, content: output_content }); @@ -3892,7 +3894,7 @@ var Templater = class { }); } overwrite_active_file_commands() { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView); + const active_view = app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView); if (active_view === null) { log_error(new TemplaterError("Active view is null, can't overwrite content")); return; @@ -3908,8 +3910,8 @@ var Templater = class { if (output_content == null) { return; } - yield this.app.vault.modify(file, output_content); - this.app.workspace.trigger("templater:overwrite-file", { + yield app.vault.modify(file, output_content); + app.workspace.trigger("templater:overwrite-file", { file, content: output_content }); @@ -3925,17 +3927,19 @@ var Templater = class { let functions_object; while (node = walker.nextNode()) { let content = node.nodeValue; - let match; - if ((match = dynamic_command_regex.exec(content)) != null) { - const file = this.app.metadataCache.getFirstLinkpathDest("", ctx.sourcePath); - if (!file || !(file instanceof import_obsidian13.TFile)) { - return; - } - if (!pass) { - pass = true; - const config2 = this.create_running_config(file, file, 4); - functions_object = yield this.functions_generator.generate_object(config2, FunctionsMode.USER_INTERNAL); - this.current_functions_object = functions_object; + if (content !== null) { + let match = dynamic_command_regex.exec(content); + if (match !== null) { + const file = app.metadataCache.getFirstLinkpathDest("", ctx.sourcePath); + if (!file || !(file instanceof import_obsidian13.TFile)) { + return; + } + if (!pass) { + pass = true; + const config2 = this.create_running_config(file, file, 4); + functions_object = yield this.functions_generator.generate_object(config2, FunctionsMode.USER_INTERNAL); + this.current_functions_object = functions_object; + } } while (match != null) { const complete_command = match[1] + match[2]; @@ -3981,7 +3985,7 @@ var Templater = class { return; } const template_file = yield errorWrapper(() => __async(this, null, function* () { - return resolve_tfile(templater.app, folder_template_match); + return resolve_tfile(folder_template_match); }), `Couldn't find template ${folder_template_match}`); if (template_file == null) { return; @@ -3998,7 +4002,7 @@ var Templater = class { if (!template) { continue; } - const file = errorWrapperSync(() => resolve_tfile(this.app, template), `Couldn't find startup template "${template}"`); + const file = errorWrapperSync(() => resolve_tfile(template), `Couldn't find startup template "${template}"`); if (!file) { continue; } @@ -4014,14 +4018,13 @@ var Templater = class { // src/handlers/EventHandler.ts var import_obsidian14 = __toModule(require("obsidian")); var EventHandler = class { - constructor(app, plugin, templater, settings) { - this.app = app; + constructor(plugin, templater, settings) { this.plugin = plugin; this.templater = templater; this.settings = settings; } setup() { - this.app.workspace.onLayoutReady(() => { + app.workspace.onLayoutReady(() => { this.update_trigger_file_on_creation(); }); this.update_syntax_highlighting(); @@ -4029,35 +4032,35 @@ var EventHandler = class { } update_syntax_highlighting() { if (this.plugin.settings.syntax_highlighting) { - this.syntax_highlighting_event = this.app.workspace.on("codemirror", (cm) => { + this.syntax_highlighting_event = app.workspace.on("codemirror", (cm) => { cm.setOption("mode", "templater"); }); - this.app.workspace.iterateCodeMirrors((cm) => { + app.workspace.iterateCodeMirrors((cm) => { cm.setOption("mode", "templater"); }); this.plugin.registerEvent(this.syntax_highlighting_event); } else { if (this.syntax_highlighting_event) { - this.app.vault.offref(this.syntax_highlighting_event); + app.vault.offref(this.syntax_highlighting_event); } - this.app.workspace.iterateCodeMirrors((cm) => { + app.workspace.iterateCodeMirrors((cm) => { cm.setOption("mode", "hypermd"); }); } } update_trigger_file_on_creation() { if (this.settings.trigger_on_file_creation) { - this.trigger_on_file_creation_event = this.app.vault.on("create", (file) => Templater.on_file_creation(this.templater, file)); + this.trigger_on_file_creation_event = app.vault.on("create", (file) => Templater.on_file_creation(this.templater, file)); this.plugin.registerEvent(this.trigger_on_file_creation_event); } else { if (this.trigger_on_file_creation_event) { - this.app.vault.offref(this.trigger_on_file_creation_event); + app.vault.offref(this.trigger_on_file_creation_event); this.trigger_on_file_creation_event = void 0; } } } update_file_menu() { - this.plugin.registerEvent(this.app.workspace.on("file-menu", (menu, file) => { + this.plugin.registerEvent(app.workspace.on("file-menu", (menu, file) => { if (file instanceof import_obsidian14.TFolder) { menu.addItem((item) => { item.setTitle("Create new note from template").setIcon("templater-icon").onClick(() => { @@ -4071,8 +4074,7 @@ var EventHandler = class { // src/handlers/CommandHandler.ts var CommandHandler = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; } setup() { @@ -4144,7 +4146,7 @@ var CommandHandler = class { id: new_template, name: `Insert ${new_template}`, callback: () => { - const template = errorWrapperSync(() => resolve_tfile(this.app, new_template), `Couldn't find the template file associated with this hotkey`); + const template = errorWrapperSync(() => resolve_tfile(new_template), `Couldn't find the template file associated with this hotkey`); if (!template) { return; } @@ -4155,7 +4157,7 @@ var CommandHandler = class { } remove_template_hotkey(template) { if (template) { - this.app.commands.removeCommand(`${this.plugin.manifest.id}:${template}`); + app.commands.removeCommand(`${this.plugin.manifest.id}:${template}`); } } }; @@ -4166,21 +4168,20 @@ var import_obsidian17 = __toModule(require("obsidian")); // src/editor/CursorJumper.ts var import_obsidian15 = __toModule(require("obsidian")); var CursorJumper = class { - constructor(app) { - this.app = app; + constructor() { } jump_to_next_cursor_location() { return __async(this, null, function* () { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian15.MarkdownView); + const active_view = app.workspace.getActiveViewOfType(import_obsidian15.MarkdownView); if (!active_view) { return; } const active_file = active_view.file; yield active_view.save(); - const content = yield this.app.vault.read(active_file); + const content = yield app.vault.read(active_file); const { new_content, positions } = this.replace_and_get_cursor_positions(content); if (positions) { - yield this.app.vault.modify(active_file, new_content); + yield app.vault.modify(active_file, new_content); this.set_cursor_location(positions); } }); @@ -4207,7 +4208,7 @@ var CursorJumper = class { return {}; } cursor_matches.sort((m1, m2) => { - return Number(m1.groups["order"]) - Number(m2.groups["order"]); + return Number(m1.groups && m1.groups["order"]) - Number(m2.groups && m2.groups["order"]); }); const match_str = cursor_matches[0][0]; cursor_matches = cursor_matches.filter((m) => { @@ -4227,7 +4228,7 @@ var CursorJumper = class { return { new_content: content, positions }; } set_cursor_location(positions) { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian15.MarkdownView); + const active_view = app.workspace.getActiveViewOfType(import_obsidian15.MarkdownView); if (!active_view) { return; } @@ -4251,7 +4252,16 @@ var tp = { config: { name: "config", description: "This module exposes Templater var documentation_default = { tp }; // src/editor/TpDocumentation.ts -var module_names = ["config", "date", "file", "frontmatter", "obsidian", "system", "user", "web"]; +var module_names = [ + "config", + "date", + "file", + "frontmatter", + "obsidian", + "system", + "user", + "web" +]; var module_names_checker = new Set(module_names); function is_module_name(x) { return typeof x === "string" && module_names_checker.has(x); @@ -4263,8 +4273,7 @@ function is_function_documentation(x) { return false; } var Documentation = class { - constructor(app) { - this.app = app; + constructor() { this.documentation = documentation_default; } get_all_modules_documentation() { @@ -4272,7 +4281,7 @@ var Documentation = class { } get_all_functions_documentation(module_name) { if (!this.documentation.tp[module_name].functions) { - return null; + return; } return Object.values(this.documentation.tp[module_name].functions); } @@ -4293,25 +4302,23 @@ var Documentation = class { // src/editor/Autocomplete.ts var Autocomplete = class extends import_obsidian16.EditorSuggest { - constructor(app, plugin) { + constructor() { super(app); - this.app = app; - this.plugin = plugin; this.tp_keyword_regex = /tp\.(?[a-z]*)?(?\.(?[a-z_]*)?)?$/; - this.documentation = new Documentation(this.app); + this.documentation = new Documentation(); } - onTrigger(cursor, editor, file) { + onTrigger(cursor, editor, _file) { const range = editor.getRange({ line: cursor.line, ch: 0 }, { line: cursor.line, ch: cursor.ch }); const match = this.tp_keyword_regex.exec(range); if (!match) { return null; } let query; - const module_name = match.groups["module"] || ""; + const module_name = match.groups && match.groups["module"] || ""; this.module_name = module_name; - if (match.groups["fn_trigger"]) { + if (match.groups && match.groups["fn_trigger"]) { if (module_name == "" || !is_module_name(module_name)) { - return; + return null; } this.function_trigger = true; this.function_name = match.groups["fn"] || ""; @@ -4350,8 +4357,8 @@ var Autocomplete = class extends import_obsidian16.EditorSuggest { el.createEl("div", { text: value.description }); } } - selectSuggestion(value, evt) { - const active_view = this.app.workspace.getActiveViewOfType(import_obsidian16.MarkdownView); + selectSuggestion(value, _evt) { + const active_view = app.workspace.getActiveViewOfType(import_obsidian16.MarkdownView); if (!active_view) { return; } @@ -5641,15 +5648,14 @@ var TP_INTERPOLATION_TAG_TOKEN_CLASS = "templater-interpolation-tag"; var TP_RAW_TAG_TOKEN_CLASS = "templater-raw-tag"; var TP_EXEC_TAG_TOKEN_CLASS = "templater-execution-tag"; var Editor2 = class { - constructor(app, plugin) { - this.app = app; + constructor(plugin) { this.plugin = plugin; - this.cursor_jumper = new CursorJumper(this.app); + this.cursor_jumper = new CursorJumper(); } setup() { return __async(this, null, function* () { yield this.registerCodeMirrorMode(); - this.plugin.registerEditorSuggest(new Autocomplete(this.app, this.plugin)); + this.plugin.registerEditorSuggest(new Autocomplete(app)); }); } jump_to_next_cursor_location(file = null, auto_jump = false) { @@ -5657,7 +5663,7 @@ var Editor2 = class { if (auto_jump && !this.plugin.settings.auto_jump_to_cursor) { return; } - if (file && this.app.workspace.getActiveFile() !== file) { + if (file && app.workspace.getActiveFile() !== file) { return; } yield this.cursor_jumper.jump_to_next_cursor_location(); @@ -5719,7 +5725,7 @@ var Editor2 = class { state.tag_class = ""; return `line-${TP_INLINE_CLASS} ${TP_CMD_TOKEN_CLASS} ${TP_CLOSING_TAG_TOKEN_CLASS} ${tag_class}`; } - const js_result = js_mode.token(stream, state); + const js_result = js_mode.token && js_mode.token(stream, state); if (stream.peek() == null && state.freeLine) { keywords += ` line-background-templater-command-bg`; } @@ -5760,14 +5766,14 @@ var TemplaterPlugin = class extends import_obsidian18.Plugin { onload() { return __async(this, null, function* () { yield this.load_settings(); - this.templater = new Templater(this.app, this); + this.templater = new Templater(this); yield this.templater.setup(); - this.editor_handler = new Editor2(this.app, this); + this.editor_handler = new Editor2(this); yield this.editor_handler.setup(); - this.fuzzy_suggester = new FuzzySuggester(this.app, this); - this.event_handler = new EventHandler(this.app, this, this.templater, this.settings); + this.fuzzy_suggester = new FuzzySuggester(this); + this.event_handler = new EventHandler(this, this.templater, this.settings); this.event_handler.setup(); - this.command_handler = new CommandHandler(this.app, this); + this.command_handler = new CommandHandler(this); this.command_handler.setup(); (0, import_obsidian18.addIcon)("templater-icon", ICON_DATA); if (this.settings.enable_ribbon_icon) { @@ -5775,8 +5781,8 @@ var TemplaterPlugin = class extends import_obsidian18.Plugin { this.fuzzy_suggester.insert_template(); })).setAttribute("id", "rb-templater-icon"); } - this.addSettingTab(new TemplaterSettingTab(this.app, this)); - this.app.workspace.onLayoutReady(() => { + this.addSettingTab(new TemplaterSettingTab(this)); + app.workspace.onLayoutReady(() => { this.templater.execute_startup_scripts(); }); }); diff --git a/.obsidian/plugins/templater-obsidian/manifest.json b/.obsidian/plugins/templater-obsidian/manifest.json index 343b81d1..d7f73fd1 100644 --- a/.obsidian/plugins/templater-obsidian/manifest.json +++ b/.obsidian/plugins/templater-obsidian/manifest.json @@ -1,7 +1,7 @@ { "id": "templater-obsidian", "name": "Templater", - "version": "1.14.1", + "version": "1.14.3", "description": "Create and use templates", "minAppVersion": "0.11.13", "author": "SilentVoid", diff --git a/.obsidian/workspace b/.obsidian/workspace index 7f4ab6e1..5ab5b0a6 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -4,7 +4,7 @@ "type": "split", "children": [ { - "id": "d7214829bae5fc41", + "id": "ab8726a1d7042b76", "type": "leaf", "state": { "type": "markdown", @@ -141,35 +141,35 @@ } }, { - "id": "e617fe6736b3bd7c", + "id": "c25e04fe97bc025c", "type": "leaf", "state": { - "type": "DICE_ROLLER_VIEW", + "type": "metatable-sidebar-view", "state": {} } }, { - "id": "c25e04fe97bc025c", + "id": "a9a5a5427d736b95", "type": "leaf", "state": { - "type": "metatable-sidebar-view", + "type": "DICE_ROLLER_VIEW", "state": {} } } ], - "currentTab": 6 + "currentTab": 2 }, - "active": "d7214829bae5fc41", + "active": "ab8726a1d7042b76", "lastOpenFiles": [ - "03.04 Cinematheque/@Cinematheque.md", + "02.02 Paris/Terrass'Hotel.md", "01.02 Home/@Main Dashboard.md", - "00.01 Admin/Obsidian plugins.md", - "00.01 Admin/Calendars/2022-09-17.md", - "01.02 Home/2021-12-04 MRCK - lil dialogue.md", - "02.03 Zürich/@Restaurants Zürich.md", - "00.01 Admin/Calendars/2022-09-16.md", - "03.04 Cinematheque/A Fistful of Dollars (1964).md", - "00.01 Admin/Calendars/2023-02-11 Mariage Eloi & Zélie.md", - "00.01 Admin/Calendars/2022-10-14 Weekend à GVA.md" + "03.04 Cinematheque/@Cinematheque.md", + "01.01 Life Orga/@Lifestyle.md", + "02.01 London/Ryan Anderson.md", + "02.01 London/Callum Anderson.md", + "02.01 London/Epsom Polo Club.md", + "02.01 London/Ealing Riding School.md", + "02.02 Paris/Paris SG.md", + "02.02 Paris/Le Barn.md" ] } \ No newline at end of file diff --git a/00.01 Admin/Calendars/2022-09-12.md b/00.01 Admin/Calendars/2022-09-12.md index ade7039e..9abddacb 100644 --- a/00.01 Admin/Calendars/2022-09-12.md +++ b/00.01 Admin/Calendars/2022-09-12.md @@ -78,8 +78,8 @@ style: number This section does serve for quick memos.   -- [ ] 10:50 :couch_and_lamp: [[2022-09-12|Memo]], [[@Lifestyle]]: sofa options at the border 📅 2022-09-17 -- [ ] 10:50 :chair: [[2022-09-12|Memo]], [[@Lifestyle]]: armchair options at the border 📆2022-09-17 +- [ ] 10:50 :couch_and_lamp: [[2022-09-12|Memo]], [[@Lifestyle]]: sofa options at the border 📅 2022-09-25 +- [ ] 10:50 :chair: [[2022-09-12|Memo]], [[@Lifestyle]]: armchair options at the border 📆2022-09-25 - 20:32 [[2022-09-12|Today]], [[Big Shells With Spicy Lamb Sausage and Pistachios]] with Merguez & without pistacchio ^qjxyyl %% --- %% diff --git a/00.01 Admin/Calendars/2022-09-14.md b/00.01 Admin/Calendars/2022-09-14.md index c27240c5..f89c6e70 100644 --- a/00.01 Admin/Calendars/2022-09-14.md +++ b/00.01 Admin/Calendars/2022-09-14.md @@ -79,8 +79,8 @@ This section does serve for quick memos.   - 12:00 Day trip à [[Geneva]] pour le boulot -- [ ] 12:03 :small_airplane: [[2022-09-14|Memo]], [[Geneva]]: reserver un hotel/airbnb pour Geneve 📅 2022-09-18 ^z9fx6n -- [ ] 12:04 :small_airplane: [[2022-09-14|Memo]], [[@@Paris|Paris]]: reserver billets de train + accommodation pour weekend a Paris 📅 2022-09-18 ^38rnfw +- [x] 12:03 :small_airplane: [[2022-09-14|Memo]], [[Geneva]]: reserver un hotel/airbnb pour Geneve 📅 2022-09-18 ✅ 2022-09-19 ^z9fx6n +- [x] 12:04 :small_airplane: [[2022-09-14|Memo]], [[@@Paris|Paris]]: reserver billets de train + accommodation pour weekend a Paris 📅 2022-09-18 ✅ 2022-09-19 ^38rnfw - 23:17 [[Game of Thrones (2011–2019)|Game of Thrones]] with my [[MRCK|Boubix]] [[2022-09-14|this day]] %% --- %% diff --git a/00.01 Admin/Calendars/2022-09-17.md b/00.01 Admin/Calendars/2022-09-17.md index d89b385b..0ebf14a4 100644 --- a/00.01 Admin/Calendars/2022-09-17.md +++ b/00.01 Admin/Calendars/2022-09-17.md @@ -13,9 +13,9 @@ Stress: 25 FrontHeadBar: 5 EarHeadBar: 30 BackHeadBar: 20 -Water: 2.75 +Water: 3.85 Coffee: 1 -Steps: +Steps: 5281 Ski: Riding: 1 Racket: @@ -93,6 +93,7 @@ This section does serve for quick memos.   - [[Game of Thrones (2011–2019)|Game of Thrones]] with my [[MRCK|Boubix]] [[2022-09-17|this day]] +- [[Iroquois]] for brunch with my [[MRCK|Boubix]] [[2022-09-17|this day]]   diff --git a/00.01 Admin/Calendars/2022-09-18 Lyon - Paris SG (0-1).md b/00.01 Admin/Calendars/2022-09-18 Lyon - Paris SG (0-1).md new file mode 100644 index 00000000..2ce9623e --- /dev/null +++ b/00.01 Admin/Calendars/2022-09-18 Lyon - Paris SG (0-1).md @@ -0,0 +1,11 @@ +--- +title: ⚽ Lyon - Paris SG (0-1) +allDay: false +startTime: 20:45 +endTime: 22:45 +date: 2022-09-18 +CollapseMetaTable: true +--- + +[[2022-09-18|this day]], Lyon - [[Paris SG]]: 0-1 +Buteurs:: ⚽ Messi \ No newline at end of file diff --git a/00.01 Admin/Calendars/2022-09-18.md b/00.01 Admin/Calendars/2022-09-18.md new file mode 100644 index 00000000..7eadd18b --- /dev/null +++ b/00.01 Admin/Calendars/2022-09-18.md @@ -0,0 +1,112 @@ +--- + +Date: 2022-09-18 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 90 +Gratefulness: 90 +Stress: 25 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 20 +Water: 4.825 +Coffee: 2 +Steps: 9539 +Ski: +Riding: 1 +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2022-09-17|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2022-09-19|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2022-09-18Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2022-09-18NSave + +  + +# 2022-09-18 + +  + +> [!summary]+ +> Daily note for 2022-09-18 + +  + +```toc +style: number +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +- [[Toto]] for lunch with my [[MRCK|Meggi]] [[2022-09-18|this day]] +- [[Polo Park Zürich|Beginners’ chukkas]] in the same team as [[MRCK|Meggi-mo]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2022-09-18]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2022-09-19.md b/00.01 Admin/Calendars/2022-09-19.md new file mode 100644 index 00000000..4587db46 --- /dev/null +++ b/00.01 Admin/Calendars/2022-09-19.md @@ -0,0 +1,111 @@ +--- + +Date: 2022-09-19 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 6.5 +Happiness: 90 +Gratefulness: 90 +Stress: 30 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 30 +Water: 3.125 +Coffee: 3 +Steps: 6810 +Ski: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2022-09-18|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2022-09-20|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2022-09-19Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2022-09-19NSave + +  + +# 2022-09-19 + +  + +> [!summary]+ +> Daily note for 2022-09-19 + +  + +```toc +style: number +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +- [[Game of Thrones (2011–2019)|Game of Thrones]] with my [[MRCK|Boubix]] [[2022-09-19|this day]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2022-09-19]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2022-09-20.md b/00.01 Admin/Calendars/2022-09-20.md new file mode 100644 index 00000000..71d10252 --- /dev/null +++ b/00.01 Admin/Calendars/2022-09-20.md @@ -0,0 +1,112 @@ +--- + +Date: 2022-09-20 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: +Happiness: 90 +Gratefulness: 90 +Stress: 30 +FrontHeadBar: 5 +EarHeadBar: 30 +BackHeadBar: 30 +Water: 3.08 +Coffee: 3 +Steps: +Ski: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2022-09-19|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2022-09-21|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2022-09-20Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2022-09-20NSave + +  + +# 2022-09-20 + +  + +> [!summary]+ +> Daily note for 2022-09-20 + +  + +```toc +style: number +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  +- 17:54 [[Luigia]] for lunch [[2022-09-20|today]] + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +- [[Game of Thrones (2011–2019)|Game of Thrones]] with my [[MRCK|Boubix]] [[2022-09-20|this day]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2022-09-20]] +``` + +  +  \ No newline at end of file diff --git a/00.06 Professional/4 Non-Traditional Workplace Practices For Leaders To Consider Adopting.md b/00.06 Professional/4 Non-Traditional Workplace Practices For Leaders To Consider Adopting.md index 85f43616..6b978f15 100644 --- a/00.06 Professional/4 Non-Traditional Workplace Practices For Leaders To Consider Adopting.md +++ b/00.06 Professional/4 Non-Traditional Workplace Practices For Leaders To Consider Adopting.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/6 ways companies screw up their global expansion.md b/00.06 Professional/6 ways companies screw up their global expansion.md index 84d63bc1..0fcb8398 100644 --- a/00.06 Professional/6 ways companies screw up their global expansion.md +++ b/00.06 Professional/6 ways companies screw up their global expansion.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/@Professional.md b/00.06 Professional/@@Professional.md similarity index 91% rename from 00.06 Professional/@Professional.md rename to 00.06 Professional/@@Professional.md index a2b73a32..32228dfd 100644 --- a/00.06 Professional/@Professional.md +++ b/00.06 Professional/@@Professional.md @@ -54,7 +54,7 @@ style: number   -### Master Navigation +### 🧭 Master Navigation   @@ -69,7 +69,7 @@ style: number   -### Tag Navigation +### 🏷 Tag Navigation   @@ -85,7 +85,8 @@ style: number   -### TimeStamp check +### ⏲ TimeStamp check +   ```dataview @@ -100,7 +101,7 @@ style: number   -### High Level tasks +### ✅ High Level tasks   diff --git a/00.06 Professional/@Useful tools.md b/00.06 Professional/@Useful tools.md new file mode 100644 index 00000000..00972a89 --- /dev/null +++ b/00.06 Professional/@Useful tools.md @@ -0,0 +1,77 @@ +--- + +Alias: ["Useful tools"] +Tag: ["Professional", "Tools"] +Date: 2022-09-19 +DocType: Professional +Hierarchy: Root2 +TimeStamp: +location: +CollapseMetaTable: true + +--- + +Parent:: [[@@Professional|Professional]] + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-UsefultoolsNSave + +  + +# @Useful tools + +  + +> [!summary]+ +> Note Description + +  + +```toc +style: number +``` + +  + +--- + +  + +### 🏗 Organisational + +  + +#### 🪖 Office work + +- Text editor: [Obsidian](https://obsidian.md/) +- Project management: [Manage Your Team’s Projects From Anywhere | Trello](https://trello.com/) + +  + +#### 💻 Code & Automation + +- Editor: [Visual Studio Code - Code Editing. Redefined](https://code.visualstudio.com/) + +  + +--- + +  + +### 🤝 Client & relationship management + +  + +[Find email addresses in seconds • Hunter (Email Hunter)](https://hunter.io/) + +  +  \ No newline at end of file diff --git a/00.06 Professional/A Black woman's guide to venture-capital fundraising How to pitch investors, build a support network, and raise millions..md b/00.06 Professional/A Black woman's guide to venture-capital fundraising How to pitch investors, build a support network, and raise millions..md index 33895830..b0b83920 100644 --- a/00.06 Professional/A Black woman's guide to venture-capital fundraising How to pitch investors, build a support network, and raise millions..md +++ b/00.06 Professional/A Black woman's guide to venture-capital fundraising How to pitch investors, build a support network, and raise millions..md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/Crypto industry makes push into regulated derivatives markets.md b/00.06 Professional/Crypto industry makes push into regulated derivatives markets.md index bdc0ec44..1f872acd 100644 --- a/00.06 Professional/Crypto industry makes push into regulated derivatives markets.md +++ b/00.06 Professional/Crypto industry makes push into regulated derivatives markets.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/Les 17 erreurs de management à ne pas commettre.md b/00.06 Professional/Les 17 erreurs de management à ne pas commettre.md index 1a69587b..dfccf015 100644 --- a/00.06 Professional/Les 17 erreurs de management à ne pas commettre.md +++ b/00.06 Professional/Les 17 erreurs de management à ne pas commettre.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/Lynceus Partners arrivée de Melchior de Villeneuve en tant que Responsable du Développement.md b/00.06 Professional/Lynceus Partners arrivée de Melchior de Villeneuve en tant que Responsable du Développement.md index b7408aa0..9fee710a 100644 --- a/00.06 Professional/Lynceus Partners arrivée de Melchior de Villeneuve en tant que Responsable du Développement.md +++ b/00.06 Professional/Lynceus Partners arrivée de Melchior de Villeneuve en tant que Responsable du Développement.md @@ -13,7 +13,7 @@ CollapseMetaTable: true --- -Parent:: [[@@Life Organisation|Life]], [[@Professional|Professional]] +Parent:: [[@@Life Organisation|Life]], [[@@Professional|Professional]] Read:: No --- diff --git a/00.06 Professional/Managing people 🤯 Andreas Klinger.md b/00.06 Professional/Managing people 🤯 Andreas Klinger.md index b6a652fc..e265e1cc 100644 --- a/00.06 Professional/Managing people 🤯 Andreas Klinger.md +++ b/00.06 Professional/Managing people 🤯 Andreas Klinger.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/Sameer Huda - gunnercooke llp.md b/00.06 Professional/Sameer Huda - gunnercooke llp.md index 5aa06dea..88551b99 100644 --- a/00.06 Professional/Sameer Huda - gunnercooke llp.md +++ b/00.06 Professional/Sameer Huda - gunnercooke llp.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]], [[MRCK|Meggi-mo]] +Parent:: [[@@Professional|Professional]], [[MRCK|Meggi-mo]] --- diff --git a/00.06 Professional/Step-by-step How to grow a company culture.md b/00.06 Professional/Step-by-step How to grow a company culture.md index edb67774..e138f383 100644 --- a/00.06 Professional/Step-by-step How to grow a company culture.md +++ b/00.06 Professional/Step-by-step How to grow a company culture.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/The 10 Keys to A Successful Board Meeting How to Make Them Great and Not Something Everyone Dreads from Ajay Agarwal, Bain Capital Partners SaaStr.md b/00.06 Professional/The 10 Keys to A Successful Board Meeting How to Make Them Great and Not Something Everyone Dreads from Ajay Agarwal, Bain Capital Partners SaaStr.md index e69415ee..f0d589e1 100644 --- a/00.06 Professional/The 10 Keys to A Successful Board Meeting How to Make Them Great and Not Something Everyone Dreads from Ajay Agarwal, Bain Capital Partners SaaStr.md +++ b/00.06 Professional/The 10 Keys to A Successful Board Meeting How to Make Them Great and Not Something Everyone Dreads from Ajay Agarwal, Bain Capital Partners SaaStr.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@Professional|Professional]] +Parent:: [[@@Professional|Professional]] --- diff --git a/00.06 Professional/The Company-Building Cornerstones Every Founder Needs to Focus On — Advice from HubSpot.md b/00.06 Professional/The Company-Building Cornerstones Every Founder Needs to Focus On — Advice from HubSpot.md index 8609451b..4762d403 100644 --- a/00.06 Professional/The Company-Building Cornerstones Every Founder Needs to Focus On — Advice from HubSpot.md +++ b/00.06 Professional/The Company-Building Cornerstones Every Founder Needs to Focus On — Advice from HubSpot.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- -Parent:: [[@News|News]], [[@Professional|Professional]] +Parent:: [[@News|News]], [[@@Professional|Professional]] --- diff --git a/00.06 Professional/The Importance of Leading With Empathy (And How To Do It).md b/00.06 Professional/The Importance of Leading With Empathy (And How To Do It).md index 404230e0..f4e9533c 100644 --- a/00.06 Professional/The Importance of Leading With Empathy (And How To Do It).md +++ b/00.06 Professional/The Importance of Leading With Empathy (And How To Do It).md @@ -13,7 +13,7 @@ CollapseMetaTable: true --- -Parent:: [[@News|News]], [[@Professional|Professional]] +Parent:: [[@News|News]], [[@@Professional|Professional]] Read:: No --- diff --git a/01.01 Life Orga/@Lifestyle.md b/01.01 Life Orga/@Lifestyle.md index 731077c4..7681195d 100644 --- a/01.01 Life Orga/@Lifestyle.md +++ b/01.01 Life Orga/@Lifestyle.md @@ -153,7 +153,7 @@ See [[Internet services|Internet]] section **UK** 1. [[Epsom Polo Club|EPC]] -2. [Rugby Polo Club](geo:52.33100963781016,-1.2585905491865028) (Molawa) #Sport +2. [Rugby Polo Club](geo:52.33100963781016,-1.2585905491865028) (Molawa) #Horse     diff --git a/01.02 Home/@Shopping list.md b/01.02 Home/@Shopping list.md index a38c90d8..a06c66ec 100644 --- a/01.02 Home/@Shopping list.md +++ b/01.02 Home/@Shopping list.md @@ -56,23 +56,23 @@ style: number - [x] ☕ Coffee ✅ 2022-03-01 - [x] 🍶 Coke 0 ✅ 2022-03-14 - [x] 🧃 Apfelschorle ✅ 2022-05-07 -- [x] 🍊 Morning juice ✅ 2022-08-05 +- [ ] 🍊 Morning juice - [x] 🍿 Snacks ✅ 2022-03-04 -- [x] 🍦 Dessert ✅ 2022-08-05 -- [x] 🧈 Beurre ✅ 2022-09-12 -- [x] 🥯 Bread ✅ 2022-08-05 +- [x] 🍦 Dessert ✅ 2022-09-18 +- [x] 🧈 Beurre ✅ 2022-09-18 +- [x] 🥯 Bread ✅ 2022-09-18 - [x] 🍯 Honey/Jam ✅ 2022-03-31 - [x] 🍫 Nutella ✅ 2022-02-15 - [x] 🍐 Fruit ✅ 2022-09-05 - [x] 🍌 Bananas ✅ 2022-09-05 - [x] 🍅 vegetables ✅ 2022-09-12 - [x] 🧅 onions ✅ 2022-03-31 -- [x] 🧄 garlic ✅ 2022-03-01 -- [x] 🥚 Eggs ✅ 2022-07-30 -- [x] 🧀 Fromage ✅ 2022-07-30 -- [x] 🧀 Fromage rapé ✅ 2022-09-12 +- [x] 🧄 garlic ✅ 2022-09-18 +- [x] 🥚 Eggs ✅ 2022-09-18 +- [x] 🧀 Fromage ✅ 2022-09-18 +- [x] 🧀 Fromage rapé ✅ 2022-09-18 - [x] 🥩 Cured meat ✅ 2022-08-05 -- [x] 🍖 Fresh meat ✅ 2022-09-05 +- [x] 🍖 Fresh meat ✅ 2022-09-18 - [x] 🍝 Pasta ✅ 2022-09-12 - [x] 🍚 Rice ✅ 2022-03-31 - [x] 🥔 Potatoes ✅ 2022-08-05 diff --git a/01.02 Home/Household.md b/01.02 Home/Household.md index b92c8fed..409cd152 100644 --- a/01.02 Home/Household.md +++ b/01.02 Home/Household.md @@ -48,7 +48,11 @@ style: number   -### Needs +### 🚧 Infos & projects + +  + +`$= dv.el('center', '[[Zürich - Practical infos|ℹ️]]')`   @@ -63,25 +67,22 @@ style: number   -### Zürich +### 🇨‍🇭 Zürich   -`$= dv.el('center', '[[Zürich - Practical infos|ℹ️]]')` - -  - -#### Garbage collection +#### 🚮 Garbage collection - [ ] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-09-27 - [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-09-13 ✅ 2022-09-12 - [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-08-30 ✅ 2022-08-29 -- [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-09-20 +- [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-10-04 +- [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-09-20 ✅ 2022-09-19 - [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2022-09-06 ✅ 2022-09-05   -#### House chores +#### 🏠 House chores - [ ] 🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%% 🔁 every month on the last Saturday 🛫 2022-08-29 📅 2022-09-24 - [x] 🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%% 🔁 every month on the last Saturday 🛫 2022-08-01 📅 2022-08-27 ✅ 2022-08-27 @@ -90,20 +91,9 @@ style: number - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2022-09-12 ✅ 2022-09-09 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2022-09-05 ✅ 2022-09-02 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2022-08-29 ✅ 2022-08-27 -- [ ] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2022-09-17 +- [ ] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2022-10-01 +- [x] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2022-09-17 ✅ 2022-09-19 - [x] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2022-09-03 ✅ 2022-09-04 -  - ---- - -  - -### Completed to-dos - -  - -Loret ipsum -     \ No newline at end of file diff --git a/01.02 Home/League Tables.md b/01.02 Home/League Tables.md index 0031ceed..dd71f1f0 100644 --- a/01.02 Home/League Tables.md +++ b/01.02 Home/League Tables.md @@ -45,16 +45,12 @@ style: number   -### Zürich +> [!product] League tables +> This section sums up our good finds by what we like across our trips & outings   -> [!product] League tables in Zürich -> This section sums up our good finds by what we like in Zürich - -  - -#### 🥐 Croissants +### 🥐 Croissants 1. Buchmann Seefeld 2. [[Toto]] @@ -62,7 +58,11 @@ style: number   -#### ☕ Coffee +--- + +  + +### ☕ Coffee 1. [[Monocle]] 2. [[La Stanza]] @@ -76,12 +76,9 @@ style: number   -### Paris +### 🥮 Tiramisu -  -> [!product] League tables in Paris -> This section sums up our good finds by what we like in Paris     \ No newline at end of file diff --git a/01.02 Home/Zürich - Practical infos.md b/01.02 Home/Life - Practical infos.md similarity index 91% rename from 01.02 Home/Zürich - Practical infos.md rename to 01.02 Home/Life - Practical infos.md index 2b167676..3f4baae1 100644 --- a/01.02 Home/Zürich - Practical infos.md +++ b/01.02 Home/Life - Practical infos.md @@ -4,11 +4,11 @@ kanban-plugin: basic --- -## Lifestyle +## Health -- [ ] # Polo: [[Polo Park Zürich]]

---

[[Francisco Podesta]] -- [ ] # Polo: [[Epsom Polo Club]]

---

[[Callum Anderson]]
[[Ryan Anderson]] -- [ ] # Polo: Iridike

--- +- [ ] # Doctor

--- +- [ ] # Dentist

--- +- [ ] # Optician

--- ## Utilities @@ -18,6 +18,13 @@ kanban-plugin: basic - [ ] # Phone, TV & Internet: Swisscom

---

> [!info] Info
> **Payment frequency**: monthly
> **Approx amount**: 58.80 CHF

---

💵: CH32 3000 0001 8769 3077 7
🏦: Swisscom (CH) Ltd +## Lifestyle + +- [ ] # Polo: [[Polo Park Zürich]]

---

[[Francisco Podesta]] +- [ ] # Polo: [[Epsom Polo Club]]

---

[[Callum Anderson]]
[[Ryan Anderson]] +- [ ] # Polo: Iridike

--- + + %% kanban:settings diff --git a/02.01 London/Callum Anderson.md b/02.01 London/Callum Anderson.md index 7e75dc4b..6ead200d 100644 --- a/02.01 London/Callum Anderson.md +++ b/02.01 London/Callum Anderson.md @@ -1,12 +1,12 @@ --- Alias: [""] -Tag: ["Polo", "London"] +Tag: ["Polo", "London", "Person"] Date: 2022-09-16 DocType: "Person" Hierarchy: "NonRoot" TimeStamp: -location: +location: [51.34378980192966,-0.2915408008813016] CollapseMetaTable: true Person: LastName: Anderson diff --git a/02.01 London/Ealing Riding School.md b/02.01 London/Ealing Riding School.md index 8b651a0c..35da989d 100644 --- a/02.01 London/Ealing Riding School.md +++ b/02.01 London/Ealing Riding School.md @@ -1,6 +1,6 @@ --- -Tag: ["London", "Sport", "Riding"] +Tag: ["London", "Sport", "Horse"] Date: 2021-10-04 DocType: "Place" Hierarchy: "NonRoot" @@ -12,6 +12,7 @@ Place: Location: Ealing Country: UK Status: Regular +CollapseMetaTable: true --- diff --git a/02.01 London/Epsom Polo Club.md b/02.01 London/Epsom Polo Club.md index 4b834c52..f3f4c21e 100644 --- a/02.01 London/Epsom Polo Club.md +++ b/02.01 London/Epsom Polo Club.md @@ -1,7 +1,7 @@ --- Alias: ["EPC"] -Tag: ["London", "Sport", "Polo"] +Tag: ["London", "Sport", "Polo", "Horse"] Date: 2021-10-04 DocType: "Place" Hierarchy: "NonRoot" @@ -13,6 +13,7 @@ Place: Location: Epsom Country: UK Status: Regular +CollapseMetaTable: true --- diff --git a/02.01 London/Ryan Anderson.md b/02.01 London/Ryan Anderson.md index 49e23058..0348c3ce 100644 --- a/02.01 London/Ryan Anderson.md +++ b/02.01 London/Ryan Anderson.md @@ -1,12 +1,12 @@ --- Alias: [] -Tag: ["Polo", "London"] +Tag: ["Person", "Polo", "London"] Date: 2022-09-16 DocType: "Person" Hierarchy: "NonRoot" TimeStamp: -location: +location: [51.34378980192966,-0.2915408008813016] CollapseMetaTable: true Person: LastName: Ryan diff --git a/02.02 Paris/Chez Robert.md b/02.02 Paris/Chez Robert.md index 1cefd922..2f325c98 100644 --- a/02.02 Paris/Chez Robert.md +++ b/02.02 Paris/Chez Robert.md @@ -1,6 +1,6 @@ --- -Tag: ["Modern", "EnglishChef"] +Tag: ["Modern", "EnglishChef", "Restaurant"] Date: 2022-05-21 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.02 Paris/Domaine de Courances.md b/02.02 Paris/Domaine de Courances.md index f4de72bd..ae88d42b 100644 --- a/02.02 Paris/Domaine de Courances.md +++ b/02.02 Paris/Domaine de Courances.md @@ -1,6 +1,6 @@ --- -Tag: ["Paris", "Lifestyle", "Sport", "Polo"] +Tag: ["Paris", "Lifestyle", "Sport", "Polo", "Horse"] Date: 2021-10-04 DocType: "Place" Hierarchy: "NonRoot" @@ -12,6 +12,7 @@ Place: Location: Essonne Country: France Status: Prospect +CollapseMetaTable: true --- diff --git a/02.02 Paris/Guibine.md b/02.02 Paris/Guibine.md index a0eb6898..3444dd73 100644 --- a/02.02 Paris/Guibine.md +++ b/02.02 Paris/Guibine.md @@ -1,6 +1,6 @@ --- -Tag: ["Korean", "Barbecue", "Restaurant"] +Tag: ["Korean", "Restaurant", "Barbecue"] Date: 2021-12-06 DocType: "Place" Hierarchy: "NonRoot" @@ -13,10 +13,11 @@ Place: Location: Opéra Country: France Status: Tested +CollapseMetaTable: true --- -Parent:: [[@Restaurants Paris|Restaurants in Paris]] +Parent:: [[@@Paris|Paris]], [[@Restaurants Paris|Restaurants in Paris]]   diff --git a/02.02 Paris/Haras de la Cense.md b/02.02 Paris/Haras de la Cense.md index 583aae85..72c1bb0c 100644 --- a/02.02 Paris/Haras de la Cense.md +++ b/02.02 Paris/Haras de la Cense.md @@ -1,6 +1,6 @@ --- -Tag: ["Paris", "Lifestyle", "Sport", "Riding"] +Tag: ["Paris", "Lifestyle", "Sport", "Horse"] Date: 2021-10-04 DocType: "Place" Hierarchy: "NonRoot" @@ -12,6 +12,7 @@ Place: Location: Yvelines Country: France Status: Tested +CollapseMetaTable: true --- diff --git a/02.02 Paris/Inavoué.md b/02.02 Paris/Inavoué.md index 156f5858..90dbc095 100644 --- a/02.02 Paris/Inavoué.md +++ b/02.02 Paris/Inavoué.md @@ -1,6 +1,6 @@ --- -Tag: ["Modern", "Fusion"] +Tag: ["Modern", "Fusion", "Restaurant"] Date: 2022-05-21 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.02 Paris/Le Barn.md b/02.02 Paris/Le Barn.md index 6c701fda..cae5218a 100644 --- a/02.02 Paris/Le Barn.md +++ b/02.02 Paris/Le Barn.md @@ -12,6 +12,7 @@ Place: Location: Yvelines Country: France Status: Tested +CollapseMetaTable: true --- diff --git a/02.03 Zürich/Afghan Anar.md b/02.03 Zürich/Afghan Anar.md index 3b289ce1..254fa97b 100644 --- a/02.03 Zürich/Afghan Anar.md +++ b/02.03 Zürich/Afghan Anar.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-02-26 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Baur's.md b/02.03 Zürich/Baur's.md index 3674f680..4a85c1e0 100644 --- a/02.03 Zürich/Baur's.md +++ b/02.03 Zürich/Baur's.md @@ -1,6 +1,6 @@ --- -Tag: [""] +Tag: ["Restaurant"] Date: 2022-01-24 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Bebek.md b/02.03 Zürich/Bebek.md index 6f894e8a..d1715698 100644 --- a/02.03 Zürich/Bebek.md +++ b/02.03 Zürich/Bebek.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-08-19 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Bimi.md b/02.03 Zürich/Bimi.md index d1a4de2d..49b8c039 100644 --- a/02.03 Zürich/Bimi.md +++ b/02.03 Zürich/Bimi.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: ["Sushi"] +Tag: ["Sushi", "Restaurant"] Date: 2022-02-23 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Café des Amis.md b/02.03 Zürich/Café des Amis.md index 9dac1a7f..3b789a84 100644 --- a/02.03 Zürich/Café des Amis.md +++ b/02.03 Zürich/Café des Amis.md @@ -1,6 +1,6 @@ --- -Tag: ["Brunch"] +Tag: ["Brunch", "Restaurant"] Date: 2022-04-15 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Cantinetta Antinori.md b/02.03 Zürich/Cantinetta Antinori.md index 4e8627f5..b00da5f7 100644 --- a/02.03 Zürich/Cantinetta Antinori.md +++ b/02.03 Zürich/Cantinetta Antinori.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: ["Traditional", "Primo", "Socondo"] +Tag: ["Traditional", "Primo", "Socondo", "Restaurant"] Date: 2022-04-16 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Daizy.md b/02.03 Zürich/Daizy.md index 8a485ac7..467cc171 100644 --- a/02.03 Zürich/Daizy.md +++ b/02.03 Zürich/Daizy.md @@ -1,6 +1,6 @@ --- -Tag: ["Healthy", "Vegan"] +Tag: ["Healthy", "Vegan", "Restaurant"] Date: 2022-07-16 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Dante.md b/02.03 Zürich/Dante.md index 303feaaf..747460cc 100644 --- a/02.03 Zürich/Dante.md +++ b/02.03 Zürich/Dante.md @@ -1,6 +1,6 @@ --- -Tag: ["Cocktails"] +Tag: ["Cocktails", "Bar"] Date: 2022-01-24 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Dolder Grand.md b/02.03 Zürich/Dolder Grand.md index f287ed08..685c2d68 100644 --- a/02.03 Zürich/Dolder Grand.md +++ b/02.03 Zürich/Dolder Grand.md @@ -1,11 +1,11 @@ --- -Tag: ["Luxurious", "Quiet"] +Tag: ["Luxurious", "Quiet", "Hotel"] Date: 2022-08-19 DocType: "Place" Hierarchy: "NonRoot" TimeStamp: -location: +location: [47.372768449999995,8.573080642314265] Place: Type: ["Hotel", "Restaurant"] SubType: Modern diff --git a/02.03 Zürich/Francisco Podesta.md b/02.03 Zürich/Francisco Podesta.md index e70f8329..e58b3554 100644 --- a/02.03 Zürich/Francisco Podesta.md +++ b/02.03 Zürich/Francisco Podesta.md @@ -1,11 +1,11 @@ --- -Tag: ["Polo", "Zürich", "Mallorca"] +Tag: ["Polo", "Zürich", "Mallorca", "Person"] Date: 2022-09-16 DocType: "Person" Hierarchy: "NonRoot" TimeStamp: -location: +location: [47.5324731,8.7327316] CollapseMetaTable: true Person: LastName: Podesta @@ -16,6 +16,7 @@ Person: Email: "[info@polopark.ch](readdle-spark://compose?recipient=info@polopark.ch&subject=Reservierung)" Relation: "Polo Manager" +locations: --- Parent:: [[@@Zürich|Zürich]], [[Polo Park Zürich]] diff --git a/02.03 Zürich/Franzos.md b/02.03 Zürich/Franzos.md index cb9e9f6b..921862a5 100644 --- a/02.03 Zürich/Franzos.md +++ b/02.03 Zürich/Franzos.md @@ -1,6 +1,6 @@ --- -Tag: ["French"] +Tag: ["French", "Coffee"] Date: 2022-01-23 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Gestuet Homberg.md b/02.03 Zürich/Gestuet Homberg.md index e47cc420..b345698a 100644 --- a/02.03 Zürich/Gestuet Homberg.md +++ b/02.03 Zürich/Gestuet Homberg.md @@ -1,6 +1,6 @@ --- -Tag: ["Zürich", "Sport", "Riding"] +Tag: ["Zürich", "Sport", "Riding", "Horse"] Date: 2022-01-08 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Ginger.md b/02.03 Zürich/Ginger.md index 5616b2c9..a4543c03 100644 --- a/02.03 Zürich/Ginger.md +++ b/02.03 Zürich/Ginger.md @@ -1,6 +1,6 @@ --- -Tag: ["Sushi", "Isakaya"] +Tag: ["Sushi", "Isakaya", "Restaurant"] Date: 2022-07-08 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Grande.md b/02.03 Zürich/Grande.md index e2fec274..dc9bbf73 100644 --- a/02.03 Zürich/Grande.md +++ b/02.03 Zürich/Grande.md @@ -1,6 +1,6 @@ --- -Tag: [""] +Tag: ["Coffee"] Date: 2022-01-24 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Kiosk.md b/02.03 Zürich/Kiosk.md index adb33206..0e5c01be 100644 --- a/02.03 Zürich/Kiosk.md +++ b/02.03 Zürich/Kiosk.md @@ -1,6 +1,6 @@ --- -Tag: ["Snack"] +Tag: ["Snack", "Restaurant"] Date: 2022-09-04 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/La Baracca.md b/02.03 Zürich/La Baracca.md index 53fe6f8f..466cb874 100644 --- a/02.03 Zürich/La Baracca.md +++ b/02.03 Zürich/La Baracca.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: ["FamilyOwned"] +Tag: ["FamilyOwned", "Restaurant"] Date: 2022-02-20 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/La Réserve.md b/02.03 Zürich/La Réserve.md index 0a89bfef..cec2c0b8 100644 --- a/02.03 Zürich/La Réserve.md +++ b/02.03 Zürich/La Réserve.md @@ -1,6 +1,6 @@ --- -Tag: ["Modern"] +Tag: ["Modern", "Restaurant"] Date: 2022-05-29 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/La Stanza.md b/02.03 Zürich/La Stanza.md index 37003212..0ca36120 100644 --- a/02.03 Zürich/La Stanza.md +++ b/02.03 Zürich/La Stanza.md @@ -1,6 +1,6 @@ --- -Tag: [""] +Tag: ["Coffee"] Date: 2022-01-24 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Le Mezzerie.md b/02.03 Zürich/Le Mezzerie.md index c36552fa..41ab4993 100644 --- a/02.03 Zürich/Le Mezzerie.md +++ b/02.03 Zürich/Le Mezzerie.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-08-20 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Le Raymond Bar.md b/02.03 Zürich/Le Raymond Bar.md index 9505a719..4cf31b72 100644 --- a/02.03 Zürich/Le Raymond Bar.md +++ b/02.03 Zürich/Le Raymond Bar.md @@ -1,6 +1,6 @@ --- -Tag: ["French"] +Tag: ["French", "Bar"] Date: 2022-01-24 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Luca2.md b/02.03 Zürich/Luca2.md index a9225b9f..78a96294 100644 --- a/02.03 Zürich/Luca2.md +++ b/02.03 Zürich/Luca2.md @@ -1,6 +1,6 @@ --- -Tag: [""] +Tag: ["Restaurant"] Date: 2022-08-23 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Luigia.md b/02.03 Zürich/Luigia.md new file mode 100644 index 00000000..976297ef --- /dev/null +++ b/02.03 Zürich/Luigia.md @@ -0,0 +1,109 @@ +--- + +Tag: ["Italian", "Napolitano", "Restaurant"] +Date: 2022-09-20 +DocType: "Place" +Hierarchy: "NonRoot" +TimeStamp: +location: [47.3704056,8.5355364] +Place: + Type: "Restaurant" + SubType: "Napolitan" + Style: "Italian" + Location: Altstadt + Country: CH + Status: Tested +CollapseMetaTable: true +Phone: +41 (0) 44 700 22 22 +Email: "[zurich@luigia.ch](readdle-spark://compose?recipient=zurich@luigia.ch&subject=Reservierung)" +Website: "[Le meilleur de l'Italie | LUIGIA | Restaurants italiens en Suisse](http://luigia.ch/)" + +locations: +--- + +Parent:: [[@@Zürich|Zürich]], [[@Restaurants Zürich|Restaurants in Zürich]] + +  + +`= elink("https://waze.com/ul?ll=" + this.location[0] + "%2C" + this.location[1] + "&navigate=yes", "Launch Waze")` + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-LuigiaSave + +  + +# Luigia + +  + +> [!summary]+ +> Note Description + +  + +```toc +style: number +``` + +  + +--- + +  + +### 📇 Contact + +  + +> [!address] 🗺 +> Talstrasse 61 +> 8001 Zürich +> Switzerland + +  + +☎️ `= this.Phone` + +📧 `= this.Email` + +🌐 `= this.Website` + +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### 🔗 Other activity + +  + +```dataview +Table DocType as "Doc type" from [[Luigia]] +where !contains(file.name, "@@Travel") +sort DocType asc +``` + +  +  \ No newline at end of file diff --git a/02.03 Zürich/Modo.md b/02.03 Zürich/Modo.md index f78a43c7..2d5bb90d 100644 --- a/02.03 Zürich/Modo.md +++ b/02.03 Zürich/Modo.md @@ -1,6 +1,6 @@ --- -Tag: ["Fresh"] +Tag: ["Fresh", "Restaurant"] Date: 2022-07-16 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Monocle.md b/02.03 Zürich/Monocle.md index 4409dbc9..57091baa 100644 --- a/02.03 Zürich/Monocle.md +++ b/02.03 Zürich/Monocle.md @@ -1,6 +1,6 @@ --- -Tag: ["Café", "International"] +Tag: ["Café", "International", "Coffee"] Date: 2022-09-03 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/No Idea.md b/02.03 Zürich/No Idea.md index 09ab39a6..a1db2a6c 100644 --- a/02.03 Zürich/No Idea.md +++ b/02.03 Zürich/No Idea.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: ["Modern"] +Tag: ["Modern", "Bar"] Date: 2022-05-29 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Polo Park Zürich.md b/02.03 Zürich/Polo Park Zürich.md index 82950fdb..753e0b84 100644 --- a/02.03 Zürich/Polo Park Zürich.md +++ b/02.03 Zürich/Polo Park Zürich.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: ["Zürich", "Sport", "Polo"] +Tag: ["Zürich", "Sport", "Polo", "Horse"] Date: 2022-08-20 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Rosi.md b/02.03 Zürich/Rosi.md index 5e9f079e..56a17a4e 100644 --- a/02.03 Zürich/Rosi.md +++ b/02.03 Zürich/Rosi.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-08-20 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Schluessel.md b/02.03 Zürich/Schluessel.md index fc31f7aa..1e09b596 100644 --- a/02.03 Zürich/Schluessel.md +++ b/02.03 Zürich/Schluessel.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-02-23 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Shilla.md b/02.03 Zürich/Shilla.md index 1f78a7c1..bc27c89c 100644 --- a/02.03 Zürich/Shilla.md +++ b/02.03 Zürich/Shilla.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-02-26 DocType: "Place" Hierarchy: "NonRoot" diff --git a/02.03 Zürich/Toto.md b/02.03 Zürich/Toto.md index b0e349cc..0f284cf0 100644 --- a/02.03 Zürich/Toto.md +++ b/02.03 Zürich/Toto.md @@ -1,7 +1,7 @@ --- Alias: [""] -Tag: [""] +Tag: ["Restaurant"] Date: 2022-02-23 DocType: "Place" Hierarchy: "NonRoot" diff --git a/03.04 Cinematheque/@Cinematheque.md b/03.04 Cinematheque/@Cinematheque.md index fbf38941..a21ddbd2 100644 --- a/03.04 Cinematheque/@Cinematheque.md +++ b/03.04 Cinematheque/@Cinematheque.md @@ -12,7 +12,7 @@ CollapseMetaTable: true TVShow: Name: "Game of Thrones" Season: 5 - Episode: 1 + Episode: 9 Source: Internal banner: "![[img_1924.jpg]]" banner_icon: 🍿 diff --git a/05.02 Networks/Server VPN.md b/05.02 Networks/Server VPN.md index 953dd0d9..c93e001a 100644 --- a/05.02 Networks/Server VPN.md +++ b/05.02 Networks/Server VPN.md @@ -290,7 +290,8 @@ Everything is rather self-explanatory. - [x] [[Server VPN]]: Backup server 🔁 every 6 months on the 1st Tuesday 📅 2021-10-14 ✅ 2022-01-08 - [x] [[Server VPN]]: Backup server 🔁 every 6 months on the 1st Tuesday ✅ 2021-10-13 -- [ ] :shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard %%done_del%% 🔁 every 3 months 📅 2022-09-18 +- [ ] :shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard %%done_del%% 🔁 every 3 months 📅 2022-12-18 +- [x] :shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard %%done_del%% 🔁 every 3 months 📅 2022-09-18 ✅ 2022-09-18 - [x] :shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard 🔁 every 3 months 📅 2022-06-18 ✅ 2022-06-20 - [x] [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard 🔁 every 3 months 📅 2022-03-18 ✅ 2022-03-18

wi7Zc6RpNRi>H;WC=q1>Io3Q zZeX#Hmj%_pT{%O5OSfHkx=f{FvBTM4Vrqc*1Go?!ju@%d;5MEL{JDfMb^* zfl)|r2pCM3TM?u$U=Hj_VpraT2nM>it|>?fgyD$xFk?L&gu6aqRsn%5dZQJHr~0~r z1Vw(_F<_Go3g&e)tDfP`|4|4ZGdld5Y$1i(tsLX*q@FC+W9h|43bi`&YWYL5Txgp z(mPEBGK_=@kI$-yvWC#1Kviq|KzY(KBDLn2S1gius6(l>TGH$#n^tT>ZmuDP+jF8l$oT0sGqn!9oT_E6r@0( zWP~pt2N@uXS&V3@Exmo<|D$1~(g;@Z0BaiXt0@WCoWz6MMZhgpWb}Fsanp_{sO5j%)yscn8H`|*;&`JHUvy! zcl-U!z#z=qA|Q!H$JOe{a9)5tc68NcG|b`ZdopjMeNc*O)asJSjDq&@YpeQ;?O_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_O~h&>kAkG|i&cn|pV?*%iR1o?r`mf_4wV1r99pS_&vVi^vEn9Qu!wb#`cOYJ6;YC24wje(wJ-U%96u7f_08C2P;Ko;(5p>Z<4z zTRyyOAe|6^Jwx!#%etu>ThTlfP?>k*#j+uc7&s3*IkLD)&$-Uh$AHU?+w!|TV8k&O zh9UH)a$yooAdlCG68p-#tqH|^?IEZ2p-5L42Ae46r&S{8>T8@4Y@d1#Mj`VV=;~lc z)WIBFg3b}!) z8{tA%UTy;~SQwg;+ztNfCTLK+2~hu!Z!?~@Ig?iICY@sGB2up9ml nH}`iLeCsW-!=-L^bYS literal 0 HcmV?d00001 diff --git a/.obsidian/plugins/obsidian-3d-graph/styles.css b/.obsidian/plugins/obsidian-3d-graph/styles.css new file mode 100644 index 00000000..38f6517b --- /dev/null +++ b/.obsidian/plugins/obsidian-3d-graph/styles.css @@ -0,0 +1,57 @@ +.graph-3d-view .tree-item.is-collapsed > .tree-item-children { + display: none; + visibility: hidden; +} + +.graph-3d-view { + padding: 0 !important; + position: relative; + overflow: hidden !important; +} + +.graph-3d-view .graph-controls.is-collapsed > .graph-control-section { + display: none; + visibility: hidden; +} +.graph-3d-view .graph-controls:hover > .control-buttons { + opacity: 0.5; +} + +.graph-3d-view .graph-controls > .control-buttons:hover { + opacity: 1; +} + +.graph-3d-view .graph-controls > .control-buttons { + float: right; + margin-right: 0; + opacity: 0; +} + +.graph-3d-view .hidden { + display: none; + visibility: hidden; +} + +.graph-3d-view .control-buttons { + display: block; +} + +.graph-3d-view .control-buttons > * { + display: inline-block; + margin: 0; +} + +.graph-3d-view .graph-settings-view > .clickable-icon { + position: absolute; + top: 8px; + left: 8px; +} + +.graph-3d-view .node-label { + color: var(--text-normal); +} + +.graph-3d-view .scene-nav-info { + display: none; + visibility: hidden; +} diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json index b2e3b554..25d42daa 100644 --- a/.obsidian/plugins/obsidian-activity-history/data.json +++ b/.obsidian/plugins/obsidian-activity-history/data.json @@ -12,8 +12,8 @@ "checkpointList": [ { "path": "/", - "date": "2022-09-17", - "size": 7122665 + "date": "2022-09-20", + "size": 7129893 } ], "activityHistory": [ @@ -1023,6 +1023,18 @@ { "date": "2022-09-17", "value": 1202 + }, + { + "date": "2022-09-18", + "value": 1974 + }, + { + "date": "2022-09-19", + "value": 2567 + }, + { + "date": "2022-09-20", + "value": 3285 } ] } diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json index cdd3624d..c4013120 100644 --- a/.obsidian/plugins/obsidian-commits/data.json +++ b/.obsidian/plugins/obsidian-commits/data.json @@ -21,7 +21,7 @@ }, "02.01 London/Epsom Polo Club.md": { "size": 1038, - "tags": 3, + "tags": 4, "links": 2 }, "02.01 London/Khan’s.md": { @@ -1012,7 +1012,7 @@ "02.02 Paris/Guibine.md": { "size": 954, "tags": 3, - "links": 1 + "links": 2 }, "02.02 Paris/Terrass'Hotel.md": { "size": 1004, @@ -1161,7 +1161,7 @@ }, "02.02 Paris/Domaine de Courances.md": { "size": 1018, - "tags": 4, + "tags": 5, "links": 2 }, "02.02 Paris/@Media France.md": { @@ -1441,7 +1441,7 @@ }, "02.03 Zürich/Gestuet Homberg.md": { "size": 1179, - "tags": 3, + "tags": 4, "links": 3 }, "02.03 Zürich/@@Zürich.md": { @@ -1890,7 +1890,7 @@ "links": 16 }, "05.02 Networks/Server VPN.md": { - "size": 5053, + "size": 5649, "tags": 4, "links": 11 }, @@ -1966,7 +1966,7 @@ }, "02.03 Zürich/Franzos.md": { "size": 1069, - "tags": 1, + "tags": 2, "links": 2 }, "02.03 Zürich/@Café Zürich.md": { @@ -1981,27 +1981,27 @@ }, "02.03 Zürich/Le Raymond Bar.md": { "size": 1078, - "tags": 1, + "tags": 2, "links": 4 }, "02.03 Zürich/Dante.md": { "size": 1051, - "tags": 1, + "tags": 2, "links": 4 }, "02.03 Zürich/Grande.md": { "size": 1055, - "tags": 0, + "tags": 1, "links": 4 }, "02.03 Zürich/La Stanza.md": { "size": 1165, - "tags": 0, + "tags": 1, "links": 3 }, "02.03 Zürich/Baur's.md": { "size": 972, - "tags": 0, + "tags": 1, "links": 2 }, "03.03 Food & Wine/Molletes.md": { @@ -2395,8 +2395,8 @@ "links": 0 }, "02.03 Zürich/La Baracca.md": { - "size": 1144, - "tags": 1, + "size": 1261, + "tags": 2, "links": 2 }, "00.03 News/Nurses Have Finally Learned What They’re Worth.md": { @@ -2480,18 +2480,18 @@ "links": 4 }, "02.03 Zürich/Bimi.md": { - "size": 1093, - "tags": 1, + "size": 1203, + "tags": 2, "links": 2 }, "02.03 Zürich/Toto.md": { "size": 1187, - "tags": 0, + "tags": 1, "links": 2 }, "02.03 Zürich/Schluessel.md": { "size": 1126, - "tags": 0, + "tags": 1, "links": 2 }, "00.03 News/A Vibe Shift Is Coming.md": { @@ -2556,12 +2556,12 @@ }, "02.03 Zürich/Afghan Anar.md": { "size": 1258, - "tags": 0, + "tags": 1, "links": 2 }, "02.03 Zürich/Shilla.md": { "size": 1075, - "tags": 0, + "tags": 1, "links": 2 }, "00.03 News/As rents rise, Americans are stuck in homes even when they want to move.md": { @@ -3631,7 +3631,7 @@ }, "02.03 Zürich/Café des Amis.md": { "size": 1200, - "tags": 1, + "tags": 2, "links": 4 }, "00.01 Admin/Calendars/2022-04-16.md": { @@ -3641,7 +3641,7 @@ }, "02.03 Zürich/Cantinetta Antinori.md": { "size": 1296, - "tags": 3, + "tags": 4, "links": 4 }, "00.03 News/How an Ivy League School Turned Against a Student.md": { @@ -3981,12 +3981,12 @@ }, "02.02 Paris/Chez Robert.md": { "size": 1226, - "tags": 2, + "tags": 3, "links": 4 }, "02.02 Paris/Inavoué.md": { "size": 1189, - "tags": 2, + "tags": 3, "links": 4 }, "00.01 Admin/Calendars/2022-05-22.md": { @@ -4081,12 +4081,12 @@ }, "02.03 Zürich/La Réserve.md": { "size": 1259, - "tags": 1, + "tags": 2, "links": 2 }, "02.03 Zürich/No Idea.md": { "size": 1173, - "tags": 1, + "tags": 2, "links": 2 }, "00.01 Admin/Calendars/2022-05-30.md": { @@ -4466,7 +4466,7 @@ }, "02.03 Zürich/Ginger.md": { "size": 1191, - "tags": 2, + "tags": 3, "links": 4 }, "00.01 Admin/Calendars/2022-07-09.md": { @@ -4536,12 +4536,12 @@ }, "02.03 Zürich/Daizy.md": { "size": 1202, - "tags": 2, + "tags": 3, "links": 4 }, "02.03 Zürich/Modo.md": { "size": 1204, - "tags": 1, + "tags": 2, "links": 4 }, "00.01 Admin/Calendars/2022-07-17.md": { @@ -5231,12 +5231,12 @@ }, "02.03 Zürich/Dolder Grand.md": { "size": 1159, - "tags": 2, + "tags": 3, "links": 3 }, "02.03 Zürich/Bebek.md": { "size": 1108, - "tags": 0, + "tags": 1, "links": 4 }, "03.04 Cinematheque/Django (1966).md": { @@ -5251,17 +5251,17 @@ }, "02.03 Zürich/Le Mezzerie.md": { "size": 1085, - "tags": 0, + "tags": 1, "links": 2 }, "02.03 Zürich/Polo Park Zürich.md": { "size": 1100, - "tags": 3, + "tags": 4, "links": 2 }, "02.03 Zürich/Rosi.md": { "size": 1104, - "tags": 0, + "tags": 1, "links": 2 }, "00.03 News/The architect who became the king of bank robberies.md": { @@ -5351,7 +5351,7 @@ }, "02.03 Zürich/Luca2.md": { "size": 1310, - "tags": 0, + "tags": 1, "links": 2 }, "00.01 Admin/Calendars/2022-08-24.md": { @@ -5359,11 +5359,6 @@ "tags": 0, "links": 7 }, - "00.06 Professional/@Professional.md": { - "size": 1231, - "tags": 0, - "links": 1 - }, "03.02 Travels/@Switzerland.md": { "size": 1197, "tags": 1, @@ -5496,11 +5491,11 @@ }, "02.03 Zürich/Monocle.md": { "size": 1412, - "tags": 2, + "tags": 3, "links": 2 }, "01.02 Home/League Tables.md": { - "size": 844, + "size": 755, "tags": 0, "links": 7 }, @@ -5531,7 +5526,7 @@ }, "02.03 Zürich/Kiosk.md": { "size": 1367, - "tags": 1, + "tags": 2, "links": 3 }, "00.03 News/Was Vincent van Gogh Color Blind It Sure Looks Like It.md": { @@ -5740,23 +5735,18 @@ "links": 7 }, "02.03 Zürich/Francisco Podesta.md": { - "size": 1256, - "tags": 3, + "size": 1385, + "tags": 4, "links": 2 }, - "01.02 Home/Zürich - Practical infos.md": { - "size": 981, - "tags": 0, - "links": 5 - }, "02.01 London/Callum Anderson.md": { "size": 1213, - "tags": 2, + "tags": 3, "links": 3 }, "02.01 London/Ryan Anderson.md": { "size": 1223, - "tags": 2, + "tags": 3, "links": 3 }, "00.01 Admin/Calendars/2023-09-08 Trip to NYC.md": { @@ -5792,15 +5782,55 @@ "00.01 Admin/Calendars/2022-09-17.md": { "size": 1181, "tags": 0, + "links": 9 + }, + "01.02 Home/Life - Practical infos.md": { + "size": 981, + "tags": 0, + "links": 5 + }, + "00.01 Admin/Calendars/2022-09-18.md": { + "size": 1196, + "tags": 0, "links": 8 + }, + "00.01 Admin/Calendars/2022-09-18 Lyon - Paris SG (0-1).md": { + "size": 194, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2022-09-19.md": { + "size": 1136, + "tags": 0, + "links": 7 + }, + "00.06 Professional/@@Professional.md": { + "size": 1231, + "tags": 0, + "links": 1 + }, + "00.06 Professional/@Useful tools.md": { + "size": 936, + "tags": 2, + "links": 1 + }, + "00.01 Admin/Calendars/2022-09-20.md": { + "size": 1136, + "tags": 0, + "links": 8 + }, + "02.03 Zürich/Luigia.md": { + "size": 1341, + "tags": 3, + "links": 2 } }, "commitTypes": { "/": { - "Refactor": 837, - "Create": 881, - "Link": 1814, - "Expand": 812 + "Refactor": 847, + "Create": 889, + "Link": 1867, + "Expand": 822 } }, "dailyCommits": { @@ -5809,42 +5839,52 @@ "1": 22, "2": 3, "3": 9, - "4": 13, + "4": 16, "5": 9, "6": 55, - "7": 302, - "8": 420, - "9": 433, + "7": 305, + "8": 421, + "9": 434, "10": 261, - "11": 221, + "11": 224, "12": 176, - "13": 271, - "14": 226, + "13": 275, + "14": 234, "15": 242, "16": 194, - "17": 205, + "17": 210, "18": 374, - "19": 193, - "20": 161, - "21": 141, - "22": 275, - "23": 75 + "19": 195, + "20": 165, + "21": 143, + "22": 280, + "23": 115 } }, "weeklyCommits": { "/": { - "Mon": 677, - "Tue": 556, + "Mon": 691, + "Tue": 607, "Wed": 585, "Thu": 399, "Fri": 431, "Sat": 0, - "Sun": 1696 + "Sun": 1712 } }, "recentCommits": { "/": { "Expanded": [ + " Francisco Podesta ", + " La Baracca ", + " Bimi ", + " Luigia ", + " 2022-09-18 ", + " @Useful tools ", + " @Useful tools ", + " 2022-09-18 Lyon - Paris SG ", + " 2022-09-18 Lyon - Paris SG ", + " Server VPN ", " 2022-09-17 ", " 2022-10-14 Weekend à GVA ", " 2023-02-11 Mariage Eloi & Zélie ", @@ -5885,19 +5925,17 @@ " 2022-10-21 Depart pour Paris ", " 2022-10-14 🚆 Départ pour GVA ", " 2022-10-16 Retour de GVA ", - " 2022-09-14 ", - " 2022-10-21 Depart pour Paris ", - " 2022-10-23 Retour de Paris ", - " 2022-09-30 🚆 Départ pour GVA ", - " 2022-10-02 Retour de GVA ", - " 2022-09-12 ", - " 2022-09-13 Diner Lorena ", - " Apple processes ", - " 2022-09-12 ", - " Household ", - " 2022-09-06 PSG - Juventus (2-1) " + " 2022-09-14 " ], "Created": [ + " Untitled ", + " 2022-09-20 ", + " 2022-09-20 ", + " Untitled ", + " 2022-09-19 ", + " 2022-09-18 Lyon - Paris SG ", + " The Daily - How Queen Elizabeth II Preserved the Monarchy ", + " 2022-09-18 ", " 2022-09-17 ", " 2022-10-10 ", " 2023-09-08 ", @@ -5940,17 +5978,15 @@ " Meghan of Montecito ", " U.K. braced for death of Queen Elizabeth II. It still came as a shock. ", " 2022-09-11 ", - " 2022-09-10 ", - " 2022-09-09 ", - " Batman Robin (1997) ", - " 2022-09-08 ", - " 2022-09-07 ", - " Untitled ", - " Untitled ", - " Untitled ", - " Untitled " + " 2022-09-10 " ], "Renamed": [ + " Luigia ", + " @Useful tools ", + " @@Professional ", + " 2022-09-18 Lyon - Paris SG (0-1) ", + " 2022-09-18 ⚽ Lyon - Paris SG (0-1) ", + " Life - Practical infos ", " 2023-02-11 Mariage Eloi & Zélie ", " 2022-10-14 Weekend à GVA ", " 2022-10-16 Weekend à GVA ", @@ -5995,15 +6031,47 @@ " Men in Black 3 (2012) ", " Men in Black II (2002) ", " Men in Black (1997) ", - " Was Vincent van Gogh Color Blind It Sure Looks Like It ", - " Kiosk ", - " 2022-09-03 Nantes - Paris SG (0-3) ", - " 2022-08-31 Toulouse - Paris SG (0-3) ", - " Paris SG ", - " League Tables ", - " Monocle " + " Was Vincent van Gogh Color Blind It Sure Looks Like It " ], "Tagged": [ + " Ryan Anderson ", + " Polo Park Zürich ", + " Domaine de Courances ", + " Callum Anderson ", + " Epsom Polo Club ", + " Chez Robert ", + " Inavoué ", + " Toto ", + " Shilla ", + " No Idea ", + " Le Raymond Bar ", + " Grande ", + " Luca2 ", + " Luigia ", + " Modo ", + " La Baracca ", + " Rosi ", + " Le Mezzerie ", + " La Stanza ", + " Kiosk ", + " Schluessel ", + " La Réserve ", + " Daizy ", + " Baur's ", + " Café des Amis ", + " Monocle ", + " Afghan Anar ", + " Bebek ", + " Dante ", + " Gestuet Homberg ", + " Cantinetta Antinori ", + " Bimi ", + " Ginger ", + " Francisco Podesta ", + " Franzos ", + " Dolder Grand ", + " Luigia ", + " @Useful tools ", " Ryan Anderson ", " Callum Anderson ", " Francisco Podesta ", @@ -6016,47 +6084,10 @@ " TRON - Legacy (2010) ", " Avatar (2009) ", " Basic Instinct (1992) ", - " The Cowboy and Queen Elizabeth ", - " The Victim Who Became the Accused ", - " Revolut chief Nikolay Storonsky We can still be banking’s super app ", - " The Victim Who Became the Accused ", - " Meghan of Montecito ", - " Why Are Black Families Leaving Cities ", - " The Second Elizabethan Age Has Ended ", - " U.K. braced for death of Queen Elizabeth II. It still came as a shock. ", - " Batman Robin (1997) ", - " Apple processes ", - " Le Miel de Paris ", - " The Lord of the Rings - The Return of the King (2003) ", - " The Lord of the Rings - The Fellowship of the Ring (2001) ", - " The Lord of the Rings - The Two Towers (2002) ", - " Men in Black II (2002) ", - " Men in Black 3 (2012) ", - " Men in Black (1997) ", - " Was Vincent van Gogh Color Blind It Sure Looks Like It ", - " Kiosk ", - " Paris SG ", - " Monocle ", - " Extroverts destroy the world ", - " Jellyfin ", - " Test sheet ", - " Squid Game (2021–) ", - " Derinkuyu Mysterious underground city in Turkey found in man’s basement ", - " Shakshuka ", - " Opinion Maternal Instinct Is a Myth That Men Created ", - " The Deacon and the Dog City Journal ", - " Why Don’t Millennials Have Hobbies ", - " Was King Arthur a Real Person ", - " Mountain hikes in Switzerland ", - " Skiing in Switzerland ", - " Geneva ", - " Skiing in Switzerland ", - " @Switzerland ", - " Pan-seared Seabream with vine leaf risotto ", - " Pan-seared Seabream with vine leaf risotto ", - " The messages that survived civilisation's collapse " + " The Cowboy and Queen Elizabeth " ], "Refactored": [ + " League Tables ", " 2022-10-03 Meggi leaving to Belfast ", " Zürich - Practical info ", " Zürich - Practical info ", @@ -6106,10 +6137,11 @@ " @Restaurants Zürich ", " 2022-06-20 ", " @France ", - " Avignon ", - " Bahrein " + " Avignon " ], "Deleted": [ + " 2022-09-20 ", + " The Daily - How Queen Elizabeth II Preserved the Monarchy ", " 2022-10-10 ", " 2022-10-10 Return flight to Zürich ", " 2022-10-23 Retour de Paris ", @@ -6158,11 +6190,24 @@ " Basquiat (1996) ", " Daily ", " Life Progress ", - " Inside Putin's Anti-Semitic Turn ", - " 403 Forbidden ", - " 2022-07-30 " + " Inside Putin's Anti-Semitic Turn " ], "Linked": [ + " Guibine ", + " 2022-09-20 ", + " 2022-09-20 ", + " Luigia ", + " 2022-09-20 ", + " 2022-09-19 ", + " 2022-09-18 ", + " @Useful tools ", + " 2022-09-19 ", + " 2022-09-19 ", + " 2022-09-18 Lyon - Paris SG ", + " 2022-09-18 Lyon - Paris SG ", + " 2022-09-18 ", + " 2022-09-17 ", + " 2022-09-18 ", " 2022-09-17 ", " 2022-09-17 ", " 2022-09-17 ", @@ -6198,22 +6243,7 @@ " 2022-09-30 🚆 Départ pour GVA ", " 2022-10-02 Retour de GVA ", " 2022-09-14 ", - " Why Are Black Families Leaving Cities ", - " Revolut chief Nikolay Storonsky We can still be banking’s super app ", - " The Devil's Advocate (1997) ", - " The Good the Bad and the Ugly (1966) ", - " The Godfather Part II (1974) ", - " The Godfather Part III (1990) ", - " The Godfather (1972) ", - " Dikkenek (2006) ", - " TRON - Legacy (2010) ", - " Avatar (2009) ", - " Basic Instinct (1992) ", - " The Cowboy and Queen Elizabeth ", - " 2022-09-12 ", - " 2022-09-13 ", - " U.K. braced for death of Queen Elizabeth II. It still came as a shock. ", - " The Cowboy and Queen Elizabeth " + " Why Are Black Families Leaving Cities " ], "Removed Tags from": [ " Le Miel de Paris ", @@ -6252,7 +6282,8 @@ " Server Cloud ", " Paris SG ", " Zürich - Practical info ", - " 2022-10-03 Meggi leaving to Belfast " + " 2022-10-03 Meggi leaving to Belfast ", + " 2022-09-19 " ] } }, diff --git a/.obsidian/plugins/obsidian-dice-roller/main.js b/.obsidian/plugins/obsidian-dice-roller/main.js index e246e2fb..5a468927 100644 --- a/.obsidian/plugins/obsidian-dice-roller/main.js +++ b/.obsidian/plugins/obsidian-dice-roller/main.js @@ -469,7 +469,7 @@ Use (?: \u2026 ) instead`);if(!N.lineBreaks&&Q.test(` .fad.fa-inverse { color: #fff; -}`;function zc(){var n=Wi,e=ji,t=T2.familyPrefix,i=T2.replacementClass,a=Cc;if(t!==n||i!==e){var r=new RegExp("\\.".concat(n,"\\-"),"g"),s=new RegExp("\\--".concat(n,"\\-"),"g"),o=new RegExp("\\.".concat(e),"g");a=a.replace(r,".".concat(t,"-")).replace(s,"--".concat(t,"-")).replace(o,".".concat(i))}return a}var Ac=function(){function n(){ko(this,n),this.definitions={}}return Uo(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,a=new Array(i),r=0;r1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:ma(e||{}),a=t.mask;return a&&(a=(a||{}).icon?a:ma(a||{})),n(i,F1({},t,{mask:a}))}}var Ec=new Ac;var va=!1;var L0=Sc(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,i=t===void 0?N4:t,a=e.symbol,r=a===void 0?!1:a,s=e.mask,o=s===void 0?null:s,l=e.maskId,c=l===void 0?null:l,u=e.title,f=u===void 0?null:u,h=e.titleId,m=h===void 0?null:h,v=e.classes,g=v===void 0?[]:v,x=e.attributes,p=x===void 0?{}:x,d=e.styles,z=d===void 0?{}:d;if(!!n){var b=n.prefix,C=n.iconName,E=n.icon;return _c(F1({type:"icon"},n),function(){return wc(),T2.autoA11y&&(f?p["aria-labelledby"]="".concat(T2.replacementClass,"-title-").concat(m||t6()):(p["aria-hidden"]="true",p.focusable="false")),vc({icons:{main:pa(E),mask:o?pa(o.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:C,transform:F1({},N4,i),symbol:r,title:f,maskId:c,titleId:m,extra:{attributes:p,styles:z,classes:g}})})}});function D0(n,e){let t=Object.keys(e).map(i=>Lc(n,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}function Lc(n,e,t){let i=n[e],a=n.hasOwnProperty(e),r=t(i);return i&&Object.setPrototypeOf(r,i),Object.setPrototypeOf(s,r),n[e]=s,o;function s(...l){return r===i&&n[e]===s&&o(),r.apply(this,l)}function o(){n[e]===s&&(a?n[e]=i:delete n[e]),r!==i&&(r=i,Object.setPrototypeOf(s,i||Function))}}var Ti=Z2(ga());var T0=/(?:(?\d+)[Dd])?#(?[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,xa=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+?)#?\^(?.+?)(?:\]\]|\))(?:\|(?