{"version":3,"file":"warpgate.js","sources":["../src/scripts/module.js","../src/scripts/crosshairs.js","../src/scripts/events.js","../src/scripts/mutator.js","../src/scripts/remote-mutator.js","../src/scripts/update-queue.js","../src/scripts/comms.js","../src/scripts/gateway.js","../src/scripts/mutation-stack.js","../src/scripts/lib/propagator.js","../src/scripts/lib/PlaceableFit.mjs","../src/scripts/lib/ring-highlight.js","../src/scripts/api.js","../src/scripts/user-interface.js","../src/scripts/warpgate.js"],"sourcesContent":["/** @typedef {import('./api.js').NoticeConfig} NoticeConfig */\n\n\n/**\n * __`options` property details__\n * | Input Type | Options Type | Default Value | Description |\n * |--|--|--|--|\n * | header, info | `none` | `undefined` | Ignored\n * | text, password, number | `string` | `''` | Initial value of input |\n * | checkbox | `boolean`| `false` | Initial checked state |\n * | radio | `[string, boolean]` | `['radio', false]` | Group name and initial checked state, respectively |\n * | select | `{html: string, value: any, selected: boolean}[]` or `string[]` | `[]` | HTML string for select option element, the value to be return if selected, and initial state. If only a string is provided, it will be used as both the HTML and return value. |\n * \n * @typedef {Object} MenuInput\n * @prop {string} type Type of input, controlling display and return values. See \"options property details,\" above, and {@link MenuResult MenuResult.button}.\n * @prop {string} label Display text for this inputs label element. Accepts HTML.\n * @prop {boolean|string|Array} [options] See \"options property details,\" above.\n */\n\n/**\n * @callback MenuCallback\n * @param {MenuResult} result User's chosen values (by reference) for this menu. Can modify or expand return value.\n * @param {HTMLElement} html Menu DOM element.\n */\n\n/**\n * @typedef {object} MenuButton\n * @prop {string} label Display text for this button, accepts HTML.\n * @prop {*} value Arbitrary object to return if selected.\n * @prop {MenuCallback} [callback] Additional callback to be executed\n * when this button is selected. Can be used to modify the menu's results object.\n * @prop {boolean} [default] Any truthy value sets this button as \n * default for the 'submit' or 'ENTER' dialog event. If none provided, the last button provided\n * will be used.\n */\n\n/**\n * @typedef {object} MenuConfig\n * @prop {string} title='Prompt' Title of dialog\n * @prop {string} defaultButton='Ok' Button label if no buttons otherwise provided\n * @prop {boolean} checkedText=false Return the associated label's `innerText` (no html) of `'checkbox'` or `'radio'` type inputs as opposed to its checked state.\n * @prop {Function} close=((resolve)=>resolve({buttons:false})) Override default behavior and return value if the menu is closed without a button selected.\n * @prop {function(HTMLElement):void} render=()=>{} \n * @prop {object} options Passed to the Dialog options argument.\n */\n\n/**\n * __`inputs` return details__\n * | Input Type | Return Type | Description |\n * |--|--|--|\n * | header, info | `undefined` | |\n * | text, password, number | `string` | Final input value\n * | checkbox, radio | `boolean\\|string`| Final checked state. Using `checkedText` results in `\"\"` for unchecked and `label` for checked. |\n * | select | `any` | `value` of the chosen select option, as provided by {@link MenuInput MenuInput.options[i].value} |\n *\n * @typedef {object} MenuResult\n * @prop {Array} inputs See \"inputs return details,\" above.\n * @prop {*} buttons `value` of the selected menu button, as provided by {@link MenuButton MenuButton.value}\n */\n\n\n/** @ignore */\nconst NAME = \"warpgate\";\n/** @ignore */\nconst PATH = `/modules/${NAME}`;\n\nexport class MODULE {\n static data = {\n name: NAME,\n path: PATH,\n title: \"Warp Gate\",\n };\n\n /**\n *\n *\n * @static\n * @param {*} shimId\n * @param {globalThis|*} [root=globalThis]\n * @returns {*|null}\n * @memberof MODULE\n */\n static compat(shimId, root = globalThis) {\n const gen = game.release?.generation;\n switch (shimId) {\n case \"interaction.pointer\":\n return gen < 11 ? root.canvas.app.renderer.plugins.interaction.mouse : canvas.app.renderer.events.pointer;\n case \"crosshairs.computeShape\":\n return (\n {\n 10: () => {\n if (root.document.t != \"circle\") {\n logger.error(\"Non-circular Crosshairs is unsupported!\");\n }\n return root._getCircleShape(root.ray.distance);\n },\n }[gen] ?? (() => root._computeShape())\n )();\n case \"token.delta\":\n return (\n {\n 10: \"actorData\",\n }[gen] ?? \"delta\"\n );\n default:\n return null;\n }\n }\n\n static async register() {\n logger.info(\"Initializing Module\");\n MODULE.settings();\n }\n\n static setting(key) {\n return game.settings.get(MODULE.data.name, key);\n }\n\n /**\n * Returns the localized string for a given warpgate scoped i18n key\n *\n * @ignore\n * @static\n * @param {*} key\n * @returns {string}\n * @memberof MODULE\n */\n static localize(key) {\n return game.i18n.localize(`warpgate.${key}`);\n }\n\n static format(key, data) {\n return game.i18n.format(`warpgate.${key}`, data);\n }\n\n static canSpawn(user) {\n const reqs = [\"TOKEN_CREATE\", \"TOKEN_CONFIGURE\", \"FILES_BROWSE\"];\n\n return MODULE.canUser(user, reqs);\n }\n\n static canMutate(user) {\n const reqs = [\"TOKEN_CONFIGURE\", \"FILES_BROWSE\"];\n\n return MODULE.canUser(user, reqs);\n }\n\n /**\n * Handles notice request from spawns and mutations\n *\n * @static\n * @param {{x: Number, y: Number}} location\n * @param {string} sceneId\n * @param {NoticeConfig} config\n * @memberof MODULE\n */\n static async handleNotice({ x, y }, sceneId, config) {\n /* can only operate if the user is on the scene requesting notice */\n if (\n canvas.ready &&\n !!sceneId &&\n !!config &&\n config.receivers.includes(game.userId) &&\n canvas.scene?.id === sceneId\n ) {\n const panSettings = {};\n const hasLoc = x !== undefined && y !== undefined;\n const doPan = !!config.pan;\n const doZoom = !!config.zoom;\n const doPing = !!config.ping;\n\n if (hasLoc) {\n panSettings.x = x;\n panSettings.y = y;\n }\n\n if (doPan) {\n panSettings.duration =\n Number.isNumeric(config.pan) && config.pan !== true\n ? Number(config.pan)\n : CONFIG.Canvas.pings.pullSpeed;\n }\n\n if (doZoom) {\n panSettings.scale = Math.min(CONFIG.Canvas.maxZoom, config.zoom);\n }\n\n if (doPan) {\n await canvas.animatePan(panSettings);\n }\n\n if (doPing && hasLoc) {\n const user = game.users.get(config.sender);\n const location = { x: panSettings.x, y: panSettings.y };\n\n /* draw the ping, either onscreen or offscreen */\n canvas.isOffscreen(location)\n ? canvas.controls.drawOffscreenPing(location, {\n scene: sceneId,\n style: CONFIG.Canvas.pings.types.ARROW,\n user,\n })\n : canvas.controls.drawPing(location, {\n scene: sceneId,\n style: config.ping,\n user,\n });\n }\n }\n }\n\n /**\n * @return {Array} missing permissions for this operation\n */\n static canUser(user, requiredPermissions) {\n if (MODULE.setting(\"disablePermCheck\")) return [];\n const { role } = user;\n const permissions = game.settings.get(\"core\", \"permissions\");\n return requiredPermissions\n .filter((req) => !permissions[req].includes(role))\n .map((missing) =>\n game.i18n.localize(CONST.USER_PERMISSIONS[missing].label)\n );\n }\n\n /**\n * A helper functions that returns the first active GM level user.\n * @returns {User|undefined} First active GM User\n */\n static firstGM() {\n return game.users?.find((u) => u.isGM && u.active);\n }\n\n /**\n * Checks whether the user calling this function is the user returned\n * by {@link warpgate.util.firstGM}. Returns true if they are, false if they are not.\n * @returns {boolean} Is the current user the first active GM user?\n */\n static isFirstGM() {\n return game.user?.id === MODULE.firstGM()?.id;\n }\n\n static emptyObject(obj) {\n // @ts-ignore\n return foundry.utils.isEmpty(obj);\n }\n\n static removeEmptyObjects(obj) {\n let result = foundry.utils.flattenObject(obj);\n Object.keys(result).forEach((key) => {\n if (typeof result[key] == \"object\" && MODULE.emptyObject(result[key])) {\n delete result[key];\n }\n });\n\n return foundry.utils.expandObject(result);\n }\n\n /**\n * Duplicates a compatible object (non-complex).\n *\n * @returns {Object}\n */\n static copy(source, errorString = \"error.unknown\") {\n try {\n return foundry.utils.deepClone(source, { strict: true });\n } catch (err) {\n logger.catchThrow(err, MODULE.localize(errorString));\n }\n\n return;\n }\n\n /**\n * Removes top level empty objects from the provided object.\n *\n * @static\n * @param {object} obj\n * @memberof MODULE\n */\n static stripEmpty(obj, inplace = true) {\n const result = inplace ? obj : MODULE.copy(obj);\n\n Object.keys(result).forEach((key) => {\n if (typeof result[key] == \"object\" && MODULE.emptyObject(result[key])) {\n delete result[key];\n }\n });\n\n return result;\n }\n\n static ownerSublist(docList) {\n /* break token list into sublists by first owner */\n const subLists = docList.reduce((lists, doc) => {\n if (!doc) return lists;\n const owner = MODULE.firstOwner(doc)?.id ?? \"none\";\n lists[owner] ??= [];\n lists[owner].push(doc);\n return lists;\n }, {});\n\n return subLists;\n }\n\n /**\n * Returns the first active user with owner permissions for the given document,\n * falling back to the firstGM should there not be any. Returns false if the\n * document is falsey. In the case of token documents it checks the permissions\n * for the token's actor as tokens themselves do not have a permission object.\n *\n * @param {{ actor: Actor } | { document: { actor: Actor } } | Actor} doc\n *\n * @returns {User|undefined}\n */\n static firstOwner(doc) {\n /* null docs could mean an empty lookup, null docs are not owned by anyone */\n if (!doc) return undefined;\n\n /* while conceptually correct, tokens derive permissions from their\n * (synthetic) actor data.\n */\n const corrected =\n doc instanceof TokenDocument\n ? doc.actor\n : // @ts-ignore 2589\n doc instanceof Token\n ? doc.document.actor\n : doc;\n\n const permissionObject = getProperty(corrected ?? {}, \"ownership\") ?? {};\n\n const playerOwners = Object.entries(permissionObject)\n .filter(\n ([id, level]) =>\n !game.users.get(id)?.isGM && game.users.get(id)?.active && level === 3\n )\n .map(([id]) => id);\n\n if (playerOwners.length > 0) {\n return game.users.get(playerOwners[0]);\n }\n\n /* if no online player owns this actor, fall back to first GM */\n return MODULE.firstGM();\n }\n\n /**\n * Checks whether the user calling this function is the user returned by\n * {@link warpgate.util.firstOwner} when the function is passed the\n * given document. Returns true if they are the same, false if they are not.\n *\n * As `firstOwner`, biases towards players first.\n *\n * @returns {boolean} the current user is the first player owner. If no owning player, first GM.\n */\n static isFirstOwner(doc) {\n return game.user.id === MODULE.firstOwner(doc).id;\n }\n\n /**\n * Helper function. Waits for a specified amount of time in milliseconds (be sure to await!).\n * Useful for timings with animations in the pre/post callbacks.\n *\n * @param {Number} ms Time to delay, in milliseconds\n * @returns Promise\n */\n static async wait(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n /**\n * Advanced helper function similar to `warpgate.wait` that allows for non-deterministic waits based on the predicate function, `fn`, provided.\n *\n * @param {function(iteration, currentTime):Boolean} fn Given the current wait iteration number and the time spent waiting as parameters, return a boolean indicating if we should continue to wait.\n * @param {number} [maxIter=600] Negative value will allow unbounded wait based on `fn`. Positive values act as a timeout. Defaults will cause a timeout after 1 minute.\n * @param {number} [iterWaitTime=100] Time (in ms) between each predicate function check for continued waiting\n * @returns {Boolean} Indicates if the function return was caused by timeout during waiting\n */\n static async waitFor(fn, maxIter = 600, iterWaitTime = 100) {\n let i = 0;\n const continueWait = (current, max) => {\n /* negative max iter means wait forever */\n if (maxIter < 0) return true;\n\n return current < max;\n };\n\n while (!fn(i, (i * iterWaitTime)) && continueWait(i, maxIter)) {\n i++;\n await MODULE.wait(iterWaitTime);\n }\n return i === maxIter ? false : true;\n }\n\n static settings() {\n const data = {\n disablePermCheck: {\n config: true,\n scope: \"world\",\n type: Boolean,\n default: false,\n },\n };\n\n MODULE.applySettings(data);\n }\n\n static applySettings(settingsData) {\n Object.entries(settingsData).forEach(([key, data]) => {\n game.settings.register(MODULE.data.name, key, {\n name: MODULE.localize(`setting.${key}.name`),\n hint: MODULE.localize(`setting.${key}.hint`),\n ...data,\n });\n });\n }\n\n /**\n * @param {string|Actor} actorNameDoc\n * @param {object} tokenUpdates\n *\n * @returns {Promise}\n */\n static async getTokenData(actorNameDoc, tokenUpdates) {\n let sourceActor = actorNameDoc;\n if (typeof actorNameDoc == \"string\") {\n /* lookup by actor name */\n sourceActor = game.actors.getName(actorNameDoc);\n }\n\n //get source actor\n if (!sourceActor) {\n logger.error(\n `Could not find world actor named \"${actorNameDoc}\" or no souce actor document provided.`\n );\n return false;\n }\n\n //get prototoken data -- need to prepare potential wild cards for the template preview\n let protoData = await sourceActor.getTokenDocument(tokenUpdates);\n if (!protoData) {\n logger.error(`Could not find proto token data for ${sourceActor.name}`);\n return false;\n }\n\n await loadTexture(protoData.texture.src);\n\n return protoData;\n }\n\n static async updateProtoToken(protoToken, changes) {\n protoToken.updateSource(changes);\n const img = getProperty(changes, \"texture.src\");\n if (img) await loadTexture(img);\n }\n\n static getMouseStagePos() {\n const mouse = MODULE.compat(\"interaction.pointer\");\n return mouse.getLocalPosition(canvas.app.stage);\n }\n\n /**\n * @returns {undefined} provided updates object modified in-place\n */\n static shimUpdate(updates) {\n updates.token = MODULE.shimClassData(\n TokenDocument.implementation,\n updates.token\n );\n updates.actor = MODULE.shimClassData(Actor.implementation, updates.actor);\n\n Object.keys(updates.embedded ?? {}).forEach((embeddedName) => {\n const cls = CONFIG[embeddedName].documentClass;\n\n Object.entries(updates.embedded[embeddedName]).forEach(\n ([shortId, data]) => {\n updates.embedded[embeddedName][shortId] =\n typeof data == \"string\" ? data : MODULE.shimClassData(cls, data);\n }\n );\n });\n }\n\n static shimClassData(cls, change) {\n if (!change) return change;\n\n if (!!change && !foundry.utils.isEmpty(change)) {\n /* shim data if needed */\n return cls.migrateData(foundry.utils.expandObject(change));\n }\n\n return foundry.utils.expandObject(change);\n }\n\n static getFeedbackSettings({\n alwaysAccept = false,\n suppressToast = false,\n } = {}) {\n const acceptSetting =\n MODULE.setting(\"alwaysAcceptLocal\") == 0\n ? MODULE.setting(\"alwaysAccept\")\n : { 1: true, 2: false }[MODULE.setting(\"alwaysAcceptLocal\")];\n\n const accepted = !!alwaysAccept ? true : acceptSetting;\n\n const suppressSetting =\n MODULE.setting(\"suppressToastLocal\") == 0\n ? MODULE.setting(\"suppressToast\")\n : { 1: true, 2: false }[MODULE.setting(\"suppressToastLocal\")];\n\n const suppress = !!suppressToast ? true : suppressSetting;\n\n return { alwaysAccept: accepted, suppressToast: suppress };\n }\n\n /**\n * Collects the changes in 'other' compared to 'base'.\n * Also includes \"delete update\" keys for elements in 'base' that do NOT\n * exist in 'other'.\n */\n static strictUpdateDiff(base, other) {\n /* get the changed fields */\n const diff = foundry.utils.flattenObject(\n foundry.utils.diffObject(base, other, { inner: true })\n );\n\n /* get any newly added fields */\n const additions = MODULE.unique(flattenObject(base), flattenObject(other));\n\n /* set their data to null */\n Object.keys(additions).forEach((key) => {\n if (typeof additions[key] != \"object\") diff[key] = null;\n });\n\n return foundry.utils.expandObject(diff);\n }\n\n static unique(object, remove) {\n // Validate input\n const ts = getType(object);\n const tt = getType(remove);\n if (ts !== \"Object\" || tt !== \"Object\")\n throw new Error(\"One of source or template are not Objects!\");\n\n // Define recursive filtering function\n const _filter = function (s, t, filtered) {\n for (let [k, v] of Object.entries(s)) {\n let has = t.hasOwnProperty(k);\n let x = t[k];\n\n // Case 1 - inner object\n if (has && getType(v) === \"Object\" && getType(x) === \"Object\") {\n filtered[k] = _filter(v, x, {});\n }\n\n // Case 2 - inner key\n else if (!has) {\n filtered[k] = v;\n }\n }\n return filtered;\n };\n\n // Begin filtering at the outer-most layer\n return _filter(object, remove, {});\n }\n\n /**\n * Helper function for quickly creating a simple dialog with labeled buttons and associated data.\n * Useful for allowing a choice of actors to spawn prior to `warpgate.spawn`.\n *\n * @param {Object} data\n * @param {Array<{label: string, value:*}>} data.buttons\n * @param {string} [data.title]\n * @param {string} [data.content]\n * @param {Object} [data.options]\n *\n * @param {string} [direction = 'row'] 'column' or 'row' accepted. Controls layout direction of dialog.\n */\n static async buttonDialog(data, direction = \"row\") {\n return await new Promise(async (resolve) => {\n /** @type Object */\n let buttons = {},\n dialog;\n\n data.buttons.forEach((button) => {\n buttons[button.label] = {\n label: button.label,\n callback: () => resolve(button.value),\n };\n });\n\n dialog = new Dialog(\n {\n title: data.title ?? \"\",\n content: data.content ?? \"\",\n buttons,\n close: () => resolve(false),\n },\n {\n /*width: '100%',*/\n height: \"100%\",\n ...data.options,\n }\n );\n\n await dialog._render(true);\n dialog.element.find(\".dialog-buttons\").css({\n \"flex-direction\": direction,\n });\n });\n }\n\n static dialogInputs = (data) => {\n /* correct legacy input data */\n data.forEach((inputData) => {\n if (inputData.type === \"select\") {\n inputData.options.forEach((e, i) => {\n switch (typeof e) {\n case \"string\":\n /* if we are handed legacy string values, convert them to objects */\n inputData.options[i] = { value: e, html: e };\n /* fallthrough to tweak missing values from object */\n\n case \"object\":\n /* if no HMTL provided, use value */\n inputData.options[i].html ??= inputData.options[i].value;\n\n /* sanity check */\n if (\n !!inputData.options[i].html &&\n inputData.options[i].value != undefined\n ) {\n break;\n }\n\n /* fallthrough to throw error if all else fails */\n\n default: {\n const emsg = MODULE.format(\"error.badSelectOpts\", {\n fnName: \"menu\",\n });\n logger.error(emsg);\n throw new Error(emsg);\n }\n }\n });\n }\n });\n\n const mapped = data\n .map(({ type, label, options }, i) => {\n type = type.toLowerCase();\n switch (type) {\n case \"header\":\n return `

${label}

`;\n case \"button\":\n return \"\";\n case \"info\":\n return `${label}`;\n case \"select\": {\n const optionString = options\n .map((e, i) => {\n return ``;\n })\n .join(\"\");\n\n return ``;\n }\n case \"radio\":\n return ``;\n case \"checkbox\":\n return ``;\n default:\n return ``;\n }\n })\n .join(``);\n\n const content = `\n\n ${mapped}\n
`;\n\n return content;\n };\n\n /**\n * Advanced dialog helper providing multiple input type options as well as user defined buttons.\n *\n * @static\n * @param {Object} [prompts]\n * @param {Array} [prompts.inputs]\n * @param {Array} [prompts.buttons] If no default button is specified, the last \n * button provided will be set as default\n * @param {MenuConfig} [config]\n *\n * @return {Promise} Object with `inputs` containing the chosen values for each provided input, in order, and the provided `value` of the pressed button or `false`, if closed.\n *\n * @example\n * const results = await warpgate.menu({\n * inputs: [{\n * label: 'My Way',\n * type: 'radio',\n * options: 'group1', \n * }, {\n * label: 'The Highway',\n * type: 'radio',\n * options: 'group1',\n * },{\n * label: 'Agree to ToS 😈',\n * type: 'checkbox',\n * options: true,\n * },{\n * type: 'select',\n * label: 'Make it a combo?',\n * options: [\n * {html: 'Yes ✅', value: {combo: true, size: 'med'}},\n * {html: 'No ❌', value: {combo: false}, selected:true},\n * {html: 'Super Size Me!', value: {combo: true, size: 'lg'}}\n * ],\n * }],\n * buttons: [{\n * label: 'Yes',\n * value: 1,\n * callback: () => ui.notifications.info('Yes was clicked'),\n * }, {\n * label: 'No',\n * value: 2\n * }, {\n * label: 'Maybe',\n * value: 3,\n * default: true,\n * callback: (results) => {\n * results.inputs[3].freebies = true;\n * ui.notifications.info('Let us help make your decision easier.')\n * },\n * }, {\n * label: 'Eventually',\n * value: 4\n * }]\n * },{\n * title: 'Choose Wisely...',\n * //checkedText: true, //Swap true/false output to label/empty string\n * render: (...args) => { console.log(...args); ui.notifications.info('render!')},\n * options: {\n * width: '100px',\n * height: '100%', \n * }\n * })\n * \n * console.log('results', results)\n * \n * // EXAMPLE OUTPUT\n * \n * // Ex1: Default state (Press enter when displayed)\n * // -------------------------------\n * // Foundry VTT | Rendering Dialog\n * // S.fn.init(3) [div.dialog-content, text, div.dialog-buttons]\n * // render!\n * // Let us help make your decision easier.\n * // results {\n * // \"inputs\": [\n * // false,\n * // false,\n * // true,\n * // {\n * // \"combo\": false,\n * // \"freebies\": true\n * // }\n * // ],\n * // \"buttons\": 3\n * // }\n * // \n * // Ex 2: Output for selecting 'My Way', super sizing\n * // the combo, and clicking 'Yes' \n * // -------------------------------\n * // Foundry VTT | Rendering Dialog\n * // S.fn.init(3) [div.dialog-content, text, div.dialog-buttons]\n * // render!\n * // Yes was clicked\n * // results {\n * // \"inputs\": [\n * // true,\n * // false,\n * // true,\n * // {\n * // \"combo\": true,\n * // \"size\": \"lg\"\n * // }\n * // ],\n * // \"buttons\": 1\n * // } \n */\n static async menu(prompts = {}, config = {}) {\n /* apply defaults to optional params */\n const configDefaults = {\n title: \"Prompt\",\n defaultButton: \"Ok\",\n render: null,\n close: (resolve) => resolve({ buttons: false }),\n options: {},\n };\n\n const { title, defaultButton, render, close, checkedText, options } =\n foundry.utils.mergeObject(configDefaults, config);\n const { inputs, buttons } = foundry.utils.mergeObject(\n { inputs: [], buttons: [] },\n prompts\n );\n\n return await new Promise((resolve) => {\n let content = MODULE.dialogInputs(inputs);\n /** @type Object */\n let buttonData = {};\n let def = buttons.at(-1)?.label;\n buttons.forEach((button) => {\n if (\"default\" in button) def = button.label;\n buttonData[button.label] = {\n label: button.label,\n callback: (html) => {\n const results = {\n inputs: MODULE._innerValueParse(inputs, html, {checkedText}),\n buttons: button.value,\n };\n if (button.callback instanceof Function)\n button.callback(results, html);\n return resolve(results);\n },\n };\n });\n\n /* insert standard submit button if none provided */\n if (buttons.length < 1) {\n def = defaultButton;\n buttonData = {\n [defaultButton]: {\n label: defaultButton,\n callback: (html) =>\n resolve({\n inputs: MODULE._innerValueParse(inputs, html, {checkedText}),\n buttons: true,\n }),\n },\n };\n }\n\n new Dialog(\n {\n title,\n content,\n default: def,\n close: (...args) => close(resolve, ...args),\n buttons: buttonData,\n render,\n },\n { focus: true, ...options }\n ).render(true);\n });\n }\n\n static _innerValueParse(data, html, {checkedText = false}) {\n return Array(data.length)\n .fill()\n .map((e, i) => {\n let { type } = data[i];\n if (type.toLowerCase() === `select`) {\n return data[i].options[html.find(`select#${i}qd`).val()].value;\n } else {\n switch (type.toLowerCase()) {\n case `text`:\n case `password`:\n return html.find(`input#${i}qd`)[0].value;\n case `radio`:\n case `checkbox`: {\n const ele = html.find(`input#${i}qd`)[0];\n \n if (checkedText) {\n const label = html.find(`[for=\"${i}qd\"]`)[0];\n return ele.checked ? label.innerText : '';\n }\n\n return ele.checked;\n }\n case `number`:\n return html.find(`input#${i}qd`)[0].valueAsNumber;\n }\n }\n });\n }\n}\n\n/** @ignore */\nexport class logger {\n static info(...args) {\n console.log(`${MODULE?.data?.title ?? \"\"} | `, ...args);\n }\n static debug(...args) {\n if (MODULE.setting(\"debug\"))\n console.debug(`${MODULE?.data?.title ?? \"\"} | `, ...args);\n }\n\n static warn(...args) {\n console.warn(`${MODULE?.data?.title ?? \"\"} | WARNING | `, ...args);\n ui.notifications.warn(\n `${MODULE?.data?.title ?? \"\"} | WARNING | ${args[0]}`\n );\n }\n\n static error(...args) {\n console.error(`${MODULE?.data?.title ?? \"\"} | ERROR | `, ...args);\n ui.notifications.error(`${MODULE?.data?.title ?? \"\"} | ERROR | ${args[0]}`);\n }\n\n static catchThrow(thrown, toastMsg = undefined) {\n console.warn(thrown);\n if (toastMsg) logger.error(toastMsg);\n }\n\n static register() {\n this.settings();\n }\n\n static settings() {\n const config = true;\n const settingsData = {\n debug: {\n scope: \"client\",\n config,\n default: false,\n type: Boolean,\n },\n };\n\n MODULE.applySettings(settingsData);\n }\n}\n","/* \n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n * \n * This program is free software: you can redistribute it and/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see .\n */\n\nimport { MODULE, logger } from './module.js'\n\n/** @typedef {import('@league-of-foundry-developers/foundry-vtt-types/src/foundry/common/data/data.mjs/measuredTemplateData.js').MeasuredTemplateDataProperties} MeasuredTemplateProperties */\n\n/**\n * Contains all fields from `MeasuredTemplate#toObject`, plus the following.\n * \n * @typedef {Object} CrosshairsData\n * @borrows MeasuredTemplateProperties\n * @prop {boolean} cancelled Workflow cancelled via right click (true)\n * @prop {Scene} scene Scene on this crosshairs was last active\n * @prop {number} radius Final radius of template, in pixels\n * @prop {number} size Final diameter of template, in grid units\n */\n\n/**\n * @class\n */\nexport class Crosshairs extends MeasuredTemplate {\n\n //constructor(gridSize = 1, data = {}){\n constructor(config, callbacks = {}) {\n const templateData = {\n t: config.t ?? \"circle\",\n user: game.user.id,\n distance: config.size,\n x: config.x,\n y: config.y,\n fillColor: config.fillColor,\n width: 1,\n texture: config.texture,\n direction: config.direction,\n }\n\n const template = new CONFIG.MeasuredTemplate.documentClass(templateData, {parent: canvas.scene});\n super(template);\n\n /** @TODO all of these fields should be part of the source data schema for this class **/\n /** image path to display in the center (under mouse cursor) */\n this.icon = config.icon ?? Crosshairs.ERROR_TEXTURE;\n\n /** text to display below crosshairs' circle */\n this.label = config.label;\n\n /** Offsets the default position of the label (in pixels) */\n this.labelOffset = config.labelOffset;\n\n /**\n * Arbitrary field used to identify this instance\n * of a Crosshairs in the canvas.templates.preview\n * list\n */\n this.tag = config.tag;\n\n /** Should the center icon be shown? */\n this.drawIcon = config.drawIcon;\n\n /** Should the outer circle be shown? */\n this.drawOutline = config.drawOutline;\n\n /** Opacity of the fill color */\n this.fillAlpha = config.fillAlpha;\n\n /** Should the texture (if any) be tiled\n * or scaled and offset? */\n this.tileTexture = config.tileTexture;\n\n /** locks the size of crosshairs (shift+scroll) */\n this.lockSize = config.lockSize;\n\n /** locks the position of crosshairs */\n this.lockPosition = config.lockPosition;\n\n /** Number of quantization steps along\n * a square's edge (N+1 snap points \n * along each edge, conting endpoints)\n */\n this.interval = config.interval;\n\n /** Callback functions to execute\n * at particular times\n */\n this.callbacks = callbacks;\n\n /** Indicates if the user is actively \n * placing the crosshairs.\n * Setting this to true in the show\n * callback will stop execution\n * and report the current mouse position\n * as the chosen location\n */\n this.inFlight = false;\n\n /** indicates if the placement of\n * crosshairs was canceled (with\n * a right click)\n */\n this.cancelled = true;\n\n /**\n * Indicators on where cancel was initiated\n * for determining if it was a drag or a cancel\n */\n this.rightX = 0;\n this.rightY = 0;\n\n /** @type {number} */\n this.radius = this.document.distance * this.scene.grid.size / 2;\n }\n\n /**\n * @returns {CrosshairsData} Current Crosshairs class data\n */\n toObject() {\n\n /** @type {CrosshairsData} */\n const data = foundry.utils.mergeObject(this.document.toObject(), {\n cancelled: this.cancelled,\n scene: this.scene,\n radius: this.radius,\n size: this.document.distance,\n });\n delete data.width;\n return data;\n }\n\n static ERROR_TEXTURE = 'icons/svg/hazard.svg'\n\n /**\n * Will retrieve the active crosshairs instance with the defined tag identifier.\n * @param {string} key Crosshairs identifier. Will be compared against the Crosshairs `tag` field for strict equality.\n * @returns {PIXI.DisplayObject|undefined}\n */\n static getTag(key) {\n return canvas.templates.preview.children.find( child => child.tag === key )\n }\n\n static getSnappedPosition({x,y}, interval){\n const offset = interval < 0 ? canvas.grid.size/2 : 0;\n const snapped = canvas.grid.getSnappedPosition(x - offset, y - offset, interval);\n return {x: snapped.x + offset, y: snapped.y + offset};\n }\n\n /* -----------EXAMPLE CODE FROM MEASUREDTEMPLATE.JS--------- */\n /* Portions of the core package (MeasuredTemplate) repackaged \n * in accordance with the \"Limited License Agreement for Module \n * Development, found here: https://foundryvtt.com/article/license/ \n * Changes noted where possible\n */\n\n /**\n * Set the displayed ruler tooltip text and position\n * @private\n */\n //BEGIN WARPGATE\n _setRulerText() {\n this.ruler.text = this.label;\n /** swap the X and Y to use the default dx/dy of a ray (pointed right)\n //to align the text to the bottom of the template */\n this.ruler.position.set(-this.ruler.width / 2 + this.labelOffset.x, this.template.height / 2 + 5 + this.labelOffset.y);\n //END WARPGATE\n }\n\n /** @override */\n async draw() {\n this.clear();\n\n // Load the texture\n const texture = this.document.texture;\n if ( texture ) {\n this._texture = await loadTexture(texture, {fallback: 'icons/svg/hazard.svg'});\n } else {\n this._texture = null;\n }\n\n // Template shape\n this.template = this.addChild(new PIXI.Graphics());\n\n // Rotation handle\n //BEGIN WARPGATE\n //this.handle = this.addChild(new PIXI.Graphics());\n //END WARPGATE\n\n // Draw the control icon\n //if(this.drawIcon) \n this.controlIcon = this.addChild(this._drawControlIcon());\n\n // Draw the ruler measurement\n this.ruler = this.addChild(this._drawRulerText());\n\n // Update the shape and highlight grid squares\n this.refresh();\n //BEGIN WARPGATE\n this._setRulerText();\n //this.highlightGrid();\n //END WARPGATE\n\n // Enable interactivity, only if the Tile has a true ID\n if ( this.id ) this.activateListeners();\n return this;\n }\n\n /**\n * Draw the Text label used for the MeasuredTemplate\n * @return {PreciseText}\n * @protected\n */\n _drawRulerText() {\n const style = CONFIG.canvasTextStyle.clone();\n style.fontSize = Math.max(Math.round(canvas.dimensions.size * 0.36 * 12) / 12, 36);\n const text = new PreciseText(null, style);\n //BEGIN WARPGATE\n //text.anchor.set(0.5, 0);\n text.anchor.set(0, 0);\n //END WARPGATE\n return text;\n }\n\n /**\n * Draw the ControlIcon for the MeasuredTemplate\n * @return {ControlIcon}\n * @protected\n */\n _drawControlIcon() {\n const size = Math.max(Math.round((canvas.dimensions.size * 0.5) / 20) * 20, 40);\n\n //BEGIN WARPGATE\n let icon = new ControlIcon({texture: this.icon, size: size});\n icon.visible = this.drawIcon;\n //END WARPGATE\n\n icon.pivot.set(size*0.5, size*0.5);\n //icon.x -= (size * 0.5);\n //icon.y -= (size * 0.5);\n icon.angle = this.document.direction;\n return icon;\n }\n\n /** @override */\n refresh() {\n if (!this.template || this._destroyed) return;\n let d = canvas.dimensions;\n const document = this.document;\n this.position.set(document.x, document.y);\n\n // Extract and prepare data\n let {direction, distance} = document;\n distance *= (d.size/2);\n //BEGIN WARPGATE\n //width *= (d.size / d.distance);\n //END WARPGATE\n direction = Math.toRadians(direction);\n\n // Create ray and bounding rectangle\n this.ray = Ray.fromAngle(document.x, document.y, direction, distance);\n\n // Get the Template shape\n this.shape = MODULE.compat('crosshairs.computeShape', this);\n\n // Draw the Template outline\n this.template.clear()\n .lineStyle(this._borderThickness, this.borderColor, this.drawOutline ? 0.75 : 0)\n\n // Fill Color or Texture\n\n if (this._texture) {\n /* assume 0,0 is top left of texture\n * and scale/offset this texture (due to origin\n * at center of template). tileTexture indicates\n * that this texture is tilable and does not \n * need to be scaled/offset */\n const scale = this.tileTexture ? 1 : distance * 2 / this._texture.width;\n const offset = this.tileTexture ? 0 : distance;\n this.template.beginTextureFill({\n texture: this._texture,\n matrix: new PIXI.Matrix().scale(scale, scale).translate(-offset, -offset)\n });\n } else {\n this.template.beginFill(this.fillColor, this.fillAlpha);\n }\n\n // Draw the shape\n this.template.drawShape(this.shape);\n\n // Draw origin and destination points\n //BEGIN WARPGATE\n //this.template.lineStyle(this._borderThickness, 0x000000, this.drawOutline ? 0.75 : 0)\n // .beginFill(0x000000, 0.5)\n //.drawCircle(0, 0, 6)\n //.drawCircle(this.ray.dx, this.ray.dy, 6);\n //END WARPGATE\n\n // Update visibility\n if (this.drawIcon) {\n this.controlIcon.visible = true;\n this.controlIcon.border.visible = this._hover\n this.controlIcon.angle = document.direction;\n }\n\n // Draw ruler text\n //BEGIN WARPGATE\n this._setRulerText()\n //END WARPGATE\n return this;\n }\n\n /* END MEASUREDTEMPLATE.JS USAGE */\n\n\n /* -----------EXAMPLE CODE FROM ABILITY-TEMPLATE.JS--------- */\n /* Foundry VTT 5th Edition\n * Copyright (C) 2019 Foundry Network\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * Original License: \n * https://gitlab.com/foundrynet/dnd5e/-/blob/master/LICENSE.txt\n */\n\n /**\n * Creates a preview of the spell template\n */\n\n get layer() {\n return canvas.activeLayer;\n }\n\n async drawPreview() {\n // Draw the template and switch to the template layer\n //this.initialLayer = canvas.activeLayer;\n //this.layer.activate();\n await this.draw();\n this.layer.preview.addChild(this);\n this.layer.interactiveChildren = false;\n\n // Hide the sheet that originated the preview\n //BEGIN WARPGATE\n this.inFlight = true;\n\n // Activate interactivity\n this.activatePreviewListeners();\n\n // Callbacks\n this.callbacks?.show?.(this);\n\n /* wait _indefinitely_ for placement to be decided. */\n await MODULE.waitFor(() => !this.inFlight, -1)\n if (this.activeHandlers) {\n this.clearHandlers();\n }\n\n //END WARPGATE\n return this;\n }\n\n /* -------------------------------------------- */\n\n _mouseMoveHandler(event) {\n event.stopPropagation();\n\n /* if our position is locked, do not update it */\n if (this.lockPosition) return;\n\n // Apply a 20ms throttle\n let now = Date.now();\n if (now - this.moveTime <= 20) return;\n\n const center = event.data.getLocalPosition(this.layer);\n const {x,y} = Crosshairs.getSnappedPosition(center, this.interval);\n this.document.updateSource({x, y});\n this.refresh();\n this.moveTime = now;\n\n if(now - this.initTime > 1000){\n logger.debug(`1 sec passed (${now} - ${this.initTime}) - panning`);\n canvas._onDragCanvasPan(event.data.originalEvent);\n }\n }\n\n _leftClickHandler(event) {\n event.preventDefault();\n\n const document = this.document;\n const thisSceneSize = this.scene.grid.size;\n\n const destination = Crosshairs.getSnappedPosition(this.document, this.interval);\n this.radius = document.distance * thisSceneSize / 2;\n this.cancelled = false;\n\n this.document.updateSource({ ...destination });\n \n this.clearHandlers(event);\n return true;\n }\n\n // Rotate the template by 3 degree increments (mouse-wheel)\n // none = rotate 5 degrees\n // shift = scale size\n // ctrl = rotate 30 or 15 degrees (square/hex)\n // alt = zoom canvas\n _mouseWheelHandler(event) {\n\n if (event.ctrlKey) event.preventDefault(); // Avoid zooming the browser window\n if (!event.altKey) event.stopPropagation();\n\n const delta = canvas.grid.type > CONST.GRID_TYPES.SQUARE ? 30 : 15;\n const snap = event.ctrlKey ? delta : 5;\n //BEGIN WARPGATE\n const document = this.document;\n const thisSceneSize = this.scene.grid.size;\n if (event.shiftKey && !this.lockSize) {\n let distance = document.distance + 0.25 * (Math.sign(event.deltaY));\n distance = Math.max(distance, 0.25);\n this.document.updateSource({ distance });\n this.radius = document.distance * thisSceneSize / 2;\n } else if (!event.altKey) {\n const direction = document.direction + (snap * Math.sign(event.deltaY));\n this.document.updateSource({ direction });\n }\n //END WARPGATE\n this.refresh();\n }\n\n _rightDownHandler(event) {\n if (event.button !== 2) return;\n\n this.rightX = event.screenX;\n this.rightY = event.screenY;\n }\n\n _rightUpHandler(event) {\n if (event.button !== 2) return;\n\n const isWithinThreshold = (current, previous) => Math.abs(current - previous) < 10;\n if (isWithinThreshold(this.rightX, event.screenX)\n && isWithinThreshold(this.rightY, event.screenY)\n ) {\n this.cancelled = true;\n this.clearHandlers(event);\n }\n }\n\n /* Disable left drag monitoring */\n //_onDragLeftStart(evt) {}\n //_onDragStart(evt) {}\n //_onDragLeftMove(evt) {}\n\n _clearHandlers(event) {\n this.template.destroy();\n this._destroyed = true;\n this.layer.preview.removeChild(this);\n\n this.inFlight = false;\n \n //WARPGATE BEGIN\n canvas.stage.off(\"mousemove\", this.activeMoveHandler);\n canvas.stage.off(\"mousedown\", this.activeLeftClickHandler);\n canvas.app.view.onmousedown = null;\n canvas.app.view.onmouseup = null;\n canvas.app.view.onwheel = null;\n\n // Show the sheet that originated the preview\n if (this.actorSheet) this.actorSheet.maximize();\n //WARPGATE END\n\n /* re-enable interactivity on this layer */\n canvas.mouseInteractionManager.reset({interactionData: true});\n this.layer.interactiveChildren = true;\n }\n\n /**\n * Activate listeners for the template preview\n */\n activatePreviewListeners() {\n this.moveTime = 0;\n this.initTime = Date.now();\n //BEGIN WARPGATE\n this.removeAllListeners();\n /* Activate listeners */\n this.activeMoveHandler = this._mouseMoveHandler.bind(this);\n this.activeLeftClickHandler = this._leftClickHandler.bind(this);\n this.rightDownHandler = this._rightDownHandler.bind(this);\n this.rightUpHandler = this._rightUpHandler.bind(this);\n this.activeWheelHandler = this._mouseWheelHandler.bind(this);\n\n this.clearHandlers = this._clearHandlers.bind(this);\n\n // Update placement (mouse-move)\n canvas.stage.on(\"mousemove\", this.activeMoveHandler);\n\n // Confirm the workflow (left-click)\n canvas.stage.on(\"mousedown\", this.activeLeftClickHandler);\n\n // Mouse Wheel rotate\n canvas.app.view.onwheel = this.activeWheelHandler;\n\n // Right click cancel\n canvas.app.view.onmousedown = this.rightDownHandler;\n canvas.app.view.onmouseup = this.rightUpHandler;\n\n // END WARPGATE\n }\n\n /** END ABILITY-TEMPLATE.JS USAGE */\n}\n","import {\n logger\n} from './module.js'\n\nconst NAME = 'Events';\n\nlet watches = {};\nlet triggers = {};\nlet id = 0;\n\nconst removeIf = function (array, condition) {\n let i = array.length;\n while (i--) {\n if (condition(array[i], i)) {\n this.splice(i, 1);\n return true;\n }\n }\n\n return false;\n};\n\nexport class Events {\n\n /**\n * Similar in operation to `Hooks.on`, with two exceptions. First, the provided function \n * can be asynchronous and will be awaited. Second, an optional `conditionFn` parameter \n * is added to help compartmentalize logic between detecting the desired event and responding to said event.\n *\n * @param {String} name Event name to watch for; It is recommended to use the enums found in {@link warpgate.EVENT}\n * @param {function(object):Promise|void} fn Function to execute when this event has passed the condition function. Will be awaited\n * @param {function(object):boolean} [condition = ()=>true] Optional. Function to determine if the event function should \n * be executed. While not strictly required, as the `fn` function could simply return as a NOOP, providing this \n * parameter may help compartmentalize \"detection\" vs \"action\" processing.\n *\n * @returns {number} Function id assigned to this event, for use with {@link warpgate.event.remove}\n */\n static watch(name, fn, condition = () => {\n return true;\n }) {\n if (!watches[name]) watches[name] = [];\n id++;\n watches[name].push({\n fn,\n condition,\n id\n });\n return id;\n }\n\n /**\n * Identical to {@link warpgate.event.watch}, except that this function will only be called once, after the condition is met.\n *\n * @see {@link warpgate.event.watch}\n */\n static trigger(name, fn, condition = () => {\n return true;\n }) {\n if (!triggers[name]) triggers[name] = [];\n id++;\n triggers[name].push({\n fn,\n condition,\n id\n });\n return id;\n }\n\n\n static async run(name, data) {\n for (const {\n fn,\n condition,\n id\n } of watches[name] ?? []) {\n try {\n if (condition(data)) {\n logger.debug(`${name} | ${id} passes watch condition`);\n await fn(data);\n } else {\n logger.debug(`${name} | ${id} fails watch condition`);\n }\n } catch (e) {\n logger.error(`${NAME} | error`, e, `\\n \\nIn watch function (${name})\\n`, fn);\n }\n }\n\n let {\n run,\n keep\n } = (triggers[name] ?? []).reduce((acum, elem) => {\n try {\n const passed = elem.condition(data);\n if (passed) {\n logger.debug(`${name} | ${elem.id} passes trigger condition`);\n acum.run.push(elem);\n } else {\n logger.debug(`${name} | ${elem.id} fails trigger condition`);\n acum.keep.push(elem);\n }\n } catch (e) {\n logger.error(`${NAME} | error`, e, `\\n \\nIn trigger condition function (${name})\\n`, elem.condition);\n return acum;\n } finally {\n return acum;\n }\n }, {\n run: [],\n keep: []\n });\n\n for (const {\n fn,\n id\n } of run) {\n logger.debug(`${name} | calling trigger ${id}`);\n try {\n await fn(data);\n } catch (e) {\n logger.error(`${NAME} | error`, e, `\\n \\nIn trigger function (${name})\\n`, fn);\n }\n }\n\n triggers[name] = keep;\n }\n\n /**\n * Removes a `watch` or `trigger` by its provided id -- obtained by the return value of `watch` and `trigger`.\n *\n * @param {number} id Numerical ID of the event function to remove.\n *\n * @see warpgate.event.watch\n * @see warpgate.event.trigger\n */\n static remove(id) {\n\n const tryRemove = (page) => {\n let i = page.length;\n while (i--) {\n if (page[i].id == id) {\n page.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n const hookRemove = Object.values(watches).map(tryRemove).reduce((sum, current) => {\n return sum || current\n }, false);\n\n const triggerRemove = Object.values(triggers).map(tryRemove).reduce((sum, current) => {\n return sum || current\n }, false);\n\n return hookRemove || triggerRemove;\n }\n}\n","/* \n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n * \n * This program is free software: you can redistribute it and/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see .\n */\n\nimport {MODULE, logger} from './module.js'\nimport {remoteMutate, remoteRevert, remoteBatchMutate, remoteBatchRevert} from './remote-mutator.js'\n\n/** @ignore */\nconst NAME = \"Mutator\";\n\n/** @typedef {import('./api.js').ComparisonKeys} ComparisonKeys */\n/** @typedef {import('./api.js').NoticeConfig} NoticeConfig */\n/** @typedef {import('./mutation-stack.js').MutationData} MutationData */\n/** @typedef {import('./api.js').Shorthand} Shorthand */\n/** @typedef {import('./api.js').SpawningOptions} SpawningOptions */\n\n//TODO proper objects\n/** @typedef {Object} MutateInfo\n * @ignore\n */\n\n/**\n * Workflow options\n * @typedef {Object} WorkflowOptions\n * @property {Shorthand} [updateOpts] Options for the creation/deletion/updating of (embedded) documents related to this mutation \n * @property {string} [description] Description of this mutation for potential display to the remote owning user.\n * @property {NoticeConfig} [notice] Options for placing a ping or panning to the token after mutation\n * @property {boolean} [noMoveWait = false] If true, will not wait for potential token movement animation to complete before proceeding with remaining actor/embedded updates.\n * @property {Object} [overrides]\n * @property {boolean} [overrides.alwaysAccept = false] Force the receiving clients \"auto-accept\" state,\n * regardless of world/client settings\n * @property {boolean} [overrides.suppressToast = false] Force the initiating and receiving clients to suppress\n * the \"call and response\" UI toasts indicating the requests accepted/rejected response.\n * @property {boolean} [overrides.includeRawData = false] Force events produced from this operation to include the \n * raw data used for its operation (such as the final mutation data to be applied, or the resulting packed actor \n * data from a spawn). **Caution, use judiciously** -- enabling this option can result in potentially large\n * socket data transfers during warpgate operation.\n * @property {boolean} [overrides.preserveData = false] If enabled, the provided updates data object will\n * be modified in-place as needed for internal Warp Gate operations and will NOT be re-usable for a\n * subsequent operation. Otherwise, the provided data is copied and modified internally, preserving\n * the original input for subsequent re-use.\n *\n */\n\n/**\n *\n * @typedef {Object} MutationOptions\n * @property {boolean} [permanent=false] Indicates if this should be treated as a permanent change\n * to the actor, which does not store the update delta information required to revert mutation.\n * @property {string} [name=randomId()] User provided name, or identifier, for this particular\n * mutation operation. Used for reverting mutations by name, as opposed to popping last applied.\n * @property {Object} [delta]\n * @property {ComparisonKeys} [comparisonKeys]\n */\n\n/**\n * The post delta creation, pre mutate callback. Called after the update delta has been generated, but before \n * it is stored on the actor. Can be used to modify this delta for storage (ex. Current and Max HP are\n * increased by 10, but when reverted, you want to keep the extra Current HP applied. Update the delta object\n * with the desired HP to return to after revert, or remove it entirely.\n *\n * @typedef {(function(Shorthand,TokenDocument):Promise|undefined)} PostDelta\n * @param {Shorthand} delta Computed change of the actor based on `updates`. Used to \"unroll\" this mutation when reverted.\n * @param {TokenDocument} tokenDoc Token being modified.\n *\n * @returns {Promise|any}\n */\n\n/**\n * The post mutate callback prototype. Called after the actor has been mutated and after the mutate event\n * has triggered. Useful for animations or changes that should not be tracked by the mutation system.\n *\n * @typedef {function(TokenDocument, Object, boolean):Promise|void} PostMutate\n * @param {TokenDocument} tokenDoc Token that has been modified.\n * @param {Shorthand} updates Current permutation of the original shorthand updates object provided, as\n * applied for this mutation\n * @param {boolean} accepted Whether or not the mutation was accepted by the first owner.\n *\n * @returns {Promise|any}\n */\n\nclass Mutator {\n static register() {\n Mutator.defaults();\n }\n\n static defaults(){\n MODULE[NAME] = {\n comparisonKey: 'name'\n }\n }\n\n static #idByQuery( list, key, comparisonPath ) {\n const id = this.#findByQuery(list, key, comparisonPath)?.id ?? null;\n\n return id;\n }\n\n static #findByQuery( list, key, comparisonPath ) {\n return list.find( element => getProperty(element, comparisonPath) === key )\n }\n\n //TODO change to reduce\n static _parseUpdateShorthand(collection, updates, comparisonKey) {\n let parsedUpdates = Object.keys(updates).map((key) => {\n if (updates[key] === warpgate.CONST.DELETE) return { _id: null };\n const _id = this.#idByQuery(collection, key, comparisonKey )\n return {\n ...updates[key],\n _id,\n }\n });\n parsedUpdates = parsedUpdates.filter( update => !!update._id);\n return parsedUpdates;\n }\n\n //TODO change to reduce\n static _parseDeleteShorthand(collection, updates, comparisonKey) {\n let parsedUpdates = Object.keys(updates).map((key) => {\n if (updates[key] !== warpgate.CONST.DELETE) return null;\n return this.#idByQuery(collection, key, comparisonKey);\n });\n\n parsedUpdates = parsedUpdates.filter( update => !!update);\n return parsedUpdates;\n }\n\n static _parseAddShorthand(collection, updates, comparisonKey){\n\n let parsedAdds = Object.keys(updates).reduce((acc, key) => {\n\n /* ignore deletes */\n if (updates[key] === warpgate.CONST.DELETE) return acc;\n\n /* ignore item updates for items that exist */\n if (this.#idByQuery(collection, key, comparisonKey)) return acc;\n \n let data = updates[key];\n setProperty(data, comparisonKey, key);\n acc.push(data);\n return acc;\n },[]);\n\n return parsedAdds;\n\n }\n\n static _invertShorthand(collection, updates, comparisonKey){\n let inverted = {};\n Object.keys(updates).forEach( (key) => {\n\n /* find this item currently and copy off its data */ \n const currentData = this.#findByQuery(collection, key, comparisonKey);\n\n /* this is a delete */\n if (updates[key] === warpgate.CONST.DELETE) {\n\n /* hopefully we found something */\n if(currentData) setProperty(inverted, key, currentData.toObject());\n else logger.debug('Delta Creation: Could not locate shorthand identified document for deletion.', collection, key, updates[key]);\n\n return;\n }\n\n /* this is an update */\n if (currentData){\n /* grab the current value of any updated fields and store */\n const expandedUpdate = expandObject(updates[key]);\n const sourceData = currentData.toObject();\n const updatedData = mergeObject(sourceData, expandedUpdate, {inplace: false});\n\n const diff = MODULE.strictUpdateDiff(updatedData, sourceData);\n \n setProperty(inverted, updatedData[comparisonKey], diff);\n return;\n }\n \n /* must be an add, so we delete */\n setProperty(inverted, key, warpgate.CONST.DELETE);\n \n });\n\n return inverted;\n }\n\n \n\n static _errorCheckEmbeddedUpdates( embeddedName, updates ) {\n\n /* at the moment, the most pressing error is an Item creation without a 'type' field.\n * This typically indicates a failed lookup for an update operation\n */\n if( embeddedName == 'Item'){\n const badItemAdd = (updates.add ?? []).find( add => !add.type );\n\n if (badItemAdd) {\n logger.info(badItemAdd);\n const message = MODULE.format('error.badMutate.missing.type', {embeddedName});\n\n return {error: true, message}\n }\n }\n\n return {error:false};\n }\n\n /* run the provided updates for the given embedded collection name from the owner */\n static async _performEmbeddedUpdates(owner, embeddedName, updates, comparisonKey = 'name', updateOpts = {}){\n \n const collection = owner.getEmbeddedCollection(embeddedName);\n\n const parsedAdds = Mutator._parseAddShorthand(collection, updates, comparisonKey);\n const parsedUpdates = Mutator._parseUpdateShorthand(collection, updates, comparisonKey); \n const parsedDeletes = Mutator._parseDeleteShorthand(collection, updates, comparisonKey);\n\n logger.debug(`Modify embedded ${embeddedName} of ${owner.name} from`, {adds: parsedAdds, updates: parsedUpdates, deletes: parsedDeletes});\n\n const {error, message} = Mutator._errorCheckEmbeddedUpdates( embeddedName, {add: parsedAdds, update: parsedUpdates, delete: parsedDeletes} );\n if(error) {\n logger.error(message);\n return false;\n }\n\n try {\n if (parsedAdds.length > 0) await owner.createEmbeddedDocuments(embeddedName, parsedAdds, updateOpts);\n } catch (e) {\n logger.error(e);\n } \n\n try {\n if (parsedUpdates.length > 0) await owner.updateEmbeddedDocuments(embeddedName, parsedUpdates, updateOpts);\n } catch (e) {\n logger.error(e);\n }\n\n try {\n if (parsedDeletes.length > 0) await owner.deleteEmbeddedDocuments(embeddedName, parsedDeletes, updateOpts);\n } catch (e) {\n logger.error(e);\n }\n\n return true;\n }\n\n /* embeddedUpdates keyed by embedded name, contains shorthand */\n static async _updateEmbedded(owner, embeddedUpdates, comparisonKeys, updateOpts = {}){\n\n /* @TODO check for any recursive embeds*/\n if (embeddedUpdates?.embedded) delete embeddedUpdates.embedded;\n\n for(const embeddedName of Object.keys(embeddedUpdates ?? {})){\n await Mutator._performEmbeddedUpdates(owner, embeddedName, embeddedUpdates[embeddedName],\n comparisonKeys[embeddedName] ?? MODULE[NAME].comparisonKey,\n updateOpts[embeddedName] ?? {})\n }\n\n }\n\n /* updates the actor and any embedded documents of this actor */\n /* @TODO support embedded documents within embedded documents */\n static async _updateActor(actor, updates = {}, comparisonKeys = {}, updateOpts = {}) {\n\n logger.debug('Performing update on (actor/updates)',actor, updates, comparisonKeys, updateOpts);\n await warpgate.wait(MODULE.setting('updateDelay')); // @workaround for semaphore bug\n\n /** perform the updates */\n if (updates.actor) await actor.update(updates.actor, updateOpts.actor ?? {});\n\n await Mutator._updateEmbedded(actor, updates.embedded, comparisonKeys, updateOpts.embedded);\n\n return;\n }\n\n \n /**\n * Given an update argument identical to `warpgate.spawn` and a token document, will apply the changes listed\n * in the updates and (by default) store the change delta, which allows these updates to be reverted. Mutating \n * the same token multiple times will \"stack\" the delta changes, allowing the user to remove them as desired,\n * while preserving changes made \"higher\" in the stack.\n *\n * @param {TokenDocument} tokenDoc Token document to update, does not accept Token Placeable.\n * @param {Shorthand} [updates] As {@link warpgate.spawn}\n * @param {Object} [callbacks] Two provided callback locations: delta and post. Both are awaited.\n * @param {PostDelta} [callbacks.delta] \n * @param {PostMutate} [callbacks.post] \n * @param {WorkflowOptions & MutationOptions} [options]\n *\n * @return {Promise} The mutation stack entry produced by this mutation, if they are tracked (i.e. not permanent).\n */\n static async mutate(tokenDoc, updates = {}, callbacks = {}, options = {}) {\n \n const neededPerms = MODULE.canMutate(game.user)\n if(neededPerms.length > 0) {\n logger.warn(MODULE.format('error.missingPerms', {permList: neededPerms.join(', ')}));\n return false;\n }\n\n /* the provided update object will be mangled for our use -- copy it to\n * preserve the user's original input if requested (default).\n */\n if(!options.overrides?.preserveData) {\n updates = MODULE.copy(updates, 'error.badUpdate.complex');\n if(!updates) return false;\n options = foundry.utils.mergeObject(options, {overrides: {preserveData: true}}, {inplace: false});\n }\n\n /* ensure that we are working with clean data */\n await Mutator.clean(updates, options);\n\n /* providing a delta means you are managing the\n * entire data change (including mutation stack changes).\n * Typically used by remote requests */\n\n /* create a default mutation info assuming we were provided\n * with the final delta already or the change is permanent\n */\n let mutateInfo = Mutator._createMutateInfo( options.delta ?? {}, options );\n\n /* check that this mutation name is unique */\n const present = warpgate.mutationStack(tokenDoc).getName(mutateInfo.name);\n if(!!present) {\n logger.warn(MODULE.format('error.badMutate.duplicate', {name: mutateInfo.name}));\n return false;\n }\n\n /* ensure the options parameter has a name field if not provided */\n options.name = mutateInfo.name;\n\n /* expand the object to handle property paths correctly */\n MODULE.shimUpdate(updates);\n\n /* permanent changes are not tracked */\n if(!options.permanent) {\n\n /* if we have the delta provided, trust it */\n let delta = options.delta ?? Mutator._createDelta(tokenDoc, updates, options);\n\n /* allow user to modify delta if needed (remote updates will never have callbacks) */\n if (callbacks.delta) {\n\n const cont = await callbacks.delta(delta, tokenDoc);\n if(cont === false) return false;\n\n }\n\n /* update the mutation info with the final updates including mutate stack info */\n mutateInfo = Mutator._mergeMutateDelta(tokenDoc.actor, delta, updates, options);\n\n options.delta = mutateInfo.delta;\n\n } else if (callbacks.delta) {\n /* call the delta callback if provided, but there is no object to modify */\n const cont = await callbacks.delta({}, tokenDoc);\n if(cont === false) return false;\n }\n\n if (tokenDoc.actor.isOwner) {\n\n if(options.notice && tokenDoc.object) {\n\n const placement = {\n scene: tokenDoc.object.scene,\n ...tokenDoc.object.center,\n };\n\n warpgate.plugin.notice(placement, options.notice);\n }\n \n await Mutator._update(tokenDoc, updates, options);\n\n if(callbacks.post) await callbacks.post(tokenDoc, updates, true);\n\n await warpgate.event.notify(warpgate.EVENT.MUTATE, {\n uuid: tokenDoc.uuid, \n name: options.name,\n updates: (options.overrides?.includeRawData ?? false) ? updates : 'omitted',\n options\n });\n\n } else {\n /* this is a remote mutation request, hand it over to that system */\n return remoteMutate( tokenDoc, {updates, callbacks, options} );\n }\n\n return mutateInfo;\n }\n\n /**\n * Perform a managed, batch update of multple token documents. Heterogeneous ownership supported\n * and routed through the Remote Mutation system as needed. The same updates, callbacks and options\n * objects will be used for all mutations.\n *\n * Note: If a specific mutation name is not provided, a single random ID will be generated for all\n * resulting individual mutations.\n *\n * @static\n * @param {Array} tokenDocs List of tokens on which to apply the provided mutation.\n * @param {Object} details The details of this batch mutation operation.\n * @param {Shorthand} details.updates The updates to apply to each token; as {@link warpgate.spawn}\n * @param {Object} [details.callbacks] Delta and post mutation callbacks; as {@link warpgate.mutate}\n * @param {PostDelta} [details.callbacks.delta]\n * @param {PostMutate} [details.callbacks.post]\n * @param {WorkflowOptions & MutationOptions} [details.options]\n *\n * @returns {Promise>} List of mutation results, which resolve \n * once all local mutations have been applied and when all remote mutations have been _accepted_ \n * or _rejected_. Currently, local and remote mutations will contain differing object structures.\n * Notably, local mutations contain a `delta` field containing the revert data for\n * this mutation; whereas remote mutations will contain an `accepted` field,\n * indicating if the request was accepted.\n */\n static async batchMutate( tokenDocs, {updates, callbacks, options} ) {\n \n /* break token list into sublists by first owner */\n const tokenLists = MODULE.ownerSublist(tokenDocs);\n\n if((tokenLists['none'] ?? []).length > 0) {\n logger.warn(MODULE.localize('error.offlineOwnerBatch'));\n logger.debug('Affected UUIDs:', tokenLists['none'].map( t => t.uuid ));\n delete tokenLists['none'];\n }\n\n options.name ??= randomID();\n\n let promises = Reflect.ownKeys(tokenLists).flatMap( async (owner) => {\n if(owner == game.userId) {\n //self service mutate\n return await tokenLists[owner].map( tokenDoc => warpgate.mutate(tokenDoc, updates, callbacks, options) );\n }\n\n /* is a remote update */\n return await remoteBatchMutate( tokenLists[owner], {updates, callbacks, options} );\n\n })\n\n /* wait for each client batch of mutations to complete */\n promises = await Promise.all(promises);\n\n /* flatten all into a single array, and ensure all subqueries are complete */\n return Promise.all(promises.flat());\n }\n\n /**\n * Perform a managed, batch update of multple token documents. Heterogeneous ownership supported\n * and routed through the Remote Mutation system as needed. The same updates, callbacks and options\n * objects will be used for all mutations.\n *\n * Note: If a specific mutation name is not provided, a single random ID will be generated for all\n * resulting individual mutations.\n *\n * @static\n * @param {Array} tokenDocs List of tokens on which to perform the revert\n * @param {Object} details\n * @param {string} [details.mutationName] Specific mutation name to revert, or the latest mutation \n * for an individual token if not provided. Tokens without mutations or without the specific \n * mutation requested are not processed.\n * @param {WorkflowOptions & MutationOptions} [details.options]\n * @returns {Promise>} List of mutation revert results, which resolve \n * once all local reverts have been applied and when all remote reverts have been _accepted_ \n * or _rejected_. Currently, local and remote reverts will contain differing object structures.\n * Notably, local revert contain a `delta` field containing the revert data for\n * this mutation; whereas remote reverts will contain an `accepted` field,\n * indicating if the request was accepted.\n\n */\n static async batchRevert( tokenDocs, {mutationName = null, options = {}} = {} ) {\n \n const tokenLists = MODULE.ownerSublist(tokenDocs);\n\n if((tokenLists['none'] ?? []).length > 0) {\n logger.warn(MODULE.localize('error.offlineOwnerBatch'));\n logger.debug('Affected UUIDs:', tokenLists['none'].map( t => t.uuid ));\n delete tokenLists['none'];\n }\n\n let promises = Reflect.ownKeys(tokenLists).map( (owner) => {\n if(owner == game.userId) {\n //self service mutate\n return tokenLists[owner].map( tokenDoc => warpgate.revert(tokenDoc, mutationName, options) );\n }\n\n /* is a remote update */\n return remoteBatchRevert( tokenLists[owner], {mutationName, options} );\n\n })\n\n promises = await Promise.all(promises);\n\n return Promise.all(promises.flat());\n }\n\n /**\n * @returns {MutationData}\n */\n static _createMutateInfo( delta, options = {} ) {\n options.name ??= randomID();\n return {\n delta: MODULE.stripEmpty(delta),\n user: game.user.id,\n comparisonKeys: MODULE.stripEmpty(options.comparisonKeys ?? {}, false),\n name: options.name,\n updateOpts: MODULE.stripEmpty(options.updateOpts ?? {}, false),\n overrides: MODULE.stripEmpty(options.overrides ?? {}, false),\n };\n }\n\n static _cleanInner(single) {\n Object.keys(single).forEach( key => {\n /* dont process embedded */\n if(key == 'embedded') return;\n\n /* dont process delete identifiers */\n if(typeof single[key] == 'string') return;\n\n /* convert value to plain object if possible */\n if(single[key]?.toObject) single[key] = single[key].toObject();\n\n if(single[key] == undefined) {\n single[key] = {};\n } \n\n return;\n });\n }\n\n /**\n * Cleans and validates mutation data\n * @param {Shorthand} updates\n * @param {SpawningOptions & MutationOptions} [options]\n */\n static async clean(updates, options = undefined) {\n\n if(!!updates) {\n /* ensure we are working with raw objects */\n Mutator._cleanInner(updates);\n\n /* perform cleaning on shorthand embedded updates */\n Object.values(updates.embedded ?? {}).forEach( type => Mutator._cleanInner(type));\n\n /* if the token is getting an image update, preload it */\n let source;\n if('src' in (updates.token?.texture ?? {})) {\n source = updates.token.texture.src; \n }\n else if( 'img' in (updates.token ?? {})){\n source = updates.token.img;\n }\n\n /* load texture if provided */\n try {\n !!source ? await loadTexture(source) : null;\n } catch (err) {\n logger.debug(err);\n }\n }\n\n if(!!options) {\n /* insert the better ActiveEffect default ONLY IF\n * one wasn't provided in the options object initially\n */\n options.comparisonKeys = foundry.utils.mergeObject(\n options.comparisonKeys ?? {},\n {ActiveEffect: 'label'},\n {overwrite:false, inplace:false});\n\n /* if `id` is being used as the comparison key, \n * change it to `_id` and set the option to `keepId=true`\n * if either are present\n */\n options.comparisonKeys ??= {};\n options.updateOpts ??= {};\n Object.keys(options.comparisonKeys).forEach( embName => {\n\n /* switch to _id if needed */\n if(options.comparisonKeys[embName] == 'id') options.comparisonKeys[embName] = '_id'\n\n /* flag this update to preserve ids */\n if(options.comparisonKeys[embName] == '_id') {\n foundry.utils.mergeObject(options.updateOpts, {embedded: {[embName]: {keepId: true}}});\n }\n });\n \n }\n\n }\n\n static _mergeMutateDelta(actorDoc, delta, updates, options) {\n\n /* Grab the current stack (or make a new one) */\n let mutateStack = actorDoc.getFlag(MODULE.data.name, 'mutate') ?? [];\n\n /* create the information needed to revert this mutation and push\n * it onto the stack\n */\n const mutateInfo = Mutator._createMutateInfo( delta, options );\n mutateStack.push(mutateInfo);\n\n /* Create a new mutation stack flag data and store it in the update object */\n const flags = {warpgate: {mutate: mutateStack}};\n updates.actor = mergeObject(updates.actor ?? {}, {flags});\n \n return mutateInfo;\n }\n\n /* @return {Promise} */\n static async _update(tokenDoc, updates, options = {}) {\n\n /* update the token */\n await tokenDoc.update(updates.token ?? {}, options.updateOpts?.token ?? {});\n\n if(!options.noMoveWait && !!tokenDoc.object) {\n await CanvasAnimation.getAnimation(tokenDoc.object.animationName)?.promise\n }\n\n /* update the actor */\n return Mutator._updateActor(tokenDoc.actor, updates, options.comparisonKeys ?? {}, options.updateOpts ?? {});\n }\n\n /**\n * Will peel off the last applied mutation change from the provided token document\n * \n * @param {TokenDocument} tokenDoc Token document to revert the last applied mutation.\n * @param {String} [mutationName]. Specific mutation name to revert. optional.\n * @param {WorkflowOptions} [options]\n *\n * @return {Promise} The mutation data (updates) used for this \n * revert operation or `undefined` if none occured.\n */\n static async revertMutation(tokenDoc, mutationName = undefined, options = {}) {\n\n const mutateData = await Mutator._popMutation(tokenDoc?.actor, mutationName);\n\n if(!mutateData) {\n return;\n }\n\n if (tokenDoc.actor?.isOwner) {\n if(options.notice && tokenDoc.object) {\n\n const placement = {\n scene: tokenDoc.object.scene,\n ...tokenDoc.object.center,\n };\n\n warpgate.plugin.notice(placement, options.notice);\n }\n\n /* the provided options object will be mangled for our use -- copy it to\n * preserve the user's original input if requested (default).\n */\n if(!options.overrides?.preserveData) {\n options = MODULE.copy(options, 'error.badUpdate.complex');\n if(!options) return;\n options = foundry.utils.mergeObject(options, {overrides: {preserveData: true}}, {inplace: false});\n }\n\n /* perform the revert with the stored delta */\n MODULE.shimUpdate(mutateData.delta);\n mutateData.updateOpts ??= {};\n mutateData.overrides ??= {};\n foundry.utils.mergeObject(mutateData.updateOpts, options.updateOpts ?? {});\n foundry.utils.mergeObject(mutateData.overrides, options.overrides ?? {});\n\n await Mutator._update(tokenDoc, mutateData.delta, {\n overrides: mutateData.overrides,\n comparisonKeys: mutateData.comparisonKeys,\n updateOpts: mutateData.updateOpts\n });\n\n /* notify clients */\n warpgate.event.notify(warpgate.EVENT.REVERT, {\n uuid: tokenDoc.uuid, \n name: mutateData.name,\n updates: (options.overrides?.includeRawData ?? false) ? mutateData : 'omitted',\n options});\n\n } else {\n return remoteRevert(tokenDoc, {mutationId: mutateData.name, options});\n }\n\n return mutateData;\n }\n\n static async _popMutation(actor, mutationName) {\n\n let mutateStack = actor?.getFlag(MODULE.data.name, 'mutate') ?? [];\n\n if (mutateStack.length == 0 || !actor){\n logger.debug(`Provided actor is undefined or has no mutation stack. Cannot pop.`);\n return undefined;\n }\n\n let mutateData = undefined;\n\n if (!!mutationName) {\n /* find specific mutation */\n const index = mutateStack.findIndex( mutation => mutation.name === mutationName );\n\n /* check for no result and log */\n if ( index < 0 ) {\n logger.debug(`Could not locate mutation named ${mutationName} in actor ${actor.name}`);\n return undefined;\n }\n\n /* otherwise, retrieve and remove */\n mutateData = mutateStack.splice(index, 1)[0];\n\n for( let i = index; i < mutateStack.length; i++){\n\n /* get the values stored in our delta and push any overlapping ones to\n * the mutation next in the stack\n */\n const stackUpdate = filterObject(mutateData.delta, mutateStack[i].delta);\n mergeObject(mutateStack[i].delta, stackUpdate);\n\n /* remove any changes that exist higher in the stack, we have\n * been overriden and should not restore these values\n */\n mutateData.delta = MODULE.unique(mutateData.delta, mutateStack[i].delta)\n }\n\n } else {\n /* pop the most recent mutation */\n mutateData = mutateStack.pop();\n }\n\n const newFlags = {[`${MODULE.data.name}.mutate`]: mutateStack};\n\n /* set the current mutation stack in the mutation data */\n foundry.utils.mergeObject(mutateData.delta, {actor: {flags: newFlags}});\n\n logger.debug(MODULE.localize('debug.finalRevertUpdate'), mutateData);\n\n return mutateData;\n }\n\n /* given a token document and the standard update object,\n * parse the changes that need to be applied to *reverse*\n * the mutate operation\n */\n static _createDelta(tokenDoc, updates, options) {\n\n /* get token changes */\n let tokenData = tokenDoc.toObject()\n //tokenData.actorData = {};\n \n const tokenDelta = MODULE.strictUpdateDiff(updates.token ?? {}, tokenData);\n\n /* get the actor changes (no embeds) */\n const actorData = Mutator._getRootActorData(tokenDoc.actor);\n const actorDelta = MODULE.strictUpdateDiff(updates.actor ?? {}, actorData);\n\n /* get the changes from the embeds */\n let embeddedDelta = {};\n if(updates.embedded) {\n \n for( const embeddedName of Object.keys(updates.embedded) ) {\n const collection = tokenDoc.actor.getEmbeddedCollection(embeddedName);\n const invertedShorthand = Mutator._invertShorthand(collection, updates.embedded[embeddedName], getProperty(options.comparisonKeys, embeddedName) ?? 'name');\n embeddedDelta[embeddedName] = invertedShorthand;\n }\n }\n\n logger.debug(MODULE.localize('debug.tokenDelta'), tokenDelta, MODULE.localize('debug.actorDelta'), actorDelta, MODULE.localize('debug.embeddedDelta'), embeddedDelta);\n\n return {token: tokenDelta, actor: actorDelta, embedded: embeddedDelta}\n }\n\n /* returns the actor data sans ALL embedded collections */\n static _getRootActorData(actorDoc) {\n let actorData = actorDoc.toObject();\n\n /* get the key NAME of the embedded document type.\n * ex. not 'ActiveEffect' (the class name), 'effect' the collection's field name\n */\n let embeddedFields = Object.values(Actor.implementation.metadata.embedded);\n\n /* delete any embedded fields from the actor data */\n embeddedFields.forEach( field => { delete actorData[field] } )\n\n return actorData;\n }\n}\n\nexport const register = Mutator.register, mutate = Mutator.mutate, revertMutation = Mutator.revertMutation, batchMutate = Mutator.batchMutate, batchRevert = Mutator.batchRevert, clean = Mutator.clean, _updateActor = Mutator._updateActor;\n","/* \n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n * \n * This program is free software: you can redistribute it and/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see .\n */\n\nimport {MODULE, logger} from './module.js'\nimport {requestMutate, requestRevert} from './comms.js'\nimport {mutate, revertMutation} from './mutator.js'\n\nclass RemoteMutator {\n\n static register() {\n RemoteMutator.settings();\n }\n\n static settings() {\n const config = true;\n const settingsData = {\n alwaysAccept: {\n scope: 'world', config, default: false, type: Boolean\n },\n suppressToast: {\n scope: 'world', config, default: false, type: Boolean\n },\n alwaysAcceptLocal: {\n scope: 'client', config, default: 0, type: Number,\n choices: {\n 0: MODULE.localize('setting.option.useWorld'),\n 1: MODULE.localize('setting.option.overrideTrue'),\n 2: MODULE.localize('setting.option.overrideFalse'),\n }\n },\n suppressToastLocal: {\n scope: 'client', config, default: 0, type: Number,\n choices: {\n 0: MODULE.localize('setting.option.useWorld'),\n 1: MODULE.localize('setting.option.overrideTrue'),\n 2: MODULE.localize('setting.option.overrideFalse'),\n }\n },\n };\n\n MODULE.applySettings(settingsData);\n }\n\n //responseData:\n //------\n //sceneId\n //userId\n //-------\n //accepted (bool)\n //tokenId\n //actorId\n //mutationId\n //updates (if mutate)\n\n /* create the needed trigger functions if there is a post callback to handle */\n static _createMutateTriggers( tokenDoc, {post = undefined}, options ) {\n\n const condition = (responseData) => {\n return responseData.tokenId === tokenDoc.id && responseData.mutationId === options.name;\n }\n\n /* craft the response handler\n * execute the post callback */\n const promise = new Promise( (resolve) => {\n const handleResponse = async (responseData) => {\n\n /* if accepted, run our post callback */\n const tokenDoc = game.scenes.get(responseData.sceneId).getEmbeddedDocument('Token', responseData.tokenId);\n if (responseData.accepted) {\n const info = MODULE.format('display.mutationAccepted', {mName: options.name, tName: tokenDoc.name});\n\n const {suppressToast} = MODULE.getFeedbackSettings(options.overrides);\n if(!suppressToast) ui.notifications.info(info);\n } else {\n const warn = MODULE.format('display.mutationRejected', {mName: options.name, tName: tokenDoc.name});\n if(!options.overrides?.suppressReject) ui.notifications.warn(warn);\n }\n\n /* only need to do this if we have a post callback */\n if (post) await post(tokenDoc, responseData.updates, responseData.accepted);\n resolve(responseData);\n return;\n }\n\n warpgate.event.trigger(warpgate.EVENT.MUTATE_RESPONSE, handleResponse, condition);\n });\n\n return promise;\n }\n\n static _createRevertTriggers( tokenDoc, mutationName = undefined, {callbacks={}, options = {}} ) {\n\n const condition = (responseData) => {\n return responseData.tokenId === tokenDoc.id && (responseData.mutationId === mutationName || !mutationName);\n }\n\n /* if no name provided, we are popping the last one */\n const mName = mutationName ? mutationName : warpgate.mutationStack(tokenDoc).last.name;\n\n /* craft the response handler\n * execute the post callback */\n const promise = new Promise(async (resolve) => {\n const handleResponse = async (responseData) => {\n const tokenDoc = game.scenes.get(responseData.sceneId).getEmbeddedDocument('Token', responseData.tokenId);\n\n /* if accepted, run our post callback */\n if (responseData.accepted) {\n const info = MODULE.format('display.revertAccepted', {mName , tName: tokenDoc.name});\n const {suppressToast} = MODULE.getFeedbackSettings(options.overrides);\n if(!suppressToast) ui.notifications.info(info);\n } else {\n const warn = MODULE.format('display.revertRejected', {mName , tName: tokenDoc.name});\n if(!options.overrides?.suppressReject) ui.notifications.warn(warn);\n }\n\n await callbacks.post?.(tokenDoc, responseData.updates, responseData.accepted);\n\n resolve(responseData);\n return;\n }\n\n warpgate.event.trigger(warpgate.EVENT.REVERT_RESPONSE, handleResponse, condition);\n });\n\n return promise;\n }\n\n static remoteMutate( tokenDoc, {updates, callbacks = {}, options = {}} ) {\n /* we need to make sure there is a user that can handle our resquest */\n if (!MODULE.firstOwner(tokenDoc)) {\n logger.error(MODULE.localize('error.noOwningUserMutate'));\n return false;\n }\n\n /* register our trigger for monitoring remote response.\n * This handles the post callback\n */\n const promise = RemoteMutator._createMutateTriggers( tokenDoc, callbacks, options );\n\n /* broadcast the request to mutate the token */\n requestMutate(tokenDoc.id, tokenDoc.parent.id, { updates, options });\n\n return promise;\n }\n\n /**\n *\n * @returns {Promise>}\n */\n static async remoteBatchMutate( tokenDocs, {updates, callbacks = {}, options = {}} ) {\n /* follow normal protocol for initial requests.\n * if accepted, force accept and force suppress remaining token mutations\n * if rejected, bail on all further mutations for this owner */\n\n const firstToken = tokenDocs.shift();\n let results = [await warpgate.mutate(firstToken, updates, callbacks, options)];\n\n if (results[0].accepted) {\n\n const silentOptions = foundry.utils.mergeObject(options, { overrides: {alwaysAccept: true, suppressToast: true} }, {inplace: false});\n\n results = results.concat(tokenDocs.map( tokenDoc => {\n return warpgate.mutate(tokenDoc, updates, callbacks, silentOptions);\n }));\n\n } else {\n results = results.concat(tokenDocs.map( tokenDoc => ({sceneId: tokenDoc.parent.id, tokenId: tokenDoc.id, accepted: false})));\n }\n\n \n return results;\n }\n\n static remoteRevert( tokenDoc, {mutationId = null, callbacks={}, options = {}} = {} ) {\n /* we need to make sure there is a user that can handle our resquest */\n if (!MODULE.firstOwner(tokenDoc)) {\n logger.error(MODULE.format('error.noOwningUserRevert'));\n return false;\n }\n\n /* register our trigger for monitoring remote response.\n * This handles the post callback\n */\n const result = RemoteMutator._createRevertTriggers( tokenDoc, mutationId, {callbacks, options} );\n\n /* broadcast the request to mutate the token */\n requestRevert(tokenDoc.id, tokenDoc.parent.id, {mutationId, options});\n\n return result;\n }\n\n /**\n *\n * @returns {Promise>}\n */\n static async remoteBatchRevert( tokenDocs, {mutationName = null, options = {}} = {} ) {\n\n /* follow normal protocol for initial requests.\n * if accepted, force accept and force suppress remaining token mutations\n * if rejected, bail on all further mutations for this owner */\n\n let firstToken = tokenDocs.shift();\n while( !!firstToken && warpgate.mutationStack(firstToken).stack.length == 0 ) firstToken = tokenDocs.shift();\n\n if(!firstToken) return [];\n\n const results = [await warpgate.revert(firstToken, mutationName, options)];\n\n if(results[0].accepted) {\n\n const silentOptions = foundry.utils.mergeObject(options, {\n overrides: {alwaysAccept: true, suppressToast: true}\n }, {inplace: false}\n );\n\n results.push(...(tokenDocs.map( tokenDoc => {\n return warpgate.revert(tokenDoc, mutationName, silentOptions);\n })))\n } else {\n results.push(...tokenDocs.map( tokenDoc => ({sceneId: tokenDoc.parent.id, tokenId: tokenDoc.id, accepted: false})));\n }\n\n return results;\n }\n\n static async handleMutationRequest(payload) {\n \n /* First, are we the first player owner? If not, stop, they will handle it */\n const tokenDoc = game.scenes.get(payload.sceneId).getEmbeddedDocument('Token', payload.tokenId);\n\n if (MODULE.isFirstOwner(tokenDoc.actor)) {\n\n let {alwaysAccept: accepted, suppressToast} = MODULE.getFeedbackSettings(payload.options.overrides);\n \n if(!accepted) {\n accepted = await RemoteMutator._queryRequest(tokenDoc, payload.userId, payload.options.description, payload.updates)\n\n /* if a dialog is shown, the user knows the outcome */\n suppressToast = true;\n }\n\n let responseData = {\n sceneId: payload.sceneId,\n userId: game.user.id,\n accepted,\n tokenId: payload.tokenId,\n mutationId: payload.options.name,\n options: payload.options,\n }\n\n await warpgate.event.notify(warpgate.EVENT.MUTATE_RESPONSE, responseData);\n\n if (accepted) {\n /* first owner accepts mutation -- apply it */\n /* requests will never have callbacks */\n await mutate(tokenDoc, payload.updates, {}, payload.options);\n const message = MODULE.format('display.mutationRequestTitle', {userName: game.users.get(payload.userId).name, tokenName: tokenDoc.name});\n \n if(!suppressToast) ui.notifications.info(message);\n }\n }\n }\n\n static async handleRevertRequest(payload) {\n\n /* First, are we the first player owner? If not, stop, they will handle it */\n const tokenDoc = game.scenes.get(payload.sceneId).getEmbeddedDocument('Token', payload.tokenId);\n\n if (MODULE.isFirstOwner(tokenDoc.actor)) {\n\n const stack = warpgate.mutationStack(tokenDoc);\n if( (stack.stack ?? []).length == 0 ) return;\n const details = payload.mutationId ? stack.getName(payload.mutationId) : stack.last;\n const description = MODULE.format('display.revertRequestDescription', {mName: details.name, tName: tokenDoc.name});\n\n let {alwaysAccept: accepted, suppressToast} = MODULE.getFeedbackSettings(payload.options.overrides);\n\n if(!accepted) {\n accepted = await RemoteMutator._queryRequest(tokenDoc, payload.userId, description, details );\n suppressToast = true;\n }\n\n let responseData = {\n sceneId: payload.sceneId,\n userId: game.user.id,\n accepted,\n tokenId: payload.tokenId,\n mutationId: payload.mutationId\n }\n\n await warpgate.event.notify(warpgate.EVENT.REVERT_RESPONSE, responseData);\n\n /* if the request is accepted, do the revert */\n if (accepted) {\n await revertMutation(tokenDoc, payload.mutationId, payload.options);\n\n if (!suppressToast) { \n ui.notifications.info(description);\n }\n }\n\n }\n }\n\n static async _queryRequest(tokenDoc, requestingUserId, description = 'warpgate.display.emptyDescription', detailsObject) {\n\n /* if this is update data, dont include the mutate data please, its huge */\n let displayObject = duplicate(detailsObject);\n if (displayObject.actor?.flags?.warpgate) {\n displayObject.actor.flags.warpgate = {};\n }\n\n displayObject = MODULE.removeEmptyObjects(displayObject);\n\n const details = RemoteMutator._convertObjToHTML(displayObject)\n\n const modeSwitch = {\n description: {label: MODULE.localize('display.inspectLabel'), value: 'inspect', content: `

${game.i18n.localize(description)}

`},\n inspect: {label: MODULE.localize('display.descriptionLabel'), value: 'description', content: details }\n }\n\n const title = MODULE.format('display.mutationRequestTitle', {userName: game.users.get(requestingUserId).name, tokenName: tokenDoc.name});\n\n let userResponse = false;\n let modeButton = modeSwitch.description;\n\n do {\n userResponse = await warpgate.buttonDialog({buttons: [{label: MODULE.localize('display.findTargetLabel'), value: 'select'}, {label: MODULE.localize('display.acceptLabel'), value: true}, {label: MODULE.localize('display.rejectLabel'), value: false}, modeButton], content: modeButton.content, title, options: {top: 100}});\n\n if (userResponse === 'select') {\n if (tokenDoc.object) {\n tokenDoc.object.control({releaseOthers: true});\n await canvas.animatePan({x: tokenDoc.object.x, y: tokenDoc.object.y});\n }\n } else if (userResponse !== false && userResponse !== true) {\n /* swap modes and re-render */\n modeButton = modeSwitch[userResponse];\n }\n\n } while (userResponse !== false && userResponse !== true)\n\n return userResponse;\n\n }\n\n static _convertObjToHTML(obj) {\n const stringified = JSON.stringify(obj, undefined, '$SPACING');\n return stringified.replaceAll('\\n', '
').replaceAll('$SPACING', '    ');\n }\n\n}\n\nexport const register = RemoteMutator.register, handleMutationRequest = RemoteMutator.handleMutationRequest, handleRevertRequest = RemoteMutator.handleRevertRequest, remoteMutate = RemoteMutator.remoteMutate, remoteRevert = RemoteMutator.remoteRevert, remoteBatchMutate = RemoteMutator.remoteBatchMutate, remoteBatchRevert = RemoteMutator.remoteBatchRevert;\n\n\n","/*\n * MIT License\n * \n * Copyright (c) 2021 DnD5e Helpers Team\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport {MODULE} from './module.js'\n\nlet updateQueues = new Map();\n\n/** \n * Safely manages concurrent updates to the provided entity type\n * @function warpgate.plugin.queueUpdate\n * @param {Function} updateFn the function that handles the actual update (can be async)\n */\nexport function queueUpdate(updateFn) {\n\n /** queue the update for this entity */\n getQueue().queueUpdate(updateFn);\n}\n\nexport function flush() {\n return getQueue().flush();\n}\n\nfunction getQueue(entity = \"default\"){\n /** if this is a new entity type, create the queue object to manage it */\n if(!updateQueues.has(entity)) {\n updateQueues.set(entity, new UpdateQueue(entity));\n }\n\n /** queue the update for this entity */\n return updateQueues.get(entity);\n}\n\n/** \n * Helper class to manage database updates that occur from\n * hooks that may fire back to back.\n * @ignore\n */\nclass UpdateQueue {\n constructor(entityType) {\n\n /** self identification */\n this.entityType = entityType;\n\n /** buffer of update functions to run */\n this.queue = [];\n\n /** Semaphore for 'batch update in progress' */\n this.inFlight = false;\n }\n\n queueUpdate(fn) {\n this.queue.push(fn);\n\n /** only kick off a batch of updates if none are in flight */\n if (!this.inFlight) {\n this.runUpdate();\n }\n }\n\n flush() {\n return MODULE.waitFor( () => !this.inFlight )\n }\n\n async runUpdate(){\n\n this.inFlight = true;\n\n while(this.queue.length > 0) {\n\n\n /** grab the last update in the list and hold onto its index\n * in case another update pushes onto this array before we\n * are finished.\n */\n const updateIndex = this.queue.length-1;\n const updateFn = this.queue[updateIndex];\n\n /** wait for the update to complete */\n await updateFn();\n\n /** remove this entry from the queue */\n this.queue.splice(updateIndex,1);\n }\n\n this.inFlight = false;\n\n }\n}\n","/*\n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\nimport { MODULE, logger } from \"./module.js\";\nimport { handleDismissSpawn } from \"./gateway.js\";\nimport { Events } from \"./events.js\";\nimport {\n handleMutationRequest,\n handleRevertRequest,\n} from \"./remote-mutator.js\";\nimport { queueUpdate } from \"./update-queue.js\";\n\nconst ops = {\n DISMISS_SPAWN: \"dismiss\", //tokenId, sceneId, userId\n EVENT: \"event\", //name, ...payload\n REQUEST_MUTATE: \"req-mutate\", // ...payload\n REQUEST_REVERT: \"req-revert\", // ...payload\n NOTICE: \"req-notice\",\n};\n\nclass Comms {\n static register() {\n Comms.hooks();\n }\n\n static hooks() {\n Hooks.on(\"ready\", Comms._ready);\n }\n\n static _ready() {\n logger.info(\"Registering sockets\");\n\n game.socket.on(`module.${MODULE.data.name}`, Comms._receiveSocket);\n }\n\n static _receiveSocket(socketData) {\n logger.debug(\"Received socket data => \", socketData);\n\n /* all users should immediately respond to notices */\n if (socketData.op == ops.NOTICE) {\n MODULE.handleNotice(\n socketData.payload.location,\n socketData.payload.sceneId,\n socketData.payload.options\n );\n return socketData;\n }\n\n queueUpdate(async () => {\n logger.debug(\"Routing operation: \", socketData.op);\n switch (socketData.op) {\n case ops.DISMISS_SPAWN:\n await handleDismissSpawn(socketData.payload);\n break;\n case ops.EVENT:\n /* all users should respond to events */\n await Events.run(socketData.eventName, socketData.payload);\n break;\n case ops.REQUEST_MUTATE:\n /* First owner of this target token/actor should respond */\n await handleMutationRequest(socketData.payload);\n break;\n case ops.REQUEST_REVERT:\n /* First owner of this target token/actor should respond */\n await handleRevertRequest(socketData.payload);\n break;\n default:\n logger.error(\"Unrecognized socket request\", socketData);\n break;\n }\n });\n\n return socketData;\n }\n\n static _emit(socketData) {\n game.socket.emit(`module.${MODULE.data.name}`, socketData);\n\n /* always send events to self as well */\n return Comms._receiveSocket(socketData);\n }\n\n static requestDismissSpawn(tokenId, sceneId) {\n /** craft the socket data */\n const data = {\n op: ops.DISMISS_SPAWN,\n payload: { tokenId, sceneId, userId: game.user.id },\n };\n\n return Comms._emit(data);\n }\n\n /*\n * payload = {userId, tokenId, sceneId, updates, options}\n */\n static requestMutate(\n tokenId,\n sceneId,\n { updates = {}, options = {} } = {},\n onBehalf = game.user.id\n ) {\n /* insert common fields */\n const payload = {\n userId: onBehalf,\n tokenId,\n sceneId,\n updates,\n options,\n };\n\n /* craft the socket data */\n const data = {\n op: ops.REQUEST_MUTATE,\n payload,\n };\n\n return Comms._emit(data);\n }\n\n static requestRevert(\n tokenId,\n sceneId,\n { mutationId = undefined, onBehalf = game.user.id, options = {} }\n ) {\n /* insert common fields */\n const payload = {\n userId: onBehalf,\n tokenId,\n sceneId,\n mutationId,\n options,\n };\n\n /* craft the socket data */\n const data = {\n op: ops.REQUEST_REVERT,\n payload,\n };\n\n return Comms._emit(data);\n }\n\n static requestNotice(location, sceneId = canvas.scene?.id, options = {}) {\n const data = {\n op: ops.NOTICE,\n payload: {\n sceneId,\n location,\n options,\n },\n };\n\n return Comms._emit(data);\n }\n\n static packToken(tokenDoc) {\n const tokenData = tokenDoc.toObject();\n delete tokenData.actorData;\n delete tokenData.delta;\n\n let actorData = tokenDoc.actor?.toObject() ?? {};\n actorData.token = tokenData;\n return actorData;\n }\n\n /**\n * Allow custom events to be fired using the Warp Gate event system. Is broadcast to all users, including the initiator.\n * Like Hooks, these functions cannot be awaited for a response, but all event functions executing on a given client\n * will be evaluated in order of initial registration and the processing of the event functions will respect\n * (and await) returned Promises.\n *\n * @param {string} name Name of this event. Watches and triggers use this name to register themselves.\n * Like Hooks, any string can be used and it is dependent upon the watch or trigger registration to monitor the correct event name.\n * @param {object} [payload={sceneId: canvas.scene.id, userId: game.user.id}] eventData {Object} The data that will be\n * provided to watches and triggers and their condition functions.\n * @param {string} [onBehalf=game.user.id] User ID that will be used in place of the current user in the\n * cases of a relayed request to the GM (e.g. dismissal).\n *\n * @returns {Object} Data object containing the event's payload (execution details), and identifying metadata about\n * this event, sent to all watching and triggering clients.\n */\n static notifyEvent(name, payload = {}, onBehalf = game.user?.id) {\n /** insert common fields */\n payload.sceneId = canvas.scene?.id;\n payload.userId = onBehalf;\n\n /* craft the socket data */\n const data = {\n op: ops.EVENT,\n eventName: name,\n payload,\n };\n\n return Comms._emit(data);\n }\n}\n\nexport const register = Comms.register,\n requestMutate = Comms.requestMutate,\n requestRevert = Comms.requestRevert,\n packToken = Comms.packToken,\n requestDismissSpawn = Comms.requestDismissSpawn,\n notifyEvent = Comms.notifyEvent,\n requestNotice = Comms.requestNotice;\n","/*\n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\nimport { MODULE, logger } from \"./module.js\";\nimport { Crosshairs } from \"./crosshairs.js\";\nimport { packToken, requestDismissSpawn } from \"./comms.js\";\n\nconst NAME = \"Gateway\";\n\n/** @typedef {import('./api.js').CrosshairsConfig} CrosshairsConfig */\n/** @typedef {import('./crosshairs.js').CrosshairsData} CrosshairsData */\n/** @typedef {import('./lib/PlaceableFit.mjs').PlaceableFit} PlaceableFit */\n\n/**\n * Callback started just prior to the crosshairs template being drawn. Is not awaited. Used for modifying\n * how the crosshairs is displayed and for responding to its displayed position\n *\n * All of the fields in the {@link CrosshairsConfig} object can be modified directly. Any fields owned by\n * MeasuredTemplate must be changed via `update|updateSource` as other DocumentData|DataModel classes.\n * Async functions will run in parallel while the user is moving the crosshairs. Serial functions will\n * block detection of the left and right click operations until return.\n *\n * @typedef {function(Crosshairs):any} ParallelShow\n * @param {Crosshairs} crosshairs The live Crosshairs instance associated with this callback\n *\n * @returns {any}\n */\n\n/**\n * @class\n * @private\n */\nclass Gateway {\n static register() {\n Gateway.settings();\n Gateway.defaults();\n }\n\n static settings() {\n const config = true;\n const settingsData = {\n openDelete: {\n scope: \"world\",\n config,\n default: false,\n type: Boolean,\n },\n updateDelay: {\n scope: \"client\",\n config,\n default: 0,\n type: Number,\n },\n };\n\n MODULE.applySettings(settingsData);\n }\n\n static defaults() {\n MODULE[NAME] = {\n /**\n * type {CrosshairsConfig}\n * @const\n */\n get crosshairsConfig() {\n return {\n size: 1,\n icon: \"icons/svg/dice-target.svg\",\n label: \"\",\n labelOffset: {\n x: 0,\n y: 0,\n },\n tag: \"crosshairs\",\n drawIcon: true,\n drawOutline: true,\n interval: 2,\n fillAlpha: 0,\n tileTexture: false,\n lockSize: true,\n lockPosition: false,\n rememberControlled: false,\n\n //Measured template defaults\n texture: null,\n //x: 0,\n //y: 0,\n direction: 0,\n fillColor: game.user.color,\n };\n },\n };\n }\n\n /**\n * dnd5e helper function\n * @param { Item5e } item\n * @param {Object} [options={}]\n * @param {Object} [config={}] V10 Only field\n * @todo abstract further out of core code\n */\n static async _rollItemGetLevel(item, options = {}, config = {}) {\n const result = await item.use(config, options);\n // extract the level at which the spell was cast\n if (!result) return 0;\n const content = result.content;\n const level = content.charAt(content.indexOf(\"data-spell-level\") + 18);\n return parseInt(level);\n }\n\n /**\n * Displays a circular template attached to the mouse cursor that snaps to grid centers\n * and grid intersections.\n *\n * Its size is in grid squares/hexes and can be scaled up and down via shift+mouse scroll.\n * Resulting data indicates the final position and size of the template. Note: Shift+Scroll\n * will increase/decrease the size of the crosshairs outline, which increases or decreases\n * the size of the token spawned, independent of other modifications.\n *\n * @param {CrosshairsConfig} [config] Configuration settings for how the crosshairs template should be displayed.\n * @param {Object} [callbacks] Functions executed at certain stages of the crosshair display process.\n * @param {ParallelShow} [callbacks.show]\n *\n * @returns {Promise} All fields contained by `MeasuredTemplateDocument#toObject`. Notably `x`, `y`,\n * `width` (in pixels), and the addition of `size` (final size, in grid units, e.g. \"2\" for a final diameter of 2 squares).\n *\n */\n static async showCrosshairs(config = {}, callbacks = {}) {\n /* add in defaults */\n mergeObject(config, MODULE[NAME].crosshairsConfig, { overwrite: false });\n\n /* store currently controlled tokens */\n let controlled = [];\n if (config.rememberControlled) {\n controlled = canvas.tokens.controlled;\n }\n\n /* if a specific initial location is not provided, grab the current mouse location */\n if (!config.hasOwnProperty(\"x\") && !config.hasOwnProperty(\"y\")) {\n let mouseLoc = MODULE.getMouseStagePos();\n mouseLoc = Crosshairs.getSnappedPosition(mouseLoc, config.interval);\n config.x = mouseLoc.x;\n config.y = mouseLoc.y;\n }\n\n const template = new Crosshairs(config, callbacks);\n await template.drawPreview();\n\n const dataObj = template.toObject();\n\n /* if we have stored any controlled tokens,\n * restore that control now\n */\n for (const token of controlled) {\n token.control({ releaseOthers: false });\n }\n\n return dataObj;\n }\n\n /* tests if a placeable's center point is within\n * the radius of the crosshairs\n */\n static _containsCenter(placeable, crosshairsData) {\n const calcDistance = (A, B) => {\n return Math.hypot(A.x - B.x, A.y - B.y);\n };\n\n const distance = calcDistance(placeable.center, crosshairsData);\n return distance <= crosshairsData.radius;\n }\n\n /**\n * Returns desired types of placeables whose center point\n * is within the crosshairs radius.\n *\n * @param {Object} crosshairsData Requires at least {x,y,radius,parent} (all in pixels, parent is a Scene)\n * @param {String|Array} [types='Token'] Collects the desired embedded placeable types.\n * @param {Function} [containedFilter=Gateway._containsCenter]. Optional function for determining if a placeable\n * is contained by the crosshairs. Default function tests for centerpoint containment. {@link Gateway._containsCenter}\n *\n * @return {Object} List of collected placeables keyed by embeddedName\n */\n static collectPlaceables(\n crosshairsData,\n types = \"Token\",\n containedFilter = Gateway._containsCenter\n ) {\n const isArray = types instanceof Array;\n\n types = isArray ? types : [types];\n\n const result = types.reduce((acc, embeddedName) => {\n const collection =\n crosshairsData.scene.getEmbeddedCollection(embeddedName);\n\n let contained = collection.filter((document) => {\n return containedFilter(document.object, crosshairsData);\n });\n\n acc[embeddedName] = contained;\n return acc;\n }, {});\n\n /* if we are only collecting one kind of placeable, only return one kind of placeable */\n return isArray ? result : result[types[0]];\n }\n\n static async handleDismissSpawn({ tokenId, sceneId, userId, ...rest }) {\n /* let the first GM handle all dismissals */\n if (MODULE.isFirstGM())\n await Gateway.dismissSpawn(tokenId, sceneId, userId);\n }\n\n /**\n * Deletes the specified token from the specified scene. This function allows anyone\n * to delete any specified token unless this functionality is restricted to only\n * owned tokens in Warp Gate's module settings. This is the same function called\n * by the \"Dismiss\" header button on owned actor sheets.\n *\n * @param {string} tokenId\n * @param {string} [sceneId = canvas.scene.id] Needed if the dismissed token does not reside\n * on the currently viewed scene\n * @param {string} [onBehalf = game.user.id] Impersonate another user making this request\n */\n static async dismissSpawn(\n tokenId,\n sceneId = canvas.scene?.id,\n onBehalf = game.user.id\n ) {\n if (!tokenId || !sceneId) {\n logger.debug(\n \"Cannot dismiss null token or from a null scene.\",\n tokenId,\n sceneId\n );\n return;\n }\n\n const tokenData = game.scenes\n .get(sceneId)\n ?.getEmbeddedDocument(\"Token\", tokenId);\n if (!tokenData) {\n logger.debug(`Token [${tokenId}] no longer exists on scene [${sceneId}]`);\n return;\n }\n\n /* check for permission to delete freely */\n if (!MODULE.setting(\"openDelete\")) {\n /* check permissions on token */\n if (!tokenData.isOwner) {\n logger.error(MODULE.localize(\"error.unownedDelete\"));\n return;\n }\n }\n\n logger.debug(`Deleting ${tokenData.uuid}`);\n\n if (!MODULE.firstGM()) {\n logger.error(MODULE.localize(\"error.noGm\"));\n return;\n }\n\n /** first gm drives */\n if (MODULE.isFirstGM()) {\n \n if( tokenData.isLinked ) {\n logger.debug('...and removing control flag from linked token actor');\n await tokenData.actor?.unsetFlag(MODULE.data.name, 'control');\n }\n const tokenDocs = await game.scenes\n .get(sceneId)\n .deleteEmbeddedDocuments(\"Token\", [tokenId]);\n\n const actorData = packToken(tokenDocs[0]);\n await warpgate.event.notify(\n warpgate.EVENT.DISMISS,\n { actorData },\n onBehalf\n );\n } else {\n /** otherwise, we need to send a request for deletion */\n requestDismissSpawn(tokenId, sceneId);\n }\n\n return;\n }\n\n /**\n * returns promise of token creation\n * @param {TokenData} protoToken\n * @param {{ x: number, y: number }} spawnPoint\n * @param {boolean} collision\n */\n static async _spawnTokenAtLocation(protoToken, spawnPoint, collision) {\n // Increase this offset for larger summons\n const gridSize = canvas.scene.grid.size;\n let loc = {\n x: spawnPoint.x - gridSize * (protoToken.width / 2),\n y: spawnPoint.y - gridSize * (protoToken.height / 2),\n };\n\n /* call ripper's placement algorithm for collision checks\n * which will try to avoid tokens and walls\n */\n if (collision) {\n /** @type PlaceableFit */\n const PFit = warpgate.abstract.PlaceableFit;\n const fitter = new PFit({...loc, width: gridSize * protoToken.width, height: gridSize * protoToken.height});\n const openPosition = fitter.find();\n if (!openPosition) {\n logger.info(MODULE.localize(\"error.noOpenLocation\"));\n } else {\n loc = openPosition;\n }\n }\n\n protoToken.updateSource(loc);\n\n return canvas.scene.createEmbeddedDocuments(\"Token\", [protoToken]);\n }\n}\n\nexport const register = Gateway.register,\n dismissSpawn = Gateway.dismissSpawn,\n showCrosshairs = Gateway.showCrosshairs,\n collectPlaceables = Gateway.collectPlaceables,\n _rollItemGetLevel = Gateway._rollItemGetLevel,\n handleDismissSpawn = Gateway.handleDismissSpawn,\n _spawnTokenAtLocation = Gateway._spawnTokenAtLocation;\n","/* \n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n * \n * This program is free software: you can redistribute it and/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see .\n */\n\nimport {\n MODULE, logger\n} from './module.js'\n\n/** @typedef {import('./api.js').Shorthand} Shorthand */\n/** @typedef {import('./api.js').ComparisonKeys} ComparisonKeys */\n\n/** \n * @typedef {Object} MutationData\n * @property {Shorthand} delta\n * @property {string} user\n * @property {ComparisonKeys} comparisonKeys\n * @property {Shorthand} updateOpts\n * @property {object} overrides\n * @property {string} name\n */\n\n/**\n * The following class and its utility methods allows safer and more direct modification of the mutation stack,\n * which is stored on a token's actor. This mutation stack stores the information needed to _revert_ the changes\n * made by a mutation. This could be used, for example, to deal with rollover damage where the hit point value\n * being reverted to is lower than when the mutation was first applied.\n * \n * Searching and querying a given mutation is a quick, read-only process. When the mutation stack is modified \n * via one of its class methods, the actor's mutation data at that point in time will be copied for fast, local updates.\n *\n * No changes will be made to the actor's serialized data until the changes have been commited ({@link MutationStack#commit}).\n * The MutationStack object will then be locked back into a read-only state sourced with this newly updated data.\n */\nexport class MutationStack {\n constructor(tokenDoc) {\n\n this.actor = tokenDoc instanceof TokenDocument ? tokenDoc.actor :\n tokenDoc instanceof Token ? tokenDoc.document.actor :\n tokenDoc instanceof Actor ? tokenDoc :\n null;\n\n if(!this.actor) {\n throw new Error(MODULE.localize('error.stack.noActor'));\n }\n\n }\n\n /**\n * Private copy of the working stack (mutable)\n * @type {Array}\n */\n #stack = [];\n\n /** indicates if the stack has been duplicated for modification */\n #locked = true;\n\n /**\n * Current stack, according to the remote server (immutable)\n * @const\n * @type {Array}\n */\n get #liveStack() {\n // @ts-ignore\n return this.actor?.getFlag(MODULE.data.name, 'mutate') ?? [] \n }\n\n /** \n * Mutation stack according to its lock state.\n * @type {Array} \n */\n get stack() {\n return this.#locked ? this.#liveStack : this.#stack ;\n }\n\n /**\n * @callback FilterFn\n * @param {MutationData} mutation\n * @returns {boolean} provided mutation meets criteria\n * @memberof MutationStack\n */\n\n /**\n * Searches for an element of the mutation stack that satisfies the provided predicate\n *\n * @param {FilterFn} predicate Receives the argments of `Array.prototype.find` \n * and should return a boolean indicating if the current element satisfies the predicate condition\n * @return {MutationData|undefined} Element of the mutation stack that matches the predicate, or undefined if none.\n */\n find(predicate) {\n if (this.#locked) return this.#liveStack.find(predicate);\n\n return this.#stack.find(predicate);\n }\n\n /**\n * Searches for an element of the mutation stack that satisfies the provided predicate and returns its\n * stack index\n *\n * @param {FilterFn} predicate Receives the argments of {@link Array.findIndex} and returns a Boolean indicating if the current\n * element satisfies the predicate condition\n * @return {Number} Index of the element of the mutation stack that matches the predicate, or undefined if none.\n */\n #findIndex( predicate ) {\n\n if (this.#locked) return this.#liveStack.findIndex(predicate);\n\n return this.#stack.findIndex(predicate);\n }\n\n /**\n * Retrieves an element of the mutation stack that matches the provided name\n *\n * @param {String} name Name of mutation (serves as a unique identifier)\n * @return {MutationData|undefined} Element of the mutation stack matching the provided name, or undefined if none\n */\n getName(name) {\n return this.find((element) => element.name === name);\n }\n\n /**\n * Retrieves that last mutation added to the mutation stack (i.e. the \"newest\"), \n * or undefined if none present\n * @type {MutationData}\n */\n get last() {\n return this.stack[this.stack.length - 1];\n }\n\n /**\n * Updates the mutation matching the provided name with the provided mutation info.\n * The mutation info can be a subset of the full object if (and only if) overwrite is false.\n *\n * @param {string} name name of mutation to update\n * @param {MutationData} data New information, can include 'name'.\n * @param {object} options\n * @param {boolean} [options.overwrite = false] default will merge the provided info\n * with the current values. True will replace the entire entry and requires\n * at least the 'name' field.\n * \n * @return {MutationStack} self, unlocked for writing and updates staged if update successful\n */\n update(name, data, {\n overwrite = false\n }) {\n const index = this.#findIndex((element) => element.name === name);\n\n if (index < 0) {\n return this;\n }\n\n this.#unlock();\n\n if (overwrite) {\n\n /* we need at LEAST a name to identify by */\n if (!data.name) {\n logger.error(MODULE.localize('error.incompleteMutateInfo'));\n this.#locked=true; \n return this;\n }\n\n /* if no user is provided, input current user. */\n if (!data.user) data.user = game.user.id;\n this.#stack[index] = data;\n\n } else {\n /* incomplete mutations are fine with merging */\n mergeObject(this.#stack[index], data);\n }\n\n return this;\n }\n\n /**\n * Applies a given change or tranform function to the current buffer,\n * unlocking if needed.\n *\n * @param {MutationData|function(MutationData) : MutationData} transform Object to merge or function to generate an object to merge from provided {@link MutationData}\n * @param {FilterFn} [filterFn = () => true] Optional function returning a boolean indicating \n * if this element should be modified. By default, affects all elements of the mutation stack.\n * @return {MutationStack} self, unlocked for writing and updates staged.\n */\n updateAll(transform, filterFn = () => true) {\n\n const innerUpdate = (transform) => {\n if (typeof transform === 'function') {\n /* if we are applying a transform function */\n return (element) => mergeObject(element, transform(element));\n } else {\n /* if we are applying a constant change */\n return (element) => mergeObject(element, transform);\n }\n }\n\n this.#unlock();\n\n this.#stack.forEach((element) => {\n if (filterFn(element)) {\n innerUpdate(transform)(element);\n }\n });\n\n return this;\n }\n\n /**\n * Deletes all mutations from this actor's stack, effectively making\n * the current changes permanent.\n *\n * @param {function(MutationData):boolean} [filterFn = () => true] Optional function returning a boolean indicating if this\n * element should be delete. By default, deletes all elements of the mutation stack.\n * @return {MutationStack} self, unlocked for writing and updates staged.\n */\n deleteAll(filterFn = () => true) {\n this.#unlock();\n\n this.#stack = this.#stack.filter((element) => !filterFn(element))\n\n return this;\n }\n\n /**\n * Updates the owning actor with the mutation stack changes made. Will not commit a locked buffer.\n *\n * @return {Promise} self, locked for writing\n */\n async commit() {\n\n if(this.#locked) {\n logger.error(MODULE.localize('error.stackLockedOrEmpty'))\n }\n\n await this.actor.update({\n flags: {\n [MODULE.data.name]: {\n 'mutate': this.#stack\n }\n }\n });\n\n /* return to a locked read-only state */\n this.#locked = true;\n this.#stack.length = 0;\n\n return this;\n }\n\n /**\n * Unlocks the current buffer for writing by copying the mutation stack into this object.\n *\n * @return {boolean} Indicates if the unlock occured. False indicates the buffer was already unlocked.\n */\n #unlock() {\n\n if (!this.#locked) {\n return false;\n }\n\n this.#stack = duplicate(this.#liveStack)\n this.#locked = false;\n return true;\n }\n\n}\n","/* theripper93\n * Copyright (C) 2021 dnd-randomizer\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * Original License:\n * https://github.com/theripper93/dnd-randomizer/blob/master/LICENSE\n */\n\n/* WARPGATE CHANGES\n * exporting propagator class\n * removed test function from original code\n */\n\nexport class Propagator {\n // Find a non-occupied cell in the grid that matches the size of the token given an origin\n static getFreePosition(tokenData, origin, collision = true) {\n const center = canvas.grid.getCenter(origin.x, origin.y);\n origin = { x: center[0], y: center[1] };\n const positions = Propagator.generatePositions(origin);\n for (let position of positions) {\n if (Propagator.canFit(tokenData, position, positions[0], collision)) {\n return position;\n }\n }\n }\n //generate positions radiantially from the origin\n static generatePositions(origin) {\n let positions = [\n canvas.grid.getSnappedPosition(origin.x - 1, origin.y - 1),\n ];\n for (\n let r = canvas.scene.dimensions.size;\n r < canvas.scene.dimensions.size * 10;\n r += canvas.scene.dimensions.size\n ) {\n for (\n let theta = 0;\n theta < 2 * Math.PI;\n theta += Math.PI / ((4 * r) / canvas.scene.dimensions.size)\n ) {\n const newPos = canvas.grid.getTopLeft(\n origin.x + r * Math.cos(theta),\n origin.y + r * Math.sin(theta)\n );\n positions.push({ x: newPos[0], y: newPos[1] });\n }\n }\n return positions;\n }\n //check if a position is free\n static isFree(position) {\n for (let token of canvas.tokens.placeables) {\n const hitBox = new PIXI.Rectangle(token.x, token.y, token.w, token.h);\n if (hitBox.contains(position.x, position.y)) {\n return false;\n }\n }\n return true;\n }\n //check if a token can fit in a position\n static canFit(tokenData, position, origin, collision) {\n for (let i = 0; i < tokenData.width; i++) {\n for (let j = 0; j < tokenData.height; j++) {\n const x = position.x + j;\n const y = position.y + i;\n if (!Propagator.isFree({ x, y })) {\n return false;\n }\n }\n }\n const wallCollisions =\n canvas.walls.checkCollision(\n new Ray(origin, {\n x: position.x + tokenData.width / 2,\n y: position.y + tokenData.height / 2,\n }),\n { type: \"move\" }\n )?.length ?? 0;\n\n return !collision || !wallCollisions;\n }\n}\n","import { Propagator } from \"./propagator.js\";\n\n/**\n * Generator function for exploring vertex-connected grid locations in an\n * outward \"ring\" pattern.\n *\n * @export\n * @generator\n * @name warpgate.plugin.RingGenerator\n * @param {{x:Number, y:Number}} origin Staring location (pixels) for search\n * @param {Number} numRings\n * @yields {{x: Number, y: Number}} pixel location of next grid-ring-connected origin\n */\nexport function* RingGenerator(origin, numRings) {\n const gridLoc = canvas.grid.grid.getGridPositionFromPixels(\n origin.x,\n origin.y\n );\n\n const positions = new Set();\n\n const seen = (position) => {\n const key = position.join(\".\");\n if (positions.has(key)) return true;\n\n positions.add(key);\n return false;\n };\n\n seen(gridLoc);\n let queue = [gridLoc];\n let ring = 0;\n\n /* include seed point in iterator */\n yield { x: origin.x, y: origin.y, ring: -1 };\n\n /* if this is off-grid, also check the snap location */\n const snapped = canvas.grid.getSnappedPosition(origin.x, origin.y);\n const snappedIndex = canvas.grid.grid.getGridPositionFromPixels(\n snapped.x,\n snapped.y\n );\n if (!seen(snappedIndex)) {\n queue = [snappedIndex];\n yield {...snapped, ring: -1};\n }\n\n while (queue.length > 0 && ring < numRings) {\n const next = queue.flatMap((loc) => canvas.grid.grid.getNeighbors(...loc));\n queue = next.filter((loc) => !seen(loc));\n\n for (const loc of queue) {\n const [x, y] = canvas.grid.grid.getPixelsFromGridPosition(...loc);\n yield { x, y, ring };\n }\n\n ring += 1;\n }\n\n return { x: null, y: null, ring: null };\n}\n\n/**\n * Utility class for locating a free area on the grid from\n * a given initial 'requested' position. Effectively slides\n * the requested position to a nearby position free of other\n * tokens (by default, but accepts arbitrary canvas layers with quad trees)\n *\n * @class PlaceableFit\n */\nexport class PlaceableFit {\n /**\n * Initialize new \"fit\" search from the provided\n * bounds.\n *\n * @param {{x:Number, y:Number, width:Number, height:Number}} bounds\n * @param {Object} [options]\n * @constructor\n */\n constructor(bounds, options = {}) {\n this.options = {\n avoidWalls: true,\n searchRange: 6,\n visualize: false,\n collisionLayers: [canvas.tokens],\n };\n\n foundry.utils.mergeObject(this.options, options);\n\n this.bounds = new PIXI.Rectangle(\n bounds.x,\n bounds.y,\n bounds.width,\n bounds.height\n );\n\n if (this.options.visualize) canvas.controls?.debug?.clear?.();\n }\n\n /**\n *\n *\n * @param {{x:Number, y:Number}} loc `{x,y}` location value (in pixels) defining the testing bound's origin (top left)\n * @param {Boolean} isCenter provided location defines the bounds new center, rather than origin\n * @returns PIXI.Rectangle bounds for overlap testing (slightly smaller)\n * @memberof PlaceableFit\n */\n _collisionBounds(loc, isCenter = false) {\n\n const origin = isCenter ? {\n x: loc.x - this.bounds.width / 2,\n y: loc.y - this.bounds.height / 2,\n } : loc;\n\n const newBounds = new PIXI.Rectangle(\n origin.x,\n origin.y,\n this.bounds.width,\n this.bounds.height\n );\n newBounds.pad(-10);\n return newBounds.normalize();\n }\n\n /**\n * With the provided origin (top left), can this\n * placeable fit without overlapping other placeables?\n *\n * @param {{x: Number, y: Number}} loc Origin of bounds\n * @param {Boolean} isCenter Provided origin instead defines the bounds' centerpoint\n * @returns boolean Placeable bounds fit without overlap\n * @memberof PlaceableFit\n */\n spaceClear(loc, isCenter = false) {\n const candidateBounds = this._collisionBounds(loc, isCenter);\n\n if (this.options.visualize) {\n canvas.controls.debug\n .lineStyle(2, 0xff0000, 0.5)\n .drawShape(candidateBounds);\n }\n\n if (this.options.avoidWalls && this._offsetCollidesWall(this.bounds.center, candidateBounds.center)) {\n return false;\n }\n\n for (const layer of this.options.collisionLayers) {\n const hits = layer.quadtree.getObjects(candidateBounds);\n if (hits.size == 0) return true;\n }\n\n return false;\n }\n\n /**\n *\n *\n * @param {{x:Number, y:Number}} originalCenter\n * @param {{x:Number, y:Number}} shiftedCenter\n * @returns Boolean resulting shifted position would collide with a move blocking wall\n * @memberof PlaceableFit\n */\n _offsetCollidesWall(originalCenter, shiftedCenter) {\n const collision = CONFIG.Canvas.polygonBackends.move.testCollision(\n originalCenter,\n shiftedCenter,\n { mode: \"any\", type: \"move\" }\n );\n\n return collision;\n }\n\n /**\n * Searches for and returns the bounds origin point at which it does\n * not overlap other placeables.\n *\n * @param {Object} [options]\n * @param {Boolean} [options.center=false] Return the _center-point_ of the valid freespace bounds, rather than its origin (top-left)\n *\n * @returns {{x: Number, y: Number}|undefined} Identified bounds origin free of overlap\n * @memberof PlaceableFit\n */\n find({center = false} = {}) {\n if (game.release?.generation < 11) {\n return Propagator.getFreePosition(this.bounds, this.bounds);\n }\n\n const locIter = RingGenerator(this.bounds, this.options.searchRange);\n\n let testLoc = null;\n\n while (!(testLoc = locIter.next()).done) {\n\n const newCenter = {\n x: testLoc.value.x + this.bounds.width / 2,\n y: testLoc.value.y + this.bounds.height / 2,\n };\n\n if (this.spaceClear(newCenter, true)) {\n return center ? newCenter : testLoc.value;\n }\n }\n\n return;\n }\n}\n","/*\n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2023 Matthew Haentschke.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\n/** \n * @typedef {function(object, object):Color} ColorFn\n * @param {object} ringData Contains information about the current grid square/hex being highlighted.`x, y, ring` as position and ring index (first is ring 0)\n * @param {object} options Highlight options passed to the initial call.\n *\n * @returns Color Any object/primitive compatible with the `Color` constructor.\n */\n\n/** @ignore */\nfunction BandedColorFn(rings, size, colorList) {\n \n const unitRings = rings instanceof Array ? rings.map( ring => ring * size ) : Array.from({length: rings}, () => 1 * size);\n const unitColors = [];\n unitRings.forEach( (size, band) => unitColors.push( ...Array.from({length: size}, (index) => colorList.at(band % colorList.length)) ))\n \n return ({ring}) => unitColors.at(ring);\n\n}\n\n/**\n * For gridded scenes, will highlight a corresponding number of concentric rings spreading outward from the provided starting point (which is given a negative ring index).\n *\n * By default, the number of rings to highlight is zero and the layer is cleared before drawing, which results in erasing any highlighted rings on the canvas.\n *\n * @param {object} config\n * @param {Number} config.x\n * @param {Number} config.y\n * @param {Number|Array} [config.rings = 0] Number of concentric rings to highlight. If an array is provided, it is treated as a \"schedule\" where each entry represents `value` number of `size`-width rings.\n * @param {String} [config.name = 'warpgate-ring'] Highlight layer name to be used for drawing/clearing\n *\n * @param {object} [options]\n * @param {Number} [options.size = 1] Width of each ring, in grid spaces\n * @param {Color|Array|ColorFn} [options.colors = game.user.color] Colors for each ring 'band' (based on `size` option). If a `Color` is passed, all highlights will use that color. If an `Array` is passed each `size`-width ring will be colored according to the provided list, which is iterated _circularly_ (i.e. repeats if short). If a `ColorFn` is passed, it will be used to generate the color on a per-square/hex basis (see {@link ColorFn} for more details). Any falsey value provided (either in list or as ColorFn return) will _not_ highlight the given location (e.g. \"transparent highlight\").\n * @param {boolean} [options.clear = true] Clear any current highlights on named layer before drawing more.\n * @param {Number} [options.lifetime = 0] Time (in milliseconds) before the highlighted ring is automatically\n * cleared. A negative value or zero indicates \"indefinitely\". Ignored if `config.rings` is less than 1.\n *\n * @returns {Array<{x: Number, y: Number, ring: Number}>} Highlighted grid locations (in pixels) and their corresponding ring index\n *\n * @example\n * const name = 'rangefinder';\n * const size = 2;\n * const rings = 5;\n * const colors = ['red', '#00FF00', 0x0000FF, false];\n * \n * // Draw a simple ring on the default layer\n * warpgate.grid.highlightRing({x: token.x, y:token.y, rings:1});\n * \n * // Draw a larger temporary ring on the rangerfinder layer\n * const highlights = warpgate.grid.highlightRing(\n * {x: token.x, y:token.y, rings, name}, \n * {size, colors, clear: true, lifetime:2000});\n * \n * ui.notifications.info(`Highlighted ${highlights.length} grid positions.`);\n */\nexport function highlightRing(\n config = { x: 0, y: 0, rings: 0, name: 'warpgate-ring' },\n options = {}\n) {\n\n /* establish defaults */\n config = foundry.utils.mergeObject({rings: 0, name: 'warpgate-ring'}, config);\n options = foundry.utils.mergeObject({ size: 1, colors: game.user.color, clear: true, lifetime: 0}, options);\n\n /* ensure we have a layer on which to draw */\n canvas.grid.addHighlightLayer(config.name);\n\n if (options.clear) canvas.grid.clearHighlightLayer(config.name);\n\n const singleRings = config.rings instanceof Array ? config.rings.reduce( (acc, curr) => acc + curr * options.size, 0) : config.rings * options.size;\n\n if(singleRings < 1) {\n return [];\n }\n\n /* prep color array/string */\n const colorFn = typeof options.colors == 'string' ? () => options.colors \n : options.colors instanceof Array ? BandedColorFn(config.rings, options.size, options.colors) :\n options.colors;\n \n /* snap position to nearest grid square origin */\n const snapped = canvas.grid.getSnappedPosition(config.x, config.y);\n\n const locs = [...warpgate.plugin.RingGenerator(snapped, singleRings)];\n locs.forEach((loc) => {\n if (loc.ring < 0) return;\n\n const color = colorFn(loc, options);\n loc.color = color;\n if (!!color) {\n canvas.grid.highlightPosition(config.name, {\n x: loc.x,\n y: loc.y,\n color: colorFn(loc, options),\n });\n }\n });\n if (options.lifetime > 0) warpgate.wait(options.lifetime).then( () => highlightRing({name: config.name}) );\n return locs;\n}\n\n","\n/* \n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n * \n * This program is free software: you can redistribute it and/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see .\n */\n\nimport { dismissSpawn, showCrosshairs, collectPlaceables, _rollItemGetLevel, _spawnTokenAtLocation } from './gateway.js';\nimport { mutate, revertMutation, batchMutate, batchRevert, clean, _updateActor } from './mutator.js';\nimport { MODULE, logger } from './module.js';\nimport { notifyEvent, requestNotice } from './comms.js';\nimport { Events } from './events.js';\nimport { queueUpdate } from './update-queue.js';\nimport { Crosshairs } from './crosshairs.js';\nimport { MutationStack } from './mutation-stack.js';\nimport {PlaceableFit, RingGenerator} from './lib/PlaceableFit.mjs'\nimport {highlightRing} from './lib/ring-highlight.js';\n\n/** @typedef {import('./crosshairs.js').CrosshairsData} CrosshairsData */\n/** @typedef {import('./mutator.js').WorkflowOptions} WorkflowOptions */\n/** @typedef {import('./gateway.js').ParallelShow} ParallelShow */\n\n/**\n * string-string key-value pairs indicating which field to use for comparisons for each needed embeddedDocument type. \n * @typedef {Object} ComparisonKeys \n * @example\n * const comparisonKeys = {\n * ActiveEffect: 'label',\n * Item: 'name'\n * }\n */\n\n/* \n * @private\n * @ignore\n * @todo Creating proper type and use in warpgate.dismiss\n * @typedef {{overrides: ?{includeRawData: ?WorkflowOptions['overrides']['includeRawData']}}} DismissOptions\n */\n\n/**\n * Configuration obect for pan and ping (i.e. Notice) operations\n * @typedef {Object} NoticeConfig\n * @prop {boolean|string} [ping=false] Creates an animated ping at designated location if a valid\n * ping style from the values contained in `CONFIG.Canvas.pings.types` is provided, or `'pulse'` if `true`\n * @prop {boolean|Number} [pan=false] Pans all receivers to designated location if value is `true`\n * using the configured default pan duration of `CONFIG.Canvas.pings.pullSpeed`. If a Number is \n * provided, it is used as the duration of the pan.\n * @prop {Number} [zoom] Alters zoom level of all receivers, independent of pan/ping\n * @prop {string} [sender = game.userId] The user who triggered the notice\n * @prop {Array} [receivers = warpgate.USERS.SELF] An array of user IDs to send the notice to. If not\n * provided, the notice is only sent to the current user.\n */\n\n/**\n * Common 'shorthand' notation describing arbitrary data related to a spawn/mutate/revert process.\n *\n * The `token` and `actor` key values are standard update or options objects as one would use in \n * `Actor#update` and `TokenDocument#update`.\n *\n * The `embedded` key uses a shorthand notation to make creating the updates for embedded documents\n * (such as items) easier. Notably, it does not require the `_id` field to be part of the update object \n * for a given embedded document type. \n *\n * @typedef {Object} Shorthand\n * @prop {object} [token] Data related to the workflow TokenDocument.\n * @prop {object} [actor] Data related to the workflow Actor.\n * @prop {Object} [embedded] Keyed by embedded document class name (e.g. `\"Item\"` or `\"ActiveEffect\"`), there are three operations that this object controls -- adding, updating, deleting (in that order).\n *\n * | Operation | Value Interpretation |\n * | :-- | :-- |\n * | Add | Given the identifier of a **non-existing** embedded document, the value contains the data object for document creation compatible with `createEmbeddedDocuments`. This object can be constructed in-place by hand, or gotten from a template document and modified using `\"Item To Add\": game.items.getName(\"Name of Item\").data`. As an example. Note: the name contained in the key will override the corresponding identifier field in the final creation data. |\n * | Update | Given a key of an existing document, the value contains the data object compatible with `updateEmbeddedDocuments`|\n * | Delete | A value of {@link warpgate.CONST.DELETE} will remove this document (if it exists) from the spawned actor. e.g. `{\"Item Name To Delete\": warpgate.CONST.DELETE}`|\n *\n * @see ComparisonKeys\n */\n\n/**\n * Pre spawn callback. After a location is chosen or provided, but before any\n * spawning for _this iteration_ occurs. Used for modifying the spawning data prior to\n * each spawning iteration and for potentially skipping certain iterations.\n *\n * @callback PreSpawn\n * @param {{x: number, y: number}} location Desired centerpoint of spawned token.\n * @param {Object} updates Current working \"updates\" object, which is modified for every iteration\n * @param {number} iteration Current iteration number (0-indexed) in the case of 'duplicates'\n *\n * @returns {Promise|boolean} Indicating if the _current_ spawning iteration should continue. \n */\n\n/**\n * Post spawn callback. After the spawning and updating for _this iteration_ occurs.\n * Used for modifying the spawning for the next iteration, operations on the TokenDocument directly\n * (such as animations or chat messages), and potentially aborting the spawning process entirely.\n *\n * @callback PostSpawn\n * @param {{x: number, y: number}} location Actual centerpoint of spawned token (affected by collision options).\n * @param {TokenDocument} spawnedToken Resulting token created for this spawning iteration\n * @param {Object} updates Current working \"updates\" object, which is modified for every iteration\n * @param {number} iteration Current iteration number (0-indexed) in the case of 'duplicates'\n *\n * @returns {Promise|boolean} Indicating if this entire spawning process should be aborted (including any remaining duplicates)\n */\n\n\n/**\n * This object controls how the crosshairs will be displayed and decorated. \n * Each field is optional with its default value listed.\n *\n * @typedef {Object} CrosshairsConfig\n * @property {number} [x=currentMousePosX] Initial x location for display\n * @property {number} [y=currentMousePosY] Initial y location for display\n * @property {number} [size=1] The initial diameter of the crosshairs outline in grid squares\n * @property {string} [icon = 'icons/svg/dice-target.svg'] The icon displayed in the center of the crosshairs\n * @property {number} [direction = 0] Initial rotation angle (in degrees) of the displayed icon (if any). 0 degrees corresponds to <0, 1> unit vector (y+ in screen space, or 'down' in \"monitor space\"). If this is included within a {@link WarpOptions} object, it is treated as a delta change to the token/update's current rotation value. Positive values rotate clockwise; negative values rotate counter-clockwise. \n * @property {string} [label = ''] The text to display below the crosshairs outline\n * @property {{x:number, y:number}} [labelOffset={x:0,y:0}] Pixel offset from the label's initial relative position below the outline\n * @property {*} [tag='crosshairs'] Arbitrary value used to identify this crosshairs object\n * @property {boolean} [drawIcon=true] Controls the display of the center icon of the crosshairs\n * @property {boolean} [drawOutline=true] Controls the display of the outline circle of the crosshairs\n * @property {number} [interval=2] Sub-grid granularity per square. Snap points will be created every 1/`interval` \n * grid spaces. Positive values begin snapping at grid intersections. Negative values begin snapping at the \n * center of the square. Ex. the default value of 2 produces two snap points -- one at the edge and one at the \n * center; `interval` of 1 will snap to grid intersections; `interval` of -1 will snap to grid centers. \n * Additionally, a value of `0` will turn off grid snapping completely for this instance of crosshairs.\n * @property {number} [fillAlpha=0] Alpha (opacity) of the template's fill color (if any).\n * @property {string} [fillColor=game.user.color] Color of the template's fill when no texture is used. \n * @property {boolean} [rememberControlled=false] Will restore the previously selected tokens after using crosshairs.\n * @property {boolean} [tileTexture=false] Indicates if the texture is tileable and does not need specific\n * offset/scaling to be drawn correctly. By default, the chosen texture will be position and scaled such \n * that the center of the texture image resides at the center of the crosshairs template.\n * @property {boolean} [lockSize=true] Controls the ability of the user to scale the size of the crosshairs \n * using shift+scroll. When locked, shift+scroll acts as a \"coarse rotation\" step for rotating the center icon.\n * @property {boolean} [lockPosition=false] Prevents updating the position of the crosshair based on mouse movement. Typically used in combination with the `show` callback to lock position conditionally.\n * @property {string} [texture] Asset path of the texture to draw inside the crosshairs border.\n */\n\n/**\n * @typedef {Object} SpawningOptions\n * @property {ComparisonKeys} [comparisonKeys] Data paths relative to root document data used for comparisons of embedded\n * shorthand identifiers\n * @property {Shorthand} [updateOpts] Options for the creation/deletion/updating of (embedded) documents related to this spawning \n * @property {Actor} [controllingActor] will minimize this actor's open sheet (if any) for a clearer view of the canvas \n * during placement. Also flags the created token with this actor's id. Default `null`\n * @property {number} [duplicates=1] will spawn multiple tokens from a single placement. See also {@link SpawningOptions.collision}\n * @property {boolean} [collision=duplicates>1] controls whether the placement of a token collides with any other token \n * or wall and finds a nearby unobstructed point (via a radial search) to place the token. If `duplicates` is greater \n * than 1, default is `true`; otherwise `false`.\n * @property {NoticeConfig} [notice] will pan or ping the canvas to the token's position after spawning.\n * @property {object} [overrides] See corresponding property descriptions in {@link WorkflowOptions}\n * @property {boolean} [overrides.includeRawData = false] \n * @property {boolean} [overrides.preserveData = false]\n */\n\n /**\n * @typedef {Object} WarpOptions\n * @prop {CrosshairsConfig} [crosshairs] A crosshairs configuration object to be used for this spawning process\n */\n\n/**\n * @class\n * @private\n */\nexport class api {\n\n static register() {\n api.globals();\n }\n\n static settings() {\n\n }\n\n static globals() {\n /**\n * @global\n * @summary Top level (global) symbol providing access to all Warp Gate API functions\n * @static\n * @namespace warpgate\n * @property {warpgate.CONST} CONST\n * @property {warpgate.EVENT} EVENT\n * @property {warpgate.USERS} USERS\n * @borrows api._spawn as spawn\n * @borrows api._spawnAt as spawnAt\n * @borrows Gateway.dismissSpawn as dismiss\n * @borrows Mutator.mutate as mutate\n * @borrows Mutator.revertMutation as revert\n * @borrows MODULE.wait as wait\n * @borrows MODULE.buttonDialog as buttonDialog\n * @borrows MODULE.menu as menu\n */\n window[MODULE.data.name] = {\n spawn : api._spawn,\n spawnAt : api._spawnAt,\n dismiss : dismissSpawn,\n mutate : mutate,\n revert : revertMutation,\n /**\n * Factory method for creating a new mutation stack class from\n * the provided token document\n *\n * @memberof warpgate\n * @static\n * @param {TokenDocument} tokenDoc\n * @return {MutationStack} Locked instance of a token actor's mutation stack.\n *\n * @see {@link MutationStack}\n */\n mutationStack : (tokenDoc) => new MutationStack(tokenDoc),\n wait : MODULE.wait,\n menu: MODULE.menu,\n buttonDialog : MODULE.buttonDialog,\n /**\n * @summary Utility functions for common queries and operations\n * @namespace\n * @alias warpgate.util\n * @borrows MODULE.firstGM as firstGM\n * @borrows MODULE.isFirstGM as isFirstGM\n * @borrows MODULE.firstOwner as firstOwner\n * @borrows MODULE.isFirstOwner as isFirstOwner\n * @borrows MODULE.waitFor as waitFor\n */\n util: {\n firstGM : MODULE.firstGM,\n isFirstGM : MODULE.isFirstGM,\n firstOwner : MODULE.firstOwner,\n isFirstOwner : MODULE.isFirstOwner,\n waitFor : MODULE.waitFor,\n },\n\n /**\n * @summary Crosshairs methods\n * @namespace \n * @alias warpgate.crosshairs\n * @borrows Gateway.showCrosshairs as show\n * @borrows Crosshairs.getTag as getTag\n * @borrows Gateway.collectPlaceables as collect\n */\n crosshairs: {\n show: showCrosshairs,\n getTag: Crosshairs.getTag,\n collect: collectPlaceables,\n },\n /**\n * @summary Methods intended for warp gate \"pylons\" (e.g. Warp Gate-dependent modules)\n * @namespace \n * @alias warpgate.plugin\n * @borrows api._notice as notice\n * @borrows Mutator.batchMutate as batchMutate\n * @borrows Mutator.batchRevert as batchRevert\n * @borrows RingGenerator as RingGenerator\n */\n plugin: {\n queueUpdate,\n notice: api._notice,\n batchMutate,\n batchRevert,\n RingGenerator,\n },\n /**\n * @summary Helper functions related to grid-centric canvas operations\n * @namespace\n * @alias warpgate.grid\n * @borrows highlightRing as highlightRing\n */\n grid: {\n highlightRing,\n },\n /**\n * @description Constants and enums for use in embedded shorthand fields\n * @alias warpgate.CONST\n * @readonly\n * @enum {string}\n */\n CONST : {\n /** Instructs warpgate to delete the identified embedded document. Used in place of the update or create data objects. */\n DELETE : 'delete',\n },\n /**\n * @description Helper enums for retrieving user IDs\n * @alias warpgate.USERS\n * @readonly\n * @enum {Array}\n * @property {Array} ALL All online users\n * @property {Array} SELF The current user\n * @property {Array} GM All online GMs\n * @property {Array} PLAYERS All online players (non-gms)\n */\n USERS: {\n /** All online users */\n get ALL() { return game.users.filter(user => user.active).map( user => user.id ) },\n /** The current user */\n get SELF() { return [game.userId] },\n /** All online GMs */\n get GM() { return game.users.filter(user => user.active && user.isGM).map( user => user.id ) },\n /** All online players */\n get PLAYERS() { return game.users.filter(user => user.active && !user.isGM).map( user => user.id ) }\n },\n /**\n *\n * The following table describes the stock event type payloads that are broadcast during {@link warpgate.event.notify}\n * \n * | Event | Payload | Notes |\n * | :-- | -- | -- |\n * | `` | `{sceneId: string, userId: string}` | userId is the initiator |\n * | {@link warpgate.EVENT.PLACEMENT} | `{templateData: {@link CrosshairsData}|Object, tokenData: TokenData|String('omitted'), options: {@link WarpOptions}} | The final Crosshairs data used to spawn the token, and the final token data that will be spawned. There is no actor data provided. In the case of omitting raw data, `template` data will be of type `{x: number, y: number, size: number, cancelled: boolean}` |\n * | SPAWN | `{uuid: string, updates: {@link Shorthand}|String('omitted'), options: {@link WarpOptions}|{@link SpawningOptions}, iteration: number}` | UUID of created token, updates applied to the token, options used for spawning, and iteration this token was spawned on.|\n * | DISMISS | `{actorData: {@link PackedActorData}|string}` | `actorData` is a customized version of `Actor#toObject` with its `token` field containing the actual token document data dismissed, instead of its prototype data. |\n * | MUTATE | `{uuid: string, updates: {@link Shorthand}, options: {@link WorkflowOptions} & {@link MutationOptions}` | UUID of modified token, updates applied to the token, options used for mutation. When raw data is omitted, `updates` will be `String('omitted')`|\n * | REVERT | `{uuid: string, updates: {@link Shorthand}, options: {@link WorkflowOptions}} | UUID is that of reverted token and updates applied to produce the final reverted state (or `String('omitted') if raw data is omitted). |\n * | REVERT\\_RESPONSE | `{accepted: bool, tokenId: string, mutationId: string, options: {@link WorkflowOptions}` | Indicates acceptance/rejection of the remote revert request, including target identifiers and options |\n * | MUTATE\\_RESPONSE | `{accepted: bool, tokenId: string, mutationId: string, options: {@link WorkflowOptions}` | `mutationId` is the name provided in `options.name` OR a randomly assigned ID if not provided. Callback functions provided for remote mutations will be internally converted to triggers for this event and do not need to be registered manually by the user. `accepted` is a bool field that indicates if the remote user accepted the mutation. |\n *\n * @description Event name constants for use with the {@link warpgate.event} system.\n * @alias warpgate.EVENT\n * @enum {string}\n */\n EVENT : {\n /** After placement is chosen */\n PLACEMENT: 'wg_placement',\n /** After each token has been spawned and fully updated */\n SPAWN: 'wg_spawn',\n /** After a token has been dismissed via warpgate */\n DISMISS: 'wg_dismiss',\n /** After a token has been fully reverted */\n REVERT: 'wg_revert',\n /** After a token has been fully modified */\n MUTATE: 'wg_mutate',\n /** Feedback of mutation acceptance/rejection from the remote owning player in\n * the case of an \"unowned\" or remote mutation operation\n */\n MUTATE_RESPONSE: 'wg_response_mutate',\n /** Feedback of mutation revert acceptance/rejection from the remote owning player in\n * the case of an \"unowned\" or remote mutation operation\n */\n REVERT_RESPONSE: 'wg_response_revert'\n },\n /**\n * Warp Gate includes a hook-like event system that can be used to respond to stages of the\n * spawning and mutation process. Additionally, the event system is exposed so that users \n * and module authors can create custom events in any context.\n *\n * @summary Event system API functions.\n * @see warpgate.event.notify\n *\n * @namespace \n * @alias warpgate.event\n * @borrows Events.watch as watch\n * @borrows Events.trigger as trigger\n * @borrows Events.remove as remove\n * @borrows Comms.notifyEvent as notify\n *\n */\n event : {\n watch : Events.watch,\n trigger : Events.trigger,\n remove : Events.remove,\n notify : notifyEvent,\n },\n /**\n * @summary Warp Gate classes suitable for extension\n * @namespace \n * @alias warpgate.abstract\n * @property {Crosshairs} Crosshairs\n * @property {MutationStack} MutationStack\n * @property {PlaceableFit} PlaceableFit\n */\n abstract : {\n Crosshairs,\n MutationStack,\n PlaceableFit,\n }\n }\n }\n\n /** \n *\n * The primary function of Warp Gate. When executed, it will create a custom MeasuredTemplate\n * that is used to place the spawned token and handle any customizations provided in the `updates` \n * object. `warpgate#spawn` will return a Promise that can be awaited, which can be used in loops \n * to spawn multiple tokens, one after another (or use the `duplicates` options). The player spawning\n * the token will also be given Owner permissions for that specific token actor. \n * This means that players can spawn any creature available in the world.\n *\n * @param {String|PrototypeTokenDocument} spawnName Name of actor to spawn or the actual TokenData \n * that should be used for spawning.\n * @param {Shorthand} [updates] - embedded document, actor, and token document updates. embedded updates use \n * a \"shorthand\" notation.\n * @param {Object} [callbacks] The callbacks object as used by spawn and spawnAt provide a way to execute custom \n * code during the spawning process. If the callback function modifies updates or location, it is often best \n * to do this via `mergeObject` due to pass by reference restrictions.\n * @param {PreSpawn} [callbacks.pre] \n * @param {PostSpawn} [callbacks.post] \n * @param {ParallelShow} [callbacks.show]\n * @param {WarpOptions & SpawningOptions} [options]\n *\n * @return {Promise>} list of created token ids\n */\n static async _spawn(spawnName, updates = {}, callbacks = {}, options = {}) {\n \n /* check for needed spawning permissions */\n const neededPerms = MODULE.canSpawn(game.user);\n if(neededPerms.length > 0) {\n logger.warn(MODULE.format('error.missingPerms', {permList: neededPerms.join(', ')}));\n return [];\n }\n\n /* create permissions for this user */\n const actorData = {\n ownership: {[game.user.id]: CONST.DOCUMENT_PERMISSION_LEVELS.OWNER}\n }\n\n /* the provided update object will be mangled for our use -- copy it to\n * preserve the user's original input if requested (default).\n */\n if(!options.overrides?.preserveData) {\n updates = MODULE.copy(updates, 'error.badUpdate.complex');\n if(!updates) return [];\n options = foundry.utils.mergeObject(options, {overrides: {preserveData: true}}, {inplace: false});\n }\n\n /* insert token updates to modify token actor permission */\n MODULE.shimUpdate(updates);\n foundry.utils.mergeObject(updates, {token: mergeObject(updates.token ?? {}, {actorData}, {overwrite:false})});\n\n /* Detect if the protoData is actually a name, and generate token data */\n let protoData;\n if (typeof spawnName == 'string'){\n protoData = await MODULE.getTokenData(spawnName, updates.token);\n } else {\n protoData = spawnName;\n protoData.updateSource(updates.token ?? {});\n }\n\n if (!protoData) return;\n \n if(options.controllingActor?.sheet?.rendered) options.controllingActor.sheet.minimize();\n\n /* gather data needed for configuring the display of the crosshairs */\n const tokenImg = protoData.texture.src;\n const rotation = updates.token?.rotation ?? protoData.rotation ?? 0;\n const crosshairsConfig = foundry.utils.mergeObject(options.crosshairs ?? {}, {\n size: protoData.width,\n icon: tokenImg,\n name: protoData.name,\n direction: 0,\n }, {inplace: true, overwrite: false});\n\n crosshairsConfig.direction += rotation;\n\n /** @type {CrosshairsData} */\n const templateData = await showCrosshairs(crosshairsConfig, callbacks);\n\n const eventPayload = {\n templateData: (options.overrides?.includeRawData ?? false) ? templateData : {x: templateData.x, y: templateData.y, size: templateData.size, cancelled: templateData.cancelled},\n tokenData: (options.overrides?.includeRawData ?? false) ? protoData.toObject() : 'omitted',\n options,\n }\n\n await warpgate.event.notify(warpgate.EVENT.PLACEMENT, eventPayload);\n\n if (templateData.cancelled) return;\n\n let spawnLocation = {x: templateData.x, y:templateData.y}\n\n /* calculate any scaling that may have happened */\n const scale = templateData.size / protoData.width;\n\n /* insert changes from the template into the updates data */\n mergeObject(updates, {token: {rotation: templateData.direction, width: templateData.size, height: protoData.height*scale}});\n\n return api._spawnAt(spawnLocation, protoData, updates, callbacks, options);\n }\n\n /**\n * An alternate, more module friendly spawning function. Will create a token from the provided token data and updates at the designated location. \n *\n * @param {{x: number, y: number}} spawnLocation Centerpoint of spawned token\n * @param {String|PrototypeTokenData|TokenData|PrototypeTokenDocument} protoData Any token data or the name of a world-actor. Serves as the base data for all operations.\n * @param {Shorthand} [updates] As {@link warpgate.spawn}\n * @param {Object} [callbacks] see {@link warpgate.spawn}\n * @param {PreSpawn} [callbacks.pre] \n * @param {PostSpawn} [callbacks.post] \n * @param {SpawningOptions} [options] Modifies behavior of the spawning process.\n *\n * @return {Promise>} list of created token ids\n *\n */\n static async _spawnAt(spawnLocation, protoData, updates = {}, callbacks = {}, options = {}) {\n\n /* check for needed spawning permissions */\n const neededPerms = MODULE.canSpawn(game.user);\n if(neededPerms.length > 0) {\n logger.warn(MODULE.format('error.missingPerms', {permList: neededPerms.join(', ')}));\n return [];\n }\n\n /* the provided update object will be mangled for our use -- copy it to\n * preserve the user's original input if requested (default).\n */\n if(!options.overrides?.preserveData) {\n updates = MODULE.copy(updates, 'error.badUpdate.complex');\n if(!updates) return [];\n options = foundry.utils.mergeObject(options, {overrides: {preserveData: true}}, {inplace: false});\n }\n\n MODULE.shimUpdate(updates);\n\n /* Detect if the protoData is actually a name, and generate token data */\n if (typeof protoData == 'string'){\n protoData = await MODULE.getTokenData(protoData, updates.token ?? {});\n }\n\n if (!protoData) return [];\n\n let createdIds = [];\n\n /* flag this user as the tokens's creator */\n const actorFlags = {\n [MODULE.data.name]: {\n control: {user: game.user.id, actor: options.controllingActor?.uuid},\n }\n }\n\n /* create permissions for this user */\n const actorData = {\n ownership: {[game.user.id]: CONST.DOCUMENT_PERMISSION_LEVELS.OWNER}\n }\n const deltaField = MODULE.compat('token.delta');\n updates.token = mergeObject({[deltaField]: actorData}, updates.token ?? {}, {inplace: false})\n\n updates.actor = mergeObject({flags: actorFlags}, updates.actor ?? {}, {inplace: false})\n\n const duplicates = options.duplicates > 0 ? options.duplicates : 1;\n await clean(null, options);\n\n if(options.notice) warpgate.plugin.notice({...spawnLocation, scene: canvas.scene}, options.notice); \n\n for (let iteration = 0; iteration < duplicates; iteration++) {\n\n /** pre creation callback */\n if (callbacks.pre) {\n const response = await callbacks.pre(spawnLocation, updates, iteration);\n\n /* pre create callbacks can skip this spawning iteration */\n if(response === false) continue;\n }\n await clean(updates);\n\n /* merge in changes to the prototoken */\n if(iteration == 0){\n /* first iteration, potentially from a spawn with a determined image,\n * apply our changes to this version */\n await MODULE.updateProtoToken(protoData, updates.token);\n } else {\n /* get a fresh copy */\n protoData = await MODULE.getTokenData(game.actors.get(protoData.actorId), updates.token)\n }\n\n logger.debug(`Spawn iteration ${iteration} using`, protoData, updates);\n\n /* pan to token if first iteration */\n //TODO integrate into stock event data instead of hijacking mutate events\n\n /** @type Object */\n const spawnedTokenDoc = (await _spawnTokenAtLocation(protoData,\n spawnLocation,\n options.collision ?? (options.duplicates > 1)))[0];\n\n createdIds.push(spawnedTokenDoc.id);\n\n logger.debug('Spawned token with data: ', spawnedTokenDoc);\n\n await _updateActor(spawnedTokenDoc.actor, updates, options.comparisonKeys ?? {}, options.updateOpts ?? {});\n\n const eventPayload = {\n uuid: spawnedTokenDoc.uuid,\n updates: (options.overrides?.includeRawData ?? false) ? updates : 'omitted',\n options,\n iteration\n } \n\n await warpgate.event.notify(warpgate.EVENT.SPAWN, eventPayload);\n\n /* post creation callback */\n if (callbacks.post) {\n const response = await callbacks.post(spawnLocation, spawnedTokenDoc, updates, iteration);\n if(response === false) break;\n }\n \n }\n\n if (options.controllingActor?.sheet?.rendered) options.controllingActor?.sheet?.maximize();\n return createdIds;\n }\n\n /**\n * Helper function for displaying pings for or panning the camera of specific users. If no scene is provided, the user's current\n * is assumed.\n *\n * @param {{x: Number, y: Number, scene: Scene} | CrosshairsData} placement Information for the physical placement of the notice containing at least `{x: Number, y: Number, scene: Scene}`\n * @param {NoticeConfig} [config] Configuration for the notice\n */\n static _notice({x, y, scene}, config = {}){\n\n config.sender ??= game.userId;\n config.receivers ??= warpgate.USERS.SELF;\n scene ??= canvas.scene;\n\n return requestNotice({x,y}, scene.id, config);\n }\n\n}\n","/* \n * This file is part of the warpgate module (https://github.com/trioderegion/warpgate)\n * Copyright (c) 2021 Matthew Haentschke.\n * \n * This program is free software: you can redistribute it and/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, version 3.\n *\n * This program is distributed in the hope that it will be useful, but \n * WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see .\n */\n\nimport { dismissSpawn } from './gateway.js'\nimport { MODULE, logger } from './module.js'\nimport {queueUpdate} from './update-queue.js'\nimport { revertMutation } from './mutator.js'\n\nexport class UserInterface {\n\n static register() {\n this.hooks();\n this.settings();\n }\n\n static hooks() {\n Hooks.on(\"renderActorSheet\", UserInterface._renderActorSheet);\n }\n\n static settings() {\n const config = true;\n const settingsData = {\n showDismissLabel : {\n scope: \"client\", config, default: true, type: Boolean,\n },\n showRevertLabel : {\n scope: \"client\", config, default: true, type: Boolean,\n },\n dismissButtonScope : {\n scope: \"client\", config, default: 'spawned', type: String, choices: {\n disabled: MODULE.localize('setting.option.disabled'),\n spawned: MODULE.localize('setting.option.spawnedOnly'),\n all: MODULE.localize('setting.option.all')\n }\n },\n revertButtonBehavior : {\n scope: 'client', config, default: 'pop', type: String, choices: {\n disabled: MODULE.localize('setting.option.disabled'),\n pop: MODULE.localize('setting.option.popLatestMutation'),\n menu: MODULE.localize('setting.option.showMutationList')\n }\n }\n };\n\n MODULE.applySettings(settingsData);\n }\n\n static _renderActorSheet(app, html) {\n \n UserInterface.addDismissButton(app, html);\n UserInterface.addRevertMutation(app, html);\n }\n\n static _shouldAddDismiss(token) {\n\n if ( !(token instanceof TokenDocument) ) return false;\n\n switch (MODULE.setting('dismissButtonScope')){\n case 'disabled':\n return false;\n case 'spawned':\n \n const controlData = token?.actor.getFlag(MODULE.data.name, 'control');\n\n /** do not add the button if we are not the controlling actor AND we aren't the GM */\n if ( controlData?.user !== game.user.id ) return false;\n\n return !!controlData;\n case 'all':\n return true;\n }\n\n }\n\n static addDismissButton(app, html) {\n const token = app.token;\n\n /** this is not a warpgate spawned actor */\n if (!UserInterface._shouldAddDismiss(token)) return;\n\n /* do not add duplicate buttons! */\n if(html.closest('.app').find('.dismiss-warpgate').length !== 0) {\n logger.debug(MODULE.localize('debug.dismissPresent')); \n return;\n }\n\n const label = MODULE.setting('showDismissLabel') ? MODULE.localize(\"display.dismiss\") : \"\"\n let dismissButton = $(`${label}`);\n\n dismissButton.click( (/*event*/) => {\n if (!token) {\n logger.error(MODULE.localize('error.sheetNoToken'));\n return;\n }\n const {id, parent} = token;\n dismissSpawn(id, parent?.id);\n\n /** close the actor sheet if provided */\n app?.close({submit: false});\n });\n\n let title = html.closest('.app').find('.window-title');\n dismissButton.insertAfter(title);\n\n }\n\n static _shouldAddRevert(token) {\n\n if ( !(token instanceof TokenDocument) ) return false;\n\n const mutateStack = warpgate.mutationStack(token).stack;\n\n /* this is not a warpgate mutated actor,\n * or there are no remaining stacks to peel */\n if (mutateStack.length == 0) return false;\n\n return MODULE.setting('revertButtonBehavior') !== 'disabled';\n }\n\n static _getTokenFromApp(app) {\n \n const {token, actor} = app;\n \n const hasToken = token instanceof TokenDocument;\n\n if( !hasToken ) {\n /* check if linked and has an active token on scene */\n const candidates = actor?.getActiveTokens() ?? [];\n const linkedToken = candidates.find( t => t.document.actorLink )?.document ?? null;\n \n return linkedToken;\n \n }\n\n return token;\n }\n\n static addRevertMutation(app, html) {\n\n /* do not add duplicate buttons! */\n let foundButton = html.closest('.app').find('.revert-warpgate')\n\n /* we remove the current button on each render\n * in case the render was triggered by a mutation\n * event and we need to update the tool tip\n * on the revert stack\n */\n if (foundButton) {\n foundButton.remove();\n }\n\n const token = UserInterface._getTokenFromApp(app);\n\n if(!UserInterface._shouldAddRevert(token)) return;\n\n const mutateStack = token?.actor?.getFlag(MODULE.data.name, 'mutate');\n\n /* construct the revert button */\n const label = MODULE.setting('showRevertLabel') ? MODULE.localize(\"display.revert\") : \"\"\n const stackCount = mutateStack.length > 1 ? ` 1/${mutateStack.length}` : '';\n let revertButton = $(`${label}`);\n\n revertButton.click( async (event) => {\n const shouldShow = (shiftKey) => {\n const mode = MODULE.setting('revertButtonBehavior')\n const show = mode == 'menu' ? !shiftKey : shiftKey;\n return show;\n }\n\n let name = undefined;\n const showMenu = shouldShow(event.shiftKey);\n\n if (showMenu) {\n const buttons = mutateStack.map( mutation => {return {label: mutation.name, value: mutation.name}} )\n name = await warpgate.buttonDialog({buttons, title: MODULE.localize('display.revertDialogTitle')}, 'column');\n if (name === false) return;\n }\n\n /* need to queue this since 'click' could\n * happen at any time.\n * Do not need to remove the button here \n * as it will be refreshed on the render call\n */\n queueUpdate( async () => {\n await revertMutation(token, name);\n app?.render(false);\n });\n\n });\n\n let title = html.closest('.app').find('.window-title');\n revertButton.insertAfter(title);\n }\n\n}\n","/*\n * MIT License\n * \n * Copyright (c) 2020-2021 DnD5e Helpers Team and Contributors\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nimport { MODULE, logger } from './module.js';\nimport { api } from './api.js';\nimport { register as rGateway } from './gateway.js';\nimport { register as rMutator } from './mutator.js';\nimport { register as rRemoteMutator } from './remote-mutator.js'\nimport { UserInterface } from './user-interface.js';\nimport { register as rComms } from './comms.js';\n\nconst SUB_MODULES = {\n MODULE,\n logger,\n api,\n Gateway: {register: rGateway},\n Mutator: {register: rMutator},\n RemoteMutator: {register: rRemoteMutator},\n UserInterface,\n Comms: {register: rComms}\n}\n\n/*\n Initialize all Sub Modules\n*/\nHooks.on(`setup`, () => {\n Object.values(SUB_MODULES).forEach(cl => cl.register());\n});\n"],"names":["NAME","register","rGateway","rMutator","rRemoteMutator","rComms"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAI,GAAG,UAAU,CAAC;AACxB;AACA,MAAM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AAK,CAAC,CAAC;AACd;AACA,IAAI,OAAO,UAAU,IAAI,aAAa,CAAC;AACvC,GAAG;AACH;;AC9JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA,MAAMA,MAAI,GAAG,SAAS,CAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO,CAAC;AACd,EAAE,OAAO,QAAQ,GAAG;AACpB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;AACvB,GAAG;AACH;AACA,EAAE,OAAO,QAAQ,EAAE;AACnB,IAAI,MAAM,CAACA,MAAI,CAAC,GAAG;AACnB,MAAM,aAAa,EAAE,MAAM;AAC3B,MAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG;AACjD,IAAI,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC;AACxE;AACA,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH;AACA,EAAE,OAAO,YAAY,EAAE,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG;AACnD,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,KAAK,GAAG,EAAE;AAC/E,GAAG;AACH;A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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,GAAG,CAAC;AACjB;AACA,EAAE,OAAO,QAAQ,GAAG;AACpB,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;AAClB,GAAG;AACH;AACA,EAAE,OAAO,QAAQ,GAAG;AACpB;AACA,GAAG;AACH;AACA,EAAE,OAAO,OAAO,GAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM;AACxB,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ;AAC5B,MAAM,OAAO,GAAG,YAAY;AAC5B,MAAM,MAAM,GAAG,MAAM;AACrB,MAAM,MAAM,GAAG,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,QAAQ,KAAK,IAAI,aA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