From f32e178e46b043ccad839affe271c0776088da6f Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Thu, 26 Jan 2023 17:53:30 +0100 Subject: [PATCH 001/451] Update widalt.settings.js --- apps/widalt/widalt.settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/widalt/widalt.settings.js b/apps/widalt/widalt.settings.js index 57993474ea..a05934d8d9 100644 --- a/apps/widalt/widalt.settings.js +++ b/apps/widalt/widalt.settings.js @@ -1,6 +1,6 @@ (function(back) { var settings = Object.assign({ - interval: 5000, + interval: 60000, }, require('Storage').readJSON("widalt.json", true) || {}); o=Bangle.getOptions(); Bangle.getPressure().then((p)=>{ From 8c700386613ec9da01c173bbaf36224375a467ac Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Thu, 26 Jan 2023 18:18:11 +0100 Subject: [PATCH 002/451] Update app.js --- apps/contourclock/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/contourclock/app.js b/apps/contourclock/app.js index 407203e6c6..0bf34b0fd0 100644 --- a/apps/contourclock/app.js +++ b/apps/contourclock/app.js @@ -16,7 +16,7 @@ require('Storage').writeJSON("contourclock.json", settings); } require("FontTeletext10x18Ascii").add(Graphics); - let extrasShown = (!settings.hidewhenlocked) && (!Bangle.isLocked()); + let extrasShown = (!settings.hidewhenlocked) || (!Bangle.isLocked()); let installedFonts = require('Storage').readJSON("contourclock-install.json") || {}; if (installedFonts.n > 0) { //New install - check for unused font files settings.fontIndex = E.clip(settings.fontIndex, -installedFonts.n + 1, installedFonts.n - 1); From 4e6cc0961d5568d59dae15a8d7d3d24c539cf2ec Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Thu, 26 Jan 2023 18:18:55 +0100 Subject: [PATCH 003/451] Update widalt.wid.js --- apps/widalt/widalt.wid.js | 54 +++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/apps/widalt/widalt.wid.js b/apps/widalt/widalt.wid.js index dbd1a763ea..2080a4197c 100644 --- a/apps/widalt/widalt.wid.js +++ b/apps/widalt/widalt.wid.js @@ -1,38 +1,42 @@ -(()=>{ - var alt=""; - var lastAlt=0; +(() => { + var alt = ""; + var lastAlt; + var timeout; var settings = Object.assign({ - interval: 5000, + interval: 60000, }, require('Storage').readJSON("widalt.json", true) || {}); - Bangle.setBarometerPower(true,"widalt"); - Bangle.on("pressure", (p)=>{ - if (Math.floor(p.altitude)!=lastAlt) { - lastAlt=Math.floor(p.altitude); - alt=p.altitude.toFixed(0); - var w = WIDGETS["widalt"].width; - WIDGETS["widalt"].width = 1 + (alt.length)*12+16; - if (w!=WIDGETS["widalt"].width) Bangle.drawWidgets(); - else WIDGETS["widalt"].draw(); + Bangle.setBarometerPower(true, "widalt"); + Bangle.on("pressure", (p) => { + if (timeout) return; + //some other app is using the barometer - ignore new readings until our interval is up + if (Math.floor(p.altitude) != lastAlt) { + lastAlt = Math.floor(p.altitude); + nextUpdate = Date.now() + settings.interval; + alt = p.altitude.toFixed(0); + WIDGETS.widalt.draw(); } - Bangle.setBarometerPower(false,"widalt") - setTimeout(()=>{Bangle.setBarometerPower(true,"widalt");},settings.interval); + Bangle.setBarometerPower(false, "widalt"); + timeout = setTimeout(() => { + timeout = undefined; + Bangle.setBarometerPower(true, "widalt"); + }, settings.interval); }); - + function draw() { - if (!Bangle.isLCDOn()) return; + if (!Bangle.isLCDOn()) return; g.reset(); - g.setColor(g.theme.bg); - g.fillRect(this.x, this.y, this.x + this.width, this.y + 23); - g.setColor(g.theme.fg); - g.drawImage(atob("EBCBAAAAAAAIAAwgFXAX0BCYIIggTD/EYPZADkACf/4AAAAA"), this.x, this.y+4); -g.setFontCustom(atob("AAAAABwAAOAAAgAAHAADwAD4AB8AB8AA+AAeAADAAAAOAAP+AH/8B4DwMAGBgAwMAGBgAwOAOA//gD/4AD4AAAAAAAABgAAcAwDAGAwAwP/+B//wAAGAAAwAAGAAAAAAAAIAwHgOA4DwMA+BgOwMDmBg4wOeGA/gwDwGAAAAAAAAAGAHA8A4DwMAGBhAwMMGBjgwOcOA+/gDj4AAAAABgAAcAAHgADsAA5gAOMAHBgBwMAP/+B//wABgAAMAAAAAAAgD4OB/AwOYGBjAwMYGBjBwMe8Bh/AIHwAAAAAAAAAfAAP8AHxwB8GAdgwPMGBxgwMOOAB/gAH4AAAAAAABgAAMAABgAwMAeBgPgMHwBj4AN8AB+AAPAABAAAAAAAMfAH38B/xwMcGBhgwMMGBjgwP+OA+/gDj4AAAAAAAAOAAH4AA/gQMMGBgzwME8BhvAOPgA/4AD8AAEAAAAAAGAwA4OAHBwAAA="), 46, atob("BAgMDAwMDAwMDAwMBQ=="), 21+(1<<8)+(1<<16)); + g.clearRect(this.x, this.y, this.x + this.width, this.y + 23); + var w = this.width; + this.width = 1 + (alt.length) * 12 + 16; + if (w != this.width) Bangle.drawWidgets(); + g.drawImage(atob("EBCBAAAAAAAIAAwgFXAX0BCYIIggTD/EYPZADkACf/4AAAAA"), this.x, this.y + 4); + g.setFontCustom(atob("AAAAABwAAOAAAgAAHAADwAD4AB8AB8AA+AAeAADAAAAOAAP+AH/8B4DwMAGBgAwMAGBgAwOAOA//gD/4AD4AAAAAAAABgAAcAwDAGAwAwP/+B//wAAGAAAwAAGAAAAAAAAIAwHgOA4DwMA+BgOwMDmBg4wOeGA/gwDwGAAAAAAAAAGAHA8A4DwMAGBhAwMMGBjgwOcOA+/gDj4AAAAABgAAcAAHgADsAA5gAOMAHBgBwMAP/+B//wABgAAMAAAAAAAgD4OB/AwOYGBjAwMYGBjBwMe8Bh/AIHwAAAAAAAAAfAAP8AHxwB8GAdgwPMGBxgwMOOAB/gAH4AAAAAAABgAAMAABgAwMAeBgPgMHwBj4AN8AB+AAPAABAAAAAAAMfAH38B/xwMcGBhgwMMGBjgwP+OA+/gDj4AAAAAAAAOAAH4AA/gQMMGBgzwME8BhvAOPgA/4AD8AAEAAAAAAGAwA4OAHBwAAA="), 46, atob("BAgMDAwMDAwMDAwMBQ=="), 21 + (1 << 8) + (1 << 16)); g.setFontAlign(-1, 0); - g.drawString(alt, this.x+16, this.y + 12); + g.drawString(alt, this.x + 16, this.y + 12); } - WIDGETS["widalt"] = { + WIDGETS.widalt = { area: "tr", width: 6, draw: draw }; - })(); From c9fd5eebc00d1b8c53076ad982cd3a82e3be653c Mon Sep 17 00:00:00 2001 From: xxDUxx <96152564+xxDUxx@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:11:41 +0200 Subject: [PATCH 004/451] Update app.js --- apps/contourclock/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/contourclock/app.js b/apps/contourclock/app.js index 0bf34b0fd0..2e1c254694 100644 --- a/apps/contourclock/app.js +++ b/apps/contourclock/app.js @@ -45,6 +45,7 @@ }; let hideExtras = function() { if (extrasTimeout) clearTimeout(extrasTimeout); + delete extrasTimeout; g.clearRect(0, 138, g.getWidth() - 1, 176); require("widget_utils").hide(); extrasShown = false; @@ -83,6 +84,8 @@ Bangle.removeListener('twist', showExtras); if (drawTimeout) clearTimeout(drawTimeout); if (extrasTimeout) clearTimeout(extrasTimeout); + delete drawTimeout; + delete extrasTimeout; if (settings.hideWhenLocked) require("widget_utils").show(); g.reset(); g.clear(); From 2ee7c6468acc5f6bbc6a4b282842906298a63689 Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:27:46 +0200 Subject: [PATCH 005/451] elapsed_t: use the new pickers for target date and time --- apps/elapsed_t/ChangeLog | 1 + apps/elapsed_t/app.js | 254 ++++++++++++++++++++--------------- apps/elapsed_t/metadata.json | 2 +- 3 files changed, 150 insertions(+), 107 deletions(-) diff --git a/apps/elapsed_t/ChangeLog b/apps/elapsed_t/ChangeLog index 6a72c2590e..193bb2413d 100644 --- a/apps/elapsed_t/ChangeLog +++ b/apps/elapsed_t/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App! 0.02: Handle AM/PM time in the "set target" menu. Add yesterday/today/tomorrow when showing target date to improve readability. 0.03: Add option to set clock as default, handle DST in day/month/year mode +0.04: Use new pickers from more_pickers library diff --git a/apps/elapsed_t/app.js b/apps/elapsed_t/app.js index 13fbca2cda..bda8d2ef1a 100644 --- a/apps/elapsed_t/app.js +++ b/apps/elapsed_t/app.js @@ -49,17 +49,12 @@ function writeData() { require('Storage').writeJSON(APP_NAME + ".data.json", data); } -function writeSettings() { - require('Storage').writeJSON(APP_NAME + ".settings.json", settings); - temp_displaySeconds = settings.temp_displaySeconds; -} - let inMenu = false; Bangle.on('touch', function (zone, e) { if (!inMenu && e.y > 24) { if (drawTimeout) clearTimeout(drawTimeout); - E.showMenu(menu); + showMainMenu(); inMenu = true; } }); @@ -112,11 +107,11 @@ function formatDateTime(date, dateFormat, time24, showSeconds) { return formattedDateTime; } -function formatHourToAMPM(h){ +function formatHourToAMPM(h) { var ampm = (h >= 12 ? 'PM' : 'AM'); var h_ampm = h % 12; h_ampm = (h_ampm == 0 ? 12 : h_ampm); - return `${h_ampm} ${ampm}` + return `${h_ampm}\n${ampm}`; } function howManyDaysInMonth(month, year) { @@ -132,95 +127,145 @@ function handleExceedingDay() { } } -var menu = { - "": { - "title": "Set target", - back: function () { - E.showMenu(); - Bangle.setUI("clock"); - inMenu = false; - draw(); - } - }, - 'Day': { - value: data.target.D, - min: 1, max: 31, wrap: true, - onchange: v => { - data.target.D = v; - } - }, - 'Month': { - value: data.target.M, - min: 1, max: 12, noList: true, wrap: true, - onchange: v => { - data.target.M = v; - handleExceedingDay(); - } - }, - 'Year': { - value: data.target.Y, - min: 1900, max: 2100, - onchange: v => { - data.target.Y = v; - handleExceedingDay(); - } - }, - 'Hours': { - value: data.target.h, - min: 0, max: 23, wrap: true, - onchange: v => { - data.target.h = v; +function getDatePickerObject() { + switch (settings.dateFormat) { + case 0: + return { + back: showMainMenu, + title: "Date", + separator_1: "/", + separator_2: "/", + + value_1: data.target.D, + min_1: 1, max_1: 31, step_1: 1, wrap_1: true, + + value_2: data.target.M, + min_2: 1, max_2: 12, step_2: 1, wrap_2: true, + + value_3: data.target.Y, + min_3: 1900, max_3: 2100, step_3: 1, wrap_3: true, + + format_1: function (v_1) { return (pad2(v_1)); }, + format_2: function (v_2) { return (pad2(v_2)); }, + onchange: function (v_1, v_2, v_3) { data.target.D = v_1; data.target.M = v_2; data.target.Y = v_3; setTarget(true); } + }; + + case 1: + return { + back: showMainMenu, + title: "Date", + separator_1: "/", + separator_2: "/", + + value_1: data.target.M, + min_1: 1, max_1: 12, step_1: 1, wrap_1: true, + + value_2: data.target.D, + min_2: 1, max_2: 31, step_2: 1, wrap_2: true, + + value_3: data.target.Y, + min_3: 1900, max_3: 2100, step_3: 1, wrap_3: true, + + format_1: function (v_1) { return (pad2(v_1)); }, + format_2: function (v_2) { return (pad2(v_2)); }, + onchange: function (v_1, v_2, v_3) { data.target.M = v_1; data.target.D = v_2; data.target.Y = v_3; setTarget(true); } + }; + + case 2: + return { + back: showMainMenu, + title: "Date", + separator_1: "-", + separator_2: "-", + + value_1: data.target.Y, + min_1: 1900, max_1: 2100, step_1: 1, wrap_1: true, + + value_2: data.target.M, + min_2: 1, max_2: 12, step_2: 1, wrap_2: true, + + value_3: data.target.D, + min_3: 1, max_3: 31, step_3: 1, wrap_3: true, + + format_1: function (v_1) { return (pad2(v_1)); }, + format_2: function (v_2) { return (pad2(v_2)); }, + onchange: function (v_1, v_2, v_3) { data.target.Y = v_1; data.target.M = v_2; data.target.D = v_3; setTarget(true); } + }; + } +} + +function getTimePickerObject() { + var timePickerObject = { + back: showMainMenu, + title: "Time", + separator_1: ":", + separator_2: ":", + + value_1: data.target.h, + min_1: 0, max_1: 23, step_1: 1, wrap_1: true, + + value_2: data.target.m, + min_2: 0, max_2: 59, step_2: 1, wrap_2: true, + + value_3: data.target.s, + min_3: 0, max_3: 59, step_3: 1, wrap_3: true, + + format_2: function (v_2) { return (pad2(v_2)); }, + format_3: function (v_3) { return (pad2(v_3)); }, + onchange: function (v_1, v_2, v_3) { data.target.h = v_1; data.target.m = v_2; data.target.s = v_3; setTarget(true); }, + }; + + if (settings.time24) { + timePickerObject.format_1 = function (v_1) { return (pad2(v_1)); }; + } else { + timePickerObject.format_1 = function (v_1) { return (formatHourToAMPM(v_1)); }; + } + + return timePickerObject; +} + +function showMainMenu() { + E.showMenu({ + "": { + "title": "Set target", + back: function () { + E.showMenu(); + Bangle.setUI("clock"); + inMenu = false; + draw(); + } }, - format: function (v) {return(settings.time24 ? pad2(v) : formatHourToAMPM(v))} - }, - 'Minutes': { - value: data.target.m, - min: 0, max: 59, wrap: true, - onchange: v => { - data.target.m = v; + 'Date': { + value: formatDateTime(target, settings.dateFormat, settings.time24, true).date, + onchange: function () { require("more_pickers").triplePicker(getDatePickerObject()); } }, - format: function (v) { return pad2(v); } - }, - 'Seconds': { - value: data.target.s, - min: 0, max: 59, wrap: true, - onchange: v => { - data.target.s = v; + 'Time': { + value: formatDateTime(target, settings.dateFormat, settings.time24, true).time, + onchange: function () { require("more_pickers").triplePicker(getTimePickerObject()); } }, - format: function (v) { return pad2(v); } - }, - 'Save': function () { - E.showMenu(); - inMenu = false; - Bangle.setUI("clock"); - setTarget(true); - writeSettings(); - temp_displaySeconds = settings.displaySeconds; - updateQueueMillis(settings.displaySeconds); - draw(); - }, - 'Reset': function () { - E.showMenu(); - inMenu = false; - Bangle.setUI("clock"); - setTarget(false); - updateQueueMillis(settings.displaySeconds); - draw(); - }, - 'Set clock as default': function () { - setClockAsDefault(); - E.showAlert("Elapsed Time was set as default").then(function() { + 'Reset': function () { E.showMenu(); inMenu = false; Bangle.setUI("clock"); + setTarget(false); + updateQueueMillis(settings.displaySeconds); draw(); - }); - } -}; + }, + 'Set clock as default': function () { + setClockAsDefault(); + E.showAlert("Elapsed Time was set as default").then(function () { + E.showMenu(); + inMenu = false; + Bangle.setUI("clock"); + draw(); + }); + } + }); +} -function setClockAsDefault(){ +function setClockAsDefault() { let storage = require('Storage'); - let settings = storage.readJSON('setting.json',true)||{clock:null}; + let settings = storage.readJSON('setting.json', true) || { clock: null }; settings.clock = "elapsed_t.app.js"; storage.writeJSON('setting.json', settings); } @@ -238,26 +283,21 @@ function setTarget(set) { data.target.isSet = true; } else { target = new Date(); + target.setSeconds(0); Object.assign( data, { target: { isSet: false, - Y: now.getFullYear(), - M: now.getMonth() + 1, // Month is zero-based, so add 1 - D: now.getDate(), - h: now.getHours(), - m: now.getMinutes(), + Y: target.getFullYear(), + M: target.getMonth() + 1, // Month is zero-based, so add 1 + D: target.getDate(), + h: target.getHours(), + m: target.getMinutes(), s: 0 } } ); - menu.Day.value = data.target.D; - menu.Month.value = data.target.M; - menu.Year.value = data.target.Y; - menu.Hours.value = data.target.h; - menu.Minutes.value = data.target.m; - menu.Seconds.value = 0; } writeData(); @@ -269,7 +309,6 @@ setTarget(data.target.isSet); var drawTimeout; var queueMillis = 1000; - function queueDraw() { if (drawTimeout) clearTimeout(drawTimeout); var delay = queueMillis - (Date.now() % queueMillis); @@ -335,18 +374,21 @@ function diffToTarget() { var end; if (now > target) { - start = target; - end = now; + start = new Date(target.getTime()); + end = new Date(now.getTime()); } else { - start = now; - end = target; + start = new Date(now.getTime()); + end = new Date(target.getTime()); } + // Adjust for DST + end.setMinutes(end.getMinutes() + end.getTimezoneOffset() - start.getTimezoneOffset()); + diff.Y = end.getFullYear() - start.getFullYear(); diff.M = end.getMonth() - start.getMonth(); diff.D = end.getDate() - start.getDate(); diff.hh = end.getHours() - start.getHours(); - diff.mm = end.getMinutes() - start.getMinutes() + end.getTimezoneOffset() - start.getTimezoneOffset(); + diff.mm = end.getMinutes() - start.getMinutes(); diff.ss = end.getSeconds() - start.getSeconds(); // Adjust negative differences @@ -372,7 +414,6 @@ function diffToTarget() { diff.Y--; } - } else { var timeDifference = target - now; timeDifference = Math.abs(timeDifference); @@ -492,3 +533,4 @@ Bangle.drawWidgets(); Bangle.setUI("clock"); draw(); + diff --git a/apps/elapsed_t/metadata.json b/apps/elapsed_t/metadata.json index fa0674e0ba..2515e0e799 100644 --- a/apps/elapsed_t/metadata.json +++ b/apps/elapsed_t/metadata.json @@ -3,7 +3,7 @@ "name": "Elapsed Time Clock", "shortName": "Elapsed Time", "type": "clock", - "version":"0.03", + "version":"0.04", "description": "A clock that calculates the time difference between now and any given target date.", "tags": "clock,tool", "supports": ["BANGLEJS2"], From 81fd82926f94211be7a7b669dbdcaa5d3dc70a8e Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:16:55 +0200 Subject: [PATCH 006/451] fix bug preventing to not show seconds when locked --- apps/elapsed_t/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/elapsed_t/app.js b/apps/elapsed_t/app.js index bda8d2ef1a..246ae44659 100644 --- a/apps/elapsed_t/app.js +++ b/apps/elapsed_t/app.js @@ -532,5 +532,11 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); Bangle.setUI("clock"); +if (Bangle.isBacklightOn()) { + temp_displaySeconds = settings.displaySeconds; + updateQueueMillis(temp_displaySeconds); +} else { + temp_displaySeconds = false; + updateQueueMillis(false); +} draw(); - From 03f1f8cda0e67c561bc8102ff8cda90734a3b3a8 Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:54:16 +0200 Subject: [PATCH 007/451] elapsed_t: add setting to show seconds never/unlocked/always --- apps/elapsed_t/ChangeLog | 2 +- apps/elapsed_t/app.js | 48 +++++++++++++++----------------------- apps/elapsed_t/settings.js | 9 ++++--- 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/apps/elapsed_t/ChangeLog b/apps/elapsed_t/ChangeLog index 193bb2413d..26fbf5ff02 100644 --- a/apps/elapsed_t/ChangeLog +++ b/apps/elapsed_t/ChangeLog @@ -1,4 +1,4 @@ 0.01: New App! 0.02: Handle AM/PM time in the "set target" menu. Add yesterday/today/tomorrow when showing target date to improve readability. 0.03: Add option to set clock as default, handle DST in day/month/year mode -0.04: Use new pickers from more_pickers library +0.04: Use new pickers from the more_pickers library, add settings to display seconds never/unlocked/always diff --git a/apps/elapsed_t/app.js b/apps/elapsed_t/app.js index 246ae44659..08e2e145f7 100644 --- a/apps/elapsed_t/app.js +++ b/apps/elapsed_t/app.js @@ -24,14 +24,12 @@ var now = new Date(); var settings = Object.assign({ // default values - displaySeconds: true, + displaySeconds: 1, displayMonthsYears: true, dateFormat: 0, time24: true }, require('Storage').readJSON(APP_NAME + ".settings.json", true) || {}); -var temp_displaySeconds = settings.displaySeconds; - var data = Object.assign({ // default values target: { @@ -118,15 +116,6 @@ function howManyDaysInMonth(month, year) { return new Date(year, month, 0).getDate(); } -function handleExceedingDay() { - var maxDays = howManyDaysInMonth(data.target.M, data.target.Y); - menu.Day.max = maxDays; - if (data.target.D > maxDays) { - menu.Day.value = maxDays; - data.target.D = maxDays; - } -} - function getDatePickerObject() { switch (settings.dateFormat) { case 0: @@ -248,7 +237,6 @@ function showMainMenu() { inMenu = false; Bangle.setUI("clock"); setTarget(false); - updateQueueMillis(settings.displaySeconds); draw(); }, 'Set clock as default': function () { @@ -307,7 +295,8 @@ var target; setTarget(data.target.isSet); var drawTimeout; -var queueMillis = 1000; +var temp_displaySeconds; +var queueMillis; function queueDraw() { if (drawTimeout) clearTimeout(drawTimeout); @@ -322,27 +311,25 @@ function queueDraw() { }, delay); } -function updateQueueMillis(displaySeconds) { +function updateQueueMillisAndDraw(displaySeconds) { + temp_displaySeconds = displaySeconds; if (displaySeconds) { queueMillis = 1000; } else { queueMillis = 60000; } + draw(); } Bangle.on('lock', function (on, reason) { - if (inMenu) { // if already in a menu, nothing to do + if (inMenu || settings.displaySeconds == 0 || settings.displaySeconds == 2) { // if already in a menu, or always/never show seconds, nothing to do return; } if (on) { // screen is locked - temp_displaySeconds = false; - updateQueueMillis(false); - draw(); + updateQueueMillisAndDraw(false); } else { // screen is unlocked - temp_displaySeconds = settings.displaySeconds; - updateQueueMillis(temp_displaySeconds); - draw(); + updateQueueMillisAndDraw(true); } }); @@ -532,11 +519,14 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); Bangle.setUI("clock"); -if (Bangle.isBacklightOn()) { - temp_displaySeconds = settings.displaySeconds; - updateQueueMillis(temp_displaySeconds); -} else { - temp_displaySeconds = false; - updateQueueMillis(false); +switch (settings.displaySeconds) { + case 0: // never + updateQueueMillisAndDraw(false); + break; + case 1: // unlocked + updateQueueMillisAndDraw(Bangle.isBacklightOn()); + break; + case 2: // always + updateQueueMillisAndDraw(true); + break; } -draw(); diff --git a/apps/elapsed_t/settings.js b/apps/elapsed_t/settings.js index d3a7cb3572..9b405986f0 100644 --- a/apps/elapsed_t/settings.js +++ b/apps/elapsed_t/settings.js @@ -4,7 +4,7 @@ // Load settings var settings = Object.assign({ // default values - displaySeconds: true, + displaySeconds: 1, displayMonthsYears: true, dateFormat: 0, time24: true @@ -15,17 +15,20 @@ } var dateFormats = ["DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD"]; + var displaySecondsFormats = ["Never", "Unlocked", "Always"]; // Show the menu E.showMenu({ "" : { "title" : "Elapsed Time" }, "< Back" : () => back(), 'Show\nseconds': { - value: !!settings.displaySeconds, + value: settings.displaySeconds, + min: 0, max: 2, wrap: true, onchange: v => { settings.displaySeconds = v; writeSettings(); - } + }, + format: function (v) {return displaySecondsFormats[v];} }, 'Show months/\nyears': { value: !!settings.displayMonthsYears, From e5c82c43415a826c0a3fbbbebdd434778a09f06a Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Sun, 23 Jun 2024 23:03:59 +0200 Subject: [PATCH 008/451] elapsed_t: ensure retro compatibility with the previous displaySeconds setting --- apps/elapsed_t/app.js | 9 +++++++++ apps/elapsed_t/settings.js | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/apps/elapsed_t/app.js b/apps/elapsed_t/app.js index 08e2e145f7..29bea4fef1 100644 --- a/apps/elapsed_t/app.js +++ b/apps/elapsed_t/app.js @@ -30,6 +30,15 @@ var settings = Object.assign({ time24: true }, require('Storage').readJSON(APP_NAME + ".settings.json", true) || {}); +function writeSettings() { + require('Storage').writeJSON(APP_NAME + ".settings.json", settings); +} + +if (typeof settings.displaySeconds === 'boolean') { + settings.displaySeconds = 1; + writeSettings(); +} + var data = Object.assign({ // default values target: { diff --git a/apps/elapsed_t/settings.js b/apps/elapsed_t/settings.js index 9b405986f0..4726516d50 100644 --- a/apps/elapsed_t/settings.js +++ b/apps/elapsed_t/settings.js @@ -14,6 +14,11 @@ require('Storage').writeJSON(FILE, settings); } + if (typeof settings.displaySeconds === 'boolean') { + settings.displaySeconds = 1; + writeSettings(); + } + var dateFormats = ["DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD"]; var displaySecondsFormats = ["Never", "Unlocked", "Always"]; From e984cb18c0ce0553d9528e9b38cf6860eb319ac4 Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Sun, 23 Jun 2024 23:05:44 +0200 Subject: [PATCH 009/451] elapsed_t: update readme --- apps/elapsed_t/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/elapsed_t/README.md b/apps/elapsed_t/README.md index dc2173409b..9e361be59b 100644 --- a/apps/elapsed_t/README.md +++ b/apps/elapsed_t/README.md @@ -1,7 +1,10 @@ # Elapsed Time Clock A clock that calculates the time difference between now (in blue/cyan) and any given target date (in red/orange). -The results is show in years, months, days, hours, minutes, seconds. To save battery life, the seconds are shown only when the watch is unlocked, or can be disabled entirely. +The results is show in years, months, days, hours, minutes, seconds. The seconds can be shown: +- always +- when the watch is unlocked +- never. The time difference is positive if the target date is in the past and negative if it is in the future. From b0ffab457dda73faa0ea39abe18b38733f25473b Mon Sep 17 00:00:00 2001 From: Brian Whelan Date: Mon, 15 Jul 2024 22:57:29 +0100 Subject: [PATCH 010/451] Add support for replying to messages to messagegui --- apps/messagegui/ChangeLog | 1 + apps/messagegui/app.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index 7320d8ec64..bb3ac519e9 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -106,3 +106,4 @@ 0.77: Messages can now use international fonts if they are installed 0.78: Fix: When user taps on a new message, clear the unread timeout 0.79: Fix: Reset the unread timeout each time a new message is shown. When the message is read from user input, do not set an unread timeout. +0.80: Add ability to reply to messages if a reply library is installed and the message can be replied to \ No newline at end of file diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 9172bcad71..663e9a028b 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -24,6 +24,7 @@ require("messages").pushMessage({"t":"add","id":"call","src":"Phone","title":"Bo var Layout = require("Layout"); var layout; // global var containing the layout for the currently displayed message var settings = require('Storage').readJSON("messages.settings.json", true) || {}; +var reply = require("reply"); var fontSmall = "6x8"; var fontMedium = g.getFonts().includes("6x15")?"6x15":"6x8:2"; var fontBig = g.getFonts().includes("12x20")?"12x20":"6x8:2"; @@ -45,6 +46,7 @@ if (Graphics.prototype.setFontIntl) { var active; // active screen (undefined/"list"/"music"/"map"/"message"/"scroller"/"settings") var openMusic = false; // go back to music screen after we handle something else? +var replying = false; // If we're replying to a message, don't interrupt // hack for 2v10 firmware's lack of ':size' font handling try { g.setFont("6x8:2"); @@ -267,11 +269,27 @@ function showMessageSettings(msg) { /*LANG*/"View Message" : () => { showMessageScroller(msg); }, + /*LANG*/"Reply": () => { + replying = true; + reply.reply({msg: msg}) + .then(result => { + Bluetooth.println(JSON.stringify(result)); + replying = false; + showMessage(msg.id); + }) + .catch(() => { + replying = false; + showMessage(msg.id); + }); + }, /*LANG*/"Delete" : () => { MESSAGES = MESSAGES.filter(m=>m.id!=msg.id); checkMessages({clockIfNoMsg:0,clockIfAllRead:0,showMsgIfUnread:0,openMusic:0}); }, }; + + if (!msg.reply || !reply) delete menu[/*LANG*/"Reply"]; + if (Bangle.messageIgnore && msg.src) menu[/*LANG*/"Ignore"] = () => { E.showPrompt(/*LANG*/"Ignore all messages from "+E.toJS(msg.src)+"?", {title:/*LANG*/"Ignore"}).then(isYes => { From 3bb1f7be5588223120799c71f1aaf14029115596 Mon Sep 17 00:00:00 2001 From: Brian Whelan Date: Mon, 15 Jul 2024 23:00:27 +0100 Subject: [PATCH 011/451] Bump messagegui version to 0.80 --- apps/messagegui/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 83056fc0c9..05ec18fa27 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.79", + "version": "0.80", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app", From a9fa2fb679285b40cbc10054852e769e6b4e5282 Mon Sep 17 00:00:00 2001 From: Brian Whelan Date: Mon, 15 Jul 2024 23:02:34 +0100 Subject: [PATCH 012/451] Don't showMessage if replying to a message --- apps/messagegui/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 663e9a028b..03f0013977 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -323,6 +323,7 @@ function showMessageSettings(msg) { } function showMessage(msgid, persist) { + if (replying) { return; } if(!persist) resetReloadTimeout(); let idx = MESSAGES.findIndex(m=>m.id==msgid); var msg = MESSAGES[idx]; From dc8a475474f51d5ed3e2a015fe533c4a5199b0f7 Mon Sep 17 00:00:00 2001 From: Brian Whelan Date: Mon, 15 Jul 2024 23:19:43 +0100 Subject: [PATCH 013/451] Require reply lib --- apps/messagegui/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 05ec18fa27..1e6913aac4 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -8,7 +8,7 @@ "type": "app", "tags": "tool,system", "supports": ["BANGLEJS","BANGLEJS2"], - "dependencies" : { "messageicons":"module" }, + "dependencies" : { "messageicons":"module", "reply": "module" }, "provides_modules": ["messagegui"], "default": true, "readme": "README.md", From 81fdfc9f090463c67e4b3e15f13639ccebbb984f Mon Sep 17 00:00:00 2001 From: Brian Whelan Date: Wed, 24 Jul 2024 22:36:40 +0100 Subject: [PATCH 014/451] Add swipe right to reply and PR fixes --- apps/messagegui/app.js | 42 ++++++++++++++++++++++++++++++---------- apps/reply/ChangeLog | 3 ++- apps/reply/lib.js | 21 ++++++++++++++------ apps/reply/metadata.json | 2 +- 4 files changed, 50 insertions(+), 18 deletions(-) diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 03f0013977..3b03adeaff 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -24,7 +24,8 @@ require("messages").pushMessage({"t":"add","id":"call","src":"Phone","title":"Bo var Layout = require("Layout"); var layout; // global var containing the layout for the currently displayed message var settings = require('Storage').readJSON("messages.settings.json", true) || {}; -var reply = require("reply"); +var reply; +try { reply = require("reply"); } catch (e) {} var fontSmall = "6x8"; var fontMedium = g.getFonts().includes("6x15")?"6x15":"6x8:2"; var fontBig = g.getFonts().includes("12x20")?"12x20":"6x8:2"; @@ -269,7 +270,10 @@ function showMessageSettings(msg) { /*LANG*/"View Message" : () => { showMessageScroller(msg); }, - /*LANG*/"Reply": () => { + }; + + if (msg.reply && reply) { + menu[/*LANG*/"Reply"] = () => { replying = true; reply.reply({msg: msg}) .then(result => { @@ -281,14 +285,15 @@ function showMessageSettings(msg) { replying = false; showMessage(msg.id); }); - }, + }; + } + + menu = Object.assign(menu, { /*LANG*/"Delete" : () => { MESSAGES = MESSAGES.filter(m=>m.id!=msg.id); checkMessages({clockIfNoMsg:0,clockIfAllRead:0,showMsgIfUnread:0,openMusic:0}); }, - }; - - if (!msg.reply || !reply) delete menu[/*LANG*/"Reply"]; + }); if (Bangle.messageIgnore && msg.src) menu[/*LANG*/"Ignore"] = () => { @@ -393,15 +398,32 @@ function showMessage(msgid, persist) { }; footer.push({type:"img",src:atob("PhAB4A8AAAAAAAPAfAMAAAAAD4PwHAAAAAA/H4DwAAAAAH78B8AAAAAA/+A/AAAAAAH/Af//////w/gP//////8P4D///////H/Af//////z/4D8AAAAAB+/AfAAAAAA/H4DwAAAAAPg/AcAAAAADwHwDAAAAAA4A8AAAAAAAA=="),col:"#f00",cb:negHandler}); } footer.push({fillx:1}); // push images to left/right - if (msg.positive) { + if (msg.reply && reply) { + posHandler = ()=>{ + replying = true; + msg.new = false; + cancelReloadTimeout(); // don't auto-reload to clock now + reply.reply({msg: msg}) + .then(result => { + Bluetooth.println(JSON.stringify(result)); + replying = false; + layout.render(); + checkMessages({clockIfNoMsg:1,clockIfAllRead:1,showMsgIfUnread:1,openMusic:openMusic}); + }) + .catch(() => { + replying = false; + layout.render(); + showMessage(msg.id); + }); + }; footer.push({type:"img",src:atob("QRABAAAAAAAH//+AAAAABgP//8AAAAADgf//4AAAAAHg4ABwAAAAAPh8APgAAAAAfj+B////////geHv///////hf+f///////GPw///////8cGBwAAAAAPx/gDgAAAAAfD/gHAAAAAA8DngOAAAAABwDHP8AAAAADACGf4AAAAAAAAM/w=="),col:"#0f0", cb:posHandler}); + } + else if (msg.positive) { posHandler = ()=>{ msg.new = false; cancelReloadTimeout(); // don't auto-reload to clock now Bangle.messageResponse(msg,true); checkMessages({clockIfNoMsg:1,clockIfAllRead:1,showMsgIfUnread:1,openMusic:openMusic}); - }; - footer.push({type:"img",src:atob("QRABAAAAAAAAAAOAAAAABgAAA8AAAAADgAAD4AAAAAHgAAPgAAAAAPgAA+AAAAAAfgAD4///////gAPh///////gA+D///////AD4H//////8cPgAAAAAAPw8+AAAAAAAfB/4AAAAAAA8B/gAAAAAABwB+AAAAAAADAB4AAAAAAAAABgAA=="),col:"#0f0",cb:posHandler}); - + }; footer.push({type:"img",src:atob("QRABAAAAAAAAAAOAAAAABgAAA8AAAAADgAAD4AAAAAHgAAPgAAAAAPgAA+AAAAAAfgAD4///////gAPh///////gA+D///////AD4H//////8cPgAAAAAAPw8+AAAAAAAfB/4AAAAAAA8B/gAAAAAABwB+AAAAAAADAB4AAAAAAAAABgAA=="),col:"#0f0",cb:posHandler}); } layout = new Layout({ type:"v", c: [ diff --git a/apps/reply/ChangeLog b/apps/reply/ChangeLog index f3c7b0d2c3..a5a65b1162 100644 --- a/apps/reply/ChangeLog +++ b/apps/reply/ChangeLog @@ -1 +1,2 @@ -0.01: New Library! \ No newline at end of file +0.01: New Library! +0.02: Minor bug fixes \ No newline at end of file diff --git a/apps/reply/lib.js b/apps/reply/lib.js index 4a040c557a..cdf394bb4a 100644 --- a/apps/reply/lib.js +++ b/apps/reply/lib.js @@ -6,7 +6,12 @@ exports.reply = function (options) { keyboard = null; } - function constructReply(msg, replyText, resolve) { + function constructReply(msg, replyText, resolve, reject) { + if (!replyText) { + reject(""); + return; + } + var responseMessage = {msg: replyText}; if (msg.id) { responseMessage = { t: "notify", id: msg.id, n: "REPLY", msg: replyText }; @@ -29,7 +34,10 @@ exports.reply = function (options) { }, // options /*LANG*/ "Compose": function () { keyboard.input().then((result) => { - constructReply(options.msg ?? {}, result, resolve); + if (result) + constructReply(options.msg ?? {}, result, resolve, reject); + else + E.showMenu(menu); }); }, }; @@ -40,7 +48,7 @@ exports.reply = function (options) { ) || []; replies.forEach((reply) => { menu = Object.defineProperty(menu, reply.text, { - value: () => constructReply(options.msg ?? {}, reply.text, resolve), + value: () => constructReply(options.msg ?? {}, reply.text, resolve, reject), }); }); if (!keyboard) delete menu[/*LANG*/ "Compose"]; @@ -60,10 +68,11 @@ exports.reply = function (options) { ); } else { keyboard.input().then((result) => { - constructReply(options.msg.id, result, resolve); + constructReply(options.msg, result, resolve, reject); }); } + } else{ + E.showMenu(menu); } - E.showMenu(menu); }); -}; +}; \ No newline at end of file diff --git a/apps/reply/metadata.json b/apps/reply/metadata.json index 34843edd44..c028ed0539 100644 --- a/apps/reply/metadata.json +++ b/apps/reply/metadata.json @@ -1,6 +1,6 @@ { "id": "reply", "name": "Reply Library", - "version": "0.01", + "version": "0.02", "description": "A library for replying to text messages via predefined responses or keyboard", "icon": "app.png", "type": "module", From 10b2e9e8dd06e74110bc51013d6a32e849c0f20e Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 15 Aug 2024 17:13:58 +0200 Subject: [PATCH 015/451] Only return meridian for 12-hour clocks --- apps/locale/locale.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/locale/locale.html b/apps/locale/locale.html index 8ec818aaea..4e1f954d89 100644 --- a/apps/locale/locale.html +++ b/apps/locale/locale.html @@ -204,11 +204,14 @@ var p = Math.max(0,Math.min(dp,dp - Math.floor(Math.log(n)/Math.log(10)))); return n.toFixed(p); } -var is12; +var _is12Hours; +function is12Hours() { + if (_is12Hours === undefined) _is12Hours = ${isLocal ? "false" : `(require('Storage').readJSON('setting.json', 1) || {})["12hour"]`}; + return _is12Hours; +} function getHours(d) { var h = d.getHours(); - if (is12 === undefined) is12 = ${isLocal ? "false" : `(require('Storage').readJSON('setting.json', 1) || {})["12hour"]`}; - if (!is12) return ('0' + h).slice(-2); + if (!is12Hours()) return ('0' + h).slice(-2); return ((h % 12 == 0) ? 12 : h % 12).toString(); } exports = { @@ -237,7 +240,7 @@ translate: s => ${locale.trans?`{var t=${js(locale.trans)};s=''+s;return t[s]||t[s.toLowerCase()]||s;}`:`s`}, date: (d,short) => short ? \`${dateS}\` : \`${dateN}\`, time: (d,short) => short ? \`${timeS}\` : \`${timeN}\`, - meridian: d => d.getHours() < 12 ? ${js(locale.ampm[0])}:${js(locale.ampm[1])}, + meridian: d => is12Hours() ? d.getHours() < 12 ? ${js(locale.ampm[0])}:${js(locale.ampm[1])} : "", }; `.trim() }; From 332d3ca3362ab51f3f800758da8bdf6bb79a1d2f Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 15 Aug 2024 17:14:17 +0200 Subject: [PATCH 016/451] Add `is12Hour` function to locale --- apps/locale/locale.html | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/locale/locale.html b/apps/locale/locale.html index 4e1f954d89..ae8cd82045 100644 --- a/apps/locale/locale.html +++ b/apps/locale/locale.html @@ -241,6 +241,7 @@ date: (d,short) => short ? \`${dateS}\` : \`${dateN}\`, time: (d,short) => short ? \`${timeS}\` : \`${timeN}\`, meridian: d => is12Hours() ? d.getHours() < 12 ? ${js(locale.ampm[0])}:${js(locale.ampm[1])} : "", + is12Hours, }; `.trim() }; From f1453c5b8101de21970a9efbc011d331f09f3350 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 19 Aug 2024 13:51:28 -0400 Subject: [PATCH 017/451] Added OpenLocate Beacon app --- apps/openlocatebeacon/ChangeLog | 1 + apps/openlocatebeacon/README.md | 28 ++++ apps/openlocatebeacon/metadata.json | 19 +++ .../openlocatebeacon/openlocatebeacon-icon.js | 1 + apps/openlocatebeacon/openlocatebeacon.js | 123 ++++++++++++++++++ apps/openlocatebeacon/openlocatebeacon.png | Bin 0 -> 1977 bytes 6 files changed, 172 insertions(+) create mode 100644 apps/openlocatebeacon/ChangeLog create mode 100644 apps/openlocatebeacon/README.md create mode 100644 apps/openlocatebeacon/metadata.json create mode 100644 apps/openlocatebeacon/openlocatebeacon-icon.js create mode 100644 apps/openlocatebeacon/openlocatebeacon.js create mode 100644 apps/openlocatebeacon/openlocatebeacon.png diff --git a/apps/openlocatebeacon/ChangeLog b/apps/openlocatebeacon/ChangeLog new file mode 100644 index 0000000000..5560f00bce --- /dev/null +++ b/apps/openlocatebeacon/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/openlocatebeacon/README.md b/apps/openlocatebeacon/README.md new file mode 100644 index 0000000000..ef4d20a216 --- /dev/null +++ b/apps/openlocatebeacon/README.md @@ -0,0 +1,28 @@ +# OpenLocate Beacon + +Collect geolocation sensor data from the Bangle.js 2's GPS and barometer, display the live readings on-screen, and broadcast in Bluetooth Low Energy (BLE) OpenLocate Beacon packets (LCI over BLE) to any listening devices in range. + + +## Usage + +The advertising packets will be recognised by [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere/) open source middleware and any other program which observes the standard packet types. See our [Bangle.js Development Guide](https://reelyactive.github.io/diy/banglejs-dev/) for details. + + +## Features + +Advertises packets with the OpenLocate Beacon geolocation element when a GPS fix is available, and packets with the name "Bangle.js" otherwise. + + +## Controls + +None. + + +## Requests + +[Contact reelyActive](https://www.reelyactive.com/contact/) for support/updates. + + +## Creator + +Developed by [jeffyactive](https://github.com/jeffyactive) of [reelyActive](https://www.reelyactive.com) diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json new file mode 100644 index 0000000000..87e38f9852 --- /dev/null +++ b/apps/openlocatebeacon/metadata.json @@ -0,0 +1,19 @@ +{ + "id": "openlocatebeacon", + "name": "OpenLocate Beacon", + "shortName": "OpenLocale Beacon", + "version": "0.01", + "description": "Advertise GPS geolocation date using the OpenLocate Beacon packet specification.", + "icon": "openlocatebeacon.png", + "screenshots": [], + "type": "app", + "tags": "tool,sensors,bluetooth", + "supports" : [ "BANGLEJS2" ], + "allow_emulator": true, + "readme": "README.md", + "storage": [ + { "name": "openlocatebeacon.app.js", "url": "openlocatebeacon.js" }, + { "name": "openlocatebeacon.img", "url": "openlocatebeacon-icon.js", + "evaluate": true } + ] +} \ No newline at end of file diff --git a/apps/openlocatebeacon/openlocatebeacon-icon.js b/apps/openlocatebeacon/openlocatebeacon-icon.js new file mode 100644 index 0000000000..7e838aaa04 --- /dev/null +++ b/apps/openlocatebeacon/openlocatebeacon-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwhHXAB+sr1dnMzmcPh4DBnNdr2sDyAsOropCABczroyaxE5FhoAFnOIFqutFqgxE1ouSrwdHnWIxGz2YPBAYIHBnQTHrwuQLgwsBURwyGnIWN2bmFnR4S1oxFmZyCFx0zLY2r0md4AACzuk1ZjGDoowKCAk6JwuBFggAFzuBOApiEmYuIBwjSE2ddvOcFxIABzl5rpWErxQJN4QuIPIN5FpYADvKlFGAivGHZAuSGBCDEFwg6EOoZnBFyQwCK4mzQg4IECIYuBqzqKehVWDwxWFLwc5M4czLxPB5HP5/I4JgJmYfDnJgFEwJeFG4MyLw4tB6wPB6wxBMA8yRAhgDHAOtY44FBq2cFw3Qa4nX6AwGziQBEIwAB1o1DHoyOG4PPFwoAB56SGSAKBGA4SVDBgc6AwKOG45eGMAXHSAwbBnSQGnIvD1psFF43IXgQAF6yQGF4SQDXQczdwezF5pfJF5uzF4bED1gACF5KPSKoMzEY0PgAAJuQdFMAIvH5wQGuQkKABVOzhgG57BE63PLw2cpwvVkgvGGAPI5/Q6HP5AuGF4MkF6pgIAAPB4/H4ILHLxsrMBbBHABlyLxcrF5ZgKABJeOqyRMMCVyEBlWwLyNywuPyzsNwPXeS6NTAAPX67AMSKCNNXwIvBSBqRBGBlyRpqOCAAIRNSJiNPRwQABqwwPF5IuPqwvD1gUOSJKNPgGsF4bBPgEqSI2clQYOXoYADlbCUXiErFwyRQgCREuQVPRoqRTkmWFwOWXh6NHGCaRBRqAuLGCIAQFxowgFx70ClYtZlbqJMUZcRAA1WFqdWFq5jESp0rLbAyJq0rGggFBqwsSA==")) \ No newline at end of file diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js new file mode 100644 index 0000000000..fe24201738 --- /dev/null +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -0,0 +1,123 @@ +/** + * Copyright reelyActive 2024 + * We believe in an open Internet of Things + */ + + +// Non-user-configurable constants +const APP_ID = 'openlocatebeacon'; +const ADVERTISING_OPTIONS = { showName: false, interval: 5000 }; + + +// Global variables +let bar, gps; +let sequenceNumber = 0; + + +// Menus +let mainMenu = { + "": { "title": "OpenLocateBeacon" }, + "Lat": { value: null }, + "Lon": { value: null }, + "Altitude": { value: null }, + "Satellites": { value: null }, + "HDOP": { value: null } +}; + + +// Encode the OpenLocate geo location element advertising packet +function encodeGeoLocationElement() { + let lci = new Uint8Array(16); + let seqFrag = ((sequenceNumber++ & 0x0f) << 4) + 0x01; + let rfc6225lat = toRfc6225Coordinate(gps.lat); + let rfc6225lon = toRfc6225Coordinate(gps.lon); + let rfc6225alt = toRfc6225Coordinate(bar.altitude); + lci[0] = rfc6225lat.integer >> 7; + lci[1] = ((rfc6225lat.integer & 0xff) << 1) + (rfc6225lat.fraction >> 24); + lci[2] = (rfc6225lat.fraction >> 16) & 0xff; + lci[3] = (rfc6225lat.fraction >> 8) & 0xff; + lci[4] = rfc6225lat.fraction & 0xff; + lci[5] = rfc6225lon.integer >> 7; + lci[6] = ((rfc6225lon.integer & 0xff) << 1) + (rfc6225lon.fraction >> 24); + lci[7] = (rfc6225lon.fraction >> 16) & 0xff; + lci[8] = (rfc6225lon.fraction >> 8) & 0xff; + lci[9] = rfc6225lon.fraction & 0xff; + lci[10] = Number.isFinite(bar.altitude) ? 0x10 : 0x00; + lci[11] = (rfc6225alt.integer >> 16) & 0xff; + lci[12] = (rfc6225alt.integer >> 8) & 0xff; + lci[13] = rfc6225alt.integer & 0xff; + lci[14] = rfc6225alt.fraction & 0xff; + lci[15] = 0x41; + + return [ + 0x02, 0x01, 0x06, // Flags + 0x16, 0x16, 0x94, 0xfd, 0x09, seqFrag, 0x30, lci[0], lci[1], lci[2], + lci[3], lci[4], lci[5], lci[6], lci[7], lci[8], lci[9], lci[10], lci[11], + lci[12], lci[13], lci[14], lci[15] + ]; +} + + +// Convert a latitude or longitude coordinate to RFC6225 +function toRfc6225Coordinate(coordinate) { + let integer = Math.floor(coordinate); + let fraction = Math.round((coordinate - integer) * 0x1ffffff); + + if(integer < 0) { + integer += 0x1ff + 1; + } + + return { integer: integer, fraction: fraction }; +} + + +// Convert altitude to RFC6225 +function toRfc6225Altitude(altitude) { + if(!Number.isFinite(altitude)) { + return { integer: 0, fraction: 0 }; + } + + let integer = Math.floor(altitude); + let fraction = Math.round((altitude - integer) * 0xff); + + if(integer < 0) { + integer += 0x3fffff + 1; + } + + return { integer: integer, fraction: fraction }; +} + + +// Update barometer +Bangle.on('pressure', (newBar) => { + bar = newBar; + + mainMenu.Altitude.value = bar.altitude.toFixed(1) + 'm'; + E.showMenu(mainMenu); +}); + + +// Update GPS +Bangle.on('GPS', (newGps) => { + gps = newGps; + + mainMenu.Lat.value = gps.lat.toFixed(4); + mainMenu.Lon.value = gps.lon.toFixed(4); + mainMenu.Satellites.value = gps.satellites; + mainMenu.HDOP.value = (gps.hdop * 5).toFixed(1) + 'm'; + E.showMenu(gpsMenu); + + if(Number.isFinite(gps.lat) && Number.isFinite(gps.lon)) { + NRF.setAdvertising(encodeGeoLocationElement(), ADVERTISING_OPTIONS); + } + else { + NRF.setAdvertising({}, { name:"Bangle.js" }); + } +}); + + +// On start: enable sensors and display main menu +g.clear(); +Bangle.setGPSPower(true, APP_ID); +Bangle.setBarometerPower(true, APP_ID); +E.showMenu(mainMenu); \ No newline at end of file diff --git a/apps/openlocatebeacon/openlocatebeacon.png b/apps/openlocatebeacon/openlocatebeacon.png new file mode 100644 index 0000000000000000000000000000000000000000..b3294dae03285aa269545fe5b267ea6f357cc32a GIT binary patch literal 1977 zcmV;q2S)gbP)f7_p*YaLP86U;HN2;H3qFl1<^M+g?mBSd_c_)VV)srv@-O;2Os(Yhp5Y z3`xmX?6uUx$$8NkMaL>@sFrJJ3S>H2F?xmdG5og*{~#YCRM#0i1gfZQd@A*SMX|3@ z@8?61dN{&mpu3&s#Qb9a#La5mdy}?AeR1%;z2)1>FI8Q=@kdij`<=TeT;LXim;wPb zbuR=H@{U5B`gOs1pr)JcV^$Wb<(|pdZz`*4ZttKC&Hx(7lQQvBCa=mrn5{G>>XxZ0A<#YqL-E291 zu<*!7G3Sy-G#mWQdLI-naC>y+E2j?>+-#+05P_7v@_>a~U`J>Uftp&|$*#r&zuMep z&-vwY{U_>VR?Nr=NZRvVCtu^DVN1Lz44h zYR_>96qT{Zo*ld8#2veT-^Ioj{W{ZHFKJB`0=B^y-!W0Ogfvo=`zoxN8ia-#u z_AXP_?3T0KKG2%O752QC+++58VaJ(EPrs99GDcq4^^}jqeSrq@Hsk0C3)0Xor63D& zd#{Wmwj;_KsP0Bv;M=xcI{vf09d|n=3EOz+{PZoxasTLgxOp(@0vRn^jbqUc5h)09 zSV+5oq|FGROj!fP<{XyO{T7>WqR8geN6rS$->}N~{55@mS7~G>G@>0Mkdm^n=)1@y zO=CA6QpQCfY`>lfwgwu9UjaSgwBvB9OA*uvsV0OH%|; zP5}|<-J%jX5&Gdy`A5Fqc6&f_!Ts@HZZeE-(REilaYS4?gl~-DyO)c~c~#sx%Z>fG z*)R@L5WI2Adal9soP%ZqG*G5U%=h^9fUpU$g~@(zbnO59c#^Q`HVtYZ*?6a*m)afJ>$n92YM!&dAT zk3p&EoMNdg7kGnVVwD#?2`^E+j5kKqZk!IuWgjN%tdB$)zJAUL)_1X7A7#3dJ|GQe}I3fZH}ZJ#@M zVv=`%*ONT{)?+jcDt9iguasnp`YN6qOIvgdQi>+TCAZ|F?LRXtC65I!u^k5T_`&-{ z4wfc`sipabmwD|kQk0_hSN>HrZPBsP#4srfK1Qp&M2I=qX-ld+ZdI2l&U~qy-{ni^o2^v_PptKb=*)U@E;3hV|*whq=X?aqRDT z^tbYa0KRLf*y?IvaMvP~OLIT-=7ucOQr~$`O`TnE4Fp-y<`1!-4a8Z;b234mh z+93id_Yh$`E}4%HTlggVbB-#IQgPk+vPXFOL{ZCzs?TVp(7rHCNV$gy6A}_ahgBGU zANwYX-FltcXe=~-8zn?MLWGHmilW2LFlQL6oQ-b@YUZ)fQuQ*69Zm(ELWGHrkEg@V z5ah>Jk7Z4-Q9qB>WZ7In9{#9Sh%hFTi4MC!_ycU;G}i9T!hwtyG-`wh)6mf1yjX(^p zd@*KbX3|O52n}LIlRfV^5VlWYBYV?!H$V()pr)p#UcGwJdDoaZgq6;4w{Vy$n;~f0 zfdGhM4Fn`6CQ^!PbnnKJN3r_3G>0rqrHm3Z?LYt}i8WAdZLPn*KV`Ybpa7OL$@#)z zFn5w5Xa}qjz#$NjmX=0|Zt+|&E1u5oIxZY;k4S}@WK-{u+Uj3i61G4Isl5iP_TmIu-?K>@iAo&*)xC_KB zX8{fgug*+YfC!}Qceqn{2&AB{t}Y=V!K?S3J34BK3(+;1TQ>RYFXL Date: Mon, 19 Aug 2024 14:00:48 -0400 Subject: [PATCH 018/451] Corrected variable/function names --- apps/openlocatebeacon/openlocatebeacon.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js index fe24201738..72a5a4547e 100644 --- a/apps/openlocatebeacon/openlocatebeacon.js +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -31,7 +31,7 @@ function encodeGeoLocationElement() { let seqFrag = ((sequenceNumber++ & 0x0f) << 4) + 0x01; let rfc6225lat = toRfc6225Coordinate(gps.lat); let rfc6225lon = toRfc6225Coordinate(gps.lon); - let rfc6225alt = toRfc6225Coordinate(bar.altitude); + let rfc6225alt = toRfc6225Altitude(bar.altitude); lci[0] = rfc6225lat.integer >> 7; lci[1] = ((rfc6225lat.integer & 0xff) << 1) + (rfc6225lat.fraction >> 24); lci[2] = (rfc6225lat.fraction >> 16) & 0xff; @@ -105,7 +105,7 @@ Bangle.on('GPS', (newGps) => { mainMenu.Lon.value = gps.lon.toFixed(4); mainMenu.Satellites.value = gps.satellites; mainMenu.HDOP.value = (gps.hdop * 5).toFixed(1) + 'm'; - E.showMenu(gpsMenu); + E.showMenu(mainMenu); if(Number.isFinite(gps.lat) && Number.isFinite(gps.lon)) { NRF.setAdvertising(encodeGeoLocationElement(), ADVERTISING_OPTIONS); From 431f7570d73a46d23984ec8b60a7d66255bcf8f1 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 19 Aug 2024 17:47:59 -0400 Subject: [PATCH 019/451] Corrected shortName --- apps/openlocatebeacon/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json index 87e38f9852..ff96a464e4 100644 --- a/apps/openlocatebeacon/metadata.json +++ b/apps/openlocatebeacon/metadata.json @@ -1,7 +1,7 @@ { "id": "openlocatebeacon", "name": "OpenLocate Beacon", - "shortName": "OpenLocale Beacon", + "shortName": "OpenLocate Beacon", "version": "0.01", "description": "Advertise GPS geolocation date using the OpenLocate Beacon packet specification.", "icon": "openlocatebeacon.png", From 46de0a5ae87917445c4610c00fae650643ba525f Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 19 Aug 2024 18:00:30 -0400 Subject: [PATCH 020/451] Corrected test for NaN --- apps/openlocatebeacon/openlocatebeacon.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js index 72a5a4547e..b4f7ba5db7 100644 --- a/apps/openlocatebeacon/openlocatebeacon.js +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -107,11 +107,11 @@ Bangle.on('GPS', (newGps) => { mainMenu.HDOP.value = (gps.hdop * 5).toFixed(1) + 'm'; E.showMenu(mainMenu); - if(Number.isFinite(gps.lat) && Number.isFinite(gps.lon)) { + if(!isNaN(gps.lat) && !isNaN(gps.lon)) { NRF.setAdvertising(encodeGeoLocationElement(), ADVERTISING_OPTIONS); } else { - NRF.setAdvertising({}, { name:"Bangle.js" }); + NRF.setAdvertising({}, { name: "Bangle.js" }); } }); From eb20a35e0d0b6ae547cd702241bb105888c874c2 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 19 Aug 2024 18:09:01 -0400 Subject: [PATCH 021/451] Version bump --- apps/openlocatebeacon/ChangeLog | 1 + apps/openlocatebeacon/metadata.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openlocatebeacon/ChangeLog b/apps/openlocatebeacon/ChangeLog index 5560f00bce..3b392b46b2 100644 --- a/apps/openlocatebeacon/ChangeLog +++ b/apps/openlocatebeacon/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Corrected NaN test for GPS diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json index ff96a464e4..98a8a008fc 100644 --- a/apps/openlocatebeacon/metadata.json +++ b/apps/openlocatebeacon/metadata.json @@ -2,7 +2,7 @@ "id": "openlocatebeacon", "name": "OpenLocate Beacon", "shortName": "OpenLocate Beacon", - "version": "0.01", + "version": "0.02", "description": "Advertise GPS geolocation date using the OpenLocate Beacon packet specification.", "icon": "openlocatebeacon.png", "screenshots": [], From 1443cc400046365cd7d54e9b2e91281128158fd4 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 19 Aug 2024 18:22:03 -0400 Subject: [PATCH 022/451] Removed remaining invalid references to Number.isFinite() --- apps/openlocatebeacon/ChangeLog | 1 + apps/openlocatebeacon/metadata.json | 2 +- apps/openlocatebeacon/openlocatebeacon.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openlocatebeacon/ChangeLog b/apps/openlocatebeacon/ChangeLog index 3b392b46b2..2a9236565f 100644 --- a/apps/openlocatebeacon/ChangeLog +++ b/apps/openlocatebeacon/ChangeLog @@ -1,2 +1,3 @@ 0.01: New App! 0.02: Corrected NaN test for GPS +0.03: Removed remaining invalid references to Number.isFinite diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json index 98a8a008fc..d46624b8be 100644 --- a/apps/openlocatebeacon/metadata.json +++ b/apps/openlocatebeacon/metadata.json @@ -2,7 +2,7 @@ "id": "openlocatebeacon", "name": "OpenLocate Beacon", "shortName": "OpenLocate Beacon", - "version": "0.02", + "version": "0.03", "description": "Advertise GPS geolocation date using the OpenLocate Beacon packet specification.", "icon": "openlocatebeacon.png", "screenshots": [], diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js index b4f7ba5db7..b240e6f6f7 100644 --- a/apps/openlocatebeacon/openlocatebeacon.js +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -42,7 +42,7 @@ function encodeGeoLocationElement() { lci[7] = (rfc6225lon.fraction >> 16) & 0xff; lci[8] = (rfc6225lon.fraction >> 8) & 0xff; lci[9] = rfc6225lon.fraction & 0xff; - lci[10] = Number.isFinite(bar.altitude) ? 0x10 : 0x00; + lci[10] = bar.altitude ? 0x10 : 0x00; lci[11] = (rfc6225alt.integer >> 16) & 0xff; lci[12] = (rfc6225alt.integer >> 8) & 0xff; lci[13] = rfc6225alt.integer & 0xff; @@ -73,7 +73,7 @@ function toRfc6225Coordinate(coordinate) { // Convert altitude to RFC6225 function toRfc6225Altitude(altitude) { - if(!Number.isFinite(altitude)) { + if(!altitude) { return { integer: 0, fraction: 0 }; } From 058e19ad496f93a405a292d33fa3a2254fd5668c Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Tue, 20 Aug 2024 09:06:19 -0400 Subject: [PATCH 023/451] Corrected typo and removed extra newlines --- apps/openlocatebeacon/README.md | 9 --------- apps/openlocatebeacon/metadata.json | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/apps/openlocatebeacon/README.md b/apps/openlocatebeacon/README.md index ef4d20a216..944bb51bf1 100644 --- a/apps/openlocatebeacon/README.md +++ b/apps/openlocatebeacon/README.md @@ -2,27 +2,18 @@ Collect geolocation sensor data from the Bangle.js 2's GPS and barometer, display the live readings on-screen, and broadcast in Bluetooth Low Energy (BLE) OpenLocate Beacon packets (LCI over BLE) to any listening devices in range. - ## Usage The advertising packets will be recognised by [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere/) open source middleware and any other program which observes the standard packet types. See our [Bangle.js Development Guide](https://reelyactive.github.io/diy/banglejs-dev/) for details. - ## Features Advertises packets with the OpenLocate Beacon geolocation element when a GPS fix is available, and packets with the name "Bangle.js" otherwise. - -## Controls - -None. - - ## Requests [Contact reelyActive](https://www.reelyactive.com/contact/) for support/updates. - ## Creator Developed by [jeffyactive](https://github.com/jeffyactive) of [reelyActive](https://www.reelyactive.com) diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json index d46624b8be..e029731a03 100644 --- a/apps/openlocatebeacon/metadata.json +++ b/apps/openlocatebeacon/metadata.json @@ -3,7 +3,7 @@ "name": "OpenLocate Beacon", "shortName": "OpenLocate Beacon", "version": "0.03", - "description": "Advertise GPS geolocation date using the OpenLocate Beacon packet specification.", + "description": "Advertise GPS geolocation data using the OpenLocate Beacon packet specification.", "icon": "openlocatebeacon.png", "screenshots": [], "type": "app", From e262880005f6ffc2fd3004d3a549745266698fc1 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 24 Aug 2024 00:19:49 +0200 Subject: [PATCH 024/451] pomoplus: increase size of fonts and buttons for legibility and ease of use. Also center the images correctly with regards to their anchoring. --- apps/pomoplus/ChangeLog | 1 + apps/pomoplus/app.js | 48 +++++++++++++++++++++---------------- apps/pomoplus/metadata.json | 2 +- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/apps/pomoplus/ChangeLog b/apps/pomoplus/ChangeLog index 96104469b5..6ce1bd59a9 100644 --- a/apps/pomoplus/ChangeLog +++ b/apps/pomoplus/ChangeLog @@ -2,3 +2,4 @@ 0.02-0.04: Bug fixes 0.05: Submitted to the app loader 0.06: Added setting to show clock after start/resume +0.07: Make fonts and buttons larger for legibility and ease of use. diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index a9e21b98a4..b4ff83cafb 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -14,37 +14,45 @@ if ( common.state = common.STATE_DEFAULT; } +const W = g.getWidth(); +const H = g.getHeight(); +const SCALING = W/176; // The UI was tweaked to look good on a Bangle.js 2 (176x176 px). SCALING is used to adapt with the resolution of whatever device the app is running on. +const BUTTON_HEIGHT = 56 * SCALING; + function drawButtons() { - let w = g.getWidth(); - let h = g.getHeight(); //Draw the backdrop - const BAR_TOP = h - 24; - g.setColor(0, 0, 1).setFontAlign(0, -1) - .clearRect(0, BAR_TOP, w, h) - .fillRect(0, BAR_TOP, w, h) + const BUTTON_TOP = H - BUTTON_HEIGHT; + const IMG_SIZE = 24; + const IMG_ANCHOR_Y = BUTTON_TOP + BUTTON_HEIGHT / 2 - IMG_SIZE / 2; + g.setColor(0, 0, 1) + .fillRect({x:0, y:BUTTON_TOP, x2:W-1, y2:H-1,r:15}) .setColor(1, 1, 1); if (!common.state.wasRunning) { //If the timer was never started, only show a play button - g.drawImage(common.BUTTON_ICONS.play, w / 2, BAR_TOP); + g.drawImage(common.BUTTON_ICONS.play, W / 2 - IMG_SIZE / 2, IMG_ANCHOR_Y); } else { - g.drawLine(w / 2, BAR_TOP, w / 2, h); + g.setColor(g.theme.bg) + .fillRect(W / 2 - 2, BUTTON_TOP, W / 2 + 2, H) + .setColor(1,1,1); if (common.state.running) { - g.drawImage(common.BUTTON_ICONS.pause, w / 4, BAR_TOP) - .drawImage(common.BUTTON_ICONS.skip, w * 3 / 4, BAR_TOP); + g.drawImage(common.BUTTON_ICONS.pause, W / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y) + .drawImage(common.BUTTON_ICONS.skip, W * 3 / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y); } else { - g.drawImage(common.BUTTON_ICONS.reset, w / 4, BAR_TOP) - .drawImage(common.BUTTON_ICONS.play, w * 3 / 4, BAR_TOP); + g.drawImage(common.BUTTON_ICONS.reset, W / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y) + .drawImage(common.BUTTON_ICONS.play, W * 3 / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y); } } } function drawTimerAndMessage() { - let w = g.getWidth(); - let h = g.getHeight(); + const ANCHOR_X = W / 2; + const ANCHOR_Y = H * 3 / 8; + const TIME_SIZE = 48 * SCALING; + const LABEL_SIZE = 18 * SCALING; g.reset() .setFontAlign(0, 0) - .setFont("Vector", 36) - .clearRect(w / 2 - 60, h / 2 - 34, w / 2 + 60, h / 2 + 34) + .setFont("Vector", TIME_SIZE) + .clearRect(0, ANCHOR_Y - TIME_SIZE / 2, W-1, ANCHOR_Y + TIME_SIZE / 2 + 1.2 * LABEL_SIZE) //Draw the timer .drawString((() => { @@ -59,17 +67,17 @@ function drawTimerAndMessage() { if (hours >= 1) return `${parseInt(hours)}:${pad(minutes)}:${pad(seconds)}`; else return `${parseInt(minutes)}:${pad(seconds)}`; - })(), w / 2, h / 2) + })(), ANCHOR_X, ANCHOR_Y) //Draw the phase label - .setFont("Vector", 12) + .setFont("Vector", LABEL_SIZE) .drawString(((currentPhase, numShortBreaks) => { if (!common.state.wasRunning) return "Not started"; else if (currentPhase == common.PHASE_WORKING) return `Work ${numShortBreaks + 1}/${common.settings.numShortBreaks + 1}` else if (currentPhase == common.PHASE_SHORT_BREAK) return `Short break ${numShortBreaks + 1}/${common.settings.numShortBreaks}`; else return "Long break!"; })(common.state.phase, common.state.numShortBreaks), - w / 2, h / 2 + 18); + ANCHOR_X, ANCHOR_Y + 2*LABEL_SIZE); //Update phase with vibation if needed if (common.getTimeLeft() <= 0) { @@ -81,7 +89,7 @@ drawButtons(); Bangle.on("touch", (button, xy) => { //If we support full touch and we're not touching the keys, ignore. //If we don't support full touch, we can't tell so just assume we are. - if (xy !== undefined && xy.y <= g.getHeight() - 24) return; + if (xy !== undefined && xy.y <= g.getHeight() - BUTTON_HEIGHT) return; if (!common.state.wasRunning) { //If we were never running, there is only one button: the start button diff --git a/apps/pomoplus/metadata.json b/apps/pomoplus/metadata.json index 4f2fd6cbb9..1fd65de166 100644 --- a/apps/pomoplus/metadata.json +++ b/apps/pomoplus/metadata.json @@ -1,7 +1,7 @@ { "id": "pomoplus", "name": "Pomodoro Plus", - "version": "0.06", + "version": "0.07", "description": "A configurable pomodoro timer that runs in the background.", "icon": "icon.png", "type": "app", From ffdfe98b92cbda40b0822c58649973689cfb0cf4 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sun, 25 Aug 2024 12:12:51 +0200 Subject: [PATCH 025/451] pomoplus: add README.md --- apps/pomoplus/README.md | 39 +++++++++++++++++++++++++++++++++++++ apps/pomoplus/metadata.json | 1 + 2 files changed, 40 insertions(+) create mode 100644 apps/pomoplus/README.md diff --git a/apps/pomoplus/README.md b/apps/pomoplus/README.md new file mode 100644 index 0000000000..0e8170f504 --- /dev/null +++ b/apps/pomoplus/README.md @@ -0,0 +1,39 @@ +# Pomodoro Plus + +> The Pomodoro Technique is a time management method developed by Francesco Cirillo in the late 1980s. It uses a kitchen timer to break work into intervals, typically 25 minutes in length, separated by short breaks. Each interval is known as a pomodoro, from the Italian word for tomato, after the tomato-shaped kitchen timer Cirillo used as a university student. +> +> The original technique has six steps: +> +> Decide on the task to be done. +> Set the Pomodoro timer (typically for 25 minutes). +> Work on the task. +> End work when the timer rings and take a short break (typically 5–10 minutes). +> Go back to Step 2 and repeat until you complete four pomodori. +> After four pomodori are done, take a long break (typically 20 to 30 minutes) instead of a short break. Once the long break is finished, return to step 2. + +*Description gathered from https://en.wikipedia.org/wiki/Pomodoro_Technique* + +## Usage + +- Click the play button to start a pomodoro and get to work! +- Click the pause button if you're interrupted with something urgent. +- Click the cross button if you need to end your work session. +- Click the skip button if you forgot to start the pomodori after the urgent interruption and ended up working for a long time! (Good on ya'!) + +Configure the pomodori and break times in the settings. + +## Features + +Continues to run in the background if you exit the app while the pomodoro timer is running. + +## Requests + +Open an issue on the espruino/BangleApps issue tracker. + +## Creator + +bruceblore + +## Contributors + +notEvil, thyttan diff --git a/apps/pomoplus/metadata.json b/apps/pomoplus/metadata.json index 1fd65de166..7b1efee2a7 100644 --- a/apps/pomoplus/metadata.json +++ b/apps/pomoplus/metadata.json @@ -10,6 +10,7 @@ "BANGLEJS", "BANGLEJS2" ], + "readme": "README.md", "storage": [ { "name": "pomoplus.app.js", From 74394f10f3564a64171ed3170a1c0502026381c4 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:04:57 +0100 Subject: [PATCH 026/451] Create tvremove.app.js added inital code --- apps/tvremote/tvremove.app.js | 631 ++++++++++++++++++++++++++++++++++ 1 file changed, 631 insertions(+) create mode 100644 apps/tvremote/tvremove.app.js diff --git a/apps/tvremote/tvremove.app.js b/apps/tvremote/tvremove.app.js new file mode 100644 index 0000000000..c115fc970a --- /dev/null +++ b/apps/tvremote/tvremove.app.js @@ -0,0 +1,631 @@ +require("Font7x11Numeric7Seg").add(Graphics); + +let deviceFileName = "tvdevicelist.json"; +let serverDataFile = "tvremote.settings.json"; +let serverData = require("Storage").readJSON(serverDataFile, true); +let devicefile = require("Storage").readJSON(deviceFileName, true); + +//console.log(require("Storage").list()); +//console.log(devicefile); + + +let serverDns = serverData.webServerDns; +let serverPort = serverData.port; +let tvIp = serverData.tvIp; +let username = serverData.username; +let password = serverData.password; + +let panaIp = "tvIp" in serverData ? serverData.tvIp : 'undefined'; +let settingsPort = "port" in serverData ? serverData.port : 'undefined'; + +let counter; +let countdownTimer = null; +let drawTimeout; +let currNumber = null; +let prevNumber = null; +let selected = "NONE"; +let currentScreen = "power"; +let font = 'Vector'; +let RESULT_HEIGHT = 24; +let RIGHT_MARGIN = 15; +let midpoint = (g.getWidth() / 2); +let IP_AREA = [0, RESULT_HEIGHT, g.getWidth(), g.getHeight()]; // values used for key buttons +let KEY_AREA = [0, 24, g.getWidth(), g.getHeight()]; +let COLORS = {DEFAULT: ['#FF0000'], BLACK: ['#000000'], WHITE: ['#FFFFFF'], GREY: ['#808080', '#222222']}; // background + +let sourceApps = { + "selection": { + '!': { + grid: [0, 1], + globalGrid: [0, 0], + key: 'down' + }, + '^': { + grid: [0, 0], + globalGrid: [0, 0], + key: 'up' + }, + '<': { + grid: [1, 0], + globalGrid: [1, 0], + key: 'left' + }, + '>': { + grid: [1, 1], + globalGrid: [1, 0], + key: 'right' + } + }, + "volume": { + 'Vol Up': { + grid: [0, 0], + globalGrid: [0, 0], + key: 'volume_up' + }, + 'Vol Dwn': { + grid: [0, 1], + globalGrid: [1, 0], + key: 'volume_down' + }, + 'Mute': { + grid: [1, 0], + globalGrid: [2, 0], + key: 'mute' + }, + 'Options': { + grid: [1, 1], + globalGrid: [2, 0], + key: 'option' + } + }, + "numbers": { + '<': { + grid: [0, 3], + globalGrid: [1, 4] + }, + '0': { + grid: [1, 3], + globalGrid: [1, 4] + }, + 'ok': { + grid: [2, 3], + globalGrid: [2, 4] + }, + '1': { + grid: [0, 2], + globalGrid: [0, 3] + }, + '2': { + grid: [1, 2], + globalGrid: [1, 3] + }, + '3': { + grid: [2, 2], + globalGrid: [2, 3] + }, + '4': { + grid: [0, 1], + globalGrid: [0, 2] + }, + '5': { + grid: [1, 1], + globalGrid: [1, 2] + }, + '6': { + grid: [2, 1], + globalGrid: [2, 2] + }, + '7': { + grid: [0, 0], + globalGrid: [0, 1] + }, + '8': { + grid: [1, 0], + globalGrid: [1, 1] + }, + '9': { + grid: [2, 0], + globalGrid: [2, 1] + } + }, + "apps": [{ + "name": "Disney +", + "key": "disney" + }, + { + "name": "Netflix", + "key": "netflix" + }, + { + "name": "Amazon Prime", + "key": "prime" + }, + { + "name": "Youtube", + "key": "youtube" + }, + { + "name": "Home", + "key": "home" + }, + { + "name": "TV", + "key": "tv" + }, + { + "name": "HDMI1", + "key": "hdmi1" + }, + { + "name": "HDMI2", + "key": "hdmi2" + }, + { + "name": "HDMI3", + "key": "hdmi3" + }, + { + "name": "HDMI4", + "key": "hdmi4" + } + ] +}; +let numbersGrid = [3, 4]; +let selectionGrid = [2, 2]; +let volumeGrid = [2, 2]; +let appData = sourceApps.apps; +let volume = sourceApps.volume; +let selection = sourceApps.selection; +let numbers = sourceApps.numbers; + +function assignScreen (screen) { + currentScreen = screen; + console.log(currentScreen); +} + +function sendPost(keyPress) { + let serverPort = settingsPort; + let tvIp = panaIp; + let credentials = btoa(`${username}:${password}`); + let serverUrl = `https://${serverDns}:${serverPort}`; + + let keyJson = { + "command": keyPress, + "tvip": tvIp, + }; + + Bangle.http( + serverUrl, + { + method: 'POST', + headers: { + 'Authorization': `Basic ${credentials}`, + }, + body: JSON.stringify(keyJson) + }) + .then(response => { + console.log("Response received:", response); + }).catch(error => { + console.error("Error sending data:", error); + }); +} + +function receiveDevices() { + let serverPort = settingsPort; + let credentials = btoa(`${username}:${password}`); + let serverUrl = `https://${serverDns}:${serverPort}/ssdp-devices.json`; + return Bangle.http( + serverUrl, + { + method: 'GET', + headers: { + 'Authorization': `Basic ${credentials}` + }, + }).then(data => { + require("Storage").write(deviceFileName, data); + devicefile = require("Storage").readJSON(deviceFileName, true); + }); +} + +function prepareScreen(screen, grid, defaultColor, area) { // grid, [3, 4], colour, grid area size + for (let k in screen) { + if (screen.hasOwnProperty(k)) { + screen[k].color = screen[k].color || defaultColor; + let position = []; + let xGrid = (area[2] - area[0]) / grid[0]; + let yGrid = (area[3] - area[1]) / grid[1]; + + //console.log(xGrid + " " + yGrid); + position[0] = area[0] + xGrid * screen[k].grid[0]; + position[1] = area[1] + yGrid * screen[k].grid[1]; + + position[2] = position[0] + xGrid - 1; + position[3] = position[1] + yGrid - 1; + + screen[k].xy = position; + //console.log("prepared " + screen+"\n"); + } + } + Bangle.setUI({ + mode: "custom", + back: function() { + appMenu(); + } + }); +} + +function drawKey(name, k, selected) { // number, number data, NONE + g.setColor(COLORS.DEFAULT[0]); // set color for rectangles + g.setFont('Vector', 20).setFontAlign(0, 0); + g.fillRect(k.xy[0], k.xy[1], k.xy[2], k.xy[3]); // create rectangles based on letters xy areas + + g.setColor(COLORS.BLACK[0]).drawRect(k.xy[0], k.xy[1], k.xy[2], k.xy[3]); + + g.setColor(COLORS.WHITE[0]); // color for numbers + g.drawString(name, (k.xy[0] + k.xy[2]) / 2, (k.xy[1] + k.xy[3]) / 2); // center the keys to the rectangle that is drawn +} + +function drawKeys(area, buttons) { + g.setColor(COLORS.DEFAULT[0]); // background colour + g.fillRect(area[0], area[1], area[2], area[3]); // number grid area + for (let k in buttons) { + if (buttons.hasOwnProperty(k)) { + drawKey(k, buttons[k], k == selected); + } + } +} + +function displayOutput(num, screenValue) { // top block + num = num.toString(); + g.setFont('Vector', 18); //'7x11Numeric7Seg' + g.setFontAlign(1, 0); + g.setBgColor(0).clearRect(0, 0, g.getWidth(), RESULT_HEIGHT - 1); + g.setColor(-1); // value + + g.drawString(num, g.getWidth() - RIGHT_MARGIN, RESULT_HEIGHT / 2); +} + +function buttonPress(val, screenValue) { + + if (screenValue === "ip") { + if (val === "<") currNumber = currNumber.slice(0,-1); + else if (val === ".") currNumber = currNumber + "."; + else currNumber = currNumber == null ? val : currNumber + val; // currNumber is null if no value pressed + + let ipcount = (currNumber.match(/\./g) || []).length; + if (ipcount > 3 || currNumber.length > 15) currNumber = currNumber.slice(0,-1); + + displayOutput(currNumber, screenValue); + } + + checkValue = appData.some(app => app.name === screenValue); // check app data + + if (checkValue) sendPost(val); // app values + + if (screenValue === "numbers") { + if (val === '<') sendPost('back'); + else if (val === 'ok') sendPost('enter'); + else sendPost("num_"+val); + } + + else if (screenValue === "selection") sendPost(selection[val].key); + else if (screenValue === "volume") sendPost(volume[val].key); +} + +const powerScreen = () => { + currentScreen = "power"; + g.setColor(COLORS.GREY[0]).fillRect(0, 24, g.getWidth(), g.getWidth()); // outer circ + g.setColor(COLORS.WHITE[0]).fillCircle(midpoint, 76 + 24, 50); // inner circ + g.setColor(COLORS.BLACK[0]).setFont('Vector', 25).setFontAlign(0, 0).drawString("On/Off", 88, 76 + 24); // circ text + + Bangle.setUI({ + mode: "custom", + back: function() { + mainMenu(); + } + }); +}; + +const appMenu = () => { + + assignScreen("apps"); + E.showScroller({ + h: 54, + c: appData.length, + draw: (i, r) => { + let sourceOption = appData[i]; + g.setColor(COLORS.DEFAULT[0]).fillRect((r.x), (r.y), (r.x + r.w), (r.y + r.h)); + g.setColor(COLORS.BLACK[0]).drawRect((r.x), (r.y), (r.x + r.w), (r.y + r.h)); + g.setColor(COLORS.WHITE[0]).setFont(font, 20).setFontAlign(-1, 1).drawString(sourceOption.name, 15, r.y + 32); + }, + + select: i => { + let sourceOption = appData[i]; + let appPressed = sourceOption.name; + let appKey = sourceOption.key; + buttonPress(appKey, appPressed); + }, + + back: main => { + E.showScroller(); + mainMenu(); + }, + }); + g.flip(); // force a render before widgets have finished drawing +}; + +function ipScreen() { + //require("widget_utils").hide(); + assignScreen("ip"); + currNumber = ""; + prepareScreen(numbers, numbersGrid, COLORS.DEFAULT, IP_AREA); + drawKeys(IP_AREA, numbers); + displayOutput(0); +} + +let tvSelector = { + "": { + title: "TV Selector", + back: function() { + load();//E.showMenu(tvSelector); + } + }, + "Panasonic": function() { + assignScreen("power"); + powerScreen(); + }, + "Samsung": function() { + assignScreen("power"); + powerScreen(); + }, + "Settings": function() { + subMenu(); + } +}; + +function samsungmenu() { + //E.showMessage("It's on my list to do", "Error"); +} + +function mainMenu() { + assignScreen("mainmenu"); + E.showMenu(tvSelector); +} + +function clearCountdown() { + if (countdownTimer) { + clearTimeout(countdownTimer); + countdownTimer = null; + } +} + +function countDown(callback) { + require("widget_utils").show(); + if (counter === 0) { + callback(); // Call the callback function when countdown reaches 0 + return; + } + E.showMessage(`Searching for devices...\n${counter}`, "Device Search"); + counter--; + countdownTimer = setTimeout(() => countDown(callback), 1000); +} + +function clearDisplayOutput() { + g.clear(); + Bangle.loadWidgets(); + Bangle.drawWidgets(); +} + +function subMenu() { + + if (typeof IPASSIGN !== 'undefined' && currNumber !== "") { + if (IPASSIGN === "pana") { + console.log("current numeber = " + currNumber); + panaIp = currNumber; + console.log("pana ip " + panaIp); + console.log("default ip " + serverData.tvIp); + serverData.tvIp = panaIp; + require("Storage").write(serverDataFile, serverData); + console.log("tv ip is now " + serverData.tvIp); + + } else if (IPASSIGN === "sams") { + samsIp = currNumber; + + } else if (IPASSIGN === "port") { + settingsPort = currNumber; + console.log("setting port " + settingsPort); + console.log("server port " + serverData.port); + serverData.port = settingsPort; + require("Storage").write(serverDataFile, serverData); + console.log("port is now " + serverData.port); + } + } + + require("widget_utils").show(); + assignScreen("settingssub"); + clearDisplayOutput(); + + let settingssub = { + "": { + title: "Settings", + back: function() { + E.showMenu(tvSelector); + clearCountdown(); + } + }, + }; + + if (typeof settingsPort !== 'undefined' && settingsPort !== 'undefined') { + let portHeader = `Port: ${settingsPort}`; + settingssub[portHeader] = function() { IPASSIGN = "port"; ipScreen();}; + } else { + settingssub["Set DNS Port"] = function() { IPASSIGN = "port"; ipScreen();}; + } + + if (typeof panaIp !== 'undefined' && panaIp !== 'undefined') { + let panaheader = `Pana IP: ${panaIp}`; + settingssub[panaheader] = function() { + IPASSIGN = "pana"; + E.showMenu(deviceSelect); + deviceFile = require("Storage").readJSON("tvdevicelist.json", true); +console.log(devicefile); + }; + } else { + settingssub["Set Pana IP"] = function() { IPASSIGN = "pana"; ipScreen();}; + } + + if (typeof samsIp !== 'undefined' && panaIp !== 'undefined') { + let samsheader = `Sams IP: ${samsIp}`; + settingssub[samsheader] = function() { IPASSIGN = "sams"; ipScreen();}; + } else { + settingssub["Set Sams IP"] = function() { IPASSIGN = "sams"; ipScreen();}; + } + + E.showMenu(settingssub); +} + +const deviceMenu = () => { +let parsedResp = JSON.parse(devicefile.resp); + E.showScroller({ + h: 54, + c: parsedResp.length, + draw: (i, r) => { + let sourceOption = parsedResp[i]; + g.setColor(COLORS.DEFAULT[0]).fillRect((r.x), (r.y), (r.x + r.w), (r.y + r.h)); + g.setColor(COLORS.BLACK[0]).drawRect((r.x), (r.y), (r.x + r.w), (r.y + r.h)); + g.setColor(COLORS.WHITE[0]).setFont(font, 15).setFontAlign(-1, 1).drawString(sourceOption.name, 15, r.y + 32); + }, + + select: i => { + let sourceOption = parsedResp[i]; + let devicePressed = sourceOption.name; + let deviceIp = sourceOption.ip; + + assignScreen("deviceSearch"); + serverData.tvIp = deviceIp.replace('http://', ''); + currNumber = serverData.tvIp; + require("Storage").write(serverDataFile, serverData); + console.log("tv ip is now " + serverData.tvIp); + subMenu(); + }, + + back: main => { + E.showScroller(); + E.showMenu(deviceSelect); + }, + }); + g.flip(); // force a render before widgets have finished drawing +}; + + +let deviceSelect = { + "" : { title : "Device Select", + back : function() { subMenu(); } + }, + "Manual IP Assign" : function() { + ipScreen(); + }, + "Device Select" : function() { + receiveDevices(); + counter = 5; + countDown(deviceMenu); + } +}; + + +function swipeHandler(LR, UD) { + if (LR == -1) { // swipe left + if (currentScreen === "power") { + assignScreen("apps"); + appMenu(); + + } else if (currentScreen === "apps") { + //require("widget_utils").hide(); + assignScreen("selection"); + E.showScroller(); + prepareScreen(selection, selectionGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, selection); + + } else if (currentScreen === "volume") { + sendPost("fast_forward"); + + } else if (currentScreen === "selection") { + sendPost("enter"); + } + } + if (LR == 1) { // swipe right + if (currentScreen === "apps") { + assignScreen("power"); + E.showScroller(); + powerScreen(); + } else if (currentScreen === "volume") { + sendPost("rewind"); + } else if (currentScreen === "selection") { + sendPost("back"); + } + } + if (UD == -1) { // swipe up + if (currentScreen === "selection") { + assignScreen("volume"); + prepareScreen(volume, volumeGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, volume); + } else if (currentScreen === "volume") { + sendPost("enter"); + } else if (currentScreen === "ip") { + buttonPress(".", "ip"); + } else if (currentScreen == "numbers") { + assignScreen("selection"); + prepareScreen(selection, selectionGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, selection); + } + } + if (UD == 1) { // swipe down + if (currentScreen === "volume") { + assignScreen("selection"); + prepareScreen(selection, selectionGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, selection); + } else if (currentScreen === "selection") { + assignScreen("numbers"); + prepareScreen(numbers, numbersGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, numbers); + } + } +} +Bangle.on('swipe', swipeHandler); + + +function touchHandler(button, e) { + const screenActions = { + ip: () => checkButtons(numbers), + volume: () => checkButtons(volume), + numbers: () => checkButtons(numbers), + selection: () => checkButtons(selection), + power: () => { + if (Math.pow(e.x - 88, 2) + Math.pow(e.y - 88, 2) < 2500) { + sendPost("power"); + } + } + }; + + function checkButtons(buttonMap) { + for (let key in buttonMap) { + if (typeof buttonMap[key] === "undefined") continue; + let r = buttonMap[key].xy; + + if (e.x >= r[0] && e.y >= r[1] && e.x < r[2] && e.y < r[3]) { + if (currentScreen === "ip" && key === "ok") { + subMenu(); + } else { + buttonPress("" + key, currentScreen); + } + } + } + } + + if (currentScreen in screenActions) screenActions[currentScreen](); +} +Bangle.on('touch', touchHandler); + +Bangle.loadWidgets(); +Bangle.drawWidgets(); +mainMenu(); From d6a506ac9ad8d3abd553d130d0dafc952f672100 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:07:09 +0100 Subject: [PATCH 027/451] Rename tvremove.app.js to app.js --- apps/tvremote/{tvremove.app.js => app.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename apps/tvremote/{tvremove.app.js => app.js} (100%) diff --git a/apps/tvremote/tvremove.app.js b/apps/tvremote/app.js similarity index 100% rename from apps/tvremote/tvremove.app.js rename to apps/tvremote/app.js From 55bdf8cff73d0e833e7fd2fab3d15c74280db219 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:08:26 +0100 Subject: [PATCH 028/451] added app image app image --- apps/tvremote/app.png | Bin 0 -> 607 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/tvremote/app.png diff --git a/apps/tvremote/app.png b/apps/tvremote/app.png new file mode 100644 index 0000000000000000000000000000000000000000..2d661af88aad420fed5bff452fb1bf216b938bb9 GIT binary patch literal 607 zcmV-l0-*hgP)F6XU=)mkAqj%=tK38D>)9BFA_&Q=oEVZ<^*=PP zvVvhKf}osg7mx=+@+!XuWmU^F3`G!}SG5}KiQLLngwzIR)Qg4YR%S8`CJ>lgCKH@j z`5By)aw|M=s>`Ss3(2jz42iL-EQY}ZLh~vsps{evBR7{FLq4}sG&ryF64de6L$gXG z7zPsvt*>VTISk~$;M}V6A?0{{8G6V#9$SVUa*jvO(80Nt_XphZ=WpEkKNvB?s0VHg z@fbLC`ojO^o3{V&ojLD+MQhLh^wR48VW~O)eWDZpI|oJmxAP1AZ|?37ra^p=I7l9( z4x}EW52PPt4qZL4`{=3v(U}Ec$59K1r{@0OcHk(6Bk#^%|Noax$p2qDq5tnL+&~=< zM5N_W)$uSKoRo>-0g%K0i@SjFFWpeeJ+SB4DVjJQhW8vhMOzO{TeO^}9+Vb-uZrWzz_`Fh@dLSXMjJ6)|iB6`e2YjNFY3l*!;3%4U zz$GM_wjQwd4yLIGti6Nbc1>Ne>HmZ!>oD-h_JH$HPeMLJJrl>%u^637izGzPifk$^ zJV5WJ#Cd8bA$m9F&Qse1ARL*IPZP&SWfq{=Lz5%~iv^Hn)O37IcH#fM$IsBm14F(` td47;!hEWgP7$Pw+3P!;w7zGUU0s!Tn)#ptDBbERF002ovPDHLkV1oOB5wQRO literal 0 HcmV?d00001 From 99b09b56174e8aec82aecda7541703be345063da Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:18:42 +0100 Subject: [PATCH 029/451] Create app-icon.js adding app-icon --- apps/tvremote/app-icon.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/tvremote/app-icon.js diff --git a/apps/tvremote/app-icon.js b/apps/tvremote/app-icon.js new file mode 100644 index 0000000000..00903b468b --- /dev/null +++ b/apps/tvremote/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEw4kA///7fOlMytX5muVt9T5lK6eMy2l1H4nO+i3d19jq2VxdCltTMf4A/AFsFqAYWqoXXGCxIEJqZIDGiYXCgpkTIYRjUFgIuUJAQuPgMRACEQC+0aw98+3ul3m/l3xQXMjVSkQAH/QUB2c7C48fCxEil4XBnOTC4+iC5Mi0IXKoQXKoJHKuQXKuJ3K4QXK4IXKsQXKsIXK8QXK8IXXjvd7vRC9Z3iU5hHKa5gXKoQXKoJHK0QXK0IXKj4WJksRI5UaqQXI5QXLDAOHvn290u838u+KIoZHIACAX0AH4A/ABo=")) From 1906e8a8b9a844e72cf7ee6d0cf79925b03c1033 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:26:39 +0100 Subject: [PATCH 030/451] Create metadata.json added metadata --- apps/tvremote/metadata.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 apps/tvremote/metadata.json diff --git a/apps/tvremote/metadata.json b/apps/tvremote/metadata.json new file mode 100644 index 0000000000..a624b625f8 --- /dev/null +++ b/apps/tvremote/metadata.json @@ -0,0 +1,15 @@ +{ "id": "tvremote", + "name": "TV Remote", + "shortName":"TV Remote", + "icon": "app.png", + "version":"0.01", + "description": "remote for controlling your tv, using a webserver and the bangle Gadget Bridge (https://www.espruino.com/Gadgetbridge).", + "icon": "app.png", + "tags": "remote", + "supports": ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"tvremote.app.js","url":"app.js"}, + {"name":"tvremote.img","url":"app-icon.js","evaluate":true} + ] +} From 5d241b3830326fb2bf505bfcf1748bdee73c9667 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 26 Aug 2024 09:20:16 -0400 Subject: [PATCH 031/451] Removed HDOP from menu/display to elimate need for scrolling --- apps/openlocatebeacon/openlocatebeacon.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js index b240e6f6f7..2b7e10e54d 100644 --- a/apps/openlocatebeacon/openlocatebeacon.js +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -20,8 +20,7 @@ let mainMenu = { "Lat": { value: null }, "Lon": { value: null }, "Altitude": { value: null }, - "Satellites": { value: null }, - "HDOP": { value: null } + "Satellites": { value: null } }; @@ -104,7 +103,6 @@ Bangle.on('GPS', (newGps) => { mainMenu.Lat.value = gps.lat.toFixed(4); mainMenu.Lon.value = gps.lon.toFixed(4); mainMenu.Satellites.value = gps.satellites; - mainMenu.HDOP.value = (gps.hdop * 5).toFixed(1) + 'm'; E.showMenu(mainMenu); if(!isNaN(gps.lat) && !isNaN(gps.lon)) { From fc4428a054e30fe191bf1c4c651016c3e97671bc Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 26 Aug 2024 09:22:16 -0400 Subject: [PATCH 032/451] Shortened menu title (app name) to fit screen --- apps/openlocatebeacon/openlocatebeacon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openlocatebeacon/openlocatebeacon.js b/apps/openlocatebeacon/openlocatebeacon.js index 2b7e10e54d..0fa60419e9 100644 --- a/apps/openlocatebeacon/openlocatebeacon.js +++ b/apps/openlocatebeacon/openlocatebeacon.js @@ -16,7 +16,7 @@ let sequenceNumber = 0; // Menus let mainMenu = { - "": { "title": "OpenLocateBeacon" }, + "": { "title": "OpenLocateBcn" }, "Lat": { value: null }, "Lon": { value: null }, "Altitude": { value: null }, From c330ef9cc07b2df382d592c489c1d40e12d4cc55 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 26 Aug 2024 09:24:50 -0400 Subject: [PATCH 033/451] Version bump --- apps/openlocatebeacon/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openlocatebeacon/ChangeLog b/apps/openlocatebeacon/ChangeLog index 2a9236565f..4a396d83f4 100644 --- a/apps/openlocatebeacon/ChangeLog +++ b/apps/openlocatebeacon/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App! 0.02: Corrected NaN test for GPS 0.03: Removed remaining invalid references to Number.isFinite +0.04: Improved menu/display interaction From d66fc98676fabcfacee08e142fc577c5bd6cbda0 Mon Sep 17 00:00:00 2001 From: jeffyactive Date: Mon, 26 Aug 2024 09:27:22 -0400 Subject: [PATCH 034/451] Corrected version number to match ChangeLog --- apps/openlocatebeacon/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openlocatebeacon/metadata.json b/apps/openlocatebeacon/metadata.json index e029731a03..85f7e2feed 100644 --- a/apps/openlocatebeacon/metadata.json +++ b/apps/openlocatebeacon/metadata.json @@ -2,7 +2,7 @@ "id": "openlocatebeacon", "name": "OpenLocate Beacon", "shortName": "OpenLocate Beacon", - "version": "0.03", + "version": "0.04", "description": "Advertise GPS geolocation data using the OpenLocate Beacon packet specification.", "icon": "openlocatebeacon.png", "screenshots": [], From effa1b654a667581e5357a9223824e1be27218c7 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 27 Aug 2024 13:51:06 +0200 Subject: [PATCH 035/451] Support forced meridians --- apps/locale/locale.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/locale/locale.html b/apps/locale/locale.html index 22f94e597e..71bfecea95 100644 --- a/apps/locale/locale.html +++ b/apps/locale/locale.html @@ -237,7 +237,7 @@ translate: s => ${locale.trans?`{var t=${js(locale.trans)};s=''+s;return t[s]||t[s.toLowerCase()]||s;}`:`s`}, date: (d,short) => short ? \`${dateS}\` : \`${dateN}\`, time: (d,short) => short ? \`${timeS}\` : \`${timeN}\`, - meridian: d => is12Hours() ? d.getHours() < 12 ? ${js(locale.ampm[0])}:${js(locale.ampm[1])} : "", + meridian: (d,force) => (force||is12Hours()) ? d.getHours() < 12 ? ${js(locale.ampm[0])}:${js(locale.ampm[1])} : "", is12Hours, }; `.trim() @@ -310,8 +310,8 @@ `; document.getElementById("examples").innerHTML = ` Meridian - ${exports.meridian(new Date(0))} / - ${exports.meridian(new Date(43200000))} + ${exports.meridian(new Date(0), true)} / + ${exports.meridian(new Date(43200000), true)} ${customizeLocale ? `Meridian names From 65ab758beaddbd6b215696d8e5674eeb6144074d Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Tue, 27 Aug 2024 22:09:44 +0200 Subject: [PATCH 036/451] pomoplus: tweak var names, apply scaling to radius Also reword the comment regarding SCALING. --- apps/pomoplus/app.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index b4ff83cafb..6da7405798 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -16,30 +16,30 @@ if ( const W = g.getWidth(); const H = g.getHeight(); -const SCALING = W/176; // The UI was tweaked to look good on a Bangle.js 2 (176x176 px). SCALING is used to adapt with the resolution of whatever device the app is running on. +const SCALING = W/176; // The UI was tweaked to look good on a Bangle.js 2 (176x176 px). SCALING automatically adapts so elements have the same proportions relative to the screen size on devices with other resolutions. const BUTTON_HEIGHT = 56 * SCALING; function drawButtons() { //Draw the backdrop const BUTTON_TOP = H - BUTTON_HEIGHT; - const IMG_SIZE = 24; - const IMG_ANCHOR_Y = BUTTON_TOP + BUTTON_HEIGHT / 2 - IMG_SIZE / 2; + const ICONS_SIZE = 24; + const ICONS_ANCHOR_Y = BUTTON_TOP + BUTTON_HEIGHT / 2 - ICONS_SIZE / 2; g.setColor(0, 0, 1) - .fillRect({x:0, y:BUTTON_TOP, x2:W-1, y2:H-1,r:15}) + .fillRect({x:0, y:BUTTON_TOP, x2:W-1, y2:H-1,r:15*SCALING}) .setColor(1, 1, 1); if (!common.state.wasRunning) { //If the timer was never started, only show a play button - g.drawImage(common.BUTTON_ICONS.play, W / 2 - IMG_SIZE / 2, IMG_ANCHOR_Y); + g.drawImage(common.BUTTON_ICONS.play, W / 2 - ICONS_SIZE / 2, ICONS_ANCHOR_Y); } else { g.setColor(g.theme.bg) .fillRect(W / 2 - 2, BUTTON_TOP, W / 2 + 2, H) .setColor(1,1,1); if (common.state.running) { - g.drawImage(common.BUTTON_ICONS.pause, W / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y) - .drawImage(common.BUTTON_ICONS.skip, W * 3 / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y); + g.drawImage(common.BUTTON_ICONS.pause, W / 4 - ICONS_SIZE / 2, ICONS_ANCHOR_Y) + .drawImage(common.BUTTON_ICONS.skip, W * 3 / 4 - ICONS_SIZE / 2, ICONS_ANCHOR_Y); } else { - g.drawImage(common.BUTTON_ICONS.reset, W / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y) - .drawImage(common.BUTTON_ICONS.play, W * 3 / 4 - IMG_SIZE / 2, IMG_ANCHOR_Y); + g.drawImage(common.BUTTON_ICONS.reset, W / 4 - ICONS_SIZE / 2, ICONS_ANCHOR_Y) + .drawImage(common.BUTTON_ICONS.play, W * 3 / 4 - ICONS_SIZE / 2, ICONS_ANCHOR_Y); } } } From 15f8906723781de6872411ab61bf4013ed5fca45 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Tue, 27 Aug 2024 23:48:15 +0200 Subject: [PATCH 037/451] pomoplus: hide buttons and widgets when locked --- apps/pomoplus/app.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index 6da7405798..0576547dc0 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -4,6 +4,7 @@ Bangle.POMOPLUS_ACTIVE = true; //Prevent the boot code from running. To avoid h const storage = require("Storage"); const common = require("pomoplus-com.js"); +const wu = require("widget_utils"); //Expire the state if necessary if ( @@ -18,10 +19,10 @@ const W = g.getWidth(); const H = g.getHeight(); const SCALING = W/176; // The UI was tweaked to look good on a Bangle.js 2 (176x176 px). SCALING automatically adapts so elements have the same proportions relative to the screen size on devices with other resolutions. const BUTTON_HEIGHT = 56 * SCALING; +const BUTTON_TOP = H - BUTTON_HEIGHT; function drawButtons() { //Draw the backdrop - const BUTTON_TOP = H - BUTTON_HEIGHT; const ICONS_SIZE = 24; const ICONS_ANCHOR_Y = BUTTON_TOP + BUTTON_HEIGHT / 2 - ICONS_SIZE / 2; g.setColor(0, 0, 1) @@ -85,7 +86,8 @@ function drawTimerAndMessage() { } } -drawButtons(); +if (!Bangle.isLocked()) drawButtons(); + Bangle.on("touch", (button, xy) => { //If we support full touch and we're not touching the keys, ignore. //If we don't support full touch, we can't tell so just assume we are. @@ -164,6 +166,17 @@ if (common.state.running) { setupTimerInterval(); } +Bangle.on('lock', (on, reason) => { + if (on) { + g.clearRect(0,BUTTON_TOP,W-1,H-1); + wu.hide(); + } + if (!on) { + drawButtons(); + wu.show(); + } +}); + //Save our state when the app is closed E.on('kill', () => { storage.writeJSON(common.STATE_PATH, common.state); @@ -171,3 +184,4 @@ E.on('kill', () => { Bangle.loadWidgets(); Bangle.drawWidgets(); +if (Bangle.isLocked()) wu.hide(); From 022181a3e577643e82d811dd30f2004de96df6ea Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:36:17 +0100 Subject: [PATCH 038/451] Update app.js amended app back button --- apps/tvremote/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tvremote/app.js b/apps/tvremote/app.js index c115fc970a..9fb88fd2d6 100644 --- a/apps/tvremote/app.js +++ b/apps/tvremote/app.js @@ -348,7 +348,7 @@ const appMenu = () => { back: main => { E.showScroller(); - mainMenu(); + powerScreen(); }, }); g.flip(); // force a render before widgets have finished drawing From abec3f7701a95c377c246351ee70954e2b7572ed Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:02:22 +0100 Subject: [PATCH 039/451] Create README.md --- apps/tvremote/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/tvremote/README.md diff --git a/apps/tvremote/README.md b/apps/tvremote/README.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/apps/tvremote/README.md @@ -0,0 +1 @@ + From f3bbaeb7f0b7d7c7bc7ed66d1f28516a35e49e8e Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:20:56 +0100 Subject: [PATCH 040/451] Update README.md --- apps/tvremote/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apps/tvremote/README.md b/apps/tvremote/README.md index 8b13789179..a18c7a81b8 100644 --- a/apps/tvremote/README.md +++ b/apps/tvremote/README.md @@ -1 +1,25 @@ +# TV Remote +A [BangleJS 2](https://shop.espruino.com/banglejs2) app that allows the user to send TV input signals from their watch to their TV. +Currenly there is only support for Panasonic viera TV's however support for other brands may be considered in interest is there. +# Requirements +1. The [Bangle GadgetBridge App](https://www.espruino.com/Gadgetbridge) with permissions allowed for `http requests`. +2. A domain name and DNS created. +3. A webserver that the DNS points to, that is set up to receive and process the watch http requests. [Here](https://github.com/Guptilious/banglejs-tvremote-webserver) is one I have created that should complete the full set up for users - provided they have their own domain name and DNS created. + +# Set Up +You will need to upload the below JSON file to your BangleJS, which will be used for config settings. At minimum you must provide: +* `webServerDNS` address, which points to your webserver. +* `username` which should mirror what is included in your webservers auth config. If using my webserver it would be `config.json`. +* `password` which should mirror what is included in your webservers auth config. If using my webserver it would be `config.json`. + +`port` and `tvIp` are optional as they can be manually assigned and updated via the tvremote watch app settings. + + ## Tv remote config example + require("Storage").write("tvremote.settings.json", { + "webServerDns": "", + "tvIp": "", + "port": "", + "username": "", + "password": "" + }); From 4d63ddf134abc3fe070401e69a505724a9194853 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:31:24 +0100 Subject: [PATCH 041/451] Update README.md --- apps/tvremote/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/apps/tvremote/README.md b/apps/tvremote/README.md index a18c7a81b8..7eb6122455 100644 --- a/apps/tvremote/README.md +++ b/apps/tvremote/README.md @@ -23,3 +23,40 @@ You will need to upload the below JSON file to your BangleJS, which will be used "username": "", "password": "" }); + +# Usage +Main Menu +* Select TV type (panasonic is currently the only one supported) +* Settings takes you to the settings menu, that allows you to manually assign ports and IP's. + +Settings Menu +* Device Select sends a http request to the webserver for a scrollable list devices to select. +* Manual IP takes standard number inputs and swipping up will provide a `.` for IP's. + +Power Screen +* Press button - on/off. +* Swipe left - `App Menu`. +* Swipe Right - Main Menu + +App Menu +* Scroll and select to send App menu input. +* Swipe left - Selection menu. +* Swipe right - Power Screen. + +Selection Menu +* ^ - up +* ! - down +* < - left +* > - right +* Swipe right - back +* Swipe left - select +* Swipe Down - Number Menu ( used for inputting key passwords). +* Swipe Up - Vol Commands + +Vol Commands +* Swipe Down - Selection Menu +* Swipe right - rewind +* Swipe left - fast forward +* Swipe Up - Play/Pause + +Back Button - Should take you back to the previous menu screen. From 6ad651e27390c5d27afdde0719a2c18ff0b31a59 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:32:12 +0100 Subject: [PATCH 042/451] Update README.md --- apps/tvremote/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tvremote/README.md b/apps/tvremote/README.md index 7eb6122455..77ee3681f7 100644 --- a/apps/tvremote/README.md +++ b/apps/tvremote/README.md @@ -47,7 +47,7 @@ Selection Menu * ^ - up * ! - down * < - left -* > - right +* `>` - right * Swipe right - back * Swipe left - select * Swipe Down - Number Menu ( used for inputting key passwords). From db223d4ca3f4172d7ba74b844e35ceb8f93e8099 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 28 Aug 2024 23:29:03 +0200 Subject: [PATCH 043/451] trail: initial import. Initial import of GPX-following application. --- apps/trail/ChangeLog | 2 + apps/trail/README.md | 18 ++ apps/trail/app-icon.js | 1 + apps/trail/app.png | Bin 0 -> 1431 bytes apps/trail/gpx2egt.sh | 2 + apps/trail/metadata.json | 13 + apps/trail/trail.app.js | 651 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 687 insertions(+) create mode 100644 apps/trail/ChangeLog create mode 100644 apps/trail/README.md create mode 100644 apps/trail/app-icon.js create mode 100644 apps/trail/app.png create mode 100755 apps/trail/gpx2egt.sh create mode 100644 apps/trail/metadata.json create mode 100644 apps/trail/trail.app.js diff --git a/apps/trail/ChangeLog b/apps/trail/ChangeLog new file mode 100644 index 0000000000..4c4db83bc2 --- /dev/null +++ b/apps/trail/ChangeLog @@ -0,0 +1,2 @@ +0.01: New App! + diff --git a/apps/trail/README.md b/apps/trail/README.md new file mode 100644 index 0000000000..24e06a3bac --- /dev/null +++ b/apps/trail/README.md @@ -0,0 +1,18 @@ +# Trail Rail ![](app.png) + +Simple app to follow GPX track + +Written by: [Pavel Machek](https://github.com/pavelmachek) + +After GPS fix is acquired, it displays familiar arrow with road in +front of you. It never stores whole track in memory, so it should work +with fairly large files. + +GPX files can be obtained from various services, www.mapy.cz is one of +them (actually uses openstreetmap data for most of the world). + +## Preparing data + +"gpx2egt.sh < file.gpx > t.name.egt" can be used to prepare data, then +upload it to watch. + diff --git a/apps/trail/app-icon.js b/apps/trail/app-icon.js new file mode 100644 index 0000000000..511c432459 --- /dev/null +++ b/apps/trail/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwhHXAH4AHgAqpvownEQ4wEMEYw8YMgw4F84wwMH4woeQQvlEwwvCGFgvqE4gvDGFAvHAFQv/AH74YElYvjF3Je/FzV9F8wuLF8QhHL34u/RqSOjFxYvpF2gvlRQwuoAAIvqFoQvJFsoupF9wtFF+CNuX34xfF1YwDF9oA/AH4AyA==")) diff --git a/apps/trail/app.png b/apps/trail/app.png new file mode 100644 index 0000000000000000000000000000000000000000..3213f929a2ebeed88615a8361e5ba58dfd044004 GIT binary patch literal 1431 zcmeAS@N?(olHy`uVBq!ia0vp^8$g(Y4M?uv{v-}aF%}28J29*~C-V}>VJUX<4B-HR z8jh3>1_o9~PZ!6KinzCT?@ki(7HAEu{NHZZ*XH&>Wo8NOt`*?NJ;g8=x z-9NrPf1jqomIJI07Mef5Vb9ILbLa&VL;pUzcJ>*K7g-tPYHRuU4VV{mGuZt4B_o%> z<|fWi@#U+f%>kYsJ%$f2UKdw1NJ_*qJh*uM`3DALgIx><7Oy}5kTETxgt5Ure*R(R zGY9Bz;E%_@^roLS|9}6n&++BVe-ghkzy7b!ozyU0^8?3Y-6Q??HlJxPo?y?F^P8oP zMd*=jok|Y(kKrfIS{?H{zRaw51;Xt_f z1J0OhKaNy2%= 1.0) return km.toFixed(1) + this.icon_km; + return (km*1000).toFixed(0) + this.icon_m; + }, + fmtSteps: function(n) { return this.fmtDist(0.001 * 0.719 * n); }, + fmtAlt: function(m) { return m.toFixed(0) + this.icon_alt; }, + fmtTemp: function(c) { return c.toFixed(1) + this.icon_c; }, + fmtPress: function(p) { + if (p < 900 || p > 1100) + return p.toFixed(0) + this.icon_hpa; + if (p < 1000) { + p -= 900; + return this.icon_9 + this.add0(p.toFixed(0)) + this.icon_hpa; + } + p -= 1000; + return this.icon_10 + this.add0(p.toFixed(0)) + this.icon_hpa; + }, + draw_dot : 1, + add0: function(i) { + if (i > 9) { + return ""+i; + } else { + return "0"+i; + } + }, + fmtTOD: function(now) { + this.draw_dot = !this.draw_dot; + let dot = ":"; + if (!this.draw_dot) + dot = "."; + return now.getHours() + dot + this.add0(now.getMinutes()); + }, + fmtNow: function() { return this.fmtTOD(new Date()); }, + fmtTimeDiff: function(d) { + if (d < 180) + return ""+d.toFixed(0); + d = d/60; + return ""+d.toFixed(0)+"m"; + }, + fmtAngle: function(x) { + switch (this.geo_mode) { + case 0: + return "" + x; + case 1: { + let d = Math.floor(x); + let m = x - d; + m = m*60; + return "" + d + " " + m.toFixed(3) + "'"; + } + case 2: { + let d = Math.floor(x); + let m = x - d; + m = m*60; + let mf = Math.floor(m); + let s = m - mf; + s = s*60; + return "" + d + " " + mf + "'" + s.toFixed(0) + '"'; + } + } + return "bad mode?"; + }, + fmtPos: function(pos) { + let x = pos.lat; + let c = "N"; + if (x<0) { + c = "S"; + x = -x; + } + let s = c+this.fmtAngle(x) + "\n"; + c = "E"; + if (x<0) { + c = "W"; + x = -x; + } + return s + c + this.fmtAngle(x); + }, + fmtFix: function(fix, t) { + if (fix && fix.fix && fix.lat) { + return this.fmtSpeed(fix.speed) + " " + + this.fmtAlt(fix.alt); + } else { + return "N/FIX " + this.fmtTimeDiff(t); + } + }, + fmtSpeed: function(kph) { + return kph.toFixed(1) + this.icon_kph; + }, + radians: function(a) { return a*Math.PI/180; }, + degrees: function(a) { return a*180/Math.PI; }, + // distance between 2 lat and lons, in meters, Mean Earth Radius = 6371km + // https://www.movable-type.co.uk/scripts/latlong.html + // (Equirectangular approximation) + // returns value in meters + distance: function(a,b) { + var x = this.radians(b.lon-a.lon) * Math.cos(this.radians((a.lat+b.lat)/2)); + var y = this.radians(b.lat-a.lat); + return Math.sqrt(x*x + y*y) * 6371000; + }, + // thanks to waypointer + bearing: function(a,b) { + var delta = this.radians(b.lon-a.lon); + var alat = this.radians(a.lat); + var blat = this.radians(b.lat); + var y = Math.sin(delta) * Math.cos(blat); + var x = Math.cos(alat) * Math.sin(blat) - + Math.sin(alat)*Math.cos(blat)*Math.cos(delta); + return Math.round(this.degrees(Math.atan2(y, x))); + }, +}; + +/* gps library v0.1.2 */ +let gps = { + emulator: -1, + init: function(x) { + this.emulator = (process.env.BOARD=="EMSCRIPTEN" + || process.env.BOARD=="EMSCRIPTEN2")?1:0; + }, + state: {}, + on_gps: function(f) { + let fix = this.getGPSFix(); + f(fix); + + /* + "lat": number, // Latitude in degrees + "lon": number, // Longitude in degrees + "alt": number, // altitude in M + "speed": number, // Speed in kph + "course": number, // Course in degrees + "time": Date, // Current Time (or undefined if not known) + "satellites": 7, // Number of satellites + "fix": 1 // NMEA Fix state - 0 is no fix + "hdop": number, // Horizontal Dilution of Precision + */ + this.state.timeout = setTimeout(this.on_gps, 1000, f); + }, + off_gps: function() { + clearTimeout(this.state.timeout); + }, + getGPSFix: function() { + if (!this.emulator) + return Bangle.getGPSFix(); + let fix = {}; + fix.fix = 1; + fix.lat = 50; + fix.lon = 14-(getTime()-this.gps_start) / 1000; /* Go West! */ + fix.alt = 200; + fix.speed = 5; + fix.course = 30; + fix.time = Date(); + fix.satellites = 5; + fix.hdop = 12; + return fix; + }, + gps_start : -1, + start_gps: function() { + Bangle.setGPSPower(1, "libgps"); + this.gps_start = getTime(); + }, + stop_gps: function() { + Bangle.setGPSPower(0, "libgps"); + }, +}; + +/* ui library 0.1.2 */ +let ui = { + display: 0, + numScreens: 2, + drawMsg: function(msg) { + g.reset().setFont("Vector", 35) + .setColor(1,1,1) + .fillRect(0, this.wi, 176, 176) + .setColor(0,0,0) + .drawString(msg, 5, 30) + .flip(); + }, + drawBusy: function() { + this.drawMsg("\n.oO busy"); + }, + nextScreen: function() { + print("nextS"); + this.display = this.display + 1; + if (this.display == this.numScreens) + this.display = 0; + this.drawBusy(); + }, + prevScreen: function() { + print("prevS"); + this.display = this.display - 1; + if (this.display < 0) + this.display = this.numScreens - 1; + this.drawBusy(); + }, + onSwipe: function(dir) { + this.nextScreen(); + }, + h: 176, + w: 176, + wi: 32, + last_b: 0, + touchHandler: function(d) { + let x = Math.floor(d.x); + let y = Math.floor(d.y); + + if (d.b != 1 || this.last_b != 0) { + this.last_b = d.b; + return; + } + + print("touch", x, y, this.h, this.w); + + /* + if ((xthis.h/2) && (ythis.w/2)) { + print("prev"); + this.prevScreen(); + } + if ((x>this.h/2) && (y>this.w/2)) { + print("next"); + this.nextScreen(); + } + }, + init: function() { + this.drawBusy(); + } +}; + +/* egt 0.0.1 */ +let egt = { + init: function() { + }, + parse: function(l) { + let r = {}; + let s = l.split(' '); + + if (s === undefined) + return r; + + if (s[1] === undefined) + return r; + + if (s[1].split('=')[1] === undefined) { + r.lat = 1 * s[0]; + r.lon = 1 * s[1]; + } + + for (let fi of s) { + let f = fi.split('='); + if (f[0] == "utime") { + r.utime = 1 * f[1]; + } + } + + return r; + }, +}; + +function toCartesian(v) { + const R = 6371; // Poloměr Země v km + const latRad = v.lat * Math.PI / 180; + const lonRad = v.lon * Math.PI / 180; + + const x = R * lonRad * Math.cos(latRad); + const y = R * latRad; + + return { x, y }; +} + +function distSegment(x1, x2, xP) { + // Převod zeměpisných souřadnic na kartézské souřadnice + const p1 = toCartesian(x1); + const p2 = toCartesian(x2); + const p = toCartesian(xP); + + // Vektor p1p2 + const dx = p2.x - p1.x; + const dy = p2.y - p1.y; + + // Projekce bodu p na přímku definovanou body p1 a p2 + const dot = ((p.x - p1.x) * dx + (p.y - p1.y) * dy) / (dx * dx + dy * dy); + + // Určení bodu na přímce, kde leží projekce + let closestX, closestY; + if (dot < 0) { + closestX = p1.x; + closestY = p1.y; + } else if (dot > 1) { + closestX = p2.x; + closestY = p2.y; + } else { + closestX = p1.x + dot * dx; + closestY = p1.y + dot * dy; + } + + // Vzdálenost mezi bodem p a nejbližším bodem na úsečce + const distance = Math.sqrt((p.x - closestX) * (p.x - closestX) + (p.y - closestY) * (p.y - closestY)); + + return distance * 1000; +} + +function angleDifference(angle1, angle2) { + // Compute the difference + let difference = angle2 - angle1; + + // Normalize the difference to be within the range -180° to 180° + while (difference > 180) difference -= 360; + while (difference < -180) difference += 360; + + return difference; +} + +function drawThickLine(x1, y1, x2, y2, thickness) { + // Calculate the perpendicular offset for the line thickness + const dx = x2 - x1; + const dy = y2 - y1; + const length = Math.sqrt(dx * dx + dy * dy); + const offsetX = (dy / length) * (thickness / 2); + const offsetY = (dx / length) * (thickness / 2); + + // Draw multiple lines to simulate thickness + for (let i = -thickness / 2; i <= thickness / 2; i++) { + g.drawLine( + x1 + offsetX * i, + y1 - offsetY * i, + x2 + offsetX * i, + y2 - offsetY * i + ); + } +} + +function toxy(pp, p) { + let r = {}; + let d = fmt.distance(pp, p); + let h = fmt.radians(fmt.bearing(pp, p) - pp.course); + let x = pp.x, y = pp.y; + x += d * pp.ppm * Math.sin(h); + y -= d * pp.ppm * Math.cos(h); + r.x = x; + r.y = y; + return r; +} + +function paint(pp, p1, p2, thick) { + let d1 = toxy(pp, p1); + let d2 = toxy(pp, p2); + drawThickLine(d1.x, d1.y, d2.x, d2.y, thick); +} + +var destination = {}, num = 0, dist = 0; + +function read(pp, n) { + g.reset().clear(); + let f = require("Storage").open(n+".st", "r"); + let l = f.readLine(); + let prev = 0; + while (l!==undefined) { + num++; + l = ""+l; + //print(l); + let p = egt.parse(l); + if (p.lat) { + if (prev) { + dist += fmt.distance(prev, p); + //paint(pp, prev, p); + } + prev = p; + } + l = f.readLine(); + if (!(num % 100)) { + ui.drawMsg(num + "\n" + fmt.fmtDist(dist / 1000)); + print(num, "points"); + } + } + ui.drawMsg(num + "\n" + fmt.fmtDist(dist / 1000)); + destination = prev; +} + +function time_read(n) { + print("Converting..."); + to_storage(n); + print("Running..."); + let v1 = getTime(); + let pp = {}; + pp.lat = 50; + pp.lon = 14.75; + pp.ppm = 0.08; /* Pixels per meter */ + pp.course = 270; + read(pp, n); + let v2 = getTime(); + print("Read took", (v2-v1), "seconds"); + step_init(); + print(num, "points", dist, "distance"); + setTimeout(step, 1000); +} + +var track_name = "", inf, point_num, track = [], track_points = 30, north = {}; + +function step_init() { + inf = require("Storage").open(track_name + ".st", "r"); + north = {}; + north.lat = 89.9; + north.lon = 0; + point_num = 0; + track = []; +} + +function load_next() { + while (track.length < track_points) { + let l = inf.readLine(); + if (l === undefined) { + print("End of track"); + ui.drawMsg("End of track"); + break; + } + let p = egt.parse(l); + if (!p.lat) { + print("No latitude?"); + continue; + } + p.point_num = point_num++; + p.passed = 0; + print("Loading ", p.point_num); + track.push(p); + } +} + +function paint_all(pp) { + let prev = 0; + let mDist = 99999999999, m = 0; + const fast = 0; + + g.setColor(1, 0, 0); + for (let i = 1; i < track.length; i++) { + p = track[i]; + prev = track[i-1]; + if (0 && fmt.distance(p, pp) < 100) + p.passed = 1; + if (!fast) { + let d = distSegment(prev, p, pp); + if (d < mDist) { + mDist = d; + m = i; + } else { + g.setColor(0, 0, 0); + } + } + paint(pp, prev, p, 3); + } + if (fast) + return { quiet: 0, offtrack : 0 }; + print("Best segment was", m, "dist", mDist); + let ahead = 0, a = fmt.bearing(track[m-1], track[m]), quiet = -1; + for (let i = m+1; i < track.length; i++) { + let a2 = fmt.bearing(track[i-1], track[i]); + let ad = angleDifference(a, a2); + if (Math.abs(ad) > 20) { + if (quiet == -1) + quiet = ahead + fmt.distance(pp, track[i-1]); + print("...straight", ahead); + a = a2; + } + ahead += fmt.distance(track[i-1], track[i]); + } + print("...see", ahead); + return { quiet: quiet, offtrack: mDist }; +} + +function step_to(pp, pass_all) { + pp.x = ui.w/2; + pp.y = ui.h*0.66; + + g.setColor(0.5, 0.5, 1); + let sc = 2.5; + g.fillPoly([ pp.x, pp.y, pp.x - 5*sc, pp.y + 12*sc, pp.x + 5*sc, pp.y + 12*sc ]); + + if (0) { + g.setColor(0.5, 0.5, 1); + paint(pp, pp, destination, 1); + + g.setColor(1, 0.5, 0.5); + paint(pp, pp, north, 1); + } + + let quiet = paint_all(pp); + + if ((pass_all || track[0].passed) && distSegment(track[0], track[1], pp) > 150) { + print("Dropping ", track[0].point_num); + track.shift(); + } + return quiet; +} + +var demo_mode = 0; + +function step() { + const fast = 0; + let v1 = getTime(); + g.reset().clear(); + + fix = gps.getGPSFix(); + + load_next(); + + let pp = fix; + pp.ppm = 0.08 * 3; /* Pixels per meter */ + + if (!fix.fix) { + let i = 2; + pp.lat = track[i].lat; + pp.lon = track[i].lon; + pp.course = fmt.bearing(track[i], track[i+1]); + } + + let quiet = step_to(pp, 1); + + if (!fast) { + g.setFont("Vector", 31); + g.setFontAlign(-1, -1); + msg = "\noff " + fmt.fmtDist(quiet.offtrack/1000); + g.drawString(fmt.fmtFix(fix, getTime()-gps.gps_start) + msg, 3, 3); + } + if (!fast) { + g.setFont("Vector", 23); + g.setColor(0, 0, 0); + g.setFontAlign(-1, 1); + g.drawString(fmt.fmtNow(), 3, ui.h); + g.setFontAlign(1, 1); + g.drawString(fmt.fmtDist(quiet.quiet/1000), ui.w-3, ui.h); + } + + if (quiet < 200) + Bangle.setLCDPower(1); + + if (demo_mode) + track.shift(); + let v2 = getTime(); + print("Step took", (v2-v1), "seconds"); + setTimeout(step, 100); +} + +function recover() { + ui.drawMsg("Recover..."); + step_init(); + fix = gps.getGPSFix(); + let pp = fix; + pp.ppm = 0.08 * 3; /* Pixels per meter */ + if (!fix.fix) { + print("Can't recover with no fix\n"); + fix.lat = 50.0122; + fix.lon = 14.7780; + } + load_next(); + load_next(); + while(1) { + let d = distSegment(track[0], track[1], pp); + print("Recover, d", d); + if (d < 400) + break; + track.shift(); + if (0) + step_to(pp, 1); + load_next(); + ui.drawMsg("Recover\n" + fmt.fmtDist(d / 1000)); + } +} + +function to_storage(n) { + let f2 = require("Storage").open(n+".st", "w"); + let pos = 0; + let size = 1024; + while (1) { + let d = require("Storage").read(n, pos, size); + if (!d) + break; + f2.write(d); + pos += size; + print("Copy ", pos); + } +} + +ui.init(); +fmt.init(); +egt.init(); +gps.init(); +gps.start_gps(); + +const st = require('Storage'); + +let l = /^t\..*\.egt$/; +l = st.list(l, {sf:false}); + +print(l); + +function load_track(x) { + print("Loading", x); + Bangle.buzz(50, 1); // Won't happen because load() is quicker + g.reset().clear() + .setFont("Vector", 40) + .drawString("Loading", 0, 30) + .drawString(x, 0, 80); + g.flip(); + track_name = x; + time_read(x); + + Bangle.setUI("clockupdown", btn => { + print("Button", btn); + if (btn == -1) { + recover(); + } + if (btn == 1) { + demo_mode = 1; + } + }); +} + +var menu = { + "< Back" : Bangle.load +}; +if (l.length==0) menu["No tracks"] = ()=>{}; +else for (let id in l) { + let i = id; + menu[l[id]]=()=>{ load_track(l[i]); }; +} + +g.clear(); +E.showMenu(menu); + From e876804ebcc0b89943583999d8d241d7829d2f18 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 29 Aug 2024 09:11:00 +0200 Subject: [PATCH 044/451] trail: fix warnings --- apps/trail/trail.app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/trail/trail.app.js b/apps/trail/trail.app.js index 38bf5505ae..17f2ffc88e 100644 --- a/apps/trail/trail.app.js +++ b/apps/trail/trail.app.js @@ -455,7 +455,7 @@ function paint_all(pp) { g.setColor(1, 0, 0); for (let i = 1; i < track.length; i++) { - p = track[i]; + let p = track[i]; prev = track[i-1]; if (0 && fmt.distance(p, pp) < 100) p.passed = 1; @@ -521,7 +521,7 @@ function step() { let v1 = getTime(); g.reset().clear(); - fix = gps.getGPSFix(); + let fix = gps.getGPSFix(); load_next(); @@ -540,7 +540,7 @@ function step() { if (!fast) { g.setFont("Vector", 31); g.setFontAlign(-1, -1); - msg = "\noff " + fmt.fmtDist(quiet.offtrack/1000); + let msg = "\noff " + fmt.fmtDist(quiet.offtrack/1000); g.drawString(fmt.fmtFix(fix, getTime()-gps.gps_start) + msg, 3, 3); } if (!fast) { @@ -565,7 +565,7 @@ function step() { function recover() { ui.drawMsg("Recover..."); step_init(); - fix = gps.getGPSFix(); + let fix = gps.getGPSFix(); let pp = fix; pp.ppm = 0.08 * 3; /* Pixels per meter */ if (!fix.fix) { From 19e9fa8361d6643a9e278653db544c36ee83ecf0 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 20 Jul 2024 22:17:36 +0200 Subject: [PATCH 045/451] sixths: fix issues in emulator, a bit bigger font --- apps/sixths/sixths.app.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index c5fb3b9cf8..a0ea2c101b 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -547,7 +547,9 @@ function draw() { msg = gpsHandle(); } else { let o = Bangle.getOptions(); - msg = o.seaLevelPressure.toFixed(1) + "hPa"; + let pr = o.seaLevelPressure; + if (pr) + msg = pr.toFixed(1) + "hPa"; if (note != "") { msg = note; } @@ -563,7 +565,8 @@ function draw() { //let km = 0.001 * 0.719 * Bangle.getHealthStatus("day").steps; g.setFontAlign(-1, 1); - g.setFont('Vector', 26); + // 33 still fits + g.setFont('Vector', 30); const weekday = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]; @@ -585,7 +588,10 @@ function draw() { o.seaLevelPressure = o.seaLevelPressure + a; Bangle.setOptions(o); } - msg = o.seaLevelPressure.toFixed(1) + "hPa"; + let pr = o.seaLevelPressure; + msg = "emu?"; + if (pr) + msg = pr.toFixed(1) + "hPa"; } else { msg = fmtAlt(cur_altitude); } From 661bf324fd40a27b00f1261af555072f6728c4c3 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 20 Jul 2024 22:39:31 +0200 Subject: [PATCH 046/451] sixths: Refactor info printing, so we can scroll down less important stuff --- apps/sixths/sixths.app.js | 51 +++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index a0ea2c101b..09ba8679e7 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -542,18 +542,6 @@ function draw() { g.setColor(0.25, 1, 1); g.fillPoly([ W/2, 24, W, 80, 0, 80 ]); } - let msg = ""; - if (gps_on) { - msg = gpsHandle(); - } else { - let o = Bangle.getOptions(); - let pr = o.seaLevelPressure; - if (pr) - msg = pr.toFixed(1) + "hPa"; - if (note != "") { - msg = note; - } - } drawBackground(); let now = new Date(); @@ -564,16 +552,21 @@ function draw() { //let km = 0.001 * 0.719 * Bangle.getHealthStatus("day").steps; - g.setFontAlign(-1, 1); // 33 still fits g.setFont('Vector', 30); const weekday = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]; + + msg = weekday[now.getDay()] + "" + now.getDate() + ". " + + fmtSteps(Bangle.getHealthStatus("day").steps) + "\n"; - g.drawString(weekday[now.getDay()] + "" + now.getDate() + ". " - + fmtSteps(Bangle.getHealthStatus("day").steps), 10, 115); - - g.drawString(msg, 10, 145); + if (gps_on) { + msg += gpsHandle() + "\n"; + } + + if (cur_mark) { + msg += markHandle() + "\n"; + } if (getTime() - last_active > 15*60) { let alt_adjust = cur_altitude - rest_altitude; @@ -589,17 +582,27 @@ function draw() { Bangle.setOptions(o); } let pr = o.seaLevelPressure; - msg = "emu?"; if (pr) - msg = pr.toFixed(1) + "hPa"; + msg += pr.toFixed(1) + "hPa"; + else + msg += "emu?"; } else { - msg = fmtAlt(cur_altitude); + msg += fmtAlt(cur_altitude); } - msg = msg + " " + cur_temperature.toFixed(1)+icon_c; - if (cur_mark) { - msg = markHandle(); + msg = msg + " " + cur_temperature.toFixed(1)+icon_c + "\n"; + + if (note != "") + msg += note + "\n"; + + { + let o = Bangle.getOptions(); + let pr = o.seaLevelPressure; + + if (pr) + msg += pr.toFixed(1) + "hPa\n"; } - g.drawString(msg, 10, 175); + g.setFontAlign(-1, -1); + g.drawString(msg, 10, 85); if (disp_mode == 1) { g.drawString(debug, 10, 45); From 490f37f7c6b354db91c90d2baac78a379c5f5d7e Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 20 Jul 2024 22:49:29 +0200 Subject: [PATCH 047/451] siths: Acknowledge commands. --- apps/sixths/sixths.app.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 09ba8679e7..f5ac5ef0b6 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -154,7 +154,7 @@ function gpsHandle() { msg = "L"+ fmtTimeDiff(getTime()-last_fix); else { msg = "N"+ fmtTimeDiff(getTime()-gps_on); - if (fix) { + if (0 && fix) { msg += " " + fix.satellites + "sats"; } } @@ -238,6 +238,10 @@ function selectWP(i) { show("WP:"+wp.name, 60); print("Select waypoint: ", cur_mark); } +function ack(cmd) { + show(cmd, 3); + doBuzz(' .'); +} function inputHandler(s) { print("Ascii: ", s, s[0], s[1]); if (s[0] == '^') { @@ -265,22 +269,23 @@ function inputHandler(s) { show("Bat "+bat+"%", 60); break; } - case 'D': selectWP(1); break; - case 'F': gpsOff(); show("GPS off", 3); break; - case 'G': gpsOn(); gps_limit = getTime() + 60*60*4; show("GPS on", 3); break; + case 'D': doBuzz(' .'); selectWP(1); break; + case 'F': gpsOff(); ack("GPS off"); break; + case 'T': gpsOn(); gps_limit = getTime() + 60*60*4; ack("GPS on"); break; case 'I': + doBuzz(' .'); disp_mode += 1; if (disp_mode == 2) { disp_mode = 0; } break; case 'L': aload("altimeter.app.js"); break; - case 'M': mode = 2; show("M>", 10); cur_mark = markNew(); mode_time = getTime(); break; - case 'N': mode = 1; show(">", 10); mode_time = getTime(); break; + case 'M': doBuzz(' .'); mode = 2; show("M>", 10); cur_mark = markNew(); mode_time = getTime(); break; + case 'N': doBuzz(' .'); mode = 1; show(">", 10); mode_time = getTime(); break; case 'O': aload("orloj.app.js"); break; case 'R': aload("runplus.app.js"); break; - case 'S': gpsOn(); gps_limit = getTime() + 60*30; gps_speed_limit = gps_limit; show("GPS on", 3); break; - case 'T': { + case 'S': gpsOn(); gps_limit = getTime() + 60*30; gps_speed_limit = gps_limit; ack("GPS speed"); break; + case 'G': { s = ' T'; let d = new Date(); s += d.getHours() % 10; @@ -288,8 +293,9 @@ function inputHandler(s) { doBuzz(toMorse(s)); break; } - case 'U': selectWP(-1); break; - case 'Y': doBuzz(buzz); Bangle.resetCompass(); break; + case 'U': doBuzz(' .'); selectWP(-1); break; + case 'Y': ack('Compass reset'); Bangle.resetCompass(); break; + default: doBuzz(' ..'); show("Unknown "+s, 5); break; } } const morseDict = { From 2e8a52198ddbfb8afa51dfaff95c1359146116f3 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 20 Jul 2024 23:01:08 +0200 Subject: [PATCH 048/451] sixths: fix docs, adjust times for keeping the gps fix. --- apps/sixths/README.md | 6 +++--- apps/sixths/sixths.app.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 18aa85bebb..6f66386668 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -26,8 +26,8 @@ Useful gestures: B -- "Battery", show/buzz battery info D -- "Down", previous waypoint -F -- "oFf", disable GPS. -G -- "Gps", enable GPS for 4 hours in low power mode. +F -- "turn oFf gps", disable GPS. +T -- "Turn on gps", enable GPS for 4 hours in low power mode. I -- "Info", toggle info display L -- "aLtimeter", load altimeter app M -- "Mark", create mark from current position @@ -35,7 +35,7 @@ N -- "Note", take a note and write it to the log. O -- "Orloj", run orloj app R -- "Run", run "runplus" app S -- "Speed", enable GPS for 30 minutes in high power mode. - T -- "Time", buzz current time + G -- "Get time", buzz current time U -- "Up", next waypoint Y -- "compass", reset compass diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index f5ac5ef0b6..93145db5bb 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -22,7 +22,8 @@ var gps_on = 0, // time GPS was turned on last_restart = 0, last_pause = 0, last_fstart = 0; // utime var gps_needed = 0, // how long to wait for a fix gps_limit = 0, // timeout -- when to stop recording - gps_speed_limit = 0; + gps_speed_limit = 0, + keep_fix_for = 10; var prev_fix = null; var gps_dist = 0; @@ -148,6 +149,11 @@ function gpsHandle() { if (!last_fstart) last_fstart = getTime(); last_fix = getTime(); + keep_fix_for = gps_needed / 3; + if (keep_fix_for < 10) + keep_fix_for = 10; + if (keep_fix_for > 3*60) + keep_fix_for = 3*60; gps_needed = 60; } else { if (last_fix) @@ -164,7 +170,7 @@ function gpsHandle() { let d2 = (getTime()-last_fstart); print("gps on, restarted ", d, gps_needed, d2, fix.lat); if (getTime() > gps_speed_limit && - (d > gps_needed || (last_fstart && d2 > 10))) { + (d > gps_needed || (last_fstart && d2 > keep_fix_for))) { gpsPause(); gps_needed = gps_needed * 1.5; print("Pausing, next try", gps_needed); From a06e73b31681876d9f226926b0188f24f912af76 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 26 Jul 2024 16:24:34 +0200 Subject: [PATCH 049/451] sixths: Allow keeping distances over restarts, better debug display implementation --- apps/sixths/sixths.app.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 93145db5bb..a9a5558b57 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -12,14 +12,15 @@ var buzz = "", /* Set this to transmit morse via vibrations */ inm = "", l = "", /* For incoming morse handling */ in_str = "", note = "", - debug = "v0.04.1", debug2 = "(otherdb)", debug3 = "(short)"; + debug = "v0.05.1", debug2 = "(otherdb)", debug3 = "(short)"; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time // GPS handling var gps_on = 0, // time GPS was turned on last_fix = 0, // time of last fix - last_restart = 0, last_pause = 0, last_fstart = 0; // utime + last_restart = 0, last_pause = 0; // utime + last_fstart = 0; // utime, time of start of last fix var gps_needed = 0, // how long to wait for a fix gps_limit = 0, // timeout -- when to stop recording gps_speed_limit = 0, @@ -85,12 +86,14 @@ function gpsPause() { last_restart = 0; last_pause = getTime(); } +function gpsReset() { + prev_fix = null; + gps_dist = 0; +} function gpsOn() { gps_on = getTime(); gps_needed = 1000; last_fix = 0; - prev_fix = null; - gps_dist = 0; gpsRestart(); } function gpsOff() { @@ -128,6 +131,8 @@ function gpsHandleFix(fix) { } function gpsHandle() { let msg = ""; + debug2 = "Ne" + gps_needed; + debug3 = "Ke" + keep_fix_for; if (!last_restart) { let d = (getTime()-last_pause); if (last_fix) @@ -149,11 +154,11 @@ function gpsHandle() { if (!last_fstart) last_fstart = getTime(); last_fix = getTime(); - keep_fix_for = gps_needed / 3; + keep_fix_for = gps_needed / 1.5; if (keep_fix_for < 10) keep_fix_for = 10; - if (keep_fix_for > 3*60) - keep_fix_for = 3*60; + if (keep_fix_for > 4*60) + keep_fix_for = 4*60; gps_needed = 60; } else { if (last_fix) @@ -289,7 +294,8 @@ function inputHandler(s) { case 'M': doBuzz(' .'); mode = 2; show("M>", 10); cur_mark = markNew(); mode_time = getTime(); break; case 'N': doBuzz(' .'); mode = 1; show(">", 10); mode_time = getTime(); break; case 'O': aload("orloj.app.js"); break; - case 'R': aload("runplus.app.js"); break; + case 'R': gpsReset(); ack("GPS reset"); break; + case 'P': aload("runplus.app.js"); break; case 'S': gpsOn(); gps_limit = getTime() + 60*30; gps_speed_limit = gps_limit; ack("GPS speed"); break; case 'G': { s = ' T'; @@ -617,9 +623,8 @@ function draw() { g.drawString(msg, 10, 85); if (disp_mode == 1) { - g.drawString(debug, 10, 45); - g.drawString(debug2, 10, 65); - g.drawString(debug3, 10, 85); + g.setFont('Vector', 21); + g.drawString(debug + "\n" + debug2 + "\n" + debug3, 10, 20); } queueDraw(); From 8d6c4f70caab1a4a1eafd26e954f501959276bdd Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 26 Jul 2024 17:21:21 +0200 Subject: [PATCH 050/451] sixths: This should fix keep_fix_for logic --- apps/sixths/sixths.app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index a9a5558b57..86c6241be2 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -115,7 +115,8 @@ function gpsHandleFix(fix) { doBuzz(" ."); prev_fix = fix; } - if (1) { + if (0) { + /* Display error between GPS and system time */ let now1 = Date(); let now2 = fix.time; let n1 = now1.getMinutes() * 60 + now1.getSeconds(); @@ -154,7 +155,7 @@ function gpsHandle() { if (!last_fstart) last_fstart = getTime(); last_fix = getTime(); - keep_fix_for = gps_needed / 1.5; + keep_fix_for = (last_fstart - last_restart) / 2; if (keep_fix_for < 10) keep_fix_for = 10; if (keep_fix_for > 4*60) @@ -175,7 +176,7 @@ function gpsHandle() { let d2 = (getTime()-last_fstart); print("gps on, restarted ", d, gps_needed, d2, fix.lat); if (getTime() > gps_speed_limit && - (d > gps_needed || (last_fstart && d2 > keep_fix_for))) { + ((d > gps_needed && !last_fstart) || (last_fstart && d2 > keep_fix_for))) { gpsPause(); gps_needed = gps_needed * 1.5; print("Pausing, next try", gps_needed); From 23d2766bf130fe98f185578d4a4830bee65195f0 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 26 Jul 2024 17:37:08 +0200 Subject: [PATCH 051/451] sixths: This should keep power with GPS on --- apps/sixths/README.md | 11 ----------- apps/sixths/sixths.app.js | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 6f66386668..9c5d25b363 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -73,9 +73,6 @@ Todo: *) only turn on compass when needed -*) only warn about battery low when it crosses thresholds, update -battery low message - *) rename "show" to something else -- it collides with built-in *) adjust clock according to GPS @@ -84,16 +81,8 @@ battery low message *) hide messages after timeout. -*) show route lengths after the fact - *) implement longer recording than "G". -*) Probably T should be G. - -*) sum gps distances for a day - *) allow setting up home altitude, or at least disable auto-calibration *) show time-to-sunset / sunrise? - -*) one-second updates when gps is active \ No newline at end of file diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 86c6241be2..56b616846e 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -754,7 +754,8 @@ function lockHandler(locked) { function queueDraw() { let next; - if (getTime() - last_unlocked > 3*60) + if ((getTime() - last_unlocked > 3*60) && + (getTime() > gps_limit)) next = 60000; else next = 1000; From d9fa77f8183ba7457f40128522707490c876e4cc Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 26 Jul 2024 17:42:50 +0200 Subject: [PATCH 052/451] sixths: Implement hiding info after timeout --- apps/sixths/sixths.app.js | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 56b616846e..e779c08f12 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -13,6 +13,7 @@ var buzz = "", /* Set this to transmit morse via vibrations */ in_str = "", note = "", debug = "v0.05.1", debug2 = "(otherdb)", debug3 = "(short)"; +var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time @@ -111,7 +112,7 @@ function fmtTimeDiff(d) { } function gpsHandleFix(fix) { if (!prev_fix) { - show("GPS acquired", 10); + showMsg("GPS acquired", 10); doBuzz(" ."); prev_fix = fix; } @@ -213,7 +214,7 @@ function markHandle() { return msg; } function entryDone() { - show(":" + in_str); + showMsg(":" + in_str); doBuzz(" ."); switch (mode) { case 1: logstamp(">" + in_str); break; @@ -237,7 +238,7 @@ function selectWP(i) { if (sel_wp >= waypoints.length) sel_wp = waypoints.length - 1; if (sel_wp < 0) { - show("No WPs", 60); + showMsg("No WPs", 60); } let wp = waypoints[sel_wp]; cur_mark = {}; @@ -247,11 +248,11 @@ function selectWP(i) { cur_mark.fix.fix = 1; cur_mark.fix.lat = wp.lat; cur_mark.fix.lon = wp.lon; - show("WP:"+wp.name, 60); + showMsg("WP:"+wp.name, 60); print("Select waypoint: ", cur_mark); } function ack(cmd) { - show(cmd, 3); + showMsg(cmd, 3); doBuzz(' .'); } function inputHandler(s) { @@ -265,7 +266,7 @@ function inputHandler(s) { } if ((mode == 1) || (mode == 2)){ in_str = in_str + s; - show(">"+in_str, 10); + showMsg(">"+in_str, 10); mode_time = getTime(); return; } @@ -278,7 +279,7 @@ function inputHandler(s) { else s = s+(bat/5); doBuzz(toMorse(s)); - show("Bat "+bat+"%", 60); + showMsg("Bat "+bat+"%", 60); break; } case 'D': doBuzz(' .'); selectWP(1); break; @@ -292,8 +293,8 @@ function inputHandler(s) { } break; case 'L': aload("altimeter.app.js"); break; - case 'M': doBuzz(' .'); mode = 2; show("M>", 10); cur_mark = markNew(); mode_time = getTime(); break; - case 'N': doBuzz(' .'); mode = 1; show(">", 10); mode_time = getTime(); break; + case 'M': doBuzz(' .'); mode = 2; showMsg("M>", 10); cur_mark = markNew(); mode_time = getTime(); break; + case 'N': doBuzz(' .'); mode = 1; showMsg(">", 10); mode_time = getTime(); break; case 'O': aload("orloj.app.js"); break; case 'R': gpsReset(); ack("GPS reset"); break; case 'P': aload("runplus.app.js"); break; @@ -308,7 +309,7 @@ function inputHandler(s) { } case 'U': doBuzz(' .'); selectWP(-1); break; case 'Y': ack('Compass reset'); Bangle.resetCompass(); break; - default: doBuzz(' ..'); show("Unknown "+s, 5); break; + default: doBuzz(' ..'); showMsg("Unknown "+s, 5); break; } } const morseDict = { @@ -429,13 +430,14 @@ function hourly() { let bat = E.getBattery(); if (bat < 25) { s = ' B'; - show("Bat "+bat+"%", 60); + showMsg("Bat "+bat+"%", 60); } if (is_active) doBuzz(toMorse(s)); //logstamp(""); } -function show(msg, timeout) { +function showMsg(msg, timeout) { + note_limit = getTime() + timeout; note = msg; } function fivemin() { @@ -587,6 +589,13 @@ function draw() { msg += markHandle() + "\n"; } + if (note != "") { + if (getTime() > note_limit) + note = ""; + else + msg += note + "\n"; + } + if (getTime() - last_active > 15*60) { let alt_adjust = cur_altitude - rest_altitude; let abs = Math.abs(alt_adjust); @@ -608,10 +617,8 @@ function draw() { } else { msg += fmtAlt(cur_altitude); } - msg = msg + " " + cur_temperature.toFixed(1)+icon_c + "\n"; - if (note != "") - msg += note + "\n"; + msg = msg + " " + cur_temperature.toFixed(1)+icon_c + "\n"; { let o = Bangle.getOptions(); From fda027fa18c107f11f158bc7c097000b5f0cd04e Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 27 Jul 2024 19:06:35 +0200 Subject: [PATCH 053/451] sixths: Get my location from... mylocation. --- apps/sixths/README.md | 12 +++--------- apps/sixths/sixths.app.js | 10 +++++----- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 9c5d25b363..939d162e6e 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -33,7 +33,8 @@ I -- "Info", toggle info display M -- "Mark", create mark from current position N -- "Note", take a note and write it to the log. O -- "Orloj", run orloj app - R -- "Run", run "runplus" app + P -- "runPlus", run "runplus" app +R -- "Reset" daily statistics S -- "Speed", enable GPS for 30 minutes in high power mode. G -- "Get time", buzz current time U -- "Up", next waypoint @@ -44,6 +45,7 @@ to communicate back to the user. B -- battery low. E -- acknowledge, gesture understood. +I -- unknown gesture. T -- start of new hour. Three colored dots may appear on display. North is on the 12 o'clock @@ -73,14 +75,6 @@ Todo: *) only turn on compass when needed -*) rename "show" to something else -- it collides with built-in - -*) adjust clock according to GPS - -*) show something more reasonable than (NOTEHERE). - -*) hide messages after timeout. - *) implement longer recording than "G". *) allow setting up home altitude, or at least disable auto-calibration diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index e779c08f12..83631522fe 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -1,8 +1,7 @@ // Sixth sense /* eslint-disable no-unused-vars */ -// Options you'll want to edit -const rest_altitude = 354; +var location; const W = g.getWidth(); const H = g.getHeight(); @@ -12,7 +11,7 @@ var buzz = "", /* Set this to transmit morse via vibrations */ inm = "", l = "", /* For incoming morse handling */ in_str = "", note = "", - debug = "v0.05.1", debug2 = "(otherdb)", debug3 = "(short)"; + debug = "v0.05.2", debug2 = "(otherdb)", debug3 = "(short)"; var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time @@ -597,14 +596,14 @@ function draw() { } if (getTime() - last_active > 15*60) { - let alt_adjust = cur_altitude - rest_altitude; + let alt_adjust = cur_altitude - location.alt; let abs = Math.abs(alt_adjust); print("adj", alt_adjust); let o = Bangle.getOptions(); if (abs > 10 && abs < 150) { let a = 0.01; // FIXME: draw is called often compared to alt reading - if (cur_altitude > rest_altitude) + if (cur_altitude > location.alt) a = -a; o.seaLevelPressure = o.seaLevelPressure + a; Bangle.setOptions(o); @@ -789,6 +788,7 @@ function start() { } draw(); + location = require("Storage").readJSON("mylocation.json",1)||{"lat":50,"lon":14.45,"alt":354,"location":"Woods"}; loadWPs(); buzzTask(); if (0) From 522a53c5b73497ee2067f26e35f68e880e49b533 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 27 Jul 2024 19:27:41 +0200 Subject: [PATCH 054/451] sixths: move state into struct so we can save it --- apps/sixths/sixths.app.js | 82 ++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 83631522fe..99588f5f3e 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -16,17 +16,23 @@ var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time +var state = { + gps_limit: 0, // timeout -- when to stop recording + gps_speed_limit: 0, + prev_fix: null, + gps_dist: 0, + + // Marks + cur_mark: null, +}; + // GPS handling var gps_on = 0, // time GPS was turned on last_fix = 0, // time of last fix last_restart = 0, last_pause = 0; // utime last_fstart = 0; // utime, time of start of last fix var gps_needed = 0, // how long to wait for a fix - gps_limit = 0, // timeout -- when to stop recording - gps_speed_limit = 0, keep_fix_for = 10; -var prev_fix = null; -var gps_dist = 0; var mark_heading = -1; @@ -39,9 +45,6 @@ var is_level = false; var cur_altitude = 0; var cur_temperature = 0; -// Marks -var cur_mark = null; - // Icons var icon_alt = "\0\x08\x1a\1\x00\x00\x00\x20\x30\x78\x7C\xFE\xFF\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00"; @@ -87,8 +90,8 @@ function gpsPause() { last_pause = getTime(); } function gpsReset() { - prev_fix = null; - gps_dist = 0; + state.prev_fix = null; + state.gps_dist = 0; } function gpsOn() { gps_on = getTime(); @@ -110,10 +113,10 @@ function fmtTimeDiff(d) { return ""+d.toFixed(0)+"m"; } function gpsHandleFix(fix) { - if (!prev_fix) { + if (!state.prev_fix) { showMsg("GPS acquired", 10); doBuzz(" ."); - prev_fix = fix; + state.prev_fix = fix; } if (0) { /* Display error between GPS and system time */ @@ -124,10 +127,10 @@ function gpsHandleFix(fix) { debug2 = "te "+(n2-n1)+"s"; } loggps(fix); - let d = calcDistance(fix, prev_fix); + let d = calcDistance(fix, state.prev_fix); if (d > 30) { - prev_fix = fix; - gps_dist += d/1000; + state.prev_fix = fix; + state.gps_dist += d/1000; } } function gpsHandle() { @@ -182,33 +185,33 @@ function gpsHandle() { print("Pausing, next try", gps_needed); } } - msg += " "+gps_dist.toFixed(1)+icon_km; + msg += " "+state.gps_dist.toFixed(1)+icon_km; return msg; } function markNew() { let r = {}; r.time = getTime(); - r.fix = prev_fix; + r.fix = state.prev_fix; r.steps = Bangle.getHealthStatus("day").steps; - r.gps_dist = gps_dist; + r.gps_dist = state.gps_dist; r.altitude = cur_altitude; r.name = "auto"; return r; } function markHandle() { - let m = cur_mark; + let m = state.cur_mark; let msg = m.name + ">"; if (m.time) { msg += fmtTimeDiff(getTime()- m.time); } - if (prev_fix && prev_fix.fix && m.fix && m.fix.fix) { - let s = fmtDist(calcDistance(m.fix, prev_fix)/1000) + icon_km; + if (state.prev_fix && state.prev_fix.fix && m.fix && m.fix.fix) { + let s = fmtDist(calcDistance(m.fix, state.prev_fix)/1000) + icon_km; msg += " " + s; debug = "wp>" + s; - mark_heading = 180 + calcBearing(m.fix, prev_fix); + mark_heading = 180 + calcBearing(m.fix, state.prev_fix); debug2 = "wp>" + mark_heading; } else { - msg += " w" + fmtDist(gps_dist - m.gps_dist); + msg += " w" + fmtDist(state.gps_dist - m.gps_dist); } return msg; } @@ -217,7 +220,7 @@ function entryDone() { doBuzz(" ."); switch (mode) { case 1: logstamp(">" + in_str); break; - case 2: cur_mark.name = in_str; break; + case 2: state.cur_mark.name = in_str; break; } in_str = 0; mode = 0; @@ -240,15 +243,15 @@ function selectWP(i) { showMsg("No WPs", 60); } let wp = waypoints[sel_wp]; - cur_mark = {}; - cur_mark.name = wp.name; - cur_mark.gps_dist = 0; /* HACK */ - cur_mark.fix = {}; - cur_mark.fix.fix = 1; - cur_mark.fix.lat = wp.lat; - cur_mark.fix.lon = wp.lon; + state.cur_mark = {}; + state.cur_mark.name = wp.name; + state.cur_mark.gps_dist = 0; /* HACK */ + state.cur_mark.fix = {}; + state.cur_mark.fix.fix = 1; + state.cur_mark.fix.lat = wp.lat; + state.cur_mark.fix.lon = wp.lon; showMsg("WP:"+wp.name, 60); - print("Select waypoint: ", cur_mark); + print("Select waypoint: ", state.cur_mark); } function ack(cmd) { showMsg(cmd, 3); @@ -283,7 +286,7 @@ function inputHandler(s) { } case 'D': doBuzz(' .'); selectWP(1); break; case 'F': gpsOff(); ack("GPS off"); break; - case 'T': gpsOn(); gps_limit = getTime() + 60*60*4; ack("GPS on"); break; + case 'T': gpsOn(); state.gps_limit = getTime() + 60*60*4; ack("GPS on"); break; case 'I': doBuzz(' .'); disp_mode += 1; @@ -292,12 +295,12 @@ function inputHandler(s) { } break; case 'L': aload("altimeter.app.js"); break; - case 'M': doBuzz(' .'); mode = 2; showMsg("M>", 10); cur_mark = markNew(); mode_time = getTime(); break; + case 'M': doBuzz(' .'); mode = 2; showMsg("M>", 10); state.cur_mark = markNew(); mode_time = getTime(); break; case 'N': doBuzz(' .'); mode = 1; showMsg(">", 10); mode_time = getTime(); break; case 'O': aload("orloj.app.js"); break; case 'R': gpsReset(); ack("GPS reset"); break; case 'P': aload("runplus.app.js"); break; - case 'S': gpsOn(); gps_limit = getTime() + 60*30; gps_speed_limit = gps_limit; ack("GPS speed"); break; + case 'S': gpsOn(); state.gps_limit = getTime() + 60*30; state.gps_speed_limit = state.gps_limit; ack("GPS speed"); break; case 'G': { s = ' T'; let d = new Date(); @@ -458,7 +461,7 @@ function every(now) { } mode = 0; } - if (gps_on && getTime() > gps_limit && getTime() > gps_speed_limit) { + if (gps_on && getTime() > state.gps_limit && getTime() > state.gps_speed_limit) { Bangle.setGPSPower(0, "sixths"); gps_on = 0; } @@ -529,9 +532,9 @@ function drawBackground() { drawDot(h, 0.7, 10); } } - if (prev_fix && prev_fix.fix) { + if (state.prev_fix && state.prev_fix.fix) { g.setColor(0.5, 1, 0.5); - drawDot(prev_fix.course, 0.5, 6); + drawDot(state.prev_fix.course, 0.5, 6); } if (mark_heading != -1) { g.setColor(1, 0.5, 0.5); @@ -584,7 +587,7 @@ function draw() { msg += gpsHandle() + "\n"; } - if (cur_mark) { + if (state.cur_mark) { msg += markHandle() + "\n"; } @@ -761,7 +764,7 @@ function lockHandler(locked) { function queueDraw() { let next; if ((getTime() - last_unlocked > 3*60) && - (getTime() > gps_limit)) + (getTime() > state.gps_limit)) next = 60000; else next = 1000; @@ -789,6 +792,7 @@ function start() { draw(); location = require("Storage").readJSON("mylocation.json",1)||{"lat":50,"lon":14.45,"alt":354,"location":"Woods"}; + state = require("Storage").readJSON("sixths.json",1)||state; loadWPs(); buzzTask(); if (0) From ee934d5bb55171dc482e14caeb963789e8c2c5e0 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 27 Jul 2024 21:04:47 +0200 Subject: [PATCH 055/451] sixths: fixup moving to struct. --- apps/sixths/sixths.app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 99588f5f3e..ee2128a0a1 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -11,7 +11,7 @@ var buzz = "", /* Set this to transmit morse via vibrations */ inm = "", l = "", /* For incoming morse handling */ in_str = "", note = "", - debug = "v0.05.2", debug2 = "(otherdb)", debug3 = "(short)"; + debug = "v0.05.3", debug2 = "(otherdb)", debug3 = "(short)"; var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time @@ -178,7 +178,7 @@ function gpsHandle() { let d = (getTime()-last_restart); let d2 = (getTime()-last_fstart); print("gps on, restarted ", d, gps_needed, d2, fix.lat); - if (getTime() > gps_speed_limit && + if (getTime() > state.gps_speed_limit && ((d > gps_needed && !last_fstart) || (last_fstart && d2 > keep_fix_for))) { gpsPause(); gps_needed = gps_needed * 1.5; From 1498c501d9e75185d82613ad5bf94ee4161052f9 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 21:21:59 +0200 Subject: [PATCH 056/451] sixths: start using fmt library. --- apps/sixths/README.md | 16 +++ apps/sixths/sixths.app.js | 244 +++++++++++++++++++++++++++++--------- 2 files changed, 205 insertions(+), 55 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 939d162e6e..2fe7ad484a 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -80,3 +80,19 @@ Todo: *) allow setting up home altitude, or at least disable auto-calibration *) show time-to-sunset / sunrise? + +*) "myprofile" to read step length + +*) +-3.5hPa 1012hPa + +*) keep GPS on longer + +*) display gps alt + offset to baro + +*) start logging altitudes, baro pressure + +*) compute climb/descent + +*) switch to compensated compass + +*) only accept gps fix when altitude matches baro \ No newline at end of file diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index ee2128a0a1..9ce647ec6c 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -1,6 +1,176 @@ // Sixth sense /* eslint-disable no-unused-vars */ +/* fmt library v0.2.2 */ +let fmt = { + icon_alt : "\0\x08\x1a\1\x00\x00\x00\x20\x30\x78\x7C\xFE\xFF\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00", + icon_m : "\0\x08\x1a\1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00", + icon_km : "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00", + icon_kph : "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\xFF\x00\xC3\xC3\xFF\xC3\xC3", + icon_c : "\0\x08\x1a\1\x00\x00\x60\x90\x90\x60\x00\x7F\xFF\xC0\xC0\xC0\xC0\xC0\xFF\x7F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + + /* 0 .. DD.ddddd + 1 .. DD MM.mmm' + 2 .. DD MM'ss" + */ + geo_mode : 1, + + init: function() {}, + fmtDist: function(km) { + if (km >= 1.0) return km.toFixed(1) + this.icon_km; + return (km*1000).toFixed(0) + this.icon_m; + }, + fmtSteps: function(n) { return this.fmtDist(0.001 * 0.719 * n); }, + fmtAlt: function(m) { return m.toFixed(0) + this.icon_alt; }, + draw_dot : 1, + add0: function(i) { + if (i > 9) { + return ""+i; + } else { + return "0"+i; + } + }, + fmtTOD: function(now) { + this.draw_dot = !this.draw_dot; + let dot = ":"; + if (!this.draw_dot) + dot = "."; + return now.getHours() + dot + this.add0(now.getMinutes()); + }, + fmtNow: function() { return this.fmtTOD(new Date()); }, + fmtTimeDiff: function(d) { + if (d < 180) + return ""+d.toFixed(0); + d = d/60; + return ""+d.toFixed(0)+"m"; + }, + fmtAngle: function(x) { + switch (this.geo_mode) { + case 0: + return "" + x; + case 1: { + let d = Math.floor(x); + let m = x - d; + m = m*60; + return "" + d + " " + m.toFixed(3) + "'"; + } + case 2: { + let d = Math.floor(x); + let m = x - d; + m = m*60; + let mf = Math.floor(m); + let s = m - mf; + s = s*60; + return "" + d + " " + mf + "'" + s.toFixed(0) + '"'; + } + } + return "bad mode?"; + }, + fmtPos: function(pos) { + let x = pos.lat; + let c = "N"; + if (x<0) { + c = "S"; + x = -x; + } + let s = c+this.fmtAngle(x) + "\n"; + c = "E"; + if (x<0) { + c = "W"; + x = -x; + } + return s + c + this.fmtAngle(x); + }, + fmtFix: function(fix, t) { + if (fix && fix.fix && fix.lat) { + return this.fmtSpeed(fix.speed) + " " + + this.fmtAlt(fix.alt); + } else { + return "N/FIX " + this.fmtTimeDiff(t); + } + }, + fmtSpeed: function(kph) { + return kph.toFixed(1) + this.icon_kph; + }, + radians: function(a) { return a*Math.PI/180; }, + degrees: function(a) { return a*180/Math.PI; }, + // distance between 2 lat and lons, in meters, Mean Earth Radius = 6371km + // https://www.movable-type.co.uk/scripts/latlong.html + // (Equirectangular approximation) + // returns value in meters + distance: function(a,b) { + var x = this.radians(b.lon-a.lon) * Math.cos(this.radians((a.lat+b.lat)/2)); + var y = this.radians(b.lat-a.lat); + return Math.sqrt(x*x + y*y) * 6371000; + }, + // thanks to waypointer + bearing: function(a,b) { + var delta = this.radians(b.lon-a.lon); + var alat = this.radians(a.lat); + var blat = this.radians(b.lat); + var y = Math.sin(delta) * Math.cos(blat); + var x = Math.cos(alat) * Math.sin(blat) - + Math.sin(alat)*Math.cos(blat)*Math.cos(delta); + return Math.round(this.degrees(Math.atan2(y, x))); + }, +}; + +/* gps library v0.1.2 */ +let gps = { + emulator: -1, + init: function(x) { + this.emulator = (process.env.BOARD=="EMSCRIPTEN" + || process.env.BOARD=="EMSCRIPTEN2")?1:0; + }, + state: {}, + on_gps: function(f) { + let fix = this.getGPSFix(); + f(fix); + + /* + "lat": number, // Latitude in degrees + "lon": number, // Longitude in degrees + "alt": number, // altitude in M + "speed": number, // Speed in kph + "course": number, // Course in degrees + "time": Date, // Current Time (or undefined if not known) + "satellites": 7, // Number of satellites + "fix": 1 // NMEA Fix state - 0 is no fix + "hdop": number, // Horizontal Dilution of Precision + */ + this.state.timeout = setTimeout(this.on_gps, 1000, f); + }, + off_gps: function() { + clearTimeout(this.state.timeout); + }, + getGPSFix: function() { + if (!this.emulator) + return Bangle.getGPSFix(); + let fix = {}; + fix.fix = 1; + fix.lat = 50; + fix.lon = 14-(getTime()-this.gps_start) / 1000; /* Go West! */ + fix.alt = 200; + fix.speed = 5; + fix.course = 30; + fix.time = Date(); + fix.satellites = 5; + fix.hdop = 12; + return fix; + }, + gps_start : -1, + start_gps: function() { + Bangle.setGPSPower(1, "libgps"); + this.gps_start = getTime(); + }, + stop_gps: function() { + Bangle.setGPSPower(0, "libgps"); + }, +}; + +fmt.init(); +gps.init(); + var location; const W = g.getWidth(); @@ -11,7 +181,7 @@ var buzz = "", /* Set this to transmit morse via vibrations */ inm = "", l = "", /* For incoming morse handling */ in_str = "", note = "", - debug = "v0.05.3", debug2 = "(otherdb)", debug3 = "(short)"; + debug = "v0.6.0", debug2 = "(otherdb)", debug3 = "(short)"; var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time @@ -103,15 +273,6 @@ function gpsOff() { Bangle.setGPSPower(0, "sixths"); gps_on = 0; } -function fmtDist(km) { return km.toFixed(1) + icon_km; } -function fmtSteps(n) { return fmtDist(0.001 * 0.719 * n); } -function fmtAlt(m) { return m.toFixed(0) + icon_alt; } -function fmtTimeDiff(d) { - if (d < 180) - return ""+d.toFixed(0); - d = d/60; - return ""+d.toFixed(0)+"m"; -} function gpsHandleFix(fix) { if (!state.prev_fix) { showMsg("GPS acquired", 10); @@ -140,9 +301,9 @@ function gpsHandle() { if (!last_restart) { let d = (getTime()-last_pause); if (last_fix) - msg = "PL"+ fmtTimeDiff(getTime()-last_fix); + msg = "PL"+ fmt.fmtTimeDiff(getTime()-last_fix); else - msg = "PN"+ fmtTimeDiff(getTime()-gps_on); + msg = "PN"+ fmt.fmtTimeDiff(getTime()-gps_on); print("gps on, paused ", d, gps_needed); if (d > gps_needed * 2) { @@ -166,9 +327,9 @@ function gpsHandle() { gps_needed = 60; } else { if (last_fix) - msg = "L"+ fmtTimeDiff(getTime()-last_fix); + msg = "L"+ fmt.fmtTimeDiff(getTime()-last_fix); else { - msg = "N"+ fmtTimeDiff(getTime()-gps_on); + msg = "N"+ fmt.fmtTimeDiff(getTime()-gps_on); if (0 && fix) { msg += " " + fix.satellites + "sats"; } @@ -177,7 +338,7 @@ function gpsHandle() { let d = (getTime()-last_restart); let d2 = (getTime()-last_fstart); - print("gps on, restarted ", d, gps_needed, d2, fix.lat); + print("gps on, restarted ", d, gps_needed, d2); if (getTime() > state.gps_speed_limit && ((d > gps_needed && !last_fstart) || (last_fstart && d2 > keep_fix_for))) { gpsPause(); @@ -202,16 +363,16 @@ function markHandle() { let m = state.cur_mark; let msg = m.name + ">"; if (m.time) { - msg += fmtTimeDiff(getTime()- m.time); + msg += fmt.fmtTimeDiff(getTime()- m.time); } if (state.prev_fix && state.prev_fix.fix && m.fix && m.fix.fix) { - let s = fmtDist(calcDistance(m.fix, state.prev_fix)/1000) + icon_km; + let s = fmt.fmtDist(fmt.distance(m.fix, state.prev_fix)/1000) + icon_km; msg += " " + s; debug = "wp>" + s; - mark_heading = 180 + calcBearing(m.fix, state.prev_fix); + mark_heading = 180 + fmt.bearing(m.fix, state.prev_fix); debug2 = "wp>" + mark_heading; } else { - msg += " w" + fmtDist(state.gps_dist - m.gps_dist); + msg += " w" + fmt.fmtDist(state.gps_dist - m.gps_dist); } return msg; } @@ -249,7 +410,7 @@ function selectWP(i) { state.cur_mark.fix = {}; state.cur_mark.fix.fix = 1; state.cur_mark.fix.lat = wp.lat; - state.cur_mark.fix.lon = wp.lon; + state.cur_mark.fix.lon = wp.lon; showMsg("WP:"+wp.name, 60); print("Select waypoint: ", state.cur_mark); } @@ -305,7 +466,7 @@ function inputHandler(s) { s = ' T'; let d = new Date(); s += d.getHours() % 10; - s += add0(d.getMinutes()); + s += fmt.add0(d.getMinutes()); doBuzz(toMorse(s)); break; } @@ -411,13 +572,6 @@ function touchHandler(d) { //print(inm, "drag:", d); } -function add0(i) { - if (i > 9) { - return ""+i; - } else { - return "0"+i; - } -} var lastHour = -1, lastMin = -1; function logstamp(s) { logfile.write("utime=" + getTime() + " " + s + "\n"); @@ -477,31 +631,11 @@ function every(now) { } -function radians(a) { return a*Math.PI/180; } -function degrees(a) { return a*180/Math.PI; } -// distance between 2 lat and lons, in meters, Mean Earth Radius = 6371km -// https://www.movable-type.co.uk/scripts/latlong.html -// (Equirectangular approximation) -function calcDistance(a,b) { - var x = radians(b.lon-a.lon) * Math.cos(radians((a.lat+b.lat)/2)); - var y = radians(b.lat-a.lat); - return Math.sqrt(x*x + y*y) * 6371000; -} -// thanks to waypointer -function calcBearing(a,b){ - var delta = radians(b.lon-a.lon); - var alat = radians(a.lat); - var blat = radians(b.lat); - var y = Math.sin(delta) * Math.cos(blat); - var x = Math.cos(alat)*Math.sin(blat) - - Math.sin(alat)*Math.cos(blat)*Math.cos(delta); - return Math.round(degrees(Math.atan2(y, x))); -} function testBearing() { let p1 = {}, p2 = {}; p1.lat = 40; p2.lat = 50; p1.lon = 14; p2.lon = 14; - print("bearing = ", calcBearing(p1, p2)); + print("bearing = ", fmt.bearing(p1, p2)); } function radA(p) { return p*(Math.PI*2); } @@ -551,7 +685,7 @@ function drawTime(now) { let dot = ":"; if (!draw_dot) dot = "."; - g.drawString(now.getHours() + dot + add0(now.getMinutes()), W, 90); + g.drawString(now.getHours() + dot + fmt.add0(now.getMinutes()), W, 90); } function draw() { if (disp_mode == 2) { @@ -579,14 +713,14 @@ function draw() { g.setFont('Vector', 30); const weekday = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]; - + msg = weekday[now.getDay()] + "" + now.getDate() + ". " - + fmtSteps(Bangle.getHealthStatus("day").steps) + "\n"; + + fmt.fmtSteps(Bangle.getHealthStatus("day").steps) + "\n"; if (gps_on) { msg += gpsHandle() + "\n"; } - + if (state.cur_mark) { msg += markHandle() + "\n"; } @@ -617,7 +751,7 @@ function draw() { else msg += "emu?"; } else { - msg += fmtAlt(cur_altitude); + msg += fmt.fmtAlt(cur_altitude); } msg = msg + " " + cur_temperature.toFixed(1)+icon_c + "\n"; @@ -647,7 +781,7 @@ function draw_all() { g.setColor(1, 1, 1); g.setFontAlign(-1, 1); let now = new Date(); - g.drawString(now.getHours() + ":" + add0(now.getMinutes()) + ":" + add0(now.getSeconds()), 10, 40); + g.drawString(now.getHours() + ":" + fmt.add0(now.getMinutes()) + ":" + fmt.add0(now.getSeconds()), 10, 40); let acc = Bangle.getAccel(); let ax = 0 + acc.x, ay = 0.75 + acc.y, az = 0.75 + acc.y; From bc98682aa9e4542d2bd483cfce29e14348d7e441 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 21:26:31 +0200 Subject: [PATCH 057/451] sixths: use icons from library. --- apps/sixths/sixths.app.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 9ce647ec6c..75f7ede3fc 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -215,14 +215,6 @@ var is_level = false; var cur_altitude = 0; var cur_temperature = 0; -// Icons - -var icon_alt = "\0\x08\x1a\1\x00\x00\x00\x20\x30\x78\x7C\xFE\xFF\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00"; -//var icon_m = "\0\x08\x1a\1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00"; -var icon_km = "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00"; -var icon_kph = "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\xFF\x00\xC3\xC3\xFF\xC3\xC3"; -var icon_c = "\0\x08\x1a\1\x00\x00\x60\x90\x90\x60\x00\x7F\xFF\xC0\xC0\xC0\xC0\xC0\xFF\x7F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; - function toMorse(x) { let r = ""; for (var i = 0; i < x.length; i++) { @@ -313,7 +305,7 @@ function gpsHandle() { let fix = Bangle.getGPSFix(); if (fix && fix.fix && fix.lat) { gpsHandleFix(fix); - msg = fix.speed.toFixed(1) + icon_kph; + msg = fmt.fmtSpeed(fix.speed); print("GPS FIX", msg); if (!last_fstart) @@ -346,7 +338,7 @@ function gpsHandle() { print("Pausing, next try", gps_needed); } } - msg += " "+state.gps_dist.toFixed(1)+icon_km; + msg += " "+fmt.fmtDist(state.gps_dist); return msg; } function markNew() { @@ -366,7 +358,7 @@ function markHandle() { msg += fmt.fmtTimeDiff(getTime()- m.time); } if (state.prev_fix && state.prev_fix.fix && m.fix && m.fix.fix) { - let s = fmt.fmtDist(fmt.distance(m.fix, state.prev_fix)/1000) + icon_km; + let s = fmt.fmtDist(fmt.distance(m.fix, state.prev_fix)/1000) + fmt.icon_km; msg += " " + s; debug = "wp>" + s; mark_heading = 180 + fmt.bearing(m.fix, state.prev_fix); @@ -754,7 +746,7 @@ function draw() { msg += fmt.fmtAlt(cur_altitude); } - msg = msg + " " + cur_temperature.toFixed(1)+icon_c + "\n"; + msg = msg + " " + cur_temperature.toFixed(1)+fmt.icon_c + "\n"; { let o = Bangle.getOptions(); From 8d19a3585395aa359b4b01adf3bfe9b0e1ff964d Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 21:40:46 +0200 Subject: [PATCH 058/451] sixths: add pressure formatting. --- apps/sixths/sixths.app.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 75f7ede3fc..ee190a7195 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -8,6 +8,9 @@ let fmt = { icon_km : "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\x00\x00\x00\x00\x00\x00\x00", icon_kph : "\0\x08\x1a\1\xC3\xC6\xCC\xD8\xF0\xD8\xCC\xC6\xC3\x00\xC3\xE7\xFF\xDB\xC3\xC3\xC3\xC3\x00\xFF\x00\xC3\xC3\xFF\xC3\xC3", icon_c : "\0\x08\x1a\1\x00\x00\x60\x90\x90\x60\x00\x7F\xFF\xC0\xC0\xC0\xC0\xC0\xFF\x7F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + icon_hpa : "\x00\x08\x16\x01\x00\x80\xb0\xc8\x88\x88\x88\x00\xf0\x88\x84\x84\x88\xf0\x80\x8c\x92\x22\x25\x19\x00\x00", + icon_9 : "\x00\x08\x16\x01\x00\x00\x00\x00\x38\x44\x44\x4c\x34\x04\x04\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + icon_10 : "\x00\x08\x16\x01\x00\x08\x18\x28\x08\x08\x08\x00\x00\x18\x24\x24\x24\x24\x18\x00\x00\x00\x00\x00\x00\x00", /* 0 .. DD.ddddd 1 .. DD MM.mmm' @@ -22,6 +25,17 @@ let fmt = { }, fmtSteps: function(n) { return this.fmtDist(0.001 * 0.719 * n); }, fmtAlt: function(m) { return m.toFixed(0) + this.icon_alt; }, + fmtTemp: function(c) { return c.toFixed(1) + this.icon_c; }, + fmtPress: function(p) { + if (p < 900 || p > 1100) + return p.toFixed(1) + this.icon_hpa; + if (p < 1000) { + p -= 900; + return this.icon_9 + p.toFixed(1) + this.icon_hpa; + } + p -= 1000; + return this.icon_10 + p.toFixed(1) + this.icon_hpa; + }, draw_dot : 1, add0: function(i) { if (i > 9) { @@ -739,21 +753,21 @@ function draw() { } let pr = o.seaLevelPressure; if (pr) - msg += pr.toFixed(1) + "hPa"; + msg += fmt.fmtPress(pr); else msg += "emu?"; } else { msg += fmt.fmtAlt(cur_altitude); } - msg = msg + " " + cur_temperature.toFixed(1)+fmt.icon_c + "\n"; + msg = msg + " " + fmt.fmtTemp(cur_temperature) + "\n"; { let o = Bangle.getOptions(); let pr = o.seaLevelPressure; if (pr) - msg += pr.toFixed(1) + "hPa\n"; + msg += fmt.fmtPress(pr) + "\n"; } g.setFontAlign(-1, -1); g.drawString(msg, 10, 85); From 6c04da4c01578fc6645f9168d78dc2c53ac9365e Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 21:44:08 +0200 Subject: [PATCH 059/451] sixths: Keep GPS on for longer. --- apps/sixths/README.md | 2 -- apps/sixths/sixths.app.js | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 2fe7ad484a..4b826ca92f 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -85,8 +85,6 @@ Todo: *) +-3.5hPa 1012hPa -*) keep GPS on longer - *) display gps alt + offset to baro *) start logging altitudes, baro pressure diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index ee190a7195..7adc59d452 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -216,7 +216,7 @@ var gps_on = 0, // time GPS was turned on last_restart = 0, last_pause = 0; // utime last_fstart = 0; // utime, time of start of last fix var gps_needed = 0, // how long to wait for a fix - keep_fix_for = 10; + keep_fix_for = 30; var mark_heading = -1; @@ -325,11 +325,11 @@ function gpsHandle() { if (!last_fstart) last_fstart = getTime(); last_fix = getTime(); - keep_fix_for = (last_fstart - last_restart) / 2; - if (keep_fix_for < 10) - keep_fix_for = 10; - if (keep_fix_for > 4*60) - keep_fix_for = 4*60; + keep_fix_for = (last_fstart - last_restart) / 1.5; + if (keep_fix_for < 20) + keep_fix_for = 20; + if (keep_fix_for > 6*60) + keep_fix_for = 6*60; gps_needed = 60; } else { if (last_fix) From 543e51846bbfdb2ec83ad833729ea9d920c67f37 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 22:01:13 +0200 Subject: [PATCH 060/451] sixhts: Warn when GPS altitude does not match baro. --- apps/sixths/sixths.app.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 7adc59d452..9f88a8fea4 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -294,7 +294,7 @@ function gpsHandleFix(fix) { debug2 = "te "+(n2-n1)+"s"; } loggps(fix); - let d = calcDistance(fix, state.prev_fix); + let d = fmt.distance(fix, state.prev_fix); if (d > 30) { state.prev_fix = fix; state.gps_dist += d/1000; @@ -316,11 +316,13 @@ function gpsHandle() { gpsRestart(); } } else { - let fix = Bangle.getGPSFix(); + let fix = gps.getGPSFix(); if (fix && fix.fix && fix.lat) { gpsHandleFix(fix); - msg = fmt.fmtSpeed(fix.speed); - print("GPS FIX", msg); + msg = ""; + if (Math.abs(fix.alt - cur_altitude) > 20) + msg += "!"; + msg += fmt.fmtSpeed(fix.speed); if (!last_fstart) last_fstart = getTime(); From 08870ec31a3a4dd4ce1741de702d826dd73ebb17 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 22:10:27 +0200 Subject: [PATCH 061/451] sixths: start logging more data. --- apps/sixths/README.md | 6 ++---- apps/sixths/sixths.app.js | 7 +++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 4b826ca92f..8a7d2185a6 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -85,12 +85,10 @@ Todo: *) +-3.5hPa 1012hPa -*) display gps alt + offset to baro +?) display gps alt + offset to baro -*) start logging altitudes, baro pressure +?) start logging baro pressure *) compute climb/descent *) switch to compensated compass - -*) only accept gps fix when altitude matches baro \ No newline at end of file diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 9f88a8fea4..f9901f8b44 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -582,10 +582,13 @@ function touchHandler(d) { } var lastHour = -1, lastMin = -1; function logstamp(s) { - logfile.write("utime=" + getTime() + " " + s + "\n"); + logfile.write("utime=" + getTime() + + " bele=" + cur_altitude + + " batperc=" + E.getBattery() + + " " + s + "\n"); } function loggps(fix) { - logfile.write(fix.lat + " " + fix.lon + " "); + logfile.write(fix.lat + " " + fix.lon + " ele=" + fix.alt + " "); logstamp(""); } function hourly() { From a27f40c9f6cbb77ade83f95b3c01e1c5df5c603b Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 14 Aug 2024 22:29:26 +0200 Subject: [PATCH 062/451] sixths: save night pressure to watch trend. --- apps/sixths/sixths.app.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index f9901f8b44..49a209a9ae 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -28,13 +28,13 @@ let fmt = { fmtTemp: function(c) { return c.toFixed(1) + this.icon_c; }, fmtPress: function(p) { if (p < 900 || p > 1100) - return p.toFixed(1) + this.icon_hpa; + return p.toFixed(0) + this.icon_hpa; if (p < 1000) { p -= 900; - return this.icon_9 + p.toFixed(1) + this.icon_hpa; + return this.icon_9 + p.toFixed(0) + this.icon_hpa; } p -= 1000; - return this.icon_10 + p.toFixed(1) + this.icon_hpa; + return this.icon_10 + p.toFixed(0) + this.icon_hpa; }, draw_dot : 1, add0: function(i) { @@ -228,6 +228,7 @@ var is_level = false; // For altitude handling. var cur_altitude = 0; var cur_temperature = 0; +var night_pressure = 0; function toMorse(x) { let r = ""; @@ -771,6 +772,10 @@ function draw() { let o = Bangle.getOptions(); let pr = o.seaLevelPressure; + if (now.hour < 6) + night_pressure = pr; + if (night_pressure) + msg += (pr-night_pressure).toFixed(1) + fmt.icon_hpa + " "; if (pr) msg += fmt.fmtPress(pr) + "\n"; } From e6f864d44181b09db50b3867b40317aab2893401 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 15 Aug 2024 09:53:47 +0200 Subject: [PATCH 063/451] sixths: Fix pressure change handling. --- apps/sixths/README.md | 2 -- apps/sixths/sixths.app.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/sixths/README.md b/apps/sixths/README.md index 8a7d2185a6..9fd7631f9e 100644 --- a/apps/sixths/README.md +++ b/apps/sixths/README.md @@ -83,8 +83,6 @@ Todo: *) "myprofile" to read step length -*) +-3.5hPa 1012hPa - ?) display gps alt + offset to baro ?) start logging baro pressure diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 49a209a9ae..ea9943fdd5 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -772,7 +772,7 @@ function draw() { let o = Bangle.getOptions(); let pr = o.seaLevelPressure; - if (now.hour < 6) + if (now.getHours() < 10) night_pressure = pr; if (night_pressure) msg += (pr-night_pressure).toFixed(1) + fmt.icon_hpa + " "; From f61a98d1b97105f07bc7bb00e1e21048d218c0dd Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 15 Aug 2024 10:42:16 +0200 Subject: [PATCH 064/451] sixths: start implementing climb/descent. --- apps/sixths/sixths.app.js | 51 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index ea9943fdd5..eeba5eb6f8 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -226,7 +226,7 @@ var draw_dot = false; var is_level = false; // For altitude handling. -var cur_altitude = 0; +var cur_altitude = -1; var cur_temperature = 0; var night_pressure = 0; @@ -608,6 +608,9 @@ function showMsg(msg, timeout) { note_limit = getTime() + timeout; note = msg; } + +var prev_step = -1, this_step = -1; + function fivemin() { print("fivemin"); let s = ' B'; @@ -618,7 +621,8 @@ function fivemin() { } catch (e) { print("Altimeter error", e); } - + prev_step = this_step; + this_step = Bangle.getStepCount(); } function every(now) { if ((mode > 0) && (getTime() - mode_time > 10)) { @@ -699,6 +703,45 @@ function drawTime(now) { dot = "."; g.drawString(now.getHours() + dot + fmt.add0(now.getMinutes()), W, 90); } + +var base_alt = -1, ext_alt = -1, tot_down = 0, tot_up = 0; + +function walkHandle() { + let msg = ""; + let step = Bangle.getStepCount(); + let cur = cur_altitude; + if (base_alt == -1) { + base_alt = cur; + ext_alt = cur; + } + if (this_step - prev_step > 100 + || 1 + || step - this_step > 100) { + msg += fmt.fmtSteps((this_step - prev_step) * 12); + + let dir = cur > base_alt; /* 1.. climb */ + if (!dir) dir = -1; + let hyst = 6; + if (Math.abs(cur - base_alt) > hyst) { + if (cur > ext_alt) { //f + ext_alt = cur; + } + if (cur < ext_alt - hyst) { //f + let diff = ext_alt - base_alt; + if (1) { + tot_up += diff; + } + base_alt = cur; + ext_alt = cur; + } + } + msg += fmt.fmtAlt(cur-base_alt) + fmt.fmtAlt(tot_down) + fmt.fmtAlt(tot_up); + + return msg + "\n"; + } + return ""; +} + function draw() { if (disp_mode == 2) { draw_all(); @@ -743,6 +786,8 @@ function draw() { else msg += note + "\n"; } + + msg += walkHandle(); if (getTime() - last_active > 15*60) { let alt_adjust = cur_altitude - location.alt; @@ -772,7 +817,7 @@ function draw() { let o = Bangle.getOptions(); let pr = o.seaLevelPressure; - if (now.getHours() < 10) + if (now.getHours() < 10) // FIXME night_pressure = pr; if (night_pressure) msg += (pr-night_pressure).toFixed(1) + fmt.icon_hpa + " "; From ba21c2ba7b6606a376ef5b2abe4883b498c27d69 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 15 Aug 2024 10:48:09 +0200 Subject: [PATCH 065/451] sixths: Tweak settings for easier debugging. --- apps/sixths/sixths.app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index eeba5eb6f8..2e3f1de0d2 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -195,7 +195,7 @@ var buzz = "", /* Set this to transmit morse via vibrations */ inm = "", l = "", /* For incoming morse handling */ in_str = "", note = "", - debug = "v0.6.0", debug2 = "(otherdb)", debug3 = "(short)"; + debug = "v0.5.10", debug2 = "(otherdb)", debug3 = "(short)"; var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time @@ -721,7 +721,7 @@ function walkHandle() { let dir = cur > base_alt; /* 1.. climb */ if (!dir) dir = -1; - let hyst = 6; + let hyst = 2; if (Math.abs(cur - base_alt) > hyst) { if (cur > ext_alt) { //f ext_alt = cur; @@ -817,7 +817,7 @@ function draw() { let o = Bangle.getOptions(); let pr = o.seaLevelPressure; - if (now.getHours() < 10) // FIXME + if (now.getHours() < 12) // FIXME night_pressure = pr; if (night_pressure) msg += (pr-night_pressure).toFixed(1) + fmt.icon_hpa + " "; From 462dc3827be4b4874b64e6ebda05540642b317ed Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 15 Aug 2024 11:57:26 +0200 Subject: [PATCH 066/451] sixths: fixup altitude totals. Still not fully correct. --- apps/sixths/sixths.app.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 2e3f1de0d2..4f8cfdeb9e 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -722,17 +722,22 @@ function walkHandle() { let dir = cur > base_alt; /* 1.. climb */ if (!dir) dir = -1; let hyst = 2; + // This is not fully correct; it fails + // to add totals for sequence such as 100, 200, 100, 200. if (Math.abs(cur - base_alt) > hyst) { - if (cur > ext_alt) { //f + if (cur*dir > ext_alt*dir) { ext_alt = cur; } - if (cur < ext_alt - hyst) { //f + if (cur*dir < (ext_alt - hyst*dir)*dir) { let diff = ext_alt - base_alt; - if (1) { + if (1 == dir) { tot_up += diff; } - base_alt = cur; - ext_alt = cur; + if (-1 == dir) { + tot_down += -diff; + } + base_alt = ext_alt; + ext_alt = ext_alt; } } msg += fmt.fmtAlt(cur-base_alt) + fmt.fmtAlt(tot_down) + fmt.fmtAlt(tot_up); From 64cfbeb157d4c2c3054173c6bc9d291e2305b2bf Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 15 Aug 2024 12:20:01 +0200 Subject: [PATCH 067/451] sixths: more altitude fixups, hopefully correct --- apps/sixths/sixths.app.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 4f8cfdeb9e..138a1b5c23 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -719,15 +719,14 @@ function walkHandle() { || step - this_step > 100) { msg += fmt.fmtSteps((this_step - prev_step) * 12); - let dir = cur > base_alt; /* 1.. climb */ + let dir = ext_alt > base_alt; /* 1.. climb */ if (!dir) dir = -1; let hyst = 2; - // This is not fully correct; it fails - // to add totals for sequence such as 100, 200, 100, 200. if (Math.abs(cur - base_alt) > hyst) { if (cur*dir > ext_alt*dir) { ext_alt = cur; } + } if (cur*dir < (ext_alt - hyst*dir)*dir) { let diff = ext_alt - base_alt; if (1 == dir) { @@ -737,9 +736,9 @@ function walkHandle() { tot_down += -diff; } base_alt = ext_alt; - ext_alt = ext_alt; + ext_alt = cur; } - } + msg += fmt.fmtAlt(cur-base_alt) + fmt.fmtAlt(tot_down) + fmt.fmtAlt(tot_up); return msg + "\n"; From 6b201ceb7f26f556ad15bb971e082daaa79b04a6 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 16 Aug 2024 21:31:28 +0200 Subject: [PATCH 068/451] sixths: simplify climb/descent display, scalable altitude warnings. --- apps/sixths/sixths.app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 138a1b5c23..160847020e 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -323,6 +323,10 @@ function gpsHandle() { msg = ""; if (Math.abs(fix.alt - cur_altitude) > 20) msg += "!"; + if (Math.abs(fix.alt - cur_altitude) > 80) + msg += "!"; + if (Math.abs(fix.alt - cur_altitude) > 320) + msg += "!"; msg += fmt.fmtSpeed(fix.speed); if (!last_fstart) @@ -738,8 +742,8 @@ function walkHandle() { base_alt = ext_alt; ext_alt = cur; } - - msg += fmt.fmtAlt(cur-base_alt) + fmt.fmtAlt(tot_down) + fmt.fmtAlt(tot_up); + + msg += " " + fmt.fmtAlt(tot_down-cur+base_alt) + " " + fmt.fmtAlt(tot_up+cur-base_alt); return msg + "\n"; } From 099e504d3f4fc554ef32f0378a6e2e68fe46f5e9 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 16 Aug 2024 21:58:34 +0200 Subject: [PATCH 069/451] sixths: fix alt up/down counts. --- apps/sixths/sixths.app.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 160847020e..10c18255f2 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -721,7 +721,7 @@ function walkHandle() { if (this_step - prev_step > 100 || 1 || step - this_step > 100) { - msg += fmt.fmtSteps((this_step - prev_step) * 12); + //msg += fmt.fmtSteps((this_step - prev_step) * 12); let dir = ext_alt > base_alt; /* 1.. climb */ if (!dir) dir = -1; @@ -731,8 +731,8 @@ function walkHandle() { ext_alt = cur; } } + let diff = ext_alt - base_alt; if (cur*dir < (ext_alt - hyst*dir)*dir) { - let diff = ext_alt - base_alt; if (1 == dir) { tot_up += diff; } @@ -742,8 +742,15 @@ function walkHandle() { base_alt = ext_alt; ext_alt = cur; } + let tmp_down = tot_down, tmp_up = tot_up; + if (1 == dir) { + tmp_up += diff; + } + if (-1 == dir) { + tmp_down += -diff; + } - msg += " " + fmt.fmtAlt(tot_down-cur+base_alt) + " " + fmt.fmtAlt(tot_up+cur-base_alt); + msg += " " + fmt.fmtAlt(tmp_down) + " " + fmt.fmtAlt(tmp_up); return msg + "\n"; } From bc0a490bea58616a081ef0416b66da87d85a7792 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sun, 18 Aug 2024 20:42:53 +0200 Subject: [PATCH 070/451] sixths: better implementation of "info". --- apps/sixths/sixths.app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 10c18255f2..b491faa8d8 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -700,12 +700,12 @@ function drawTime(now) { g.setFont('Vector', 60); else g.setFont('Vector', 26); - g.setFontAlign(1, 1); + g.setFontAlign(1, -1); draw_dot = !draw_dot; let dot = ":"; if (!draw_dot) dot = "."; - g.drawString(now.getHours() + dot + fmt.add0(now.getMinutes()), W, 90); + g.drawString(now.getHours() + dot + fmt.add0(now.getMinutes()), W, 28); } var base_alt = -1, ext_alt = -1, tot_down = 0, tot_up = 0; @@ -840,9 +840,12 @@ function draw() { msg += fmt.fmtPress(pr) + "\n"; } g.setFontAlign(-1, -1); - g.drawString(msg, 10, 85); + if (disp_mode == 0) + g.drawString(msg, 10, 85); + else + g.drawString(msg, 10, 60); - if (disp_mode == 1) { + if (0 && disp_mode == 1) { g.setFont('Vector', 21); g.drawString(debug + "\n" + debug2 + "\n" + debug3, 10, 20); } From 7057b34e6fd4e01fd3ee0ac039488dc952cf2a32 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sun, 18 Aug 2024 21:55:54 +0200 Subject: [PATCH 071/451] sixths: fix hPa formatting. --- apps/sixths/sixths.app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index b491faa8d8..90bf17ded7 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -31,10 +31,10 @@ let fmt = { return p.toFixed(0) + this.icon_hpa; if (p < 1000) { p -= 900; - return this.icon_9 + p.toFixed(0) + this.icon_hpa; + return this.icon_9 + this.add0(p.toFixed(0)) + this.icon_hpa; } p -= 1000; - return this.icon_10 + p.toFixed(0) + this.icon_hpa; + return this.icon_10 + this.add0(p.toFixed(0)) + this.icon_hpa; }, draw_dot : 1, add0: function(i) { From 5c77834a6bd533b3900f765d5bdff6663f7f3966 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 19 Aug 2024 13:32:34 +0200 Subject: [PATCH 072/451] sixths: Activate delta pressure measurement --- apps/sixths/sixths.app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 90bf17ded7..af6e984f13 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -832,7 +832,7 @@ function draw() { let o = Bangle.getOptions(); let pr = o.seaLevelPressure; - if (now.getHours() < 12) // FIXME + if (now.getHours() < 6) night_pressure = pr; if (night_pressure) msg += (pr-night_pressure).toFixed(1) + fmt.icon_hpa + " "; From 68ae86361c332475eef39da91af606fbab17315e Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 19 Aug 2024 22:12:51 +0200 Subject: [PATCH 073/451] sixths: start importing suncalc. --- apps/sixths/sixths.app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index af6e984f13..857adc564a 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -182,6 +182,21 @@ let gps = { }, }; +/* sun version 0.0.1 */ +let sun = { + SunCalc: null, + init: function() { + try { + this.SunCalc = require("suncalc"); // from modules folder + } catch (e) { + print("Require error", e); + } + + print("Have suncalc: ", this.SunCalc); + } +}; + +sun.init(); fmt.init(); gps.init(); From d25b643c49e086108e24558c572b9eed536bb843 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 19 Aug 2024 22:33:39 +0200 Subject: [PATCH 074/451] sixths: start testing Sun time/pos --- apps/sixths/sixths.app.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 857adc564a..c6fe4234f5 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -185,6 +185,8 @@ let gps = { /* sun version 0.0.1 */ let sun = { SunCalc: null, + lat: 50, + lon: 14, init: function() { try { this.SunCalc = require("suncalc"); // from modules folder @@ -193,10 +195,24 @@ let sun = { } print("Have suncalc: ", this.SunCalc); - } + }, + get_sun_pos: function() { + let d = new Date(); + let sun = this.SunCalc.getPosition(d, this.lat, this.lon); + print(sun.azimuth, sun.altitude); + return sun; + }, + get_sun_time: function() { + let d = new Date(); + let sun = this.SunCalc.getTimes(d, this.lat, this.lon); + print(sun.sunrise, sun.sunrise.getHour()); + return sun; + }, }; sun.init(); +sun.get_sun_pos(); +sun.get_sun_time(); fmt.init(); gps.init(); From a104f12f7ee115f5fad6c8cb115604679c474e2c Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 19 Aug 2024 22:37:01 +0200 Subject: [PATCH 075/451] sixths: show version on info --- apps/sixths/sixths.app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index c6fe4234f5..8e716a5be7 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -226,7 +226,7 @@ var buzz = "", /* Set this to transmit morse via vibrations */ inm = "", l = "", /* For incoming morse handling */ in_str = "", note = "", - debug = "v0.5.10", debug2 = "(otherdb)", debug3 = "(short)"; + debug = "v0.5.11", debug2 = "(otherdb)", debug3 = "(short)"; var note_limit = 0; var mode = 0, mode_time = 0; // 0 .. normal, 1 .. note, 2.. mark name var disp_mode = 0; // 0 .. normal, 1 .. small time @@ -736,7 +736,10 @@ function drawTime(now) { let dot = ":"; if (!draw_dot) dot = "."; - g.drawString(now.getHours() + dot + fmt.add0(now.getMinutes()), W, 28); + let s = ""; + if (disp_mode == 1) + s = debug; + g.drawString(s + now.getHours() + dot + fmt.add0(now.getMinutes()), W, 28); } var base_alt = -1, ext_alt = -1, tot_down = 0, tot_up = 0; From 942ff4aaf892f03a2bf11c5ea016f9fd5420a1e2 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 19 Aug 2024 22:44:51 +0200 Subject: [PATCH 076/451] sixths: gethour was not available, try this --- apps/sixths/sixths.app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 8e716a5be7..5740c95096 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -205,7 +205,7 @@ let sun = { get_sun_time: function() { let d = new Date(); let sun = this.SunCalc.getTimes(d, this.lat, this.lon); - print(sun.sunrise, sun.sunrise.getHour()); + print(sun.sunrise, sun.sunset); return sun; }, }; From 1b40897ea287ca6a75d04b4945cd301f201894a8 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 22 Aug 2024 14:49:00 +0200 Subject: [PATCH 077/451] sixths: add fixme. --- apps/sixths/sixths.app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 5740c95096..761ddee76d 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -675,11 +675,10 @@ function every(now) { lastHour = now.getHours(); hourly(); } - if (lastMin / 5 != now.getMinutes() / 5) { + if (lastMin / 5 != now.getMinutes() / 5) { // fixme, trunc? lastMin = now.getMinutes(); fivemin(); } - } function testBearing() { From cfcfe8e9855b3db7d2eed22a676fa93843456b79 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 29 Aug 2024 09:36:05 +0200 Subject: [PATCH 078/451] sixths: Increase version --- apps/sixths/ChangeLog | 8 ++++++++ apps/sixths/metadata.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/sixths/ChangeLog b/apps/sixths/ChangeLog index 510748fb31..2da2201428 100644 --- a/apps/sixths/ChangeLog +++ b/apps/sixths/ChangeLog @@ -3,3 +3,11 @@ 0.03: minor code improvements 0.04: make height auto-calibration useful and slow ticks to save power 0.05: add ability to navigate to waypoints, better documentation +0.1: lots of updates + acknowledge commands by vibration and message + ui tweaks -- bigger font, compressing uninteresting info + display meters up/down + display pressure trend + adjust GPS on/off algorithm for more reliable fix + display warnings when GPS altitude does not match baro + diff --git a/apps/sixths/metadata.json b/apps/sixths/metadata.json index 585f23170e..9aab1ee8b0 100644 --- a/apps/sixths/metadata.json +++ b/apps/sixths/metadata.json @@ -1,6 +1,6 @@ { "id": "sixths", "name": "Sixth sense", - "version": "0.05", + "version": "0.1", "description": "Clock for outdoor use with GPS support", "icon": "app.png", "readme": "README.md", From 468f55950d560a2472a7c457052dbc839059153d Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 29 Aug 2024 09:38:47 +0200 Subject: [PATCH 079/451] sixths: fix warnings --- apps/sixths/sixths.app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sixths/sixths.app.js b/apps/sixths/sixths.app.js index 761ddee76d..c8d2e668eb 100644 --- a/apps/sixths/sixths.app.js +++ b/apps/sixths/sixths.app.js @@ -244,7 +244,7 @@ var state = { // GPS handling var gps_on = 0, // time GPS was turned on last_fix = 0, // time of last fix - last_restart = 0, last_pause = 0; // utime + last_restart = 0, last_pause = 0, // utime last_fstart = 0; // utime, time of start of last fix var gps_needed = 0, // how long to wait for a fix keep_fix_for = 30; @@ -817,7 +817,7 @@ function draw() { const weekday = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]; - msg = weekday[now.getDay()] + "" + now.getDate() + ". " + let msg = weekday[now.getDay()] + "" + now.getDate() + ". " + fmt.fmtSteps(Bangle.getHealthStatus("day").steps) + "\n"; if (gps_on) { From f49a9341a502d25b3e00a3d6885b085d6fdc1829 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:38:30 +0100 Subject: [PATCH 080/451] Update app.js --- apps/tvremote/app.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/apps/tvremote/app.js b/apps/tvremote/app.js index 9fb88fd2d6..5911d5c5b5 100644 --- a/apps/tvremote/app.js +++ b/apps/tvremote/app.js @@ -19,10 +19,10 @@ let panaIp = "tvIp" in serverData ? serverData.tvIp : 'undefined'; let settingsPort = "port" in serverData ? serverData.port : 'undefined'; let counter; +let IPASSIGN; +let samsIp; let countdownTimer = null; -let drawTimeout; let currNumber = null; -let prevNumber = null; let selected = "NONE"; let currentScreen = "power"; let font = 'Vector'; @@ -298,7 +298,7 @@ function buttonPress(val, screenValue) { displayOutput(currNumber, screenValue); } - checkValue = appData.some(app => app.name === screenValue); // check app data + let checkValue = appData.some(app => app.name === screenValue); // check app data if (checkValue) sendPost(val); // app values @@ -383,10 +383,6 @@ let tvSelector = { } }; -function samsungmenu() { - //E.showMessage("It's on my list to do", "Error"); -} - function mainMenu() { assignScreen("mainmenu"); E.showMenu(tvSelector); @@ -467,7 +463,7 @@ function subMenu() { settingssub[panaheader] = function() { IPASSIGN = "pana"; E.showMenu(deviceSelect); - deviceFile = require("Storage").readJSON("tvdevicelist.json", true); + devicefile = require("Storage").readJSON("tvdevicelist.json", true); console.log(devicefile); }; } else { @@ -498,7 +494,7 @@ let parsedResp = JSON.parse(devicefile.resp); select: i => { let sourceOption = parsedResp[i]; - let devicePressed = sourceOption.name; + //let devicePressed = sourceOption.name; let deviceIp = sourceOption.ip; assignScreen("deviceSearch"); From 1a1d8cf1dd2c839bbad9e996d09304d7f265f3c4 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:09:28 +0100 Subject: [PATCH 081/451] Update app.js --- apps/tvremote/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/tvremote/app.js b/apps/tvremote/app.js index 5911d5c5b5..628ccd81ce 100644 --- a/apps/tvremote/app.js +++ b/apps/tvremote/app.js @@ -184,8 +184,8 @@ function assignScreen (screen) { } function sendPost(keyPress) { - let serverPort = settingsPort; - let tvIp = panaIp; + serverPort = settingsPort; + tvIp = panaIp; let credentials = btoa(`${username}:${password}`); let serverUrl = `https://${serverDns}:${serverPort}`; @@ -211,7 +211,7 @@ function sendPost(keyPress) { } function receiveDevices() { - let serverPort = settingsPort; + serverPort = settingsPort; let credentials = btoa(`${username}:${password}`); let serverUrl = `https://${serverDns}:${serverPort}/ssdp-devices.json`; return Bangle.http( From e521b67d59693feb63a2abdcc79d21173765ab1e Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Thu, 29 Aug 2024 11:32:50 +0200 Subject: [PATCH 082/451] sixths: Mark version as 0.10 for consistency with other apps. --- apps/sixths/ChangeLog | 2 +- apps/sixths/metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sixths/ChangeLog b/apps/sixths/ChangeLog index 2da2201428..bff499d30b 100644 --- a/apps/sixths/ChangeLog +++ b/apps/sixths/ChangeLog @@ -3,7 +3,7 @@ 0.03: minor code improvements 0.04: make height auto-calibration useful and slow ticks to save power 0.05: add ability to navigate to waypoints, better documentation -0.1: lots of updates +0.10: lots of updates acknowledge commands by vibration and message ui tweaks -- bigger font, compressing uninteresting info display meters up/down diff --git a/apps/sixths/metadata.json b/apps/sixths/metadata.json index 9aab1ee8b0..03a9aa1d9d 100644 --- a/apps/sixths/metadata.json +++ b/apps/sixths/metadata.json @@ -1,6 +1,6 @@ { "id": "sixths", "name": "Sixth sense", - "version": "0.1", + "version": "0.10", "description": "Clock for outdoor use with GPS support", "icon": "app.png", "readme": "README.md", From 8662f635d8df7cbbc0272446f5c5ac409e83b14a Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 29 Aug 2024 21:05:52 +0200 Subject: [PATCH 083/451] Upgrade to new translation system --- apps/gbmusic/ChangeLog | 3 ++- apps/gbmusic/metadata.json | 2 +- apps/gbmusic/settings.js | 9 ++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/gbmusic/ChangeLog b/apps/gbmusic/ChangeLog index 90e5ed8571..0275542fb6 100644 --- a/apps/gbmusic/ChangeLog +++ b/apps/gbmusic/ChangeLog @@ -10,4 +10,5 @@ 0.10: Simplify touch events Remove date+time 0.11: Use default Bangle formatter for booleans -0.12: Issue newline before GB commands (solves issue with console.log and ignored commands) \ No newline at end of file +0.12: Issue newline before GB commands (solves issue with console.log and ignored commands) +0.13: Upgrade to new translation system diff --git a/apps/gbmusic/metadata.json b/apps/gbmusic/metadata.json index 0c73548cb5..0024a1708d 100644 --- a/apps/gbmusic/metadata.json +++ b/apps/gbmusic/metadata.json @@ -2,7 +2,7 @@ "id": "gbmusic", "name": "Gadgetbridge Music Controls", "shortName": "Music Controls", - "version": "0.12", + "version": "0.13", "description": "Control the music on your Gadgetbridge-connected phone", "icon": "icon.png", "screenshots": [{"url":"screenshot_v1_d.png"},{"url":"screenshot_v1_l.png"}, diff --git a/apps/gbmusic/settings.js b/apps/gbmusic/settings.js index 6619eab1c6..9b8d35be93 100644 --- a/apps/gbmusic/settings.js +++ b/apps/gbmusic/settings.js @@ -3,8 +3,7 @@ */ (function(back) { const SETTINGS_FILE = "gbmusic.json", - storage = require("Storage"), - translate = require("locale").translate; + storage = require("Storage"); // initialize with default settings... let s = { @@ -28,12 +27,12 @@ let menu = { "": {"title": "Music Control"}, }; - menu[translate("< Back")] = back; - menu[translate("Auto start")] = { + menu["< Back"] = back; + menu[/*LANG*/"Auto start"] = { value: !!s.autoStart, onchange: save("autoStart"), }; - menu[translate("Simple button")] = { + menu[/*LANG*/"Simple button"] = { value: !!s.simpleButton, onchange: save("simpleButton"), }; From f894bd58981c4fa170dd9c9474d97717259b3dd5 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 29 Aug 2024 21:12:58 +0200 Subject: [PATCH 084/451] Release new version --- apps/locale/ChangeLog | 1 + apps/locale/metadata.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/locale/ChangeLog b/apps/locale/ChangeLog index 982103cd16..64e4775296 100644 --- a/apps/locale/ChangeLog +++ b/apps/locale/ChangeLog @@ -21,3 +21,4 @@ 0.17: Fix regression where long month names were 'undefined' (fix #1641) 0.18: Fix lint warnings, change anv->janv for fr_BE and fr_CH 0.19: Deprecate currency information +0.20: Improve support for meridians diff --git a/apps/locale/metadata.json b/apps/locale/metadata.json index 36cb2eae72..c2f76ca8a4 100644 --- a/apps/locale/metadata.json +++ b/apps/locale/metadata.json @@ -1,7 +1,7 @@ { "id": "locale", "name": "Languages", - "version": "0.19", + "version": "0.20", "description": "Translations for different countries", "icon": "locale.png", "type": "locale", From 1005b67c54cbe94da4133cd81ef2c3c6523c93e1 Mon Sep 17 00:00:00 2001 From: paul-arg Date: Tue, 27 Aug 2024 17:15:53 +0200 Subject: [PATCH 085/451] messageicons: add more icons including gmail, google agenda, google messages --- apps/messageicons/ChangeLog | 1 + apps/messageicons/icons.img | Bin 5244 -> 5548 bytes apps/messageicons/icons/agenda.png | Bin 0 -> 189 bytes apps/messageicons/icons/generate.js | 3 +++ apps/messageicons/icons/gmail.png | Bin 0 -> 195 bytes apps/messageicons/icons/icon_names.json | 7 +++++-- apps/messageicons/icons/leboncoin.png | Bin 0 -> 187 bytes apps/messageicons/icons/messages.png | Bin 0 -> 201 bytes apps/messageicons/lib.js | 5 ++++- apps/messageicons/metadata.json | 2 +- 10 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 apps/messageicons/icons/agenda.png create mode 100644 apps/messageicons/icons/gmail.png create mode 100644 apps/messageicons/icons/leboncoin.png create mode 100644 apps/messageicons/icons/messages.png diff --git a/apps/messageicons/ChangeLog b/apps/messageicons/ChangeLog index 4e8972f7a8..ede1699143 100644 --- a/apps/messageicons/ChangeLog +++ b/apps/messageicons/ChangeLog @@ -6,3 +6,4 @@ 0.05: Add message icon for 'jira' 0.06: Add message icon for 'molly' and 'threema libre' 0.07: Minor code improvements +0.08: Add more icons including GMail, Google Messages, Google Agenda \ No newline at end of file diff --git a/apps/messageicons/icons.img b/apps/messageicons/icons.img index 66ecb53f8eec12eb8eb1859d9c7bb41ee5f77e16..bb74d05d962eb81062100dc8e83185879bd4bbb5 100644 GIT binary patch delta 258 zcmeyPu||8sB6|h~2LAsA^8YI!NREL)E~!FpT7{fY1&9G8CxICZ6+o48|10GF7s&lj z;QQ|Y!?YX|fCxx3T>HA1LSnhy48y^7miJ-@hS$e~0}23i*3KlmdKI;Vst0Ku&^YybcN literal 0 HcmV?d00001 diff --git a/apps/messageicons/icons/generate.js b/apps/messageicons/icons/generate.js index 854e041435..a07b7af447 100755 --- a/apps/messageicons/icons/generate.js +++ b/apps/messageicons/icons/generate.js @@ -91,6 +91,7 @@ exports.getColor = function(msg,options) { const s = (("string"=== typeof msg) ? msg : (msg.src || "")).toLowerCase(); return { /* generic colors, using B2-safe colors */ ${ /* DO NOT USE BLACK OR WHITE HERE, just leave the declaration out and then the theme's fg color will be used */"" } + "agenda": "#206cd5", "airbnb": "#ff385c", // https://news.airbnb.com/media-assets/category/brand/ "mail": "#ff0", "music": "#f0f", @@ -111,8 +112,10 @@ exports.getColor = function(msg,options) { // "home assistant": "#41bdf5", // ha-blue is #41bdf5, but that's the background "instagram": "#ff0069", // https://about.instagram.com/brand/gradient "jira": "#0052cc", //https://atlassian.design/resources/logo-library + "leboncoin": "#fa7321", "lieferando": "#ff8000", "linkedin": "#0a66c2", // https://brand.linkedin.com/ + "messages": "#0a5cce", "messenger": "#0078ff", "mastodon": "#563acc", // https://www.joinmastodon.org/branding "mattermost": "#00f", diff --git a/apps/messageicons/icons/gmail.png b/apps/messageicons/icons/gmail.png new file mode 100644 index 0000000000000000000000000000000000000000..b96465db18d3fe119bd1a8b8b903a48538af1a38 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaT3?y&uT)!JgF%}28J2BoosZ$T+a29w(7Bet# z3xhBt!>lbP0l+XkKp+GtR literal 0 HcmV?d00001 diff --git a/apps/messageicons/icons/icon_names.json b/apps/messageicons/icons/icon_names.json index de8be9e989..89f81be081 100644 --- a/apps/messageicons/icons/icon_names.json +++ b/apps/messageicons/icons/icon_names.json @@ -1,6 +1,7 @@ [ { "app":"default", "icon":"default.png" }, { "app":"airbnb", "icon":"airbnb.png" }, + { "app":"agenda", "icon":"agenda.png" }, { "app":"alarm", "icon":"alarm.png" }, { "app":"alarmclockreceiver", "icon":"alarm.png" }, { "app":"amazon shopping", "icon":"amazon.png" }, @@ -36,6 +37,7 @@ { "app":"aurora droid", "icon":"security.png" }, { "app":"github", "icon":"github.png" }, { "app":"gitlab", "icon":"gitlab.png" }, + { "app":"gmail", "icon":"gmail.png" }, { "app":"gmx", "icon":"gmx.png" }, { "app":"google", "icon":"google.png" }, { "app":"google home", "icon":"google home.png" }, @@ -45,6 +47,7 @@ { "app":"jira", "icon":"jira.png" }, { "app":"kalender", "icon":"kalender.png" }, { "app":"keep notes", "icon":"google keep.png" }, + { "app":"leboncoin", "icon":"leboncoin.png" }, { "app":"lieferando", "icon":"lieferando.png" }, { "app":"linkedin", "icon":"linkedin.png" }, { "app":"maps", "icon":"map.png" }, @@ -55,6 +58,7 @@ { "app":"tooot", "icon":"mastodon.png" }, { "app":"tusky", "icon":"mastodon.png" }, { "app":"mattermost", "icon":"mattermost.png" }, + { "app":"messages", "icon":"messages.png" }, { "app":"n26", "icon":"n26.png" }, { "app":"netflix", "icon":"netflix.png" }, { "app":"news", "icon":"news.png" }, @@ -110,6 +114,5 @@ { "app":"meet", "icon":"videoconf.png" }, { "app":"music", "icon":"music.png" }, { "app":"sms message", "icon":"default.png" }, - { "app":"mail", "icon":"default.png" }, - { "app":"gmail", "icon":"default.png" } + { "app":"mail", "icon":"default.png" } ] diff --git a/apps/messageicons/icons/leboncoin.png b/apps/messageicons/icons/leboncoin.png new file mode 100644 index 0000000000000000000000000000000000000000..fb41bf03f109af3626faf7af68faa31fa3e12ebc GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaT3?y&uT)!JgF%}28J2BoosZ$T+a29w(7Bet# z3xhBt!>ll2t~yoBUWJ3|968~YO)f1fBX{xG}0=aGJ$(Wd_nN6*yTH5oqM-`vAvZy_P6WhEi0 l<7Z&xu_qzr!4F1bVTNd5S;I?iMzcWndAj Date: Wed, 14 Aug 2024 12:01:29 +0200 Subject: [PATCH 086/451] more_pickers: draw sections independently for faster execution --- modules/more_pickers.js | 109 ++++++++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 38 deletions(-) diff --git a/modules/more_pickers.js b/modules/more_pickers.js index 596b36fdf1..865ff689c8 100644 --- a/modules/more_pickers.js +++ b/modules/more_pickers.js @@ -10,27 +10,37 @@ exports.doublePicker = function (options) { var v_1 = options.value_1; var v_2 = options.value_2; - function draw() { + function draw1() { + var txt_1 = options.format_1 ? options.format_1(v_1) : v_1; + g.setColor(g.theme.bg2) .fillRect(14, 60, 81, 166) - .fillRect(95, 60, 162, 166); - - g.setColor(g.theme.fg2) + .setColor(g.theme.fg2) .fillPoly([47.5, 68, 62.5, 83, 32.5, 83]) .fillPoly([47.5, 158, 62.5, 143, 32.5, 143]) - .fillPoly([128.5, 68, 143.5, 83, 113.5, 83]) - .fillPoly([128.5, 158, 143.5, 143, 113.5, 143]); - - var txt_1 = options.format_1 ? options.format_1(v_1) : v_1; + .setFontAlign(0, 0) + .setFontVector(Math.min(30, (R.w - 110) * 100 / g.setFontVector(100).stringWidth(txt_1))) + .drawString(txt_1, 47.5, 113); + } + function draw2() { var txt_2 = options.format_2 ? options.format_2(v_2) : v_2; - g.setFontAlign(0, 0) - .setFontVector(Math.min(30, (R.w - 110) * 100 / g.setFontVector(100).stringWidth(txt_1))) - .drawString(txt_1, 47.5, 113) + g.setColor(g.theme.bg2) + .fillRect(95, 60, 162, 166) + .setColor(g.theme.fg2) + .fillPoly([128.5, 68, 143.5, 83, 113.5, 83]) + .fillPoly([128.5, 158, 143.5, 143, 113.5, 143]) + .setFontAlign(0, 0) .setFontVector(Math.min(30, (R.w - 110) * 100 / g.setFontVector(100).stringWidth(txt_2))) - .drawString(txt_2, 128.5, 113) - .setFontVector(30) - .drawString(options.separator ?? "", 88, 110); + .drawString(txt_2, 128.5, 113); + } + function drawSeparator(){ + g.setFontVector(30).drawString(options.separator ?? "", 88, 110); + } + function drawAll() { + draw1(); + draw2(); + drawSeparator() } function cb(dir, x_part) { if (dir) { @@ -38,12 +48,14 @@ exports.doublePicker = function (options) { v_1 -= (dir || 1) * (options.step_1 || 1); if (options.min_1 !== undefined && v_1 < options.min_1) v_1 = options.wrap_1 ? options.max_1 : options.min_1; if (options.max_1 !== undefined && v_1 > options.max_1) v_1 = options.wrap_1 ? options.min_1 : options.max_1; + draw1(); } else { v_2 -= (dir || 1) * (options.step_2 || 1); if (options.min_2 !== undefined && v_2 < options.min_2) v_2 = options.wrap_2 ? options.max_2 : options.min_2; if (options.max_2 !== undefined && v_2 > options.max_2) v_2 = options.wrap_2 ? options.min_2 : options.max_2; + draw2(); } - draw(); + drawSeparator(); } else { // actually selected options.value_1 = v_1; options.value_2 = v_2; @@ -52,14 +64,14 @@ exports.doublePicker = function (options) { } } - draw(); + drawAll(); var dy = 0; Bangle.setUI({ mode: "custom", back: options.back, remove: options.remove, - redraw: draw, + redraw: drawAll, drag: e => { dy += e.dy; // after a certain amount of dragging up/down fire cb if (!e.b) dy = 0; @@ -101,51 +113,72 @@ exports.triplePicker = function (options) { var v_2 = options.value_2; var v_3 = options.value_3; - function draw() { + function draw1() { + var txt_1 = options.format_1 ? options.format_1(v_1) : v_1; + g.setColor(g.theme.bg2) .fillRect(8, 60, 56, 166) - .fillRect(64, 60, 112, 166) - .fillRect(120, 60, 168, 166); - - g.setColor(g.theme.fg2) + .setColor(g.theme.fg2) .fillPoly([32, 68, 47, 83, 17, 83]) .fillPoly([32, 158, 47, 143, 17, 143]) - .fillPoly([88, 68, 103, 83, 73, 83]) - .fillPoly([88, 158, 103, 143, 73, 143]) - .fillPoly([144, 68, 159, 83, 129, 83]) - .fillPoly([144, 158, 159, 143, 129, 143]); - - var txt_1 = options.format_1 ? options.format_1(v_1) : v_1; + .setFontAlign(0, 0) + .setFontVector(Math.min(30, (R.w - 130) * 100 / g.setFontVector(100).stringWidth(txt_1))) + .drawString(txt_1, 32, 113); + } + function draw2() { var txt_2 = options.format_2 ? options.format_2(v_2) : v_2; - var txt_3 = options.format_3 ? options.format_3(v_3) : v_3; - g.setFontAlign(0, 0) - .setFontVector(Math.min(30, (R.w - 130) * 100 / g.setFontVector(100).stringWidth(txt_1))) - .drawString(txt_1, 32, 113) + g.setColor(g.theme.bg2) + .fillRect(64, 60, 112, 166) + .setColor(g.theme.fg2) + .fillPoly([88, 68, 103, 83, 73, 83]) + .fillPoly([88, 158, 103, 143, 73, 143]) + .setFontAlign(0, 0) .setFontVector(Math.min(30, (R.w - 130) * 100 / g.setFontVector(100).stringWidth(txt_2))) - .drawString(txt_2, 88, 113) + .drawString(txt_2, 88, 113); + } + function draw3() { + var txt_3 = options.format_3 ? options.format_3(v_3) : v_3; + + g.setColor(g.theme.bg2) + .fillRect(120, 60, 168, 166) + .setColor(g.theme.fg2) + .fillPoly([144, 68, 159, 83, 129, 83]) + .fillPoly([144, 158, 159, 143, 129, 143]) + .setFontAlign(0, 0) .setFontVector(Math.min(30, (R.w - 130) * 100 / g.setFontVector(100).stringWidth(txt_3))) - .drawString(txt_3, 144, 113) - .setFontVector(30) + .drawString(txt_3, 144, 113); + } + function drawSeparators(){ + g.setFontVector(30) .drawString(options.separator_1 ?? "", 60, 113) .drawString(options.separator_2 ?? "", 116, 113); } + function drawAll() { + draw1(); + draw2(); + draw3(); + drawSeparators(); + } function cb(dir, x_part) { if (dir) { if (x_part == -1) { v_1 -= (dir || 1) * (options.step_1 || 1); if (options.min_1 !== undefined && v_1 < options.min_1) v_1 = options.wrap_1 ? options.max_1 : options.min_1; if (options.max_1 !== undefined && v_1 > options.max_1) v_1 = options.wrap_1 ? options.min_1 : options.max_1; + draw1(); } else if (x_part == 0) { v_2 -= (dir || 1) * (options.step_2 || 1); if (options.min_2 !== undefined && v_2 < options.min_2) v_2 = options.wrap_2 ? options.max_2 : options.min_3; if (options.max_2 !== undefined && v_2 > options.max_2) v_2 = options.wrap_2 ? options.min_2 : options.max_3; + draw2(); } else { v_3 -= (dir || 1) * (options.step_3 || 1); if (options.min_3 !== undefined && v_3 < options.min_3) v_3 = options.wrap_3 ? options.max_3 : options.min_3; if (options.max_3 !== undefined && v_3 > options.max_3) v_3 = options.wrap_3 ? options.min_3 : options.max_3; + draw3(); } - draw(); + drawSeparators(); } else { // actually selected options.value_1 = v_1; options.value_2 = v_2; @@ -155,14 +188,14 @@ exports.triplePicker = function (options) { } } - draw(); + drawAll(); var dy = 0; Bangle.setUI({ mode: "custom", back: options.back, remove: options.remove, - redraw: draw, + redraw: drawAll, drag: e => { dy += e.dy; // after a certain amount of dragging up/down fire cb if (!e.b) dy = 0; From 4b1e4d01ce1cb5924d09e3de31b30b674c0414b8 Mon Sep 17 00:00:00 2001 From: paul-arg <18153423+paul-arg@users.noreply.github.com> Date: Sat, 31 Aug 2024 21:55:23 +0200 Subject: [PATCH 087/451] elapsed_t: remove unused function --- apps/elapsed_t/app.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/elapsed_t/app.js b/apps/elapsed_t/app.js index 29bea4fef1..910ff85f3c 100644 --- a/apps/elapsed_t/app.js +++ b/apps/elapsed_t/app.js @@ -121,10 +121,6 @@ function formatHourToAMPM(h) { return `${h_ampm}\n${ampm}`; } -function howManyDaysInMonth(month, year) { - return new Date(year, month, 0).getDate(); -} - function getDatePickerObject() { switch (settings.dateFormat) { case 0: From 70be2ed03f82c1bea5070f00caa723e5f72ba573 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 31 Aug 2024 21:55:24 +0200 Subject: [PATCH 088/451] pomoplus: HW button hide/show widgets + SW buttons --- apps/pomoplus/ChangeLog | 4 +++- apps/pomoplus/README.md | 3 +++ apps/pomoplus/app.js | 39 +++++++++++++++++++++++++++++++++++---- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/apps/pomoplus/ChangeLog b/apps/pomoplus/ChangeLog index 6ce1bd59a9..327ce07c2b 100644 --- a/apps/pomoplus/ChangeLog +++ b/apps/pomoplus/ChangeLog @@ -2,4 +2,6 @@ 0.02-0.04: Bug fixes 0.05: Submitted to the app loader 0.06: Added setting to show clock after start/resume -0.07: Make fonts and buttons larger for legibility and ease of use. +0.07: Make fonts and buttons larger for legibility and ease of use. Hide + buttons when screen is locked. Toggle the graphical presentation when + pressing the (middle) hardware button. diff --git a/apps/pomoplus/README.md b/apps/pomoplus/README.md index 0e8170f504..20bc39a67e 100644 --- a/apps/pomoplus/README.md +++ b/apps/pomoplus/README.md @@ -19,6 +19,7 @@ - Click the pause button if you're interrupted with something urgent. - Click the cross button if you need to end your work session. - Click the skip button if you forgot to start the pomodori after the urgent interruption and ended up working for a long time! (Good on ya'!) +- Press the (middle) hardware button to toggle visibility of widgets and software buttons. Configure the pomodori and break times in the settings. @@ -26,6 +27,8 @@ Configure the pomodori and break times in the settings. Continues to run in the background if you exit the app while the pomodoro timer is running. +The buttons and widgets hide automatically when the screen is locked. + ## Requests Open an issue on the espruino/BangleApps issue tracker. diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index 0576547dc0..0c4e5a79a0 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -88,10 +88,34 @@ function drawTimerAndMessage() { if (!Bangle.isLocked()) drawButtons(); -Bangle.on("touch", (button, xy) => { +let hideButtons = ()=>{ + g.clearRect(0,BUTTON_TOP,W-1,H-1); +} + +let graphicState = 0; // 0 - all is visible, 1 - widgets are hidden, 2 - widgets and buttons are hidden. +let switchGraphicsOnButton = (n)=>{ + if (process.env.HWVERSION == 2) n=2; // Translate Bangle.js 2 button to Bangle.js 1 middle button. + if (n == 2) { + if (graphicState == 0) { + wu.hide(); + } + if (graphicState == 1) { + hideButtons(); + } + if (graphicState == 2) { + wu.show(); + drawButtons(); + } + + graphicState = (graphicState+1) % 3; + } +} + +let touchHandler = (button, xy) => { //If we support full touch and we're not touching the keys, ignore. //If we don't support full touch, we can't tell so just assume we are. - if (xy !== undefined && xy.y <= g.getHeight() - BUTTON_HEIGHT) return; + let isOutsideButtonArea = xy !== undefined && xy.y <= g.getHeight() - BUTTON_HEIGHT; + if (isOutsideButtonArea || graphicState == 2) return; if (!common.state.wasRunning) { //If we were never running, there is only one button: the start button @@ -147,7 +171,14 @@ Bangle.on("touch", (button, xy) => { if (common.settings.showClock) Bangle.showClock(); } } -}); +}; + +Bangle.setUI({ + mode: "custom", + touch: touchHandler, + btn: switchGraphicsOnButton + +}) let timerInterval; @@ -168,7 +199,7 @@ if (common.state.running) { Bangle.on('lock', (on, reason) => { if (on) { - g.clearRect(0,BUTTON_TOP,W-1,H-1); + hideButtons(); wu.hide(); } if (!on) { From f20683cc4e9e12de201c47f3d30ac8cb9add71d6 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 31 Aug 2024 21:57:44 +0200 Subject: [PATCH 089/451] pomoplus: fix typo in readme --- apps/pomoplus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/pomoplus/README.md b/apps/pomoplus/README.md index 20bc39a67e..98642debfd 100644 --- a/apps/pomoplus/README.md +++ b/apps/pomoplus/README.md @@ -18,7 +18,7 @@ - Click the play button to start a pomodoro and get to work! - Click the pause button if you're interrupted with something urgent. - Click the cross button if you need to end your work session. -- Click the skip button if you forgot to start the pomodori after the urgent interruption and ended up working for a long time! (Good on ya'!) +- Click the skip button if you forgot to start the pomodoro after the urgent interruption and ended up working for a long time! (Good on ya'!) - Press the (middle) hardware button to toggle visibility of widgets and software buttons. Configure the pomodori and break times in the settings. From ff3228c8f2fcbe64cc6c80df289c7fe13f5b1004 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 31 Aug 2024 22:23:05 +0200 Subject: [PATCH 090/451] pomoplus: refactor function names touchHandler -> onTouchSoftwareButtons switchGraphicsOnButton -> onButtonSwitchGraphics --- apps/pomoplus/app.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index 0c4e5a79a0..c587a3b730 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -93,7 +93,7 @@ let hideButtons = ()=>{ } let graphicState = 0; // 0 - all is visible, 1 - widgets are hidden, 2 - widgets and buttons are hidden. -let switchGraphicsOnButton = (n)=>{ +let onButtonSwitchGraphics = (n)=>{ if (process.env.HWVERSION == 2) n=2; // Translate Bangle.js 2 button to Bangle.js 1 middle button. if (n == 2) { if (graphicState == 0) { @@ -106,12 +106,11 @@ let switchGraphicsOnButton = (n)=>{ wu.show(); drawButtons(); } - graphicState = (graphicState+1) % 3; } } -let touchHandler = (button, xy) => { +let onTouchSoftwareButtons = (button, xy) => { //If we support full touch and we're not touching the keys, ignore. //If we don't support full touch, we can't tell so just assume we are. let isOutsideButtonArea = xy !== undefined && xy.y <= g.getHeight() - BUTTON_HEIGHT; @@ -175,9 +174,8 @@ let touchHandler = (button, xy) => { Bangle.setUI({ mode: "custom", - touch: touchHandler, - btn: switchGraphicsOnButton - + touch: onTouchSoftwareButtons, + btn: onButtonSwitchGraphics }) let timerInterval; From d7f7d2b95d8e66ff89cae32d44a0e460907666bb Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 31 Aug 2024 22:43:39 +0200 Subject: [PATCH 091/451] pomoplus: fix unintentional redraws when unlocking --- apps/pomoplus/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/pomoplus/app.js b/apps/pomoplus/app.js index c587a3b730..56275efb46 100644 --- a/apps/pomoplus/app.js +++ b/apps/pomoplus/app.js @@ -196,13 +196,14 @@ if (common.state.running) { } Bangle.on('lock', (on, reason) => { + if (graphicState==2) return; if (on) { hideButtons(); wu.hide(); } if (!on) { drawButtons(); - wu.show(); + if (graphicState==0) wu.show(); } }); From bdb681d8486b18e18f2599ba30919fc9f0af0954 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 00:41:50 +0200 Subject: [PATCH 092/451] Add dutchclock app --- apps/dutchclock/app-icon.js | 1 + apps/dutchclock/app.js | 228 ++++++++++++++++++++++++++++++++++ apps/dutchclock/app.png | Bin 0 -> 1436 bytes apps/dutchclock/metadata.json | 19 +++ apps/dutchclock/settings.js | 61 +++++++++ 5 files changed, 309 insertions(+) create mode 100644 apps/dutchclock/app-icon.js create mode 100644 apps/dutchclock/app.js create mode 100644 apps/dutchclock/app.png create mode 100644 apps/dutchclock/metadata.json create mode 100644 apps/dutchclock/settings.js diff --git a/apps/dutchclock/app-icon.js b/apps/dutchclock/app-icon.js new file mode 100644 index 0000000000..7d6e655e8a --- /dev/null +++ b/apps/dutchclock/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwgP/AE0/Ao/4sccAoX79NtAofttIFD8dsAof3t1/GZ397oGE/YLE6IFDloFE1vbAoeNAondAon/z4FE356U/nNxhZC/drlpLDscNAoX4ue9C4f3L4oAKt4FEQ4qxE/0skIGDtg7DAoNtAocsAogAX94POA")) \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js new file mode 100644 index 0000000000..a25d349fa1 --- /dev/null +++ b/apps/dutchclock/app.js @@ -0,0 +1,228 @@ +const SCREEN_WIDTH = g.getWidth(); +const SCREEN_HEIGHT = g.getHeight(); +const MINS_IN_HOUR = 60; + +const VARIANT_EXACT = 'exact'; +const VARIANT_APPROXIMATE = 'approximate'; +const VARIANT_HYBRID = 'hybrid'; + +const SETTINGS_FILE = "dutchclock.json"; + +let date, mins; + +var settings = Object.assign({ + // default values + variant: VARIANT_APPROXIMATE, + showWidgets: true +}, require('Storage').readJSON(SETTINGS_FILE, true) || {}); + +const maxFontSize = SCREEN_HEIGHT + - 20 // For the date + - (settings.showWidgets ? 25 : 0); + +const X = SCREEN_WIDTH / 2; +const Y = SCREEN_HEIGHT / 2 + + (settings.showWidgets ? 5 : -5); + + +function initialize() { + // draw immediately at first + tick(); + +// for (let mm = 0; mm < 60; mm++) { +// console.log(23, mm); +// console.log(getTimeLines(23 * 60 + mm)); +// } + + // now check every second + let secondInterval = setInterval(tick, 1000); + // Stop updates when LCD is off, restart when on + + Bangle.on('lcdPower',on=>{ + if (secondInterval) clearInterval(secondInterval); + secondInterval = undefined; + if (on) { + secondInterval = setInterval(tick, 1000); + draw(); // draw immediately + } + }); +} + +function tick() { + date = new Date(); + const m = date.getHours() * MINS_IN_HOUR + date.getMinutes(); + + if (m !== mins) { + mins = m; + draw(); + } +} + +function draw() { + // work out how to display the current time + const timeLines = getTimeLines(mins); + + // Reset the state of the graphics library + g.clear(true); + // draw the current time (4x size 7 segment) + setFont(timeLines); + + g.setFontAlign(0,0); // align center top + g.drawString(timeLines.join("\n"), X, Y, true /*clear background*/); + + // draw the date, in a normal font + g.setFont("6x8"); + g.setFontAlign(0,1); // align center bottom + // pad the date - this clears the background if the date were to change length + var dateStr = " "+require("locale").date(date)+" "; + g.drawString(dateStr, SCREEN_WIDTH/2, SCREEN_HEIGHT - 5, true /*clear background*/); + + /* Show launcher when middle button pressed + This should be done *before* Bangle.loadWidgets so that + widgets know if they're being loaded into a clock app or not */ + Bangle.setUI("clock"); + + if (settings.showWidgets) { + // Load widgets + Bangle.loadWidgets(); + Bangle.drawWidgets(); + } +} + +function setFont(timeLines) { + const size = maxFontSize / timeLines.length; + + g.setFont("Vector", size); + + let width = g.stringWidth(timeLines.join('\n')); + + if (width > SCREEN_WIDTH) { + g.setFont("Vector", Math.floor(size * (SCREEN_WIDTH / width))); + } +} + +function getTimeLines(m) { + switch (settings.variant) { + case VARIANT_EXACT: + return getExactTimeLines(m); + case VARIANT_APPROXIMATE: + return getApproximateTimeLines(m); + case VARIANT_HYBRID: + return distanceFromNearest(15)(m) < 3 + ? getApproximateTimeLines(m) + : getExactTimeLines(m); + default: + console.warn(`Error in settings: unknown variant "${settings.variant}"`); + return getExactTimeLines(m); + } +} + +function getExactTimeLines(m) { + const hour = getHour(m); + const minutes = getMinutes(hour.offset); + + const lines = minutes.concat(hour.lines); + if (lines.length === 1) { + lines.push('uur'); + } + + return lines; +} + +function getApproximateTimeLines(m) { + const roundMinutes = getRoundMinutes(m); + const hour = getHour(roundMinutes.minutes); + + const minutes = getMinutes(hour.offset); + + const lines = minutes.concat(hour.lines); + + if (lines.length === 1) { + lines.push('uur'); + } + + return addApproximateDescription(lines, roundMinutes.offset); +} + +function getHour(minutes) { + const hours = ['twaalf', 'een', 'twee', 'drie', 'vier', 'vijf', 'zes', 'zeven', 'acht', 'negen', 'tien', 'elf']; + + const h = Math.floor(minutes / MINS_IN_HOUR), m = minutes % MINS_IN_HOUR; + + if (m <= 15) { + return {lines: [hours[h % 12]], offset: m}; + } + + if (m > 15 && m < 45) { + return { + lines: ['half', hours[(h + 1) % 12]], + offset: m - (MINS_IN_HOUR / 2) + }; + } + + return {lines: [hours[(h + 1) % 12]], offset: m - MINS_IN_HOUR}; +} + +function getMinutes(m) { + const minutes = ['', 'een', 'twee', 'drie', 'vier', 'vijf', 'zes', 'zeven', 'acht', 'negen', 'tien', 'elf', 'twaalf', 'dertien', 'veertien', 'kwart']; + + if (m === 0) { + return []; + } + + return [minutes[Math.abs(m)], m > 0 ? 'over' : 'voor']; +} + +function getRoundMinutes(m) { + const nearest = roundTo(5)(m); + + return { + minutes: nearest, + offset: m - nearest + }; +} + +function addApproximateDescription(lines, offset) { + if (offset === 0) { + return lines; + } + + if (lines[1] === 'uur') { + const plural = getPlural(lines[0]); + return { + '-2': ['tegen', plural], + '-1': ['iets voor', plural], + '1': ['iets na', plural], + '2': ['even na', plural] + }[`${offset}`]; + } + + return { + '-2': ['bijna'].concat(lines), + '-1': ['rond'].concat(lines), + '1': ['iets na'].concat(lines), + '2': lines.concat(['geweest']) + }[`${offset}`]; +} + +function getPlural(h) { + return { + een: 'enen', + twee: 'tweeën', + drie: 'drieën', + vijf: 'vijven', + zes: 'zessen', + elf: 'elven', + twaalf: 'twaalven' + }[h] || `${h}en`; +} + +function distanceFromNearest(x) { + return n => Math.abs(n - roundTo(x)(n)); +} + +function roundTo(x) { + return n => Math.round(n / x) * x; +} + +initialize(); diff --git a/apps/dutchclock/app.png b/apps/dutchclock/app.png new file mode 100644 index 0000000000000000000000000000000000000000..faacb7eaf13b86d8144a49f9afa9f0d9a49958ce GIT binary patch literal 1436 zcmV;N1!MY&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1u;oPK~!i%?U`99 zbzc;~m*HMhd_)! zl(CD(UB&boW;HSA-?IPi@z7p~uy9|KIyj{$NS z92}&NR7`Hb#KZ)Bq$0_HU3RptiP_R;Qz*1Du?kXl`g|s4z%ae=`W$0cwHzFc} z3`94>vB1DUnj0J(EXmG_ke03OKCDLQ$`E#xujIsje=H^tG8DeE+MH{-Utqph>r7Obs%U^Tl@KZ{dn*XN( zO-)Ty>v(y2Q3;KdmzP6&dOFFSot+RK9!~Ps))qA_xF3p(iz)kJ#>R3S_k*vmFRZMr z&|FF29{32nKx1}xc5HTbmU>+5Z4q8N=o1;w4f_5!FE5XALs?Bt4J9yMcCg{$Va8iZ z#xpeIg`K`mlEQ}#z|8CF>iUq$GN9@q-VG2B49~;KMG2 zZi9VoK|ui&78btirn0iKpr@yYdSFLKN7CWAr>7@0G&E3wmy?r2dShYnn(kTI;Njr`RaI4V!hoPZ9~>Nzao*nEq>GM@rn4WcMzMv&{eY(tSg9r^Cej=^{Nw>s zBg+8vX$+@(dwX=BpPx^Cz*i#60Q5erLPamk$jG20ldnXU0psK2bZu{M2j0ApEP`z$ z9zWu-qG%w>nB=fKJ3KrjoosLuOQo!=jAA>FN|eZWh-5rmvZtpf=I7_fA|oRi51~x0 zR?~dU3BP{*V#&$L%-PwQ4us_*YXvawBhAgtbWSRQJ@ESaIvuOv(Yi*X5k`RW!O+kU zo#gfR_X}F-$T9%ydaQBqAq^4rxF2w1t5hmshH(=q0ucPoD_2PH_d`Tz;SuVtz7nqxy1D#F>cXxMGTHuDo3KTmve5J%= zKWuDlkOAlC=kz@+uP-kzVS9TUDk>^SCly&MfTwV1e_C1^ { + writeOption(setting, value); + } + }; + } + + // Show the menu + function showMainMenu() { + const mainMenu = [ + getOption('Exact', 'variant', VARIANT_EXACT), + getOption('Approximate', 'variant', VARIANT_APPROXIMATE), + getOption('Hybrid', 'variant', VARIANT_HYBRID), + { + title: 'Show widgets?', + value: settings.showWidgets ?? true, + onchange: v => writeSetting('showWidgets', v) + } + ]; + + mainMenu[""] = { + title : "Dutch Clock", + back: back + }; + + E.showMenu(mainMenu); + } + + showMainMenu(); + }) \ No newline at end of file From 45cc0dc60f0e4f56f113128066b6306f2bc11b45 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 00:55:10 +0200 Subject: [PATCH 093/451] Allow emulator --- apps/dutchclock/metadata.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 49873c18f5..a7f863849b 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -8,6 +8,7 @@ "type": "clock", "tags": "clock,dutch,text", "supports": ["BANGLEJS", "BANGLEJS2"], + "allow_emulator": true, "storage": [ {"name":"dutchclock.app.js","url":"app.js"}, {"name":"dutchclock.settings.js","url":"settings.js"}, @@ -16,4 +17,5 @@ "data": [ {"name":"dutchclock.json"} ] -} \ No newline at end of file +} + \ No newline at end of file From 3cc5c3f31dbc8667ec878a7294de302155e64a1a Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:20:29 -0500 Subject: [PATCH 094/451] Restore custom background function, fix clockbg usage, restore img linked in readme --- apps/boxclk/ChangeLog | 3 ++- apps/boxclk/app.js | 22 +++++++++++++++++++--- apps/boxclk/boxclk.space.img | Bin 0 -> 30979 bytes apps/boxclk/screenshot-2.png | Bin 3456 -> 7460 bytes 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 apps/boxclk/boxclk.space.img diff --git a/apps/boxclk/ChangeLog b/apps/boxclk/ChangeLog index b78eba44c2..f7ee419046 100644 --- a/apps/boxclk/ChangeLog +++ b/apps/boxclk/ChangeLog @@ -3,4 +3,5 @@ 0.03: Allows showing the month in short or long format by setting `"shortMonth"` to true or false 0.04: Improves touchscreen drag handling for background apps such as Pattern Launcher 0.05: Fixes step count not resetting after a new day starts -0.06 Added clockbackground app functionality +0.06: Added clockbackground app functionality +0.07: Allow custom backgrounds per boxclk config and from the clockbg module diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 548062349b..61edfde7b6 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -10,6 +10,7 @@ let locale = require("locale"); let widgets = require("widget_utils"); let date = new Date(); + let bgImage; let configNumber = (storage.readJSON("boxclk.json", 1) || {}).selectedConfig || 0; let fileName = 'boxclk' + (configNumber > 0 ? `-${configNumber}` : '') + '.json'; // Add a condition to check if the file exists, if it does not, default to 'boxclk.json' @@ -71,6 +72,14 @@ * --------------------------------------------------------------- */ + for (let key in boxesConfig) { + if (key === 'bg' && boxesConfig[key].img) { + bgImage = storage.read(boxesConfig[key].img); + } else if (key !== 'selectedConfig') { + boxes[key] = Object.assign({}, boxesConfig[key]); + } + } + let boxKeys = Object.keys(boxes); boxKeys.forEach((key) => { @@ -211,14 +220,21 @@ */ let draw = (function() { - let updatePerMinute = true; // variable to track the state of time display + let updatePerMinute = true; return function(boxes) { date = new Date(); g.clear(); - background.fillRect(Bangle.appRect); + + // Always draw background for full screen + if (bgImage) { + g.drawImage(bgImage, 0, 0); + } else { + background.fillRect(0, 0, g.getWidth(), g.getHeight()); + } + if (boxes.time) { - boxes.time.string = modString(boxes.time, locale.time(date, isBool(boxes.time.short, true) ? 1 : 0)); + boxes.time.string = modString(boxes.time, locale.time(date, isBool(boxes.time.short, true) ? 1 : 0).trim()); updatePerMinute = isBool(boxes.time.short, true); } if (boxes.meridian) { diff --git a/apps/boxclk/boxclk.space.img b/apps/boxclk/boxclk.space.img new file mode 100644 index 0000000000000000000000000000000000000000..1708b5c24248a388661783f446bd86f5a2e4f715 GIT binary patch literal 30979 zcmeI5y>cTr5`YQvs!n9IdIS8$bgMpn(}ul-I7isaj1Ben0dy8kiXn``d44y}#(8)C+*WNTG)F zMT%Da7f^yJvL6+rX5@FGy|7wzFW zylOHD0AqW23rw1l{c-qCh;6yqe>ga90m5HZ=`2iw|inE<{!J z94zVy8a}U&0apFVB%DB8Tbu{tT0Ll97d)p348c~I15v@0_36d|#)3MpuC;!ztMllt z#!2Ptc)Ykn<*wkE&sQrgKA?o6KIU+^3+jBRXoG9cpG*Bt)xYfX_A67e&~QAy*0=}- z2PhJ-_2G1iR}Tbi4dM~i%z2+a=QZ5x75xJvlf`g;20Ao=>0hmF9c)#NC$t6Zn}I1K zx?GtK75#77FR;@1{P%A8@Bp`8J|Id*lB)ID;*ys`e52}3G6(W?)(^4!t(*0_@d=zH zw1RowyCvOznb?F{YglPBW=`5VX3P6ju;FC>pzhZD&06Sx4365sn$QUsptU_OP&{TwY$ifM9iy}tJVEo&1tM0KK$?m z*GNRLpx-w{2x0tE(+Ph-)mFb6*NhvVGo3E9)bo0|Y?xVkEHw@u)_g>-r}2=?9R|t; z5x>BSK{2lZ-ta0iva05p*^g3JmtoU<5n8?45(rp>8RNhpr*H$@yfKGsh5^a< z#clBLLq(j|V7jE&?3vJbBe>qJdm}qG+< zH$Q0@nFR5YYr~FLa>H6%8T(X&(ReyrY!{2G@n{eyicKMdTN{%NW8XMm2g9`)Ks2zS zZRMp~9G^kG!wKs5^%WT%q4u`zD%h>?~PiPh& zGQ)B^xiEhq)uApuI)*y!MlsY1%E=AF*aPF$#QCXZ3$idjv$a|{$54X`gTuzKFqanG zoV5w^XUrh>amyl&4{7 zF2n2TP-}SO6LqEmp@Ovudj->6jfRc1W**Y^ea5Gac~NaCnjAv+!k)3qX@kIrBx4zV zSoSqa(t*4(PHSj}S3l4hP1|7(EJC7WVdd{LKB2j%tz=Sy&>Vo>>KC+Z4%D&n6MD?> zl?qbQuY@!hq$}-WtSNECYdkPLE+aAUK7KJH2aa(W0vnw1XK^N7Y0Bb46drwd$%UBL zYSo{Rmj=34-WV)%-NLJJ@ec=ea$vvVw9-&xry~Wo=r_X`2M4?fmBaNh5aiX(fpfg% zgHOV%r;^TmJ(W?R$90T-408&$L$t>Bk40n=c62r$I-WMC0LGd;t_RUX3^x=VuNADC z@hKk;!lg$IQgD}75%KMhuNkjK@+2W)c;!=BDd>6;ukCS9PbcCf^;#rD5c0)WWnMS8 z^!``RfltIsm2+Ngr7@+yrY!Cp=-0hLVZ1nC1iT&HtzZwfQcu$^IZhHHUi?-9IFzl4{Ta1>KAeO0LSg2ZIwd+$u77v zV?3=Q8G=1Wyr#z?ZiZL=(Y(;05ZSt5b23An=Jm*-{T^u#uF_VG$_XOFFnYE_2Jylf zeQ?Ozb^gd~0mV+d@G3TYxB`rzf$a$Qm3VavyYlM!NEiJ^dh2@W)RP0Ef^zYZ8Jkye zcB-Zwgw`^eLue0F?t$mdyjh!YC0GG1!t(mp*DuG5?d7`k?dPFP7J1z)&8QfkGLF-4 zJPNwnEP=suIG#3?T!PrGxuMSXIl~LM$MGg!#PYiO9TtYT3rTQUT$8mxewgvnBQhV~ zq!NWNRYifeySU0-ba&pc#}Ti6Uy1s)yt!}5u1Z0ul26J;J1MV_ISg`Hj6hlrdG$*Z z%ljeB-|4D)6DKTVbJq9gSiSp!^>LD;Dp=hX^s zd%qJa60fVf$9PHIxvs}mFXfWLTm~oPdF^!Ph_8m#{k|4GgsW9zlfqmEClIgww#f8r zc%@QW!c?<)N>)bb8|i9oDZxd%3?z75Gld9v(I8ybZUU^cY?fbO5z?1sQ*om>4KKsx zyfouEl6Sp-TCahZcRJ)HCGqe!HTXOraa_(zuXtcMZYxiS7wrM(?7nUxS0>2kiEuTq zF$cFmZT~4#3I^x31pQ4|Df5!N_LX0eSNMc!Tc=Wg1~JF+@@Z#a4*ZdbzQ~n$)hPX> z?Rb;%BH*>jx}U63a9%TBkUiKhhy`9%;O(X3F|c_{><(&Ero49kK%bMXg6~R8+K2g1 zh3R|;D|W!A<7Hp$aYp%5spMpJj!#@&c-c$D>qELqS^dI-AbJf9y!)F{fqDPXOXlmg z98+(pP%(}g%KR_QC+V3}fAJJEcL~fkMc3S=1eV6pqCj2F@!I8!Fk@f(-wI{xXT=6$ z?wRax-hfu%wVz***ApDf>$8T^3-B8I4S5S)E97av0^;^WE=5MWU=?=0ZtWK)Jl-05 zz3`_9uC!x>gLw0}3GW?WDmxqNNlRx0V1zQ+cy4sf;f zYt--MP*{#`>rm6_8o*->*06PolN`p5^a$e>jXWo$0 zUJjS^%V%V~9N5Jo|LeOj;d8D;TxYv(0%@!P zY@<+DZdGz2%fV4CxDjvsdO57_ly^NW8LvcA@5QW&gWi@F@`r{b#NG_7!G z()rR6t?a$J^ZZFHzccV(j5q#yx@%{b@uf=|SKvtmRlz4Vv7|1)%J?e0neC4H?NfO8 zTqHL2B?EKz08dEm+PlbnGl+rPOKML+W#&?L(XTim9A17OKdt2IAO@H(g|l7RM0N69 zR2Tbgq$k_)Y%vaN?=bfcYindYO)`o9SeU|z9%lsvJ zMzvli&gE=0TP$YZP^-;Z_@!-_0DsfwLezS{U*Gs^7x7F%)tgPSx!w?V3b-AG_Ml!d z8o5$t4^@q8{7%oS)O@p_M+#P#SL3+1!Ml&by9C3}tU+(ebz*yfC!J=wgN2U!-HNa2 zP@_@$iZ0ovP*$-Gg@suUcQ=t5ia9z&0xztY!8It$2DT<6TT{bfqFiuQ@iv8}3KW!E zXNIs+zVB#hp5+S%tFUzD0X*77`yCRjoI{eM^DL+Y}1* zWw)yl(jFY7mcceoDK3s%XT!@W==XKu-LtP)onPnQ`1oW;O3`>B@j}V+Hicr9@F*pQ zpDIuskCVc?`-hX_3WZ&Cd*1Eff0IT&KOpE@rnrvtUo|=5x7Drv{X}$1q{XtIl?Q6fZnE z;V~ZLzwvlFonFo0pYD3c0T;eeb!>4dSszFTu;9S*T1`)ltN2*TDaXN6Qf`YqIm2P0 zLx80Np|uPGn#E#!1TSnr-q|1yL)ED{@87^Kh<7>#8{TdOx7J$8vv6DHlYP?dV8BE) zW$1a@t)+gr4fv>TWD9M}3%G`}-={OSfOwBIiMAHyGzUt$0p6c@n7s?|D1{c2vY z;gt6dcC3EDO^4xK$&;XhX9krPY2bg90fb6Z!jm4!hF1?B(C2Og0{ro9(>&mEJW%oG z*u4ycGT8+#+F_Tm=y=^{RHtD*Hn`` zk;}Xq7)A`%z6$nQ!rK5k#$S2t9#5uUT;%x*c^9)zywn1uA(OyCIp}Zj?aLk-Sl})7 zZr|>V)YTq>>>3D&!K>*x1ovmiYZ9Z1>o*TyLjBh7_se%dX$M{mZ()&gArGh$_<{t) z3&1VB7xgOS#f|dUzl6mFWw&1Rf0!lPBL|uEW=cT_@>+v{F*zJBxPBEZ&f0xh^Ssrk z%trYS#3~Zj`^2z90q_6fer-vF1(k8~vjF0`FN8 ztpm`0V_vmdEq}U^UIKMD5s{Z$ESC+MRWMF^U>Uj03%D?HG!0(~Th+_=??f_H8e>C! zi1SIFJ?2GPZNHlL)g;4Py6-bqA3RCr$PUD1~8Cc{{XeEpkw<#5a;Tnndv4jQ=s3rp>w8@EOt++skgn)k z@Ky^jtR+Ewt8#(HQUK0_mgC5aQ46zj|KBH*%j|wVIi~(JCg!ZIt%iRO;A^>P3c$;? zG8z~KPj9;P`eRL_PxO7H%^uT!0>h%dPX=&o%x9U_E2le)>u=5TDY0MAv8)#mIJ|mL zxjUav2JpD*UU*W#SSC0Z#Qz;l$-sIk_DZEy0NxROEbMqgPl*k01hDL7lwzP&X#c{RmI#ml?wF<1LCvJ7 z2ZdRYTzPKFcYyPfmrSgOm~J-?eNn^B0Jdy41Y;gK z`2UXRfRo>2;!B@yJI4%if>`TaW*E;7UO!8Jni=YNzye0M>*$vrgvh_>Im<$Wat;GK zQB`3u6>EArbQuzb98mxe@>BKs5CB_26qQ{-07cISfyovpLI}`Z$QUYCM$ChNam5e& zzjS@Q5aPwYTNF{p%BHbAhV%48@=bhlWlQ#nLH*9kdyEe1OEWXFKa0FcatgrYde&lM zmQfP`)>#Mb@QPW5Pdqll; zjND=1EuuEYWW~V9R$0bH4xVVAlN5!WP`BvkaE7I8S|WG=IKjM99kseQr$iK^>Zvda z0Ap&S7#Nv#0)Wk-J`uoj!)D4RjP|W%qhq6JO3D%Wpz}P>zzx8hYy%t9dNChj>Tax9 zvJ`qRgNT9I7?cHgv_9li6(UISDQ7qkfgBA^N!6jgVgLgMW*ByrgN6Xy={f13vj((C zL(f;)$6!JI|O06!TMp2O-Jc^4=2kR6U%gm0PpA|5=zaR$l+8_D5dD_jLv3xg2PQh70Uef>J zVvL^QN`nPJ|K;Q88=Gb9+WFV&4bV;L%vcZhwh=!#iVgK0xov#8-n5QzV!fFZnDP#; zbb-VZUOOWj)t@>KJjk%;uE9~yxkHvu+B?PVhvtxNgN8xc%3<1)J$b|&>082#O5=!StMvI~Gm?dTc62(crZ z8cb{*ohfF3-Q(0F2;Hoy7?_zTo?3T~!&la@ftU#OdzkT_nGD?X#@wzAtuR<7_E4a^ zIk{_Rb-VAHd@X7oJy-cvFKJ&R>H3Y4AF_zSzzD>EsVyqs*eAlkryufH3^5BqMBoe) zmpYiiAB{>`dBMPzIztF)90zMtj)wA+1Xu>{88ybh1O<5>$%0*@ zQ~qu<@ENNPpd<>&sQiFxY|$>b*;zs}@P>%%-MlT#Ab;3*`iLP?wa74@S)ikL7OatS z`=Btr#2eM^LvM?@6k=q&FvF)k`$;tGaIEfJFvzz$NC3XVj17e1hd!HZWH7uCrN@9e zq&Zz-FeKY8Rt|yFbtxJs%^MH18MyY?_1l{R7&35XP&7*p;)T?WY7X!pFS8!6zM7$$ z93stf+?eUY3``&vffePWnKXjUz?*Vk2G;M|gq9zWE*ppDv_RhBcS(>Up9v69@~cTjKvqsg=$1G}3XHe*YBQ@0T5u5KBL zc?|4jEmj8&5zrQ0bY9wwflo#%MoL_e=cQ|0qlAGs3&1P`AMIJIc;>duZEd_yj%L;; zf|gE5wx^j7hF5jozKA2wW@I*r&Je<4;F5&c*dhD#F$^q#c`~UJ>rP_eW`;|oo zr#A_Iy+I7DL;ozqUiH`v+%RtPRz%?@vWKfwv z5}WT$RBaY%+N-k=nW!Wd^Yo$pa@fsgZE~mdKZ$g>Pi?>oW$O({zLSoO9WPdgLiWdP`dR=)nW_EOYne{`>dy zI!n2a-$ai}K&3q+_0lD`j))#Kqr2s#c zfo%Zqn-AASmCoNPP&BD6L`lb@vfO1~^4E06NHegWc-e{giiO;hzTW45nJ#YKBm~z1 zm}vZyL`>#PcEH^EOVpK`5mfl3`!(>AAn`RQG+M6bJ22}H{#YjZ0@zEUT&qaM1tLc7 zy%8$b6t$6i<oX_`v$gBdg<6Y19ojCByGg1bX&oX3$5i<(_Sido$}nPvi8JlUMLM#Z&$MJo6q{NMjH*_n zzPA8HRXz2bV&Di^QAfC)m+G=BRAu!%T0fday~an|;ZtjS$}Gj0;$4Mvutjd&gfT7` z^M@Q56#hAG@(mXI3~`3}-;Q}lV%eZuB;y8)zK!@?0B3{U3Fa7O#MMk|#?GOzfMa6s zaKN?aVq`lY)7tsj32qy%VlIG()fuZG3u4r2W`QWz3f=n8`0RSo^Ga!5mxdx8yU&jf z{07F={roim&VrZ8D)89^{{p++@Z>ghhndr{FtbAlnb_{%(BK*@{A&Pg*&(|?Yeu<| zRz-G)S%+@;pqN+YW6g3}L2*_>L1@{q|=&(m3mQO5I_FV%~{)tzkpOZu0HdG!w2 zJ20>ek1{Ds)(4DS#lRX=Q71AD{w5jEKK+!Wi$jF=sAW4}PU zfU$NKyxBpufN|w5mCbozn3vTvCmt<#n3Z+QjKNSb@FOuV+uN+%3@gbx-bIfI{rU~D zF<@Zzx(jWz%gg0W1NOv!Ol~rxd;MFGO)&eJU|jvKnRh;HWlAkOpM_eVEe7oHUT8GAA_FN}THGO@>v z$K}{Bpm^7Hd3O*?aFzRx^_%tHr8dsrqnuO8&pZ!|76^fX#fuL0KKbq#>gb!&o2k|W z05{GG0C+U~*cn)y_(w5lcQ1ZI3}?o4%a~eS&T+OAW$@&t1nQTLPrQ37$T;R50lZBD zQFBZAi-C`7Jfn8*17HYA=8dy?OrDm7GMX`)+bMP2%X|VY0LTpB z5qPiX{{F-mjUN}WnMMXzXGvzB!auw;zRVVpA6YUK6D!jWW)}*ho{UUl1v2bSO!$-@L@c;ZSUEdnLWqrE%00$C z_C5xCRDPd-`JG=cTxGciGBsV1=x{|~(mCEoBhcTs^RomR*x)@QR}6vl5C&tLIifDl zg02hF47`0I?12A-xHpQCp1i}rm@!#nvvMQMl4Ydl%UyFVYbP_jAQ?Huz&oW*1@H{U z9S*Z*Z8Y7!^M@F*_nf7U2pSU%oXz5x0Ct!6yYv6QKG=Lp5StMwwx|D&TO~YSF_ck6$rnWy8P<=hVf3~8t z`ll9_*EftKQ3i}^$e9VIs~AR=D2jg4%&5O)Ey{PKtufx_fn}C#U#~y*b7u_PbKtR7 z8L$Hwt`I!~P4DZhJcd zng;8$4#+?yX}>In7KUOOnDQyfz-GT**H#z9Fu*eyxcLYqQ;)In;mxlMzM!2vFv5aB zz^Zq&PF)@WR}&bD22#&wcS;a$t&e74W5KC90GXNaVU|IoptXFvjTe>?EIHSf1NGXB z8ejeI7us>t(=`j{cDh{V9tE#Ev&_+x8Q{Gxu=Yhv8Z}cW{M0s#Hr9k&9dK8&n8ME zUe}qvM?6$UlvF;-CL=L&?_-XEvo5PLh(l|p5x<0E-z@W-4T(Icp*S5!u?#k1oIA?8 z4nR|ncrF+?>z>iBQVfh@mq3^4SlbLE(hVW-dT(a1e;@qJ)2J8O^0S$EV2v}2kxvG` zYXpUvSH~%=vxFRq(M0yMtvx$v5_&#Tq*)1(9TrBN1;$MOO$KHwBD+eRY&6@1u`i~8 z-oou7q&cg3;>J_fv@yA8Ox%P){^rM-pHi`~%L9Ele^lc0rX5LM!m|yVMFYdk zl8NyINUwQ%oYd>i@+?G{d0FEFrz0{viSu2-BV&JL6VzE$e(-q~e1px_A%s=gY~Rkv z-0VYIX9pA&5aGiXJ-Dm#=#Jk_RKz-D1~Nb$Occke%gR|QEo0!GQmgID5|SGOk9a5B zx!zQz^(k$z9nI<#EEh4GS9Nqf+6Az;E?`GY8pMMQuztmx7tz>zA`@>Oo^^9jJ3|Gr z*@#ELI_OUKN}b;No9T)@bMX;bU#XR z!Z)4yI4TTsOwns27%bfaD zSGJsaI&2XW4}=}jF*}`sM;35s)J%EqOaT%0twP{4F)Xx;dSOb(7FP1+Ol+x#tZ_R7 zBZa8vo%kifz`89jg>${)6$zXMIR%`vrP5d-59 z&U%}Wa~Sgk?-t*Hj>4V9NwG1zyO4;PBV)|;5A%(T!fJ2Jz9pFb;a=YC4Wf!^E9)k_ zqZ?AwL)UpD#`f3*p~W+d#b#5OsIEksM|R))`xYf20QU+n=mS^fWCpIz1skuNS7#>J z>_L$`C^Z$LT35|dvGD-&T2nAFp-^co!@KO5^48N3z%mvdAq5VZbEG11u$4~Uv}ihu zyy$o*xr=)?Khx+QT3E9qv<)(KmuU|jwK*VwLk!H$vI#7lpdyXPWFtIvPxa*2n>>ms zj3^m*fB?H_T5ESu92J=q7n3Q z{CT3`ycoJW!z3BoOdA+?*a=6tv99y>7sbHH(NmsVJ|Zh_E>fJ3jW})Zv7b%8q{hCO zX$Er!7;Y+G0U0)UU_=cg5X&$?+YJ)uc z85z(Fb4BW7ZIUKT5Af2sloG%j5pW>}?&VJ@T_*@-z&AA}K0S^#8D`+gSFc*;Z@M$! zqiziBt^81X6@aZ_E`~LDjGF2Mlg2n-K_`v|J*cHRMS{5MV#4;#q*oh{X#(J-Q7U()>YkZHkXzhth=CDks-WM?!=gm@@_k3ju^GA#%uvV&GJ`@WB8^%xi`Z$WbWqtzK;G7nmb#M#tkl1_pMix~X$p#V%+U4>7u2xp}1e1#s&rLFundQU}T(DUg z0yvoJs4|jd*a_JCtnH3AxWIQASOjJUh{ZY14yPpSY~DA$Ppw#Jz|%)0
#uQBUgR~!7yO@#H zFas+pf>{WwGn0YD+6x)XR26N28P6LA1`37&JYqk@dM*Py?-nNG_st~KSqShJwO&A@ zEJT-SSR{=&fNf*p!0E-lrP;{9ek%Y+8F(dtt+lOUU`ZBdYL|MY= z6N!Cg<|ty9cLFeL%C0ZjN=6vCH#1TI21<4vm;e%MlaWOO+s1EZVAck+0bK2YXeCfW zL4^_SMuvC#CmdFM5P%~LEbZ`RU}7lfO^X9y+Xh}K&N_fS3qh#0$LBpkw2(mMStXj0 zYy?$_oKP?OV8+0xzeF4fH!ZR@@yaDOK}J;2o^dwvs3uMZ)|F5UtTs%{76}Fx)lf?7 z0h?_%I`BO(N79Q^V&IUK2;sW{eD2`w$%%$)0)PnJ%oCX^yKz&32?;mUBE-O9>ijaW zu+l=mSxE@SKahd5vEFY1@T(taA@^lq25MNQmq~M@A9R?(KKo;u%Ul%x5dc3P1OE{Kdv?~@Fz@%cnf?fXpNN6u z&bUgz9CGJ19{ASBh+<%-%T|qM$3GuJXlB^Mn0j-5b_kJm=Br!?z|nq;C`JI72_xn) z@a)dKX? za1LT%lfS9M_bcTk>B6!s!w{0>1r!jDL&pZR0u5nVMD5FKBjD(9Q=lnTR zb40cW+DJW&>{|jj!obW34`a<^;9^mzpz&^3^Bp$EJ-w(8^!z5~joN?qSb9qUGp>ag zVk&WDv{R_6=ut9b4zXZkXgM1#M$BwPUzE9K34IiR8PH}Kp%^rjXACP8E>P!nNw05v zOfz4JC)*u~WwT9u6o50G>_Nt>FU7#RGP+@p!}h;NG8{6(DGQv8%|5BjJplH$ojvbJ z`G5!G{APav*{X+fDy@Kb|3Ulrb7O+px<72yFfe2PK>eF7qVkjh<3hg*!13<;C72YB zW<09>-smvAagN^+z1 zVg`jYg(F`vFkmnm!0bp8a_8>Yh&=;gSfk=o?UJ_o0+?|w3EWKoL1S(o^4_0Fok9OqE7`W=uDgYB!XBoJ_EFw>3lSll>0G_ZxPh=ef z%T`wyAqsd;2j=e}z!u>kJIu7v)sdQm_|<&$7C45NUI%6|la zqu~T&1V)BwcTznlZ#*1AL>F1iz+^HuZx}XI9(xnK9W&bjV$UFV$pexLIX*4&5_$_E7i0GuYq23AZq z{BMJ>GVSx$MOP+(1S=ynpngc;2XoS869YXPqU)Lqsc}`7WAyaYcX;K+6b+>=ih9$% z?frE|j?=yAlBi*qu24o_TI_vlIb_C!ZX#~f>ITWAO1vFqT5EE~P!4sG`v3m(N87uH zR|BG^cMGO|3AeNqJRa222ep2qj^>-tpY<3m>w>@9Im}f@S&ceNp7VQccYt=Y!G~EH zqHJ79Hq!b~Qp%bMUQHnoAcg`Zpk7R>!7o;DDrUgdbk?b_V&wv%x@m=I=N#T9q9JG) zA#)%jMi&ivVUQFEK)xGKUu{UmD93VP3G}PDacIxsqz8+>v5GMs!GkGfBh4oppo#gP z>3=uQa|4wgL9qBlYSF6D3_bK30*6M~eshMBY(#VYS=q0f>z4$8vZJA;xEV0%r1LD{?)(Oo$(UTvNB_1lo$8DFx&O%9O}scH?j~M;|g$g zen?~Aae}7GJ_*&bBq%HvgoL@Ln1^1T)>o;p(0&>#-(Z9jz3J@krFuIK$j{ykL)fS6 z?rytDF(}^?!RC9DA#Y{(-|c&n6?=FJ!TCJ_5Aene%#=7O>s_i=2wW0jFP$aF)&lrB zt2&zhEctkcg61WBn%cz3bzIPW6mTk^T2}EulBAKC>Lr;MA`zl6JT;g`esA%IfFQy_ zHCg8T7rAT6AX6Q2x&D*(XOL7@6SGh$6H%KyBVg8puoF8!Bs$=Lq6m}|WWNp)j)hZR zLgg*+x0YBI6MgOc9}GV+{y_8oasEY>YzSxjNQZopf9V_cCB0~<(uYl})^lP=!qso- zlQc#4u9Q;v@&r$rI7uF?H`}318r!rY1uL*%`kw?Ebsk-Fdw(Whi6o=n0x?- z+m>_*mqY^)_|YmoD4S#URHGYz$7eB7?HgGqM6bBU8iKG-*J0=QlpL3r4#q_MRZhb9g=e>p3mY4HeMILF5VhG~3e40e+j3b%5YT{}(5wf&+sQTq!8mf`TlT?iznfAh^fun@yJiqO}Aj z*?e|r5Fnxr-k>_o#w2X$R|TAzqvCkK78sMl#gnGuU}HLlN(&TbQb)6?00X&Xf&VeX z8kSiJ|5~7;t*!G~kG||Mwd}sOdul@8xN;Xx^oWW{q_$3f+i9B(-ksjoMQBPgy7nmG z76qm8ow_fhlgOmKTsReSMD5U%ad!A-8gKI_?8GZdX zb|0=MmCTSp<&*I6$?UD-1B*4xK0!_U8nR5v6?adgwGWcIoM~+SCvaP0sY$lMmaX^n z_4N0A%ZZ`-k~(PCfx~alNS%R_nn^fg((~-MOR0a&>rWMU!B{G}mM{C8uM$*@os(3* z^W+B?JVLR2?fhMo*gl8jUab+nm%&$1x~LEfLfZHCVSUyssqGKE_9Jd5WPfzYi9L1D z)&jB7308*4#VVEMyn`tyhwQY`Gmv-Loh0wCs)IpQxj2WfwGN>TI|0qXK^uc4`D=%g zjL@X&oR0a_bSu_=^U*dN?NU$;|2#$3poi!seHKH%e%ARJb+vvDADgS(R(+v8v?2kp z16g2^0LncoMEjnorrJr8HfLCEy?wvHY+x^&I4Qc8;a%T4w(5oJ(f>D^0X6ml`xaj3Q7NF04^z~k zwXEIq>k}0=?RkcR#s?xT8kU3cd&FODVTVD`;%POFDE(1ojekFyP4M?qW?Y*S%)#;n z>D9@l!M|TV7%?NYs&M|8Ork^_TW+jquceDe{KTqxf{NAZD@z{kN{#a@V7-WPYevY{ z2i&)(ppQPg-h1)s7QNF`S^)JrELaxKg0tg%B3nLr+s<%==vUj)`_7Pl%T7kXmlQX~ zifDFXD{!nCwrnl*fw2Jh?4wz)FMYiGp@&_=Su5mi)dH_PSp8sl$$%aQ=t9fL?YUcJ zQg1jYg6UV|vzfKMTkL(z4HniAz2`bu*vm7~FWBL{NdWdM9CyP7NC0*LlGsfS{W!1? z>s9S^R2(=Rm8G5}iUPqB9t#?Ypg=~Y#{4~8A|$fjaJo2?;@I*ucjo(|r_`qp&LsRI z?fu`(gmfQi`UU~#i#F`pJ{3f-%x6NdPE(9@mFS=gS8!V94qc*sA+KIa?u#*X?hY|X z^2)dvW7nyJypao>00HRk>>*f)Ttczc8cO8q>SXv3yfp%EgpFpo*(=W2GB) zDauFDmZE<+6ERIaRJ?Xv_6B)uDtzvJLFa`&?JR6;WV2HeRR&KEZViHV$rOa=5T|q^ za=LD{{|P8tkt5}yeh`y)gUVwnPOzlNLB&{IL&LFL!cTQuM*KnrRPpZFm;k4{xamZ{ zZ(}$SU7BY}F^=>i?p0m`j#QUiCquXgI!E|33*EM`k2>=7TiJ*X0!0!W$)NKa^JYk= zPFPtPwA5BK*@j{dJmLvBTwDa7$a3Uz-zDH{Kz1hw*+pocuwTwWb>ByB`i&1AEP`X^ zY{wlf1$UY=_tit^HkW=Cuow54Ztqr?SeVl#`m}F0ZfTWv^}i)x>IR;$%oyRly8Ns5 zm+MY^UH%+I1%U$EeOxPDHJ9uxD%ct+Nu&5!@J+M>L`d-PKy*hjjPg-_a@+ zv)09j_eO4=fBt=ftl`!!fINCP9C)^Na&}U8Z%#y7m}lL(^25@nEfC2&Pq1? zp_@KCt|eQF{qTCn<`*;@;uT4p?OX2WGy$p&ci}0?;Ir9M9V+_ zLy^x@Z1X|s!t?uQ8u@l+uo>2LzS6MIM)|tsoQ=@MeEbbG`$=SiIVduVaP59IAh^>I zDM=cZF`#1hyk0iwwN%QPCl?CwS5XI~%G&zTqtlsTiy*es&a#R8-1j`)(bv4+sgOm{ z_z;+fU`o}o7dyvt&v>qgk-9$0qSv*UYWy{_ShpqEIr4tz)qfvR`|RgVPoYCAnH}Ff zz?e+~98lt%W09pkX1M8#NC@fb#r0l&vs+WhO@^FSi8LJeD~qrt zgJ#`sf|NKWGZ+^Z29xyObW+ODTw8eGrt5I?x=lHYRK{S zKX0+rYUzrOWvcJIi(@u=GzqL@Y7yd)4Q8#UM+Dm!gOl89Z62RADg;)G@bD;udrEBa zl2%if(yx3>4jj)+D{RTqiwftSV2CK6D>r+^)f6IVKik`FDN0hplo8*`IK;=MMF)a! z*D;s4z5ZS|?b6fDZkh)VQ~1|yRWr#(ETr%w=8cnRD7ku`xV6k4MdBT~2W6HWC}VGh i$mFI{DH{@U1Qe86K82Y?$1%TD024!VgL*VR{(k`W24*+_ From 3de80a72175479e0ecbadff016c4fd78926b95ca Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:22:38 -0500 Subject: [PATCH 095/451] Update example config to match screenshot --- apps/boxclk/boxclk-2.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/boxclk/boxclk-2.json b/apps/boxclk/boxclk-2.json index 64b842f1cd..dde1da97e7 100644 --- a/apps/boxclk/boxclk-2.json +++ b/apps/boxclk/boxclk-2.json @@ -11,15 +11,15 @@ "xOffset": 3, "yOffset": 0, "boxPos": { - "x": "0.5", - "y": "0.33" + "x": "0.494", + "y": "0.739" } }, "dow": { "font": "6x8", "fontSize": 3, "outline": 1, - "color": "#5ccd73", + "color": "bgH", "outlineColor": "fg", "border": "#f0f", "xPadding": -1, @@ -27,8 +27,8 @@ "xOffset": 2, "yOffset": 0, "boxPos": { - "x": "0.5", - "y": "0.57" + "x": "0.421", + "y": "0.201" }, "short": false }, @@ -36,7 +36,7 @@ "font": "6x8", "fontSize": 2, "outline": 1, - "color": "#5ccd73", + "color": "bgH", "outlineColor": "fg", "border": "#f0f", "xPadding": -0.5, @@ -44,8 +44,8 @@ "xOffset": 1, "yOffset": 0, "boxPos": { - "x": "0.5", - "y": "0.75" + "x": "0.454", + "y": "0.074" }, "shortMonth": false, "disableSuffix": true @@ -62,8 +62,8 @@ "xOffset": 2, "yOffset": 1, "boxPos": { - "x": "0.5", - "y": "0.92" + "x": "0.494", + "y": "0.926" }, "prefix": "Steps: " }, @@ -79,8 +79,8 @@ "xOffset": 2, "yOffset": 2, "boxPos": { - "x": "0.85", - "y": "0.08" + "x": "0.805", + "y": "0.427" }, "suffix": "%" } From 53b72754ffbc03ed0e055d3ac40f151f0656b717 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:27:51 -0500 Subject: [PATCH 096/451] Update comments --- apps/boxclk/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 61edfde7b6..67493aad95 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -226,10 +226,11 @@ date = new Date(); g.clear(); - // Always draw background for full screen - if (bgImage) { + // Always draw backgrounds full screen + + if (bgImage) { // Check for bg in boxclk config g.drawImage(bgImage, 0, 0); - } else { + } else { // Otherwise use clockbg module background.fillRect(0, 0, g.getWidth(), g.getHeight()); } From f46e454a0b7fff1eeb58a97cf8b53f6e881bedc2 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Tue, 3 Sep 2024 01:59:15 -0500 Subject: [PATCH 097/451] Bump version --- apps/boxclk/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/boxclk/metadata.json b/apps/boxclk/metadata.json index 79b4c30190..b4055f1607 100644 --- a/apps/boxclk/metadata.json +++ b/apps/boxclk/metadata.json @@ -1,7 +1,7 @@ { "id": "boxclk", "name": "Box Clock", - "version": "0.05", + "version": "0.07", "description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background", "icon": "app.png", "dependencies" : { "clockbg":"module" }, From 9753795231c188983e35d74ff80e851adc58b353 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:05:45 +0200 Subject: [PATCH 098/451] Add settings for time and date lines Add separate defaults file --- apps/dutchclock/app.js | 43 +++++++++++++++++++++++------------ apps/dutchclock/default.json | 6 +++++ apps/dutchclock/metadata.json | 1 + apps/dutchclock/settings.js | 10 ++++---- 4 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 apps/dutchclock/default.json diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index a25d349fa1..7317d3d642 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -1,29 +1,42 @@ const SCREEN_WIDTH = g.getWidth(); const SCREEN_HEIGHT = g.getHeight(); + +const WIDGETS_HEIGHT = 25; +const DATETIME_SPACING_HEIGHT = 10; +const DATE_HEIGHT = 10; +const TIME_HEIGHT = 10; + +const TEXT_WIDTH = SCREEN_WIDTH - 2; + const MINS_IN_HOUR = 60; const VARIANT_EXACT = 'exact'; const VARIANT_APPROXIMATE = 'approximate'; const VARIANT_HYBRID = 'hybrid'; +const DEFAULTS_FILE = "dutchclock.default.json"; const SETTINGS_FILE = "dutchclock.json"; -let date, mins; - -var settings = Object.assign({ - // default values - variant: VARIANT_APPROXIMATE, - showWidgets: true -}, require('Storage').readJSON(SETTINGS_FILE, true) || {}); +// Load settings +const settings = Object.assign( + storage.readJSON(DEFAULTS_FILE, true)?.settings || {}, + storage.readJSON(SETTINGS_FILE, true) || {} +); const maxFontSize = SCREEN_HEIGHT - - 20 // For the date - - (settings.showWidgets ? 25 : 0); + - (settings.showWidgets ? WIDGETS_HEIGHT : 0) + - (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT : 0) + - (settings.showDate ? DATE_HEIGHT : 0) + - (settings.showTime ? TIME_HEIGHT : 0); const X = SCREEN_WIDTH / 2; const Y = SCREEN_HEIGHT / 2 - + (settings.showWidgets ? 5 : -5); - + + (settings.showWidgets ? WIDGETS_HEIGHT / 2 : 0) + - (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT / 2 : 0) + - (settings.showDate ? DATE_HEIGHT / 2 : 0) + - (settings.showTime ? TIME_HEIGHT / 2 : 0); + +let date, mins; function initialize() { // draw immediately at first @@ -75,7 +88,7 @@ function draw() { g.setFontAlign(0,1); // align center bottom // pad the date - this clears the background if the date were to change length var dateStr = " "+require("locale").date(date)+" "; - g.drawString(dateStr, SCREEN_WIDTH/2, SCREEN_HEIGHT - 5, true /*clear background*/); + g.drawString(dateStr, SCREEN_WIDTH / 2, SCREEN_HEIGHT - 5, true /*clear background*/); /* Show launcher when middle button pressed This should be done *before* Bangle.loadWidgets so that @@ -96,8 +109,8 @@ function setFont(timeLines) { let width = g.stringWidth(timeLines.join('\n')); - if (width > SCREEN_WIDTH) { - g.setFont("Vector", Math.floor(size * (SCREEN_WIDTH / width))); + if (width > TEXT_WIDTH) { + g.setFont("Vector", Math.floor(size * (TEXT_WIDTH / width))); } } @@ -225,4 +238,4 @@ function roundTo(x) { return n => Math.round(n / x) * x; } -initialize(); +initialize(); \ No newline at end of file diff --git a/apps/dutchclock/default.json b/apps/dutchclock/default.json new file mode 100644 index 0000000000..243f2824ad --- /dev/null +++ b/apps/dutchclock/default.json @@ -0,0 +1,6 @@ +{ + "variant": "approximate", + "showWidgets": true, + "showTimeLine": false, + "showDateLine": true +} \ No newline at end of file diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index a7f863849b..97457764c7 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -12,6 +12,7 @@ "storage": [ {"name":"dutchclock.app.js","url":"app.js"}, {"name":"dutchclock.settings.js","url":"settings.js"}, + {"name":"dutchclock.default.json","url":"default.json"}, {"name":"dutchclock.img","url":"app-icon.js","evaluate":true} ], "data": [ diff --git a/apps/dutchclock/settings.js b/apps/dutchclock/settings.js index 2c3f1816b8..6bb5b0a473 100644 --- a/apps/dutchclock/settings.js +++ b/apps/dutchclock/settings.js @@ -3,14 +3,14 @@ const VARIANT_APPROXIMATE = 'approximate'; const VARIANT_HYBRID = 'hybrid'; + const DEFAULTS_FILE = "dutchclock.default.json"; const SETTINGS_FILE = "dutchclock.json"; // Load settings - var settings = Object.assign({ - // default values - variant: VARIANT_APPROXIMATE, - showWidgets: true - }, require('Storage').readJSON(SETTINGS_FILE, true) || {}); + const settings = Object.assign( + storage.readJSON(DEFAULTS_FILE, true)?.settings || {}, + storage.readJSON(SETTINGS_FILE, true) || {} + ); function writeSettings() { require('Storage').writeJSON(SETTINGS_FILE, settings); From 4bca60e0708e8c456643df49e5ae0504488c5dff Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:12:02 +0200 Subject: [PATCH 099/451] Fix bug Up version --- apps/dutchclock/app.js | 2 ++ apps/dutchclock/metadata.json | 4 ++-- apps/dutchclock/settings.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 7317d3d642..be0d6f2c01 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -1,3 +1,5 @@ +const storage = require("Storage"); + const SCREEN_WIDTH = g.getWidth(); const SCREEN_HEIGHT = g.getHeight(); diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 97457764c7..fe665ea9d2 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,8 +3,8 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.01", - "description": "A clock that displays the time the way Dutch people would respond when asked what time it is", + "version":"0.02", + "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", "supports": ["BANGLEJS", "BANGLEJS2"], diff --git a/apps/dutchclock/settings.js b/apps/dutchclock/settings.js index 6bb5b0a473..bc078bf975 100644 --- a/apps/dutchclock/settings.js +++ b/apps/dutchclock/settings.js @@ -1,4 +1,6 @@ (function(back) { + const storage = require("Storage"); + const VARIANT_EXACT = 'exact'; const VARIANT_APPROXIMATE = 'approximate'; const VARIANT_HYBRID = 'hybrid'; From 2cb7ed6f9f79f37838c634dcd85942008d21392d Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:17:01 +0200 Subject: [PATCH 100/451] Fix bug --- apps/dutchclock/app.js | 2 +- apps/dutchclock/metadata.json | 2 +- apps/dutchclock/settings.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index be0d6f2c01..df655c1f28 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -21,7 +21,7 @@ const SETTINGS_FILE = "dutchclock.json"; // Load settings const settings = Object.assign( - storage.readJSON(DEFAULTS_FILE, true)?.settings || {}, + storage.readJSON(DEFAULTS_FILE, true) || {}, storage.readJSON(SETTINGS_FILE, true) || {} ); diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index fe665ea9d2..ab7284b65e 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.02", + "version":"0.03", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", diff --git a/apps/dutchclock/settings.js b/apps/dutchclock/settings.js index bc078bf975..2be7326e5c 100644 --- a/apps/dutchclock/settings.js +++ b/apps/dutchclock/settings.js @@ -10,7 +10,7 @@ // Load settings const settings = Object.assign( - storage.readJSON(DEFAULTS_FILE, true)?.settings || {}, + storage.readJSON(DEFAULTS_FILE, true) || {}, storage.readJSON(SETTINGS_FILE, true) || {} ); From f35a7e509791dd7b35f57500cd567ca893ac4f7a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:20:15 +0200 Subject: [PATCH 101/451] Add some screenshots --- apps/dutchclock/metadata.json | 7 ++++++- apps/dutchclock/screenshotbangle1-2.png | Bin 0 -> 3822 bytes apps/dutchclock/screenshotbangle1.png | Bin 0 -> 4071 bytes apps/dutchclock/screenshotbangle2.png | Bin 0 -> 2365 bytes 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 apps/dutchclock/screenshotbangle1-2.png create mode 100644 apps/dutchclock/screenshotbangle1.png create mode 100644 apps/dutchclock/screenshotbangle2.png diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index ab7284b65e..0d6435b1f9 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,12 +3,17 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.03", + "version":"0.04", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", "supports": ["BANGLEJS", "BANGLEJS2"], "allow_emulator": true, + "screenshots": [ + {"url":"screenshotbangle2.png"}, + {"url":"screenshotbangle1.png"}, + {"url":"screenshotbangle1-2.png"} + ], "storage": [ {"name":"dutchclock.app.js","url":"app.js"}, {"name":"dutchclock.settings.js","url":"settings.js"}, diff --git a/apps/dutchclock/screenshotbangle1-2.png b/apps/dutchclock/screenshotbangle1-2.png new file mode 100644 index 0000000000000000000000000000000000000000..08bf31939208969239a08d2ea20ce7844e855938 GIT binary patch literal 3822 zcmb_fc{Egi|DPEbSENCb5@UuugtS>Fjjb`1eJ4?tvNg7bh;EjQHTj~lOJy4*V=2Q; z*(;Hy5M!wcSrUnq=k|SmzjJarJ=;(y z)OL!Yz6G)_{dqthC}ffi(4RK;tF85Byen4+&^72-Uf(=9l1Qo!I$e!}L~ z&}H-dn7%z`JB=a7&ZK{Vj8gXH3h0UMW=F6_gAFD0+REdVxTVxm_Qz}`NNf@1h^OD)gu1%o)1 zFcgMggv5@yL7u~sT)v}#UHh-W{5w(xrLVzX(4gWe6eK1o$??m*=%Z5dlW$HeN3mrf#yBehz>U)s`V!HRcp)sJMK#9d) zhVzCM)c4VfBqSnf>v-XkeVwApSvR>s#B`C7Ii5*qXmJ;*MxlXSvC;p)$mqr*hR|9V z{+pnsLDrf!-w^1~=scIX>^qLUt1?)+G#g7K$pYacvpq{fI!6Qb@mP~KQx^QGs6 zA;m=RGAz>Aqj6PBOSc@zY?+&^Znx~;tS}E&I0nq_scFP7XAqn{knVT0>WVrl2`C+Y z`9f7lUC6_|Bm?enq(qJlgTzIjh#3J$Ox%j2DpY@jx){*7xO(g70ukBOWD7O8JG)U^ zeeu*oE?s*0w@?_{zWb^`JRk1=2(t7uNf#XM^C?U}N0UBq6Cor1N;yS2dr+ zaUw{J;3*Kq3wv;K4@N(nE_l?{2`b*Zdql-i*PwAQ(@4<5C`W@{F(8VmJXSgW#DLw( zyW2+!ibBzhIeT3LPfI|YyX`9<^i4Kr4*EUg5ej)$kmMr{k^8o;`U1J$l5c5Ia9|Sn zFD=}X6G4|<7^<)OM0Q9xjAeDqcKzLFhpd#;c-6uCiWso~8}6_1!PB8bRnvIt#D2bv zlWZLPFet@oP{Mn&;p{Onh+mCTbri#kcHq{YWNfvWc@QyTg5ji#fO2d_ZUC*W=6wr+ z`W4p7B(u-4%^}AfQHraCMdo-z>T10CC3{IIq1|tNwty^XYNFrPaiz7mPB8`E*H+;)eY?MGgoQ+)) z8b@_$l4H@`(o5G0h?GQ_i>G?&7D#jnNj>Q2G?ElvKGnH8EkJ5~^+(tb5>XqO%5?aw zrrpPC_0yt8f$g}Z(Qoo|%HNdp%PHH`kVX;dUE{_ruD#p|HG5{H*!FGwm^G}`Mvns@ z`ZMXUWr|#71JaFI?N2;qfdxt!+W{nEBPRMlCy@4_uW>Qw;+{|zjw;z*a^MX2r;N~9 z|ISy^Rf+K=@Ff`qakBXK>5vd;KCFO|R*^yjxtI0_0q8p@Om{ID4TmG}-gM`U5a5PD z>peUc^G%4vUiZ)?V{h`|{sSX+w<*&HBNL{Z9LqN4T~5wF^?q5bl;}B!z()I`Xm1v+ zW?)0;_tW4WQ?4W4Wz34=<5v@=hW86Vt>$6+E7Nu_j@MOmu~Qk=BbG;&Cke?u2`b3W zFAe*?$S?VeEA=)W6l4qwL5|GUuReQY;n-fs=oL^(=#-E&e)w&IUXilgBUi2n(7=VO zxfo6rS-v|L3Yi7=*AME|njTab9FG0!BOVXOK5|seGx(kX(k2}Tt5zataxODdGs*1H zgylky-MyC!Kp%+)e3EsB9OSsyX{KGFh$+S7C3v-PBh?{k-uOqr6}1{U(^uwG4nrF= z+^v=)aXCwSG2oYXdrbG*2yOaNQoz5_HhKFY6>ezX5(87`7saS6XUSOJx1EwGrd&h@ zQTwh?O?N`p`?N9yTv^T%67MMM$Rx`dnKYR+{iqJ*+@yF5li2$Ud(fqDX=A&>;95_H zC6ngc9jrwr4bQFWx^PsBvG4GYtUJ1fGsJ}D{Q5$+;^tDkv4`1N>DK$A>C`#h^jRRWn!%&@vn zqG7<%eH#3_xD*tI^QcG|c!E%ag${cxCKSM`r^u$`-sGS#H1g}~*bc%qI8?C&fEEC3 zy;i`kXp$rvczvEC3kJzugFmD`#sSM9($2;TI{8{?z(l`kmUjK|#_Q5F^;?w(V_-VL zIhc$5v*HKEebTP!$xe)1vYLYKxdRU@Qkxu47_V&h_x5jodIo0Kqw#o|T36+d^G{_L zdqGTAyQ>k&MWlk`QVG(P>WxBwo^%mg=$8RZUd)I}KjOBPHysy`6uMSse=7pvF!a4G z1l`Hy1&iFK;~EP*ltx)ZmUVvM^!&_7T3Xy)i!CI@7mTXe2j5rbJ1P37<$>4ZTxEV< zrsKKU;geR=fXOHqE$hiL)MM#uU2W*ZFC|4_f~~(Lp!1s%oi^Gw>owV)X`U5GN?G}V z@_-4jkUo1sCtba|?Sm!~KA&c$E?b{18gOQ$%#I5ZQPbgAfZ1T9Zbe{N??yIEf1X=} zWG^^LshU%&<~+-|dwyoBK71AMW8E&k#3h`1>FhR0r0$x+yD&jj+@E1lrlxW zTEvUgU*1u!VDCQ8d{Oe6FT0*s!N87r8SiZ5j~QBk#%_JMsu;AUpPiEG#W_)^DM!Vx z8bL}H%Ld6W3QU}lSa^>bxpd2hZ`4`^k7xXjV+xU6_Exrkmc;8f??{5_TzUC_@sae~a+21)XoimVJRq?{ zJyM71w(N{XavGSeS!#9&5S++T6NflCr#(EuY)W9EgCw+Qa@J&&&J%W#`;WZ%u_BbJ zb~JX`4NxW%5gsD>oV8X8j%I~CT*cOle16uATVkWFlu}@8H%@5+9QbO=Q%!tFniZ6u zl2j2Fa+cWhKnHQ`f1rYl19C4^#V~MGX(wh-t9%@+@QXQx4Y|G^3TO{UJV`fT^YM%n za03gd^^1I!jUX|EnuZMBDBc3?DvPPH%zL>or+aN$psnuLGDxKITN%xy_NE=dN*Omh z9|R=px8v)2IJN6yyu5<`OMQq23YkK`GZm9yE?zp!H4)kQM|kt!2rvHH-Pu>lAxN7h z--7;bTNi)tt=Q_P3fu zrm+zoQH!2Yau@w!_b^yE%xz^lr1B0jp~39uhwjHK1Q?Iq6HiIZ&Hju3VO$mp^R#zB z)`R$Nx#M$Z$vu*L3<`7LuQ&)ULS|pzvp2hdofxp(49|l}Lr|B(tLKO{LoO1!^xfbo z1Rmw~3Ha)e5J1=_dk&`}j||Wtl^SmJe`Z8W@YANZ)JHjJaIk!J5#dZ*A2_MD{%33i zwOR?(hZj%yE||7BMGg-MPdPNpzCE+KzSSJ2KIk`aqW!XN*Wt|(!>em>PO+!PcwtTS z#o#gFA9o|qtW~6#KJ-0MJ8&R!K@R5o;wjceytLsh{qe=mnvgc7m7I?DD-1E*T*65Z z*Lead;=`o;(dt}B`j~E=@|;QS9D_O+#QGjuKJw(lrPa2)Iph}PDVl60Dahik%Jr~G z&7DkNo6gf`ewW}eLYuJd*HDLFYTjwsnEb;jgSgNlXh3xWzZ(;XaE69YI%-%Iszkh$f>;2>X<2mQL?{lAX-RC@?bALW3*@kQ;EGQ|6 zKp=!I%t>}|&->>?Ziia~%C~g5;|sAfGe(s6NPR;fcI8`;j2yyG{>U9IpVj)y)ZRn2 z=eJ?N--5?Jt?c1l3RuFM%yhVf93xaY!+bU3H{j;ex z`&!7B2q;ysA9w2YNWl-(B|8A==5PliK>dOVxW>9ALgW^-)R=QL>U@tRpG} zQcBru)Efwj3(y&#x``h4Y?;;N1BYC)@n%BI@`@y8yY5k2&wE%2tSHe#B12#8-LeEB zc<5=zK2y)Rr8Lf51{00UFUx*%$z;5S>6hITTPbgmZf<9+%F#d&wU#`QbUjU{ZOwhZ zG;}0`vvg8ZF)p-{Q+MuFR9FdhsURXu@r6>B5x3{G{^5vr0j3^kPaYj2bRkC?vJLWf z0joYeDJXM%Ec>jy00?b@sCvT?#{{AzA4ooGfkiIE=e?0#jRW7oNRqS!jP4uqfpfh% zVlp>P5m3L42ol&3zy`;BVIrYJ0Q?iuiKwsE22$!^)0;g@5%;ny2c4&-nB&$abMG|6ms{NtC>Bck>P9@_SUCmWAj8%?jaDEjh%CUpNyiV^HpnGoYV6hnCWNmub~a{L}_pi+o;i) z`D_;Hf43AdfMT~zTxV54}m)?zb>P+Iorj6DA^T37m48z8G(s2ABFkAKwn`K z&v}c&)+VbDuBD1vz~Mu-lMY}Y!dKvwKxkc!*kMIpzk>fM-W74(r(sIFPHtHspuI;X zENXp4%|OTZB}s1tMmQwlesnz_V>I?~NiU&#ol5$|J!{0yT@FOw8U41>|NPe;fYOGg0Hm9iq>Qy5)yoh~RK z0!9~IE)DxO7XgHs^~9k%VW3ASCxg%&4D=%xFbPCyKCs8jLKb-u26}R*(*`-%am?ks zh}Gh{4Kl}hg0i<>b3VoJ@iFDsrAK9gJtL?l=EvH^O5}oOdqwauGhZz?U+=&Ndv2>q zx_Kw@h{K^Et1%Tccq!|pCLeU7p0UFWj+fc3c=s@HEx4F$%q8X6qDAbHS5rRcE*wSV zduK1lBLIRHiImVf^)eq9VfH0K)O$h&zJC5R%01omFmE#Mobd+CF3DxAbM|J7v~CO1 zae1(39{QhQgY&ox0AYoF!rsY%7m-qCIi%6k($Qg#$*+BnuD>x(|IpQ;==9p;u3m@= zylPxeK1v%M?ogt_PnpQnoEtLYwjTH@B?yT^PMx9T3Qytx4Z7;qvFth-0uV4!>Hi!@ z65&NpU1!=3>Wq}N^zh1{DCg;&M?u>}(qf|J;aPkXRED20l1%*kiOlb39Yq& zEDdi(=#ZsHFQ)vN3MIFWVA#Hn#Ioq`C%;PLYOd^;goh1`;Cz(xwNs1Z-v}XPlxQx5<0YWgouBMvJpokuk zi2u-9y&X9emQg*?w0nscAj9K{49LD!WUM;rpSxt_kct4P37F_+6OUPIv0sO8emN@$ zGKw*evq}85pGVV4+yOgH{-fLjmzT(<+z7v0*%E-yyBv8(61TBGOEj#Yg<)p|`}=RZ zWU@Pl9TFE`A>C-<-2hTAF>0QIu0Om$o|OqEyp4wm;syUBS81rUvqwxEnl9-u{NSy3 z%#PpDKuZ@t5xt;yJf6KYFyT0oL`3S@o)WS*;u_bV`FS6e{DCae%t3_xq?L;kK1y*N)Onjny}8c+*cQ5rVr7F>D?07=V!CbxR8pC!f8@_ zXAZRHyuS1c%VTT#Hbff~y?L&!%}R>TGUY=2L@va0uQ~+mQkDgFC2XZXM2CCGpu@3$ zvXpPIw+SV)w|#oaEB9+8V{7nJ&u5?lebS$%%#%QH3+N|MY6CcBHih;ISJK; zGH+?)yu8U5d%Iu5B2P!kzTgp#x)}J1$)UTGm@q)D zig;nw6!<_!janf;-@l=@XB%W8faMill~F;;gDB_x);-8$urwp6>^y5kgx407YbScZ z>P+wKDRUt}kPmc}SKki&BhV~_j=G|3U^E*itE29~8qL~u&$|*iUgmr>J~$u`75#so z6&GuafW$1XL+nBj75=W}CI;LMAelCvJHZ2TvFu!-rDdxdWo^z=PFU({Lx!?fMcBhU z{o3{F=8g>o!%xF5SNFd@zIB|5Tn@M<7_M0>GE1g4Hl&>iLTg7=bf~(@)!rol1h;e? zi^5Ceq_j%EU|ist2Tf6)yf5zm^Z1YBv)>~rO-h~zY9j5E&RTPk-z}jG`_Yh+Nd6T! zDO~YnL+b9n0!>M=Bk2|Cez%|-w~BXb1Fiw=Opc{Gr7sfc*6`lN%kYFRUPnnY=pyUv zx*d>rDpHQ8*Se5XG?YC3>URm>!H`!e6<-Qz)qBoNZCp$>Xk(zQ)GVqG=EtVqIl00?dzwdc`XRD_RYm4v-4c9Y+YESHkpgCn<|NUk1b*Uj(X<% zAYv%OSZxBVWe~!bnkDy7N&05JQ$R|w_lm83Tei7sKSay%VB9+XX3&`WL|jf4pbiQ= zljbY!$$qkcs~f_Mbu~M-U-_8jbHd8=iH~y619$fca4d*0NX>6t7^54yram|{(jPTi z`m?OPCeU#37dlPDGjAy-<%3;sWGhF#X?+ zRqD^TiIJ_volajVN>HiH6ya3cRvG{Ar zu36pZ?FIi_6fC_*ABm)x`)d{|2G^u9f0ptmxy3f=m<`!PDR-Ut(LZz^sVw5JP#D?h za-J%lW;8lmQc0JqTe)9_8kUdd)BsUqW+!cJ+0?e-NySQr;z2u)zdJflD(N`3JCbNT z^SWgj?lM3X4qruI-_fM#T%*QV8{8iheqmuQY>;D(i(2n|t>pEm1_*j{zoj&AedpWO zSRy~9z;7V*EgJhU#hvf=9n@C~4_!!q*9FC(50Mz?2^J-%mdhSC9oQk>cg@MxxjUZi z4;JmNH}MS2^YK$(d@QS0#zrTn)m2fF^zqPR{#pa$kM3q864cb3NR+cN_edJL&McMH z-VJ7ogrB+jc{_xL?;RLAlt2`L*&eXigS?K7W#b=J9{|%~u`OcWLi7M(v2DJwCS09D z_&T;0Hrc$jv8G_u_Dna^x8WhG-u@M1^XZJ`p5FZz{i)g=b(?o*1OF^MpV#>wQx&oK z^Jb~Ls1cVe{4+`doa_8e9#B$mGG^4B61aT$N?zFJR`J>phnDm_Pyv*7SoG@8v$r8P zmDU^#%+CXBRf%J%?bziCR}B2Dux~i6U-T|gC?H^#Tss-Cv@kRx8RJGD_D#JqHVezL zch?K`q&~*E<+2@lrG_uAZ=&KB8JByPF83LoEVXN>zz3`L*7%Olit;aqV!I0PNr& zADer)OSeT`a>h#ZynSUPDEe@CRP9zU{B-;RPaXab7lm6FrSEg-hp)X@KW=Y>#S~U@ z9x&E(s14Zp%#rq@G0H^sw`~8Mj?hVpXnJO4K(vd;<4S`Q%2s>tVhOl+Mc+Cx_q|%u z0YlBglFn6Xt2Hhp1--OOoltV~UdhM5`+McZ#0&jichBL|Nv$uY5#?m73Va&92ruI}>G!xQ#~Hs+8t(Mvn4fBMZI zY*S=ps9!dG=7cJm8>T{`;z-tFUaLD`%%)k@oE+{j1K#YG@9J#1)Tr#f6gsyo>bm!G z{|F^OC(>8X!P;63FQ;CBk#zMqFB5;a<=*(Rtsu~4vP7)OUZ*4%qqZi5`0pV)MokuR=~Hij9!^TY;F$|>_R-rPSPVZl z_?+!FeY@jM7z1|psl{o7I8`>-R(;|%Ey%K^Dw}@wjA~(&y*v}dT@vQf1oE}j+BU4g zZWl&p9#){PjO6U4S>o(i4*97=RsC~K{KGfqH=-&K&cx-Af6@l`d=!-}Jrw)VIqjlP z!n_1XUQC=9r$c1WScEvQttwAczpJ8~pKq)vtsi?Jk7Z}2@4G)d%ir2+ZwstjKfM_^ z*L$bgw(vel9>%}MAz}q(MEqf~v8;@fqfUZzx@rhy=Zlmsh~nzJ`AIGSjjOD7y)Xhu zm{;;74hLkouH~CuA&}IQyvNiKAf^eOH^NYXW~B$j+Cm`CHsazncL0x8uj^4H0IA}= zEdf~=pj)&)!`F>z33FCt9)-SyTB` zO&;b|vs1q28Jl$3P_&adi;^@Swz_6T`$KQF-ly7Qon$-@FmWKE~^Ld~~+V zhXEbvH1_=H^Q=1W=4e?j_Oy%BYF=*Y0Rfe?lz@EnvFN(8 z#kUwE!hTwy-JBXY?={b5@IR^0^W&5aQJK+?7>UpTGJ@60XNwy^hY?G|R7)rAmS z4Ot--?)V&R`D9BI&;=FvVSmc6)3CWo&8P_L?Zt>YB(SjDJ@;{P`tA^r^yJ8$(?EH#CS*OF;M!32o-7bA(^;J zywl#0t(2;X*DQ2FR#+U=tN>;BI^NCDH-h!s<-mqPoq!T|nX?2S84aM%7(WXyvmzjl{2K{w|*7 z3~LVb-D@rmM+@NS7d`T@gAs4RRZMb z!#0^;70x;2c=|!n+6Kk>ju1GWoS1Ty2H?Q3vsRfzAklwKIi`)m^lvve9x@uYIra>n ScN+Z<0mt30cI7*nXa5DEn Date: Tue, 3 Sep 2024 23:26:21 +0200 Subject: [PATCH 102/451] Add date and time settings --- apps/dutchclock/metadata.json | 2 +- apps/dutchclock/settings.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 0d6435b1f9..4988417dc3 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.04", + "version":"0.05", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", diff --git a/apps/dutchclock/settings.js b/apps/dutchclock/settings.js index 2be7326e5c..146df53951 100644 --- a/apps/dutchclock/settings.js +++ b/apps/dutchclock/settings.js @@ -46,8 +46,18 @@ getOption('Hybrid', 'variant', VARIANT_HYBRID), { title: 'Show widgets?', - value: settings.showWidgets ?? true, + value: settings.showWidgets, onchange: v => writeSetting('showWidgets', v) + }, + { + title: 'Show time?', + value: settings.showTime, + onchange: v => writeSetting('showTime', v) + }, + { + title: 'Show date?', + value: settings.showDate, + onchange: v => writeSetting('showDate', v) } ]; From f61aa0650a8ab03ca60bf4c3417deeb3a7bc5fe7 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:32:19 +0200 Subject: [PATCH 103/451] Fix setting name --- apps/dutchclock/default.json | 4 ++-- apps/dutchclock/metadata.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/default.json b/apps/dutchclock/default.json index 243f2824ad..cfe5d34a47 100644 --- a/apps/dutchclock/default.json +++ b/apps/dutchclock/default.json @@ -1,6 +1,6 @@ { "variant": "approximate", "showWidgets": true, - "showTimeLine": false, - "showDateLine": true + "showTime": false, + "showDate": true } \ No newline at end of file diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 4988417dc3..9a0bc84a20 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.05", + "version":"0.06", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 97785aadbd5b74019ff1c1063dc1e8a2365e603e Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:46:05 +0200 Subject: [PATCH 104/451] Add time line --- apps/dutchclock/app.js | 30 +++++++++++++++++++++++------- apps/dutchclock/metadata.json | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index df655c1f28..135cfa5ae7 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -76,6 +76,7 @@ function tick() { function draw() { // work out how to display the current time const timeLines = getTimeLines(mins); + const bottomLines = getBottomLines(); // Reset the state of the graphics library g.clear(true); @@ -85,12 +86,13 @@ function draw() { g.setFontAlign(0,0); // align center top g.drawString(timeLines.join("\n"), X, Y, true /*clear background*/); - // draw the date, in a normal font - g.setFont("6x8"); - g.setFontAlign(0,1); // align center bottom - // pad the date - this clears the background if the date were to change length - var dateStr = " "+require("locale").date(date)+" "; - g.drawString(dateStr, SCREEN_WIDTH / 2, SCREEN_HEIGHT - 5, true /*clear background*/); + if (bottomLines.length) { + // draw the time and/or date, in a normal font + g.setFont("6x8"); + g.setFontAlign(0,1); // align center bottom + // pad the date - this clears the background if the date were to change length + g.drawString(bottomLines.join('\n'), SCREEN_WIDTH/2, SCREEN_HEIGHT - 5, true /*clear background*/); + } /* Show launcher when middle button pressed This should be done *before* Bangle.loadWidgets so that @@ -116,7 +118,21 @@ function setFont(timeLines) { } } -function getTimeLines(m) { +function getBottomLines() { + const lines = []; + + if (settings.showTimeLine) { + lines.push(require("locale").time(date)); + } + + if (settings.showDateLine) { + lines.push(`${date.getHours()}:${String(date.getMinutes()).padStart(2, '0')}`); + } + + return lines; + } + + function getTimeLines(m) { switch (settings.variant) { case VARIANT_EXACT: return getExactTimeLines(m); diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 9a0bc84a20..d11dbbf414 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.06", + "version":"0.07", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 5977d9b41201b029f781e99460b29bfabd55fd9a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:51:05 +0200 Subject: [PATCH 105/451] Fix timelines --- apps/dutchclock/app.js | 11 +++++++---- apps/dutchclock/metadata.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 135cfa5ae7..e806a74f7f 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -3,8 +3,9 @@ const storage = require("Storage"); const SCREEN_WIDTH = g.getWidth(); const SCREEN_HEIGHT = g.getHeight(); -const WIDGETS_HEIGHT = 25; -const DATETIME_SPACING_HEIGHT = 10; +const TOP_SPACING = 5; +const WIDGETS_HEIGHT = 20; +const DATETIME_SPACING_HEIGHT = 5; const DATE_HEIGHT = 10; const TIME_HEIGHT = 10; @@ -26,6 +27,7 @@ const settings = Object.assign( ); const maxFontSize = SCREEN_HEIGHT + - TOP_SPACING - (settings.showWidgets ? WIDGETS_HEIGHT : 0) - (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT : 0) - (settings.showDate ? DATE_HEIGHT : 0) @@ -33,6 +35,7 @@ const maxFontSize = SCREEN_HEIGHT const X = SCREEN_WIDTH / 2; const Y = SCREEN_HEIGHT / 2 + + TOP_SPACING / 2 + (settings.showWidgets ? WIDGETS_HEIGHT / 2 : 0) - (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT / 2 : 0) - (settings.showDate ? DATE_HEIGHT / 2 : 0) @@ -121,11 +124,11 @@ function setFont(timeLines) { function getBottomLines() { const lines = []; - if (settings.showTimeLine) { + if (settings.showTime) { lines.push(require("locale").time(date)); } - if (settings.showDateLine) { + if (settings.showDate) { lines.push(`${date.getHours()}:${String(date.getMinutes()).padStart(2, '0')}`); } diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index d11dbbf414..b5a7ad32de 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.07", + "version":"0.08", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 966452854eb23a6357c2d95ed0c387e59bd41247 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 3 Sep 2024 23:57:14 +0200 Subject: [PATCH 106/451] Finetuning --- apps/dutchclock/app.js | 5 +++-- apps/dutchclock/metadata.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index e806a74f7f..b801a2044b 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -222,10 +222,11 @@ function addApproximateDescription(lines, offset) { } if (lines[1] === 'uur') { - const plural = getPlural(lines[0]); + const singular = lines[0]; + const plural = getPlural(singular); return { '-2': ['tegen', plural], - '-1': ['iets voor', plural], + '-1': ['iets voor', singular], '1': ['iets na', plural], '2': ['even na', plural] }[`${offset}`]; diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index b5a7ad32de..abaf15c499 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.08", + "version":"0.09", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 919e7243b7eb0e2affab66486c1fa64bd8cc1fe8 Mon Sep 17 00:00:00 2001 From: Brian Whelan Date: Tue, 3 Sep 2024 22:57:35 +0100 Subject: [PATCH 107/451] Support Gadgetbridge canned responses --- apps/android/ChangeLog | 3 ++- apps/android/boot.js | 3 +++ apps/android/metadata.json | 2 +- apps/reply/ChangeLog | 3 ++- apps/reply/lib.js | 11 ++++++++++- apps/reply/metadata.json | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/android/ChangeLog b/apps/android/ChangeLog index 11c78588a7..e20b30304e 100644 --- a/apps/android/ChangeLog +++ b/apps/android/ChangeLog @@ -36,4 +36,5 @@ 0.34: Implement API for activity tracks fetching (Recorder app logs). 0.35: Implement API to enable/disable acceleration data tracking. 0.36: Move from wrapper function to {} and let - faster execution at boot - Allow `calendar-` to take an array of items to remove \ No newline at end of file + Allow `calendar-` to take an array of items to remove +0.37: Support Gadgetbridge canned responses \ No newline at end of file diff --git a/apps/android/boot.js b/apps/android/boot.js index 729ed2b476..17d4033b18 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -67,6 +67,9 @@ title:event.name||/*LANG*/"Call", body:/*LANG*/"Incoming call\n"+event.number}); require("messages").pushMessage(event); }, + "canned_responses_sync" : function() { + require("Storage").writeJSON("replies.json", event.d); + }, // {"t":"alarm", "d":[{h:int,m:int,rep:int},... } "alarm" : function() { //wipe existing GB alarms diff --git a/apps/android/metadata.json b/apps/android/metadata.json index 7768efb6c2..210e711f24 100644 --- a/apps/android/metadata.json +++ b/apps/android/metadata.json @@ -2,7 +2,7 @@ "id": "android", "name": "Android Integration", "shortName": "Android", - "version": "0.36", + "version": "0.37", "description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.", "icon": "app.png", "tags": "tool,system,messages,notifications,gadgetbridge", diff --git a/apps/reply/ChangeLog b/apps/reply/ChangeLog index a5a65b1162..ae117133c2 100644 --- a/apps/reply/ChangeLog +++ b/apps/reply/ChangeLog @@ -1,2 +1,3 @@ 0.01: New Library! -0.02: Minor bug fixes \ No newline at end of file +0.02: Minor bug fixes +0.03: Support Gadgetbridge canned responses \ No newline at end of file diff --git a/apps/reply/lib.js b/apps/reply/lib.js index cdf394bb4a..50d22e6ba8 100644 --- a/apps/reply/lib.js +++ b/apps/reply/lib.js @@ -46,11 +46,20 @@ exports.reply = function (options) { options.fileOverride || "replies.json", true ) || []; + replies.forEach((reply) => { - menu = Object.defineProperty(menu, reply.text, { + var displayString = reply.disp ?? reply.text; + var truncatedDisplayString = g.wrapString(displayString, 120); + // Generally handles truncating nicely, but falls down in long runs of emoji since they count as one image + if (truncatedDisplayString.length > 1) { + truncatedDisplayString = truncatedDisplayString.slice(0,1); + truncatedDisplayString[truncatedDisplayString.length-1] += "..."; + } + menu = Object.defineProperty(menu, truncatedDisplayString, { value: () => constructReply(options.msg ?? {}, reply.text, resolve, reject), }); }); + if (!keyboard) delete menu[/*LANG*/ "Compose"]; if (replies.length == 0) { diff --git a/apps/reply/metadata.json b/apps/reply/metadata.json index c028ed0539..7f1dd6812a 100644 --- a/apps/reply/metadata.json +++ b/apps/reply/metadata.json @@ -1,6 +1,6 @@ { "id": "reply", "name": "Reply Library", - "version": "0.02", + "version": "0.03", "description": "A library for replying to text messages via predefined responses or keyboard", "icon": "app.png", "type": "module", From 42947f27bca55b3003989ce1f77fe29dbbe088e9 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 4 Sep 2024 00:13:23 +0200 Subject: [PATCH 108/451] Fix time and date lines --- apps/dutchclock/app.js | 5 +++-- apps/dutchclock/metadata.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index b801a2044b..90e1e3c78d 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -1,4 +1,5 @@ const storage = require("Storage"); +const locale = require('locale'); const SCREEN_WIDTH = g.getWidth(); const SCREEN_HEIGHT = g.getHeight(); @@ -125,11 +126,11 @@ function getBottomLines() { const lines = []; if (settings.showTime) { - lines.push(require("locale").time(date)); + lines.push(locale.time(date, 1)); } if (settings.showDate) { - lines.push(`${date.getHours()}:${String(date.getMinutes()).padStart(2, '0')}`); + lines.push(locale.date(date, 1)); } return lines; diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index abaf15c499..d1b352e0cb 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.09", + "version":"0.10", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 2f91496e57d3f2148f8212ae6e5dca2fe28f28cf Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 4 Sep 2024 01:10:59 +0200 Subject: [PATCH 109/451] Add Midnight Add README --- apps/dutchclock/README.md | 18 ++++++++++++++++++ apps/dutchclock/app.js | 28 ++++++++++++++-------------- apps/dutchclock/metadata.json | 9 +++++---- 3 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 apps/dutchclock/README.md diff --git a/apps/dutchclock/README.md b/apps/dutchclock/README.md new file mode 100644 index 0000000000..167cd4a4c4 --- /dev/null +++ b/apps/dutchclock/README.md @@ -0,0 +1,18 @@ +# Dutch Clock +This clock shows the time, in words, the way a Dutch person would tell you what time it is. Useful when learning Dutch. + +It was inspired by my wife, who sometimes insists I tell her exactly what time it says on the watch and not just an approximation. + +## Options +- Three modes: + - exact time ("zeven voor half zes / twee voor tien") + - approximate time, rounded to the nearest 5-minute mark ("bijna vijf voor half zes / tegen tienen") (the default) + - hybrid mode, rounded when close to the quarter marks and exact otherwise ("zeven voor half zes / tegen tienen") +- Option to turn top widgets on/off (on by default) +- Option to show digital time at the bottom (off by default) +- Option to show the date at the bottom (on by default) + +## Screenshots +![](screenshotbangle1-2.png) +![](screenshotbangle2.png) +![](screenshotbangle1.png) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 90e1e3c78d..9523a360c2 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -7,8 +7,9 @@ const SCREEN_HEIGHT = g.getHeight(); const TOP_SPACING = 5; const WIDGETS_HEIGHT = 20; const DATETIME_SPACING_HEIGHT = 5; -const DATE_HEIGHT = 10; const TIME_HEIGHT = 10; +const DATE_HEIGHT = 10; +const BOTTOM_SPACING = 5; const TEXT_WIDTH = SCREEN_WIDTH - 2; @@ -84,18 +85,19 @@ function draw() { // Reset the state of the graphics library g.clear(true); + // draw the current time (4x size 7 segment) setFont(timeLines); g.setFontAlign(0,0); // align center top - g.drawString(timeLines.join("\n"), X, Y, true /*clear background*/); + g.drawString(timeLines.join("\n"), X, Y, false); if (bottomLines.length) { // draw the time and/or date, in a normal font g.setFont("6x8"); g.setFontAlign(0,1); // align center bottom // pad the date - this clears the background if the date were to change length - g.drawString(bottomLines.join('\n'), SCREEN_WIDTH/2, SCREEN_HEIGHT - 5, true /*clear background*/); + g.drawString(bottomLines.join('\n'), SCREEN_WIDTH/2, SCREEN_HEIGHT - BOTTOM_SPACING, false); } /* Show launcher when middle button pressed @@ -130,13 +132,13 @@ function getBottomLines() { } if (settings.showDate) { - lines.push(locale.date(date, 1)); + lines.push(locale.date(date)); } return lines; } - function getTimeLines(m) { +function getTimeLines(m) { switch (settings.variant) { case VARIANT_EXACT: return getExactTimeLines(m); @@ -153,6 +155,10 @@ function getBottomLines() { } function getExactTimeLines(m) { + if (m === 0) { + return ['middernacht']; + } + const hour = getHour(m); const minutes = getMinutes(hour.offset); @@ -166,15 +172,8 @@ function getExactTimeLines(m) { function getApproximateTimeLines(m) { const roundMinutes = getRoundMinutes(m); - const hour = getHour(roundMinutes.minutes); - const minutes = getMinutes(hour.offset); - - const lines = minutes.concat(hour.lines); - - if (lines.length === 1) { - lines.push('uur'); - } + const lines = getExactTimeLines(roundMinutes.minutes); return addApproximateDescription(lines, roundMinutes.offset); } @@ -222,7 +221,7 @@ function addApproximateDescription(lines, offset) { return lines; } - if (lines[1] === 'uur') { + if (lines.length === 1 || lines[1] === 'uur') { const singular = lines[0]; const plural = getPlural(singular); return { @@ -243,6 +242,7 @@ function addApproximateDescription(lines, offset) { function getPlural(h) { return { + middernacht: 'middernacht', een: 'enen', twee: 'tweeën', drie: 'drieën', diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index d1b352e0cb..5ee68b7097 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,16 +3,16 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.10", + "version":"0.11", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", "supports": ["BANGLEJS", "BANGLEJS2"], "allow_emulator": true, "screenshots": [ + {"url":"screenshotbangle1-2.png"}, {"url":"screenshotbangle2.png"}, - {"url":"screenshotbangle1.png"}, - {"url":"screenshotbangle1-2.png"} + {"url":"screenshotbangle1.png"} ], "storage": [ {"name":"dutchclock.app.js","url":"app.js"}, @@ -22,6 +22,7 @@ ], "data": [ {"name":"dutchclock.json"} - ] + ], + "readme":"README.md" } \ No newline at end of file From 11e51623e5818a8139b98721ae8a421e83ef0ec6 Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:33:32 +0800 Subject: [PATCH 110/451] aviatorclk: v1.02 - various improvements --- apps/aviatorclk/ChangeLog | 5 +++ apps/aviatorclk/aviatorclk.app.js | 67 ++++++++++++++++++++++++++----- apps/aviatorclk/metadata.json | 2 +- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/apps/aviatorclk/ChangeLog b/apps/aviatorclk/ChangeLog index 929ee8387c..c086f765a1 100644 --- a/apps/aviatorclk/ChangeLog +++ b/apps/aviatorclk/ChangeLog @@ -1,2 +1,7 @@ 1.00: initial release 1.01: added tap event to scroll METAR and toggle seconds display +1.02: continue showing METAR during AVWX updates (show update status next to time) + re-try GPS fix if it takes too long + bug fix + don't attempt to update METAR if Bluetooth is NOT connected + toggle seconds display on front double-taps (if un-locked) to avoid accidential enabling diff --git a/apps/aviatorclk/aviatorclk.app.js b/apps/aviatorclk/aviatorclk.app.js index 33d671bc75..cee83813f1 100644 --- a/apps/aviatorclk/aviatorclk.app.js +++ b/apps/aviatorclk/aviatorclk.app.js @@ -19,6 +19,7 @@ const APP_NAME = 'aviatorclk'; const horizontalCenter = g.getWidth()/2; const mainTimeHeight = 38; const secondaryFontHeight = 22; +require("Font8x16").add(Graphics); // tertiary font const dateColour = ( g.theme.dark ? COLOUR_YELLOW : COLOUR_BLUE ); const UTCColour = ( g.theme.dark ? COLOUR_LIGHT_CYAN : COLOUR_DARK_CYAN ); const separatorColour = ( g.theme.dark ? COLOUR_LIGHT_GREY : COLOUR_DARK_GREY ); @@ -37,6 +38,7 @@ var settings = Object.assign({ var drawTimeout; var secondsInterval; var avwxTimeout; +var gpsTimeout; var AVWXrequest; var METAR = ''; @@ -92,16 +94,51 @@ function drawAVWX() { if (! avwxTimeout) { avwxTimeout = setTimeout(updateAVWX, 5 * 60000); } } +// show AVWX update status +function showUpdateAVWXstatus(status) { + let y = Bangle.appRect.y + 10; + g.setBgColor(g.theme.bg); + g.clearRect(0, y, horizontalCenter - 54, y + 16); + if (status) { + g.setFontAlign(0, -1).setFont("8x16").setColor( g.theme.dark ? COLOUR_ORANGE : COLOUR_DARK_YELLOW ); + g.drawString(status, horizontalCenter - 71, y, true); + } +} + +// re-try if the GPS doesn't return a fix in time +function GPStookTooLong() { + Bangle.setGPSPower(false, APP_NAME); + if (gpsTimeout) clearTimeout(gpsTimeout); + gpsTimeout = undefined; + + showUpdateAVWXstatus('X'); + + if (! avwxTimeout) { avwxTimeout = setTimeout(updateAVWX, 5 * 60000); } +} + // update the METAR info function updateAVWX() { if (avwxTimeout) clearTimeout(avwxTimeout); avwxTimeout = undefined; + if (gpsTimeout) clearTimeout(gpsTimeout); + gpsTimeout = undefined; + + if (! NRF.getSecurityStatus().connected) { + // if Bluetooth is NOT connected, try again in 5min + showUpdateAVWXstatus('X'); + avwxTimeout = setTimeout(updateAVWX, 5 * 60000); + return; + } - METAR = '\nGetting GPS fix'; - METARlinesCount = 0; METARscollLines = 0; - METARts = undefined; + showUpdateAVWXstatus('GPS'); + if (! METAR) { + METAR = '\nUpdating METAR'; + METARlinesCount = 0; METARscollLines = 0; + METARts = undefined; + } drawAVWX(); + gpsTimeout = setTimeout(GPStookTooLong, 30 * 60000); Bangle.setGPSPower(true, APP_NAME); Bangle.on('GPS', fix => { // prevent multiple, simultaneous requests @@ -109,12 +146,18 @@ function updateAVWX() { if ('fix' in fix && fix.fix != 0 && fix.satellites >= 4) { Bangle.setGPSPower(false, APP_NAME); + if (gpsTimeout) clearTimeout(gpsTimeout); + gpsTimeout = undefined; + let lat = fix.lat; let lon = fix.lon; - METAR = '\nRequesting METAR'; - METARlinesCount = 0; METARscollLines = 0; - METARts = undefined; + showUpdateAVWXstatus('AVWX'); + if (! METAR) { + METAR = '\nUpdating METAR'; + METARlinesCount = 0; METARscollLines = 0; + METARts = undefined; + } drawAVWX(); // get latest METAR from nearest airport (via AVWX API) @@ -146,6 +189,7 @@ function updateAVWX() { METARts = undefined; } + showUpdateAVWXstatus(''); drawAVWX(); AVWXrequest = undefined; @@ -155,6 +199,7 @@ function updateAVWX() { METAR = 'ERR: ' + error; METARlinesCount = 0; METARscollLines = 0; METARts = undefined; + showUpdateAVWXstatus(''); drawAVWX(); AVWXrequest = undefined; }); @@ -268,10 +313,10 @@ Bangle.on('tap', data => { case 'bottom': scrollAVWX(1); break; - case 'left': - case 'right': - // toggle seconds display on double taps left or right - if (data.double) { + case 'front': + // toggle seconds display on double tap on front/watch-face + // (if watch is un-locked) + if (data.double && ! Bangle.isLocked()) { if (settings.showSeconds) { clearInterval(secondsInterval); let y = Bangle.appRect.y + mainTimeHeight - 3; @@ -295,7 +340,7 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); // draw static separator line -y = Bangle.appRect.y + mainTimeHeight + secondaryFontHeight; +let y = Bangle.appRect.y + mainTimeHeight + secondaryFontHeight; g.setColor(separatorColour); g.drawLine(0, y, g.getWidth(), y); diff --git a/apps/aviatorclk/metadata.json b/apps/aviatorclk/metadata.json index 9d2b0beefb..54f539c1e9 100644 --- a/apps/aviatorclk/metadata.json +++ b/apps/aviatorclk/metadata.json @@ -2,7 +2,7 @@ "id": "aviatorclk", "name": "Aviator Clock", "shortName":"AV8R Clock", - "version":"1.01", + "version":"1.02", "description": "A clock for aviators, with local time and UTC - and the latest METAR for the nearest airport", "icon": "aviatorclk.png", "screenshots": [{ "url": "screenshot.png" }, { "url": "screenshot2.png" }], From 1bc60185dde94085b2d0f0a0c62b435dd0f35689 Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Sat, 13 Jan 2024 14:12:01 +0800 Subject: [PATCH 111/451] hadash: initial release --- apps/hadash/.gitignore | 4 + apps/hadash/ChangeLog | 1 + apps/hadash/README.md | 67 + apps/hadash/hadash-icon.js | 1 + apps/hadash/hadash.app.js | 227 + apps/hadash/hadash.png | Bin 0 -> 10599 bytes apps/hadash/interface.html | 258 + apps/hadash/jsoneditor.bundlejs | 39053 +++++++++++++++++++++++++++++ apps/hadash/jsoneditor.wrapperjs | 22 + apps/hadash/metadata.json | 20 + apps/hadash/screenshot.png | Bin 0 -> 3134 bytes 11 files changed, 39653 insertions(+) create mode 100644 apps/hadash/.gitignore create mode 100644 apps/hadash/ChangeLog create mode 100644 apps/hadash/README.md create mode 100644 apps/hadash/hadash-icon.js create mode 100644 apps/hadash/hadash.app.js create mode 100644 apps/hadash/hadash.png create mode 100644 apps/hadash/interface.html create mode 100644 apps/hadash/jsoneditor.bundlejs create mode 100644 apps/hadash/jsoneditor.wrapperjs create mode 100644 apps/hadash/metadata.json create mode 100644 apps/hadash/screenshot.png diff --git a/apps/hadash/.gitignore b/apps/hadash/.gitignore new file mode 100644 index 0000000000..c758274eff --- /dev/null +++ b/apps/hadash/.gitignore @@ -0,0 +1,4 @@ +hadash.json +node_modules +package-lock.json +package.json diff --git a/apps/hadash/ChangeLog b/apps/hadash/ChangeLog new file mode 100644 index 0000000000..971e5b97e0 --- /dev/null +++ b/apps/hadash/ChangeLog @@ -0,0 +1 @@ +1.00: initial release diff --git a/apps/hadash/README.md b/apps/hadash/README.md new file mode 100644 index 0000000000..a767543e26 --- /dev/null +++ b/apps/hadash/README.md @@ -0,0 +1,67 @@ +# Home-Assistant Dashboard + +This app interacts with a Home-Assistant (HA) instance. You can query entity +states and call services. This allows you access to up-to-date information of +any home automation system integrated into HA, and you can also control your +automations from your wrist. + +![](screenshot.png) + + +## How It Works + +This app uses the REST API to directly interact with HA (which requires a +"long-lived access token" - refer to "Configuration"). + +You can define a menu structure to be displayed on your Bangle, with the states +to be queried and services to be called. Menu entries can be: + +* entry to show the state of a HA entity +* entry to call a HA service +* sub-menus, including nested sub-menus + +Calls to a service can also have optional input for data fields on the Bangle +itself. + + +## Configuration + +After installing the app, use the "interface" page (floppy disk icon) in the +App Loader to configure it. + +Make sure to set the "Home-Assistant API Base URL" (which must include the +"/api" path, as well - but no slash at the end). + +Also create a "long-lived access token" in HA (under the Profile section, at +the bottom) and enter it as the "Long-lived access token". + +The tricky bit will be to configure your menu structure. You need to have a +basic understanding of the JSON format. The configuration page uses a JSON +Editor which will check the syntax and highlight any errors for you. Follow the +instructions on the page regarding how to configure menus, menu entries and the +required attributes. It also contains examples. + +Once you're happy with the menu structure (and you've entered the base URL and +access token), click the "Configure / Upload to Bangle" button. + + +## Security + +The "long-lived access token" will be stored unencrypted on your Bangle. This +would - in theory - mean that if your Bangle gets stolen, the new "owner" would +have unrestricted access to your Home-Assistant instance (the thief would have +to be fairly tech-savvy, though). However, I suggest you create a separate +token exclusively for your Bangle - that way, it's very easy to simply delete +that token in case your watch is stolen or lost. + + +## To-Do + +A better way to configure the menu structure would be useful, something like a +custom editor (replacing the jsoneditor). + + +## Author + +Flaparoo [github](https://github.com/flaparoo) + diff --git a/apps/hadash/hadash-icon.js b/apps/hadash/hadash-icon.js new file mode 100644 index 0000000000..a66e9e6873 --- /dev/null +++ b/apps/hadash/hadash-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwgmjhGACyuIxAYUCwIABFyowUCwYwSFwgwSCwowQFwwwQCw4wOFxAwOCxIwMFwuDnAwPCwv//4YFFx0/C4PzGBpXFCwIABMJiMGC5IwGQ4wXJGAq7HC5QwEW4+PCwP4YZTqJFxAwEdBIXKGAQXWIxIXMwAXXBRIXFwYFBnATKC5E/AoPzC6bdKC/4XTx4WCO5CbGC4YuDU5CbGC4QuCma+JKYwECXhoXIFwTsLC5DrONgxzMO4woDFx6nDFIYuPJQoqBFx4ADRIYuSGAiUEGCQXUYg4wUC6YwDBpUIGBYWJwA")) diff --git a/apps/hadash/hadash.app.js b/apps/hadash/hadash.app.js new file mode 100644 index 0000000000..d4ebf47a6b --- /dev/null +++ b/apps/hadash/hadash.app.js @@ -0,0 +1,227 @@ +/* + * Home-Assistant Dashboard - Bangle.js + */ + +const APP_NAME = 'hadash'; + +// Load settings +var settings = Object.assign({ + menu: [ + { type: 'state', title: 'Check for updates', id: 'update.home_assistant_core_update' }, + { type: 'service', title: 'Create Notification', domain: 'persistent_notification', service: 'create', + data: { 'message': 'test notification', 'title': 'Test'} }, + { type: 'menu', title: 'Sub-menu', data: + [ + { type: 'state', title: 'Check for Supervisor updates', id: 'update.home_assistant_supervisor_update' }, + { type: 'service', title: 'Restart HA', domain: 'homeassistant', service: 'restart', data: {} } + ] + }, + { type: 'service', title: 'Custom Notification', domain: 'persistent_notification', service: 'create', + data: { 'title': 'Not via input'}, + input: { 'message': { options: [], value: 'Pre-filled text' }, + 'notification_id': { options: [ 123, 456, 136 ], value: 999, label: "ID" } } }, + ], + HAbaseUrl: '', + HAtoken: '', +}, require('Storage').readJSON(APP_NAME+'.json', true) || {}); + + +// query an entity state +function queryState(title, id, level) { + E.showMessage('Fetching entity state from HA', { title: title }); + Bangle.http(settings.HAbaseUrl+'/states/'+id, { + headers: { + 'Authorization': 'Bearer '+settings.HAtoken, + 'Content-Type': 'application/json' + }, + }).then(data => { + //console.log(data); + let HAresp = JSON.parse(data.resp); + let title4prompt = title; + let msg = HAresp.state; + if ('attributes' in HAresp) { + if ('friendly_name' in HAresp.attributes) + title4prompt = HAresp.attributes.friendly_name; + if ('unit_of_measurement' in HAresp.attributes) + msg += HAresp.attributes.unit_of_measurement; + } + E.showPrompt(msg, { title: title4prompt, buttons: {OK: true} }).then((v) => { E.showMenu(menus[level]); }); + }).catch( error => { + console.log(error); + E.showPrompt('Error querying state!', { title: title, buttons: {OK: true} }).then((v) => { E.showMenu(menus[level]); }); + }); +} + + +// call a service +function callService(title, domain, service, data, level) { + E.showMessage('Calling HA service', { title: title }); + Bangle.http(settings.HAbaseUrl+'/services/'+domain+'/'+service, { + method: 'POST', + body: data, + headers: { + 'Authorization': 'Bearer '+settings.HAtoken, + 'Content-Type': 'application/json' + }, + }).then(data => { + //console.log(data); + E.showPrompt('Service called successfully', { title: title, buttons: {OK: true} }).then((v) => { E.showMenu(menus[level]); }); + }).catch( error => { + console.log(error); + E.showPrompt('Error calling service!', { title: title, buttons: {OK: true} }).then((v) => { E.showMenu(menus[level]); }); + }); +} + + +// callbacks for service input menu entries +function serviceInputChoiceChange(v, key, entry, level) { + entry.input[key].value = entry.input[key].options[v]; + getServiceInputData(entry, level); +} + +function serviceInputFreeform(key, entry, level) { + require("textinput").input({text: entry.input[key].value}).then(result => { + entry.input[key].value = result; + getServiceInputData(entry, level); + }); +} + +// get input data before calling a service +function getServiceInputData(entry, level) { + let serviceInputMenu = { + '': { + 'title': entry.title, + 'back': () => E.showMenu(menus[level]) + }, + }; + let CBs = {}; + for (let key in entry.input) { + // pre-fill data with default values + if ('value' in entry.input[key]) + entry.data[key] = entry.input[key].value; + + let label = ( ('label' in entry.input[key] && entry.input[key].label) ? entry.input[key].label : key ); + let key4CB = key; + + if ('options' in entry.input[key] && entry.input[key].options.length) { + // give choice from a selection of options + let idx = -1; + for (let i in entry.input[key].options) { + if (entry.input[key].value == entry.input[key].options[i]) { + idx = i; + } + } + if (idx == -1) { + idx = entry.input[key].options.push(entry.input[key].value) - 1; + } + // the setTimeout method can not be used for the "format" CB since it expects a return value - using eval instead: + eval('CBs["'+key+'_format"] = function(v) { return entry.input["'+key+'"].options[v]; }'); + serviceInputMenu[label] = { + value: parseInt(idx), + min: 0, + max: entry.input[key].options.length - 1, + format: CBs[key+'_format'], + onchange: (v) => setTimeout(serviceInputChoiceChange, 10, v, key4CB, entry, level) + }; + + } else { + // free-form text input + serviceInputMenu[label] = () => setTimeout(serviceInputFreeform, 10, key4CB, entry, level); + } + } + // menu entry to actually call the service: + serviceInputMenu['Call service'] = function() { callService(entry.title, entry.domain, entry.service, entry.data, level); }; + E.showMenu(serviceInputMenu); +} + + +// menu hierarchy +var menus = []; + + +// add menu entries +function addMenuEntries(level, entries) { + for (let i in entries) { + let entry = entries[i]; + let entryCB; + + // is there a menu entry title? + if (! ('title' in entry) || ! entry.title) + entry.title = 'TBD'; + + switch (entry.type) { + case 'state': + /* + * query entity state + */ + if ('id' in entry && entry.id) { + entryCB = () => setTimeout(queryState, 10, entry.title, entry.id, level); + } + break; + + case 'service': + /* + * call HA service + */ + if ('domain' in entry && entry.domain && 'service' in entry && entry.service) { + if (! ('data' in entry)) + entry.data = {}; + if ('input' in entry) { + // get input for some data fields first + entryCB = () => setTimeout(getServiceInputData, 10, entry, level); + } else { + // call service straight away + entryCB = () => setTimeout(callService, 10, entry.title, entry.domain, entry.service, entry.data, level); + } + } + break; + + case 'menu': + /* + * sub-menu + */ + entryCB = () => setTimeout(showSubMenu, 10, level + 1, entry.title, entry.data); + break; + } + + // only attach a call-back to menu entry if it's properly configured + if (! entryCB) { + menus[level][entry.title + ' - not correctly configured!'] = {}; + } else { + menus[level][entry.title] = entryCB; + } + } +} + + +// create and show a sub menu +function showSubMenu(level, title, entries) { + menus[level] = { + '': { + 'title': title, + 'back': () => E.showMenu(menus[level - 1]) + }, + }; + addMenuEntries(level, entries); + E.showMenu(menus[level]); +} + + +/* + * create the main menu + */ +menus[0] = { + '': { + 'title': 'HA-Dash', + 'back': () => load() + }, +}; +addMenuEntries(0, settings.menu); + +// check required configuration +if (! settings.HAbaseUrl || ! settings.HAtoken) { + E.showAlert('The app is not yet configured!', 'HA-Dash').then(() => E.showMenu(menus[0])); +} else { + E.showMenu(menus[0]); +} + diff --git a/apps/hadash/hadash.png b/apps/hadash/hadash.png new file mode 100644 index 0000000000000000000000000000000000000000..cfbb8d3b120a246f1528fafddf709cb9441a37db GIT binary patch literal 10599 zcmeHrXIN8Pw{AeCN|P$mQ91-j2wkN2A|L{y5|RL+gb+e6A|0uMbfhaC1ObuW5u`{F z6a=M%NRf`T6VSc4`=0N9=YG#~&%d4L$;w(|zT+KZzH^MZvR0^`jw%@mBMATiAX8UU z(#QP@pMHr5aL3#D`@sMJ^`VEMF;*Yy%7(@`SR(BZY*=?Rf(_w@v;+X$#)?yrE}yz% z{7)A6JcuPJ-gbRYosulr^}%a_^?if)O6T$s$ZBSL_icjb;Yv?J<9Z#zz1E}FORSA#QR$6!a*Yj`44}`{ zAdr=)H23?OuGx>7g~=Zj{EU*~u5QLV)v= z32yb@=eqSr4+CS~yrvFwd`S14k3tTf_U<1?GARxt0*l2$}A@?1<|R z`@=!KGH;7s_BI@n@Rw9<@D-L+{cyR$lf>*g=ALlZb^OS;l3GV*Y1TkTc4cd{M7HL~ z(g8)yJj>n9+qqi}8)ITVrjN+6%q{9xF&-+NURZ2h-Z{Wnp;c84L%mdP+Q)gQ@`iwD zzWCdZD6{8*j?(Foo+}e~7SdKzGDkjd_sR`PW{({C_qo4p1$rN3*=lM?ltxYn7;4-5 zdLR0XuG;2)I6m$)D1|+Ny|x(fie#*MT-82m_FP!P>ywFod~9FxG%s(@j8pJE!|+S- zvyVq1n#*MYLo4~$9NtlN%g|K0Qx}sz0bR|GOD2R|ES%YU=!Th0)?cnobvHt3%JF{L z`JuhynND=E8)BAo2NoxyGJ9m-slSjj;8afFYZ6piYnae+Ic_(Q2yOG-DqT;9M4B*R z3}U8+s(Xh1HqvSr$ayYk0NaPw2hJ6NNI3(PtJ=#fjh`(ZN)LV+s1xjMk|5M;sv!K) zTa1)^pvGiGn!$2lxP7zTd17k{C#Hw_i8y3C@TN4>-gc7I+f)kk<8M5=SWbrKvh zyHlpPKkb5g@qko@j~bC#;k_Ly;mEd-m?rqX`&+nKuI!6VUlN*JIs<&~oO?^C9Dc(J zHhH{^0@M0cvbx+M;dfTY=iKJ`XSI1i*rf52*&(xI!#!JG7a}$FN&BydnV=R64DvSN z!P*H`u@HYXVs~CG6#rS65>fV>Jo&i8Tj^T0#x64eM>~g74F+-oXQNz~-bj(3Pl*y zaSVI;EgBG2IuOZrAAHoD|+)US>5P z_QD%vg$@G-qbQHqfBIz3Q!70P(Sw~(arD+uCK-SIjLg|rbxWORopMb1JoR079oaxX zu<-LpX>)r1$MI`v2-6VN^Zr1!-OGN&UO`qWJIK6f0j$ zuY0sbTrqXmQk3@1?ry!jx#2m}Te_Scu*vW~d9pPR#gejIKCK57&E{UIPw3Acvf>ha z{&9b*)UsiOpS9#%?`5MMLC6n$mi1XMqA##_Xgjr8el_bdT~Kf@D@kB3cUOP1?!7%I z!8v)J3an{Sa4d8&W=1BCF6g`yM&rC3!|QqLq^ehC$-s{-wJjgVbZGCTeWI6@vu;T) zVwJJYhR*6cMLQz|yDCC9JMPy&Qe0TZ5J)JGQN^q1w>AKxerAqqGI3+ioIh?q<)4FH z-W#CmVY(D?owvEn>`(yj#hw@&;oQ?ex~TIvnhgyuI1WaWRj_j%zLy=1>8dEP%wp!A zjgZPLa_aV;k#f3-^%!)oQO`&@7Os=vddTf>Lvn8<(9nn{%qz@k5c1g)yIwGs>9ojk$nwUp=JZMF2g6kVC#7oJ| zxw`ExUC8=ke)V?wv*5somqhU)vjn}Aly0pam)PhNx%~~t34-$?uQL&)sFHD2d(rhI zrqJ9q3Nm8fLYF=)YP9ku{wAG}gsi-CBk*gq?t-&M61?Y?HTd$?_@-k_=_j>X{k@iuj1bC)PPf3H zEd*;`%#wEc4||pS0#ZEJ)EKRWI4gSSyWNw;>wDfwwhmt-+5ISs*40-PBY_ZnApAjR z^Q@M5Dh+(8L!~EjWt_C+xi%r-j&vx&Zm4-2feb6^LcqOJTVF`DM}XlXVO2BVh-!9o z!k2=9)zMp}#~x(uBkwxao6OPkAK1(83(T1HHb4XiGu?gW;?@Rlx7y@)&}hnvy|f1F znI?dUvkiQ0Z3!!rUv*sIS+POr-&i(&L~9Ta;#qI)6)qtd8{wRGk?~fY@WO|06*L&Z zk-(JrW-pS@GNLzX2figcA?>ZXc?!Ch6=#p0rtn9{LN80VS{t`sN>P-mZU95ZYF@-J z-r%wM!YBLk(anHDM3w&C&y}?uZQGn%7MB|fpI3(w(+G&jaVthlL)t{Hvb8t!7%p(4 zi~DZ+(pu8Hv1rr_m~}_?G4+y&gVOQooY^agZyF=*+W)ZV%|XZppg zONmXiGqrk|uSPV>qZcOLcBy$BI?Z8Y{>7;wRw3n8fk5h>XJiU%%n|iyFGbgJ=<<9p z{G`o!Q?dNPbj|Co)gPBMiW{|6+YRfJ$dMvm?%A9}DI=5W&3C(UKvd|A5A>6CYbylay`;V zWJ^NsZOmh(m!w=#59RuKU)$l^z25E7eaLw5aV6Wljf8N!{Sl{;miC%!QDV9Y)p;sU z&s6wwe5c5(u6!{IjF%TEMdST#nzFISBa<&}>uD+&%~%_f*q$sklgjmaT6`0*geTtI z;d2`gyPSXRTWj;ZogjZjLl?ne>wSpv#)j{ZkyCWkouJ&KD?Ew2#(TdV-3Ul#FeSp> zk|E(2`eJ>y>|(6^;=(aob)IaQBB2K(E)RGc*as_U9%#mNnm$d&v~M{fwO$1D=n;dT zxwVwh$zCq4$sMM>f!@JP>?z58;olo{vAF-}RwyW%?}cyAm65K)Rwa!xh->f=k`@B*zhh#(oC^rcwKz9NhGC#84F=%A@;*Dg@fyhWE} zCMpKD-Qm-<;m}|&7}|8HRkX=^hin%;br-E0ENLIs)Np=>J20Y2vz1Rp11zCQ z(ug8;-up0IjB2I4(i38@zQ+J|D0ODX-#9dTyf#^>l|pk-?~%JQozQ*yA8*+4Qs6Zh zHIrlW6WDE0nojSf8vRqLG|9(=lDu3;tL)#weOB6P3d zw4X3)EKVkby6a74l_l53vJuOL6_t*}QD>iQWy%a-59^nf&YPyWYAhuoiwlq|>H!?R zitH5Q)Rq~+?^Q=!_)A74OFn%Sx_VNXT7jo9mjQ|=FA%R2wjHdZVE(4gMM4B$$-gSi zJwM(rsoGrCj3yv=FhLBK;F*d)%nux_H!A|58ZMaDos6VFS0ij_ENi! z-c^jSI(*sKH};j8{QKgI8H}Co#o0CG4>ID>jlsq4D7KSeqTRR`;n#(ty-9%=vc9^x zmL6=*GF^mm(MM%V_m@aagr?mZhfJD;(;1P$R0g}ud840dSpc}@c(lLtBWYx2P)jmn zZ;+KsO6v;S=rO_NhP}S)0$kiLV|}nqQLiA}da+6PX-<($>v6|gSMrlu*R$$x+s={( zd?flr#JM)vI%T_nL**-4+QF-C}+M+~Fh=HCBk7(15R;b!T z`QCe3V^d=-cVN6(Xjak51g;o%kLDNTfH;W!g+3hxdNBpZA>#?T9Z8M6&B?8!N4K-z z>Ht;13t2l?vct2K$#S{elbG`Tpi0*43Q3H2UkRu|7Gl_Bi~WhFlHM?u*~*p9n8eB@ z?W>fAggQ=$f<&I}m(^Pp^X5IGk0`%n9f(H;&TvmQNO4o#+~Ebq9u-tr`|HYn=a3l7 zyh`?98j@2GNJ}6y7M0{S^%_!@*i5g+c<+jXlw4Nym_tW^yN}MHk5=NsLL2|*4o7Gx z1M`X!x`3rmL4^bpU=HOyXo{yan`7IiAyJH@zhz1NcGo8IB7ywfrs&BH!Ubk4Y<*F!A$u87D|h3S^XEP@NSU3toSt7 zMD9(R0%~0mZf3=oPoi%|mDT#R<8^T#HglZU92Oa46<}a8DXVI6R(q9q9^w?78 zcTlWt9h=HgW6oAHk)Nv1DzOTS9@8h3GdSBP~{6lG5o-L zv9H>hfw`_WKEdOsE3`W#TVhLZevh(TQ4Oj*91;3H)$~(mcPzP~-rTuma_g9f)lc^m zpFD0UChk^psuSL7)-?(9-14%Y6E8DgqZy_=_@wg7QonZHz0zTpq|eB z?VjzsmP^})JR=sOw1+KgU-N;zmKK1J;afJP9ZOT$ty=o4EDVBeKB7z@?T+xrvmrqe z+w5tayIxHG%>4YL^@NpRcQYTGD=!DO^`0|DI*t-_9KTqec?}T=Dc&G0>&ejm9<(%K zv;})VxYnPNEPSMsCEDqbukODo_e zY-gSLy8itGjrz?yHQ}DE2hJ63a}Qypr0h*FVd|DQiBWa5g?_7KT}{;im*67o@0_qq zo$Ux<1Zr{w0Lm_>wu$#O$rrM{-81P<<9EQ9$C0TSwfWUVE`s8uCF6r`rQznr1hFM2 zrz5>?{|n_TbF-Sl^XiTdd*n>6>3_VTGfrtskX1I1H5uxlK90VnnIT1hG(}>}jI>#O znQ5PpJgml)ukva0gLN#YWCuiOYTBbMKW1lsQahi(6$OYJ(7a?)z1AI(V}Jc(Lshiv z2w5baAR}WqosaBzPdXxleqQgofFX(0kXRm3XKnuu*XEMwjc^OMx>r^tdccRGjd`No7g1OJ^y5jPy?i5{7UGi^{k|R*h zb{TVGYQk%u`+~cbWG#<`*-K03M_CW23cV=kUCJd*kX~ypmE?;b-&zX=iQlUzJgONV z$Ik4~_V1>NdtZ&+m){|X9v~54?3fEE^JfRDQ(eHfZ(k02cD*y#lzC_-mM}q11T=co z`IOv&@gt=@n0A9L)D~Y?*_pBMY40tHh|Fm)_lV|1iM@_2?XtQQk%9a7E=%no^9$Kj z{S52I146I;G9?QR0t>&7ots_DsMIJzI^5&DL5UJ5u4Nz?sitqnbYaxbUoPwxA-&aIX0r?O>x69|o7D%DHR^!86(QeSX1r5f`={y; z0GTF;f{!5bykta9EU`$+9a{g=b@p(83RPTEe!sdtN!qrv?u4PMW7^!ru2taXg;>1n zkKN*zf|TpzW$KYjsk@<^MFI<<{h^%~YuLVXj?yN4mPlZtbF*xFld}-Y*=CU+7AIth zP`sAL5jl4&Vk5BVt$W{{)b}<|E7!X2Gw@mSzctGh3%E*GcAl7nX85K&E!}j5ZBC-v zkb6rjtMlQd*EE=0O>fG484ce=vK~_S^p6PW=v1p`o~LvxTZw|QRg+dQRvmfUjTcil zom@0SGCwFL?(vG5T(mCZ%y@96x_Z^Rn+5&)+{NolG663_-j^M+LGp9=oard zEsR|6Tsjw>Y4Qx^>#t~@qx5l^Wo>mOZM;!-W&a4EyNO8(Y4x`P04TzcxEHg=+FDXD z2YVqX+`$4NaON|s}-wvmGk376%#Ev7B3jaEchBh@@G z2m=otLzssxOcKr^cb!DWO$tX~kHA9N-0ba8PEu~N9A~^zxbsspkb~_Eg0+?9FxJ*% zQ*^)}*uX+yAz?vfH>8Uw$8{1m84TP~N?%Fk7X|K0mcts0MN0vJuCA^^t{@=?j1^Es zQc@BqED97A6~rL~o!n7asGA_liSv}=Cx;Tk35G$Uu}B9L+bJj1!oe9U%fW#gXZuBt z8-*#m;f%imoL-;NJ7M8Kb=(CQHy<1TC@L&0At)>=C@Km3-5)oqt^KDr%ITMiI6Z-G zP&80PNEm2u|2GdOtg_2r@&2WUlOgW?I8Yzq3PQS-=c0!z* z&hoZ{TLN)OokjlLM^#;0?@ymo8Lg1^=rfN~^zTSG>`xrp8Dn>bfy00ZJA^$h5hon8 z$lvf-q~%`=^tbt(j{LVoaN+*s{~P)bz0Ptu(^X2z0p@%fR9#7y<1}9>xC0CcmpVI@ z6b4y{z$_&MK`?}vAlOnAEGUT(g9(Bp#SoSd3lXrGh3Ico>L@2H6a_<^QsKyjkT@QQ zu!w{hLQF&u3;|gPf zVNxnMMkub>koHh31Q3m~I&(Q)7Af3haKb`QdjrROX2;D%N)dyAVjVDs4i0v*9H+Um zol>5)6r0SiW|7izfSoy>ff4Z2e*4vN3Q#NH*`*Bd-+})dlYzB^E9(D^=P&4=Eb7iBDtkO09%g~5Wj zU$`JxToNh>g~KcaCE;QqhzM8|VF~(K#(%OqIap#{p%{d`6|M$w>x^ryvvp?UIjcV2 zzvtp=jlk6izp#XqurSBZh!{|n$x1}!8EfpT*Acd7pl`6jGz9RR=&<@6Y5Ax5j2 zH~|2p)TduOKyoSr&Pa$=*H$K6#3Q>PK-{=C)CvHcYg1Q}H?*F7pQvlibc?A|uJIM9 z_M^7Twe~SJa_kO+0Eys;NA#dSzx?@nV!uoBJk`zq zxzp-pkA0(a%roOY=nNi-$GWpXY+bwhR==&LsBZ+;f4jKm-Prhfch|Gg9sP#=rl3sy zx4OFnbr;M@@1JaAR>KrIzvO2b@F3@tPc(_sOZ(^hSl#ee-l+1n6i5>Vqyjb6Hqz&)>-KU2D^u?G2dA&O^?aTb5mE?@@G{=G-Ek?E z<$)4QlRnzx({#6SOZC$yOMbGTw8dqUMh-*q@hyex>AqCbAL2NxqIDAm?GP;xvcs7a z_gs3aZl&2PJhsO5tUc)M23?aOkW{FiKQ_gsx?#TT*7#dY;q%uG^Oxng+pg{tq`eAk zQBSecKjwaL?3$2L!h&6r6*NlXqCgM5f0E*NcSl&E;c;l!b1fdeIDq#L1*yVqhq8B9Cn38&SmK}zEyGZ{IE~V13^wR4=(lcrGT`{wAZ_?sUO{( zsnvfGl05%pgR|}_ssBE2VW8K!E~O(A?madexvqutT;UC)oD5Msx^nE^{-MXM*qVZO* z_%cg6>c_dq4m}#4I%CXxKCLr@vJcRBYb-ZYQ&17Z)*2Gx_A{k5X3IB~q&LP(<~P!X zUf-1yu(yRMM(W(XQ1|%N*mDz?^twYbeHBFu+^rI{h?;JPQPlX2zhp#ffbkRR`pgX#5h}tF1_Hr|Z0Jd7y`XGQw5E`wiFP0Ci;@r4j{mzyAXNT0s^7 literal 0 HcmV?d00001 diff --git a/apps/hadash/interface.html b/apps/hadash/interface.html new file mode 100644 index 0000000000..d0a5d6329b --- /dev/null +++ b/apps/hadash/interface.html @@ -0,0 +1,258 @@ + + + + + + +
+ + +
+ Make sure to include "/api" as the URL path, but no slash at the end. +
+
+ + +
+ It's recommended to create a dedicated token for your Bangle. +
+
+ +
+ +

Menu structure

+ +

Use the editor below to configure the menu structure displayed in the + Bangle app. It is in the JSON format.

+ +

The main menu, and any sub-menus, are arrays. They can contain 3 + different types of entries (objects) defined by the "type" attribute:

+
    +
  • + Query an Entity State +
    +{
    +  "type": "state",
    +  "title": "Menu entry title",
    +  "id": "HA Entity ID"
    +}
    +        
    + The required Entity ID can be looked up in HA under Settings -> + Devices & Services -> Entities. For example: +
    +{
    +  "type": "state",
    +  "title": "Check for updates",
    +  "id": "update.home_assistant_core_update"
    +}
    +        
    +
  • +
  • + Call a HA service +
    +{
    +  "type": "service",
    +  "title": "Menu entry title",
    +  "domain": "HA Domain",
    +  "service": "HA Service",
    +  "data": {
    +    "key": "value"
    +  }
    +}
    +        
    +

    The required information to call a HA service can be found in HA + under the Developer tools -> Services. Use the "Go to YAML Mode" + function to see the actual names and values. The domain and service + parts are the 2 parts of the service name which are separated by a dot. + Any (optional) data key/value pairs can be added under the "data" + field. For example, here's a service call YAML: +

    +service: persistent_notification.create
    +data:
    +  message: test Notification
    +  title: Test
    +        
    + The resulting menu entry (JSON object) should be: +
    +{
    +  "type": "service",
    +  "title": "Create Notification",
    +  "domain": "persistent_notification",
    +  "service": "create",
    +  "data": {
    +    "message": "test Notification",
    +    "title": "Test"
    +  }
    +}
    +        
    + If the service requires a target, include the + "entity_id"/"device_id"/etc. (listed under "target:") also as "data" + key/value pairs. For example, if the YAML also includes: +
    +target:
    +  device_id: abcd1234
    +        
    + ... add another "data" key/value pair: "device_id": "abcd1234". + If that doesn't work, list the device (or entity) ID in an array: + "device_id": [ "abcd1234" ]

    + +

    Data fields can also have variable input on the Bangle. In that + case, don't add the key/value pair under "data", but create an "input" + object with entries per "data" key: +

    +{
    +  "key": {
    +    "options": [],
    +    "value": "",
    +    "label": ""
    +  }
    +}
    +        
    + If "options" is left empty, the preferred text-input (pick your + favourite app - I like the dragboard) is called to allow entering a + free-form value. Otherwise, list the allowed values in the "options" + array. The "value" is the pre-defined/default value. The "label" is + optional and can be used to override the label for this key (as + displayed on the Bangle). For example: +
    +{
    +  "type": "service",
    +  "title": "Custom Notification",
    +  "domain": "persistent_notification",
    +  "service": "create",
    +  "data": {
    +    "title": "Fixed"
    +  },
    +  "input": {
    +    "message": {
    +      "options": [],
    +      "value": "Pre-filled text"
    +    },
    +    "notification_id": {
    +      "options": [
    +        "123",
    +        "456",
    +        "136"
    +      ],
    +      "value": "999",
    +      "label": "ID"
    +    }
    +  }
    +}
    +        
    + In the above example, the "data" will have 3 key/value pairs when the + service is called: the "title" is always the same, "message" can be + entered via the (free-form) text-input and "notification_id" can be + selected from a list of numbers (however, the prompt will be for "ID" + and not "notification_id"). If the default value is not listed in + "options" (like "999"), it will be added to that list.

    +
  • +
  • + Sub-menu +
    +{
    +  "type": "menu",
    +  "title": "Menu entry / sub-menu title",
    +  "data": []
    +}
    +        
    + The "data" needs to be another array of menu entries. For example: +
    +{
    +  "type": "menu",
    +  "title": "Sub-menu",
    +  "data": [
    +    {
    +      "type": "state",
    +      "title": "Check for Supervisor updates",
    +      "id": "update.home_assistant_supervisor_update"
    +    },
    +    {
    +      "type": "service",
    +      "title": "Restart HA",
    +      "domain": "homeassistant",
    +      "service": "restart",
    +      "data": {}
    +    }
    +  ]
    +}
    +        
    + Sub-menus can contain other sub-menus, so you can have multiple levels + of nested menus. +
  • +
+ +
+ +
+ +

+ + + + + + + + + + + + diff --git a/apps/hadash/jsoneditor.bundlejs b/apps/hadash/jsoneditor.bundlejs new file mode 100644 index 0000000000..051abb9ffb --- /dev/null +++ b/apps/hadash/jsoneditor.bundlejs @@ -0,0 +1,39053 @@ +(() => { + // node_modules/vanilla-jsoneditor/standalone.js + var e; + var t; + var n; + var r; + var o; + var i; + var a; + var s; + var c; + var l; + var u; + var f; + var d; + var h; + var v; + var p; + var m; + var g; + var y; + var b; + var k; + var w; + var x; + var j; + var S; + var C; + var $; + var _; + var O; + var M; + var E; + var A; + var P; + var T; + var R; + var N; + var I; + var D; + var q; + var z; + var B; + var L; + var F; + var V; + var H; + var W; + var U; + var J; + var K; + var G; + var Q; + var Y; + var X; + var Z; + var ee; + var te; + var ne; + var re; + var oe; + var ie; + var ae; + var se; + var ce; + var le; + var ue; + var fe; + var de; + var he; + var ve; + var pe; + var me; + var ge; + var ye; + var be; + var ke; + var we; + var xe; + var je; + var Se; + var Ce; + var $e; + var _e; + var Oe; + var Me; + var Ee; + var Ae; + var Pe; + var Te; + var Re; + var Ne; + var Ie; + var De; + var qe; + var ze; + var Be; + var Le; + var Fe; + var Ve; + var He; + var We; + var Ue; + var Je; + var Ke; + var Ge; + var Qe; + var Ye; + var Xe; + var Ze; + var et; + var tt; + var nt; + var rt; + var ot; + var it; + var at; + var st; + var ct; + var lt; + var ut; + var ft; + var dt; + var ht; + var vt; + var pt; + var mt; + var gt; + var yt; + var bt; + var kt; + var wt; + var xt; + var jt; + var St; + var Ct; + var $t; + var _t; + var Ot; + var Mt; + var Et; + var At; + var Pt; + var Tt; + var Rt; + var Nt; + var It; + var Dt; + var qt; + var zt; + var Bt; + var Lt; + var Ft; + var Vt; + var Ht; + var Wt; + var Ut; + var Jt; + var Kt; + var Gt; + var Qt; + var Yt; + var Xt; + var Zt; + var en; + var tn; + var nn; + var rn; + var on; + var an; + var sn; + var cn; + var ln; + var un; + var fn; + var dn; + var hn; + var vn; + var pn; + var mn; + var gn; + var yn; + var bn; + var kn; + var wn; + var xn; + var jn; + var Sn; + var Cn; + var $n; + var _n; + var On; + var Mn; + var En; + var An; + var Pn; + var Tn; + var Rn; + var Nn; + var In; + var Dn; + var qn; + var zn; + var Bn; + var Ln; + var Fn; + var Vn; + var Hn; + var Wn; + var Un; + var Jn; + var Kn; + var Gn; + var Qn; + var Yn; + var Xn; + var Zn; + var er; + var tr; + var nr; + var rr; + var or; + var ir; + var ar; + var sr; + var cr; + var lr; + var ur; + var fr; + var dr; + var hr; + var vr; + var pr; + var mr; + var gr; + var yr; + var br; + var kr; + var wr; + var xr; + var jr; + var Sr; + var Cr; + var $r; + var _r; + var Or; + var Mr; + var Er; + var Ar; + var Pr; + var Tr; + var Rr; + var Nr; + var Ir; + var Dr; + var qr; + var zr; + var Br; + var Lr; + var Fr; + var Vr; + var Hr; + var Wr; + var Ur; + var Jr; + var Kr; + var Gr; + var Qr; + var Yr; + var Xr; + var Zr; + var eo; + var to; + var no; + var ro; + var oo; + var io; + var ao; + var so; + var co; + var lo; + var uo; + var fo; + var ho; + var vo = ["mainAxis", "crossAxis", "fallbackPlacements", "fallbackStrategy", "fallbackAxisSideDirection", "flipAlignment"]; + var po = ["mainAxis", "crossAxis", "limiter"]; + function mo(e20, t10) { + return t10 || (t10 = e20.slice(0)), Object.freeze(Object.defineProperties(e20, { raw: { value: Object.freeze(t10) } })); + } + function go() { + return go = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e20, t10, n10) { + var r10 = function(e21, t11) { + for (; !Object.prototype.hasOwnProperty.call(e21, t11) && null !== (e21 = Mo(e21)); ) + ; + return e21; + }(e20, t10); + if (r10) { + var o10 = Object.getOwnPropertyDescriptor(r10, t10); + return o10.get ? o10.get.call(arguments.length < 3 ? e20 : n10) : o10.value; + } + }, go.apply(this, arguments); + } + function yo(e20, t10) { + if (null == e20) + return {}; + var n10, r10, o10 = function(e21, t11) { + if (null == e21) + return {}; + var n11, r11, o11 = {}, i11 = Object.keys(e21); + for (r11 = 0; r11 < i11.length; r11++) + n11 = i11[r11], t11.indexOf(n11) >= 0 || (o11[n11] = e21[n11]); + return o11; + }(e20, t10); + if (Object.getOwnPropertySymbols) { + var i10 = Object.getOwnPropertySymbols(e20); + for (r10 = 0; r10 < i10.length; r10++) + n10 = i10[r10], t10.indexOf(n10) >= 0 || Object.prototype.propertyIsEnumerable.call(e20, n10) && (o10[n10] = e20[n10]); + } + return o10; + } + function bo(e20, t10) { + var n10 = "undefined" != typeof Symbol && e20[Symbol.iterator] || e20["@@iterator"]; + if (!n10) { + if (Array.isArray(e20) || (n10 = Lo(e20)) || t10 && e20 && "number" == typeof e20.length) { + n10 && (e20 = n10); + var r10 = 0, o10 = function() { + }; + return { s: o10, n: function() { + return r10 >= e20.length ? { done: true } : { done: false, value: e20[r10++] }; + }, e: function(e21) { + throw e21; + }, f: o10 }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var i10, a10 = true, s10 = false; + return { s: function() { + n10 = n10.call(e20); + }, n: function() { + var e21 = n10.next(); + return a10 = e21.done, e21; + }, e: function(e21) { + s10 = true, i10 = e21; + }, f: function() { + try { + a10 || null == n10.return || n10.return(); + } finally { + if (s10) + throw i10; + } + } }; + } + function ko() { + ko = function() { + return t10; + }; + var e20, t10 = {}, n10 = Object.prototype, r10 = n10.hasOwnProperty, o10 = Object.defineProperty || function(e21, t11, n11) { + e21[t11] = n11.value; + }, i10 = "function" == typeof Symbol ? Symbol : {}, a10 = i10.iterator || "@@iterator", s10 = i10.asyncIterator || "@@asyncIterator", c10 = i10.toStringTag || "@@toStringTag"; + function l10(e21, t11, n11) { + return Object.defineProperty(e21, t11, { value: n11, enumerable: true, configurable: true, writable: true }), e21[t11]; + } + try { + l10({}, ""); + } catch (e21) { + l10 = function(e23, t11, n11) { + return e23[t11] = n11; + }; + } + function u10(e21, t11, n11, r11) { + var i11 = t11 && t11.prototype instanceof g10 ? t11 : g10, a11 = Object.create(i11.prototype), s11 = new E10(r11 || []); + return o10(a11, "_invoke", { value: $10(e21, n11, s11) }), a11; + } + function f10(e21, t11, n11) { + try { + return { type: "normal", arg: e21.call(t11, n11) }; + } catch (e23) { + return { type: "throw", arg: e23 }; + } + } + t10.wrap = u10; + var d10 = "suspendedStart", h10 = "suspendedYield", v10 = "executing", p10 = "completed", m10 = {}; + function g10() { + } + function y10() { + } + function b10() { + } + var k10 = {}; + l10(k10, a10, function() { + return this; + }); + var w10 = Object.getPrototypeOf, x10 = w10 && w10(w10(A10([]))); + x10 && x10 !== n10 && r10.call(x10, a10) && (k10 = x10); + var j10 = b10.prototype = g10.prototype = Object.create(k10); + function S10(e21) { + ["next", "throw", "return"].forEach(function(t11) { + l10(e21, t11, function(e23) { + return this._invoke(t11, e23); + }); + }); + } + function C10(e21, t11) { + function n11(o11, i12, a11, s11) { + var c11 = f10(e21[o11], e21, i12); + if ("throw" !== c11.type) { + var l11 = c11.arg, u11 = l11.value; + return u11 && "object" == Ho(u11) && r10.call(u11, "__await") ? t11.resolve(u11.__await).then(function(e23) { + n11("next", e23, a11, s11); + }, function(e23) { + n11("throw", e23, a11, s11); + }) : t11.resolve(u11).then(function(e23) { + l11.value = e23, a11(l11); + }, function(e23) { + return n11("throw", e23, a11, s11); + }); + } + s11(c11.arg); + } + var i11; + o10(this, "_invoke", { value: function(e23, r11) { + function o11() { + return new t11(function(t12, o12) { + n11(e23, r11, t12, o12); + }); + } + return i11 = i11 ? i11.then(o11, o11) : o11(); + } }); + } + function $10(t11, n11, r11) { + var o11 = d10; + return function(i11, a11) { + if (o11 === v10) + throw new Error("Generator is already running"); + if (o11 === p10) { + if ("throw" === i11) + throw a11; + return { value: e20, done: true }; + } + for (r11.method = i11, r11.arg = a11; ; ) { + var s11 = r11.delegate; + if (s11) { + var c11 = _10(s11, r11); + if (c11) { + if (c11 === m10) + continue; + return c11; + } + } + if ("next" === r11.method) + r11.sent = r11._sent = r11.arg; + else if ("throw" === r11.method) { + if (o11 === d10) + throw o11 = p10, r11.arg; + r11.dispatchException(r11.arg); + } else + "return" === r11.method && r11.abrupt("return", r11.arg); + o11 = v10; + var l11 = f10(t11, n11, r11); + if ("normal" === l11.type) { + if (o11 = r11.done ? p10 : h10, l11.arg === m10) + continue; + return { value: l11.arg, done: r11.done }; + } + "throw" === l11.type && (o11 = p10, r11.method = "throw", r11.arg = l11.arg); + } + }; + } + function _10(t11, n11) { + var r11 = n11.method, o11 = t11.iterator[r11]; + if (o11 === e20) + return n11.delegate = null, "throw" === r11 && t11.iterator.return && (n11.method = "return", n11.arg = e20, _10(t11, n11), "throw" === n11.method) || "return" !== r11 && (n11.method = "throw", n11.arg = new TypeError("The iterator does not provide a '" + r11 + "' method")), m10; + var i11 = f10(o11, t11.iterator, n11.arg); + if ("throw" === i11.type) + return n11.method = "throw", n11.arg = i11.arg, n11.delegate = null, m10; + var a11 = i11.arg; + return a11 ? a11.done ? (n11[t11.resultName] = a11.value, n11.next = t11.nextLoc, "return" !== n11.method && (n11.method = "next", n11.arg = e20), n11.delegate = null, m10) : a11 : (n11.method = "throw", n11.arg = new TypeError("iterator result is not an object"), n11.delegate = null, m10); + } + function O10(e21) { + var t11 = { tryLoc: e21[0] }; + 1 in e21 && (t11.catchLoc = e21[1]), 2 in e21 && (t11.finallyLoc = e21[2], t11.afterLoc = e21[3]), this.tryEntries.push(t11); + } + function M10(e21) { + var t11 = e21.completion || {}; + t11.type = "normal", delete t11.arg, e21.completion = t11; + } + function E10(e21) { + this.tryEntries = [{ tryLoc: "root" }], e21.forEach(O10, this), this.reset(true); + } + function A10(t11) { + if (t11 || "" === t11) { + var n11 = t11[a10]; + if (n11) + return n11.call(t11); + if ("function" == typeof t11.next) + return t11; + if (!isNaN(t11.length)) { + var o11 = -1, i11 = function n12() { + for (; ++o11 < t11.length; ) + if (r10.call(t11, o11)) + return n12.value = t11[o11], n12.done = false, n12; + return n12.value = e20, n12.done = true, n12; + }; + return i11.next = i11; + } + } + throw new TypeError(Ho(t11) + " is not iterable"); + } + return y10.prototype = b10, o10(j10, "constructor", { value: b10, configurable: true }), o10(b10, "constructor", { value: y10, configurable: true }), y10.displayName = l10(b10, c10, "GeneratorFunction"), t10.isGeneratorFunction = function(e21) { + var t11 = "function" == typeof e21 && e21.constructor; + return !!t11 && (t11 === y10 || "GeneratorFunction" === (t11.displayName || t11.name)); + }, t10.mark = function(e21) { + return Object.setPrototypeOf ? Object.setPrototypeOf(e21, b10) : (e21.__proto__ = b10, l10(e21, c10, "GeneratorFunction")), e21.prototype = Object.create(j10), e21; + }, t10.awrap = function(e21) { + return { __await: e21 }; + }, S10(C10.prototype), l10(C10.prototype, s10, function() { + return this; + }), t10.AsyncIterator = C10, t10.async = function(e21, n11, r11, o11, i11) { + void 0 === i11 && (i11 = Promise); + var a11 = new C10(u10(e21, n11, r11, o11), i11); + return t10.isGeneratorFunction(n11) ? a11 : a11.next().then(function(e23) { + return e23.done ? e23.value : a11.next(); + }); + }, S10(j10), l10(j10, c10, "Generator"), l10(j10, a10, function() { + return this; + }), l10(j10, "toString", function() { + return "[object Generator]"; + }), t10.keys = function(e21) { + var t11 = Object(e21), n11 = []; + for (var r11 in t11) + n11.push(r11); + return n11.reverse(), function e23() { + for (; n11.length; ) { + var r12 = n11.pop(); + if (r12 in t11) + return e23.value = r12, e23.done = false, e23; + } + return e23.done = true, e23; + }; + }, t10.values = A10, E10.prototype = { constructor: E10, reset: function(t11) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = e20, this.done = false, this.delegate = null, this.method = "next", this.arg = e20, this.tryEntries.forEach(M10), !t11) + for (var n11 in this) + "t" === n11.charAt(0) && r10.call(this, n11) && !isNaN(+n11.slice(1)) && (this[n11] = e20); + }, stop: function() { + this.done = true; + var e21 = this.tryEntries[0].completion; + if ("throw" === e21.type) + throw e21.arg; + return this.rval; + }, dispatchException: function(t11) { + if (this.done) + throw t11; + var n11 = this; + function o11(r11, o12) { + return s11.type = "throw", s11.arg = t11, n11.next = r11, o12 && (n11.method = "next", n11.arg = e20), !!o12; + } + for (var i11 = this.tryEntries.length - 1; i11 >= 0; --i11) { + var a11 = this.tryEntries[i11], s11 = a11.completion; + if ("root" === a11.tryLoc) + return o11("end"); + if (a11.tryLoc <= this.prev) { + var c11 = r10.call(a11, "catchLoc"), l11 = r10.call(a11, "finallyLoc"); + if (c11 && l11) { + if (this.prev < a11.catchLoc) + return o11(a11.catchLoc, true); + if (this.prev < a11.finallyLoc) + return o11(a11.finallyLoc); + } else if (c11) { + if (this.prev < a11.catchLoc) + return o11(a11.catchLoc, true); + } else { + if (!l11) + throw new Error("try statement without catch or finally"); + if (this.prev < a11.finallyLoc) + return o11(a11.finallyLoc); + } + } + } + }, abrupt: function(e21, t11) { + for (var n11 = this.tryEntries.length - 1; n11 >= 0; --n11) { + var o11 = this.tryEntries[n11]; + if (o11.tryLoc <= this.prev && r10.call(o11, "finallyLoc") && this.prev < o11.finallyLoc) { + var i11 = o11; + break; + } + } + i11 && ("break" === e21 || "continue" === e21) && i11.tryLoc <= t11 && t11 <= i11.finallyLoc && (i11 = null); + var a11 = i11 ? i11.completion : {}; + return a11.type = e21, a11.arg = t11, i11 ? (this.method = "next", this.next = i11.finallyLoc, m10) : this.complete(a11); + }, complete: function(e21, t11) { + if ("throw" === e21.type) + throw e21.arg; + return "break" === e21.type || "continue" === e21.type ? this.next = e21.arg : "return" === e21.type ? (this.rval = this.arg = e21.arg, this.method = "return", this.next = "end") : "normal" === e21.type && t11 && (this.next = t11), m10; + }, finish: function(e21) { + for (var t11 = this.tryEntries.length - 1; t11 >= 0; --t11) { + var n11 = this.tryEntries[t11]; + if (n11.finallyLoc === e21) + return this.complete(n11.completion, n11.afterLoc), M10(n11), m10; + } + }, catch: function(e21) { + for (var t11 = this.tryEntries.length - 1; t11 >= 0; --t11) { + var n11 = this.tryEntries[t11]; + if (n11.tryLoc === e21) { + var r11 = n11.completion; + if ("throw" === r11.type) { + var o11 = r11.arg; + M10(n11); + } + return o11; + } + } + throw new Error("illegal catch attempt"); + }, delegateYield: function(t11, n11, r11) { + return this.delegate = { iterator: A10(t11), resultName: n11, nextLoc: r11 }, "next" === this.method && (this.arg = e20), m10; + } }, t10; + } + function wo(e20, t10, n10, r10, o10, i10, a10) { + try { + var s10 = e20[i10](a10), c10 = s10.value; + } catch (e21) { + return void n10(e21); + } + s10.done ? t10(c10) : Promise.resolve(c10).then(r10, o10); + } + function xo(e20) { + return function() { + var t10 = this, n10 = arguments; + return new Promise(function(r10, o10) { + var i10 = e20.apply(t10, n10); + function a10(e21) { + wo(i10, r10, o10, a10, s10, "next", e21); + } + function s10(e21) { + wo(i10, r10, o10, a10, s10, "throw", e21); + } + a10(void 0); + }); + }; + } + function jo(e20, t10) { + return Co(e20) || function(e21, t11) { + var n10 = null == e21 ? null : "undefined" != typeof Symbol && e21[Symbol.iterator] || e21["@@iterator"]; + if (null != n10) { + var r10, o10, i10, a10, s10 = [], c10 = true, l10 = false; + try { + if (i10 = (n10 = n10.call(e21)).next, 0 === t11) { + if (Object(n10) !== n10) + return; + c10 = false; + } else + for (; !(c10 = (r10 = i10.call(n10)).done) && (s10.push(r10.value), s10.length !== t11); c10 = true) + ; + } catch (e23) { + l10 = true, o10 = e23; + } finally { + try { + if (!c10 && null != n10.return && (a10 = n10.return(), Object(a10) !== a10)) + return; + } finally { + if (l10) + throw o10; + } + } + return s10; + } + }(e20, t10) || Lo(e20, t10) || So(); + } + function So() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function Co(e20) { + if (Array.isArray(e20)) + return e20; + } + function $o(e20) { + var t10 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; + return $o = function(e21) { + if (null === e21 || !function(e23) { + try { + return -1 !== Function.toString.call(e23).indexOf("[native code]"); + } catch (t11) { + return "function" == typeof e23; + } + }(e21)) + return e21; + if ("function" != typeof e21) + throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== t10) { + if (t10.has(e21)) + return t10.get(e21); + t10.set(e21, n10); + } + function n10() { + return function(e23, t11, n11) { + if (Oo()) + return Reflect.construct.apply(null, arguments); + var r10 = [null]; + r10.push.apply(r10, t11); + var o10 = new (e23.bind.apply(e23, r10))(); + return n11 && Po(o10, n11.prototype), o10; + }(e21, arguments, Mo(this).constructor); + } + return n10.prototype = Object.create(e21.prototype, { constructor: { value: n10, enumerable: false, writable: true, configurable: true } }), Po(n10, e21); + }, $o(e20); + } + function _o(e20, t10, n10) { + return t10 = Mo(t10), function(e21, t11) { + if (t11 && ("object" === Ho(t11) || "function" == typeof t11)) + return t11; + if (void 0 !== t11) + throw new TypeError("Derived constructors may only return object or undefined"); + return Eo(e21); + }(e20, Oo() ? Reflect.construct(t10, n10 || [], Mo(e20).constructor) : t10.apply(e20, n10)); + } + function Oo() { + try { + var e20 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (e21) { + } + return (Oo = function() { + return !!e20; + })(); + } + function Mo(e20) { + return Mo = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e21) { + return e21.__proto__ || Object.getPrototypeOf(e21); + }, Mo(e20); + } + function Eo(e20) { + if (void 0 === e20) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e20; + } + function Ao(e20, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Super expression must either be null or a function"); + e20.prototype = Object.create(t10 && t10.prototype, { constructor: { value: e20, writable: true, configurable: true } }), Object.defineProperty(e20, "prototype", { writable: false }), t10 && Po(e20, t10); + } + function Po(e20, t10) { + return Po = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e21, t11) { + return e21.__proto__ = t11, e21; + }, Po(e20, t10); + } + function To(e20, t10) { + var n10 = Object.keys(e20); + if (Object.getOwnPropertySymbols) { + var r10 = Object.getOwnPropertySymbols(e20); + t10 && (r10 = r10.filter(function(t11) { + return Object.getOwnPropertyDescriptor(e20, t11).enumerable; + })), n10.push.apply(n10, r10); + } + return n10; + } + function Ro(e20) { + for (var t10 = 1; t10 < arguments.length; t10++) { + var n10 = null != arguments[t10] ? arguments[t10] : {}; + t10 % 2 ? To(Object(n10), true).forEach(function(t11) { + qo(e20, t11, n10[t11]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e20, Object.getOwnPropertyDescriptors(n10)) : To(Object(n10)).forEach(function(t11) { + Object.defineProperty(e20, t11, Object.getOwnPropertyDescriptor(n10, t11)); + }); + } + return e20; + } + function No(e20, t10) { + if (!(e20 instanceof t10)) + throw new TypeError("Cannot call a class as a function"); + } + function Io(e20, t10) { + for (var n10 = 0; n10 < t10.length; n10++) { + var r10 = t10[n10]; + r10.enumerable = r10.enumerable || false, r10.configurable = true, "value" in r10 && (r10.writable = true), Object.defineProperty(e20, zo(r10.key), r10); + } + } + function Do(e20, t10, n10) { + return t10 && Io(e20.prototype, t10), n10 && Io(e20, n10), Object.defineProperty(e20, "prototype", { writable: false }), e20; + } + function qo(e20, t10, n10) { + return (t10 = zo(t10)) in e20 ? Object.defineProperty(e20, t10, { value: n10, enumerable: true, configurable: true, writable: true }) : e20[t10] = n10, e20; + } + function zo(e20) { + var t10 = function(e21, t11) { + if ("object" != Ho(e21) || !e21) + return e21; + var n10 = e21[Symbol.toPrimitive]; + if (void 0 !== n10) { + var r10 = n10.call(e21, t11 || "default"); + if ("object" != Ho(r10)) + return r10; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === t11 ? String : Number)(e21); + }(e20, "string"); + return "symbol" == Ho(t10) ? t10 : String(t10); + } + function Bo(e20) { + return function(e21) { + if (Array.isArray(e21)) + return Vo(e21); + }(e20) || Fo(e20) || Lo(e20) || function() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + }(); + } + function Lo(e20, t10) { + if (e20) { + if ("string" == typeof e20) + return Vo(e20, t10); + var n10 = Object.prototype.toString.call(e20).slice(8, -1); + return "Object" === n10 && e20.constructor && (n10 = e20.constructor.name), "Map" === n10 || "Set" === n10 ? Array.from(e20) : "Arguments" === n10 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n10) ? Vo(e20, t10) : void 0; + } + } + function Fo(e20) { + if ("undefined" != typeof Symbol && null != e20[Symbol.iterator] || null != e20["@@iterator"]) + return Array.from(e20); + } + function Vo(e20, t10) { + (null == t10 || t10 > e20.length) && (t10 = e20.length); + for (var n10 = 0, r10 = new Array(t10); n10 < t10; n10++) + r10[n10] = e20[n10]; + return r10; + } + function Ho(e20) { + return Ho = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e21) { + return typeof e21; + } : function(e21) { + return e21 && "function" == typeof Symbol && e21.constructor === Symbol && e21 !== Symbol.prototype ? "symbol" : typeof e21; + }, Ho(e20); + } + function Wo() { + } + var Uo = function(e20) { + return e20; + }; + function Jo(e20, t10) { + for (var n10 in t10) + e20[n10] = t10[n10]; + return e20; + } + function Ko(e20) { + return e20(); + } + function Go() { + return /* @__PURE__ */ Object.create(null); + } + function Qo(e20) { + e20.forEach(Ko); + } + function Yo(e20) { + return "function" == typeof e20; + } + function Xo(e20, t10) { + return e20 != e20 ? t10 == t10 : e20 !== t10 || e20 && "object" === Ho(e20) || "function" == typeof e20; + } + function Zo(e20, t10) { + return e20 != e20 ? t10 == t10 : e20 !== t10; + } + function ei(e20, t10, n10, r10) { + if (e20) { + var o10 = ti(e20, t10, n10, r10); + return e20[0](o10); + } + } + function ti(e20, t10, n10, r10) { + return e20[1] && r10 ? Jo(n10.ctx.slice(), e20[1](r10(t10))) : n10.ctx; + } + function ni(e20, t10, n10, r10) { + if (e20[2] && r10) { + var o10 = e20[2](r10(n10)); + if (void 0 === t10.dirty) + return o10; + if ("object" === Ho(o10)) { + for (var i10 = [], a10 = Math.max(t10.dirty.length, o10.length), s10 = 0; s10 < a10; s10 += 1) + i10[s10] = t10.dirty[s10] | o10[s10]; + return i10; + } + return t10.dirty | o10; + } + return t10.dirty; + } + function ri(e20, t10, n10, r10, o10, i10) { + if (o10) { + var a10 = ti(t10, n10, r10, i10); + e20.p(a10, o10); + } + } + function oi(e20) { + if (e20.ctx.length > 32) { + for (var t10 = [], n10 = e20.ctx.length / 32, r10 = 0; r10 < n10; r10++) + t10[r10] = -1; + return t10; + } + return -1; + } + function ii(e20) { + var t10 = {}; + for (var n10 in e20) + "$" !== n10[0] && (t10[n10] = e20[n10]); + return t10; + } + function ai(e20, t10) { + var n10 = {}; + for (var r10 in t10 = new Set(t10), e20) + t10.has(r10) || "$" === r10[0] || (n10[r10] = e20[r10]); + return n10; + } + function si(e20) { + return null == e20 ? "" : e20; + } + function ci(e20) { + return e20 && Yo(e20.destroy) ? e20.destroy : Wo; + } + var li = "undefined" != typeof window; + var ui = li ? function() { + return window.performance.now(); + } : function() { + return Date.now(); + }; + var fi = li ? function(e20) { + return requestAnimationFrame(e20); + } : Wo; + var di = /* @__PURE__ */ new Set(); + function hi(e20) { + di.forEach(function(t10) { + t10.c(e20) || (di.delete(t10), t10.f()); + }), 0 !== di.size && fi(hi); + } + var vi = "undefined" != typeof window ? window : "undefined" != typeof globalThis ? globalThis : global; + function pi(e20, t10) { + e20.appendChild(t10); + } + function mi(e20, t10, n10) { + var r10 = gi(e20); + if (!r10.getElementById(t10)) { + var o10 = ji("style"); + o10.id = t10, o10.textContent = n10, bi(r10, o10); + } + } + function gi(e20) { + if (!e20) + return document; + var t10 = e20.getRootNode ? e20.getRootNode() : e20.ownerDocument; + return t10 && t10.host ? t10 : e20.ownerDocument; + } + function yi(e20) { + var t10 = ji("style"); + return t10.textContent = "/* empty */", bi(gi(e20), t10), t10.sheet; + } + function bi(e20, t10) { + return pi(e20.head || e20, t10), t10.sheet; + } + function ki(e20, t10, n10) { + e20.insertBefore(t10, n10 || null); + } + function wi(e20) { + e20.parentNode && e20.parentNode.removeChild(e20); + } + function xi(e20, t10) { + for (var n10 = 0; n10 < e20.length; n10 += 1) + e20[n10] && e20[n10].d(t10); + } + function ji(e20) { + return document.createElement(e20); + } + function Si(e20) { + return document.createElementNS("http://www.w3.org/2000/svg", e20); + } + function Ci(e20) { + return document.createTextNode(e20); + } + function $i() { + return Ci(" "); + } + function _i() { + return Ci(""); + } + function Oi(e20, t10, n10, r10) { + return e20.addEventListener(t10, n10, r10), function() { + return e20.removeEventListener(t10, n10, r10); + }; + } + function Mi(e20) { + return function(t10) { + return t10.preventDefault(), e20.call(this, t10); + }; + } + function Ei(e20) { + return function(t10) { + return t10.stopPropagation(), e20.call(this, t10); + }; + } + function Ai(e20, t10, n10) { + null == n10 ? e20.removeAttribute(t10) : e20.getAttribute(t10) !== n10 && e20.setAttribute(t10, n10); + } + var Pi = ["width", "height"]; + function Ti(e20, t10) { + var n10 = Object.getOwnPropertyDescriptors(e20.__proto__); + for (var r10 in t10) + null == t10[r10] ? e20.removeAttribute(r10) : "style" === r10 ? e20.style.cssText = t10[r10] : "__value" === r10 ? e20.value = e20[r10] = t10[r10] : n10[r10] && n10[r10].set && -1 === Pi.indexOf(r10) ? e20[r10] = t10[r10] : Ai(e20, r10, t10[r10]); + } + function Ri(e20, t10) { + for (var n10 in t10) + Ai(e20, n10, t10[n10]); + } + function Ni(e20, t10) { + t10 = "" + t10, e20.data !== t10 && (e20.data = t10); + } + function Ii(e20, t10) { + e20.value = null == t10 ? "" : t10; + } + function Di(e20, t10, n10, r10) { + null == n10 ? e20.style.removeProperty(t10) : e20.style.setProperty(t10, n10, r10 ? "important" : ""); + } + function qi(e20, t10, n10) { + for (var r10 = 0; r10 < e20.options.length; r10 += 1) { + var o10 = e20.options[r10]; + if (o10.__value === t10) + return void (o10.selected = true); + } + n10 && void 0 === t10 || (e20.selectedIndex = -1); + } + function zi(e20, t10, n10) { + e20.classList.toggle(t10, !!n10); + } + function Bi(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r10 = n10.bubbles, o10 = void 0 !== r10 && r10, i10 = n10.cancelable; + return new CustomEvent(e20, { detail: t10, bubbles: o10, cancelable: void 0 !== i10 && i10 }); + } + function Li(e20, t10) { + return new e20(t10); + } + var Fi; + var Vi = /* @__PURE__ */ new Map(); + var Hi = 0; + function Wi(e20, t10, n10, r10, o10, i10, a10) { + for (var s10 = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 0, c10 = 16.666 / r10, l10 = "{\n", u10 = 0; u10 <= 1; u10 += c10) { + var f10 = t10 + (n10 - t10) * i10(u10); + l10 += 100 * u10 + "%{".concat(a10(f10, 1 - f10), "}\n"); + } + var d10 = l10 + "100% {".concat(a10(n10, 1 - n10), "}\n}"), h10 = "__svelte_".concat(function(e21) { + for (var t11 = 5381, n11 = e21.length; n11--; ) + t11 = (t11 << 5) - t11 ^ e21.charCodeAt(n11); + return t11 >>> 0; + }(d10), "_").concat(s10), v10 = gi(e20), p10 = Vi.get(v10) || function(e21, t11) { + var n11 = { stylesheet: yi(t11), rules: {} }; + return Vi.set(e21, n11), n11; + }(v10, e20), m10 = p10.stylesheet, g10 = p10.rules; + g10[h10] || (g10[h10] = true, m10.insertRule("@keyframes ".concat(h10, " ").concat(d10), m10.cssRules.length)); + var y10 = e20.style.animation || ""; + return e20.style.animation = "".concat(y10 ? "".concat(y10, ", ") : "").concat(h10, " ").concat(r10, "ms linear ").concat(o10, "ms 1 both"), Hi += 1, h10; + } + function Ui(e20, t10) { + var n10 = (e20.style.animation || "").split(", "), r10 = n10.filter(t10 ? function(e21) { + return e21.indexOf(t10) < 0; + } : function(e21) { + return -1 === e21.indexOf("__svelte"); + }), o10 = n10.length - r10.length; + o10 && (e20.style.animation = r10.join(", "), (Hi -= o10) || fi(function() { + Hi || (Vi.forEach(function(e21) { + var t11 = e21.stylesheet.ownerNode; + t11 && wi(t11); + }), Vi.clear()); + })); + } + function Ji(e20) { + Fi = e20; + } + function Ki() { + if (!Fi) + throw new Error("Function called outside component initialization"); + return Fi; + } + function Gi(e20) { + Ki().$$.on_mount.push(e20); + } + function Qi(e20) { + Ki().$$.on_destroy.push(e20); + } + function Yi() { + var e20 = Ki(); + return function(t10, n10) { + var r10 = (arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}).cancelable, o10 = void 0 !== r10 && r10, i10 = e20.$$.callbacks[t10]; + if (i10) { + var a10 = Bi(t10, n10, { cancelable: o10 }); + return i10.slice().forEach(function(t11) { + t11.call(e20, a10); + }), !a10.defaultPrevented; + } + return true; + }; + } + function Xi(e20, t10) { + return Ki().$$.context.set(e20, t10), t10; + } + function Zi(e20) { + return Ki().$$.context.get(e20); + } + function ea(e20, t10) { + var n10 = this, r10 = e20.$$.callbacks[t10.type]; + r10 && r10.slice().forEach(function(e21) { + return e21.call(n10, t10); + }); + } + var ta = []; + var na = []; + var ra = []; + var oa = []; + var ia = Promise.resolve(); + var aa = false; + function sa() { + aa || (aa = true, ia.then(va)); + } + function ca() { + return sa(), ia; + } + function la(e20) { + ra.push(e20); + } + function ua(e20) { + oa.push(e20); + } + var fa; + var da = /* @__PURE__ */ new Set(); + var ha = 0; + function va() { + if (0 === ha) { + var e20 = Fi; + do { + try { + for (; ha < ta.length; ) { + var t10 = ta[ha]; + ha++, Ji(t10), pa(t10.$$); + } + } catch (e21) { + throw ta.length = 0, ha = 0, e21; + } + for (Ji(null), ta.length = 0, ha = 0; na.length; ) + na.pop()(); + for (var n10 = 0; n10 < ra.length; n10 += 1) { + var r10 = ra[n10]; + da.has(r10) || (da.add(r10), r10()); + } + ra.length = 0; + } while (ta.length); + for (; oa.length; ) + oa.pop()(); + aa = false, da.clear(), Ji(e20); + } + } + function pa(e20) { + if (null !== e20.fragment) { + e20.update(), Qo(e20.before_update); + var t10 = e20.dirty; + e20.dirty = [-1], e20.fragment && e20.fragment.p(e20.ctx, t10), e20.after_update.forEach(la); + } + } + function ma(e20, t10, n10) { + e20.dispatchEvent(Bi("".concat(t10 ? "intro" : "outro").concat(n10))); + } + var ga; + var ya = /* @__PURE__ */ new Set(); + function ba() { + ga = { r: 0, c: [], p: ga }; + } + function ka() { + ga.r || Qo(ga.c), ga = ga.p; + } + function wa(e20, t10) { + e20 && e20.i && (ya.delete(e20), e20.i(t10)); + } + function xa(e20, t10, n10, r10) { + if (e20 && e20.o) { + if (ya.has(e20)) + return; + ya.add(e20), ga.c.push(function() { + ya.delete(e20), r10 && (n10 && e20.d(1), r10()); + }), e20.o(t10); + } else + r10 && r10(); + } + var ja = { duration: 0 }; + function Sa(e20, t10, n10, r10) { + var o10, i10 = t10(e20, n10, { direction: "both" }), a10 = r10 ? 0 : 1, s10 = null, c10 = null, l10 = null; + function u10() { + l10 && Ui(e20, l10); + } + function f10(e21, t11) { + var n11 = e21.b - a10; + return t11 *= Math.abs(n11), { a: a10, b: e21.b, d: n11, duration: t11, start: e21.start, end: e21.start + t11, group: e21.group }; + } + function d10(t11) { + var n11, r11 = i10 || ja, d11 = r11.delay, h10 = void 0 === d11 ? 0 : d11, v10 = r11.duration, p10 = void 0 === v10 ? 300 : v10, m10 = r11.easing, g10 = void 0 === m10 ? Uo : m10, y10 = r11.tick, b10 = void 0 === y10 ? Wo : y10, k10 = r11.css, w10 = { start: ui() + h10, b: t11 }; + t11 || (w10.group = ga, ga.r += 1), "inert" in e20 && (t11 ? void 0 !== o10 && (e20.inert = o10) : (o10 = e20.inert, e20.inert = true)), s10 || c10 ? c10 = w10 : (k10 && (u10(), l10 = Wi(e20, a10, t11, p10, h10, g10, k10)), t11 && b10(0, 1), s10 = f10(w10, p10), la(function() { + return ma(e20, t11, "start"); + }), n11 = function(t12) { + if (c10 && t12 > c10.start && (s10 = f10(c10, p10), c10 = null, ma(e20, s10.b, "start"), k10 && (u10(), l10 = Wi(e20, a10, s10.b, s10.duration, 0, g10, i10.css))), s10) { + if (t12 >= s10.end) + b10(a10 = s10.b, 1 - a10), ma(e20, s10.b, "end"), c10 || (s10.b ? u10() : --s10.group.r || Qo(s10.group.c)), s10 = null; + else if (t12 >= s10.start) { + var n12 = t12 - s10.start; + a10 = s10.a + s10.d * g10(n12 / s10.duration), b10(a10, 1 - a10); + } + } + return !(!s10 && !c10); + }, 0 === di.size && fi(hi), new Promise(function(e21) { + di.add({ c: n11, f: e21 }); + })); + } + return { run: function(e21) { + Yo(i10) ? (fa || (fa = Promise.resolve()).then(function() { + fa = null; + }), fa).then(function() { + i10 = i10({ direction: e21 ? "in" : "out" }), d10(e21); + }) : d10(e21); + }, end: function() { + u10(), s10 = c10 = null; + } }; + } + function Ca(e20) { + return void 0 !== (null == e20 ? void 0 : e20.length) ? e20 : Array.from(e20); + } + function $a(e20, t10) { + e20.d(1), t10.delete(e20.key); + } + function _a(e20, t10) { + xa(e20, 1, 1, function() { + t10.delete(e20.key); + }); + } + function Oa(e20, t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10) { + for (var d10 = e20.length, h10 = i10.length, v10 = d10, p10 = {}; v10--; ) + p10[e20[v10].key] = v10; + var m10 = [], g10 = /* @__PURE__ */ new Map(), y10 = /* @__PURE__ */ new Map(), b10 = []; + v10 = h10; + for (var k10 = function() { + var e21 = f10(o10, i10, v10), s11 = n10(e21), c11 = a10.get(s11); + c11 ? r10 && b10.push(function() { + return c11.p(e21, t10); + }) : (c11 = l10(s11, e21)).c(), g10.set(s11, m10[v10] = c11), s11 in p10 && y10.set(s11, Math.abs(v10 - p10[s11])); + }; v10--; ) + k10(); + var w10 = /* @__PURE__ */ new Set(), x10 = /* @__PURE__ */ new Set(); + function j10(e21) { + wa(e21, 1), e21.m(s10, u10), a10.set(e21.key, e21), u10 = e21.first, h10--; + } + for (; d10 && h10; ) { + var S10 = m10[h10 - 1], C10 = e20[d10 - 1], $10 = S10.key, _10 = C10.key; + S10 === C10 ? (u10 = S10.first, d10--, h10--) : g10.has(_10) ? !a10.has($10) || w10.has($10) ? j10(S10) : x10.has(_10) ? d10-- : y10.get($10) > y10.get(_10) ? (x10.add($10), j10(S10)) : (w10.add(_10), d10--) : (c10(C10, a10), d10--); + } + for (; d10--; ) { + var O10 = e20[d10]; + g10.has(O10.key) || c10(O10, a10); + } + for (; h10; ) + j10(m10[h10 - 1]); + return Qo(b10), m10; + } + function Ma(e20, t10) { + for (var n10 = {}, r10 = {}, o10 = { $$scope: 1 }, i10 = e20.length; i10--; ) { + var a10 = e20[i10], s10 = t10[i10]; + if (s10) { + for (var c10 in a10) + c10 in s10 || (r10[c10] = 1); + for (var l10 in s10) + o10[l10] || (n10[l10] = s10[l10], o10[l10] = 1); + e20[i10] = s10; + } else + for (var u10 in a10) + o10[u10] = 1; + } + for (var f10 in r10) + f10 in n10 || (n10[f10] = void 0); + return n10; + } + function Ea(e20) { + return "object" === Ho(e20) && null !== e20 ? e20 : {}; + } + function Aa(e20, t10, n10) { + var r10 = e20.$$.props[t10]; + void 0 !== r10 && (e20.$$.bound[r10] = n10, n10(e20.$$.ctx[r10])); + } + function Pa(e20) { + e20 && e20.c(); + } + function Ta(e20, t10, n10) { + var r10 = e20.$$, o10 = r10.fragment, i10 = r10.after_update; + o10 && o10.m(t10, n10), la(function() { + var t11, n11 = e20.$$.on_mount.map(Ko).filter(Yo); + e20.$$.on_destroy ? (t11 = e20.$$.on_destroy).push.apply(t11, Bo(n11)) : Qo(n11); + e20.$$.on_mount = []; + }), i10.forEach(la); + } + function Ra(e20, t10) { + var n10, r10, o10, i10 = e20.$$; + null !== i10.fragment && (n10 = i10.after_update, r10 = [], o10 = [], ra.forEach(function(e21) { + return -1 === n10.indexOf(e21) ? r10.push(e21) : o10.push(e21); + }), o10.forEach(function(e21) { + return e21(); + }), ra = r10, Qo(i10.on_destroy), i10.fragment && i10.fragment.d(t10), i10.on_destroy = i10.fragment = null, i10.ctx = []); + } + function Na(e20, t10, n10, r10, o10, i10) { + var a10 = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : null, s10 = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : [-1], c10 = Fi; + Ji(e20); + var l10 = e20.$$ = { fragment: null, ctx: [], props: i10, update: Wo, not_equal: o10, bound: Go(), on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], context: new Map(t10.context || (c10 ? c10.$$.context : [])), callbacks: Go(), dirty: s10, skip_bound: false, root: t10.target || c10.$$.root }; + a10 && a10(l10.root); + var u10 = false; + if (l10.ctx = n10 ? n10(e20, t10.props || {}, function(t11, n11) { + var r11 = !(arguments.length <= 2) && arguments.length - 2 ? arguments.length <= 2 ? void 0 : arguments[2] : n11; + return l10.ctx && o10(l10.ctx[t11], l10.ctx[t11] = r11) && (!l10.skip_bound && l10.bound[t11] && l10.bound[t11](r11), u10 && function(e21, t12) { + -1 === e21.$$.dirty[0] && (ta.push(e21), sa(), e21.$$.dirty.fill(0)), e21.$$.dirty[t12 / 31 | 0] |= 1 << t12 % 31; + }(e20, t11)), n11; + }) : [], l10.update(), u10 = true, Qo(l10.before_update), l10.fragment = !!r10 && r10(l10.ctx), t10.target) { + if (t10.hydrate) { + var f10 = function(e21) { + return Array.from(e21.childNodes); + }(t10.target); + l10.fragment && l10.fragment.l(f10), f10.forEach(wi); + } else + l10.fragment && l10.fragment.c(); + t10.intro && wa(e20.$$.fragment), Ta(e20, t10.target, t10.anchor), va(); + } + Ji(c10); + } + var Ia = function() { + function e20() { + No(this, e20), qo(this, "$$", void 0), qo(this, "$$set", void 0); + } + return Do(e20, [{ key: "$destroy", value: function() { + Ra(this, 1), this.$destroy = Wo; + } }, { key: "$on", value: function(e21, t10) { + if (!Yo(t10)) + return Wo; + var n10 = this.$$.callbacks[e21] || (this.$$.callbacks[e21] = []); + return n10.push(t10), function() { + var e23 = n10.indexOf(t10); + -1 !== e23 && n10.splice(e23, 1); + }; + } }, { key: "$set", value: function(e21) { + var t10; + this.$$set && (t10 = e21, 0 !== Object.keys(t10).length) && (this.$$.skip_bound = true, this.$$set(e21), this.$$.skip_bound = false); + } }]), e20; + }(); + function Da(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function(e21) { + var t11 = function(e23) { + try { + if ("undefined" != typeof window && void 0 !== window.localStorage) + return window.localStorage[e23]; + } catch (e24) { + } + }("debug"); + return null != t11 && t11.endsWith("*") ? e21.startsWith(t11.slice(0, -1)) : e21 === t11; + }(e20); + if (!t10) + return qa; + var n10 = function(e21) { + for (var t11 = 0, n11 = 0; n11 < e21.length; n11++) + t11 = (t11 << 5) - t11 + e21.charCodeAt(n11), t11 |= 0; + return za[Math.abs(t11) % za.length]; + }(e20); + return function() { + for (var t11, r10 = arguments.length, o10 = new Array(r10), i10 = 0; i10 < r10; i10++) + o10[i10] = arguments[i10]; + (t11 = console).log.apply(t11, ["%c".concat(e20), "color:".concat(n10)].concat(o10)); + }; + } + function qa() { + } + "undefined" != typeof window && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add("4"); + var za = ["#0000CC", "#0099FF", "#009400", "#8dd200", "#CCCC00", "#CC9933", "#ae04e7", "#ff35d7", "#FF3333", "#FF6600", "#FF9933", "#FFCC33"]; + function Ba(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n10 = t10.delay, r10 = void 0 === n10 ? 0 : n10, o10 = t10.duration, i10 = void 0 === o10 ? 400 : o10, a10 = t10.easing, s10 = void 0 === a10 ? Uo : a10, c10 = +getComputedStyle(e20).opacity; + return { delay: r10, duration: i10, easing: s10, css: function(e21) { + return "opacity: ".concat(e21 * c10); + } }; + } + var La = vi.window; + function Fa(e20) { + mi(e20, "svelte-n7cvum", ".svelte-n7cvum{box-sizing:border-box}.bg.svelte-n7cvum{position:fixed;z-index:1000;top:0;left:0;display:flex;flex-direction:column;justify-content:center;width:100vw;height:100vh;background:rgba(0, 0, 0, 0.66)}@supports (-webkit-touch-callout: none){}.wrap.svelte-n7cvum{position:relative;margin:2rem;max-height:100%}.window.svelte-n7cvum{position:relative;width:40rem;max-width:100%;max-height:100%;margin:2rem auto;color:black;border-radius:0.5rem;background:white}.content.svelte-n7cvum{position:relative;padding:1rem;max-height:calc(100vh - 4rem);overflow:auto}.close.svelte-n7cvum{display:block;box-sizing:border-box;position:absolute;z-index:1000;top:1rem;right:1rem;margin:0;padding:0;width:1.5rem;height:1.5rem;border:0;color:black;border-radius:1.5rem;background:white;box-shadow:0 0 0 1px black;transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close.svelte-n7cvum:before,.close.svelte-n7cvum:after{content:'';display:block;box-sizing:border-box;position:absolute;top:50%;width:1rem;height:1px;background:black;transform-origin:center;transition:height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close.svelte-n7cvum:before{-webkit-transform:translate(0, -50%) rotate(45deg);-moz-transform:translate(0, -50%) rotate(45deg);transform:translate(0, -50%) rotate(45deg);left:0.25rem}.close.svelte-n7cvum:after{-webkit-transform:translate(0, -50%) rotate(-45deg);-moz-transform:translate(0, -50%) rotate(-45deg);transform:translate(0, -50%) rotate(-45deg);left:0.25rem}.close.svelte-n7cvum:hover{background:black}.close.svelte-n7cvum:hover:before,.close.svelte-n7cvum:hover:after{height:2px;background:white}.close.svelte-n7cvum:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close.svelte-n7cvum:active{transform:scale(0.9)}.close.svelte-n7cvum:hover,.close.svelte-n7cvum:focus,.close.svelte-n7cvum:active{outline:none}"); + } + function Va(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10 = e20[1].closeButton && Ha(e20), k10 = e20[2]; + return k10 && (a10 = Li(k10, {})), { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = ji("div"), b10 && b10.c(), o10 = $i(), i10 = ji("div"), a10 && Pa(a10.$$.fragment), Ai(i10, "class", s10 = si(e20[1].classContent) + " svelte-n7cvum"), Ai(i10, "style", e20[9]), zi(i10, "content", !e20[0]), Ai(r10, "class", c10 = si(e20[1].classWindow) + " svelte-n7cvum"), Ai(r10, "role", "dialog"), Ai(r10, "aria-modal", "true"), Ai(r10, "aria-label", l10 = e20[1].ariaLabelledBy ? null : e20[1].ariaLabel || null), Ai(r10, "aria-labelledby", u10 = e20[1].ariaLabelledBy || null), Ai(r10, "style", e20[8]), zi(r10, "window", !e20[0]), Ai(n10, "class", d10 = si(e20[1].classWindowWrap) + " svelte-n7cvum"), Ai(n10, "style", e20[7]), zi(n10, "wrap", !e20[0]), Ai(t10, "aria-hidden", "true"), Ai(t10, "id", h10 = e20[1].id), Ai(t10, "class", v10 = si(e20[1].classBg) + " svelte-n7cvum"), Ai(t10, "style", e20[6]), zi(t10, "bg", !e20[0]); + }, m: function(s11, c11) { + ki(s11, t10, c11), pi(t10, n10), pi(n10, r10), b10 && b10.m(r10, null), pi(r10, o10), pi(r10, i10), a10 && Ta(a10, i10, null), e20[50](r10), e20[51](n10), e20[52](t10), m10 = true, g10 || (y10 = [Oi(r10, "introstart", function() { + Yo(e20[13]) && e20[13].apply(this, arguments); + }), Oi(r10, "outrostart", function() { + Yo(e20[14]) && e20[14].apply(this, arguments); + }), Oi(r10, "introend", function() { + Yo(e20[15]) && e20[15].apply(this, arguments); + }), Oi(r10, "outroend", function() { + Yo(e20[16]) && e20[16].apply(this, arguments); + }), Oi(t10, "mousedown", e20[20]), Oi(t10, "mouseup", e20[21])], g10 = true); + }, p: function(f11, p11) { + if ((e20 = f11)[1].closeButton ? b10 ? (b10.p(e20, p11), 2 & p11[0] && wa(b10, 1)) : ((b10 = Ha(e20)).c(), wa(b10, 1), b10.m(r10, o10)) : b10 && (ba(), xa(b10, 1, 1, function() { + b10 = null; + }), ka()), 4 & p11[0] && k10 !== (k10 = e20[2])) { + if (a10) { + ba(); + var g11 = a10; + xa(g11.$$.fragment, 1, 0, function() { + Ra(g11, 1); + }), ka(); + } + k10 ? (Pa((a10 = Li(k10, {})).$$.fragment), wa(a10.$$.fragment, 1), Ta(a10, i10, null)) : a10 = null; + } + (!m10 || 2 & p11[0] && s10 !== (s10 = si(e20[1].classContent) + " svelte-n7cvum")) && Ai(i10, "class", s10), (!m10 || 512 & p11[0]) && Ai(i10, "style", e20[9]), (!m10 || 3 & p11[0]) && zi(i10, "content", !e20[0]), (!m10 || 2 & p11[0] && c10 !== (c10 = si(e20[1].classWindow) + " svelte-n7cvum")) && Ai(r10, "class", c10), (!m10 || 2 & p11[0] && l10 !== (l10 = e20[1].ariaLabelledBy ? null : e20[1].ariaLabel || null)) && Ai(r10, "aria-label", l10), (!m10 || 2 & p11[0] && u10 !== (u10 = e20[1].ariaLabelledBy || null)) && Ai(r10, "aria-labelledby", u10), (!m10 || 256 & p11[0]) && Ai(r10, "style", e20[8]), (!m10 || 3 & p11[0]) && zi(r10, "window", !e20[0]), (!m10 || 2 & p11[0] && d10 !== (d10 = si(e20[1].classWindowWrap) + " svelte-n7cvum")) && Ai(n10, "class", d10), (!m10 || 128 & p11[0]) && Ai(n10, "style", e20[7]), (!m10 || 3 & p11[0]) && zi(n10, "wrap", !e20[0]), (!m10 || 2 & p11[0] && h10 !== (h10 = e20[1].id)) && Ai(t10, "id", h10), (!m10 || 2 & p11[0] && v10 !== (v10 = si(e20[1].classBg) + " svelte-n7cvum")) && Ai(t10, "class", v10), (!m10 || 64 & p11[0]) && Ai(t10, "style", e20[6]), (!m10 || 3 & p11[0]) && zi(t10, "bg", !e20[0]); + }, i: function(n11) { + m10 || (wa(b10), a10 && wa(a10.$$.fragment, n11), n11 && la(function() { + m10 && (f10 || (f10 = Sa(r10, e20[12], e20[1].transitionWindowProps, true)), f10.run(1)); + }), n11 && la(function() { + m10 && (p10 || (p10 = Sa(t10, e20[11], e20[1].transitionBgProps, true)), p10.run(1)); + }), m10 = true); + }, o: function(n11) { + xa(b10), a10 && xa(a10.$$.fragment, n11), n11 && (f10 || (f10 = Sa(r10, e20[12], e20[1].transitionWindowProps, false)), f10.run(0)), n11 && (p10 || (p10 = Sa(t10, e20[11], e20[1].transitionBgProps, false)), p10.run(0)), m10 = false; + }, d: function(n11) { + n11 && wi(t10), b10 && b10.d(), a10 && Ra(a10), e20[50](null), n11 && f10 && f10.end(), e20[51](null), e20[52](null), n11 && p10 && p10.end(), g10 = false, Qo(y10); + } }; + } + function Ha(e20) { + var t10, n10, r10, o10, i10, a10 = [Ua, Wa], s10 = []; + function c10(e21, n11) { + return 2 & n11[0] && (t10 = null), null == t10 && (t10 = !!e21[17](e21[1].closeButton)), t10 ? 0 : 1; + } + return n10 = c10(e20, [-1, -1, -1]), r10 = s10[n10] = a10[n10](e20), { c: function() { + r10.c(), o10 = _i(); + }, m: function(e21, t11) { + s10[n10].m(e21, t11), ki(e21, o10, t11), i10 = true; + }, p: function(e21, t11) { + var i11 = n10; + (n10 = c10(e21, t11)) === i11 ? s10[n10].p(e21, t11) : (ba(), xa(s10[i11], 1, 1, function() { + s10[i11] = null; + }), ka(), (r10 = s10[n10]) ? r10.p(e21, t11) : (r10 = s10[n10] = a10[n10](e21)).c(), wa(r10, 1), r10.m(o10.parentNode, o10)); + }, i: function(e21) { + i10 || (wa(r10), i10 = true); + }, o: function(e21) { + xa(r10), i10 = false; + }, d: function(e21) { + e21 && wi(o10), s10[n10].d(e21); + } }; + } + function Wa(e20) { + var t10, n10, r10, o10; + return { c: function() { + Ai(t10 = ji("button"), "class", n10 = si(e20[1].classCloseButton) + " svelte-n7cvum"), Ai(t10, "aria-label", "Close modal"), Ai(t10, "style", e20[10]), Ai(t10, "type", "button"), zi(t10, "close", !e20[0]); + }, m: function(n11, i10) { + ki(n11, t10, i10), r10 || (o10 = Oi(t10, "click", e20[18]), r10 = true); + }, p: function(e21, r11) { + 2 & r11[0] && n10 !== (n10 = si(e21[1].classCloseButton) + " svelte-n7cvum") && Ai(t10, "class", n10), 1024 & r11[0] && Ai(t10, "style", e21[10]), 3 & r11[0] && zi(t10, "close", !e21[0]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), r10 = false, o10(); + } }; + } + function Ua(e20) { + var t10, n10, r10, o10 = e20[1].closeButton; + function i10(e21, t11) { + return { props: { onClose: e21[18] } }; + } + return o10 && (t10 = Li(o10, i10(e20))), { c: function() { + t10 && Pa(t10.$$.fragment), n10 = _i(); + }, m: function(e21, o11) { + t10 && Ta(t10, e21, o11), ki(e21, n10, o11), r10 = true; + }, p: function(e21, r11) { + if (2 & r11[0] && o10 !== (o10 = e21[1].closeButton)) { + if (t10) { + ba(); + var a10 = t10; + xa(a10.$$.fragment, 1, 0, function() { + Ra(a10, 1); + }), ka(); + } + o10 ? (Pa((t10 = Li(o10, i10(e21))).$$.fragment), wa(t10.$$.fragment, 1), Ta(t10, n10.parentNode, n10)) : t10 = null; + } + }, i: function(e21) { + r10 || (t10 && wa(t10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + t10 && xa(t10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(n10), t10 && Ra(t10, e21); + } }; + } + function Ja(e20) { + var t10, n10, r10, o10, i10 = e20[2] && Va(e20), a10 = e20[49].default, s10 = ei(a10, e20, e20[48], null); + return { c: function() { + i10 && i10.c(), t10 = $i(), s10 && s10.c(); + }, m: function(a11, c10) { + i10 && i10.m(a11, c10), ki(a11, t10, c10), s10 && s10.m(a11, c10), n10 = true, r10 || (o10 = Oi(La, "keydown", e20[19]), r10 = true); + }, p: function(e21, r11) { + e21[2] ? i10 ? (i10.p(e21, r11), 4 & r11[0] && wa(i10, 1)) : ((i10 = Va(e21)).c(), wa(i10, 1), i10.m(t10.parentNode, t10)) : i10 && (ba(), xa(i10, 1, 1, function() { + i10 = null; + }), ka()), s10 && s10.p && (!n10 || 131072 & r11[1]) && ri(s10, a10, e21, e21[48], n10 ? ni(a10, e21[48], r11, null) : oi(e21[48]), null); + }, i: function(e21) { + n10 || (wa(i10), wa(s10, e21), n10 = true); + }, o: function(e21) { + xa(i10), xa(s10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), i10 && i10.d(e21), s10 && s10.d(e21), r10 = false, o10(); + } }; + } + function Ka(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return function(n10) { + return new e20(Ro(Ro({}, n10), {}, { props: Ro(Ro({}, t10), n10.props) })); + }; + } + function Ga(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10 = t10.$$slots, b10 = void 0 === y10 ? {} : y10, k10 = t10.$$scope, w10 = Yi(), x10 = Xi, j10 = t10.isTabbable, S10 = void 0 === j10 ? function(e21) { + return e21.tabIndex >= 0 && !e21.hidden && !e21.disabled && "none" !== e21.style.display && "hidden" !== e21.type && Boolean(e21.offsetWidth || e21.offsetHeight || e21.getClientRects().length); + } : j10, C10 = t10.show, $10 = void 0 === C10 ? null : C10, _10 = t10.id, O10 = void 0 === _10 ? null : _10, M10 = t10.key, E10 = void 0 === M10 ? "simple-modal" : M10, A10 = t10.ariaLabel, P10 = void 0 === A10 ? null : A10, T8 = t10.ariaLabelledBy, R8 = void 0 === T8 ? null : T8, N8 = t10.closeButton, I10 = void 0 === N8 || N8, D10 = t10.closeOnEsc, q10 = void 0 === D10 || D10, z10 = t10.closeOnOuterClick, B10 = void 0 === z10 || z10, L10 = t10.styleBg, F10 = void 0 === L10 ? {} : L10, V10 = t10.styleWindowWrap, H10 = void 0 === V10 ? {} : V10, W10 = t10.styleWindow, U10 = void 0 === W10 ? {} : W10, J10 = t10.styleContent, K10 = void 0 === J10 ? {} : J10, G10 = t10.styleCloseButton, Q10 = void 0 === G10 ? {} : G10, Y10 = t10.classBg, X10 = void 0 === Y10 ? null : Y10, Z10 = t10.classWindowWrap, ee2 = void 0 === Z10 ? null : Z10, te2 = t10.classWindow, ne2 = void 0 === te2 ? null : te2, re2 = t10.classContent, oe2 = void 0 === re2 ? null : re2, ie2 = t10.classCloseButton, ae2 = void 0 === ie2 ? null : ie2, se2 = t10.unstyled, ce2 = void 0 !== se2 && se2, le2 = t10.setContext, ue2 = void 0 === le2 ? x10 : le2, fe2 = t10.transitionBg, de2 = void 0 === fe2 ? Ba : fe2, he2 = t10.transitionBgProps, ve2 = void 0 === he2 ? { duration: 250 } : he2, pe2 = t10.transitionWindow, me2 = void 0 === pe2 ? de2 : pe2, ge2 = t10.transitionWindowProps, ye2 = void 0 === ge2 ? ve2 : ge2, be2 = t10.disableFocusTrap, ke2 = void 0 !== be2 && be2, we2 = { id: O10, ariaLabel: P10, ariaLabelledBy: R8, closeButton: I10, closeOnEsc: q10, closeOnOuterClick: B10, styleBg: F10, styleWindowWrap: H10, styleWindow: U10, styleContent: K10, styleCloseButton: Q10, classBg: X10, classWindowWrap: ee2, classWindow: ne2, classContent: oe2, classCloseButton: ae2, transitionBg: de2, transitionBgProps: ve2, transitionWindow: me2, transitionWindowProps: ye2, disableFocusTrap: ke2, isTabbable: S10, unstyled: ce2 }, xe2 = Ro({}, we2), je2 = null, Se2 = function(e21) { + return e21 ? Object.keys(e21).reduce(function(t11, n11) { + return "".concat(t11, "; ").concat(function(e23) { + return e23.replace(/([a-zA-Z])(?=[A-Z])/g, "$1-").toLowerCase(); + }(n11), ": ").concat(e21[n11]); + }, "") : ""; + }, Ce2 = function(e21) { + return !!(e21 && e21.constructor && e21.call && e21.apply); + }, $e2 = function() { + }, _e2 = $e2, Oe2 = $e2, Me2 = $e2, Ee2 = $e2, Ae2 = function(e21) { + var t11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; + n10(2, je2 = Ka(e21, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {})), n10(1, xe2 = Ro(Ro({}, we2), t11)), n10(6, s10 = Se2(Object.assign({}, { width: window.innerWidth, height: window.innerHeight }, xe2.styleBg))), n10(7, c10 = Se2(xe2.styleWindowWrap)), n10(8, l10 = Se2(xe2.styleWindow)), n10(9, u10 = Se2(xe2.styleContent)), n10(10, f10 = Se2(xe2.styleCloseButton)), n10(11, d10 = xe2.transitionBg), n10(12, h10 = xe2.transitionWindow), Te2(), n10(13, _e2 = function(e23) { + r11.onOpen && r11.onOpen(e23), w10("open"), w10("opening"); + }), n10(14, Oe2 = function(e23) { + r11.onClose && r11.onClose(e23), w10("close"), w10("closing"); + }), n10(15, Me2 = function(e23) { + r11.onOpened && r11.onOpened(e23), w10("opened"); + }), n10(16, Ee2 = function(e23) { + r11.onClosed && r11.onClosed(e23), w10("closed"); + }); + }, Pe2 = function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + je2 && (n10(14, Oe2 = e21.onClose || Oe2), n10(16, Ee2 = e21.onClosed || Ee2), n10(2, je2 = null), Re2()); + }, Te2 = function() { + a10 = window.scrollY, v10 = document.body.style.position, p10 = document.body.style.overflow, m10 = document.body.style.width, document.body.style.position = "fixed", document.body.style.top = "-".concat(a10, "px"), document.body.style.overflow = "hidden", document.body.style.width = "100%"; + }, Re2 = function() { + document.body.style.position = v10 || "", document.body.style.top = "", document.body.style.overflow = p10 || "", document.body.style.width = m10 || "", window.scrollTo({ top: a10, left: 0, behavior: "instant" }); + }; + ue2(E10, { open: Ae2, close: Pe2 }); + var Ne2 = false; + return Qi(function() { + Ne2 && Pe2(); + }), Gi(function() { + n10(47, Ne2 = true); + }), e20.$$set = function(e21) { + "isTabbable" in e21 && n10(22, S10 = e21.isTabbable), "show" in e21 && n10(23, $10 = e21.show), "id" in e21 && n10(24, O10 = e21.id), "key" in e21 && n10(25, E10 = e21.key), "ariaLabel" in e21 && n10(26, P10 = e21.ariaLabel), "ariaLabelledBy" in e21 && n10(27, R8 = e21.ariaLabelledBy), "closeButton" in e21 && n10(28, I10 = e21.closeButton), "closeOnEsc" in e21 && n10(29, q10 = e21.closeOnEsc), "closeOnOuterClick" in e21 && n10(30, B10 = e21.closeOnOuterClick), "styleBg" in e21 && n10(31, F10 = e21.styleBg), "styleWindowWrap" in e21 && n10(32, H10 = e21.styleWindowWrap), "styleWindow" in e21 && n10(33, U10 = e21.styleWindow), "styleContent" in e21 && n10(34, K10 = e21.styleContent), "styleCloseButton" in e21 && n10(35, Q10 = e21.styleCloseButton), "classBg" in e21 && n10(36, X10 = e21.classBg), "classWindowWrap" in e21 && n10(37, ee2 = e21.classWindowWrap), "classWindow" in e21 && n10(38, ne2 = e21.classWindow), "classContent" in e21 && n10(39, oe2 = e21.classContent), "classCloseButton" in e21 && n10(40, ae2 = e21.classCloseButton), "unstyled" in e21 && n10(0, ce2 = e21.unstyled), "setContext" in e21 && n10(41, ue2 = e21.setContext), "transitionBg" in e21 && n10(42, de2 = e21.transitionBg), "transitionBgProps" in e21 && n10(43, ve2 = e21.transitionBgProps), "transitionWindow" in e21 && n10(44, me2 = e21.transitionWindow), "transitionWindowProps" in e21 && n10(45, ye2 = e21.transitionWindowProps), "disableFocusTrap" in e21 && n10(46, ke2 = e21.disableFocusTrap), "$$scope" in e21 && n10(48, k10 = e21.$$scope); + }, e20.$$.update = function() { + 8388608 & e20.$$.dirty[0] | 65536 & e20.$$.dirty[1] && Ne2 && (Ce2($10) ? Ae2($10) : Pe2()); + }, [ce2, xe2, je2, r10, o10, i10, s10, c10, l10, u10, f10, d10, h10, _e2, Oe2, Me2, Ee2, Ce2, Pe2, function(e21) { + if (xe2.closeOnEsc && je2 && "Escape" === e21.key && (e21.preventDefault(), Pe2()), je2 && "Tab" === e21.key && !xe2.disableFocusTrap) { + var t11 = i10.querySelectorAll("*"), n11 = Array.from(t11).filter(xe2.isTabbable).sort(function(e23, t12) { + return e23.tabIndex - t12.tabIndex; + }), r11 = n11.indexOf(document.activeElement); + -1 === r11 && e21.shiftKey && (r11 = 0), r11 += n11.length + (e21.shiftKey ? -1 : 1), n11[r11 %= n11.length].focus(), e21.preventDefault(); + } + }, function(e21) { + !xe2.closeOnOuterClick || e21.target !== r10 && e21.target !== o10 || (g10 = e21.target); + }, function(e21) { + xe2.closeOnOuterClick && e21.target === g10 && (e21.preventDefault(), Pe2()); + }, S10, $10, O10, E10, P10, R8, I10, q10, B10, F10, H10, U10, K10, Q10, X10, ee2, ne2, oe2, ae2, ue2, de2, ve2, me2, ye2, ke2, Ne2, k10, b10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(5, i10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(4, o10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(3, r10 = e21); + }); + }]; + } + var Qa; + var Ya; + var Xa; + var Za; + var es; + var ts; + var ns; + var rs = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, Ga, Ja, Xo, { isTabbable: 22, show: 23, id: 24, key: 25, ariaLabel: 26, ariaLabelledBy: 27, closeButton: 28, closeOnEsc: 29, closeOnOuterClick: 30, styleBg: 31, styleWindowWrap: 32, styleWindow: 33, styleContent: 34, styleCloseButton: 35, classBg: 36, classWindowWrap: 37, classWindow: 38, classContent: 39, classCloseButton: 40, unstyled: 0, setContext: 41, transitionBg: 42, transitionBgProps: 43, transitionWindow: 44, transitionWindowProps: 45, disableFocusTrap: 46 }, Fa, [-1, -1, -1]), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + !function(e20) { + e20.text = "text", e20.tree = "tree", e20.table = "table"; + }(Qa || (Qa = {})), function(e20) { + e20.after = "after", e20.inside = "inside", e20.key = "key", e20.value = "value", e20.multi = "multi", e20.text = "text"; + }(Ya || (Ya = {})), function(e20) { + e20.after = "after", e20.key = "key", e20.value = "value", e20.inside = "inside"; + }(Xa || (Xa = {})), function(e20) { + e20.info = "info", e20.warning = "warning", e20.error = "error"; + }(Za || (Za = {})), function(e20) { + e20.key = "key", e20.value = "value"; + }(es || (es = {})), function(e20) { + e20.asc = "asc", e20.desc = "desc"; + }(ts || (ts = {})), function(e20) { + e20.no = "no", e20.self = "self", e20.nextInside = "nextInside"; + }(ns || (ns = {})); + var os = 50; + var is = 200; + var as = 400; + var ss = 1200; + var cs = 1e3; + var ls = 100; + var us = 100; + var fs = 2e4; + var ds = [{ start: 0, end: ls }]; + var hs = 104857600; + var vs = 1048576; + var ps = 10485760; + var ms = 10240; + var gs = { closeButton: false, classBg: "jse-modal-bg", classWindow: "jse-modal-window", classWindowWrap: "jse-modal-window-wrap", classContent: "jse-modal-container" }; + var ys = Ro(Ro({}, gs), {}, { classWindow: "jse-modal-window jse-modal-window-sort" }); + var bs = Ro(Ro({}, gs), {}, { classWindow: "jse-modal-window jse-modal-window-transform" }); + var ks = Ro(Ro({}, gs), {}, { classWindow: "jse-modal-window jse-modal-window-jsoneditor" }); + var ws = "Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value"; + var xs = "Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)"; + var js = "hover-insert-inside"; + var Ss = "hover-insert-after"; + var Cs = "hover-collection"; + var $s = "valid"; + var _s = "repairable"; + var Os = 336; + var Ms = 260; + var Es = qo(qo({}, ts.asc, "ascending"), ts.desc, "descending"); + var As = 0; + function Ps() { + return ++As; + } + function Ts(e20) { + return Array.isArray(e20); + } + function Rs(e20) { + return null !== e20 && "object" === Ho(e20) && e20.constructor === Object; + } + function Ns(e20) { + return !(!e20 || "object" !== Ho(e20)) && "add" === e20.op; + } + function Is(e20) { + return !(!e20 || "object" !== Ho(e20)) && "remove" === e20.op; + } + function Ds(e20) { + return !(!e20 || "object" !== Ho(e20)) && "replace" === e20.op; + } + function qs(e20) { + return !(!e20 || "object" !== Ho(e20)) && "copy" === e20.op; + } + function zs(e20) { + return !(!e20 || "object" !== Ho(e20)) && "move" === e20.op; + } + function Bs(e20, t10) { + return e20 === t10; + } + function Ls(e20) { + return e20.slice(0, e20.length - 1); + } + function Fs(e20) { + return "object" === Ho(e20) && null !== e20; + } + function Vs(e20) { + if (Ts(e20)) { + var t10 = e20.slice(); + return Object.getOwnPropertySymbols(e20).forEach(function(n11) { + t10[n11] = e20[n11]; + }), t10; + } + if (Rs(e20)) { + var n10 = Ro({}, e20); + return Object.getOwnPropertySymbols(e20).forEach(function(t11) { + n10[t11] = e20[t11]; + }), n10; + } + return e20; + } + function Hs(e20, t10, n10) { + if (e20[t10] === n10) + return e20; + var r10 = Vs(e20); + return r10[t10] = n10, r10; + } + function Ws(e20, t10) { + for (var n10 = e20, r10 = 0; r10 < t10.length; ) + n10 = Rs(n10) ? n10[t10[r10]] : Ts(n10) ? n10[parseInt(t10[r10])] : void 0, r10++; + return n10; + } + function Us(e20, t10, n10) { + var r10 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; + if (0 === t10.length) + return n10; + var o10 = t10[0], i10 = Us(e20 ? e20[o10] : void 0, t10.slice(1), n10, r10); + if (Rs(e20) || Ts(e20)) + return Hs(e20, o10, i10); + if (r10) { + var a10 = Js.test(o10) ? [] : {}; + return a10[o10] = i10, a10; + } + throw new Error("Path does not exist"); + } + var Js = /^\d+$/; + function Ks(e20, t10, n10) { + if (0 === t10.length) + return n10(e20); + if (!Fs(e20)) + throw new Error("Path doesn't exist"); + var r10 = t10[0]; + return Hs(e20, r10, Ks(e20[r10], t10.slice(1), n10)); + } + function Gs(e20, t10) { + if (0 === t10.length) + return e20; + if (!Fs(e20)) + throw new Error("Path does not exist"); + if (1 === t10.length) { + var n10 = t10[0]; + if (n10 in e20) { + var r10 = Vs(e20); + return Ts(r10) && r10.splice(parseInt(n10), 1), Rs(r10) && delete r10[n10], r10; + } + return e20; + } + var o10 = t10[0]; + return Hs(e20, o10, Gs(e20[o10], t10.slice(1))); + } + function Qs(e20, t10, n10) { + var r10 = t10.slice(0, t10.length - 1), o10 = t10[t10.length - 1]; + return Ks(e20, r10, function(e21) { + if (!Array.isArray(e21)) + throw new TypeError("Array expected at path " + JSON.stringify(r10)); + var t11 = Vs(e21); + return t11.splice(parseInt(o10), 0, n10), t11; + }); + } + function Ys(e20, t10) { + return void 0 !== e20 && (0 === t10.length || null !== e20 && Ys(e20[t10[0]], t10.slice(1))); + } + function Xs(e20) { + var t10 = e20.split("/"); + return t10.shift(), t10.map(function(e21) { + return e21.replace(/~1/g, "/").replace(/~0/g, "~"); + }); + } + function Zs(e20) { + return e20.map(ec).join(""); + } + function ec(e20) { + return "/" + String(e20).replace(/~/g, "~0").replace(/\//g, "~1"); + } + function tc(e20, t10) { + return e20 + ec(t10); + } + function nc(e20, t10) { + return e20.startsWith(t10) && (e20.length === t10.length || "/" === e20[t10.length]); + } + function rc(e20, t10, n10) { + for (var r10 = e20, o10 = 0; o10 < t10.length; o10++) { + fc(t10[o10]); + var i10 = t10[o10]; + if (n10 && n10.before) { + var a10 = n10.before(r10, i10); + if (void 0 !== a10) { + if (void 0 !== a10.document && (r10 = a10.document), void 0 !== a10.json) + throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"'); + void 0 !== a10.operation && (i10 = a10.operation); + } + } + var s10 = r10, c10 = dc(r10, i10.path); + if ("add" === i10.op) + r10 = ac(r10, c10, i10.value); + else if ("remove" === i10.op) + r10 = ic(r10, c10); + else if ("replace" === i10.op) + r10 = oc(r10, c10, i10.value); + else if ("copy" === i10.op) + r10 = sc(r10, c10, hc(i10.from)); + else if ("move" === i10.op) + r10 = cc(r10, c10, hc(i10.from)); + else { + if ("test" !== i10.op) + throw new Error("Unknown JSONPatch operation " + JSON.stringify(i10)); + lc(r10, c10, i10.value); + } + if (n10 && n10.after) { + var l10 = n10.after(r10, i10, s10); + void 0 !== l10 && (r10 = l10); + } + } + return r10; + } + function oc(e20, t10, n10) { + return Us(e20, t10, n10); + } + function ic(e20, t10) { + return Gs(e20, t10); + } + function ac(e20, t10, n10) { + return uc(e20, t10) ? Qs(e20, t10, n10) : Us(e20, t10, n10); + } + function sc(e20, t10, n10) { + var r10 = Ws(e20, n10); + return uc(e20, t10) ? Qs(e20, t10, r10) : Us(e20, t10, Ws(e20, n10)); + } + function cc(e20, t10, n10) { + var r10 = Ws(e20, n10), o10 = Gs(e20, n10); + return uc(o10, t10) ? Qs(o10, t10, r10) : Us(o10, t10, r10); + } + function lc(e20, t10, n10) { + if (void 0 === n10) + throw new Error('Test failed: no value provided (path: "'.concat(Zs(t10), '")')); + if (!Ys(e20, t10)) + throw new Error('Test failed: path not found (path: "'.concat(Zs(t10), '")')); + var r10, o10, i10 = Ws(e20, t10); + if (r10 = i10, o10 = n10, JSON.stringify(r10) !== JSON.stringify(o10)) + throw new Error('Test failed, value differs (path: "'.concat(Zs(t10), '")')); + } + function uc(e20, t10) { + if (0 === t10.length) + return false; + var n10 = Ws(e20, Ls(t10)); + return Array.isArray(n10); + } + function fc(e20) { + if (!["add", "remove", "replace", "copy", "move", "test"].includes(e20.op)) + throw new Error("Unknown JSONPatch op " + JSON.stringify(e20.op)); + if ("string" != typeof e20.path) + throw new Error('Required property "path" missing or not a string in operation ' + JSON.stringify(e20)); + if (("copy" === e20.op || "move" === e20.op) && "string" != typeof e20.from) + throw new Error('Required property "from" missing or not a string in operation ' + JSON.stringify(e20)); + } + function dc(e20, t10) { + return function(e21, t11) { + if ("-" !== function(e23) { + return e23[e23.length - 1]; + }(t11)) + return t11; + var n10 = Ls(t11), r10 = Ws(e21, n10); + return n10.concat(r10.length); + }(e20, Xs(t10)); + } + function hc(e20) { + return Xs(e20); + } + function vc(e20, t10, n10) { + var r10 = []; + return rc(e20, t10, { before: function(e21, t11) { + var o10, i10, a10 = dc(e21, t11.path); + if ("add" === t11.op) + o10 = gc(e21, a10); + else if ("remove" === t11.op) + o10 = mc(e21, a10); + else if ("replace" === t11.op) + o10 = pc(e21, a10); + else if ("copy" === t11.op) + o10 = function(e23, t12) { + return gc(e23, t12); + }(e21, a10); + else if ("move" === t11.op) + o10 = function(e23, t12, n11) { + if (t12.length < n11.length && function(e24, t13) { + var n12 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Bs; + if (e24.length < t13.length) + return false; + for (var r12 = 0; r12 < t13.length; r12++) + if (!n12(e24[r12], t13[r12])) + return false; + return true; + }(n11, t12)) + return [{ op: "replace", path: Zs(t12), value: e23 }]; + var r11 = { op: "move", from: Zs(t12), path: Zs(n11) }; + return !uc(e23, t12) && Ys(e23, t12) ? [r11].concat(Bo(mc(e23, t12))) : [r11]; + }(e21, a10, hc(t11.from)); + else { + if ("test" !== t11.op) + throw new Error("Unknown JSONPatch operation " + JSON.stringify(t11)); + o10 = []; + } + if (n10 && n10.before) { + var s10 = n10.before(e21, t11, o10); + if (s10 && s10.revertOperations && (o10 = s10.revertOperations), s10 && s10.document && (i10 = s10.document), s10 && s10.json) + throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"'); + } + if (r10 = o10.concat(r10), void 0 !== i10) + return { document: i10 }; + } }), r10; + } + function pc(e20, t10) { + return [{ op: "replace", path: Zs(t10), value: Ws(e20, t10) }]; + } + function mc(e20, t10) { + return [{ op: "add", path: Zs(t10), value: Ws(e20, t10) }]; + } + function gc(e20, t10) { + return uc(e20, t10) || !Ys(e20, t10) ? [{ op: "remove", path: Zs(t10) }] : pc(e20, t10); + } + function yc(e20) { + return e20 && e20.__esModule && Object.prototype.hasOwnProperty.call(e20, "default") ? e20.default : e20; + } + var bc = {}; + var kc = { b: "\b", f: "\f", n: "\n", r: "\r", t: " ", '"': '"', "/": "/", "\\": "\\" }; + var wc = "a".charCodeAt(); + bc.parse = function(e20, t10, n10) { + var r10 = {}, o10 = 0, i10 = 0, a10 = 0, s10 = n10 && n10.bigint && "undefined" != typeof BigInt; + return { data: c10("", true), pointers: r10 }; + function c10(t11, n11) { + var r11; + l10(), m10(t11, "value"); + var o11 = d10(); + switch (o11) { + case "t": + f10("rue"), r11 = true; + break; + case "f": + f10("alse"), r11 = false; + break; + case "n": + f10("ull"), r11 = null; + break; + case '"': + r11 = u10(); + break; + case "[": + r11 = function(e21) { + l10(); + var t12 = [], n12 = 0; + if ("]" == d10()) + return t12; + h10(); + for (; ; ) { + var r12 = e21 + "/" + n12; + t12.push(c10(r12)), l10(); + var o12 = d10(); + if ("]" == o12) + break; + "," != o12 && k10(), l10(), n12++; + } + return t12; + }(t11); + break; + case "{": + r11 = function(e21) { + l10(); + var t12 = {}; + if ("}" == d10()) + return t12; + h10(); + for (; ; ) { + var n12 = y10(); + '"' != d10() && k10(); + var r12 = u10(), o12 = e21 + "/" + Tc(r12); + g10(o12, "key", n12), m10(o12, "keyEnd"), l10(), ":" != d10() && k10(), l10(), t12[r12] = c10(o12), l10(); + var i11 = d10(); + if ("}" == i11) + break; + "," != i11 && k10(), l10(); + } + return t12; + }(t11); + break; + default: + h10(), "-0123456789".indexOf(o11) >= 0 ? r11 = function() { + var t12 = "", n12 = true; + "-" == e20[a10] && (t12 += d10()); + t12 += "0" == e20[a10] ? d10() : p10(), "." == e20[a10] && (t12 += d10() + p10(), n12 = false); + "e" != e20[a10] && "E" != e20[a10] || (t12 += d10(), "+" != e20[a10] && "-" != e20[a10] || (t12 += d10()), t12 += p10(), n12 = false); + var r12 = +t12; + return s10 && n12 && (r12 > Number.MAX_SAFE_INTEGER || r12 < Number.MIN_SAFE_INTEGER) ? BigInt(t12) : r12; + }() : b10(); + } + return m10(t11, "valueEnd"), l10(), n11 && a10 < e20.length && b10(), r11; + } + function l10() { + e: + for (; a10 < e20.length; ) { + switch (e20[a10]) { + case " ": + i10++; + break; + case " ": + i10 += 4; + break; + case "\r": + i10 = 0; + break; + case "\n": + i10 = 0, o10++; + break; + default: + break e; + } + a10++; + } + } + function u10() { + for (var e21, t11 = ""; '"' != (e21 = d10()); ) + "\\" == e21 ? (e21 = d10()) in kc ? t11 += kc[e21] : "u" == e21 ? t11 += v10() : k10() : t11 += e21; + return t11; + } + function f10(e21) { + for (var t11 = 0; t11 < e21.length; t11++) + d10() !== e21[t11] && k10(); + } + function d10() { + w10(); + var t11 = e20[a10]; + return a10++, i10++, t11; + } + function h10() { + a10--, i10--; + } + function v10() { + for (var e21 = 4, t11 = 0; e21--; ) { + t11 <<= 4; + var n11 = d10().toLowerCase(); + n11 >= "a" && n11 <= "f" ? t11 += n11.charCodeAt() - wc + 10 : n11 >= "0" && n11 <= "9" ? t11 += +n11 : k10(); + } + return String.fromCharCode(t11); + } + function p10() { + for (var t11 = ""; e20[a10] >= "0" && e20[a10] <= "9"; ) + t11 += d10(); + if (t11.length) + return t11; + w10(), b10(); + } + function m10(e21, t11) { + g10(e21, t11, y10()); + } + function g10(e21, t11, n11) { + r10[e21] = r10[e21] || {}, r10[e21][t11] = n11; + } + function y10() { + return { line: o10, column: i10, pos: a10 }; + } + function b10() { + throw new SyntaxError("Unexpected token " + e20[a10] + " in JSON at position " + a10); + } + function k10() { + h10(), b10(); + } + function w10() { + if (a10 >= e20.length) + throw new SyntaxError("Unexpected end of JSON input"); + } + }, bc.stringify = function(e20, t10, n10) { + if (jc(e20)) { + var r10, o10, i10 = 0, a10 = "object" == Ho(n10) ? n10.space : n10; + switch (Ho(a10)) { + case "number": + var s10 = a10 > 10 ? 10 : a10 < 0 ? 0 : Math.floor(a10); + a10 = s10 && y10(s10, " "), r10 = s10, o10 = s10; + break; + case "string": + a10 = a10.slice(0, 10), r10 = 0, o10 = 0; + for (var c10 = 0; c10 < a10.length; c10++) { + switch (a10[c10]) { + case " ": + o10++; + break; + case " ": + o10 += 4; + break; + case "\r": + o10 = 0; + break; + case "\n": + o10 = 0, i10++; + break; + default: + throw new Error("whitespace characters not allowed in JSON"); + } + r10++; + } + break; + default: + a10 = void 0; + } + var l10 = "", u10 = {}, f10 = 0, d10 = 0, h10 = 0, v10 = n10 && n10.es6 && "function" == typeof Map; + return function e21(t11, n11, r11) { + switch (g10(r11, "value"), Ho(t11)) { + case "number": + case "bigint": + case "boolean": + p10("" + t11); + break; + case "string": + p10(Ec(t11)); + break; + case "object": + null === t11 ? p10("null") : "function" == typeof t11.toJSON ? p10(Ec(t11.toJSON())) : Array.isArray(t11) ? o11() : v10 ? t11.constructor.BYTES_PER_ELEMENT ? o11() : t11 instanceof Map ? s11() : t11 instanceof Set ? s11(true) : i11() : i11(); + } + function o11() { + if (t11.length) { + p10("["); + for (var o12 = n11 + 1, i12 = 0; i12 < t11.length; i12++) { + i12 && p10(","), m10(o12); + var a11 = jc(t11[i12]) ? t11[i12] : null; + e21(a11, o12, r11 + "/" + i12); + } + m10(n11), p10("]"); + } else + p10("[]"); + } + function i11() { + var o12 = Object.keys(t11); + if (o12.length) { + p10("{"); + for (var i12 = n11 + 1, s12 = 0; s12 < o12.length; s12++) { + var c11 = o12[s12], l11 = t11[c11]; + if (jc(l11)) { + s12 && p10(","); + var u11 = r11 + "/" + Tc(c11); + m10(i12), g10(u11, "key"), p10(Ec(c11)), g10(u11, "keyEnd"), p10(":"), a10 && p10(" "), e21(l11, i12, u11); + } + } + m10(n11), p10("}"); + } else + p10("{}"); + } + function s11(o12) { + if (t11.size) { + p10("{"); + for (var i12 = n11 + 1, s12 = true, c11 = t11.entries(), l11 = c11.next(); !l11.done; ) { + var u11 = l11.value, f11 = u11[0], d11 = !!o12 || u11[1]; + if (jc(d11)) { + s12 || p10(","), s12 = false; + var h11 = r11 + "/" + Tc(f11); + m10(i12), g10(h11, "key"), p10(Ec(f11)), g10(h11, "keyEnd"), p10(":"), a10 && p10(" "), e21(d11, i12, h11); + } + l11 = c11.next(); + } + m10(n11), p10("}"); + } else + p10("{}"); + } + g10(r11, "valueEnd"); + }(e20, 0, ""), { json: l10, pointers: u10 }; + } + function p10(e21) { + d10 += e21.length, h10 += e21.length, l10 += e21; + } + function m10(e21) { + if (a10) { + for (l10 += "\n" + y10(e21, a10), f10++, d10 = 0; e21--; ) + i10 ? (f10 += i10, d10 = o10) : d10 += o10, h10 += r10; + h10 += 1; + } + } + function g10(e21, t11) { + u10[e21] = u10[e21] || {}, u10[e21][t11] = { line: f10, column: d10, pos: h10 }; + } + function y10(e21, t11) { + return Array(e21 + 1).join(t11); + } + }; + var xc = ["number", "bigint", "boolean", "string", "object"]; + function jc(e20) { + return xc.indexOf(Ho(e20)) >= 0; + } + var Sc = /"|\\/g; + var Cc = /[\b]/g; + var $c = /\f/g; + var _c = /\n/g; + var Oc = /\r/g; + var Mc = /\t/g; + function Ec(e20) { + return '"' + (e20 = e20.replace(Sc, "\\$&").replace($c, "\\f").replace(Cc, "\\b").replace(_c, "\\n").replace(Oc, "\\r").replace(Mc, "\\t")) + '"'; + } + var Ac = /~/g; + var Pc = /\//g; + function Tc(e20) { + return e20.replace(Ac, "~0").replace(Pc, "~1"); + } + var Rc = function(e20) { + function t10(e21, n10) { + var r10; + return No(this, t10), (r10 = _o(this, t10, [e21 + " at position " + n10])).position = n10, r10; + } + return Ao(t10, $o(Error)), Do(t10); + }(); + var Nc = 92; + var Ic = 47; + var Dc = 42; + var qc = 123; + var zc = 125; + var Bc = 91; + var Lc = 93; + var Fc = 40; + var Vc = 41; + var Hc = 32; + var Wc = 10; + var Uc = 9; + var Jc = 13; + var Kc = 8; + var Gc = 12; + var Qc = 34; + var Yc = 43; + var Xc = 45; + var Zc = 39; + var el = 48; + var tl = 57; + var nl = 44; + var rl = 46; + var ol = 58; + var il = 59; + var al = 65; + var sl = 97; + var cl = 69; + var ll = 101; + var ul = 70; + var fl = 102; + var dl = 160; + var hl = 8192; + var vl = 8202; + var pl = 8239; + var ml = 8287; + var gl = 12288; + var yl = 8220; + var bl = 8221; + var kl = 8216; + var wl = 8217; + var xl = 96; + var jl = 180; + function Sl(e20) { + return e20 >= el && e20 <= tl || e20 >= al && e20 <= ul || e20 >= sl && e20 <= fl; + } + function Cl(e20) { + return e20 >= el && e20 <= tl; + } + function $l(e20) { + return e20 >= 32 && e20 <= 1114111; + } + function _l(e20) { + return Ol.test(e20) || Rl(e20.charCodeAt(0)); + } + var Ol = /^[,:[\]{}()\n+]$/; + function Ml(e20) { + return El.test(e20) || e20 && Rl(e20.charCodeAt(0)); + } + var El = /^[[{\w-]$/; + function Al(e20) { + return e20 === Wc || e20 === Jc || e20 === Uc || e20 === Kc || e20 === Gc; + } + function Pl(e20) { + return e20 === Hc || e20 === Wc || e20 === Uc || e20 === Jc; + } + function Tl(e20) { + return e20 === dl || e20 >= hl && e20 <= vl || e20 === pl || e20 === ml || e20 === gl; + } + function Rl(e20) { + return Nl(e20) || Dl(e20); + } + function Nl(e20) { + return e20 === Qc || e20 === yl || e20 === bl; + } + function Il(e20) { + return e20 === Qc; + } + function Dl(e20) { + return e20 === Zc || e20 === kl || e20 === wl || e20 === xl || e20 === jl; + } + function ql(e20) { + return e20 === Zc; + } + function zl(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r10 = e20.lastIndexOf(t10); + return -1 !== r10 ? e20.substring(0, r10) + (n10 ? "" : e20.substring(r10 + 1)) : e20; + } + function Bl(e20, t10) { + var n10 = e20.length; + if (!Pl(e20.charCodeAt(n10 - 1))) + return e20 + t10; + for (; Pl(e20.charCodeAt(n10 - 1)); ) + n10--; + return e20.substring(0, n10) + t10 + e20.substring(n10); + } + function Ll(e20, t10, n10) { + return e20.substring(0, t10) + e20.substring(t10 + n10); + } + var Fl = { "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t" }; + var Vl = { '"': '"', "\\": "\\", "/": "/", b: "\b", f: "\f", n: "\n", r: "\r", t: " " }; + function Hl(e20) { + var t10 = 0, n10 = ""; + o10() || function() { + throw new Rc("Unexpected end of json string", e20.length); + }(); + var r10 = c10(nl); + for (r10 && i10(), Ml(e20[t10]) && function(e21) { + return /[,\n][ \t\r]*$/.test(e21); + }(n10) ? (r10 || (n10 = Bl(n10, ",")), function() { + var e21 = true, t11 = true; + for (; t11; ) { + if (e21) + e21 = false; + else + c10(nl) || (n10 = Bl(n10, ",")); + t11 = o10(); + } + t11 || (n10 = zl(n10, ",")); + n10 = "[\n".concat(n10, "\n]"); + }()) : r10 && (n10 = zl(n10, ",")); e20.charCodeAt(t10) === zc || e20.charCodeAt(t10) === Lc; ) + t10++, i10(); + if (t10 >= e20.length) + return n10; + function o10() { + i10(); + var r11 = function() { + if (e20.charCodeAt(t10) === qc) { + n10 += "{", t10++, i10(); + for (var r12 = true; t10 < e20.length && e20.charCodeAt(t10) !== zc; ) { + if (r12 ? (true, r12 = false) : (c10(nl) || (n10 = Bl(n10, ",")), i10()), !(u10() || d10())) { + e20.charCodeAt(t10) === zc || e20.charCodeAt(t10) === qc || e20.charCodeAt(t10) === Lc || e20.charCodeAt(t10) === Bc || void 0 === e20[t10] ? n10 = zl(n10, ",") : m10(); + break; + } + i10(); + var a11 = c10(ol), s11 = t10 >= e20.length; + a11 || (Ml(e20[t10]) || s11 ? n10 = Bl(n10, ":") : g10()), o10() || (a11 || s11 ? n10 += "null" : g10()); + } + return e20.charCodeAt(t10) === zc ? (n10 += "}", t10++) : n10 = Bl(n10, "}"), true; + } + return false; + }() || function() { + if (e20.charCodeAt(t10) === Bc) { + n10 += "[", t10++, i10(); + for (var r12 = true; t10 < e20.length && e20.charCodeAt(t10) !== Lc; ) { + if (r12) + r12 = false; + else + c10(nl) || (n10 = Bl(n10, ",")); + if (!o10()) { + n10 = zl(n10, ","); + break; + } + } + return e20.charCodeAt(t10) === Lc ? (n10 += "]", t10++) : n10 = Bl(n10, "]"), true; + } + return false; + }() || u10() || function() { + var r12 = t10; + if (e20.charCodeAt(t10) === Xc && (t10++, v10(r12))) + return true; + for (; Cl(e20.charCodeAt(t10)); ) + t10++; + if (e20.charCodeAt(t10) === rl) { + if (t10++, v10(r12)) + return true; + for (; Cl(e20.charCodeAt(t10)); ) + t10++; + } + if (e20.charCodeAt(t10) === ll || e20.charCodeAt(t10) === cl) { + if (t10++, e20.charCodeAt(t10) !== Xc && e20.charCodeAt(t10) !== Yc || t10++, v10(r12)) + return true; + for (; Cl(e20.charCodeAt(t10)); ) + t10++; + } + if (t10 > r12) { + var o11 = e20.slice(r12, t10), i11 = /^0\d/.test(o11); + return n10 += i11 ? '"'.concat(o11, '"') : o11, true; + } + return false; + }() || f10("true", "true") || f10("false", "false") || f10("null", "null") || f10("True", "true") || f10("False", "false") || f10("None", "null") || d10(); + return i10(), r11; + } + function i10() { + var e21 = t10, n11 = a10(); + do { + (n11 = s10()) && (n11 = a10()); + } while (n11); + return t10 > e21; + } + function a10() { + for (var r11, o11 = ""; (r11 = Pl(e20.charCodeAt(t10))) || Tl(e20.charCodeAt(t10)); ) + o11 += r11 ? e20[t10] : " ", t10++; + return o11.length > 0 && (n10 += o11, true); + } + function s10() { + if (e20.charCodeAt(t10) === Ic && e20.charCodeAt(t10 + 1) === Dc) { + for (; t10 < e20.length && !Wl(e20, t10); ) + t10++; + return t10 += 2, true; + } + if (e20.charCodeAt(t10) === Ic && e20.charCodeAt(t10 + 1) === Ic) { + for (; t10 < e20.length && e20.charCodeAt(t10) !== Wc; ) + t10++; + return true; + } + return false; + } + function c10(r11) { + return e20.charCodeAt(t10) === r11 && (n10 += e20[t10], t10++, true); + } + function l10() { + return function(n11) { + return e20.charCodeAt(t10) === n11 && (t10++, true); + }(Nc); + } + function u10() { + var r11 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], o11 = e20.charCodeAt(t10) === Nc; + if (o11 && (t10++, o11 = true), Rl(e20.charCodeAt(t10))) { + var a11 = Il(e20.charCodeAt(t10)) ? Il : ql(e20.charCodeAt(t10)) ? ql : Dl(e20.charCodeAt(t10)) ? Dl : Nl, s11 = t10, c11 = n10.length, f11 = '"'; + t10++; + for (var d11 = r11 ? function(t11) { + return _l(e20[t11]); + } : function(t11) { + return a11(e20.charCodeAt(t11)); + }; t10 < e20.length && !d11(t10); ) { + if (e20.charCodeAt(t10) === Nc) { + var h11 = e20.charAt(t10 + 1); + if (void 0 !== Vl[h11]) + f11 += e20.slice(t10, t10 + 2), t10 += 2; + else if ("u" === h11) { + for (var v11 = 2; v11 < 6 && Sl(e20.charCodeAt(t10 + v11)); ) + v11++; + 6 === v11 ? (f11 += e20.slice(t10, t10 + 6), t10 += 6) : t10 + v11 >= e20.length ? t10 = e20.length : y10(); + } else + f11 += h11, t10 += 2; + } else { + var m11 = e20.charAt(t10), g11 = e20.charCodeAt(t10); + g11 === Qc && e20.charCodeAt(t10 - 1) !== Nc ? (f11 += "\\" + m11, t10++) : Al(g11) ? (f11 += Fl[m11], t10++) : ($l(g11) || p10(m11), f11 += m11, t10++); + } + o11 && l10(); + } + var b10 = Rl(e20.charCodeAt(t10)); + b10 ? (f11 += '"', t10++) : f11 = Bl(f11, '"'), n10 += f11, i10(); + var k10 = t10 >= e20.length, w10 = _l(e20.charAt(t10)); + return !r11 && (b10 && !k10 && !w10 || !b10 && k10) ? (t10 = s11, n10 = n10.substring(0, c11), u10(true)) : (function() { + var r12 = false; + i10(); + for (; e20.charCodeAt(t10) === Yc; ) { + r12 = true, t10++, i10(); + var o12 = (n10 = zl(n10, '"', true)).length, a12 = u10(); + n10 = a12 ? Ll(n10, o12, 1) : Bl(n10, '"'); + } + }(), true); + } + return false; + } + function f10(r11, o11) { + return e20.slice(t10, t10 + r11.length) === r11 && (n10 += o11, t10 += r11.length, true); + } + function d10() { + for (var r11 = t10; t10 < e20.length && !_l(e20[t10]); ) + t10++; + if (t10 > r11) { + if (e20.charCodeAt(t10) === Fc) + return t10++, o10(), e20.charCodeAt(t10) === Vc && (t10++, e20.charCodeAt(t10) === il && t10++), true; + for (; Pl(e20.charCodeAt(t10 - 1)) && t10 > 0; ) + t10--; + var i11 = e20.slice(r11, t10); + return n10 += "undefined" === i11 ? "null" : JSON.stringify(i11), e20.charCodeAt(t10) === Qc && t10++, true; + } + } + function h10(n11) { + if (!Cl(e20.charCodeAt(t10))) { + var r11 = e20.slice(n11, t10); + throw new Rc("Invalid number '".concat(r11, "', expecting a digit ").concat(e20[t10] ? "but got '".concat(e20[t10], "'") : "but reached end of input"), t10); + } + } + function v10(r11) { + return t10 >= e20.length ? (n10 += e20.slice(r11, t10) + "0", true) : (h10(r11), false); + } + function p10(e21) { + throw new Rc("Invalid character " + JSON.stringify(e21), t10); + } + function m10() { + throw new Rc("Object key expected", t10); + } + function g10() { + throw new Rc("Colon expected", t10); + } + function y10() { + var n11 = e20.slice(t10, t10 + 6); + throw new Rc('Invalid unicode character "'.concat(n11, '"'), t10); + } + !function() { + throw new Rc("Unexpected character " + JSON.stringify(e20[t10]), t10); + }(); + } + function Wl(e20, t10) { + return "*" === e20[t10] && "/" === e20[t10 + 1]; + } + function Ul(e20) { + return parseInt(e20, 10); + } + function Jl(e20) { + return Kl.test(e20); + } + var Kl = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/; + function Gl(e20) { + return "object" === Ho(e20) && null !== e20 && "Object" === e20.constructor.name; + } + function Ql(e20) { + return "object" === Ho(e20) && null !== e20 && ("Object" === e20.constructor.name || "Array" === e20.constructor.name); + } + function Yl(e20) { + if ("number" == typeof e20) + return e20 > 9466848e5 && isFinite(e20) && Math.floor(e20) === e20 && !isNaN(new Date(e20).valueOf()); + if ("bigint" == typeof e20) + return Yl(Number(e20)); + try { + var t10 = e20 ? e20.valueOf() : e20; + if (t10 !== e20) + return Yl(t10); + } catch (e21) { + return false; + } + return false; + } + function Xl(e20) { + (Zl = Zl || window.document.createElement("div")).style.color = "", Zl.style.color = e20; + var t10 = Zl.style.color; + return "" !== t10 ? t10.replace(/\s+/g, "").toLowerCase() : null; + } + var Zl = null; + function eu(e20, t10) { + if ("number" == typeof e20 || "string" == typeof e20 || "boolean" == typeof e20 || void 0 === e20) + return Ho(e20); + if ("bigint" == typeof e20) + return "number"; + if (null === e20) + return "null"; + if (Array.isArray(e20)) + return "array"; + if (Gl(e20)) + return "object"; + var n10 = t10.stringify(e20); + return n10 && Jl(n10) ? "number" : "true" === n10 || "false" === n10 ? "boolean" : "null" === n10 ? "null" : "unknown"; + } + var tu = /^https?:\/\/\S+$/; + function nu(e20) { + return "string" == typeof e20 && tu.test(e20); + } + function ru(e20, t10) { + if ("" === e20) + return ""; + var n10 = e20.trim(); + return "null" === n10 ? null : "true" === n10 || "false" !== n10 && (Jl(n10) ? t10.parse(n10) : e20); + } + function ou(e20) { + return iu.test(e20); + } + var iu = /^-?[0-9]+$/; + var au = "object" == ("undefined" == typeof global ? "undefined" : Ho(global)) && global && global.Object === Object && global; + var su = "object" == ("undefined" == typeof self ? "undefined" : Ho(self)) && self && self.Object === Object && self; + var cu = au || su || Function("return this")(); + var lu = cu.Symbol; + var uu = Object.prototype; + var fu = uu.hasOwnProperty; + var du = uu.toString; + var hu = lu ? lu.toStringTag : void 0; + var vu = Object.prototype.toString; + var pu = "[object Null]"; + var mu = "[object Undefined]"; + var gu = lu ? lu.toStringTag : void 0; + function yu(e20) { + return null == e20 ? void 0 === e20 ? mu : pu : gu && gu in Object(e20) ? function(e21) { + var t10 = fu.call(e21, hu), n10 = e21[hu]; + try { + e21[hu] = void 0; + var r10 = true; + } catch (e23) { + } + var o10 = du.call(e21); + return r10 && (t10 ? e21[hu] = n10 : delete e21[hu]), o10; + }(e20) : function(e21) { + return vu.call(e21); + }(e20); + } + function bu(e20) { + return null != e20 && "object" == Ho(e20); + } + var ku = "[object Symbol]"; + function wu(e20) { + return "symbol" == Ho(e20) || bu(e20) && yu(e20) == ku; + } + var xu = NaN; + function ju(e20) { + return "number" == typeof e20 ? e20 : wu(e20) ? xu : +e20; + } + function Su(e20, t10) { + for (var n10 = -1, r10 = null == e20 ? 0 : e20.length, o10 = Array(r10); ++n10 < r10; ) + o10[n10] = t10(e20[n10], n10, e20); + return o10; + } + var Cu = Array.isArray; + var $u = 1 / 0; + var _u = lu ? lu.prototype : void 0; + var Ou = _u ? _u.toString : void 0; + function Mu(e20) { + if ("string" == typeof e20) + return e20; + if (Cu(e20)) + return Su(e20, Mu) + ""; + if (wu(e20)) + return Ou ? Ou.call(e20) : ""; + var t10 = e20 + ""; + return "0" == t10 && 1 / e20 == -$u ? "-0" : t10; + } + function Eu(e20, t10) { + return function(n10, r10) { + var o10; + if (void 0 === n10 && void 0 === r10) + return t10; + if (void 0 !== n10 && (o10 = n10), void 0 !== r10) { + if (void 0 === o10) + return r10; + "string" == typeof n10 || "string" == typeof r10 ? (n10 = Mu(n10), r10 = Mu(r10)) : (n10 = ju(n10), r10 = ju(r10)), o10 = e20(n10, r10); + } + return o10; + }; + } + var Au = Eu(function(e20, t10) { + return e20 + t10; + }, 0); + var Pu = /\s/; + function Tu(e20) { + for (var t10 = e20.length; t10-- && Pu.test(e20.charAt(t10)); ) + ; + return t10; + } + var Ru = /^\s+/; + function Nu(e20) { + return e20 ? e20.slice(0, Tu(e20) + 1).replace(Ru, "") : e20; + } + function Iu(e20) { + var t10 = Ho(e20); + return null != e20 && ("object" == t10 || "function" == t10); + } + var Du = NaN; + var qu = /^[-+]0x[0-9a-f]+$/i; + var zu = /^0b[01]+$/i; + var Bu = /^0o[0-7]+$/i; + var Lu = parseInt; + function Fu(e20) { + if ("number" == typeof e20) + return e20; + if (wu(e20)) + return Du; + if (Iu(e20)) { + var t10 = "function" == typeof e20.valueOf ? e20.valueOf() : e20; + e20 = Iu(t10) ? t10 + "" : t10; + } + if ("string" != typeof e20) + return 0 === e20 ? e20 : +e20; + e20 = Nu(e20); + var n10 = zu.test(e20); + return n10 || Bu.test(e20) ? Lu(e20.slice(2), n10 ? 2 : 8) : qu.test(e20) ? Du : +e20; + } + var Vu = 1 / 0; + var Hu = 17976931348623157e292; + function Wu(e20) { + return e20 ? (e20 = Fu(e20)) === Vu || e20 === -Vu ? (e20 < 0 ? -1 : 1) * Hu : e20 == e20 ? e20 : 0 : 0 === e20 ? e20 : 0; + } + function Uu(e20) { + var t10 = Wu(e20), n10 = t10 % 1; + return t10 == t10 ? n10 ? t10 - n10 : t10 : 0; + } + function Ju(e20, t10) { + if ("function" != typeof t10) + throw new TypeError("Expected a function"); + return e20 = Uu(e20), function() { + if (--e20 < 1) + return t10.apply(this, arguments); + }; + } + function Ku(e20) { + return e20; + } + var Gu = "[object AsyncFunction]"; + var Qu = "[object Function]"; + var Yu = "[object GeneratorFunction]"; + var Xu = "[object Proxy]"; + function Zu(e20) { + if (!Iu(e20)) + return false; + var t10 = yu(e20); + return t10 == Qu || t10 == Yu || t10 == Gu || t10 == Xu; + } + var ef; + var tf = cu["__core-js_shared__"]; + var nf = (ef = /[^.]+$/.exec(tf && tf.keys && tf.keys.IE_PROTO || "")) ? "Symbol(src)_1." + ef : ""; + var rf = Function.prototype.toString; + function of(e20) { + if (null != e20) { + try { + return rf.call(e20); + } catch (e21) { + } + try { + return e20 + ""; + } catch (e21) { + } + } + return ""; + } + var af = /^\[object .+?Constructor\]$/; + var sf = Function.prototype; + var cf = Object.prototype; + var lf = sf.toString; + var uf = cf.hasOwnProperty; + var ff = RegExp("^" + lf.call(uf).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); + function df(e20) { + return !(!Iu(e20) || function(e21) { + return !!nf && nf in e21; + }(e20)) && (Zu(e20) ? ff : af).test(of(e20)); + } + function hf(e20, t10) { + var n10 = function(e21, t11) { + return null == e21 ? void 0 : e21[t11]; + }(e20, t10); + return df(n10) ? n10 : void 0; + } + var vf = hf(cu, "WeakMap"); + var pf = vf && new vf(); + var mf = pf ? function(e20, t10) { + return pf.set(e20, t10), e20; + } : Ku; + var gf = Object.create; + var yf = /* @__PURE__ */ function() { + function e20() { + } + return function(t10) { + if (!Iu(t10)) + return {}; + if (gf) + return gf(t10); + e20.prototype = t10; + var n10 = new e20(); + return e20.prototype = void 0, n10; + }; + }(); + function bf(e20) { + return function() { + var t10 = arguments; + switch (t10.length) { + case 0: + return new e20(); + case 1: + return new e20(t10[0]); + case 2: + return new e20(t10[0], t10[1]); + case 3: + return new e20(t10[0], t10[1], t10[2]); + case 4: + return new e20(t10[0], t10[1], t10[2], t10[3]); + case 5: + return new e20(t10[0], t10[1], t10[2], t10[3], t10[4]); + case 6: + return new e20(t10[0], t10[1], t10[2], t10[3], t10[4], t10[5]); + case 7: + return new e20(t10[0], t10[1], t10[2], t10[3], t10[4], t10[5], t10[6]); + } + var n10 = yf(e20.prototype), r10 = e20.apply(n10, t10); + return Iu(r10) ? r10 : n10; + }; + } + var kf = 1; + function wf(e20, t10, n10) { + switch (n10.length) { + case 0: + return e20.call(t10); + case 1: + return e20.call(t10, n10[0]); + case 2: + return e20.call(t10, n10[0], n10[1]); + case 3: + return e20.call(t10, n10[0], n10[1], n10[2]); + } + return e20.apply(t10, n10); + } + var xf = Math.max; + function jf(e20, t10, n10, r10) { + for (var o10 = -1, i10 = e20.length, a10 = n10.length, s10 = -1, c10 = t10.length, l10 = xf(i10 - a10, 0), u10 = Array(c10 + l10), f10 = !r10; ++s10 < c10; ) + u10[s10] = t10[s10]; + for (; ++o10 < a10; ) + (f10 || o10 < i10) && (u10[n10[o10]] = e20[o10]); + for (; l10--; ) + u10[s10++] = e20[o10++]; + return u10; + } + var Sf = Math.max; + function Cf(e20, t10, n10, r10) { + for (var o10 = -1, i10 = e20.length, a10 = -1, s10 = n10.length, c10 = -1, l10 = t10.length, u10 = Sf(i10 - s10, 0), f10 = Array(u10 + l10), d10 = !r10; ++o10 < u10; ) + f10[o10] = e20[o10]; + for (var h10 = o10; ++c10 < l10; ) + f10[h10 + c10] = t10[c10]; + for (; ++a10 < s10; ) + (d10 || o10 < i10) && (f10[h10 + n10[a10]] = e20[o10++]); + return f10; + } + function $f() { + } + var _f = 4294967295; + function Of(e20) { + this.__wrapped__ = e20, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = _f, this.__views__ = []; + } + function Mf() { + } + Of.prototype = yf($f.prototype), Of.prototype.constructor = Of; + var Ef = pf ? function(e20) { + return pf.get(e20); + } : Mf; + var Af = {}; + var Pf = Object.prototype.hasOwnProperty; + function Tf(e20) { + for (var t10 = e20.name + "", n10 = Af[t10], r10 = Pf.call(Af, t10) ? n10.length : 0; r10--; ) { + var o10 = n10[r10], i10 = o10.func; + if (null == i10 || i10 == e20) + return o10.name; + } + return t10; + } + function Rf(e20, t10) { + this.__wrapped__ = e20, this.__actions__ = [], this.__chain__ = !!t10, this.__index__ = 0, this.__values__ = void 0; + } + function Nf(e20, t10) { + var n10 = -1, r10 = e20.length; + for (t10 || (t10 = Array(r10)); ++n10 < r10; ) + t10[n10] = e20[n10]; + return t10; + } + function If(e20) { + if (e20 instanceof Of) + return e20.clone(); + var t10 = new Rf(e20.__wrapped__, e20.__chain__); + return t10.__actions__ = Nf(e20.__actions__), t10.__index__ = e20.__index__, t10.__values__ = e20.__values__, t10; + } + Rf.prototype = yf($f.prototype), Rf.prototype.constructor = Rf; + var Df = Object.prototype.hasOwnProperty; + function qf(e20) { + if (bu(e20) && !Cu(e20) && !(e20 instanceof Of)) { + if (e20 instanceof Rf) + return e20; + if (Df.call(e20, "__wrapped__")) + return If(e20); + } + return new Rf(e20); + } + function zf(e20) { + var t10 = Tf(e20), n10 = qf[t10]; + if ("function" != typeof n10 || !(t10 in Of.prototype)) + return false; + if (e20 === n10) + return true; + var r10 = Ef(n10); + return !!r10 && e20 === r10[0]; + } + qf.prototype = $f.prototype, qf.prototype.constructor = qf; + var Bf = Date.now; + function Lf(e20) { + var t10 = 0, n10 = 0; + return function() { + var r10 = Bf(), o10 = 16 - (r10 - n10); + if (n10 = r10, o10 > 0) { + if (++t10 >= 800) + return arguments[0]; + } else + t10 = 0; + return e20.apply(void 0, arguments); + }; + } + var Ff = Lf(mf); + var Vf = /\{\n\/\* \[wrapped with (.+)\] \*/; + var Hf = /,? & /; + var Wf = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + function Uf(e20) { + return function() { + return e20; + }; + } + var Jf = function() { + try { + var e20 = hf(Object, "defineProperty"); + return e20({}, "", {}), e20; + } catch (e21) { + } + }(); + var Kf = Jf ? function(e20, t10) { + return Jf(e20, "toString", { configurable: true, enumerable: false, value: Uf(t10), writable: true }); + } : Ku; + var Gf = Lf(Kf); + function Qf(e20, t10) { + for (var n10 = -1, r10 = null == e20 ? 0 : e20.length; ++n10 < r10 && false !== t10(e20[n10], n10, e20); ) + ; + return e20; + } + function Yf(e20, t10, n10, r10) { + for (var o10 = e20.length, i10 = n10 + (r10 ? 1 : -1); r10 ? i10-- : ++i10 < o10; ) + if (t10(e20[i10], i10, e20)) + return i10; + return -1; + } + function Xf(e20) { + return e20 != e20; + } + function Zf(e20, t10, n10) { + return t10 == t10 ? function(e21, t11, n11) { + for (var r10 = n11 - 1, o10 = e21.length; ++r10 < o10; ) + if (e21[r10] === t11) + return r10; + return -1; + }(e20, t10, n10) : Yf(e20, Xf, n10); + } + function ed(e20, t10) { + return !!(null == e20 ? 0 : e20.length) && Zf(e20, t10, 0) > -1; + } + var td = [["ary", 128], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", 32], ["partialRight", 64], ["rearg", 256]]; + function nd(e20, t10, n10) { + var r10 = t10 + ""; + return Gf(e20, function(e21, t11) { + var n11 = t11.length; + if (!n11) + return e21; + var r11 = n11 - 1; + return t11[r11] = (n11 > 1 ? "& " : "") + t11[r11], t11 = t11.join(n11 > 2 ? ", " : " "), e21.replace(Wf, "{\n/* [wrapped with " + t11 + "] */\n"); + }(r10, function(e21, t11) { + return Qf(td, function(n11) { + var r11 = "_." + n11[0]; + t11 & n11[1] && !ed(e21, r11) && e21.push(r11); + }), e21.sort(); + }(function(e21) { + var t11 = e21.match(Vf); + return t11 ? t11[1].split(Hf) : []; + }(r10), n10))); + } + var rd = 1; + var od = 2; + var id = 4; + var ad = 8; + var sd = 32; + var cd = 64; + function ld(e20, t10, n10, r10, o10, i10, a10, s10, c10, l10) { + var u10 = t10 & ad; + t10 |= u10 ? sd : cd, (t10 &= ~(u10 ? cd : sd)) & id || (t10 &= ~(rd | od)); + var f10 = [e20, t10, o10, u10 ? i10 : void 0, u10 ? a10 : void 0, u10 ? void 0 : i10, u10 ? void 0 : a10, s10, c10, l10], d10 = n10.apply(void 0, f10); + return zf(e20) && Ff(d10, f10), d10.placeholder = r10, nd(d10, e20, t10); + } + function ud(e20) { + return e20.placeholder; + } + var fd = 9007199254740991; + var dd = /^(?:0|[1-9]\d*)$/; + function hd(e20, t10) { + var n10 = Ho(e20); + return !!(t10 = null == t10 ? fd : t10) && ("number" == n10 || "symbol" != n10 && dd.test(e20)) && e20 > -1 && e20 % 1 == 0 && e20 < t10; + } + var vd = Math.min; + var pd = "__lodash_placeholder__"; + function md(e20, t10) { + for (var n10 = -1, r10 = e20.length, o10 = 0, i10 = []; ++n10 < r10; ) { + var a10 = e20[n10]; + a10 !== t10 && a10 !== pd || (e20[n10] = pd, i10[o10++] = n10); + } + return i10; + } + var gd = 1; + var yd = 2; + var bd = 8; + var kd = 16; + var wd = 128; + var xd = 512; + function jd(e20, t10, n10, r10, o10, i10, a10, s10, c10, l10) { + var u10 = t10 & wd, f10 = t10 & gd, d10 = t10 & yd, h10 = t10 & (bd | kd), v10 = t10 & xd, p10 = d10 ? void 0 : bf(e20); + return function m10() { + for (var g10 = arguments.length, y10 = Array(g10), b10 = g10; b10--; ) + y10[b10] = arguments[b10]; + if (h10) + var k10 = ud(m10), w10 = function(e21, t11) { + for (var n11 = e21.length, r11 = 0; n11--; ) + e21[n11] === t11 && ++r11; + return r11; + }(y10, k10); + if (r10 && (y10 = jf(y10, r10, o10, h10)), i10 && (y10 = Cf(y10, i10, a10, h10)), g10 -= w10, h10 && g10 < l10) { + var x10 = md(y10, k10); + return ld(e20, t10, jd, m10.placeholder, n10, y10, x10, s10, c10, l10 - g10); + } + var j10 = f10 ? n10 : this, S10 = d10 ? j10[e20] : e20; + return g10 = y10.length, s10 ? y10 = function(e21, t11) { + for (var n11 = e21.length, r11 = vd(t11.length, n11), o11 = Nf(e21); r11--; ) { + var i11 = t11[r11]; + e21[r11] = hd(i11, n11) ? o11[i11] : void 0; + } + return e21; + }(y10, s10) : v10 && g10 > 1 && y10.reverse(), u10 && c10 < g10 && (y10.length = c10), this && this !== cu && this instanceof m10 && (S10 = p10 || bf(S10)), S10.apply(j10, y10); + }; + } + var Sd = 1; + var Cd = "__lodash_placeholder__"; + var $d = 1; + var _d = 2; + var Od = 4; + var Md = 8; + var Ed = 128; + var Ad = 256; + var Pd = Math.min; + var Td = "Expected a function"; + var Rd = 1; + var Nd = 2; + var Id = 8; + var Dd = 16; + var qd = 32; + var zd = 64; + var Bd = Math.max; + function Ld(e20, t10, n10, r10, o10, i10, a10, s10) { + var c10 = t10 & Nd; + if (!c10 && "function" != typeof e20) + throw new TypeError(Td); + var l10 = r10 ? r10.length : 0; + if (l10 || (t10 &= ~(qd | zd), r10 = o10 = void 0), a10 = void 0 === a10 ? a10 : Bd(Uu(a10), 0), s10 = void 0 === s10 ? s10 : Uu(s10), l10 -= o10 ? o10.length : 0, t10 & zd) { + var u10 = r10, f10 = o10; + r10 = o10 = void 0; + } + var d10 = c10 ? void 0 : Ef(e20), h10 = [e20, t10, n10, r10, o10, u10, f10, i10, a10, s10]; + if (d10 && function(e21, t11) { + var n11 = e21[1], r11 = t11[1], o11 = n11 | r11, i11 = o11 < ($d | _d | Ed), a11 = r11 == Ed && n11 == Md || r11 == Ed && n11 == Ad && e21[7].length <= t11[8] || r11 == (Ed | Ad) && t11[7].length <= t11[8] && n11 == Md; + if (!i11 && !a11) + return e21; + r11 & $d && (e21[2] = t11[2], o11 |= n11 & $d ? 0 : Od); + var s11 = t11[3]; + if (s11) { + var c11 = e21[3]; + e21[3] = c11 ? jf(c11, s11, t11[4]) : s11, e21[4] = c11 ? md(e21[3], Cd) : t11[4]; + } + (s11 = t11[5]) && (c11 = e21[5], e21[5] = c11 ? Cf(c11, s11, t11[6]) : s11, e21[6] = c11 ? md(e21[5], Cd) : t11[6]), (s11 = t11[7]) && (e21[7] = s11), r11 & Ed && (e21[8] = null == e21[8] ? t11[8] : Pd(e21[8], t11[8])), null == e21[9] && (e21[9] = t11[9]), e21[0] = t11[0], e21[1] = o11; + }(h10, d10), e20 = h10[0], t10 = h10[1], n10 = h10[2], r10 = h10[3], o10 = h10[4], !(s10 = h10[9] = void 0 === h10[9] ? c10 ? 0 : e20.length : Bd(h10[9] - l10, 0)) && t10 & (Id | Dd) && (t10 &= ~(Id | Dd)), t10 && t10 != Rd) + v10 = t10 == Id || t10 == Dd ? function(e21, t11, n11) { + var r11 = bf(e21); + return function o11() { + for (var i11 = arguments.length, a11 = Array(i11), s11 = i11, c11 = ud(o11); s11--; ) + a11[s11] = arguments[s11]; + var l11 = i11 < 3 && a11[0] !== c11 && a11[i11 - 1] !== c11 ? [] : md(a11, c11); + return (i11 -= l11.length) < n11 ? ld(e21, t11, jd, o11.placeholder, void 0, a11, l11, void 0, void 0, n11 - i11) : wf(this && this !== cu && this instanceof o11 ? r11 : e21, this, a11); + }; + }(e20, t10, s10) : t10 != qd && t10 != (Rd | qd) || o10.length ? jd.apply(void 0, h10) : function(e21, t11, n11, r11) { + var o11 = t11 & Sd, i11 = bf(e21); + return function t12() { + for (var a11 = -1, s11 = arguments.length, c11 = -1, l11 = r11.length, u11 = Array(l11 + s11), f11 = this && this !== cu && this instanceof t12 ? i11 : e21; ++c11 < l11; ) + u11[c11] = r11[c11]; + for (; s11--; ) + u11[c11++] = arguments[++a11]; + return wf(f11, o11 ? n11 : this, u11); + }; + }(e20, t10, n10, r10); + else + var v10 = function(e21, t11, n11) { + var r11 = t11 & kf, o11 = bf(e21); + return function t12() { + return (this && this !== cu && this instanceof t12 ? o11 : e21).apply(r11 ? n11 : this, arguments); + }; + }(e20, t10, n10); + return nd((d10 ? mf : Ff)(v10, h10), e20, t10); + } + var Fd = 128; + function Vd(e20, t10, n10) { + return t10 = n10 ? void 0 : t10, t10 = e20 && null == t10 ? e20.length : t10, Ld(e20, Fd, void 0, void 0, void 0, void 0, t10); + } + function Hd(e20, t10, n10) { + "__proto__" == t10 && Jf ? Jf(e20, t10, { configurable: true, enumerable: true, value: n10, writable: true }) : e20[t10] = n10; + } + function Wd(e20, t10) { + return e20 === t10 || e20 != e20 && t10 != t10; + } + var Ud = Object.prototype.hasOwnProperty; + function Jd(e20, t10, n10) { + var r10 = e20[t10]; + Ud.call(e20, t10) && Wd(r10, n10) && (void 0 !== n10 || t10 in e20) || Hd(e20, t10, n10); + } + function Kd(e20, t10, n10, r10) { + var o10 = !n10; + n10 || (n10 = {}); + for (var i10 = -1, a10 = t10.length; ++i10 < a10; ) { + var s10 = t10[i10], c10 = r10 ? r10(n10[s10], e20[s10], s10, n10, e20) : void 0; + void 0 === c10 && (c10 = e20[s10]), o10 ? Hd(n10, s10, c10) : Jd(n10, s10, c10); + } + return n10; + } + var Gd = Math.max; + function Qd(e20, t10, n10) { + return t10 = Gd(void 0 === t10 ? e20.length - 1 : t10, 0), function() { + for (var r10 = arguments, o10 = -1, i10 = Gd(r10.length - t10, 0), a10 = Array(i10); ++o10 < i10; ) + a10[o10] = r10[t10 + o10]; + o10 = -1; + for (var s10 = Array(t10 + 1); ++o10 < t10; ) + s10[o10] = r10[o10]; + return s10[t10] = n10(a10), wf(e20, this, s10); + }; + } + function Yd(e20, t10) { + return Gf(Qd(e20, t10, Ku), e20 + ""); + } + var Xd = 9007199254740991; + function Zd(e20) { + return "number" == typeof e20 && e20 > -1 && e20 % 1 == 0 && e20 <= Xd; + } + function eh(e20) { + return null != e20 && Zd(e20.length) && !Zu(e20); + } + function th(e20, t10, n10) { + if (!Iu(n10)) + return false; + var r10 = Ho(t10); + return !!("number" == r10 ? eh(n10) && hd(t10, n10.length) : "string" == r10 && t10 in n10) && Wd(n10[t10], e20); + } + function nh(e20) { + return Yd(function(t10, n10) { + var r10 = -1, o10 = n10.length, i10 = o10 > 1 ? n10[o10 - 1] : void 0, a10 = o10 > 2 ? n10[2] : void 0; + for (i10 = e20.length > 3 && "function" == typeof i10 ? (o10--, i10) : void 0, a10 && th(n10[0], n10[1], a10) && (i10 = o10 < 3 ? void 0 : i10, o10 = 1), t10 = Object(t10); ++r10 < o10; ) { + var s10 = n10[r10]; + s10 && e20(t10, s10, r10, i10); + } + return t10; + }); + } + var rh = Object.prototype; + function oh(e20) { + var t10 = e20 && e20.constructor; + return e20 === ("function" == typeof t10 && t10.prototype || rh); + } + function ih(e20, t10) { + for (var n10 = -1, r10 = Array(e20); ++n10 < e20; ) + r10[n10] = t10(n10); + return r10; + } + function ah(e20) { + return bu(e20) && "[object Arguments]" == yu(e20); + } + var sh = Object.prototype; + var ch = sh.hasOwnProperty; + var lh = sh.propertyIsEnumerable; + var uh = ah(/* @__PURE__ */ function() { + return arguments; + }()) ? ah : function(e20) { + return bu(e20) && ch.call(e20, "callee") && !lh.call(e20, "callee"); + }; + function fh() { + return false; + } + var dh = "object" == ("undefined" == typeof exports ? "undefined" : Ho(exports)) && exports && !exports.nodeType && exports; + var hh = dh && "object" == ("undefined" == typeof module ? "undefined" : Ho(module)) && module && !module.nodeType && module; + var vh = hh && hh.exports === dh ? cu.Buffer : void 0; + var ph = (vh ? vh.isBuffer : void 0) || fh; + var mh = {}; + function gh(e20) { + return function(t10) { + return e20(t10); + }; + } + mh["[object Float32Array]"] = mh["[object Float64Array]"] = mh["[object Int8Array]"] = mh["[object Int16Array]"] = mh["[object Int32Array]"] = mh["[object Uint8Array]"] = mh["[object Uint8ClampedArray]"] = mh["[object Uint16Array]"] = mh["[object Uint32Array]"] = true, mh["[object Arguments]"] = mh["[object Array]"] = mh["[object ArrayBuffer]"] = mh["[object Boolean]"] = mh["[object DataView]"] = mh["[object Date]"] = mh["[object Error]"] = mh["[object Function]"] = mh["[object Map]"] = mh["[object Number]"] = mh["[object Object]"] = mh["[object RegExp]"] = mh["[object Set]"] = mh["[object String]"] = mh["[object WeakMap]"] = false; + var yh = "object" == ("undefined" == typeof exports ? "undefined" : Ho(exports)) && exports && !exports.nodeType && exports; + var bh = yh && "object" == ("undefined" == typeof module ? "undefined" : Ho(module)) && module && !module.nodeType && module; + var kh = bh && bh.exports === yh && au.process; + var wh = function() { + try { + var e20 = bh && bh.require && bh.require("util").types; + return e20 || kh && kh.binding && kh.binding("util"); + } catch (e21) { + } + }(); + var xh = wh && wh.isTypedArray; + var jh = xh ? gh(xh) : function(e20) { + return bu(e20) && Zd(e20.length) && !!mh[yu(e20)]; + }; + var Sh = Object.prototype.hasOwnProperty; + function Ch(e20, t10) { + var n10 = Cu(e20), r10 = !n10 && uh(e20), o10 = !n10 && !r10 && ph(e20), i10 = !n10 && !r10 && !o10 && jh(e20), a10 = n10 || r10 || o10 || i10, s10 = a10 ? ih(e20.length, String) : [], c10 = s10.length; + for (var l10 in e20) + !t10 && !Sh.call(e20, l10) || a10 && ("length" == l10 || o10 && ("offset" == l10 || "parent" == l10) || i10 && ("buffer" == l10 || "byteLength" == l10 || "byteOffset" == l10) || hd(l10, c10)) || s10.push(l10); + return s10; + } + function $h(e20, t10) { + return function(n10) { + return e20(t10(n10)); + }; + } + var _h = $h(Object.keys, Object); + var Oh = Object.prototype.hasOwnProperty; + function Mh(e20) { + if (!oh(e20)) + return _h(e20); + var t10 = []; + for (var n10 in Object(e20)) + Oh.call(e20, n10) && "constructor" != n10 && t10.push(n10); + return t10; + } + function Eh(e20) { + return eh(e20) ? Ch(e20) : Mh(e20); + } + var Ah = Object.prototype.hasOwnProperty; + var Ph = nh(function(e20, t10) { + if (oh(t10) || eh(t10)) + Kd(t10, Eh(t10), e20); + else + for (var n10 in t10) + Ah.call(t10, n10) && Jd(e20, n10, t10[n10]); + }); + var Th = Ph; + var Rh = Object.prototype.hasOwnProperty; + function Nh(e20) { + if (!Iu(e20)) + return function(e21) { + var t11 = []; + if (null != e21) + for (var n11 in Object(e21)) + t11.push(n11); + return t11; + }(e20); + var t10 = oh(e20), n10 = []; + for (var r10 in e20) + ("constructor" != r10 || !t10 && Rh.call(e20, r10)) && n10.push(r10); + return n10; + } + function Ih(e20) { + return eh(e20) ? Ch(e20, true) : Nh(e20); + } + var Dh = nh(function(e20, t10) { + Kd(t10, Ih(t10), e20); + }); + var qh = Dh; + var zh = nh(function(e20, t10, n10, r10) { + Kd(t10, Ih(t10), e20, r10); + }); + var Bh = zh; + var Lh = nh(function(e20, t10, n10, r10) { + Kd(t10, Eh(t10), e20, r10); + }); + var Fh = Lh; + var Vh = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var Hh = /^\w*$/; + function Wh(e20, t10) { + if (Cu(e20)) + return false; + var n10 = Ho(e20); + return !("number" != n10 && "symbol" != n10 && "boolean" != n10 && null != e20 && !wu(e20)) || (Hh.test(e20) || !Vh.test(e20) || null != t10 && e20 in Object(t10)); + } + var Uh = hf(Object, "create"); + var Jh = Object.prototype.hasOwnProperty; + var Kh = Object.prototype.hasOwnProperty; + function Gh(e20) { + var t10 = -1, n10 = null == e20 ? 0 : e20.length; + for (this.clear(); ++t10 < n10; ) { + var r10 = e20[t10]; + this.set(r10[0], r10[1]); + } + } + function Qh(e20, t10) { + for (var n10 = e20.length; n10--; ) + if (Wd(e20[n10][0], t10)) + return n10; + return -1; + } + Gh.prototype.clear = function() { + this.__data__ = Uh ? Uh(null) : {}, this.size = 0; + }, Gh.prototype.delete = function(e20) { + var t10 = this.has(e20) && delete this.__data__[e20]; + return this.size -= t10 ? 1 : 0, t10; + }, Gh.prototype.get = function(e20) { + var t10 = this.__data__; + if (Uh) { + var n10 = t10[e20]; + return "__lodash_hash_undefined__" === n10 ? void 0 : n10; + } + return Jh.call(t10, e20) ? t10[e20] : void 0; + }, Gh.prototype.has = function(e20) { + var t10 = this.__data__; + return Uh ? void 0 !== t10[e20] : Kh.call(t10, e20); + }, Gh.prototype.set = function(e20, t10) { + var n10 = this.__data__; + return this.size += this.has(e20) ? 0 : 1, n10[e20] = Uh && void 0 === t10 ? "__lodash_hash_undefined__" : t10, this; + }; + var Yh = Array.prototype.splice; + function Xh(e20) { + var t10 = -1, n10 = null == e20 ? 0 : e20.length; + for (this.clear(); ++t10 < n10; ) { + var r10 = e20[t10]; + this.set(r10[0], r10[1]); + } + } + Xh.prototype.clear = function() { + this.__data__ = [], this.size = 0; + }, Xh.prototype.delete = function(e20) { + var t10 = this.__data__, n10 = Qh(t10, e20); + return !(n10 < 0) && (n10 == t10.length - 1 ? t10.pop() : Yh.call(t10, n10, 1), --this.size, true); + }, Xh.prototype.get = function(e20) { + var t10 = this.__data__, n10 = Qh(t10, e20); + return n10 < 0 ? void 0 : t10[n10][1]; + }, Xh.prototype.has = function(e20) { + return Qh(this.__data__, e20) > -1; + }, Xh.prototype.set = function(e20, t10) { + var n10 = this.__data__, r10 = Qh(n10, e20); + return r10 < 0 ? (++this.size, n10.push([e20, t10])) : n10[r10][1] = t10, this; + }; + var Zh = hf(cu, "Map"); + function ev(e20, t10) { + var n10 = e20.__data__; + return function(e21) { + var t11 = Ho(e21); + return "string" == t11 || "number" == t11 || "symbol" == t11 || "boolean" == t11 ? "__proto__" !== e21 : null === e21; + }(t10) ? n10["string" == typeof t10 ? "string" : "hash"] : n10.map; + } + function tv(e20) { + var t10 = -1, n10 = null == e20 ? 0 : e20.length; + for (this.clear(); ++t10 < n10; ) { + var r10 = e20[t10]; + this.set(r10[0], r10[1]); + } + } + tv.prototype.clear = function() { + this.size = 0, this.__data__ = { hash: new Gh(), map: new (Zh || Xh)(), string: new Gh() }; + }, tv.prototype.delete = function(e20) { + var t10 = ev(this, e20).delete(e20); + return this.size -= t10 ? 1 : 0, t10; + }, tv.prototype.get = function(e20) { + return ev(this, e20).get(e20); + }, tv.prototype.has = function(e20) { + return ev(this, e20).has(e20); + }, tv.prototype.set = function(e20, t10) { + var n10 = ev(this, e20), r10 = n10.size; + return n10.set(e20, t10), this.size += n10.size == r10 ? 0 : 1, this; + }; + var nv = "Expected a function"; + function rv(e20, t10) { + if ("function" != typeof e20 || null != t10 && "function" != typeof t10) + throw new TypeError(nv); + var n10 = function n11() { + var r10 = arguments, o10 = t10 ? t10.apply(this, r10) : r10[0], i10 = n11.cache; + if (i10.has(o10)) + return i10.get(o10); + var a10 = e20.apply(this, r10); + return n11.cache = i10.set(o10, a10) || i10, a10; + }; + return n10.cache = new (rv.Cache || tv)(), n10; + } + rv.Cache = tv; + var ov = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var iv = /\\(\\)?/g; + var av = function(e20) { + var t10 = rv(e20, function(e21) { + return 500 === n10.size && n10.clear(), e21; + }), n10 = t10.cache; + return t10; + }(function(e20) { + var t10 = []; + return 46 === e20.charCodeAt(0) && t10.push(""), e20.replace(ov, function(e21, n10, r10, o10) { + t10.push(r10 ? o10.replace(iv, "$1") : n10 || e21); + }), t10; + }); + function sv(e20) { + return null == e20 ? "" : Mu(e20); + } + function cv(e20, t10) { + return Cu(e20) ? e20 : Wh(e20, t10) ? [e20] : av(sv(e20)); + } + var lv = 1 / 0; + function uv(e20) { + if ("string" == typeof e20 || wu(e20)) + return e20; + var t10 = e20 + ""; + return "0" == t10 && 1 / e20 == -lv ? "-0" : t10; + } + function fv(e20, t10) { + for (var n10 = 0, r10 = (t10 = cv(t10, e20)).length; null != e20 && n10 < r10; ) + e20 = e20[uv(t10[n10++])]; + return n10 && n10 == r10 ? e20 : void 0; + } + function dv(e20, t10, n10) { + var r10 = null == e20 ? void 0 : fv(e20, t10); + return void 0 === r10 ? n10 : r10; + } + function hv(e20, t10) { + for (var n10 = -1, r10 = t10.length, o10 = Array(r10), i10 = null == e20; ++n10 < r10; ) + o10[n10] = i10 ? void 0 : dv(e20, t10[n10]); + return o10; + } + function vv(e20, t10) { + for (var n10 = -1, r10 = t10.length, o10 = e20.length; ++n10 < r10; ) + e20[o10 + n10] = t10[n10]; + return e20; + } + var pv = lu ? lu.isConcatSpreadable : void 0; + function mv(e20) { + return Cu(e20) || uh(e20) || !!(pv && e20 && e20[pv]); + } + function gv(e20, t10, n10, r10, o10) { + var i10 = -1, a10 = e20.length; + for (n10 || (n10 = mv), o10 || (o10 = []); ++i10 < a10; ) { + var s10 = e20[i10]; + t10 > 0 && n10(s10) ? t10 > 1 ? gv(s10, t10 - 1, n10, r10, o10) : vv(o10, s10) : r10 || (o10[o10.length] = s10); + } + return o10; + } + function yv(e20) { + return (null == e20 ? 0 : e20.length) ? gv(e20, 1) : []; + } + function bv(e20) { + return Gf(Qd(e20, void 0, yv), e20 + ""); + } + var kv = bv(hv); + var wv = $h(Object.getPrototypeOf, Object); + var xv = "[object Object]"; + var jv = Function.prototype; + var Sv = Object.prototype; + var Cv = jv.toString; + var $v = Sv.hasOwnProperty; + var _v = Cv.call(Object); + function Ov(e20) { + if (!bu(e20) || yu(e20) != xv) + return false; + var t10 = wv(e20); + if (null === t10) + return true; + var n10 = $v.call(t10, "constructor") && t10.constructor; + return "function" == typeof n10 && n10 instanceof n10 && Cv.call(n10) == _v; + } + var Mv = "[object DOMException]"; + var Ev = "[object Error]"; + function Av(e20) { + if (!bu(e20)) + return false; + var t10 = yu(e20); + return t10 == Ev || t10 == Mv || "string" == typeof e20.message && "string" == typeof e20.name && !Ov(e20); + } + var Pv = Yd(function(e20, t10) { + try { + return wf(e20, void 0, t10); + } catch (e21) { + return Av(e21) ? e21 : new Error(e21); + } + }); + var Tv = Pv; + var Rv = "Expected a function"; + function Nv(e20, t10) { + var n10; + if ("function" != typeof t10) + throw new TypeError(Rv); + return e20 = Uu(e20), function() { + return --e20 > 0 && (n10 = t10.apply(this, arguments)), e20 <= 1 && (t10 = void 0), n10; + }; + } + var Iv = Yd(function(e20, t10, n10) { + var r10 = 1; + if (n10.length) { + var o10 = md(n10, ud(Iv)); + r10 |= 32; + } + return Ld(e20, r10, t10, n10, o10); + }); + Iv.placeholder = {}; + var Dv = Iv; + var qv = bv(function(e20, t10) { + return Qf(t10, function(t11) { + t11 = uv(t11), Hd(e20, t11, Dv(e20[t11], e20)); + }), e20; + }); + var zv = qv; + var Bv = Yd(function(e20, t10, n10) { + var r10 = 3; + if (n10.length) { + var o10 = md(n10, ud(Bv)); + r10 |= 32; + } + return Ld(t10, r10, e20, n10, o10); + }); + Bv.placeholder = {}; + var Lv = Bv; + function Fv(e20, t10, n10) { + var r10 = -1, o10 = e20.length; + t10 < 0 && (t10 = -t10 > o10 ? 0 : o10 + t10), (n10 = n10 > o10 ? o10 : n10) < 0 && (n10 += o10), o10 = t10 > n10 ? 0 : n10 - t10 >>> 0, t10 >>>= 0; + for (var i10 = Array(o10); ++r10 < o10; ) + i10[r10] = e20[r10 + t10]; + return i10; + } + function Vv(e20, t10, n10) { + var r10 = e20.length; + return n10 = void 0 === n10 ? r10 : n10, !t10 && n10 >= r10 ? e20 : Fv(e20, t10, n10); + } + var Hv = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"); + function Wv(e20) { + return Hv.test(e20); + } + var Uv = "\\ud800-\\udfff"; + var Jv = "[" + Uv + "]"; + var Kv = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]"; + var Gv = "\\ud83c[\\udffb-\\udfff]"; + var Qv = "[^" + Uv + "]"; + var Yv = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var Xv = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var Zv = "(?:" + Kv + "|" + Gv + ")?"; + var ep = "[\\ufe0e\\ufe0f]?"; + var tp = ep + Zv + ("(?:\\u200d(?:" + [Qv, Yv, Xv].join("|") + ")" + ep + Zv + ")*"); + var np = "(?:" + [Qv + Kv + "?", Kv, Yv, Xv, Jv].join("|") + ")"; + var rp = RegExp(Gv + "(?=" + Gv + ")|" + np + tp, "g"); + function op(e20) { + return Wv(e20) ? function(e21) { + return e21.match(rp) || []; + }(e20) : function(e21) { + return e21.split(""); + }(e20); + } + function ip(e20) { + return function(t10) { + var n10 = Wv(t10 = sv(t10)) ? op(t10) : void 0, r10 = n10 ? n10[0] : t10.charAt(0), o10 = n10 ? Vv(n10, 1).join("") : t10.slice(1); + return r10[e20]() + o10; + }; + } + var ap = ip("toUpperCase"); + function sp(e20) { + return ap(sv(e20).toLowerCase()); + } + function cp(e20, t10, n10, r10) { + var o10 = -1, i10 = null == e20 ? 0 : e20.length; + for (r10 && i10 && (n10 = e20[++o10]); ++o10 < i10; ) + n10 = t10(n10, e20[o10], o10, e20); + return n10; + } + function lp(e20) { + return function(t10) { + return null == e20 ? void 0 : e20[t10]; + }; + } + var up = lp({ "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\xC7": "C", "\xE7": "c", "\xD0": "D", "\xF0": "d", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\xD1": "N", "\xF1": "n", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\xDD": "Y", "\xFD": "y", "\xFF": "y", "\xC6": "Ae", "\xE6": "ae", "\xDE": "Th", "\xFE": "th", "\xDF": "ss", "\u0100": "A", "\u0102": "A", "\u0104": "A", "\u0101": "a", "\u0103": "a", "\u0105": "a", "\u0106": "C", "\u0108": "C", "\u010A": "C", "\u010C": "C", "\u0107": "c", "\u0109": "c", "\u010B": "c", "\u010D": "c", "\u010E": "D", "\u0110": "D", "\u010F": "d", "\u0111": "d", "\u0112": "E", "\u0114": "E", "\u0116": "E", "\u0118": "E", "\u011A": "E", "\u0113": "e", "\u0115": "e", "\u0117": "e", "\u0119": "e", "\u011B": "e", "\u011C": "G", "\u011E": "G", "\u0120": "G", "\u0122": "G", "\u011D": "g", "\u011F": "g", "\u0121": "g", "\u0123": "g", "\u0124": "H", "\u0126": "H", "\u0125": "h", "\u0127": "h", "\u0128": "I", "\u012A": "I", "\u012C": "I", "\u012E": "I", "\u0130": "I", "\u0129": "i", "\u012B": "i", "\u012D": "i", "\u012F": "i", "\u0131": "i", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u0138": "k", "\u0139": "L", "\u013B": "L", "\u013D": "L", "\u013F": "L", "\u0141": "L", "\u013A": "l", "\u013C": "l", "\u013E": "l", "\u0140": "l", "\u0142": "l", "\u0143": "N", "\u0145": "N", "\u0147": "N", "\u014A": "N", "\u0144": "n", "\u0146": "n", "\u0148": "n", "\u014B": "n", "\u014C": "O", "\u014E": "O", "\u0150": "O", "\u014D": "o", "\u014F": "o", "\u0151": "o", "\u0154": "R", "\u0156": "R", "\u0158": "R", "\u0155": "r", "\u0157": "r", "\u0159": "r", "\u015A": "S", "\u015C": "S", "\u015E": "S", "\u0160": "S", "\u015B": "s", "\u015D": "s", "\u015F": "s", "\u0161": "s", "\u0162": "T", "\u0164": "T", "\u0166": "T", "\u0163": "t", "\u0165": "t", "\u0167": "t", "\u0168": "U", "\u016A": "U", "\u016C": "U", "\u016E": "U", "\u0170": "U", "\u0172": "U", "\u0169": "u", "\u016B": "u", "\u016D": "u", "\u016F": "u", "\u0171": "u", "\u0173": "u", "\u0174": "W", "\u0175": "w", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "\u0179": "Z", "\u017B": "Z", "\u017D": "Z", "\u017A": "z", "\u017C": "z", "\u017E": "z", "\u0132": "IJ", "\u0133": "ij", "\u0152": "Oe", "\u0153": "oe", "\u0149": "'n", "\u017F": "s" }); + var fp = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var dp = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g"); + function hp(e20) { + return (e20 = sv(e20)) && e20.replace(fp, up).replace(dp, ""); + } + var vp = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var pp = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var mp = "\\ud800-\\udfff"; + var gp = "\\u2700-\\u27bf"; + var yp = "a-z\\xdf-\\xf6\\xf8-\\xff"; + var bp = "A-Z\\xc0-\\xd6\\xd8-\\xde"; + var kp = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"; + var wp = "[" + kp + "]"; + var xp = "\\d+"; + var jp = "[" + gp + "]"; + var Sp = "[" + yp + "]"; + var Cp = "[^" + mp + kp + xp + gp + yp + bp + "]"; + var $p = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var _p = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var Op = "[" + bp + "]"; + var Mp = "(?:" + Sp + "|" + Cp + ")"; + var Ep = "(?:" + Op + "|" + Cp + ")"; + var Ap = "(?:['\u2019](?:d|ll|m|re|s|t|ve))?"; + var Pp = "(?:['\u2019](?:D|LL|M|RE|S|T|VE))?"; + var Tp = "(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?"; + var Rp = "[\\ufe0e\\ufe0f]?"; + var Np = Rp + Tp + ("(?:\\u200d(?:" + ["[^" + mp + "]", $p, _p].join("|") + ")" + Rp + Tp + ")*"); + var Ip = "(?:" + [jp, $p, _p].join("|") + ")" + Np; + var Dp = RegExp([Op + "?" + Sp + "+" + Ap + "(?=" + [wp, Op, "$"].join("|") + ")", Ep + "+" + Pp + "(?=" + [wp, Op + Mp, "$"].join("|") + ")", Op + "?" + Mp + "+" + Ap, Op + "+" + Pp, "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", xp, Ip].join("|"), "g"); + function qp(e20, t10, n10) { + return e20 = sv(e20), void 0 === (t10 = n10 ? void 0 : t10) ? function(e21) { + return pp.test(e21); + }(e20) ? function(e21) { + return e21.match(Dp) || []; + }(e20) : function(e21) { + return e21.match(vp) || []; + }(e20) : e20.match(t10) || []; + } + var zp = RegExp("['\u2019]", "g"); + function Bp(e20) { + return function(t10) { + return cp(qp(hp(t10).replace(zp, "")), e20, ""); + }; + } + var Lp = Bp(function(e20, t10, n10) { + return t10 = t10.toLowerCase(), e20 + (n10 ? sp(t10) : t10); + }); + var Fp = Lp; + function Vp() { + if (!arguments.length) + return []; + var e20 = arguments[0]; + return Cu(e20) ? e20 : [e20]; + } + var Hp = cu.isFinite; + var Wp = Math.min; + function Up(e20) { + var t10 = Math[e20]; + return function(e21, n10) { + if (e21 = Fu(e21), (n10 = null == n10 ? 0 : Wp(Uu(n10), 292)) && Hp(e21)) { + var r10 = (sv(e21) + "e").split("e"); + return +((r10 = (sv(t10(r10[0] + "e" + (+r10[1] + n10))) + "e").split("e"))[0] + "e" + (+r10[1] - n10)); + } + return t10(e21); + }; + } + var Jp = Up("ceil"); + function Kp(e20) { + var t10 = qf(e20); + return t10.__chain__ = true, t10; + } + var Gp = Math.ceil; + var Qp = Math.max; + function Yp(e20, t10, n10) { + t10 = (n10 ? th(e20, t10, n10) : void 0 === t10) ? 1 : Qp(Uu(t10), 0); + var r10 = null == e20 ? 0 : e20.length; + if (!r10 || t10 < 1) + return []; + for (var o10 = 0, i10 = 0, a10 = Array(Gp(r10 / t10)); o10 < r10; ) + a10[i10++] = Fv(e20, o10, o10 += t10); + return a10; + } + function Xp(e20, t10, n10) { + return e20 == e20 && (void 0 !== n10 && (e20 = e20 <= n10 ? e20 : n10), void 0 !== t10 && (e20 = e20 >= t10 ? e20 : t10)), e20; + } + function Zp(e20, t10, n10) { + return void 0 === n10 && (n10 = t10, t10 = void 0), void 0 !== n10 && (n10 = (n10 = Fu(n10)) == n10 ? n10 : 0), void 0 !== t10 && (t10 = (t10 = Fu(t10)) == t10 ? t10 : 0), Xp(Fu(e20), t10, n10); + } + function em(e20) { + var t10 = this.__data__ = new Xh(e20); + this.size = t10.size; + } + function tm(e20, t10) { + return e20 && Kd(t10, Eh(t10), e20); + } + em.prototype.clear = function() { + this.__data__ = new Xh(), this.size = 0; + }, em.prototype.delete = function(e20) { + var t10 = this.__data__, n10 = t10.delete(e20); + return this.size = t10.size, n10; + }, em.prototype.get = function(e20) { + return this.__data__.get(e20); + }, em.prototype.has = function(e20) { + return this.__data__.has(e20); + }, em.prototype.set = function(e20, t10) { + var n10 = this.__data__; + if (n10 instanceof Xh) { + var r10 = n10.__data__; + if (!Zh || r10.length < 199) + return r10.push([e20, t10]), this.size = ++n10.size, this; + n10 = this.__data__ = new tv(r10); + } + return n10.set(e20, t10), this.size = n10.size, this; + }; + var nm = "object" == ("undefined" == typeof exports ? "undefined" : Ho(exports)) && exports && !exports.nodeType && exports; + var rm = nm && "object" == ("undefined" == typeof module ? "undefined" : Ho(module)) && module && !module.nodeType && module; + var om = rm && rm.exports === nm ? cu.Buffer : void 0; + var im = om ? om.allocUnsafe : void 0; + function am(e20, t10) { + if (t10) + return e20.slice(); + var n10 = e20.length, r10 = im ? im(n10) : new e20.constructor(n10); + return e20.copy(r10), r10; + } + function sm(e20, t10) { + for (var n10 = -1, r10 = null == e20 ? 0 : e20.length, o10 = 0, i10 = []; ++n10 < r10; ) { + var a10 = e20[n10]; + t10(a10, n10, e20) && (i10[o10++] = a10); + } + return i10; + } + function cm() { + return []; + } + var lm = Object.prototype.propertyIsEnumerable; + var um = Object.getOwnPropertySymbols; + var fm = um ? function(e20) { + return null == e20 ? [] : (e20 = Object(e20), sm(um(e20), function(t10) { + return lm.call(e20, t10); + })); + } : cm; + var dm = Object.getOwnPropertySymbols ? function(e20) { + for (var t10 = []; e20; ) + vv(t10, fm(e20)), e20 = wv(e20); + return t10; + } : cm; + function hm(e20, t10, n10) { + var r10 = t10(e20); + return Cu(e20) ? r10 : vv(r10, n10(e20)); + } + function vm(e20) { + return hm(e20, Eh, fm); + } + function pm(e20) { + return hm(e20, Ih, dm); + } + var mm = hf(cu, "DataView"); + var gm = hf(cu, "Promise"); + var ym = hf(cu, "Set"); + var bm = "[object Map]"; + var km = "[object Promise]"; + var wm = "[object Set]"; + var xm = "[object WeakMap]"; + var jm = "[object DataView]"; + var Sm = of(mm); + var Cm = of(Zh); + var $m = of(gm); + var _m = of(ym); + var Om = of(vf); + var Mm = yu; + (mm && Mm(new mm(new ArrayBuffer(1))) != jm || Zh && Mm(new Zh()) != bm || gm && Mm(gm.resolve()) != km || ym && Mm(new ym()) != wm || vf && Mm(new vf()) != xm) && (Mm = function(e20) { + var t10 = yu(e20), n10 = "[object Object]" == t10 ? e20.constructor : void 0, r10 = n10 ? of(n10) : ""; + if (r10) + switch (r10) { + case Sm: + return jm; + case Cm: + return bm; + case $m: + return km; + case _m: + return wm; + case Om: + return xm; + } + return t10; + }); + var Em = Mm; + var Am = Object.prototype.hasOwnProperty; + var Pm = cu.Uint8Array; + function Tm(e20) { + var t10 = new e20.constructor(e20.byteLength); + return new Pm(t10).set(new Pm(e20)), t10; + } + var Rm = /\w*$/; + var Nm = lu ? lu.prototype : void 0; + var Im = Nm ? Nm.valueOf : void 0; + function Dm(e20, t10) { + var n10 = t10 ? Tm(e20.buffer) : e20.buffer; + return new e20.constructor(n10, e20.byteOffset, e20.length); + } + var qm = "[object Boolean]"; + var zm = "[object Date]"; + var Bm = "[object Map]"; + var Lm = "[object Number]"; + var Fm = "[object RegExp]"; + var Vm = "[object Set]"; + var Hm = "[object String]"; + var Wm = "[object Symbol]"; + var Um = "[object ArrayBuffer]"; + var Jm = "[object DataView]"; + var Km = "[object Float32Array]"; + var Gm = "[object Float64Array]"; + var Qm = "[object Int8Array]"; + var Ym = "[object Int16Array]"; + var Xm = "[object Int32Array]"; + var Zm = "[object Uint8Array]"; + var eg = "[object Uint8ClampedArray]"; + var tg = "[object Uint16Array]"; + var ng = "[object Uint32Array]"; + function rg(e20, t10, n10) { + var r10, o10 = e20.constructor; + switch (t10) { + case Um: + return Tm(e20); + case qm: + case zm: + return new o10(+e20); + case Jm: + return function(e21, t11) { + var n11 = t11 ? Tm(e21.buffer) : e21.buffer; + return new e21.constructor(n11, e21.byteOffset, e21.byteLength); + }(e20, n10); + case Km: + case Gm: + case Qm: + case Ym: + case Xm: + case Zm: + case eg: + case tg: + case ng: + return Dm(e20, n10); + case Bm: + return new o10(); + case Lm: + case Hm: + return new o10(e20); + case Fm: + return function(e21) { + var t11 = new e21.constructor(e21.source, Rm.exec(e21)); + return t11.lastIndex = e21.lastIndex, t11; + }(e20); + case Vm: + return new o10(); + case Wm: + return r10 = e20, Im ? Object(Im.call(r10)) : {}; + } + } + function og(e20) { + return "function" != typeof e20.constructor || oh(e20) ? {} : yf(wv(e20)); + } + var ig = wh && wh.isMap; + var ag = ig ? gh(ig) : function(e20) { + return bu(e20) && "[object Map]" == Em(e20); + }; + var sg = wh && wh.isSet; + var cg = sg ? gh(sg) : function(e20) { + return bu(e20) && "[object Set]" == Em(e20); + }; + var lg = 1; + var ug = 2; + var fg = 4; + var dg = "[object Arguments]"; + var hg = "[object Function]"; + var vg = "[object GeneratorFunction]"; + var pg = "[object Object]"; + var mg = {}; + function gg(e20, t10, n10, r10, o10, i10) { + var a10, s10 = t10 & lg, c10 = t10 & ug, l10 = t10 & fg; + if (n10 && (a10 = o10 ? n10(e20, r10, o10, i10) : n10(e20)), void 0 !== a10) + return a10; + if (!Iu(e20)) + return e20; + var u10 = Cu(e20); + if (u10) { + if (a10 = function(e21) { + var t11 = e21.length, n11 = new e21.constructor(t11); + return t11 && "string" == typeof e21[0] && Am.call(e21, "index") && (n11.index = e21.index, n11.input = e21.input), n11; + }(e20), !s10) + return Nf(e20, a10); + } else { + var f10 = Em(e20), d10 = f10 == hg || f10 == vg; + if (ph(e20)) + return am(e20, s10); + if (f10 == pg || f10 == dg || d10 && !o10) { + if (a10 = c10 || d10 ? {} : og(e20), !s10) + return c10 ? function(e21, t11) { + return Kd(e21, dm(e21), t11); + }(e20, function(e21, t11) { + return e21 && Kd(t11, Ih(t11), e21); + }(a10, e20)) : function(e21, t11) { + return Kd(e21, fm(e21), t11); + }(e20, tm(a10, e20)); + } else { + if (!mg[f10]) + return o10 ? e20 : {}; + a10 = rg(e20, f10, s10); + } + } + i10 || (i10 = new em()); + var h10 = i10.get(e20); + if (h10) + return h10; + i10.set(e20, a10), cg(e20) ? e20.forEach(function(r11) { + a10.add(gg(r11, t10, n10, r11, e20, i10)); + }) : ag(e20) && e20.forEach(function(r11, o11) { + a10.set(o11, gg(r11, t10, n10, o11, e20, i10)); + }); + var v10 = u10 ? void 0 : (l10 ? c10 ? pm : vm : c10 ? Ih : Eh)(e20); + return Qf(v10 || e20, function(r11, o11) { + v10 && (r11 = e20[o11 = r11]), Jd(a10, o11, gg(r11, t10, n10, o11, e20, i10)); + }), a10; + } + mg[dg] = mg["[object Array]"] = mg["[object ArrayBuffer]"] = mg["[object DataView]"] = mg["[object Boolean]"] = mg["[object Date]"] = mg["[object Float32Array]"] = mg["[object Float64Array]"] = mg["[object Int8Array]"] = mg["[object Int16Array]"] = mg["[object Int32Array]"] = mg["[object Map]"] = mg["[object Number]"] = mg[pg] = mg["[object RegExp]"] = mg["[object Set]"] = mg["[object String]"] = mg["[object Symbol]"] = mg["[object Uint8Array]"] = mg["[object Uint8ClampedArray]"] = mg["[object Uint16Array]"] = mg["[object Uint32Array]"] = true, mg["[object Error]"] = mg[hg] = mg["[object WeakMap]"] = false; + function yg(e20) { + return gg(e20, 4); + } + function bg(e20) { + return gg(e20, 5); + } + var kg = 1; + var wg = 4; + function xg(e20, t10) { + return gg(e20, kg | wg, t10 = "function" == typeof t10 ? t10 : void 0); + } + function jg(e20, t10) { + return gg(e20, 4, t10 = "function" == typeof t10 ? t10 : void 0); + } + function Sg() { + return new Rf(this.value(), this.__chain__); + } + function Cg(e20) { + for (var t10 = -1, n10 = null == e20 ? 0 : e20.length, r10 = 0, o10 = []; ++t10 < n10; ) { + var i10 = e20[t10]; + i10 && (o10[r10++] = i10); + } + return o10; + } + function $g() { + var e20 = arguments.length; + if (!e20) + return []; + for (var t10 = Array(e20 - 1), n10 = arguments[0], r10 = e20; r10--; ) + t10[r10 - 1] = arguments[r10]; + return vv(Cu(n10) ? Nf(n10) : [n10], gv(t10, 1)); + } + function _g(e20) { + var t10 = -1, n10 = null == e20 ? 0 : e20.length; + for (this.__data__ = new tv(); ++t10 < n10; ) + this.add(e20[t10]); + } + function Og(e20, t10) { + for (var n10 = -1, r10 = null == e20 ? 0 : e20.length; ++n10 < r10; ) + if (t10(e20[n10], n10, e20)) + return true; + return false; + } + function Mg(e20, t10) { + return e20.has(t10); + } + _g.prototype.add = _g.prototype.push = function(e20) { + return this.__data__.set(e20, "__lodash_hash_undefined__"), this; + }, _g.prototype.has = function(e20) { + return this.__data__.has(e20); + }; + var Eg = 1; + var Ag = 2; + function Pg(e20, t10, n10, r10, o10, i10) { + var a10 = n10 & Eg, s10 = e20.length, c10 = t10.length; + if (s10 != c10 && !(a10 && c10 > s10)) + return false; + var l10 = i10.get(e20), u10 = i10.get(t10); + if (l10 && u10) + return l10 == t10 && u10 == e20; + var f10 = -1, d10 = true, h10 = n10 & Ag ? new _g() : void 0; + for (i10.set(e20, t10), i10.set(t10, e20); ++f10 < s10; ) { + var v10 = e20[f10], p10 = t10[f10]; + if (r10) + var m10 = a10 ? r10(p10, v10, f10, t10, e20, i10) : r10(v10, p10, f10, e20, t10, i10); + if (void 0 !== m10) { + if (m10) + continue; + d10 = false; + break; + } + if (h10) { + if (!Og(t10, function(e21, t11) { + if (!Mg(h10, t11) && (v10 === e21 || o10(v10, e21, n10, r10, i10))) + return h10.push(t11); + })) { + d10 = false; + break; + } + } else if (v10 !== p10 && !o10(v10, p10, n10, r10, i10)) { + d10 = false; + break; + } + } + return i10.delete(e20), i10.delete(t10), d10; + } + function Tg(e20) { + var t10 = -1, n10 = Array(e20.size); + return e20.forEach(function(e21, r10) { + n10[++t10] = [r10, e21]; + }), n10; + } + function Rg(e20) { + var t10 = -1, n10 = Array(e20.size); + return e20.forEach(function(e21) { + n10[++t10] = e21; + }), n10; + } + var Ng = 1; + var Ig = 2; + var Dg = "[object Boolean]"; + var qg = "[object Date]"; + var zg = "[object Error]"; + var Bg = "[object Map]"; + var Lg = "[object Number]"; + var Fg = "[object RegExp]"; + var Vg = "[object Set]"; + var Hg = "[object String]"; + var Wg = "[object Symbol]"; + var Ug = "[object ArrayBuffer]"; + var Jg = "[object DataView]"; + var Kg = lu ? lu.prototype : void 0; + var Gg = Kg ? Kg.valueOf : void 0; + var Qg = 1; + var Yg = Object.prototype.hasOwnProperty; + var Xg = 1; + var Zg = "[object Arguments]"; + var ey = "[object Array]"; + var ty = "[object Object]"; + var ny = Object.prototype.hasOwnProperty; + function ry(e20, t10, n10, r10, o10, i10) { + var a10 = Cu(e20), s10 = Cu(t10), c10 = a10 ? ey : Em(e20), l10 = s10 ? ey : Em(t10), u10 = (c10 = c10 == Zg ? ty : c10) == ty, f10 = (l10 = l10 == Zg ? ty : l10) == ty, d10 = c10 == l10; + if (d10 && ph(e20)) { + if (!ph(t10)) + return false; + a10 = true, u10 = false; + } + if (d10 && !u10) + return i10 || (i10 = new em()), a10 || jh(e20) ? Pg(e20, t10, n10, r10, o10, i10) : function(e21, t11, n11, r11, o11, i11, a11) { + switch (n11) { + case Jg: + if (e21.byteLength != t11.byteLength || e21.byteOffset != t11.byteOffset) + return false; + e21 = e21.buffer, t11 = t11.buffer; + case Ug: + return !(e21.byteLength != t11.byteLength || !i11(new Pm(e21), new Pm(t11))); + case Dg: + case qg: + case Lg: + return Wd(+e21, +t11); + case zg: + return e21.name == t11.name && e21.message == t11.message; + case Fg: + case Hg: + return e21 == t11 + ""; + case Bg: + var s11 = Tg; + case Vg: + var c11 = r11 & Ng; + if (s11 || (s11 = Rg), e21.size != t11.size && !c11) + return false; + var l11 = a11.get(e21); + if (l11) + return l11 == t11; + r11 |= Ig, a11.set(e21, t11); + var u11 = Pg(s11(e21), s11(t11), r11, o11, i11, a11); + return a11.delete(e21), u11; + case Wg: + if (Gg) + return Gg.call(e21) == Gg.call(t11); + } + return false; + }(e20, t10, c10, n10, r10, o10, i10); + if (!(n10 & Xg)) { + var h10 = u10 && ny.call(e20, "__wrapped__"), v10 = f10 && ny.call(t10, "__wrapped__"); + if (h10 || v10) { + var p10 = h10 ? e20.value() : e20, m10 = v10 ? t10.value() : t10; + return i10 || (i10 = new em()), o10(p10, m10, n10, r10, i10); + } + } + return !!d10 && (i10 || (i10 = new em()), function(e21, t11, n11, r11, o11, i11) { + var a11 = n11 & Qg, s11 = vm(e21), c11 = s11.length; + if (c11 != vm(t11).length && !a11) + return false; + for (var l11 = c11; l11--; ) { + var u11 = s11[l11]; + if (!(a11 ? u11 in t11 : Yg.call(t11, u11))) + return false; + } + var f11 = i11.get(e21), d11 = i11.get(t11); + if (f11 && d11) + return f11 == t11 && d11 == e21; + var h11 = true; + i11.set(e21, t11), i11.set(t11, e21); + for (var v11 = a11; ++l11 < c11; ) { + var p11 = e21[u11 = s11[l11]], m11 = t11[u11]; + if (r11) + var g10 = a11 ? r11(m11, p11, u11, t11, e21, i11) : r11(p11, m11, u11, e21, t11, i11); + if (!(void 0 === g10 ? p11 === m11 || o11(p11, m11, n11, r11, i11) : g10)) { + h11 = false; + break; + } + v11 || (v11 = "constructor" == u11); + } + if (h11 && !v11) { + var y10 = e21.constructor, b10 = t11.constructor; + y10 == b10 || !("constructor" in e21) || !("constructor" in t11) || "function" == typeof y10 && y10 instanceof y10 && "function" == typeof b10 && b10 instanceof b10 || (h11 = false); + } + return i11.delete(e21), i11.delete(t11), h11; + }(e20, t10, n10, r10, o10, i10)); + } + function oy(e20, t10, n10, r10, o10) { + return e20 === t10 || (null == e20 || null == t10 || !bu(e20) && !bu(t10) ? e20 != e20 && t10 != t10 : ry(e20, t10, n10, r10, oy, o10)); + } + var iy = 1; + var ay = 2; + function sy(e20, t10, n10, r10) { + var o10 = n10.length, i10 = o10, a10 = !r10; + if (null == e20) + return !i10; + for (e20 = Object(e20); o10--; ) { + var s10 = n10[o10]; + if (a10 && s10[2] ? s10[1] !== e20[s10[0]] : !(s10[0] in e20)) + return false; + } + for (; ++o10 < i10; ) { + var c10 = (s10 = n10[o10])[0], l10 = e20[c10], u10 = s10[1]; + if (a10 && s10[2]) { + if (void 0 === l10 && !(c10 in e20)) + return false; + } else { + var f10 = new em(); + if (r10) + var d10 = r10(l10, u10, c10, e20, t10, f10); + if (!(void 0 === d10 ? oy(u10, l10, iy | ay, r10, f10) : d10)) + return false; + } + } + return true; + } + function cy(e20) { + return e20 == e20 && !Iu(e20); + } + function ly(e20) { + for (var t10 = Eh(e20), n10 = t10.length; n10--; ) { + var r10 = t10[n10], o10 = e20[r10]; + t10[n10] = [r10, o10, cy(o10)]; + } + return t10; + } + function uy(e20, t10) { + return function(n10) { + return null != n10 && (n10[e20] === t10 && (void 0 !== t10 || e20 in Object(n10))); + }; + } + function fy(e20) { + var t10 = ly(e20); + return 1 == t10.length && t10[0][2] ? uy(t10[0][0], t10[0][1]) : function(n10) { + return n10 === e20 || sy(n10, e20, t10); + }; + } + function dy(e20, t10) { + return null != e20 && t10 in Object(e20); + } + function hy(e20, t10, n10) { + for (var r10 = -1, o10 = (t10 = cv(t10, e20)).length, i10 = false; ++r10 < o10; ) { + var a10 = uv(t10[r10]); + if (!(i10 = null != e20 && n10(e20, a10))) + break; + e20 = e20[a10]; + } + return i10 || ++r10 != o10 ? i10 : !!(o10 = null == e20 ? 0 : e20.length) && Zd(o10) && hd(a10, o10) && (Cu(e20) || uh(e20)); + } + function vy(e20, t10) { + return null != e20 && hy(e20, t10, dy); + } + var py = 1; + var my = 2; + function gy(e20, t10) { + return Wh(e20) && cy(t10) ? uy(uv(e20), t10) : function(n10) { + var r10 = dv(n10, e20); + return void 0 === r10 && r10 === t10 ? vy(n10, e20) : oy(t10, r10, py | my); + }; + } + function yy(e20) { + return function(t10) { + return null == t10 ? void 0 : t10[e20]; + }; + } + function by(e20) { + return Wh(e20) ? yy(uv(e20)) : /* @__PURE__ */ function(e21) { + return function(t10) { + return fv(t10, e21); + }; + }(e20); + } + function ky(e20) { + return "function" == typeof e20 ? e20 : null == e20 ? Ku : "object" == Ho(e20) ? Cu(e20) ? gy(e20[0], e20[1]) : fy(e20) : by(e20); + } + function wy(e20) { + var t10 = null == e20 ? 0 : e20.length, n10 = ky; + return e20 = t10 ? Su(e20, function(e21) { + if ("function" != typeof e21[1]) + throw new TypeError("Expected a function"); + return [n10(e21[0]), e21[1]]; + }) : [], Yd(function(n11) { + for (var r10 = -1; ++r10 < t10; ) { + var o10 = e20[r10]; + if (wf(o10[0], this, n11)) + return wf(o10[1], this, n11); + } + }); + } + function xy(e20, t10, n10) { + var r10 = n10.length; + if (null == e20) + return !r10; + for (e20 = Object(e20); r10--; ) { + var o10 = n10[r10], i10 = t10[o10], a10 = e20[o10]; + if (void 0 === a10 && !(o10 in e20) || !i10(a10)) + return false; + } + return true; + } + function jy(e20) { + return function(e21) { + var t10 = Eh(e21); + return function(n10) { + return xy(n10, e21, t10); + }; + }(gg(e20, 1)); + } + function Sy(e20, t10) { + return null == t10 || xy(e20, t10, Eh(t10)); + } + function Cy(e20, t10, n10, r10) { + for (var o10 = -1, i10 = null == e20 ? 0 : e20.length; ++o10 < i10; ) { + var a10 = e20[o10]; + t10(r10, a10, n10(a10), e20); + } + return r10; + } + function $y(e20) { + return function(t10, n10, r10) { + for (var o10 = -1, i10 = Object(t10), a10 = r10(t10), s10 = a10.length; s10--; ) { + var c10 = a10[e20 ? s10 : ++o10]; + if (false === n10(i10[c10], c10, i10)) + break; + } + return t10; + }; + } + var _y = $y(); + function Oy(e20, t10) { + return e20 && _y(e20, t10, Eh); + } + function My(e20, t10) { + return function(n10, r10) { + if (null == n10) + return n10; + if (!eh(n10)) + return e20(n10, r10); + for (var o10 = n10.length, i10 = t10 ? o10 : -1, a10 = Object(n10); (t10 ? i10-- : ++i10 < o10) && false !== r10(a10[i10], i10, a10); ) + ; + return n10; + }; + } + var Ey = My(Oy); + function Ay(e20, t10, n10, r10) { + return Ey(e20, function(e21, o10, i10) { + t10(r10, e21, n10(e21), i10); + }), r10; + } + function Py(e20, t10) { + return function(n10, r10) { + var o10 = Cu(n10) ? Cy : Ay, i10 = t10 ? t10() : {}; + return o10(n10, e20, ky(r10), i10); + }; + } + var Ty = Object.prototype.hasOwnProperty; + var Ry = Py(function(e20, t10, n10) { + Ty.call(e20, n10) ? ++e20[n10] : Hd(e20, n10, 1); + }); + var Ny = Ry; + function Iy(e20, t10) { + var n10 = yf(e20); + return null == t10 ? n10 : tm(n10, t10); + } + function Dy(e20, t10, n10) { + var r10 = Ld(e20, 8, void 0, void 0, void 0, void 0, void 0, t10 = n10 ? void 0 : t10); + return r10.placeholder = Dy.placeholder, r10; + } + Dy.placeholder = {}; + function qy(e20, t10, n10) { + var r10 = Ld(e20, 16, void 0, void 0, void 0, void 0, void 0, t10 = n10 ? void 0 : t10); + return r10.placeholder = qy.placeholder, r10; + } + qy.placeholder = {}; + var zy = function() { + return cu.Date.now(); + }; + var By = "Expected a function"; + var Ly = Math.max; + var Fy = Math.min; + function Vy(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10 = 0, u10 = false, f10 = false, d10 = true; + if ("function" != typeof e20) + throw new TypeError(By); + function h10(t11) { + var n11 = r10, i11 = o10; + return r10 = o10 = void 0, l10 = t11, a10 = e20.apply(i11, n11); + } + function v10(e21) { + var n11 = e21 - c10; + return void 0 === c10 || n11 >= t10 || n11 < 0 || f10 && e21 - l10 >= i10; + } + function p10() { + var e21 = zy(); + if (v10(e21)) + return m10(e21); + s10 = setTimeout(p10, function(e23) { + var n11 = t10 - (e23 - c10); + return f10 ? Fy(n11, i10 - (e23 - l10)) : n11; + }(e21)); + } + function m10(e21) { + return s10 = void 0, d10 && r10 ? h10(e21) : (r10 = o10 = void 0, a10); + } + function g10() { + var e21 = zy(), n11 = v10(e21); + if (r10 = arguments, o10 = this, c10 = e21, n11) { + if (void 0 === s10) + return function(e23) { + return l10 = e23, s10 = setTimeout(p10, t10), u10 ? h10(e23) : a10; + }(c10); + if (f10) + return clearTimeout(s10), s10 = setTimeout(p10, t10), h10(c10); + } + return void 0 === s10 && (s10 = setTimeout(p10, t10)), a10; + } + return t10 = Fu(t10) || 0, Iu(n10) && (u10 = !!n10.leading, i10 = (f10 = "maxWait" in n10) ? Ly(Fu(n10.maxWait) || 0, t10) : i10, d10 = "trailing" in n10 ? !!n10.trailing : d10), g10.cancel = function() { + void 0 !== s10 && clearTimeout(s10), l10 = 0, r10 = c10 = o10 = s10 = void 0; + }, g10.flush = function() { + return void 0 === s10 ? a10 : m10(zy()); + }, g10; + } + function Hy(e20, t10) { + return null == e20 || e20 != e20 ? t10 : e20; + } + var Wy = Object.prototype; + var Uy = Wy.hasOwnProperty; + var Jy = Yd(function(e20, t10) { + e20 = Object(e20); + var n10 = -1, r10 = t10.length, o10 = r10 > 2 ? t10[2] : void 0; + for (o10 && th(t10[0], t10[1], o10) && (r10 = 1); ++n10 < r10; ) + for (var i10 = t10[n10], a10 = Ih(i10), s10 = -1, c10 = a10.length; ++s10 < c10; ) { + var l10 = a10[s10], u10 = e20[l10]; + (void 0 === u10 || Wd(u10, Wy[l10]) && !Uy.call(e20, l10)) && (e20[l10] = i10[l10]); + } + return e20; + }); + var Ky = Jy; + function Gy(e20, t10, n10) { + (void 0 !== n10 && !Wd(e20[t10], n10) || void 0 === n10 && !(t10 in e20)) && Hd(e20, t10, n10); + } + function Qy(e20) { + return bu(e20) && eh(e20); + } + function Yy(e20, t10) { + if (("constructor" !== t10 || "function" != typeof e20[t10]) && "__proto__" != t10) + return e20[t10]; + } + function Xy(e20) { + return Kd(e20, Ih(e20)); + } + function Zy(e20, t10, n10, r10, o10) { + e20 !== t10 && _y(t10, function(i10, a10) { + if (o10 || (o10 = new em()), Iu(i10)) + !function(e21, t11, n11, r11, o11, i11, a11) { + var s11 = Yy(e21, n11), c10 = Yy(t11, n11), l10 = a11.get(c10); + if (l10) + Gy(e21, n11, l10); + else { + var u10 = i11 ? i11(s11, c10, n11 + "", e21, t11, a11) : void 0, f10 = void 0 === u10; + if (f10) { + var d10 = Cu(c10), h10 = !d10 && ph(c10), v10 = !d10 && !h10 && jh(c10); + u10 = c10, d10 || h10 || v10 ? Cu(s11) ? u10 = s11 : Qy(s11) ? u10 = Nf(s11) : h10 ? (f10 = false, u10 = am(c10, true)) : v10 ? (f10 = false, u10 = Dm(c10, true)) : u10 = [] : Ov(c10) || uh(c10) ? (u10 = s11, uh(s11) ? u10 = Xy(s11) : Iu(s11) && !Zu(s11) || (u10 = og(c10))) : f10 = false; + } + f10 && (a11.set(c10, u10), o11(u10, c10, r11, i11, a11), a11.delete(c10)), Gy(e21, n11, u10); + } + }(e20, t10, a10, n10, Zy, r10, o10); + else { + var s10 = r10 ? r10(Yy(e20, a10), i10, a10 + "", e20, t10, o10) : void 0; + void 0 === s10 && (s10 = i10), Gy(e20, a10, s10); + } + }, Ih); + } + function eb(e20, t10, n10, r10, o10, i10) { + return Iu(e20) && Iu(t10) && (i10.set(t10, e20), Zy(e20, t10, void 0, eb, i10), i10.delete(t10)), e20; + } + var tb = nh(function(e20, t10, n10, r10) { + Zy(e20, t10, n10, r10); + }); + var nb = tb; + var rb = Yd(function(e20) { + return e20.push(void 0, eb), wf(nb, void 0, e20); + }); + function ob(e20, t10, n10) { + if ("function" != typeof e20) + throw new TypeError("Expected a function"); + return setTimeout(function() { + e20.apply(void 0, n10); + }, t10); + } + var ib = Yd(function(e20, t10) { + return ob(e20, 1, t10); + }); + var ab = ib; + var sb = Yd(function(e20, t10, n10) { + return ob(e20, Fu(t10) || 0, n10); + }); + var cb = sb; + function lb(e20, t10, n10) { + for (var r10 = -1, o10 = null == e20 ? 0 : e20.length; ++r10 < o10; ) + if (n10(t10, e20[r10])) + return true; + return false; + } + var ub = 200; + function fb(e20, t10, n10, r10) { + var o10 = -1, i10 = ed, a10 = true, s10 = e20.length, c10 = [], l10 = t10.length; + if (!s10) + return c10; + n10 && (t10 = Su(t10, gh(n10))), r10 ? (i10 = lb, a10 = false) : t10.length >= ub && (i10 = Mg, a10 = false, t10 = new _g(t10)); + e: + for (; ++o10 < s10; ) { + var u10 = e20[o10], f10 = null == n10 ? u10 : n10(u10); + if (u10 = r10 || 0 !== u10 ? u10 : 0, a10 && f10 == f10) { + for (var d10 = l10; d10--; ) + if (t10[d10] === f10) + continue e; + c10.push(u10); + } else + i10(t10, f10, r10) || c10.push(u10); + } + return c10; + } + var db = Yd(function(e20, t10) { + return Qy(e20) ? fb(e20, gv(t10, 1, Qy, true)) : []; + }); + var hb = db; + function vb(e20) { + var t10 = null == e20 ? 0 : e20.length; + return t10 ? e20[t10 - 1] : void 0; + } + var pb = Yd(function(e20, t10) { + var n10 = vb(t10); + return Qy(n10) && (n10 = void 0), Qy(e20) ? fb(e20, gv(t10, 1, Qy, true), ky(n10)) : []; + }); + var mb = pb; + var gb = Yd(function(e20, t10) { + var n10 = vb(t10); + return Qy(n10) && (n10 = void 0), Qy(e20) ? fb(e20, gv(t10, 1, Qy, true), void 0, n10) : []; + }); + var yb = gb; + var bb = Eu(function(e20, t10) { + return e20 / t10; + }, 1); + function kb(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + return r10 ? Fv(e20, (t10 = n10 || void 0 === t10 ? 1 : Uu(t10)) < 0 ? 0 : t10, r10) : []; + } + function wb(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + return r10 ? Fv(e20, 0, (t10 = r10 - (t10 = n10 || void 0 === t10 ? 1 : Uu(t10))) < 0 ? 0 : t10) : []; + } + function xb(e20, t10, n10, r10) { + for (var o10 = e20.length, i10 = r10 ? o10 : -1; (r10 ? i10-- : ++i10 < o10) && t10(e20[i10], i10, e20); ) + ; + return n10 ? Fv(e20, r10 ? 0 : i10, r10 ? i10 + 1 : o10) : Fv(e20, r10 ? i10 + 1 : 0, r10 ? o10 : i10); + } + function jb(e20, t10) { + return e20 && e20.length ? xb(e20, ky(t10), true, true) : []; + } + function Sb(e20, t10) { + return e20 && e20.length ? xb(e20, ky(t10), true) : []; + } + function Cb(e20) { + return "function" == typeof e20 ? e20 : Ku; + } + function $b(e20, t10) { + return (Cu(e20) ? Qf : Ey)(e20, Cb(t10)); + } + function _b(e20, t10) { + for (var n10 = null == e20 ? 0 : e20.length; n10-- && false !== t10(e20[n10], n10, e20); ) + ; + return e20; + } + var Ob = $y(true); + function Mb(e20, t10) { + return e20 && Ob(e20, t10, Eh); + } + var Eb = My(Mb, true); + function Ab(e20, t10) { + return (Cu(e20) ? _b : Eb)(e20, Cb(t10)); + } + function Pb(e20, t10, n10) { + e20 = sv(e20), t10 = Mu(t10); + var r10 = e20.length, o10 = n10 = void 0 === n10 ? r10 : Xp(Uu(n10), 0, r10); + return (n10 -= t10.length) >= 0 && e20.slice(n10, o10) == t10; + } + function Tb(e20) { + return function(t10) { + var n10 = Em(t10); + return "[object Map]" == n10 ? Tg(t10) : "[object Set]" == n10 ? function(e21) { + var t11 = -1, n11 = Array(e21.size); + return e21.forEach(function(e23) { + n11[++t11] = [e23, e23]; + }), n11; + }(t10) : function(e21, t11) { + return Su(t11, function(t12) { + return [t12, e21[t12]]; + }); + }(t10, e20(t10)); + }; + } + var Rb = Tb(Eh); + var Nb = Tb(Ih); + var Ib = lp({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }); + var Db = /[&<>"']/g; + var qb = RegExp(Db.source); + function zb(e20) { + return (e20 = sv(e20)) && qb.test(e20) ? e20.replace(Db, Ib) : e20; + } + var Bb = /[\\^$.*+?()[\]{}|]/g; + var Lb = RegExp(Bb.source); + function Fb(e20) { + return (e20 = sv(e20)) && Lb.test(e20) ? e20.replace(Bb, "\\$&") : e20; + } + function Vb(e20, t10) { + for (var n10 = -1, r10 = null == e20 ? 0 : e20.length; ++n10 < r10; ) + if (!t10(e20[n10], n10, e20)) + return false; + return true; + } + function Hb(e20, t10) { + var n10 = true; + return Ey(e20, function(e21, r10, o10) { + return n10 = !!t10(e21, r10, o10); + }), n10; + } + function Wb(e20, t10, n10) { + var r10 = Cu(e20) ? Vb : Hb; + return n10 && th(e20, t10, n10) && (t10 = void 0), r10(e20, ky(t10)); + } + var Ub = 4294967295; + function Jb(e20) { + return e20 ? Xp(Uu(e20), 0, Ub) : 0; + } + function Kb(e20, t10, n10, r10) { + var o10 = null == e20 ? 0 : e20.length; + return o10 ? (n10 && "number" != typeof n10 && th(e20, t10, n10) && (n10 = 0, r10 = o10), function(e21, t11, n11, r11) { + var o11 = e21.length; + for ((n11 = Uu(n11)) < 0 && (n11 = -n11 > o11 ? 0 : o11 + n11), (r11 = void 0 === r11 || r11 > o11 ? o11 : Uu(r11)) < 0 && (r11 += o11), r11 = n11 > r11 ? 0 : Jb(r11); n11 < r11; ) + e21[n11++] = t11; + return e21; + }(e20, t10, n10, r10)) : []; + } + function Gb(e20, t10) { + var n10 = []; + return Ey(e20, function(e21, r10, o10) { + t10(e21, r10, o10) && n10.push(e21); + }), n10; + } + function Qb(e20, t10) { + return (Cu(e20) ? sm : Gb)(e20, ky(t10)); + } + function Yb(e20) { + return function(t10, n10, r10) { + var o10 = Object(t10); + if (!eh(t10)) { + var i10 = ky(n10); + t10 = Eh(t10), n10 = function(e21) { + return i10(o10[e21], e21, o10); + }; + } + var a10 = e20(t10, n10, r10); + return a10 > -1 ? o10[i10 ? t10[a10] : a10] : void 0; + }; + } + var Xb = Math.max; + function Zb(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + if (!r10) + return -1; + var o10 = null == n10 ? 0 : Uu(n10); + return o10 < 0 && (o10 = Xb(r10 + o10, 0)), Yf(e20, ky(t10), o10); + } + var ek = Yb(Zb); + function tk(e20, t10, n10) { + var r10; + return n10(e20, function(e21, n11, o10) { + if (t10(e21, n11, o10)) + return r10 = n11, false; + }), r10; + } + function nk(e20, t10) { + return tk(e20, ky(t10), Oy); + } + var rk = Math.max; + var ok = Math.min; + function ik(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + if (!r10) + return -1; + var o10 = r10 - 1; + return void 0 !== n10 && (o10 = Uu(n10), o10 = n10 < 0 ? rk(r10 + o10, 0) : ok(o10, r10 - 1)), Yf(e20, ky(t10), o10, true); + } + var ak = Yb(ik); + function sk(e20, t10) { + return tk(e20, ky(t10), Mb); + } + function ck(e20) { + return e20 && e20.length ? e20[0] : void 0; + } + function lk(e20, t10) { + var n10 = -1, r10 = eh(e20) ? Array(e20.length) : []; + return Ey(e20, function(e21, o10, i10) { + r10[++n10] = t10(e21, o10, i10); + }), r10; + } + function uk(e20, t10) { + return (Cu(e20) ? Su : lk)(e20, ky(t10)); + } + function fk(e20, t10) { + return gv(uk(e20, t10), 1); + } + function dk(e20, t10) { + return gv(uk(e20, t10), Infinity); + } + function hk(e20, t10, n10) { + return n10 = void 0 === n10 ? 1 : Uu(n10), gv(uk(e20, t10), n10); + } + function vk(e20) { + return (null == e20 ? 0 : e20.length) ? gv(e20, Infinity) : []; + } + function pk(e20, t10) { + return (null == e20 ? 0 : e20.length) ? gv(e20, t10 = void 0 === t10 ? 1 : Uu(t10)) : []; + } + function mk(e20) { + return Ld(e20, 512); + } + var gk = Up("floor"); + function yk(e20) { + return bv(function(t10) { + var n10 = t10.length, r10 = n10, o10 = Rf.prototype.thru; + for (e20 && t10.reverse(); r10--; ) { + var i10 = t10[r10]; + if ("function" != typeof i10) + throw new TypeError("Expected a function"); + if (o10 && !a10 && "wrapper" == Tf(i10)) + var a10 = new Rf([], true); + } + for (r10 = a10 ? r10 : n10; ++r10 < n10; ) { + var s10 = Tf(i10 = t10[r10]), c10 = "wrapper" == s10 ? Ef(i10) : void 0; + a10 = c10 && zf(c10[0]) && 424 == c10[1] && !c10[4].length && 1 == c10[9] ? a10[Tf(c10[0])].apply(a10, c10[3]) : 1 == i10.length && zf(i10) ? a10[s10]() : a10.thru(i10); + } + return function() { + var e21 = arguments, r11 = e21[0]; + if (a10 && 1 == e21.length && Cu(r11)) + return a10.plant(r11).value(); + for (var o11 = 0, i11 = n10 ? t10[o11].apply(this, e21) : r11; ++o11 < n10; ) + i11 = t10[o11].call(this, i11); + return i11; + }; + }); + } + var bk = yk(); + var kk = yk(true); + function wk(e20, t10) { + return null == e20 ? e20 : _y(e20, Cb(t10), Ih); + } + function xk(e20, t10) { + return null == e20 ? e20 : Ob(e20, Cb(t10), Ih); + } + function jk(e20, t10) { + return e20 && Oy(e20, Cb(t10)); + } + function Sk(e20, t10) { + return e20 && Mb(e20, Cb(t10)); + } + function Ck(e20) { + for (var t10 = -1, n10 = null == e20 ? 0 : e20.length, r10 = {}; ++t10 < n10; ) { + var o10 = e20[t10]; + r10[o10[0]] = o10[1]; + } + return r10; + } + function $k(e20, t10) { + return sm(t10, function(t11) { + return Zu(e20[t11]); + }); + } + function _k(e20) { + return null == e20 ? [] : $k(e20, Eh(e20)); + } + function Ok(e20) { + return null == e20 ? [] : $k(e20, Ih(e20)); + } + var Mk = Object.prototype.hasOwnProperty; + var Ek = Py(function(e20, t10, n10) { + Mk.call(e20, n10) ? e20[n10].push(t10) : Hd(e20, n10, [t10]); + }); + var Ak = Ek; + function Pk(e20, t10) { + return e20 > t10; + } + function Tk(e20) { + return function(t10, n10) { + return "string" == typeof t10 && "string" == typeof n10 || (t10 = Fu(t10), n10 = Fu(n10)), e20(t10, n10); + }; + } + var Rk = Tk(Pk); + var Nk = Tk(function(e20, t10) { + return e20 >= t10; + }); + var Ik = Object.prototype.hasOwnProperty; + function Dk(e20, t10) { + return null != e20 && Ik.call(e20, t10); + } + function qk(e20, t10) { + return null != e20 && hy(e20, t10, Dk); + } + var zk = Math.max; + var Bk = Math.min; + function Lk(e20, t10, n10) { + return t10 = Wu(t10), void 0 === n10 ? (n10 = t10, t10 = 0) : n10 = Wu(n10), function(e21, t11, n11) { + return e21 >= Bk(t11, n11) && e21 < zk(t11, n11); + }(e20 = Fu(e20), t10, n10); + } + var Fk = "[object String]"; + function Vk(e20) { + return "string" == typeof e20 || !Cu(e20) && bu(e20) && yu(e20) == Fk; + } + function Hk(e20, t10) { + return Su(t10, function(t11) { + return e20[t11]; + }); + } + function Wk(e20) { + return null == e20 ? [] : Hk(e20, Eh(e20)); + } + var Uk = Math.max; + function Jk(e20, t10, n10, r10) { + e20 = eh(e20) ? e20 : Wk(e20), n10 = n10 && !r10 ? Uu(n10) : 0; + var o10 = e20.length; + return n10 < 0 && (n10 = Uk(o10 + n10, 0)), Vk(e20) ? n10 <= o10 && e20.indexOf(t10, n10) > -1 : !!o10 && Zf(e20, t10, n10) > -1; + } + var Kk = Math.max; + function Gk(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + if (!r10) + return -1; + var o10 = null == n10 ? 0 : Uu(n10); + return o10 < 0 && (o10 = Kk(r10 + o10, 0)), Zf(e20, t10, o10); + } + function Qk(e20) { + return (null == e20 ? 0 : e20.length) ? Fv(e20, 0, -1) : []; + } + var Yk = Math.min; + function Xk(e20, t10, n10) { + for (var r10 = n10 ? lb : ed, o10 = e20[0].length, i10 = e20.length, a10 = i10, s10 = Array(i10), c10 = 1 / 0, l10 = []; a10--; ) { + var u10 = e20[a10]; + a10 && t10 && (u10 = Su(u10, gh(t10))), c10 = Yk(u10.length, c10), s10[a10] = !n10 && (t10 || o10 >= 120 && u10.length >= 120) ? new _g(a10 && u10) : void 0; + } + u10 = e20[0]; + var f10 = -1, d10 = s10[0]; + e: + for (; ++f10 < o10 && l10.length < c10; ) { + var h10 = u10[f10], v10 = t10 ? t10(h10) : h10; + if (h10 = n10 || 0 !== h10 ? h10 : 0, !(d10 ? Mg(d10, v10) : r10(l10, v10, n10))) { + for (a10 = i10; --a10; ) { + var p10 = s10[a10]; + if (!(p10 ? Mg(p10, v10) : r10(e20[a10], v10, n10))) + continue e; + } + d10 && d10.push(v10), l10.push(h10); + } + } + return l10; + } + function Zk(e20) { + return Qy(e20) ? e20 : []; + } + var ew = Yd(function(e20) { + var t10 = Su(e20, Zk); + return t10.length && t10[0] === e20[0] ? Xk(t10) : []; + }); + var tw = Yd(function(e20) { + var t10 = vb(e20), n10 = Su(e20, Zk); + return t10 === vb(n10) ? t10 = void 0 : n10.pop(), n10.length && n10[0] === e20[0] ? Xk(n10, ky(t10)) : []; + }); + var nw = tw; + var rw = Yd(function(e20) { + var t10 = vb(e20), n10 = Su(e20, Zk); + return (t10 = "function" == typeof t10 ? t10 : void 0) && n10.pop(), n10.length && n10[0] === e20[0] ? Xk(n10, void 0, t10) : []; + }); + function ow(e20, t10) { + return function(n10, r10) { + return function(e21, t11, n11, r11) { + return Oy(e21, function(e23, o10, i10) { + t11(r11, n11(e23), o10, i10); + }), r11; + }(n10, e20, t10(r10), {}); + }; + } + var iw = Object.prototype.toString; + var aw = ow(function(e20, t10, n10) { + null != t10 && "function" != typeof t10.toString && (t10 = iw.call(t10)), e20[t10] = n10; + }, Uf(Ku)); + var sw = aw; + var cw = Object.prototype; + var lw = cw.hasOwnProperty; + var uw = cw.toString; + var fw = ow(function(e20, t10, n10) { + null != t10 && "function" != typeof t10.toString && (t10 = uw.call(t10)), lw.call(e20, t10) ? e20[t10].push(n10) : e20[t10] = [n10]; + }, ky); + var dw = fw; + function hw(e20, t10) { + return t10.length < 2 ? e20 : fv(e20, Fv(t10, 0, -1)); + } + function vw(e20, t10, n10) { + var r10 = null == (e20 = hw(e20, t10 = cv(t10, e20))) ? e20 : e20[uv(vb(t10))]; + return null == r10 ? void 0 : wf(r10, e20, n10); + } + var pw = Yd(vw); + var mw = Yd(function(e20, t10, n10) { + var r10 = -1, o10 = "function" == typeof t10, i10 = eh(e20) ? Array(e20.length) : []; + return Ey(e20, function(e21) { + i10[++r10] = o10 ? wf(t10, e21, n10) : vw(e21, t10, n10); + }), i10; + }); + var gw = mw; + var yw = wh && wh.isArrayBuffer; + var bw = yw ? gh(yw) : function(e20) { + return bu(e20) && "[object ArrayBuffer]" == yu(e20); + }; + function kw(e20) { + return true === e20 || false === e20 || bu(e20) && "[object Boolean]" == yu(e20); + } + var ww = wh && wh.isDate; + var xw = ww ? gh(ww) : function(e20) { + return bu(e20) && "[object Date]" == yu(e20); + }; + function jw(e20) { + return bu(e20) && 1 === e20.nodeType && !Ov(e20); + } + var Sw = "[object Map]"; + var Cw = "[object Set]"; + var $w = Object.prototype.hasOwnProperty; + function _w(e20) { + if (null == e20) + return true; + if (eh(e20) && (Cu(e20) || "string" == typeof e20 || "function" == typeof e20.splice || ph(e20) || jh(e20) || uh(e20))) + return !e20.length; + var t10 = Em(e20); + if (t10 == Sw || t10 == Cw) + return !e20.size; + if (oh(e20)) + return !Mh(e20).length; + for (var n10 in e20) + if ($w.call(e20, n10)) + return false; + return true; + } + function Ow(e20, t10) { + return oy(e20, t10); + } + function Mw(e20, t10, n10) { + var r10 = (n10 = "function" == typeof n10 ? n10 : void 0) ? n10(e20, t10) : void 0; + return void 0 === r10 ? oy(e20, t10, void 0, n10) : !!r10; + } + var Ew = cu.isFinite; + function Aw(e20) { + return "number" == typeof e20 && Ew(e20); + } + function Pw(e20) { + return "number" == typeof e20 && e20 == Uu(e20); + } + function Tw(e20, t10) { + return e20 === t10 || sy(e20, t10, ly(t10)); + } + function Rw(e20, t10, n10) { + return n10 = "function" == typeof n10 ? n10 : void 0, sy(e20, t10, ly(t10), n10); + } + var Nw = "[object Number]"; + function Iw(e20) { + return "number" == typeof e20 || bu(e20) && yu(e20) == Nw; + } + function Dw(e20) { + return Iw(e20) && e20 != +e20; + } + var qw = tf ? Zu : fh; + function zw(e20) { + if (qw(e20)) + throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill."); + return df(e20); + } + function Bw(e20) { + return null == e20; + } + function Lw(e20) { + return null === e20; + } + var Fw = wh && wh.isRegExp; + var Vw = Fw ? gh(Fw) : function(e20) { + return bu(e20) && "[object RegExp]" == yu(e20); + }; + var Hw = 9007199254740991; + function Ww(e20) { + return Pw(e20) && e20 >= -9007199254740991 && e20 <= Hw; + } + function Uw(e20) { + return void 0 === e20; + } + function Jw(e20) { + return bu(e20) && "[object WeakMap]" == Em(e20); + } + function Kw(e20) { + return bu(e20) && "[object WeakSet]" == yu(e20); + } + function Gw(e20) { + return ky("function" == typeof e20 ? e20 : gg(e20, 1)); + } + var Qw = Array.prototype.join; + function Yw(e20, t10) { + return null == e20 ? "" : Qw.call(e20, t10); + } + var Xw = Bp(function(e20, t10, n10) { + return e20 + (n10 ? "-" : "") + t10.toLowerCase(); + }); + var Zw = Xw; + var ex = Py(function(e20, t10, n10) { + Hd(e20, n10, t10); + }); + var tx = ex; + var nx = Math.max; + var rx = Math.min; + function ox(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + if (!r10) + return -1; + var o10 = r10; + return void 0 !== n10 && (o10 = (o10 = Uu(n10)) < 0 ? nx(r10 + o10, 0) : rx(o10, r10 - 1)), t10 == t10 ? function(e21, t11, n11) { + for (var r11 = n11 + 1; r11--; ) + if (e21[r11] === t11) + return r11; + return r11; + }(e20, t10, o10) : Yf(e20, Xf, o10, true); + } + var ix = Bp(function(e20, t10, n10) { + return e20 + (n10 ? " " : "") + t10.toLowerCase(); + }); + var ax = ix; + var sx = ip("toLowerCase"); + function cx(e20, t10) { + return e20 < t10; + } + var lx = Tk(cx); + var ux = Tk(function(e20, t10) { + return e20 <= t10; + }); + function fx(e20, t10) { + var n10 = {}; + return t10 = ky(t10), Oy(e20, function(e21, r10, o10) { + Hd(n10, t10(e21, r10, o10), e21); + }), n10; + } + function dx(e20, t10) { + var n10 = {}; + return t10 = ky(t10), Oy(e20, function(e21, r10, o10) { + Hd(n10, r10, t10(e21, r10, o10)); + }), n10; + } + function hx(e20) { + return fy(gg(e20, 1)); + } + function vx(e20, t10) { + return gy(e20, gg(t10, 1)); + } + function px(e20, t10, n10) { + for (var r10 = -1, o10 = e20.length; ++r10 < o10; ) { + var i10 = e20[r10], a10 = t10(i10); + if (null != a10 && (void 0 === s10 ? a10 == a10 && !wu(a10) : n10(a10, s10))) + var s10 = a10, c10 = i10; + } + return c10; + } + function mx(e20) { + return e20 && e20.length ? px(e20, Ku, Pk) : void 0; + } + function gx(e20, t10) { + return e20 && e20.length ? px(e20, ky(t10), Pk) : void 0; + } + function yx(e20, t10) { + for (var n10, r10 = -1, o10 = e20.length; ++r10 < o10; ) { + var i10 = t10(e20[r10]); + void 0 !== i10 && (n10 = void 0 === n10 ? i10 : n10 + i10); + } + return n10; + } + var bx = NaN; + function kx(e20, t10) { + var n10 = null == e20 ? 0 : e20.length; + return n10 ? yx(e20, t10) / n10 : bx; + } + function wx(e20) { + return kx(e20, Ku); + } + function xx(e20, t10) { + return kx(e20, ky(t10)); + } + var jx = nh(function(e20, t10, n10) { + Zy(e20, t10, n10); + }); + var Sx = jx; + var Cx = Yd(function(e20, t10) { + return function(n10) { + return vw(n10, e20, t10); + }; + }); + var $x = Cx; + var _x = Yd(function(e20, t10) { + return function(n10) { + return vw(e20, n10, t10); + }; + }); + var Ox = _x; + function Mx(e20) { + return e20 && e20.length ? px(e20, Ku, cx) : void 0; + } + function Ex(e20, t10) { + return e20 && e20.length ? px(e20, ky(t10), cx) : void 0; + } + function Ax(e20, t10, n10) { + var r10 = Eh(t10), o10 = $k(t10, r10), i10 = !(Iu(n10) && "chain" in n10 && !n10.chain), a10 = Zu(e20); + return Qf(o10, function(n11) { + var r11 = t10[n11]; + e20[n11] = r11, a10 && (e20.prototype[n11] = function() { + var t11 = this.__chain__; + if (i10 || t11) { + var n12 = e20(this.__wrapped__); + return (n12.__actions__ = Nf(this.__actions__)).push({ func: r11, args: arguments, thisArg: e20 }), n12.__chain__ = t11, n12; + } + return r11.apply(e20, vv([this.value()], arguments)); + }); + }), e20; + } + var Px = Eu(function(e20, t10) { + return e20 * t10; + }, 1); + var Tx = "Expected a function"; + function Rx(e20) { + if ("function" != typeof e20) + throw new TypeError(Tx); + return function() { + var t10 = arguments; + switch (t10.length) { + case 0: + return !e20.call(this); + case 1: + return !e20.call(this, t10[0]); + case 2: + return !e20.call(this, t10[0], t10[1]); + case 3: + return !e20.call(this, t10[0], t10[1], t10[2]); + } + return !e20.apply(this, t10); + }; + } + var Nx = "[object Map]"; + var Ix = "[object Set]"; + var Dx = lu ? lu.iterator : void 0; + function qx(e20) { + if (!e20) + return []; + if (eh(e20)) + return Vk(e20) ? op(e20) : Nf(e20); + if (Dx && e20[Dx]) + return function(e21) { + for (var t11, n10 = []; !(t11 = e21.next()).done; ) + n10.push(t11.value); + return n10; + }(e20[Dx]()); + var t10 = Em(e20); + return (t10 == Nx ? Tg : t10 == Ix ? Rg : Wk)(e20); + } + function zx() { + void 0 === this.__values__ && (this.__values__ = qx(this.value())); + var e20 = this.__index__ >= this.__values__.length; + return { done: e20, value: e20 ? void 0 : this.__values__[this.__index__++] }; + } + function Bx(e20, t10) { + var n10 = e20.length; + if (n10) + return hd(t10 += t10 < 0 ? n10 : 0, n10) ? e20[t10] : void 0; + } + function Lx(e20, t10) { + return e20 && e20.length ? Bx(e20, Uu(t10)) : void 0; + } + function Fx(e20) { + return e20 = Uu(e20), Yd(function(t10) { + return Bx(t10, e20); + }); + } + function Vx(e20, t10) { + return null == (e20 = hw(e20, t10 = cv(t10, e20))) || delete e20[uv(vb(t10))]; + } + function Hx(e20) { + return Ov(e20) ? void 0 : e20; + } + var Wx = bv(function(e20, t10) { + var n10 = {}; + if (null == e20) + return n10; + var r10 = false; + t10 = Su(t10, function(t11) { + return t11 = cv(t11, e20), r10 || (r10 = t11.length > 1), t11; + }), Kd(e20, pm(e20), n10), r10 && (n10 = gg(n10, 7, Hx)); + for (var o10 = t10.length; o10--; ) + Vx(n10, t10[o10]); + return n10; + }); + var Ux = Wx; + function Jx(e20, t10, n10, r10) { + if (!Iu(e20)) + return e20; + for (var o10 = -1, i10 = (t10 = cv(t10, e20)).length, a10 = i10 - 1, s10 = e20; null != s10 && ++o10 < i10; ) { + var c10 = uv(t10[o10]), l10 = n10; + if ("__proto__" === c10 || "constructor" === c10 || "prototype" === c10) + return e20; + if (o10 != a10) { + var u10 = s10[c10]; + void 0 === (l10 = r10 ? r10(u10, c10, s10) : void 0) && (l10 = Iu(u10) ? u10 : hd(t10[o10 + 1]) ? [] : {}); + } + Jd(s10, c10, l10), s10 = s10[c10]; + } + return e20; + } + function Kx(e20, t10, n10) { + for (var r10 = -1, o10 = t10.length, i10 = {}; ++r10 < o10; ) { + var a10 = t10[r10], s10 = fv(e20, a10); + n10(s10, a10) && Jx(i10, cv(a10, e20), s10); + } + return i10; + } + function Gx(e20, t10) { + if (null == e20) + return {}; + var n10 = Su(pm(e20), function(e21) { + return [e21]; + }); + return t10 = ky(t10), Kx(e20, n10, function(e21, n11) { + return t10(e21, n11[0]); + }); + } + function Qx(e20, t10) { + return Gx(e20, Rx(ky(t10))); + } + function Yx(e20) { + return Nv(2, e20); + } + function Xx(e20, t10) { + if (e20 !== t10) { + var n10 = void 0 !== e20, r10 = null === e20, o10 = e20 == e20, i10 = wu(e20), a10 = void 0 !== t10, s10 = null === t10, c10 = t10 == t10, l10 = wu(t10); + if (!s10 && !l10 && !i10 && e20 > t10 || i10 && a10 && c10 && !s10 && !l10 || r10 && a10 && c10 || !n10 && c10 || !o10) + return 1; + if (!r10 && !i10 && !l10 && e20 < t10 || l10 && n10 && o10 && !r10 && !i10 || s10 && n10 && o10 || !a10 && o10 || !c10) + return -1; + } + return 0; + } + function Zx(e20, t10, n10) { + t10 = t10.length ? Su(t10, function(e21) { + return Cu(e21) ? function(t11) { + return fv(t11, 1 === e21.length ? e21[0] : e21); + } : e21; + }) : [Ku]; + var r10 = -1; + t10 = Su(t10, gh(ky)); + var o10 = lk(e20, function(e21, n11, o11) { + var i10 = Su(t10, function(t11) { + return t11(e21); + }); + return { criteria: i10, index: ++r10, value: e21 }; + }); + return function(e21, t11) { + var n11 = e21.length; + for (e21.sort(t11); n11--; ) + e21[n11] = e21[n11].value; + return e21; + }(o10, function(e21, t11) { + return function(e23, t12, n11) { + for (var r11 = -1, o11 = e23.criteria, i10 = t12.criteria, a10 = o11.length, s10 = n11.length; ++r11 < a10; ) { + var c10 = Xx(o11[r11], i10[r11]); + if (c10) + return r11 >= s10 ? c10 : c10 * ("desc" == n11[r11] ? -1 : 1); + } + return e23.index - t12.index; + }(e21, t11, n10); + }); + } + function ej(e20, t10, n10, r10) { + return null == e20 ? [] : (Cu(t10) || (t10 = null == t10 ? [] : [t10]), Cu(n10 = r10 ? void 0 : n10) || (n10 = null == n10 ? [] : [n10]), Zx(e20, t10, n10)); + } + function tj(e20) { + return bv(function(t10) { + return t10 = Su(t10, gh(ky)), Yd(function(n10) { + var r10 = this; + return e20(t10, function(e21) { + return wf(e21, r10, n10); + }); + }); + }); + } + var nj = tj(Su); + var rj = Yd; + var oj = Math.min; + var ij = rj(function(e20, t10) { + var n10 = (t10 = 1 == t10.length && Cu(t10[0]) ? Su(t10[0], gh(ky)) : Su(gv(t10, 1), gh(ky))).length; + return Yd(function(r10) { + for (var o10 = -1, i10 = oj(r10.length, n10); ++o10 < i10; ) + r10[o10] = t10[o10].call(this, r10[o10]); + return wf(e20, this, r10); + }); + }); + var aj = ij; + var sj = tj(Vb); + var cj = tj(Og); + var lj = 9007199254740991; + var uj = Math.floor; + function fj(e20, t10) { + var n10 = ""; + if (!e20 || t10 < 1 || t10 > lj) + return n10; + do { + t10 % 2 && (n10 += e20), (t10 = uj(t10 / 2)) && (e20 += e20); + } while (t10); + return n10; + } + var dj = yy("length"); + var hj = "\\ud800-\\udfff"; + var vj = "[" + hj + "]"; + var pj = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]"; + var mj = "\\ud83c[\\udffb-\\udfff]"; + var gj = "[^" + hj + "]"; + var yj = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var bj = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var kj = "(?:" + pj + "|" + mj + ")?"; + var wj = "[\\ufe0e\\ufe0f]?"; + var xj = wj + kj + ("(?:\\u200d(?:" + [gj, yj, bj].join("|") + ")" + wj + kj + ")*"); + var jj = "(?:" + [gj + pj + "?", pj, yj, bj, vj].join("|") + ")"; + var Sj = RegExp(mj + "(?=" + mj + ")|" + jj + xj, "g"); + function Cj(e20) { + return Wv(e20) ? function(e21) { + for (var t10 = Sj.lastIndex = 0; Sj.test(e21); ) + ++t10; + return t10; + }(e20) : dj(e20); + } + var $j = Math.ceil; + function _j(e20, t10) { + var n10 = (t10 = void 0 === t10 ? " " : Mu(t10)).length; + if (n10 < 2) + return n10 ? fj(t10, e20) : t10; + var r10 = fj(t10, $j(e20 / Cj(t10))); + return Wv(t10) ? Vv(op(r10), 0, e20).join("") : r10.slice(0, e20); + } + var Oj = Math.ceil; + var Mj = Math.floor; + function Ej(e20, t10, n10) { + e20 = sv(e20); + var r10 = (t10 = Uu(t10)) ? Cj(e20) : 0; + if (!t10 || r10 >= t10) + return e20; + var o10 = (t10 - r10) / 2; + return _j(Mj(o10), n10) + e20 + _j(Oj(o10), n10); + } + function Aj(e20, t10, n10) { + e20 = sv(e20); + var r10 = (t10 = Uu(t10)) ? Cj(e20) : 0; + return t10 && r10 < t10 ? e20 + _j(t10 - r10, n10) : e20; + } + function Pj(e20, t10, n10) { + e20 = sv(e20); + var r10 = (t10 = Uu(t10)) ? Cj(e20) : 0; + return t10 && r10 < t10 ? _j(t10 - r10, n10) + e20 : e20; + } + var Tj = /^\s+/; + var Rj = cu.parseInt; + function Nj(e20, t10, n10) { + return n10 || null == t10 ? t10 = 0 : t10 && (t10 = +t10), Rj(sv(e20).replace(Tj, ""), t10 || 0); + } + var Ij = Yd(function(e20, t10) { + return Ld(e20, 32, void 0, t10, md(t10, ud(Ij))); + }); + Ij.placeholder = {}; + var Dj = Ij; + var qj = Yd(function(e20, t10) { + return Ld(e20, 64, void 0, t10, md(t10, ud(qj))); + }); + qj.placeholder = {}; + var zj = qj; + var Bj = Py(function(e20, t10, n10) { + e20[n10 ? 0 : 1].push(t10); + }, function() { + return [[], []]; + }); + var Lj = Bj; + var Fj = bv(function(e20, t10) { + return null == e20 ? {} : function(e21, t11) { + return Kx(e21, t11, function(t12, n10) { + return vy(e21, n10); + }); + }(e20, t10); + }); + var Vj = Fj; + function Hj(e20) { + for (var t10, n10 = this; n10 instanceof $f; ) { + var r10 = If(n10); + r10.__index__ = 0, r10.__values__ = void 0, t10 ? o10.__wrapped__ = r10 : t10 = r10; + var o10 = r10; + n10 = n10.__wrapped__; + } + return o10.__wrapped__ = e20, t10; + } + function Wj(e20) { + return function(t10) { + return null == e20 ? void 0 : fv(e20, t10); + }; + } + function Uj(e20, t10, n10, r10) { + for (var o10 = n10 - 1, i10 = e20.length; ++o10 < i10; ) + if (r10(e20[o10], t10)) + return o10; + return -1; + } + var Jj = Array.prototype.splice; + function Kj(e20, t10, n10, r10) { + var o10 = r10 ? Uj : Zf, i10 = -1, a10 = t10.length, s10 = e20; + for (e20 === t10 && (t10 = Nf(t10)), n10 && (s10 = Su(e20, gh(n10))); ++i10 < a10; ) + for (var c10 = 0, l10 = t10[i10], u10 = n10 ? n10(l10) : l10; (c10 = o10(s10, u10, c10, r10)) > -1; ) + s10 !== e20 && Jj.call(s10, c10, 1), Jj.call(e20, c10, 1); + return e20; + } + function Gj(e20, t10) { + return e20 && e20.length && t10 && t10.length ? Kj(e20, t10) : e20; + } + var Qj = Yd(Gj); + function Yj(e20, t10, n10) { + return e20 && e20.length && t10 && t10.length ? Kj(e20, t10, ky(n10)) : e20; + } + function Xj(e20, t10, n10) { + return e20 && e20.length && t10 && t10.length ? Kj(e20, t10, void 0, n10) : e20; + } + var Zj = Array.prototype.splice; + function eS(e20, t10) { + for (var n10 = e20 ? t10.length : 0, r10 = n10 - 1; n10--; ) { + var o10 = t10[n10]; + if (n10 == r10 || o10 !== i10) { + var i10 = o10; + hd(o10) ? Zj.call(e20, o10, 1) : Vx(e20, o10); + } + } + return e20; + } + var tS = bv(function(e20, t10) { + var n10 = null == e20 ? 0 : e20.length, r10 = hv(e20, t10); + return eS(e20, Su(t10, function(e21) { + return hd(e21, n10) ? +e21 : e21; + }).sort(Xx)), r10; + }); + var nS = tS; + var rS = Math.floor; + var oS = Math.random; + function iS(e20, t10) { + return e20 + rS(oS() * (t10 - e20 + 1)); + } + var aS = parseFloat; + var sS = Math.min; + var cS = Math.random; + function lS(e20, t10, n10) { + if (n10 && "boolean" != typeof n10 && th(e20, t10, n10) && (t10 = n10 = void 0), void 0 === n10 && ("boolean" == typeof t10 ? (n10 = t10, t10 = void 0) : "boolean" == typeof e20 && (n10 = e20, e20 = void 0)), void 0 === e20 && void 0 === t10 ? (e20 = 0, t10 = 1) : (e20 = Wu(e20), void 0 === t10 ? (t10 = e20, e20 = 0) : t10 = Wu(t10)), e20 > t10) { + var r10 = e20; + e20 = t10, t10 = r10; + } + if (n10 || e20 % 1 || t10 % 1) { + var o10 = cS(); + return sS(e20 + o10 * (t10 - e20 + aS("1e-" + ((o10 + "").length - 1))), t10); + } + return iS(e20, t10); + } + var uS = Math.ceil; + var fS = Math.max; + function dS(e20) { + return function(t10, n10, r10) { + return r10 && "number" != typeof r10 && th(t10, n10, r10) && (n10 = r10 = void 0), t10 = Wu(t10), void 0 === n10 ? (n10 = t10, t10 = 0) : n10 = Wu(n10), function(e21, t11, n11, r11) { + for (var o10 = -1, i10 = fS(uS((t11 - e21) / (n11 || 1)), 0), a10 = Array(i10); i10--; ) + a10[r11 ? i10 : ++o10] = e21, e21 += n11; + return a10; + }(t10, n10, r10 = void 0 === r10 ? t10 < n10 ? 1 : -1 : Wu(r10), e20); + }; + } + var hS = dS(); + var vS = dS(true); + var pS = bv(function(e20, t10) { + return Ld(e20, 256, void 0, void 0, void 0, t10); + }); + var mS = pS; + function gS(e20, t10, n10, r10, o10) { + return o10(e20, function(e21, o11, i10) { + n10 = r10 ? (r10 = false, e21) : t10(n10, e21, o11, i10); + }), n10; + } + function yS(e20, t10, n10) { + var r10 = Cu(e20) ? cp : gS, o10 = arguments.length < 3; + return r10(e20, ky(t10), n10, o10, Ey); + } + function bS(e20, t10, n10, r10) { + var o10 = null == e20 ? 0 : e20.length; + for (r10 && o10 && (n10 = e20[--o10]); o10--; ) + n10 = t10(n10, e20[o10], o10, e20); + return n10; + } + function kS(e20, t10, n10) { + var r10 = Cu(e20) ? bS : gS, o10 = arguments.length < 3; + return r10(e20, ky(t10), n10, o10, Eb); + } + function wS(e20, t10) { + return (Cu(e20) ? sm : Gb)(e20, Rx(ky(t10))); + } + function xS(e20, t10) { + var n10 = []; + if (!e20 || !e20.length) + return n10; + var r10 = -1, o10 = [], i10 = e20.length; + for (t10 = ky(t10); ++r10 < i10; ) { + var a10 = e20[r10]; + t10(a10, r10, e20) && (n10.push(a10), o10.push(r10)); + } + return eS(e20, o10), n10; + } + function jS(e20, t10, n10) { + return t10 = (n10 ? th(e20, t10, n10) : void 0 === t10) ? 1 : Uu(t10), fj(sv(e20), t10); + } + function SS() { + var e20 = arguments, t10 = sv(e20[0]); + return e20.length < 3 ? t10 : t10.replace(e20[1], e20[2]); + } + function CS(e20, t10) { + if ("function" != typeof e20) + throw new TypeError("Expected a function"); + return Yd(e20, t10 = void 0 === t10 ? t10 : Uu(t10)); + } + function $S(e20, t10, n10) { + var r10 = -1, o10 = (t10 = cv(t10, e20)).length; + for (o10 || (o10 = 1, e20 = void 0); ++r10 < o10; ) { + var i10 = null == e20 ? void 0 : e20[uv(t10[r10])]; + void 0 === i10 && (r10 = o10, i10 = n10), e20 = Zu(i10) ? i10.call(e20) : i10; + } + return e20; + } + var _S = Array.prototype.reverse; + function OS(e20) { + return null == e20 ? e20 : _S.call(e20); + } + var MS = Up("round"); + function ES(e20) { + var t10 = e20.length; + return t10 ? e20[iS(0, t10 - 1)] : void 0; + } + function AS(e20) { + return ES(Wk(e20)); + } + function PS(e20) { + return (Cu(e20) ? ES : AS)(e20); + } + function TS(e20, t10) { + var n10 = -1, r10 = e20.length, o10 = r10 - 1; + for (t10 = void 0 === t10 ? r10 : t10; ++n10 < t10; ) { + var i10 = iS(n10, o10), a10 = e20[i10]; + e20[i10] = e20[n10], e20[n10] = a10; + } + return e20.length = t10, e20; + } + function RS(e20, t10) { + return TS(Nf(e20), Xp(t10, 0, e20.length)); + } + function NS(e20, t10) { + var n10 = Wk(e20); + return TS(n10, Xp(t10, 0, n10.length)); + } + function IS(e20, t10, n10) { + return t10 = (n10 ? th(e20, t10, n10) : void 0 === t10) ? 1 : Uu(t10), (Cu(e20) ? RS : NS)(e20, t10); + } + function DS(e20, t10, n10) { + return null == e20 ? e20 : Jx(e20, t10, n10); + } + function qS(e20, t10, n10, r10) { + return r10 = "function" == typeof r10 ? r10 : void 0, null == e20 ? e20 : Jx(e20, t10, n10, r10); + } + function zS(e20) { + return TS(Nf(e20)); + } + function BS(e20) { + return TS(Wk(e20)); + } + function LS(e20) { + return (Cu(e20) ? zS : BS)(e20); + } + function FS(e20) { + if (null == e20) + return 0; + if (eh(e20)) + return Vk(e20) ? Cj(e20) : e20.length; + var t10 = Em(e20); + return "[object Map]" == t10 || "[object Set]" == t10 ? e20.size : Mh(e20).length; + } + function VS(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + return r10 ? (n10 && "number" != typeof n10 && th(e20, t10, n10) ? (t10 = 0, n10 = r10) : (t10 = null == t10 ? 0 : Uu(t10), n10 = void 0 === n10 ? r10 : Uu(n10)), Fv(e20, t10, n10)) : []; + } + var HS = Bp(function(e20, t10, n10) { + return e20 + (n10 ? "_" : "") + t10.toLowerCase(); + }); + var WS = HS; + function US(e20, t10) { + var n10; + return Ey(e20, function(e21, r10, o10) { + return !(n10 = t10(e21, r10, o10)); + }), !!n10; + } + function JS(e20, t10, n10) { + var r10 = Cu(e20) ? Og : US; + return n10 && th(e20, t10, n10) && (t10 = void 0), r10(e20, ky(t10)); + } + var KS = Yd(function(e20, t10) { + if (null == e20) + return []; + var n10 = t10.length; + return n10 > 1 && th(e20, t10[0], t10[1]) ? t10 = [] : n10 > 2 && th(t10[0], t10[1], t10[2]) && (t10 = [t10[0]]), Zx(e20, gv(t10, 1), []); + }); + var GS = KS; + var QS = 4294967294; + var YS = Math.floor; + var XS = Math.min; + function ZS(e20, t10, n10, r10) { + var o10 = 0, i10 = null == e20 ? 0 : e20.length; + if (0 === i10) + return 0; + for (var a10 = (t10 = n10(t10)) != t10, s10 = null === t10, c10 = wu(t10), l10 = void 0 === t10; o10 < i10; ) { + var u10 = YS((o10 + i10) / 2), f10 = n10(e20[u10]), d10 = void 0 !== f10, h10 = null === f10, v10 = f10 == f10, p10 = wu(f10); + if (a10) + var m10 = r10 || v10; + else + m10 = l10 ? v10 && (r10 || d10) : s10 ? v10 && d10 && (r10 || !h10) : c10 ? v10 && d10 && !h10 && (r10 || !p10) : !h10 && !p10 && (r10 ? f10 <= t10 : f10 < t10); + m10 ? o10 = u10 + 1 : i10 = u10; + } + return XS(i10, QS); + } + var eC = 2147483647; + function tC(e20, t10, n10) { + var r10 = 0, o10 = null == e20 ? r10 : e20.length; + if ("number" == typeof t10 && t10 == t10 && o10 <= eC) { + for (; r10 < o10; ) { + var i10 = r10 + o10 >>> 1, a10 = e20[i10]; + null !== a10 && !wu(a10) && (n10 ? a10 <= t10 : a10 < t10) ? r10 = i10 + 1 : o10 = i10; + } + return o10; + } + return ZS(e20, t10, Ku, n10); + } + function nC(e20, t10) { + return tC(e20, t10); + } + function rC(e20, t10, n10) { + return ZS(e20, t10, ky(n10)); + } + function oC(e20, t10) { + var n10 = null == e20 ? 0 : e20.length; + if (n10) { + var r10 = tC(e20, t10); + if (r10 < n10 && Wd(e20[r10], t10)) + return r10; + } + return -1; + } + function iC(e20, t10) { + return tC(e20, t10, true); + } + function aC(e20, t10, n10) { + return ZS(e20, t10, ky(n10), true); + } + function sC(e20, t10) { + if (null == e20 ? 0 : e20.length) { + var n10 = tC(e20, t10, true) - 1; + if (Wd(e20[n10], t10)) + return n10; + } + return -1; + } + function cC(e20, t10) { + for (var n10 = -1, r10 = e20.length, o10 = 0, i10 = []; ++n10 < r10; ) { + var a10 = e20[n10], s10 = t10 ? t10(a10) : a10; + if (!n10 || !Wd(s10, c10)) { + var c10 = s10; + i10[o10++] = 0 === a10 ? 0 : a10; + } + } + return i10; + } + function lC(e20) { + return e20 && e20.length ? cC(e20) : []; + } + function uC(e20, t10) { + return e20 && e20.length ? cC(e20, ky(t10)) : []; + } + function fC(e20, t10, n10) { + return n10 && "number" != typeof n10 && th(e20, t10, n10) && (t10 = n10 = void 0), (n10 = void 0 === n10 ? 4294967295 : n10 >>> 0) ? (e20 = sv(e20)) && ("string" == typeof t10 || null != t10 && !Vw(t10)) && !(t10 = Mu(t10)) && Wv(e20) ? Vv(op(e20), 0, n10) : e20.split(t10, n10) : []; + } + var dC = Math.max; + function hC(e20, t10) { + if ("function" != typeof e20) + throw new TypeError("Expected a function"); + return t10 = null == t10 ? 0 : dC(Uu(t10), 0), Yd(function(n10) { + var r10 = n10[t10], o10 = Vv(n10, 0, t10); + return r10 && vv(o10, r10), wf(e20, this, o10); + }); + } + var vC = Bp(function(e20, t10, n10) { + return e20 + (n10 ? " " : "") + ap(t10); + }); + var pC = vC; + function mC(e20, t10, n10) { + return e20 = sv(e20), n10 = null == n10 ? 0 : Xp(Uu(n10), 0, e20.length), t10 = Mu(t10), e20.slice(n10, n10 + t10.length) == t10; + } + function gC() { + return {}; + } + function yC() { + return ""; + } + function bC() { + return true; + } + var kC = Eu(function(e20, t10) { + return e20 - t10; + }, 0); + function wC(e20) { + return e20 && e20.length ? yx(e20, Ku) : 0; + } + function xC(e20, t10) { + return e20 && e20.length ? yx(e20, ky(t10)) : 0; + } + function jC(e20) { + var t10 = null == e20 ? 0 : e20.length; + return t10 ? Fv(e20, 1, t10) : []; + } + function SC(e20, t10, n10) { + return e20 && e20.length ? Fv(e20, 0, (t10 = n10 || void 0 === t10 ? 1 : Uu(t10)) < 0 ? 0 : t10) : []; + } + function CC(e20, t10, n10) { + var r10 = null == e20 ? 0 : e20.length; + return r10 ? Fv(e20, (t10 = r10 - (t10 = n10 || void 0 === t10 ? 1 : Uu(t10))) < 0 ? 0 : t10, r10) : []; + } + function $C(e20, t10) { + return e20 && e20.length ? xb(e20, ky(t10), false, true) : []; + } + function _C(e20, t10) { + return e20 && e20.length ? xb(e20, ky(t10)) : []; + } + function OC(e20, t10) { + return t10(e20), e20; + } + var MC = Object.prototype; + var EC = MC.hasOwnProperty; + function AC(e20, t10, n10, r10) { + return void 0 === e20 || Wd(e20, MC[n10]) && !EC.call(r10, n10) ? t10 : e20; + } + var PC = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }; + function TC(e20) { + return "\\" + PC[e20]; + } + var RC = /<%=([\s\S]+?)%>/g; + var NC = { escape: /<%-([\s\S]+?)%>/g, evaluate: /<%([\s\S]+?)%>/g, interpolate: RC, variable: "", imports: { _: { escape: zb } } }; + var IC = /\b__p \+= '';/g; + var DC = /\b(__p \+=) '' \+/g; + var qC = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + var zC = /[()=,{}\[\]\/\s]/; + var BC = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + var LC = /($^)/; + var FC = /['\n\r\u2028\u2029\\]/g; + var VC = Object.prototype.hasOwnProperty; + function HC(e20, t10, n10) { + var r10 = NC.imports._.templateSettings || NC; + n10 && th(e20, t10, n10) && (t10 = void 0), e20 = sv(e20), t10 = Bh({}, t10, r10, AC); + var o10, i10, a10 = Bh({}, t10.imports, r10.imports, AC), s10 = Eh(a10), c10 = Hk(a10, s10), l10 = 0, u10 = t10.interpolate || LC, f10 = "__p += '", d10 = RegExp((t10.escape || LC).source + "|" + u10.source + "|" + (u10 === RC ? BC : LC).source + "|" + (t10.evaluate || LC).source + "|$", "g"), h10 = VC.call(t10, "sourceURL") ? "//# sourceURL=" + (t10.sourceURL + "").replace(/\s/g, " ") + "\n" : ""; + e20.replace(d10, function(t11, n11, r11, a11, s11, c11) { + return r11 || (r11 = a11), f10 += e20.slice(l10, c11).replace(FC, TC), n11 && (o10 = true, f10 += "' +\n__e(" + n11 + ") +\n'"), s11 && (i10 = true, f10 += "';\n" + s11 + ";\n__p += '"), r11 && (f10 += "' +\n((__t = (" + r11 + ")) == null ? '' : __t) +\n'"), l10 = c11 + t11.length, t11; + }), f10 += "';\n"; + var v10 = VC.call(t10, "variable") && t10.variable; + if (v10) { + if (zC.test(v10)) + throw new Error("Invalid `variable` option passed into `_.template`"); + } else + f10 = "with (obj) {\n" + f10 + "\n}\n"; + f10 = (i10 ? f10.replace(IC, "") : f10).replace(DC, "$1").replace(qC, "$1;"), f10 = "function(" + (v10 || "obj") + ") {\n" + (v10 ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (o10 ? ", __e = _.escape" : "") + (i10 ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + f10 + "return __p\n}"; + var p10 = Tv(function() { + return Function(s10, h10 + "return " + f10).apply(void 0, c10); + }); + if (p10.source = f10, Av(p10)) + throw p10; + return p10; + } + var WC = "Expected a function"; + function UC(e20, t10, n10) { + var r10 = true, o10 = true; + if ("function" != typeof e20) + throw new TypeError(WC); + return Iu(n10) && (r10 = "leading" in n10 ? !!n10.leading : r10, o10 = "trailing" in n10 ? !!n10.trailing : o10), Vy(e20, t10, { leading: r10, maxWait: t10, trailing: o10 }); + } + function JC(e20, t10) { + return t10(e20); + } + var KC = 9007199254740991; + var GC = 4294967295; + var QC = Math.min; + function YC(e20, t10) { + if ((e20 = Uu(e20)) < 1 || e20 > KC) + return []; + var n10 = GC, r10 = QC(e20, GC); + t10 = Cb(t10), e20 -= GC; + for (var o10 = ih(r10, t10); ++n10 < e20; ) + t10(n10); + return o10; + } + function XC() { + return this; + } + function ZC(e20, t10) { + var n10 = e20; + return n10 instanceof Of && (n10 = n10.value()), cp(t10, function(e21, t11) { + return t11.func.apply(t11.thisArg, vv([e21], t11.args)); + }, n10); + } + function e$() { + return ZC(this.__wrapped__, this.__actions__); + } + function t$(e20) { + return sv(e20).toLowerCase(); + } + function n$(e20) { + return Cu(e20) ? Su(e20, uv) : wu(e20) ? [e20] : Nf(av(sv(e20))); + } + var r$ = 9007199254740991; + function o$(e20) { + return e20 ? Xp(Uu(e20), -9007199254740991, r$) : 0 === e20 ? e20 : 0; + } + function i$(e20) { + return sv(e20).toUpperCase(); + } + function a$(e20, t10, n10) { + var r10 = Cu(e20), o10 = r10 || ph(e20) || jh(e20); + if (t10 = ky(t10), null == n10) { + var i10 = e20 && e20.constructor; + n10 = o10 ? r10 ? new i10() : [] : Iu(e20) && Zu(i10) ? yf(wv(e20)) : {}; + } + return (o10 ? Qf : Oy)(e20, function(e21, r11, o11) { + return t10(n10, e21, r11, o11); + }), n10; + } + function s$(e20, t10) { + for (var n10 = e20.length; n10-- && Zf(t10, e20[n10], 0) > -1; ) + ; + return n10; + } + function c$(e20, t10) { + for (var n10 = -1, r10 = e20.length; ++n10 < r10 && Zf(t10, e20[n10], 0) > -1; ) + ; + return n10; + } + function l$(e20, t10, n10) { + if ((e20 = sv(e20)) && (n10 || void 0 === t10)) + return Nu(e20); + if (!e20 || !(t10 = Mu(t10))) + return e20; + var r10 = op(e20), o10 = op(t10); + return Vv(r10, c$(r10, o10), s$(r10, o10) + 1).join(""); + } + function u$(e20, t10, n10) { + if ((e20 = sv(e20)) && (n10 || void 0 === t10)) + return e20.slice(0, Tu(e20) + 1); + if (!e20 || !(t10 = Mu(t10))) + return e20; + var r10 = op(e20); + return Vv(r10, 0, s$(r10, op(t10)) + 1).join(""); + } + var f$ = /^\s+/; + function d$(e20, t10, n10) { + if ((e20 = sv(e20)) && (n10 || void 0 === t10)) + return e20.replace(f$, ""); + if (!e20 || !(t10 = Mu(t10))) + return e20; + var r10 = op(e20); + return Vv(r10, c$(r10, op(t10))).join(""); + } + var h$ = /\w*$/; + function v$(e20, t10) { + var n10 = 30, r10 = "..."; + if (Iu(t10)) { + var o10 = "separator" in t10 ? t10.separator : o10; + n10 = "length" in t10 ? Uu(t10.length) : n10, r10 = "omission" in t10 ? Mu(t10.omission) : r10; + } + var i10 = (e20 = sv(e20)).length; + if (Wv(e20)) { + var a10 = op(e20); + i10 = a10.length; + } + if (n10 >= i10) + return e20; + var s10 = n10 - Cj(r10); + if (s10 < 1) + return r10; + var c10 = a10 ? Vv(a10, 0, s10).join("") : e20.slice(0, s10); + if (void 0 === o10) + return c10 + r10; + if (a10 && (s10 += c10.length - s10), Vw(o10)) { + if (e20.slice(s10).search(o10)) { + var l10, u10 = c10; + for (o10.global || (o10 = RegExp(o10.source, sv(h$.exec(o10)) + "g")), o10.lastIndex = 0; l10 = o10.exec(u10); ) + var f10 = l10.index; + c10 = c10.slice(0, void 0 === f10 ? s10 : f10); + } + } else if (e20.indexOf(Mu(o10), s10) != s10) { + var d10 = c10.lastIndexOf(o10); + d10 > -1 && (c10 = c10.slice(0, d10)); + } + return c10 + r10; + } + function p$(e20) { + return Vd(e20, 1); + } + var m$ = lp({ "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }); + var g$ = /&(?:amp|lt|gt|quot|#39);/g; + var y$ = RegExp(g$.source); + function b$(e20) { + return (e20 = sv(e20)) && y$.test(e20) ? e20.replace(g$, m$) : e20; + } + var k$ = ym && 1 / Rg(new ym([, -0]))[1] == 1 / 0 ? function(e20) { + return new ym(e20); + } : Mf; + var w$ = 200; + function x$(e20, t10, n10) { + var r10 = -1, o10 = ed, i10 = e20.length, a10 = true, s10 = [], c10 = s10; + if (n10) + a10 = false, o10 = lb; + else if (i10 >= w$) { + var l10 = t10 ? null : k$(e20); + if (l10) + return Rg(l10); + a10 = false, o10 = Mg, c10 = new _g(); + } else + c10 = t10 ? [] : s10; + e: + for (; ++r10 < i10; ) { + var u10 = e20[r10], f10 = t10 ? t10(u10) : u10; + if (u10 = n10 || 0 !== u10 ? u10 : 0, a10 && f10 == f10) { + for (var d10 = c10.length; d10--; ) + if (c10[d10] === f10) + continue e; + t10 && c10.push(f10), s10.push(u10); + } else + o10(c10, f10, n10) || (c10 !== s10 && c10.push(f10), s10.push(u10)); + } + return s10; + } + var j$ = Yd(function(e20) { + return x$(gv(e20, 1, Qy, true)); + }); + var S$ = Yd(function(e20) { + var t10 = vb(e20); + return Qy(t10) && (t10 = void 0), x$(gv(e20, 1, Qy, true), ky(t10)); + }); + var C$ = S$; + var $$ = Yd(function(e20) { + var t10 = vb(e20); + return t10 = "function" == typeof t10 ? t10 : void 0, x$(gv(e20, 1, Qy, true), void 0, t10); + }); + function _$(e20) { + return e20 && e20.length ? x$(e20) : []; + } + function O$(e20, t10) { + return e20 && e20.length ? x$(e20, ky(t10)) : []; + } + function M$(e20, t10) { + return t10 = "function" == typeof t10 ? t10 : void 0, e20 && e20.length ? x$(e20, void 0, t10) : []; + } + var E$ = 0; + function A$(e20) { + var t10 = ++E$; + return sv(e20) + t10; + } + function P$(e20, t10) { + return null == e20 || Vx(e20, t10); + } + var T$ = Math.max; + function R$(e20) { + if (!e20 || !e20.length) + return []; + var t10 = 0; + return e20 = sm(e20, function(e21) { + if (Qy(e21)) + return t10 = T$(e21.length, t10), true; + }), ih(t10, function(t11) { + return Su(e20, yy(t11)); + }); + } + function N$(e20, t10) { + if (!e20 || !e20.length) + return []; + var n10 = R$(e20); + return null == t10 ? n10 : Su(n10, function(e21) { + return wf(t10, void 0, e21); + }); + } + function I$(e20, t10, n10, r10) { + return Jx(e20, t10, n10(fv(e20, t10)), r10); + } + function D$(e20, t10, n10) { + return null == e20 ? e20 : I$(e20, t10, Cb(n10)); + } + function q$(e20, t10, n10, r10) { + return r10 = "function" == typeof r10 ? r10 : void 0, null == e20 ? e20 : I$(e20, t10, Cb(n10), r10); + } + var z$ = Bp(function(e20, t10, n10) { + return e20 + (n10 ? " " : "") + t10.toUpperCase(); + }); + var B$ = z$; + function L$(e20) { + return null == e20 ? [] : Hk(e20, Ih(e20)); + } + var F$ = Yd(function(e20, t10) { + return Qy(e20) ? fb(e20, t10) : []; + }); + var V$ = F$; + function H$(e20, t10) { + return Dj(Cb(t10), e20); + } + var W$ = bv(function(e20) { + var t10 = e20.length, n10 = t10 ? e20[0] : 0, r10 = this.__wrapped__, o10 = function(t11) { + return hv(t11, e20); + }; + return !(t10 > 1 || this.__actions__.length) && r10 instanceof Of && hd(n10) ? ((r10 = r10.slice(n10, +n10 + (t10 ? 1 : 0))).__actions__.push({ func: JC, args: [o10], thisArg: void 0 }), new Rf(r10, this.__chain__).thru(function(e21) { + return t10 && !e21.length && e21.push(void 0), e21; + })) : this.thru(o10); + }); + var U$ = W$; + function J$() { + return Kp(this); + } + function K$() { + var e20 = this.__wrapped__; + if (e20 instanceof Of) { + var t10 = e20; + return this.__actions__.length && (t10 = new Of(this)), (t10 = t10.reverse()).__actions__.push({ func: JC, args: [OS], thisArg: void 0 }), new Rf(t10, this.__chain__); + } + return this.thru(OS); + } + function G$(e20, t10, n10) { + var r10 = e20.length; + if (r10 < 2) + return r10 ? x$(e20[0]) : []; + for (var o10 = -1, i10 = Array(r10); ++o10 < r10; ) + for (var a10 = e20[o10], s10 = -1; ++s10 < r10; ) + s10 != o10 && (i10[o10] = fb(i10[o10] || a10, e20[s10], t10, n10)); + return x$(gv(i10, 1), t10, n10); + } + var Q$ = Yd(function(e20) { + return G$(sm(e20, Qy)); + }); + var Y$ = Yd(function(e20) { + var t10 = vb(e20); + return Qy(t10) && (t10 = void 0), G$(sm(e20, Qy), ky(t10)); + }); + var X$ = Y$; + var Z$ = Yd(function(e20) { + var t10 = vb(e20); + return t10 = "function" == typeof t10 ? t10 : void 0, G$(sm(e20, Qy), void 0, t10); + }); + var e_ = Yd(R$); + function t_(e20, t10, n10) { + for (var r10 = -1, o10 = e20.length, i10 = t10.length, a10 = {}; ++r10 < o10; ) { + var s10 = r10 < i10 ? t10[r10] : void 0; + n10(a10, e20[r10], s10); + } + return a10; + } + function n_(e20, t10) { + return t_(e20 || [], t10 || [], Jd); + } + function r_(e20, t10) { + return t_(e20 || [], t10 || [], Jx); + } + var o_ = Yd(function(e20) { + var t10 = e20.length, n10 = t10 > 1 ? e20[t10 - 1] : void 0; + return n10 = "function" == typeof n10 ? (e20.pop(), n10) : void 0, N$(e20, n10); + }); + var i_ = o_; + var a_ = { chunk: Yp, compact: Cg, concat: $g, difference: hb, differenceBy: mb, differenceWith: yb, drop: kb, dropRight: wb, dropRightWhile: jb, dropWhile: Sb, fill: Kb, findIndex: Zb, findLastIndex: ik, first: ck, flatten: yv, flattenDeep: vk, flattenDepth: pk, fromPairs: Ck, head: ck, indexOf: Gk, initial: Qk, intersection: ew, intersectionBy: nw, intersectionWith: rw, join: Yw, last: vb, lastIndexOf: ox, nth: Lx, pull: Qj, pullAll: Gj, pullAllBy: Yj, pullAllWith: Xj, pullAt: nS, remove: xS, reverse: OS, slice: VS, sortedIndex: nC, sortedIndexBy: rC, sortedIndexOf: oC, sortedLastIndex: iC, sortedLastIndexBy: aC, sortedLastIndexOf: sC, sortedUniq: lC, sortedUniqBy: uC, tail: jC, take: SC, takeRight: CC, takeRightWhile: $C, takeWhile: _C, union: j$, unionBy: C$, unionWith: $$, uniq: _$, uniqBy: O$, uniqWith: M$, unzip: R$, unzipWith: N$, without: V$, xor: Q$, xorBy: X$, xorWith: Z$, zip: e_, zipObject: n_, zipObjectDeep: r_, zipWith: i_ }; + var s_ = { countBy: Ny, each: $b, eachRight: Ab, every: Wb, filter: Qb, find: ek, findLast: ak, flatMap: fk, flatMapDeep: dk, flatMapDepth: hk, forEach: $b, forEachRight: Ab, groupBy: Ak, includes: Jk, invokeMap: gw, keyBy: tx, map: uk, orderBy: ej, partition: Lj, reduce: yS, reduceRight: kS, reject: wS, sample: PS, sampleSize: IS, shuffle: LS, size: FS, some: JS, sortBy: GS }; + var c_ = { now: zy }; + var l_ = { after: Ju, ary: Vd, before: Nv, bind: Dv, bindKey: Lv, curry: Dy, curryRight: qy, debounce: Vy, defer: ab, delay: cb, flip: mk, memoize: rv, negate: Rx, once: Yx, overArgs: aj, partial: Dj, partialRight: zj, rearg: mS, rest: CS, spread: hC, throttle: UC, unary: p$, wrap: H$ }; + var u_ = { castArray: Vp, clone: yg, cloneDeep: bg, cloneDeepWith: xg, cloneWith: jg, conformsTo: Sy, eq: Wd, gt: Rk, gte: Nk, isArguments: uh, isArray: Cu, isArrayBuffer: bw, isArrayLike: eh, isArrayLikeObject: Qy, isBoolean: kw, isBuffer: ph, isDate: xw, isElement: jw, isEmpty: _w, isEqual: Ow, isEqualWith: Mw, isError: Av, isFinite: Aw, isFunction: Zu, isInteger: Pw, isLength: Zd, isMap: ag, isMatch: Tw, isMatchWith: Rw, isNaN: Dw, isNative: zw, isNil: Bw, isNull: Lw, isNumber: Iw, isObject: Iu, isObjectLike: bu, isPlainObject: Ov, isRegExp: Vw, isSafeInteger: Ww, isSet: cg, isString: Vk, isSymbol: wu, isTypedArray: jh, isUndefined: Uw, isWeakMap: Jw, isWeakSet: Kw, lt: lx, lte: ux, toArray: qx, toFinite: Wu, toInteger: Uu, toLength: Jb, toNumber: Fu, toPlainObject: Xy, toSafeInteger: o$, toString: sv }; + var f_ = { add: Au, ceil: Jp, divide: bb, floor: gk, max: mx, maxBy: gx, mean: wx, meanBy: xx, min: Mx, minBy: Ex, multiply: Px, round: MS, subtract: kC, sum: wC, sumBy: xC }; + var d_ = Zp; + var h_ = Lk; + var v_ = lS; + var p_ = { assign: Th, assignIn: qh, assignInWith: Bh, assignWith: Fh, at: kv, create: Iy, defaults: Ky, defaultsDeep: rb, entries: Rb, entriesIn: Nb, extend: qh, extendWith: Bh, findKey: nk, findLastKey: sk, forIn: wk, forInRight: xk, forOwn: jk, forOwnRight: Sk, functions: _k, functionsIn: Ok, get: dv, has: qk, hasIn: vy, invert: sw, invertBy: dw, invoke: pw, keys: Eh, keysIn: Ih, mapKeys: fx, mapValues: dx, merge: Sx, mergeWith: nb, omit: Ux, omitBy: Qx, pick: Vj, pickBy: Gx, result: $S, set: DS, setWith: qS, toPairs: Rb, toPairsIn: Nb, transform: a$, unset: P$, update: D$, updateWith: q$, values: Wk, valuesIn: L$ }; + var m_ = { at: U$, chain: Kp, commit: Sg, lodash: qf, next: zx, plant: Hj, reverse: K$, tap: OC, thru: JC, toIterator: XC, toJSON: e$, value: e$, valueOf: e$, wrapperChain: J$ }; + var g_ = { camelCase: Fp, capitalize: sp, deburr: hp, endsWith: Pb, escape: zb, escapeRegExp: Fb, kebabCase: Zw, lowerCase: ax, lowerFirst: sx, pad: Ej, padEnd: Aj, padStart: Pj, parseInt: Nj, repeat: jS, replace: SS, snakeCase: WS, split: fC, startCase: pC, startsWith: mC, template: HC, templateSettings: NC, toLower: t$, toUpper: i$, trim: l$, trimEnd: u$, trimStart: d$, truncate: v$, unescape: b$, upperCase: B$, upperFirst: ap, words: qp }; + var y_ = { attempt: Tv, bindAll: zv, cond: wy, conforms: jy, constant: Uf, defaultTo: Hy, flow: bk, flowRight: kk, identity: Ku, iteratee: Gw, matches: hx, matchesProperty: vx, method: $x, methodOf: Ox, mixin: Ax, noop: Mf, nthArg: Fx, over: nj, overEvery: sj, overSome: cj, property: by, propertyOf: Wj, range: hS, rangeRight: vS, stubArray: cm, stubFalse: fh, stubObject: gC, stubString: yC, stubTrue: bC, times: YC, toPath: n$, uniqueId: A$ }; + var b_ = Math.max; + var k_ = Math.min; + var w_ = Math.min; + var x_; + var j_ = 4294967295; + var S_ = Array.prototype; + var C_ = Object.prototype.hasOwnProperty; + var $_ = lu ? lu.iterator : void 0; + var __ = Math.max; + var O_ = Math.min; + var M_ = /* @__PURE__ */ function(e20) { + return function(t10, n10, r10) { + if (null == r10) { + var o10 = Iu(n10), i10 = o10 && Eh(n10), a10 = i10 && i10.length && $k(n10, i10); + (a10 ? a10.length : o10) || (r10 = n10, n10 = t10, t10 = this); + } + return e20(t10, n10, r10); + }; + }(Ax); + qf.after = l_.after, qf.ary = l_.ary, qf.assign = p_.assign, qf.assignIn = p_.assignIn, qf.assignInWith = p_.assignInWith, qf.assignWith = p_.assignWith, qf.at = p_.at, qf.before = l_.before, qf.bind = l_.bind, qf.bindAll = y_.bindAll, qf.bindKey = l_.bindKey, qf.castArray = u_.castArray, qf.chain = m_.chain, qf.chunk = a_.chunk, qf.compact = a_.compact, qf.concat = a_.concat, qf.cond = y_.cond, qf.conforms = y_.conforms, qf.constant = y_.constant, qf.countBy = s_.countBy, qf.create = p_.create, qf.curry = l_.curry, qf.curryRight = l_.curryRight, qf.debounce = l_.debounce, qf.defaults = p_.defaults, qf.defaultsDeep = p_.defaultsDeep, qf.defer = l_.defer, qf.delay = l_.delay, qf.difference = a_.difference, qf.differenceBy = a_.differenceBy, qf.differenceWith = a_.differenceWith, qf.drop = a_.drop, qf.dropRight = a_.dropRight, qf.dropRightWhile = a_.dropRightWhile, qf.dropWhile = a_.dropWhile, qf.fill = a_.fill, qf.filter = s_.filter, qf.flatMap = s_.flatMap, qf.flatMapDeep = s_.flatMapDeep, qf.flatMapDepth = s_.flatMapDepth, qf.flatten = a_.flatten, qf.flattenDeep = a_.flattenDeep, qf.flattenDepth = a_.flattenDepth, qf.flip = l_.flip, qf.flow = y_.flow, qf.flowRight = y_.flowRight, qf.fromPairs = a_.fromPairs, qf.functions = p_.functions, qf.functionsIn = p_.functionsIn, qf.groupBy = s_.groupBy, qf.initial = a_.initial, qf.intersection = a_.intersection, qf.intersectionBy = a_.intersectionBy, qf.intersectionWith = a_.intersectionWith, qf.invert = p_.invert, qf.invertBy = p_.invertBy, qf.invokeMap = s_.invokeMap, qf.iteratee = y_.iteratee, qf.keyBy = s_.keyBy, qf.keys = Eh, qf.keysIn = p_.keysIn, qf.map = s_.map, qf.mapKeys = p_.mapKeys, qf.mapValues = p_.mapValues, qf.matches = y_.matches, qf.matchesProperty = y_.matchesProperty, qf.memoize = l_.memoize, qf.merge = p_.merge, qf.mergeWith = p_.mergeWith, qf.method = y_.method, qf.methodOf = y_.methodOf, qf.mixin = M_, qf.negate = Rx, qf.nthArg = y_.nthArg, qf.omit = p_.omit, qf.omitBy = p_.omitBy, qf.once = l_.once, qf.orderBy = s_.orderBy, qf.over = y_.over, qf.overArgs = l_.overArgs, qf.overEvery = y_.overEvery, qf.overSome = y_.overSome, qf.partial = l_.partial, qf.partialRight = l_.partialRight, qf.partition = s_.partition, qf.pick = p_.pick, qf.pickBy = p_.pickBy, qf.property = y_.property, qf.propertyOf = y_.propertyOf, qf.pull = a_.pull, qf.pullAll = a_.pullAll, qf.pullAllBy = a_.pullAllBy, qf.pullAllWith = a_.pullAllWith, qf.pullAt = a_.pullAt, qf.range = y_.range, qf.rangeRight = y_.rangeRight, qf.rearg = l_.rearg, qf.reject = s_.reject, qf.remove = a_.remove, qf.rest = l_.rest, qf.reverse = a_.reverse, qf.sampleSize = s_.sampleSize, qf.set = p_.set, qf.setWith = p_.setWith, qf.shuffle = s_.shuffle, qf.slice = a_.slice, qf.sortBy = s_.sortBy, qf.sortedUniq = a_.sortedUniq, qf.sortedUniqBy = a_.sortedUniqBy, qf.split = g_.split, qf.spread = l_.spread, qf.tail = a_.tail, qf.take = a_.take, qf.takeRight = a_.takeRight, qf.takeRightWhile = a_.takeRightWhile, qf.takeWhile = a_.takeWhile, qf.tap = m_.tap, qf.throttle = l_.throttle, qf.thru = JC, qf.toArray = u_.toArray, qf.toPairs = p_.toPairs, qf.toPairsIn = p_.toPairsIn, qf.toPath = y_.toPath, qf.toPlainObject = u_.toPlainObject, qf.transform = p_.transform, qf.unary = l_.unary, qf.union = a_.union, qf.unionBy = a_.unionBy, qf.unionWith = a_.unionWith, qf.uniq = a_.uniq, qf.uniqBy = a_.uniqBy, qf.uniqWith = a_.uniqWith, qf.unset = p_.unset, qf.unzip = a_.unzip, qf.unzipWith = a_.unzipWith, qf.update = p_.update, qf.updateWith = p_.updateWith, qf.values = p_.values, qf.valuesIn = p_.valuesIn, qf.without = a_.without, qf.words = g_.words, qf.wrap = l_.wrap, qf.xor = a_.xor, qf.xorBy = a_.xorBy, qf.xorWith = a_.xorWith, qf.zip = a_.zip, qf.zipObject = a_.zipObject, qf.zipObjectDeep = a_.zipObjectDeep, qf.zipWith = a_.zipWith, qf.entries = p_.toPairs, qf.entriesIn = p_.toPairsIn, qf.extend = p_.assignIn, qf.extendWith = p_.assignInWith, M_(qf, qf), qf.add = f_.add, qf.attempt = y_.attempt, qf.camelCase = g_.camelCase, qf.capitalize = g_.capitalize, qf.ceil = f_.ceil, qf.clamp = d_, qf.clone = u_.clone, qf.cloneDeep = u_.cloneDeep, qf.cloneDeepWith = u_.cloneDeepWith, qf.cloneWith = u_.cloneWith, qf.conformsTo = u_.conformsTo, qf.deburr = g_.deburr, qf.defaultTo = y_.defaultTo, qf.divide = f_.divide, qf.endsWith = g_.endsWith, qf.eq = u_.eq, qf.escape = g_.escape, qf.escapeRegExp = g_.escapeRegExp, qf.every = s_.every, qf.find = s_.find, qf.findIndex = a_.findIndex, qf.findKey = p_.findKey, qf.findLast = s_.findLast, qf.findLastIndex = a_.findLastIndex, qf.findLastKey = p_.findLastKey, qf.floor = f_.floor, qf.forEach = s_.forEach, qf.forEachRight = s_.forEachRight, qf.forIn = p_.forIn, qf.forInRight = p_.forInRight, qf.forOwn = p_.forOwn, qf.forOwnRight = p_.forOwnRight, qf.get = p_.get, qf.gt = u_.gt, qf.gte = u_.gte, qf.has = p_.has, qf.hasIn = p_.hasIn, qf.head = a_.head, qf.identity = Ku, qf.includes = s_.includes, qf.indexOf = a_.indexOf, qf.inRange = h_, qf.invoke = p_.invoke, qf.isArguments = u_.isArguments, qf.isArray = Cu, qf.isArrayBuffer = u_.isArrayBuffer, qf.isArrayLike = u_.isArrayLike, qf.isArrayLikeObject = u_.isArrayLikeObject, qf.isBoolean = u_.isBoolean, qf.isBuffer = u_.isBuffer, qf.isDate = u_.isDate, qf.isElement = u_.isElement, qf.isEmpty = u_.isEmpty, qf.isEqual = u_.isEqual, qf.isEqualWith = u_.isEqualWith, qf.isError = u_.isError, qf.isFinite = u_.isFinite, qf.isFunction = u_.isFunction, qf.isInteger = u_.isInteger, qf.isLength = u_.isLength, qf.isMap = u_.isMap, qf.isMatch = u_.isMatch, qf.isMatchWith = u_.isMatchWith, qf.isNaN = u_.isNaN, qf.isNative = u_.isNative, qf.isNil = u_.isNil, qf.isNull = u_.isNull, qf.isNumber = u_.isNumber, qf.isObject = Iu, qf.isObjectLike = u_.isObjectLike, qf.isPlainObject = u_.isPlainObject, qf.isRegExp = u_.isRegExp, qf.isSafeInteger = u_.isSafeInteger, qf.isSet = u_.isSet, qf.isString = u_.isString, qf.isSymbol = u_.isSymbol, qf.isTypedArray = u_.isTypedArray, qf.isUndefined = u_.isUndefined, qf.isWeakMap = u_.isWeakMap, qf.isWeakSet = u_.isWeakSet, qf.join = a_.join, qf.kebabCase = g_.kebabCase, qf.last = vb, qf.lastIndexOf = a_.lastIndexOf, qf.lowerCase = g_.lowerCase, qf.lowerFirst = g_.lowerFirst, qf.lt = u_.lt, qf.lte = u_.lte, qf.max = f_.max, qf.maxBy = f_.maxBy, qf.mean = f_.mean, qf.meanBy = f_.meanBy, qf.min = f_.min, qf.minBy = f_.minBy, qf.stubArray = y_.stubArray, qf.stubFalse = y_.stubFalse, qf.stubObject = y_.stubObject, qf.stubString = y_.stubString, qf.stubTrue = y_.stubTrue, qf.multiply = f_.multiply, qf.nth = a_.nth, qf.noop = y_.noop, qf.now = c_.now, qf.pad = g_.pad, qf.padEnd = g_.padEnd, qf.padStart = g_.padStart, qf.parseInt = g_.parseInt, qf.random = v_, qf.reduce = s_.reduce, qf.reduceRight = s_.reduceRight, qf.repeat = g_.repeat, qf.replace = g_.replace, qf.result = p_.result, qf.round = f_.round, qf.sample = s_.sample, qf.size = s_.size, qf.snakeCase = g_.snakeCase, qf.some = s_.some, qf.sortedIndex = a_.sortedIndex, qf.sortedIndexBy = a_.sortedIndexBy, qf.sortedIndexOf = a_.sortedIndexOf, qf.sortedLastIndex = a_.sortedLastIndex, qf.sortedLastIndexBy = a_.sortedLastIndexBy, qf.sortedLastIndexOf = a_.sortedLastIndexOf, qf.startCase = g_.startCase, qf.startsWith = g_.startsWith, qf.subtract = f_.subtract, qf.sum = f_.sum, qf.sumBy = f_.sumBy, qf.template = g_.template, qf.times = y_.times, qf.toFinite = u_.toFinite, qf.toInteger = Uu, qf.toLength = u_.toLength, qf.toLower = g_.toLower, qf.toNumber = u_.toNumber, qf.toSafeInteger = u_.toSafeInteger, qf.toString = u_.toString, qf.toUpper = g_.toUpper, qf.trim = g_.trim, qf.trimEnd = g_.trimEnd, qf.trimStart = g_.trimStart, qf.truncate = g_.truncate, qf.unescape = g_.unescape, qf.uniqueId = y_.uniqueId, qf.upperCase = g_.upperCase, qf.upperFirst = g_.upperFirst, qf.each = s_.forEach, qf.eachRight = s_.forEachRight, qf.first = a_.head, M_(qf, (x_ = {}, Oy(qf, function(e20, t10) { + C_.call(qf.prototype, t10) || (x_[t10] = e20); + }), x_), { chain: false }), qf.VERSION = "4.17.21", (qf.templateSettings = g_.templateSettings).imports._ = qf, Qf(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e20) { + qf[e20].placeholder = qf; + }), Qf(["drop", "take"], function(e20, t10) { + Of.prototype[e20] = function(n10) { + n10 = void 0 === n10 ? 1 : __(Uu(n10), 0); + var r10 = this.__filtered__ && !t10 ? new Of(this) : this.clone(); + return r10.__filtered__ ? r10.__takeCount__ = O_(n10, r10.__takeCount__) : r10.__views__.push({ size: O_(n10, j_), type: e20 + (r10.__dir__ < 0 ? "Right" : "") }), r10; + }, Of.prototype[e20 + "Right"] = function(t11) { + return this.reverse()[e20](t11).reverse(); + }; + }), Qf(["filter", "map", "takeWhile"], function(e20, t10) { + var n10 = t10 + 1, r10 = 1 == n10 || 3 == n10; + Of.prototype[e20] = function(e21) { + var t11 = this.clone(); + return t11.__iteratees__.push({ iteratee: ky(e21), type: n10 }), t11.__filtered__ = t11.__filtered__ || r10, t11; + }; + }), Qf(["head", "last"], function(e20, t10) { + var n10 = "take" + (t10 ? "Right" : ""); + Of.prototype[e20] = function() { + return this[n10](1).value()[0]; + }; + }), Qf(["initial", "tail"], function(e20, t10) { + var n10 = "drop" + (t10 ? "" : "Right"); + Of.prototype[e20] = function() { + return this.__filtered__ ? new Of(this) : this[n10](1); + }; + }), Of.prototype.compact = function() { + return this.filter(Ku); + }, Of.prototype.find = function(e20) { + return this.filter(e20).head(); + }, Of.prototype.findLast = function(e20) { + return this.reverse().find(e20); + }, Of.prototype.invokeMap = Yd(function(e20, t10) { + return "function" == typeof e20 ? new Of(this) : this.map(function(n10) { + return vw(n10, e20, t10); + }); + }), Of.prototype.reject = function(e20) { + return this.filter(Rx(ky(e20))); + }, Of.prototype.slice = function(e20, t10) { + e20 = Uu(e20); + var n10 = this; + return n10.__filtered__ && (e20 > 0 || t10 < 0) ? new Of(n10) : (e20 < 0 ? n10 = n10.takeRight(-e20) : e20 && (n10 = n10.drop(e20)), void 0 !== t10 && (n10 = (t10 = Uu(t10)) < 0 ? n10.dropRight(-t10) : n10.take(t10 - e20)), n10); + }, Of.prototype.takeRightWhile = function(e20) { + return this.reverse().takeWhile(e20).reverse(); + }, Of.prototype.toArray = function() { + return this.take(j_); + }, Oy(Of.prototype, function(e20, t10) { + var n10 = /^(?:filter|find|map|reject)|While$/.test(t10), r10 = /^(?:head|last)$/.test(t10), o10 = qf[r10 ? "take" + ("last" == t10 ? "Right" : "") : t10], i10 = r10 || /^find/.test(t10); + o10 && (qf.prototype[t10] = function() { + var t11 = this.__wrapped__, a10 = r10 ? [1] : arguments, s10 = t11 instanceof Of, c10 = a10[0], l10 = s10 || Cu(t11), u10 = function(e21) { + var t12 = o10.apply(qf, vv([e21], a10)); + return r10 && f10 ? t12[0] : t12; + }; + l10 && n10 && "function" == typeof c10 && 1 != c10.length && (s10 = l10 = false); + var f10 = this.__chain__, d10 = !!this.__actions__.length, h10 = i10 && !f10, v10 = s10 && !d10; + if (!i10 && l10) { + t11 = v10 ? t11 : new Of(this); + var p10 = e20.apply(t11, a10); + return p10.__actions__.push({ func: JC, args: [u10], thisArg: void 0 }), new Rf(p10, f10); + } + return h10 && v10 ? e20.apply(this, a10) : (p10 = this.thru(u10), h10 ? r10 ? p10.value()[0] : p10.value() : p10); + }); + }), Qf(["pop", "push", "shift", "sort", "splice", "unshift"], function(e20) { + var t10 = S_[e20], n10 = /^(?:push|sort|unshift)$/.test(e20) ? "tap" : "thru", r10 = /^(?:pop|shift)$/.test(e20); + qf.prototype[e20] = function() { + var e21 = arguments; + if (r10 && !this.__chain__) { + var o10 = this.value(); + return t10.apply(Cu(o10) ? o10 : [], e21); + } + return this[n10](function(n11) { + return t10.apply(Cu(n11) ? n11 : [], e21); + }); + }; + }), Oy(Of.prototype, function(e20, t10) { + var n10 = qf[t10]; + if (n10) { + var r10 = n10.name + ""; + C_.call(Af, r10) || (Af[r10] = []), Af[r10].push({ name: t10, func: n10 }); + } + }), Af[jd(void 0, 2).name] = [{ name: "wrapper", func: void 0 }], Of.prototype.clone = function() { + var e20 = new Of(this.__wrapped__); + return e20.__actions__ = Nf(this.__actions__), e20.__dir__ = this.__dir__, e20.__filtered__ = this.__filtered__, e20.__iteratees__ = Nf(this.__iteratees__), e20.__takeCount__ = this.__takeCount__, e20.__views__ = Nf(this.__views__), e20; + }, Of.prototype.reverse = function() { + if (this.__filtered__) { + var e20 = new Of(this); + e20.__dir__ = -1, e20.__filtered__ = true; + } else + (e20 = this.clone()).__dir__ *= -1; + return e20; + }, Of.prototype.value = function() { + var e20 = this.__wrapped__.value(), t10 = this.__dir__, n10 = Cu(e20), r10 = t10 < 0, o10 = n10 ? e20.length : 0, i10 = function(e21, t11, n11) { + for (var r11 = -1, o11 = n11.length; ++r11 < o11; ) { + var i11 = n11[r11], a11 = i11.size; + switch (i11.type) { + case "drop": + e21 += a11; + break; + case "dropRight": + t11 -= a11; + break; + case "take": + t11 = k_(t11, e21 + a11); + break; + case "takeRight": + e21 = b_(e21, t11 - a11); + } + } + return { start: e21, end: t11 }; + }(0, o10, this.__views__), a10 = i10.start, s10 = i10.end, c10 = s10 - a10, l10 = r10 ? s10 : a10 - 1, u10 = this.__iteratees__, f10 = u10.length, d10 = 0, h10 = w_(c10, this.__takeCount__); + if (!n10 || !r10 && o10 == c10 && h10 == c10) + return ZC(e20, this.__actions__); + var v10 = []; + e: + for (; c10-- && d10 < h10; ) { + for (var p10 = -1, m10 = e20[l10 += t10]; ++p10 < f10; ) { + var g10 = u10[p10], y10 = g10.iteratee, b10 = g10.type, k10 = y10(m10); + if (2 == b10) + m10 = k10; + else if (!k10) { + if (1 == b10) + continue e; + break e; + } + } + v10[d10++] = m10; + } + return v10; + }, qf.prototype.at = m_.at, qf.prototype.chain = m_.wrapperChain, qf.prototype.commit = m_.commit, qf.prototype.next = m_.next, qf.prototype.plant = m_.plant, qf.prototype.reverse = m_.reverse, qf.prototype.toJSON = qf.prototype.valueOf = qf.prototype.value = m_.value, qf.prototype.first = qf.prototype.head, $_ && (qf.prototype[$_] = m_.toIterator); + var E_ = Object.freeze({ __proto__: null, add: Au, after: Ju, ary: Vd, assign: Th, assignIn: qh, assignInWith: Bh, assignWith: Fh, at: kv, attempt: Tv, before: Nv, bind: Dv, bindAll: zv, bindKey: Lv, camelCase: Fp, capitalize: sp, castArray: Vp, ceil: Jp, chain: Kp, chunk: Yp, clamp: Zp, clone: yg, cloneDeep: bg, cloneDeepWith: xg, cloneWith: jg, commit: Sg, compact: Cg, concat: $g, cond: wy, conforms: jy, conformsTo: Sy, constant: Uf, countBy: Ny, create: Iy, curry: Dy, curryRight: qy, debounce: Vy, deburr: hp, default: qf, defaultTo: Hy, defaults: Ky, defaultsDeep: rb, defer: ab, delay: cb, difference: hb, differenceBy: mb, differenceWith: yb, divide: bb, drop: kb, dropRight: wb, dropRightWhile: jb, dropWhile: Sb, each: $b, eachRight: Ab, endsWith: Pb, entries: Rb, entriesIn: Nb, eq: Wd, escape: zb, escapeRegExp: Fb, every: Wb, extend: qh, extendWith: Bh, fill: Kb, filter: Qb, find: ek, findIndex: Zb, findKey: nk, findLast: ak, findLastIndex: ik, findLastKey: sk, first: ck, flatMap: fk, flatMapDeep: dk, flatMapDepth: hk, flatten: yv, flattenDeep: vk, flattenDepth: pk, flip: mk, floor: gk, flow: bk, flowRight: kk, forEach: $b, forEachRight: Ab, forIn: wk, forInRight: xk, forOwn: jk, forOwnRight: Sk, fromPairs: Ck, functions: _k, functionsIn: Ok, get: dv, groupBy: Ak, gt: Rk, gte: Nk, has: qk, hasIn: vy, head: ck, identity: Ku, inRange: Lk, includes: Jk, indexOf: Gk, initial: Qk, intersection: ew, intersectionBy: nw, intersectionWith: rw, invert: sw, invertBy: dw, invoke: pw, invokeMap: gw, isArguments: uh, isArray: Cu, isArrayBuffer: bw, isArrayLike: eh, isArrayLikeObject: Qy, isBoolean: kw, isBuffer: ph, isDate: xw, isElement: jw, isEmpty: _w, isEqual: Ow, isEqualWith: Mw, isError: Av, isFinite: Aw, isFunction: Zu, isInteger: Pw, isLength: Zd, isMap: ag, isMatch: Tw, isMatchWith: Rw, isNaN: Dw, isNative: zw, isNil: Bw, isNull: Lw, isNumber: Iw, isObject: Iu, isObjectLike: bu, isPlainObject: Ov, isRegExp: Vw, isSafeInteger: Ww, isSet: cg, isString: Vk, isSymbol: wu, isTypedArray: jh, isUndefined: Uw, isWeakMap: Jw, isWeakSet: Kw, iteratee: Gw, join: Yw, kebabCase: Zw, keyBy: tx, keys: Eh, keysIn: Ih, last: vb, lastIndexOf: ox, lodash: qf, lowerCase: ax, lowerFirst: sx, lt: lx, lte: ux, map: uk, mapKeys: fx, mapValues: dx, matches: hx, matchesProperty: vx, max: mx, maxBy: gx, mean: wx, meanBy: xx, memoize: rv, merge: Sx, mergeWith: nb, method: $x, methodOf: Ox, min: Mx, minBy: Ex, mixin: Ax, multiply: Px, negate: Rx, next: zx, noop: Mf, now: zy, nth: Lx, nthArg: Fx, omit: Ux, omitBy: Qx, once: Yx, orderBy: ej, over: nj, overArgs: aj, overEvery: sj, overSome: cj, pad: Ej, padEnd: Aj, padStart: Pj, parseInt: Nj, partial: Dj, partialRight: zj, partition: Lj, pick: Vj, pickBy: Gx, plant: Hj, property: by, propertyOf: Wj, pull: Qj, pullAll: Gj, pullAllBy: Yj, pullAllWith: Xj, pullAt: nS, random: lS, range: hS, rangeRight: vS, rearg: mS, reduce: yS, reduceRight: kS, reject: wS, remove: xS, repeat: jS, replace: SS, rest: CS, result: $S, reverse: OS, round: MS, sample: PS, sampleSize: IS, set: DS, setWith: qS, shuffle: LS, size: FS, slice: VS, snakeCase: WS, some: JS, sortBy: GS, sortedIndex: nC, sortedIndexBy: rC, sortedIndexOf: oC, sortedLastIndex: iC, sortedLastIndexBy: aC, sortedLastIndexOf: sC, sortedUniq: lC, sortedUniqBy: uC, split: fC, spread: hC, startCase: pC, startsWith: mC, stubArray: cm, stubFalse: fh, stubObject: gC, stubString: yC, stubTrue: bC, subtract: kC, sum: wC, sumBy: xC, tail: jC, take: SC, takeRight: CC, takeRightWhile: $C, takeWhile: _C, tap: OC, template: HC, templateSettings: NC, throttle: UC, thru: JC, times: YC, toArray: qx, toFinite: Wu, toInteger: Uu, toIterator: XC, toJSON: e$, toLength: Jb, toLower: t$, toNumber: Fu, toPairs: Rb, toPairsIn: Nb, toPath: n$, toPlainObject: Xy, toSafeInteger: o$, toString: sv, toUpper: i$, transform: a$, trim: l$, trimEnd: u$, trimStart: d$, truncate: v$, unary: p$, unescape: b$, union: j$, unionBy: C$, unionWith: $$, uniq: _$, uniqBy: O$, uniqWith: M$, uniqueId: A$, unset: P$, unzip: R$, unzipWith: N$, update: D$, updateWith: q$, upperCase: B$, upperFirst: ap, value: e$, valueOf: e$, values: Wk, valuesIn: L$, without: V$, words: qp, wrap: H$, wrapperAt: U$, wrapperChain: J$, wrapperCommit: Sg, wrapperLodash: qf, wrapperNext: zx, wrapperPlant: Hj, wrapperReverse: K$, wrapperToIterator: XC, wrapperValue: e$, xor: Q$, xorBy: X$, xorWith: Z$, zip: e_, zipObject: n_, zipObjectDeep: r_, zipWith: i_ }); + var A_ = 1e4; + var P_ = []; + function T_(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n10 = {}; + if (!Array.isArray(e20)) + throw new TypeError("Array expected"); + function r10(e21, o11) { + (!Array.isArray(e21) && !Gl(e21) || t10 && o11.length > 0) && (n10[Zs(o11)] = true), Gl(e21) && Object.keys(e21).forEach(function(t11) { + r10(e21[t11], o11.concat(t11)); + }); + } + for (var o10 = Math.min(e20.length, A_), i10 = 0; i10 < o10; i10++) { + r10(e20[i10], P_); + } + return Object.keys(n10).sort().map(Xs); + } + function R_(e20, t10, n10) { + if (!(t10 <= e20)) + for (var r10 = e20; r10 < t10; r10++) + n10(r10); + } + function N_(e20, t10) { + return e20.length > t10 ? e20.slice(0, t10) : e20; + } + function I_(e20) { + return Ro({}, e20); + } + function D_(e20) { + return Object.values(e20); + } + function q_(e20, t10, n10, r10) { + var o10 = e20.slice(0), i10 = o10.splice(t10, n10); + return o10.splice.apply(o10, [t10 + r10, 0].concat(Bo(i10))), o10; + } + function z_(e20, t10) { + try { + return t10.parse(e20); + } catch (n10) { + return t10.parse(Hl(e20)); + } + } + function B_(e20, t10) { + try { + return z_(e20, t10); + } catch (e21) { + return; + } + } + function L_(e20, t10) { + e20 = e20.replace(V_, ""); + try { + return t10(e20); + } catch (e21) { + } + try { + return t10("[" + e20 + "]"); + } catch (e21) { + } + try { + return t10("{" + e20 + "}"); + } catch (e21) { + } + throw new Error("Failed to parse partial JSON"); + } + function F_(e20) { + e20 = e20.replace(V_, ""); + try { + return Hl(e20); + } catch (e21) { + } + try { + var t10 = Hl("[" + e20 + "]"); + return t10.substring(1, t10.length - 1); + } catch (e21) { + } + try { + var n10 = Hl("{" + e20 + "}"); + return n10.substring(1, n10.length - 1); + } catch (e21) { + } + throw new Error("Failed to repair partial JSON"); + } + var V_ = /,\s*$/; + function H_(e20, t10) { + var n10 = eO.exec(t10); + if (n10) { + var r10 = Ul(n10[2]), o10 = function(e21, t11) { + for (var n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : e21.length, o11 = 0, i11 = n11; i11 < r11; i11++) + e21.charAt(i11) === t11 && o11++; + return o11; + }(e20, "\n", 0, r10), i10 = r10 - e20.lastIndexOf("\n", r10) - 1; + return { position: r10, line: o10, column: i10, message: t10.replace(eO, function() { + return "line ".concat(o10 + 1, " column ").concat(i10 + 1); + }) }; + } + var a10 = tO.exec(t10), s10 = a10 ? Ul(a10[1]) : null, c10 = null !== s10 ? s10 - 1 : null, l10 = nO.exec(t10), u10 = l10 ? Ul(l10[1]) : null, f10 = null !== u10 ? u10 - 1 : null, d10 = null !== c10 && null !== f10 ? function(e21, t11, n11) { + var r11 = e21.indexOf("\n"), o11 = 1; + for (; o11 < t11 && -1 !== r11; ) + r11 = e21.indexOf("\n", r11 + 1), o11++; + return -1 !== r11 ? r11 + n11 + 1 : null; + }(e20, c10, f10) : null; + return { position: d10, line: c10, column: f10, message: t10.replace(/^JSON.parse: /, "").replace(/ of the JSON data$/, "") }; + } + function W_(e20) { + return Gl(e20) ? void 0 !== e20.json ? void 0 !== e20.text ? 'Content must contain either a property "json" or a property "text" but not both' : null : void 0 === e20.text ? 'Content must contain either a property "json" or a property "text"' : "string" != typeof e20.text ? 'Content "text" property must be a string containing a JSON document. Did you mean to use the "json" property instead?' : null : "Content must be an object"; + } + function J_(e20) { + return Gl(e20) && "string" == typeof e20.text; + } + function K_(e20) { + return Gl(e20) && void 0 !== e20.json; + } + function G_(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0, n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : JSON; + return J_(e20) ? e20 : { text: n10.stringify(e20.json, null, t10) }; + } + function Q_(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : JSON; + return K_(e20) ? e20 : { json: t10.parse(e20.text) }; + } + function Y_(e20, t10, n10) { + return G_(e20, t10, n10).text; + } + function X_(e20, t10) { + return Z_(e20, t10) > t10; + } + function Z_(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0; + if (J_(e20)) + return e20.text.length; + var n10 = e20.json, r10 = 0; + return function e21(n11) { + if (Array.isArray(n11)) { + if ((r10 += n11.length - 1 + 2) > t10) + return r10; + for (var o10 = 0; o10 < n11.length; o10++) { + if (e21(n11[o10]), r10 > t10) + return r10; + } + } else if (Gl(n11)) { + var i10 = Object.keys(n11); + r10 += 2 + i10.length + (i10.length - 1); + for (var a10 = 0; a10 < i10.length; a10++) { + var s10 = i10[a10], c10 = n11[s10]; + r10 += s10.length + 2, e21(c10); + } + } else + r10 += "string" == typeof n11 ? n11.length + 2 : String(n11).length; + }(n10), r10; + } + var eO = /(position|char) (\d+)/; + var tO = /line (\d+)/; + var nO = /column (\d+)/; + function rO(e20, t10) { + return e20.parse === t10.parse && e20.stringify === t10.stringify; + } + function oO(e20) { + return iO.test(e20) && e20.length > 2; + } + var iO = /^[[{]\S/; + function aO(e20) { + var t10 = e20.escapeControlCharacters, n10 = e20.escapeUnicodeCharacters; + return t10 ? n10 ? sO : cO : n10 ? lO : uO; + } + var sO = { escapeValue: function(e20) { + return fO(pO(String(e20))); + }, unescapeValue: function(e20) { + return mO(dO(e20)); + } }; + var cO = { escapeValue: function(e20) { + return pO(String(e20)); + }, unescapeValue: function(e20) { + return mO(e20); + } }; + var lO = { escapeValue: function(e20) { + return fO(String(e20)); + }, unescapeValue: function(e20) { + return dO(e20); + } }; + var uO = { escapeValue: function(e20) { + return String(e20); + }, unescapeValue: function(e20) { + return e20; + } }; + function fO(e20) { + return e20.replace(/[^\x20-\x7F]/g, function(e21) { + var t10; + return "\b" === e21 || "\f" === e21 || "\n" === e21 || "\r" === e21 || " " === e21 ? e21 : "\\u" + ("000" + (null === (t10 = e21.codePointAt(0)) || void 0 === t10 ? void 0 : t10.toString(16))).slice(-4); + }); + } + function dO(e20) { + return e20.replace(/\\u[a-fA-F0-9]{4}/g, function(e21) { + try { + var t10 = JSON.parse('"' + e21 + '"'); + return hO[t10] || t10; + } catch (t11) { + return e21; + } + }); + } + var hO = { '"': '\\"', "\\": "\\\\", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t" }; + var vO = { '\\"': '"', "\\\\": "\\", "\\/": "/", "\\b": "\b", "\\f": "\f", "\\n": "\n", "\\r": "\r", "\\t": " " }; + function pO(e20) { + return e20.replace(/["\b\f\n\r\t\\]/g, function(e21) { + return hO[e21] || e21; + }); + } + function mO(e20) { + return e20.replace(/\\["bfnrt\\]/g, function(e21) { + return vO[e21] || e21; + }); + } + function gO(e20) { + return "string" != typeof e20 ? String(e20) : e20.endsWith("\n") ? e20 + "\n" : e20; + } + function yO(e20, t10) { + return kO(e20, function(e21) { + return e21.nodeName.toUpperCase() === t10.toUpperCase(); + }); + } + function bO(e20, t10, n10) { + return kO(e20, function(e21) { + return function(e23, t11, n11) { + return "function" == typeof e23.getAttribute && e23.getAttribute(t11) === n11; + }(e21, t10, n10); + }); + } + function kO(e20, t10) { + return !!wO(e20, t10); + } + function wO(e20, t10) { + for (var n10 = e20; n10 && !t10(n10); ) + n10 = n10.parentNode; + return n10 || void 0; + } + function xO(e20) { + if (null != e20.firstChild) { + var t10 = document.createRange(), n10 = window.getSelection(); + t10.setStart(e20, 1), t10.collapse(true), null == n10 || n10.removeAllRanges(), null == n10 || n10.addRange(t10); + } else + e20.focus(); + } + function jO(e20, t10, n10, r10) { + var o10 = SO(e20); + if (o10) { + var i10 = o10.document.activeElement ? o10.document.activeElement : null; + i10 && i10.isContentEditable && (i10.textContent = n10 ? t10 : i10.textContent + t10, xO(i10), r10 && r10(i10)); + } + } + function SO(e20) { + return e20 && e20.ownerDocument ? e20.ownerDocument.defaultView : null; + } + function CO(e20) { + var t10 = SO(e20), n10 = null == t10 ? void 0 : t10.document.activeElement; + return !!n10 && kO(n10, function(t11) { + return t11 === e20; + }); + } + function $O(e20, t10) { + return wO(e20, function(e21) { + return e21.nodeName === t10; + }); + } + function _O(e20) { + return bO(e20, "data-type", "selectable-key") ? Ya.key : bO(e20, "data-type", "selectable-value") ? Ya.value : bO(e20, "data-type", "insert-selection-area-inside") ? Ya.inside : bO(e20, "data-type", "insert-selection-area-after") ? Ya.after : Ya.multi; + } + function OO(e20) { + return encodeURIComponent(Zs(e20)); + } + function MO(e20) { + var t10 = wO(e20, function(e21) { + return !(null == e21 || !e21.hasAttribute) && e21.hasAttribute("data-path"); + }), n10 = null == t10 ? void 0 : t10.getAttribute("data-path"); + return n10 ? Xs(decodeURIComponent(n10)) : null; + } + function EO(e20) { + var t10 = e20.allElements, n10 = e20.currentElement, r10 = e20.direction, o10 = e20.hasPrio, i10 = void 0 === o10 ? function() { + return true; + } : o10, a10 = e20.margin, s10 = void 0 === a10 ? 10 : a10, c10 = uk(t10.filter(function(e21) { + var t11 = e21.getBoundingClientRect(); + return t11.width > 0 && t11.height > 0; + }), u10), l10 = u10(n10); + function u10(e21) { + var t11 = e21.getBoundingClientRect(); + return { x: t11.left + t11.width / 2, y: t11.top + t11.height / 2, rect: t11, element: e21 }; + } + function f10(e21, t11) { + var n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, r11 = e21.x - t11.x, o11 = (e21.y - t11.y) * n11; + return Math.sqrt(r11 * r11 + o11 * o11); + } + var d10 = function(e21) { + return f10(e21, l10); + }; + if ("Left" === r10 || "Right" === r10) { + var h10 = "Left" === r10 ? c10.filter(function(e21) { + return t11 = l10, e21.rect.left + s10 < t11.rect.left; + var t11; + }) : c10.filter(function(e21) { + return t11 = l10, e21.rect.right > t11.rect.right + s10; + var t11; + }), v10 = Ex(h10.filter(function(e21) { + return t11 = e21, n11 = l10, Math.abs(t11.y - n11.y) < s10; + var t11, n11; + }), d10) || Ex(h10, function(e21) { + return f10(e21, l10, 10); + }); + return null == v10 ? void 0 : v10.element; + } + if ("Up" === r10 || "Down" === r10) { + var p10 = "Up" === r10 ? c10.filter(function(e21) { + return t11 = l10, e21.y + s10 < t11.y; + var t11; + }) : c10.filter(function(e21) { + return t11 = l10, e21.y > t11.y + s10; + var t11; + }), m10 = Ex(p10.filter(function(e21) { + return i10(e21.element); + }), d10) || Ex(p10, d10); + return null == m10 ? void 0 : m10.element; + } + } + function AO(e20) { + return !!e20 && "DIV" === e20.nodeName && "function" == typeof e20.refresh && "function" == typeof e20.cancel; + } + function PO(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "+", n10 = []; + e20.ctrlKey && n10.push("Ctrl"), e20.metaKey && n10.push("Ctrl"), e20.altKey && n10.push("Alt"), e20.shiftKey && n10.push("Shift"); + var r10 = 1 === e20.key.length ? e20.key.toUpperCase() : e20.key; + return r10 in TO || n10.push(r10), n10.join(t10); + } + var TO = { Ctrl: true, Command: true, Control: true, Alt: true, Option: true, Shift: true }; + var RO = vi.window; + function NO(e20) { + mi(e20, "svelte-1r8q3m8", ".jse-absolute-popup.svelte-1r8q3m8.svelte-1r8q3m8{position:relative;left:0;top:0;width:0;height:0;z-index:1001}.jse-absolute-popup.svelte-1r8q3m8 .jse-hidden-input.svelte-1r8q3m8{position:fixed;left:0;top:0;width:0;height:0;padding:0;margin:0;border:none;outline:none;overflow:hidden}.jse-absolute-popup.svelte-1r8q3m8 .jse-absolute-popup-content.svelte-1r8q3m8{position:absolute}"); + } + function IO(e20) { + var t10, n10, r10, o10, i10, a10, s10 = [e20[0].props], c10 = e20[0].component; + function l10(e21, t11) { + var n11 = {}; + if (void 0 !== t11 && 1 & t11) + n11 = Ma(s10, [Ea(e21[0].props)]); + else + for (var r11 = 0; r11 < s10.length; r11 += 1) + n11 = Jo(n11, s10[r11]); + return { props: n11 }; + } + return c10 && (o10 = Li(c10, l10(e20))), { c: function() { + t10 = ji("div"), n10 = ji("input"), r10 = $i(), o10 && Pa(o10.$$.fragment), Ai(n10, "type", "text"), n10.readOnly = true, Ai(n10, "tabindex", "-1"), Ai(n10, "class", "jse-hidden-input svelte-1r8q3m8"), Ai(t10, "class", "jse-absolute-popup-content svelte-1r8q3m8"), Ai(t10, "style", i10 = zO(e20[1], e20[0].options)); + }, m: function(i11, s11) { + ki(i11, t10, s11), pi(t10, n10), e20[7](n10), pi(t10, r10), o10 && Ta(o10, t10, null), a10 = true; + }, p: function(e21, n11) { + if (1 & n11 && c10 !== (c10 = e21[0].component)) { + if (o10) { + ba(); + var r11 = o10; + xa(r11.$$.fragment, 1, 0, function() { + Ra(r11, 1); + }), ka(); + } + c10 ? (Pa((o10 = Li(c10, l10(e21, n11))).$$.fragment), wa(o10.$$.fragment, 1), Ta(o10, t10, null)) : o10 = null; + } else if (c10) { + var u10 = 1 & n11 ? Ma(s10, [Ea(e21[0].props)]) : {}; + o10.$set(u10); + } + (!a10 || 3 & n11 && i10 !== (i10 = zO(e21[1], e21[0].options))) && Ai(t10, "style", i10); + }, i: function(e21) { + a10 || (o10 && wa(o10.$$.fragment, e21), a10 = true); + }, o: function(e21) { + o10 && xa(o10.$$.fragment, e21), a10 = false; + }, d: function(n11) { + n11 && wi(t10), e20[7](null), o10 && Ra(o10); + } }; + } + function DO(e20) { + var t10, n10, r10, o10, i10 = e20[1] && IO(e20); + return { c: function() { + t10 = ji("div"), i10 && i10.c(), Ai(t10, "role", "none"), Ai(t10, "class", "jse-absolute-popup svelte-1r8q3m8"); + }, m: function(a10, s10) { + ki(a10, t10, s10), i10 && i10.m(t10, null), e20[8](t10), n10 = true, r10 || (o10 = [Oi(RO, "mousedown", e20[3], true), Oi(RO, "keydown", e20[4], true), Oi(RO, "wheel", e20[5], true), Oi(t10, "mousedown", qO), Oi(t10, "keydown", e20[4])], r10 = true); + }, p: function(e21, n11) { + var r11 = jo(n11, 1)[0]; + e21[1] ? i10 ? (i10.p(e21, r11), 2 & r11 && wa(i10, 1)) : ((i10 = IO(e21)).c(), wa(i10, 1), i10.m(t10, null)) : i10 && (ba(), xa(i10, 1, 1, function() { + i10 = null; + }), ka()); + }, i: function(e21) { + n10 || (wa(i10), n10 = true); + }, o: function(e21) { + xa(i10), n10 = false; + }, d: function(n11) { + n11 && wi(t10), i10 && i10.d(), e20[8](null), r10 = false, Qo(o10); + } }; + } + function qO(e20) { + e20.stopPropagation(); + } + function zO(e20, t10) { + var n10 = e20.getBoundingClientRect(), r10 = function() { + if (t10.anchor) { + var e21 = t10.anchor, n11 = t10.width, r11 = void 0 === n11 ? 0 : n11, o11 = t10.height, i11 = void 0 === o11 ? 0 : o11, a11 = t10.offsetTop, s11 = void 0 === a11 ? 0 : a11, c10 = t10.offsetLeft, l10 = void 0 === c10 ? 0 : c10, u10 = t10.position, f10 = e21.getBoundingClientRect(), d10 = f10.left, h10 = f10.top, v10 = f10.bottom, p10 = f10.right, m10 = "top" === u10 || h10 + i11 > window.innerHeight && h10 > i11, g10 = "left" === u10 || d10 + r11 > window.innerWidth && d10 > r11; + return { left: g10 ? p10 - l10 : d10 + l10, top: m10 ? h10 - s11 : v10 + s11, positionAbove: m10, positionLeft: g10 }; + } + if ("number" == typeof t10.left && "number" == typeof t10.top) { + var y10 = t10.left, b10 = t10.top, k10 = t10.width, w10 = void 0 === k10 ? 0 : k10, x10 = t10.height, j10 = void 0 === x10 ? 0 : x10; + return { left: y10, top: b10, positionAbove: b10 + j10 > window.innerHeight && b10 > j10, positionLeft: y10 + w10 > window.innerWidth && y10 > w10 }; + } + throw new Error('Invalid config: pass either "left" and "top", or pass "anchor"'); + }(), o10 = r10.left, i10 = r10.top, a10 = r10.positionAbove, s10 = r10.positionLeft; + return (a10 ? "bottom: ".concat(n10.top - i10, "px;") : "top: ".concat(i10 - n10.top, "px;")) + (s10 ? "right: ".concat(n10.left - o10, "px;") : "left: ".concat(o10 - n10.left, "px;")); + } + function BO(e20, t10, n10) { + var r10, o10, i10 = t10.popup, a10 = t10.closeAbsolutePopup; + function s10(e21) { + i10.options && i10.options.closeOnOuterClick && !kO(e21.target, function(e23) { + return e23 === r10; + }) && a10(i10.id); + } + return Gi(function() { + o10 && o10.focus(); + }), e20.$$set = function(e21) { + "popup" in e21 && n10(0, i10 = e21.popup), "closeAbsolutePopup" in e21 && n10(6, a10 = e21.closeAbsolutePopup); + }, [i10, r10, o10, function(e21) { + s10(e21); + }, function(e21) { + "Escape" === PO(e21) && a10(i10.id); + }, function(e21) { + s10(e21); + }, a10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(2, o10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(1, r10 = e21); + }); + }]; + } + var LO = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, BO, DO, Xo, { popup: 0, closeAbsolutePopup: 6 }, NO), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function FO(e20, t10, n10) { + var r10 = e20.slice(); + return r10[6] = t10[n10], r10; + } + function VO(e20) { + var t10, n10; + return t10 = new LO({ props: { popup: e20[6], closeAbsolutePopup: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.popup = e21[6]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function HO(e20) { + for (var t10, n10, r10 = Ca(e20[0]), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = VO(FO(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }, s10 = e20[3].default, c10 = ei(s10, e20, e20[2], null); + return { c: function() { + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + t10 = $i(), c10 && c10.c(); + }, m: function(e21, r11) { + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(e21, r11); + ki(e21, t10, r11), c10 && c10.m(e21, r11), n10 = true; + }, p: function(e21, i11) { + var l10 = jo(i11, 1)[0]; + if (3 & l10) { + var u10; + for (r10 = Ca(e21[0]), u10 = 0; u10 < r10.length; u10 += 1) { + var f10 = FO(e21, r10, u10); + o10[u10] ? (o10[u10].p(f10, l10), wa(o10[u10], 1)) : (o10[u10] = VO(f10), o10[u10].c(), wa(o10[u10], 1), o10[u10].m(t10.parentNode, t10)); + } + for (ba(), u10 = r10.length; u10 < o10.length; u10 += 1) + a10(u10); + ka(); + } + c10 && c10.p && (!n10 || 4 & l10) && ri(c10, s10, e21, e21[2], n10 ? ni(s10, e21[2], l10, null) : oi(e21[2]), null); + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + wa(c10, e21), n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + xa(c10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21), c10 && c10.d(e21); + } }; + } + function WO(e20, t10, n10) { + var r10 = t10.$$slots, o10 = void 0 === r10 ? {} : r10, i10 = t10.$$scope, a10 = Da("jsoneditor:AbsolutePopup"), s10 = []; + function c10(e21) { + var t11 = s10.findIndex(function(t12) { + return t12.id === e21; + }); + if (-1 !== t11) { + var r11 = s10[t11]; + r11.options.onClose && r11.options.onClose(), n10(0, s10 = s10.filter(function(t12) { + return t12.id !== e21; + })); + } + } + return Xi("absolute-popup", { openAbsolutePopup: function(e21, t11, r11) { + a10("open...", t11, r11); + var o11 = { id: Ps(), component: e21, props: t11 || {}, options: r11 || {} }; + return n10(0, s10 = [].concat(Bo(s10), [o11])), o11.id; + }, closeAbsolutePopup: c10 }), e20.$$set = function(e21) { + "$$scope" in e21 && n10(2, i10 = e21.$$scope); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && a10("popups", s10); + }, [s10, c10, i10, o10]; + } + var UO = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, WO, HO, Zo, {}), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function JO(e20) { + return e20.map(function(e21, t10) { + return ZO.test(e21) ? "[" + e21 + "]" : /[.[\]]/.test(e21) || "" === e21 ? '["' + (e21.replace(/"/g, '\\"') + '"]') : (t10 > 0 ? "." : "") + e21; + }).join(""); + } + function KO(e20) { + for (var t10 = [], n10 = 0; n10 < e20.length; ) + "." === e20[n10] && n10++, "[" === e20[n10] ? (n10++, '"' === e20[n10] ? (n10++, t10.push(r10(function(e21) { + return '"' === e21; + }, true)), o10('"')) : t10.push(r10(function(e21) { + return "]" === e21; + })), o10("]")) : t10.push(r10(function(e21) { + return "." === e21 || "[" === e21; + })); + function r10(t11) { + for (var r11 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], o11 = ""; n10 < e20.length && !t11(e20[n10]); ) + r11 && "\\" === e20[n10] && '"' === e20[n10 + 1] ? (o11 += '"', n10 += 2) : (o11 += e20[n10], n10++); + return o11; + } + function o10(t11) { + if (e20[n10] !== t11) + throw new SyntaxError("Invalid JSON path: ".concat(t11, " expected at position ").concat(n10)); + n10++; + } + return t10; + } + function GO(e20) { + return { value: e20, label: _w(e20) ? "(item root)" : JO(e20) }; + } + function YO(e20) { + return e20.map(function(e21) { + return ZO.test(e21) ? "?.[".concat(e21, "]") : XO.test(e21) ? "?.".concat(e21) : "?.[".concat(JSON.stringify(e21), "]"); + }).join(""); + } + var XO = /^[a-zA-Z$_][a-zA-Z$_\d]*$/; + var ZO = /^\d+$/; + function eM(e20, t10) { + for (var n10 = new Set(t10), r10 = e20.replace(/ \(copy( \d+)?\)$/, ""), o10 = e20, i10 = 1; n10.has(o10); ) { + var a10 = "copy" + (i10 > 1 ? " " + i10 : ""); + o10 = "".concat(r10, " (").concat(a10, ")"), i10++; + } + return o10; + } + function tM(e20, t10) { + var n10 = t10 - 3; + return e20.length > t10 ? e20.substring(0, n10) + "..." : e20; + } + function nM(e20) { + if ("" === e20) + return ""; + var t10 = e20.toLowerCase(); + if ("null" === t10) + return null; + if ("true" === t10) + return true; + if ("false" === t10) + return false; + if ("undefined" !== t10) { + var n10 = Number(e20), r10 = parseFloat(e20); + return isNaN(n10) || isNaN(r10) ? e20 : n10; + } + } + var rM = { id: "javascript", name: "JavaScript", description: "\n

\n Enter a JavaScript function to filter, sort, or transform the data.\n

\n", createQuery: function(e20, t10) { + var n10 = t10.filter, r10 = t10.sort, o10 = t10.projection, i10 = [" return data\n"]; + if (n10 && n10.path && n10.relation && n10.value) { + var a10 = "item => item".concat(YO(n10.path)), s10 = nM(n10.value), c10 = "string" == typeof s10 ? "'".concat(n10.value, "'") : ou(n10.value) && !Number.isSafeInteger(s10) ? "".concat(n10.value, "n") : n10.value; + i10.push(" .filter(".concat(a10, " ").concat(n10.relation, " ").concat(c10, ")\n")); + } + r10 && r10.path && r10.direction && ("desc" === r10.direction ? i10.push(" .slice()\n .sort((a, b) => {\n // sort descending\n" + " const valueA = a".concat(YO(r10.path), "\n") + " const valueB = b".concat(YO(r10.path), "\n") + " return valueA > valueB ? -1 : valueA < valueB ? 1 : 0\n })\n") : i10.push(" .slice()\n .sort((a, b) => {\n // sort ascending\n" + " const valueA = a".concat(YO(r10.path), "\n") + " const valueB = b".concat(YO(r10.path), "\n") + " return valueA > valueB ? 1 : valueA < valueB ? -1 : 0\n })\n")); + if (o10 && o10.paths) + if (o10.paths.length > 1) { + var l10 = o10.paths.map(function(e21) { + var t11 = e21[e21.length - 1] || "item", n11 = "item".concat(YO(e21)); + return " ".concat(JSON.stringify(t11), ": ").concat(n11); + }); + i10.push(" .map(item => ({\n".concat(l10.join(",\n"), "})\n )\n")); + } else { + var u10 = "item".concat(YO(o10.paths[0])); + i10.push(" .map(item => ".concat(u10, ")\n")); + } + return "function query (data) {\n".concat(i10.join(""), "}"); + }, executeQuery: function(e20, t10) { + var n10 = new Function('"use strict";\n\n' + t10 + ` + +if (typeof query !== "function") { + throw new Error("Cannot execute query: expecting a function named 'query' but is undefined") +} + +return query; +`)()(e20); + return void 0 !== n10 ? n10 : null; + } }; + var oM = { prefix: "far", iconName: "lightbulb", icon: [384, 512, [128161], "f0eb", "M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7l0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5H109c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8l0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4l0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5H226.4c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8l0 0 0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80V416H272v16c0 44.2-35.8 80-80 80z"] }; + var iM = { prefix: "far", iconName: "square-check", icon: [448, 512, [9745, 9989, 61510, "check-square"], "f14a", "M64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16H64zM0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"] }; + var aM = { prefix: "far", iconName: "square", icon: [448, 512, [9632, 9723, 9724, 61590], "f0c8", "M384 80c8.8 0 16 7.2 16 16V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16H384zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"] }; + var sM = { prefix: "far", iconName: "clock", icon: [512, 512, [128339, "clock-four"], "f017", "M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"] }; + function cM(e20) { + var t10; + return { c: function() { + t10 = Si("g"); + }, m: function(n10, r10) { + ki(n10, t10, r10), t10.innerHTML = e20[0]; + }, p: function(e21, n10) { + 1 & jo(n10, 1)[0] && (t10.innerHTML = e21[0]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function lM(e20, t10, n10) { + var r10 = 870711; + var o10 = "", i10 = t10.data; + function a10(e21) { + if (!e21 || !e21.raw) + return ""; + var t11 = e21.raw, n11 = {}; + return t11 = t11.replace(/\s(?:xml:)?id=["']?([^"')\s]+)/g, function(e23, t12) { + var o11 = "fa-".concat((r10 += 1).toString(16)); + return n11[t12] = o11, ' id="'.concat(o11, '"'); + }), t11 = t11.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g, function(e23, t12, r11, o11) { + var i11 = t12 || o11; + return i11 && n11[i11] ? "#".concat(n11[i11]) : e23; + }), t11; + } + return e20.$$set = function(e21) { + "data" in e21 && n10(1, i10 = e21.data); + }, e20.$$.update = function() { + 2 & e20.$$.dirty && n10(0, o10 = a10(i10)); + }, [o10, i10]; + } + var uM = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, lM, cM, Xo, { data: 1 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function fM(e20) { + mi(e20, "svelte-1mc5hvj", ".fa-icon.svelte-1mc5hvj{display:inline-block;fill:currentColor}.fa-flip-horizontal.svelte-1mc5hvj{transform:scale(-1, 1)}.fa-flip-vertical.svelte-1mc5hvj{transform:scale(1, -1)}.fa-spin.svelte-1mc5hvj{animation:svelte-1mc5hvj-fa-spin 1s 0s infinite linear}.fa-inverse.svelte-1mc5hvj{color:#fff}.fa-pulse.svelte-1mc5hvj{animation:svelte-1mc5hvj-fa-spin 1s infinite steps(8)}@keyframes svelte-1mc5hvj-fa-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"); + } + function dM(e20) { + for (var t10, n10, r10, o10, i10 = e20[12].default, a10 = ei(i10, e20, e20[11], null), s10 = [{ version: "1.1" }, { class: n10 = "fa-icon " + e20[0] }, { width: e20[1] }, { height: e20[2] }, { "aria-label": e20[9] }, { role: r10 = e20[9] ? "img" : "presentation" }, { viewBox: e20[3] }, { style: e20[8] }, e20[10]], c10 = {}, l10 = 0; l10 < s10.length; l10 += 1) + c10 = Jo(c10, s10[l10]); + return { c: function() { + t10 = Si("svg"), a10 && a10.c(), Ri(t10, c10), zi(t10, "fa-spin", e20[4]), zi(t10, "fa-pulse", e20[6]), zi(t10, "fa-inverse", e20[5]), zi(t10, "fa-flip-horizontal", "horizontal" === e20[7]), zi(t10, "fa-flip-vertical", "vertical" === e20[7]), zi(t10, "svelte-1mc5hvj", true); + }, m: function(e21, n11) { + ki(e21, t10, n11), a10 && a10.m(t10, null), o10 = true; + }, p: function(e21, l11) { + var u10 = jo(l11, 1)[0]; + a10 && a10.p && (!o10 || 2048 & u10) && ri(a10, i10, e21, e21[11], o10 ? ni(i10, e21[11], u10, null) : oi(e21[11]), null), Ri(t10, c10 = Ma(s10, [{ version: "1.1" }, (!o10 || 1 & u10 && n10 !== (n10 = "fa-icon " + e21[0])) && { class: n10 }, (!o10 || 2 & u10) && { width: e21[1] }, (!o10 || 4 & u10) && { height: e21[2] }, (!o10 || 512 & u10) && { "aria-label": e21[9] }, (!o10 || 512 & u10 && r10 !== (r10 = e21[9] ? "img" : "presentation")) && { role: r10 }, (!o10 || 8 & u10) && { viewBox: e21[3] }, (!o10 || 256 & u10) && { style: e21[8] }, 1024 & u10 && e21[10]])), zi(t10, "fa-spin", e21[4]), zi(t10, "fa-pulse", e21[6]), zi(t10, "fa-inverse", e21[5]), zi(t10, "fa-flip-horizontal", "horizontal" === e21[7]), zi(t10, "fa-flip-vertical", "vertical" === e21[7]), zi(t10, "svelte-1mc5hvj", true); + }, i: function(e21) { + o10 || (wa(a10, e21), o10 = true); + }, o: function(e21) { + xa(a10, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), a10 && a10.d(e21); + } }; + } + function hM(e20, t10, n10) { + var r10 = ["class", "width", "height", "box", "spin", "inverse", "pulse", "flip", "style", "label"], o10 = ai(t10, r10), i10 = t10, a10 = i10.$$slots, s10 = void 0 === a10 ? {} : a10, c10 = i10.$$scope, l10 = t10.class, u10 = void 0 === l10 ? "" : l10, f10 = t10.width, d10 = t10.height, h10 = t10.box, v10 = void 0 === h10 ? "0 0 0 0" : h10, p10 = t10.spin, m10 = void 0 !== p10 && p10, g10 = t10.inverse, y10 = void 0 !== g10 && g10, b10 = t10.pulse, k10 = void 0 !== b10 && b10, w10 = t10.flip, x10 = void 0 === w10 ? "none" : w10, j10 = t10.style, S10 = void 0 === j10 ? "" : j10, C10 = t10.label, $10 = void 0 === C10 ? "" : C10; + return e20.$$set = function(e21) { + t10 = Jo(Jo({}, t10), ii(e21)), n10(10, o10 = ai(t10, r10)), "class" in e21 && n10(0, u10 = e21.class), "width" in e21 && n10(1, f10 = e21.width), "height" in e21 && n10(2, d10 = e21.height), "box" in e21 && n10(3, v10 = e21.box), "spin" in e21 && n10(4, m10 = e21.spin), "inverse" in e21 && n10(5, y10 = e21.inverse), "pulse" in e21 && n10(6, k10 = e21.pulse), "flip" in e21 && n10(7, x10 = e21.flip), "style" in e21 && n10(8, S10 = e21.style), "label" in e21 && n10(9, $10 = e21.label), "$$scope" in e21 && n10(11, c10 = e21.$$scope); + }, [u10, f10, d10, v10, m10, y10, k10, x10, S10, $10, o10, c10, s10]; + } + var vM = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, hM, dM, Xo, { class: 0, width: 1, height: 2, box: 3, spin: 4, inverse: 5, pulse: 6, flip: 7, style: 8, label: 9 }, fM), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function pM(e20, t10, n10) { + var r10 = e20.slice(); + return r10[24] = t10[n10], r10; + } + function mM(e20, t10, n10) { + var r10 = e20.slice(); + return r10[27] = t10[n10], r10; + } + function gM(e20) { + for (var t10, n10 = [e20[27]], r10 = {}, o10 = 0; o10 < n10.length; o10 += 1) + r10 = Jo(r10, n10[o10]); + return { c: function() { + Ri(t10 = Si("path"), r10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, o11) { + Ri(t10, r10 = Ma(n10, [64 & o11 && e21[27]])); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function yM(e20) { + for (var t10, n10 = [e20[24]], r10 = {}, o10 = 0; o10 < n10.length; o10 += 1) + r10 = Jo(r10, n10[o10]); + return { c: function() { + Ri(t10 = Si("polygon"), r10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, o11) { + Ri(t10, r10 = Ma(n10, [64 & o11 && e21[24]])); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function bM(e20) { + var t10, n10, r10; + function o10(t11) { + e20[16](t11); + } + var i10 = {}; + return void 0 !== e20[6] && (i10.data = e20[6]), t10 = new uM({ props: i10 }), na.push(function() { + return Aa(t10, "data", o10); + }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, n11) { + Ta(t10, e21, n11), r10 = true; + }, p: function(e21, r11) { + var o11 = {}; + !n10 && 64 & r11 && (n10 = true, o11.data = e21[6], ua(function() { + return n10 = false; + })), t10.$set(o11); + }, i: function(e21) { + r10 || (wa(t10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function kM(e20) { + var t10, n10 = e20[15].default, r10 = ei(n10, e20, e20[17], null), o10 = r10 || function(e21) { + for (var t11, n11, r11, o11, i10, a10, s10, c10 = Ca((null === (t11 = e21[6]) || void 0 === t11 ? void 0 : t11.paths) || []), l10 = [], u10 = 0; u10 < c10.length; u10 += 1) + l10[u10] = gM(mM(e21, c10, u10)); + for (var f10 = Ca((null === (n11 = e21[6]) || void 0 === n11 ? void 0 : n11.polygons) || []), d10 = [], h10 = 0; h10 < f10.length; h10 += 1) + d10[h10] = yM(pM(e21, f10, h10)); + var v10 = (null === (r11 = e21[6]) || void 0 === r11 ? void 0 : r11.raw) && bM(e21); + return { c: function() { + for (var e23 = 0; e23 < l10.length; e23 += 1) + l10[e23].c(); + o11 = $i(); + for (var t12 = 0; t12 < d10.length; t12 += 1) + d10[t12].c(); + i10 = $i(), v10 && v10.c(), a10 = _i(); + }, m: function(e23, t12) { + for (var n12 = 0; n12 < l10.length; n12 += 1) + l10[n12] && l10[n12].m(e23, t12); + ki(e23, o11, t12); + for (var r12 = 0; r12 < d10.length; r12 += 1) + d10[r12] && d10[r12].m(e23, t12); + ki(e23, i10, t12), v10 && v10.m(e23, t12), ki(e23, a10, t12), s10 = true; + }, p: function(e23, t12) { + var n12; + if (64 & t12) { + var r12, s11; + for (c10 = Ca((null === (r12 = e23[6]) || void 0 === r12 ? void 0 : r12.paths) || []), s11 = 0; s11 < c10.length; s11 += 1) { + var u11 = mM(e23, c10, s11); + l10[s11] ? l10[s11].p(u11, t12) : (l10[s11] = gM(u11), l10[s11].c(), l10[s11].m(o11.parentNode, o11)); + } + for (; s11 < l10.length; s11 += 1) + l10[s11].d(1); + l10.length = c10.length; + } + if (64 & t12) { + var h11, p10; + for (f10 = Ca((null === (h11 = e23[6]) || void 0 === h11 ? void 0 : h11.polygons) || []), p10 = 0; p10 < f10.length; p10 += 1) { + var m10 = pM(e23, f10, p10); + d10[p10] ? d10[p10].p(m10, t12) : (d10[p10] = yM(m10), d10[p10].c(), d10[p10].m(i10.parentNode, i10)); + } + for (; p10 < d10.length; p10 += 1) + d10[p10].d(1); + d10.length = f10.length; + } + null !== (n12 = e23[6]) && void 0 !== n12 && n12.raw ? v10 ? (v10.p(e23, t12), 64 & t12 && wa(v10, 1)) : ((v10 = bM(e23)).c(), wa(v10, 1), v10.m(a10.parentNode, a10)) : v10 && (ba(), xa(v10, 1, 1, function() { + v10 = null; + }), ka()); + }, i: function(e23) { + s10 || (wa(v10), s10 = true); + }, o: function(e23) { + xa(v10), s10 = false; + }, d: function(e23) { + e23 && (wi(o11), wi(i10), wi(a10)), xi(l10, e23), xi(d10, e23), v10 && v10.d(e23); + } }; + }(e20); + return { c: function() { + o10 && o10.c(); + }, m: function(e21, n11) { + o10 && o10.m(e21, n11), t10 = true; + }, p: function(e21, i10) { + r10 ? r10.p && (!t10 || 131072 & i10) && ri(r10, n10, e21, e21[17], t10 ? ni(n10, e21[17], i10, null) : oi(e21[17]), null) : o10 && o10.p && (!t10 || 64 & i10) && o10.p(e21, t10 ? i10 : -1); + }, i: function(e21) { + t10 || (wa(o10, e21), t10 = true); + }, o: function(e21) { + xa(o10, e21), t10 = false; + }, d: function(e21) { + o10 && o10.d(e21); + } }; + } + function wM(e20) { + for (var t10, n10, r10 = [{ label: e20[5] }, { width: e20[7] }, { height: e20[8] }, { box: e20[10] }, { style: e20[9] }, { spin: e20[1] }, { flip: e20[4] }, { inverse: e20[2] }, { pulse: e20[3] }, { class: e20[0] }, e20[11]], o10 = { $$slots: { default: [kM] }, $$scope: { ctx: e20 } }, i10 = 0; i10 < r10.length; i10 += 1) + o10 = Jo(o10, r10[i10]); + return t10 = new vM({ props: o10 }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r11) { + Ta(t10, e21, r11), n10 = true; + }, p: function(e21, n11) { + var o11 = jo(n11, 1)[0], i11 = 4031 & o11 ? Ma(r10, [32 & o11 && { label: e21[5] }, 128 & o11 && { width: e21[7] }, 256 & o11 && { height: e21[8] }, 1024 & o11 && { box: e21[10] }, 512 & o11 && { style: e21[9] }, 2 & o11 && { spin: e21[1] }, 16 & o11 && { flip: e21[4] }, 4 & o11 && { inverse: e21[2] }, 8 & o11 && { pulse: e21[3] }, 1 & o11 && { class: e21[0] }, 2048 & o11 && Ea(e21[11])]) : {}; + 131136 & o11 && (i11.$$scope = { dirty: o11, ctx: e21 }), t10.$set(i11); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function xM(e20, t10, n10) { + var r10, o10, i10, a10 = ["class", "data", "scale", "spin", "inverse", "pulse", "flip", "label", "style"], s10 = ai(t10, a10), c10 = t10, l10 = c10.$$slots, u10 = void 0 === l10 ? {} : l10, f10 = c10.$$scope, d10 = t10.class, h10 = void 0 === d10 ? "" : d10, v10 = t10.data, p10 = t10.scale, m10 = void 0 === p10 ? 1 : p10, g10 = t10.spin, y10 = void 0 !== g10 && g10, b10 = t10.inverse, k10 = void 0 !== b10 && b10, w10 = t10.pulse, x10 = void 0 !== w10 && w10, j10 = t10.flip, S10 = void 0 === j10 ? void 0 : j10, C10 = t10.label, $10 = void 0 === C10 ? "" : C10, _10 = t10.style, O10 = void 0 === _10 ? "" : _10, M10 = 10, E10 = 10; + function A10() { + var e21 = 1; + return void 0 !== m10 && (e21 = Number(m10)), isNaN(e21) || e21 <= 0 ? (console.warn('Invalid prop: prop "scale" should be a number over 0.'), 1) : 1 * e21; + } + function P10() { + return r10 ? Math.max(r10.width, r10.height) / 16 : 1; + } + return e20.$$set = function(e21) { + t10 = Jo(Jo({}, t10), ii(e21)), n10(11, s10 = ai(t10, a10)), "class" in e21 && n10(0, h10 = e21.class), "data" in e21 && n10(12, v10 = e21.data), "scale" in e21 && n10(13, m10 = e21.scale), "spin" in e21 && n10(1, y10 = e21.spin), "inverse" in e21 && n10(2, k10 = e21.inverse), "pulse" in e21 && n10(3, x10 = e21.pulse), "flip" in e21 && n10(4, S10 = e21.flip), "label" in e21 && n10(5, $10 = e21.label), "style" in e21 && n10(14, O10 = e21.style), "$$scope" in e21 && n10(17, f10 = e21.$$scope); + }, e20.$$.update = function() { + 28672 & e20.$$.dirty && (n10(6, r10 = function(e21) { + var t11; + if (e21) { + if (!("definition" in e21)) { + if ("iconName" in e21 && "icon" in e21) { + e21.iconName; + var n11 = jo(e21.icon, 5), r11 = n11[0], o11 = n11[1], i11 = n11[4]; + t11 = { width: r11, height: o11, paths: (Array.isArray(i11) ? i11 : [i11]).map(function(e23) { + return { d: e23 }; + }) }; + } else + t11 = e21[Object.keys(e21)[0]]; + return t11; + } + console.error("`import faIconName from '@fortawesome/package-name/faIconName` not supported - Please use `import { faIconName } from '@fortawesome/package-name/faIconName'` instead"); + } + }(v10)), n10(7, M10 = r10 ? r10.width / P10() * A10() : 0), n10(8, E10 = r10 ? r10.height / P10() * A10() : 0), n10(9, o10 = function() { + var e21 = ""; + null !== O10 && (e21 += O10); + var t11 = A10(); + return 1 === t11 ? 0 === e21.length ? "" : e21 : ("" === e21 || e21.endsWith(";") || (e21 += "; "), "".concat(e21, "font-size: ").concat(t11, "em")); + }()), n10(10, i10 = r10 ? "0 0 ".concat(r10.width, " ").concat(r10.height) : "0 0 ".concat(M10, " ").concat(E10))); + }, [h10, y10, k10, x10, S10, $10, r10, M10, E10, o10, i10, s10, v10, m10, O10, u10, function(e21) { + n10(6, r10 = e21), n10(12, v10), n10(14, O10), n10(13, m10); + }, f10]; + } + var jM = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, xM, wM, Xo, { class: 0, data: 12, scale: 13, spin: 1, inverse: 2, pulse: 3, flip: 4, label: 5, style: 14 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function SM(e20) { + mi(e20, "svelte-68vtq4", ".jse-boolean-toggle.svelte-68vtq4{padding:0;margin:1px 0 0;vertical-align:top;display:inline-flex;color:var(--jse-value-color-boolean, #ff8c00)}.jse-boolean-toggle.svelte-68vtq4:not(.jse-readonly){cursor:pointer}"); + } + function CM(e20) { + var t10, n10, r10, o10, i10, a10, s10; + return n10 = new jM({ props: { data: true === e20[0] ? iM : aM } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "role", "checkbox"), Ai(t10, "tabindex", "-1"), Ai(t10, "aria-checked", r10 = true === e20[0]), Ai(t10, "class", "jse-boolean-toggle svelte-68vtq4"), Ai(t10, "title", o10 = e20[1] ? "Boolean value ".concat(e20[0]) : "Click to toggle this boolean value"), zi(t10, "jse-readonly", e20[1]); + }, m: function(r11, o11) { + ki(r11, t10, o11), Ta(n10, t10, null), i10 = true, a10 || (s10 = Oi(t10, "mousedown", e20[2]), a10 = true); + }, p: function(e21, a11) { + var s11 = jo(a11, 1)[0], c10 = {}; + 1 & s11 && (c10.data = true === e21[0] ? iM : aM), n10.$set(c10), (!i10 || 1 & s11 && r10 !== (r10 = true === e21[0])) && Ai(t10, "aria-checked", r10), (!i10 || 3 & s11 && o10 !== (o10 = e21[1] ? "Boolean value ".concat(e21[0]) : "Click to toggle this boolean value")) && Ai(t10, "title", o10), (!i10 || 2 & s11) && zi(t10, "jse-readonly", e21[1]); + }, i: function(e21) { + i10 || (wa(n10.$$.fragment, e21), i10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), i10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), a10 = false, s10(); + } }; + } + function $M(e20, t10, n10) { + var r10 = t10.path, o10 = t10.value, i10 = t10.readOnly, a10 = t10.onPatch, s10 = t10.focus; + return e20.$$set = function(e21) { + "path" in e21 && n10(3, r10 = e21.path), "value" in e21 && n10(0, o10 = e21.value), "readOnly" in e21 && n10(1, i10 = e21.readOnly), "onPatch" in e21 && n10(4, a10 = e21.onPatch), "focus" in e21 && n10(5, s10 = e21.focus); + }, [o10, i10, function(e21) { + e21.stopPropagation(), i10 || (a10([{ op: "replace", path: Zs(r10), value: !o10 }]), s10()); + }, r10, a10, s10]; + } + var _M = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, $M, CM, Zo, { path: 3, value: 0, readOnly: 1, onPatch: 4, focus: 5 }, SM), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function OM(e20) { + mi(e20, "svelte-1f4ayrt", ".jse-color-picker-popup.svelte-1f4ayrt .picker_wrapper.popup,.jse-color-picker-popup.svelte-1f4ayrt .picker_wrapper.popup .picker_arrow::before,.jse-color-picker-popup.svelte-1f4ayrt .picker_wrapper.popup .picker_arrow::after{background:var(--jse-color-picker-background, var(--jse-panel-background, #ebebeb));line-height:normal}.jse-color-picker-popup.svelte-1f4ayrt .picker_slider,.jse-color-picker-popup.svelte-1f4ayrt .picker_sl,.jse-color-picker-popup.svelte-1f4ayrt .picker_editor input,.jse-color-picker-popup.svelte-1f4ayrt .picker_sample,.jse-color-picker-popup.svelte-1f4ayrt .picker_done button{box-shadow:var(--jse-color-picker-border-box-shadow, #cbcbcb 0 0 0 1px)}.jse-color-picker-popup.svelte-1f4ayrt .picker_editor input{background:var(--jse-background-color, #fff);color:var(--jse-text-color, #4d4d4d)}.jse-color-picker-popup.svelte-1f4ayrt .picker_done button{background:var(--jse-button-background, #e0e0e0);color:var(--jse-button-color, var(--jse-text-color, #4d4d4d))}.jse-color-picker-popup.svelte-1f4ayrt .picker_done button:hover{background:var(--jse-button-background-highlight, #e7e7e7)}"); + } + function MM(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("div"), "class", "jse-color-picker-popup svelte-1f4ayrt"); + }, m: function(n10, r10) { + ki(n10, t10, r10), e20[4](t10); + }, p: Wo, i: Wo, o: Wo, d: function(n10) { + n10 && wi(t10), e20[4](null); + } }; + } + function EM(e20, t10, n10) { + var r10, o10 = t10.color, i10 = t10.onChange, a10 = t10.showOnTop, s10 = function() { + }; + return Gi(xo(ko().mark(function e21() { + var t11, n11, c10; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, Promise.resolve().then(function() { + return ote; + }); + case 2: + if (e23.t1 = t11 = e23.sent, e23.t0 = null === e23.t1, e23.t0) { + e23.next = 6; + break; + } + e23.t0 = void 0 === t11; + case 6: + if (!e23.t0) { + e23.next = 10; + break; + } + e23.t2 = void 0, e23.next = 11; + break; + case 10: + e23.t2 = t11.default; + case 11: + n11 = e23.t2, c10 = new n11({ parent: r10, color: o10, popup: a10 ? "top" : "bottom", onDone: function(e24) { + var t12 = 1 === e24.rgba[3] ? e24.hex.substring(0, 7) : e24.hex; + i10(t12); + } }), c10.show(), s10 = function() { + c10.destroy(); + }; + case 15: + case "end": + return e23.stop(); + } + }, e21); + }))), Qi(function() { + s10(); + }), e20.$$set = function(e21) { + "color" in e21 && n10(1, o10 = e21.color), "onChange" in e21 && n10(2, i10 = e21.onChange), "showOnTop" in e21 && n10(3, a10 = e21.showOnTop); + }, [r10, o10, i10, a10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(0, r10 = e21); + }); + }]; + } + var AM = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, EM, MM, Xo, { color: 1, onChange: 2, showOnTop: 3 }, OM), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function PM(e20) { + mi(e20, "svelte-1zzxwe", ".jse-color-picker-button.svelte-1zzxwe{font-size:var(--jse-font-size-mono, 14px);width:var(--jse-color-picker-button-size, 1em);height:var(--jse-color-picker-button-size, 1em);box-sizing:border-box;padding:0;margin:2px 0 0;display:inline-flex;vertical-align:top;border:1px solid var(--jse-text-color, #4d4d4d);border-radius:2px;background:inherit;outline:none}.jse-color-picker-button.svelte-1zzxwe:not(.jse-readonly){cursor:pointer}"); + } + function TM(e20) { + var t10, n10, r10, o10; + return { c: function() { + Ai(t10 = ji("button"), "type", "button"), Ai(t10, "class", "jse-color-picker-button svelte-1zzxwe"), Di(t10, "background", e20[2]), Ai(t10, "title", n10 = e20[1] ? "Color ".concat(e20[0]) : "Click to open a color picker"), zi(t10, "jse-readonly", e20[1]); + }, m: function(n11, i10) { + ki(n11, t10, i10), r10 || (o10 = Oi(t10, "click", e20[3]), r10 = true); + }, p: function(e21, r11) { + var o11 = jo(r11, 1)[0]; + 4 & o11 && Di(t10, "background", e21[2]), 3 & o11 && n10 !== (n10 = e21[1] ? "Color ".concat(e21[0]) : "Click to open a color picker") && Ai(t10, "title", n10), 2 & o11 && zi(t10, "jse-readonly", e21[1]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), r10 = false, o10(); + } }; + } + function RM(e20, t10, n10) { + var r10, o10 = Zi("absolute-popup").openAbsolutePopup, i10 = t10.path, a10 = t10.value, s10 = t10.readOnly, c10 = t10.onPatch, l10 = t10.focus; + function u10(e21) { + c10([{ op: "replace", path: Zs(i10), value: e21 }]), f10(); + } + function f10() { + l10(); + } + return e20.$$set = function(e21) { + "path" in e21 && n10(4, i10 = e21.path), "value" in e21 && n10(0, a10 = e21.value), "readOnly" in e21 && n10(1, s10 = e21.readOnly), "onPatch" in e21 && n10(5, c10 = e21.onPatch), "focus" in e21 && n10(6, l10 = e21.focus); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && n10(2, r10 = Xl(a10)); + }, [a10, s10, r10, function(e21) { + var t11, n11; + if (!s10) { + var r11 = e21.target, i11 = r11.getBoundingClientRect().top, c11 = null !== (t11 = null === (n11 = SO(r11)) || void 0 === n11 ? void 0 : n11.innerHeight) && void 0 !== t11 ? t11 : 0; + o10(AM, { color: a10, onChange: u10, showOnTop: c11 - i11 < 300 && i11 > 300 }, { anchor: r11, closeOnOuterClick: true, onClose: f10, offsetTop: 18, offsetLeft: -8, height: 300 }); + } + }, i10, c10, l10]; + } + var NM = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, RM, TM, Zo, { path: 4, value: 0, readOnly: 1, onPatch: 5, focus: 6 }, PM), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function IM(e20) { + for (var t10 = GS(e20, function(e21) { + return e21.start; + }), n10 = [t10[0]], r10 = 0; r10 < t10.length; r10++) { + var o10 = n10.length - 1, i10 = n10[o10], a10 = t10[r10]; + a10.start <= i10.end ? n10[o10] = { start: Math.min(i10.start, a10.start), end: Math.max(i10.end, a10.end) } : n10.push(a10); + } + return n10; + } + function DM(e20, t10) { + return e20.some(function(e21) { + return t10 >= e21.start && t10 < e21.end; + }); + } + function qM(e20) { + return zM(e20) + ls; + } + function zM(e20) { + return Math.floor(e20 / ls) * ls; + } + function BM(e20) { + var t10 = { expandedMap: {}, enforceStringMap: {}, visibleSectionsMap: {}, selection: null, sortedColumn: null }; + return null != e20 && e20.select && void 0 !== e20.json && (t10 = Ro(Ro({}, t10), {}, { selection: e20.select(e20.json, t10) })), null != e20 && e20.expand && (t10 = HM(e20.json, t10, [], e20.expand)), t10; + } + function LM(e20, t10) { + return e20.visibleSectionsMap[t10] || ds; + } + function FM(e20, t10, n10) { + t10.forEach(function(t11) { + var r10 = t11.start, o10 = t11.end; + R_(r10, Math.min(e20.length, o10), n10); + }); + } + function VM(e20, t10, n10) { + for (var r10 = Ro({}, t10.expandedMap), o10 = Ro({}, t10.visibleSectionsMap), i10 = 0; i10 < n10.length; i10++) { + var a10 = n10.slice(0, i10), s10 = Zs(a10), c10 = Ws(e20, a10); + if (Ql(c10) && (r10[s10] = true), Array.isArray(c10) && i10 < n10.length) { + var l10 = o10[s10] || ds, u10 = Ul(n10[i10]); + if (!DM(l10, u10)) { + var f10 = zM(u10), d10 = { start: f10, end: qM(f10) }; + o10[s10] = IM(l10.concat(d10)); + } + } + } + return Ro(Ro({}, t10), {}, { expandedMap: r10, visibleSectionsMap: o10 }); + } + function HM(e20, t10, n10, r10) { + var o10 = Ro({}, t10.expandedMap); + var i10 = n10.slice(), a10 = void 0 !== e20 ? Ws(e20, n10) : e20; + return void 0 !== a10 && function e21(n11) { + var a11 = i10.length; + if (Array.isArray(n11)) { + if (r10(i10)) { + var s10 = Zs(i10); + if (o10[s10] = true, n11.length > 0) { + var c10 = LM(t10, s10); + FM(n11, c10, function(t11) { + i10[a11] = String(t11), e21(n11[t11]); + }), i10.pop(); + } + } + } else if (Gl(n11) && r10(i10)) { + o10[Zs(i10)] = true; + var l10 = Object.keys(n11); + if (l10.length > 0) { + var u10, f10 = bo(l10); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value; + i10[a11] = d10, e21(n11[d10]); + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + i10.pop(); + } + } + }(a10), Ro(Ro({}, t10), {}, { expandedMap: o10 }); + } + function WM(e20, t10) { + var n10 = QM(e20.expandedMap, t10), r10 = QM(e20.enforceStringMap, t10), o10 = QM(e20.visibleSectionsMap, t10); + return Ro(Ro({}, e20), {}, { expandedMap: n10, enforceStringMap: r10, visibleSectionsMap: o10 }); + } + function UM(e20, t10, n10) { + if (n10) { + var r10 = Ro({}, e20.enforceStringMap); + return r10[t10] = n10, Ro(Ro({}, e20), {}, { enforceStringMap: r10 }); + } + if ("boolean" == typeof e20.enforceStringMap[t10]) { + var o10 = Ro({}, e20.enforceStringMap); + return delete o10[t10], Ro(Ro({}, e20), {}, { enforceStringMap: o10 }); + } + return e20; + } + function JM(e20, t10, n10) { + var r10 = rc(e20, n10), o10 = n10.reduce(function(e21, t11) { + return Ns(t11) ? KM(r10, e21, t11) : Is(t11) ? GM(r10, e21, t11) : Ds(t11) ? function(e23, t12, n11) { + var r11 = n11.path, o11 = tE(e23, t12.expandedMap), i10 = tE(e23, t12.enforceStringMap), a10 = tE(e23, t12.visibleSectionsMap); + Rs(n11.value) || Ts(n11.value) || delete o11[r11]; + Ts(n11.value) || delete a10[r11]; + (Rs(n11.value) || Ts(n11.value)) && delete i10[r11]; + return Ro(Ro({}, t12), {}, { expandedMap: o11, enforceStringMap: i10, visibleSectionsMap: a10 }); + }(r10, e21, t11) : qs(t11) || zs(t11) ? function(e23, t12, n11) { + if (zs(n11) && n11.from === n11.path) + return t12; + var r11 = function(e24) { + return n11.path + e24.substring(n11.from.length); + }, o11 = ZM(YM(t12.expandedMap, n11.from), r11), i10 = ZM(YM(t12.enforceStringMap, n11.from), r11), a10 = ZM(YM(t12.visibleSectionsMap, n11.from), r11), s10 = t12; + zs(n11) && (s10 = GM(e23, s10, { op: "remove", path: n11.from })); + s10 = KM(e23, s10, { op: "add", path: n11.path, value: null }); + var c10 = XM(s10.expandedMap, o11), l10 = XM(s10.enforceStringMap, i10), u10 = XM(s10.visibleSectionsMap, a10); + return Ro(Ro({}, t12), {}, { expandedMap: c10, enforceStringMap: l10, visibleSectionsMap: u10 }); + }(r10, e21, t11) : e21; + }, t10); + return { json: r10, documentState: o10 }; + } + function KM(e20, t10, n10) { + var r10 = dc(e20, n10.path), o10 = Qk(r10), i10 = Zs(o10); + if (Ts(Ws(e20, o10))) { + var a10 = Ul(vb(r10)), s10 = eE(t10.expandedMap, o10, a10, 1), c10 = eE(t10.enforceStringMap, o10, a10, 1), l10 = eE(t10.visibleSectionsMap, o10, a10, 1); + return l10 = nE(l10, i10, function(e21) { + return rE(e21, a10, 1); + }), Ro(Ro({}, t10), {}, { expandedMap: s10, enforceStringMap: c10, visibleSectionsMap: l10 }); + } + return t10; + } + function GM(e20, t10, n10) { + var r10 = dc(e20, n10.path), o10 = Qk(r10), i10 = Zs(o10), a10 = Ws(e20, o10), s10 = t10.expandedMap, c10 = t10.enforceStringMap, l10 = t10.visibleSectionsMap; + if (s10 = QM(s10, r10), c10 = QM(c10, r10), l10 = QM(l10, r10), Ts(a10)) { + var u10 = Ul(vb(r10)); + s10 = eE(s10, o10, u10, -1), c10 = eE(c10, o10, u10, -1), l10 = nE(l10 = eE(l10, o10, u10, -1), i10, function(e21) { + return rE(e21, u10, -1); + }); + } + return Ro(Ro({}, t10), {}, { expandedMap: s10, enforceStringMap: c10, visibleSectionsMap: l10 }); + } + function QM(e20, t10) { + var n10 = {}, r10 = Zs(t10); + return Object.keys(e20).forEach(function(t11) { + nc(t11, r10) || (n10[t11] = e20[t11]); + }), n10; + } + function YM(e20, t10) { + var n10 = {}; + return Object.keys(e20).forEach(function(r10) { + nc(r10, t10) && (n10[r10] = e20[r10]); + }), n10; + } + function XM(e20, t10) { + return Ro(Ro({}, e20), t10); + } + function ZM(e20, t10) { + var n10 = {}; + return Object.keys(e20).forEach(function(r10) { + var o10 = t10(r10); + n10[o10] = e20[r10]; + }), n10; + } + function eE(e20, t10, n10, r10) { + for (var o10 = t10.length, i10 = Zs(t10), a10 = [], s10 = 0, c10 = Object.keys(e20); s10 < c10.length; s10++) { + var l10 = c10[s10]; + if (nc(l10, i10)) { + var u10 = Xs(l10), f10 = Ul(u10[o10]); + f10 >= n10 && (u10[o10] = String(f10 + r10), a10.push({ oldPointer: l10, newPointer: Zs(u10), value: e20[l10] })); + } + } + if (0 === a10.length) + return e20; + var d10 = Ro({}, e20); + return a10.forEach(function(e21) { + delete d10[e21.oldPointer]; + }), a10.forEach(function(e21) { + d10[e21.newPointer] = e21.value; + }), d10; + } + function tE(e20, t10) { + var n10 = {}; + return Object.keys(t10).filter(function(t11) { + return Ys(e20, dc(e20, t11)); + }).forEach(function(e21) { + n10[e21] = t10[e21]; + }), n10; + } + function nE(e20, t10, n10) { + var r10 = e20[t10]; + if (t10 in e20) { + var o10 = n10(r10); + if (!Ow(r10, o10)) { + var i10 = Ro({}, e20); + return void 0 === o10 ? delete i10[t10] : i10[t10] = o10, i10; + } + } + return e20; + } + function rE(e20, t10, n10) { + return function(e21) { + var t11 = e21.slice(0), n11 = 1; + for (; n11 < t11.length; ) + t11[n11 - 1].end === t11[n11].start && (t11[n11 - 1] = { start: t11[n11 - 1].start, end: t11[n11].end }, t11.splice(n11)), n11++; + return t11; + }(e20.map(function(e21) { + return { start: e21.start > t10 ? e21.start + n10 : e21.start, end: e21.end > t10 ? e21.end + n10 : e21.end }; + })); + } + function oE(e20, t10, n10, r10) { + var o10 = t10 ? t10[n10] : void 0; + return "boolean" == typeof o10 ? o10 : function(e21, t11) { + return "string" == typeof e21 && "string" != typeof ru(e21, t11); + }(e20, r10); + } + function iE(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r10 = e20.indexOf(t10); + return -1 !== r10 ? n10 ? e20.slice(r10) : e20.slice(r10 + 1) : []; + } + function aE(e20, t10) { + var n10 = []; + return function e21(r10, o10) { + n10.push(o10); + var i10 = Zs(o10); + if (r10 && true === t10.expandedMap[i10]) { + if (Ts(r10)) { + var a10 = LM(t10, i10); + FM(r10, a10, function(t11) { + e21(r10[t11], o10.concat(String(t11))); + }); + } + Rs(r10) && Object.keys(r10).forEach(function(t11) { + e21(r10[t11], o10.concat(t11)); + }); + } + }(e20, []), n10; + } + function sE(e20, t10) { + var n10 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r10 = []; + return function e21(o10, i10) { + r10.push({ path: i10, type: Xa.value }); + var a10 = Zs(i10); + if (o10 && true === t10.expandedMap[a10]) { + if (n10 && r10.push({ path: i10, type: Xa.inside }), Ts(o10)) { + var s10 = LM(t10, a10); + FM(o10, s10, function(t11) { + var a11 = i10.concat(String(t11)); + e21(o10[t11], a11), n10 && r10.push({ path: a11, type: Xa.after }); + }); + } + if (Rs(o10)) + Object.keys(o10).forEach(function(t11) { + var a11 = i10.concat(t11); + r10.push({ path: a11, type: Xa.key }), e21(o10[t11], a11), n10 && r10.push({ path: a11, type: Xa.after }); + }); + } + }(e20, []), r10; + } + function cE(e20, t10, n10) { + var r10 = aE(e20, t10), o10 = r10.map(Zs).indexOf(Zs(n10)); + return -1 !== o10 && o10 < r10.length - 1 ? r10[o10 + 1] : null; + } + function lE(e20, t10, n10) { + var r10 = Ws(e20, n10); + return void 0 === r10 ? t10 : HM(e20, t10, n10, !X_({ json: r10 }, ms) ? fE : uE); + } + function uE(e20) { + return 0 === e20.length || 1 === e20.length && "0" === e20[0]; + } + function fE() { + return true; + } + function dE(e20) { + return e20 && e20.type === Ya.after || false; + } + function hE(e20) { + return e20 && e20.type === Ya.inside || false; + } + function vE(e20) { + return e20 && e20.type === Ya.key || false; + } + function pE(e20) { + return e20 && e20.type === Ya.value || false; + } + function mE(e20) { + return e20 && e20.type === Ya.multi || false; + } + function gE(e20) { + return mE(e20) && Ow(e20.focusPath, e20.anchorPath); + } + function yE(e20) { + return mE(e20) || dE(e20) || hE(e20) || vE(e20) || pE(e20); + } + function bE(e20) { + return e20 && e20.type === Ya.text || false; + } + function kE(e20, t10) { + var n10 = []; + return function(e21, t11, n11) { + if (!t11) + return; + var r10 = KE(t11), o10 = JE(t11); + if (Ow(r10, o10)) + return n11(r10); + if (void 0 === e21) + return; + var i10 = OE(r10, o10); + if (r10.length === i10.length || o10.length === i10.length) + return n11(i10); + var a10 = DE(r10, o10), s10 = xE(e21, a10), c10 = jE(e21, a10), l10 = UE(e21, a10, s10), u10 = UE(e21, a10, c10); + if (-1 === l10 || -1 === u10) + return; + var f10 = Ws(e21, i10); + if (Rs(f10)) { + for (var d10 = Object.keys(f10), h10 = l10; h10 <= u10; h10++) { + var v10 = n11(i10.concat(d10[h10])); + if (void 0 !== v10) + return v10; + } + return; + } + if (Ts(f10)) { + for (var p10 = l10; p10 <= u10; p10++) { + var m10 = n11(i10.concat(String(p10))); + if (void 0 !== m10) + return m10; + } + return; + } + throw new Error("Failed to create selection"); + }(e20, t10, function(e21) { + n10.push(e21); + }), n10; + } + function wE(e20) { + return hE(e20) ? e20.path : Qk(JE(e20)); + } + function xE(e20, t10) { + if (!mE(t10)) + return t10.path; + var n10 = UE(e20, t10, t10.anchorPath); + return UE(e20, t10, t10.focusPath) < n10 ? t10.focusPath : t10.anchorPath; + } + function jE(e20, t10) { + if (!mE(t10)) + return t10.path; + var n10 = UE(e20, t10, t10.anchorPath); + return UE(e20, t10, t10.focusPath) > n10 ? t10.focusPath : t10.anchorPath; + } + function SE(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r10 = t10.selection; + if (!r10) + return null; + var o10 = n10 ? JE(r10) : xE(e20, r10), i10 = function(e21, t11, n11) { + var r11 = aE(e21, t11), o11 = r11.map(Zs), i11 = Zs(n11), a11 = o11.indexOf(i11); + return -1 !== a11 && a11 > 0 ? r11[a11 - 1] : null; + }(e20, t10, o10); + if (n10) + return hE(r10) || dE(r10) ? null !== i10 ? DE(o10, o10) : null : null !== i10 ? DE(KE(r10), i10) : null; + if (dE(r10)) + return RE(o10, false); + if (hE(r10)) + return RE(o10, false); + if (vE(r10)) { + if (null == i10 || 0 === i10.length) + return null; + var a10 = Ws(e20, Qk(i10)); + return Array.isArray(a10) || _w(i10) ? RE(i10, false) : TE(i10, false); + } + return pE(r10), null !== i10 ? RE(i10, false) : null; + } + function CE(e20, t10, n10) { + var r10 = t10.selection; + if (!r10) + return { caret: null, previous: null, next: null }; + var o10 = sE(e20, t10, n10), i10 = o10.findIndex(function(e21) { + return Ow(e21.path, JE(r10)) && String(e21.type) === String(r10.type); + }); + return { caret: -1 !== i10 ? o10[i10] : null, previous: -1 !== i10 && i10 > 0 ? o10[i10 - 1] : null, next: -1 !== i10 && i10 < o10.length - 1 ? o10[i10 + 1] : null }; + } + function $E(e20, t10) { + for (var n10 = aE(e20, t10), r10 = 0; r10 < n10.length - 1 && n10[r10 + 1].length > n10[r10].length; ) + r10++; + var o10 = n10[r10]; + return void 0 === o10 || 0 === o10.length || Array.isArray(Ws(e20, Qk(o10))) ? RE(o10, false) : TE(o10, false); + } + function _E(e20, t10) { + if (1 === t10.length) { + var n10 = ck(t10); + if ("replace" === n10.op) + return RE(dc(e20, n10.path), false); + } + if (!_w(t10) && t10.every(function(e21) { + return "move" === e21.op; + })) { + var r10 = ck(t10), o10 = t10.slice(1); + if ((qs(r10) || zs(r10)) && r10.from !== r10.path && o10.every(function(e21) { + return (qs(e21) || zs(e21)) && e21.from === e21.path; + })) + return TE(dc(e20, r10.path), false); + } + var i10 = t10.filter(function(e21) { + return "test" !== e21.op && "remove" !== e21.op && ("move" !== e21.op || e21.from !== e21.path) && "string" == typeof e21.path; + }).map(function(t11) { + return dc(e20, t11.path); + }); + return _w(i10) ? null : { type: Ya.multi, anchorPath: ck(i10), focusPath: vb(i10) }; + } + function OE(e20, t10) { + for (var n10 = 0; n10 < e20.length && n10 < t10.length && e20[n10] === t10[n10]; ) + n10++; + return e20.slice(0, n10); + } + function ME(e20) { + return vE(e20) || pE(e20) || gE(e20); + } + function EE(e20, t10) { + return ME(t10) && Ql(Ws(e20, JE(t10))) ? JE(t10) : Qk(JE(t10)); + } + function AE(e20, t10) { + if (e20.length < t10.length) + return false; + for (var n10 = 0; n10 < t10.length; n10++) + if (e20[n10] !== t10[n10]) + return false; + return true; + } + function PE(e20) { + var t10 = e20.selection; + return (vE(t10) || pE(t10)) && t10.edit ? Ro(Ro({}, e20), {}, { selection: Ro(Ro({}, t10), {}, { edit: false }) }) : e20; + } + function TE(e20, t10) { + return { type: Ya.key, path: e20, edit: t10 }; + } + function RE(e20, t10) { + return { type: Ya.value, path: e20, edit: t10 }; + } + function NE(e20) { + return { type: Ya.inside, path: e20 }; + } + function IE(e20) { + return { type: Ya.after, path: e20 }; + } + function DE(e20, t10) { + var n10 = OE(e20, t10), r10 = e20.length > n10.length && t10.length > n10.length; + return { type: Ya.multi, anchorPath: r10 ? n10.concat(e20[n10.length]) : n10, focusPath: r10 ? n10.concat(t10[n10.length]) : n10 }; + } + function qE(e20, t10, n10, r10) { + if (vE(t10)) + return String(vb(t10.path)); + if (pE(t10)) { + var o10, i10 = Ws(e20, t10.path); + return "string" == typeof i10 ? i10 : null !== (o10 = r10.stringify(i10, null, n10)) && void 0 !== o10 ? o10 : null; + } + if (mE(t10)) { + var a10; + if (_w(t10.focusPath)) + return null !== (a10 = r10.stringify(e20, null, n10)) && void 0 !== a10 ? a10 : null; + var s10 = wE(t10), c10 = Ws(e20, s10); + if (Array.isArray(c10)) { + if (gE(t10)) { + var l10, u10 = Ws(e20, t10.focusPath); + return null !== (l10 = r10.stringify(u10, null, n10)) && void 0 !== l10 ? l10 : null; + } + return kE(e20, t10).map(function(t11) { + var o11 = Ws(e20, t11); + return "".concat(r10.stringify(o11, null, n10), ","); + }).join("\n"); + } + return kE(e20, t10).map(function(t11) { + var o11 = vb(t11), i11 = Ws(e20, t11); + return "".concat(r10.stringify(o11), ": ").concat(r10.stringify(i11, null, n10), ","); + }).join("\n"); + } + return null; + } + function zE(e20) { + return (vE(e20) || pE(e20)) && true === e20.edit; + } + function BE(e20) { + return vE(e20) || pE(e20) || mE(e20); + } + function LE(e20) { + return vE(e20) || pE(e20) || gE(e20); + } + function FE(e20) { + switch (e20.type) { + case Xa.key: + return TE(e20.path, false); + case Xa.value: + return RE(e20.path, false); + case Xa.after: + return IE(e20.path); + case Xa.inside: + return NE(e20.path); + } + } + function VE(e20, t10, n10) { + switch (t10) { + case Ya.key: + return TE(n10, false); + case Ya.value: + return RE(n10, false); + case Ya.after: + return IE(n10); + case Ya.inside: + return NE(n10); + case Ya.multi: + case Ya.text: + return DE(n10, n10); + } + } + function HE(e20, t10, n10) { + return t10 && (WE(e20, t10, n10) || AE(mE(t10) ? Qk(t10.focusPath) : t10.path, n10)) ? t10 : null; + } + function WE(e20, t10, n10) { + if (void 0 === e20 || !t10) + return false; + if (vE(t10) || hE(t10) || dE(t10)) + return Ow(t10.path, n10); + if (pE(t10)) + return AE(n10, t10.path); + if (mE(t10)) { + var r10 = xE(e20, t10), o10 = jE(e20, t10), i10 = Qk(t10.focusPath); + if (!AE(n10, i10) || n10.length <= i10.length) + return false; + var a10 = UE(e20, t10, r10), s10 = UE(e20, t10, o10), c10 = UE(e20, t10, n10); + return -1 !== c10 && c10 >= a10 && c10 <= s10; + } + return false; + } + function UE(e20, t10, n10) { + var r10 = Qk(t10.focusPath); + if (!AE(n10, r10) || n10.length <= r10.length) + return -1; + var o10 = n10[r10.length], i10 = Ws(e20, r10); + if (Rs(i10)) + return Object.keys(i10).indexOf(o10); + if (Ts(i10)) { + var a10 = Ul(o10); + if (a10 < i10.length) + return a10; + } + return -1; + } + function JE(e20) { + return mE(e20) ? e20.focusPath : e20.path; + } + function KE(e20) { + return mE(e20) ? e20.anchorPath : e20.path; + } + function GE() { + for (var e20 = [], t10 = arguments.length, n10 = new Array(t10), r10 = 0; r10 < t10; r10++) + n10[r10] = arguments[r10]; + for (var o10 = 0, i10 = n10; o10 < i10.length; o10++) { + var a10 = i10[o10]; + if ("string" == typeof a10 && e20.push(a10), a10 && "object" === Ho(a10)) + for (var s10 in a10) + Object.hasOwnProperty.call(a10, s10) && a10[s10] && e20.push(s10); + } + return e20.join(" "); + } + function QE(e20, t10) { + return GE("jse-value", "jse-" + eu(e20, t10), { "jse-url": nu(e20), "jse-empty": "string" == typeof e20 && 0 === e20.length }); + } + function YE(e20) { + mi(e20, "svelte-zwlnit", ".jse-value.jse-string.svelte-zwlnit{color:var(--jse-value-color-string, #008000)}.jse-value.jse-object.svelte-zwlnit,.jse-value.jse-array.svelte-zwlnit{min-width:16px;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-value.jse-number.svelte-zwlnit{color:var(--jse-value-color-number, #ee422e)}.jse-value.jse-boolean.svelte-zwlnit{color:var(--jse-value-color-boolean, #ff8c00)}.jse-value.jse-null.svelte-zwlnit{color:var(--jse-value-color-null, #004ed0)}.jse-value.jse-invalid.svelte-zwlnit{color:var(--jse-text-color, #4d4d4d)}.jse-value.jse-url.svelte-zwlnit{color:var(--jse-value-color-url, #008000);text-decoration:underline}div.jse-editable-div.svelte-zwlnit{min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;cursor:text !important;word-break:normal;white-space:pre-wrap;overflow-wrap:anywhere}div.jse-editable-div.jse-short-text.svelte-zwlnit{overflow-wrap:normal}div.jse-editable-div[contenteditable=true].svelte-zwlnit{outline:var(--jse-edit-outline, 2px solid #656565);background:inherit !important;position:relative;border-radius:0;z-index:3}div.jse-editable-div.jse-empty.svelte-zwlnit:not(:focus){outline:1px dotted var(--jse-tag-background, rgba(0, 0, 0, 0.2));-moz-outline-radius:2px}div.jse-editable-div.jse-empty.svelte-zwlnit::after{pointer-events:none;color:var(--jse-tag-background, rgba(0, 0, 0, 0.2))}"); + } + function XE(e20) { + var t10, n10, r10, o10; + return { c: function() { + Ai(t10 = ji("div"), "role", "textbox"), Ai(t10, "tabindex", "0"), Ai(t10, "class", n10 = si(GE("jse-editable-div", e20[2], { "jse-short-text": e20[0] })) + " svelte-zwlnit"), Ai(t10, "contenteditable", "true"), Ai(t10, "spellcheck", "false"); + }, m: function(n11, i10) { + ki(n11, t10, i10), e20[13](t10), r10 || (o10 = [Oi(t10, "input", e20[3]), Oi(t10, "keydown", e20[4]), Oi(t10, "paste", e20[5]), Oi(t10, "blur", e20[6])], r10 = true); + }, p: function(e21, r11) { + 5 & jo(r11, 1)[0] && n10 !== (n10 = si(GE("jse-editable-div", e21[2], { "jse-short-text": e21[0] })) + " svelte-zwlnit") && Ai(t10, "class", n10); + }, i: Wo, o: Wo, d: function(n11) { + n11 && wi(t10), e20[13](null), r10 = false, Qo(o10); + } }; + } + function ZE(e20, t10, n10) { + var r10, o10, i10 = Da("jsoneditor:EditableDiv"), a10 = t10.value, s10 = t10.shortText, c10 = void 0 !== s10 && s10, l10 = t10.onChange, u10 = t10.onCancel, f10 = t10.onFind, d10 = t10.onPaste, h10 = void 0 === d10 ? Mf : d10, v10 = t10.onValueClass, p10 = void 0 === v10 ? function() { + return ""; + } : v10, m10 = false; + function g10() { + return r10 ? function(e21) { + return e21.replace(/\n$/, ""); + }(r10.innerText) : ""; + } + function y10(e21) { + r10 && n10(1, r10.innerText = gO(e21), r10); + } + function b10() { + var e21 = g10(); + "" === e21 && y10(""), n10(2, o10 = p10(e21)); + } + function k10() { + m10 = true, u10(); + } + return Gi(function() { + i10("onMount", { value: a10 }), y10(a10), r10 && (xO(r10), n10(1, r10.refresh = b10, r10), n10(1, r10.cancel = k10, r10)); + }), Qi(function() { + var e21 = g10(); + i10("onDestroy", { closed: m10, value: a10, newValue: e21 }), m10 || e21 === a10 || l10(e21, ns.no); + }), e20.$$set = function(e21) { + "value" in e21 && n10(7, a10 = e21.value), "shortText" in e21 && n10(0, c10 = e21.shortText), "onChange" in e21 && n10(8, l10 = e21.onChange), "onCancel" in e21 && n10(9, u10 = e21.onCancel), "onFind" in e21 && n10(10, f10 = e21.onFind), "onPaste" in e21 && n10(11, h10 = e21.onPaste), "onValueClass" in e21 && n10(12, p10 = e21.onValueClass); + }, e20.$$.update = function() { + 4224 & e20.$$.dirty && n10(2, o10 = p10(a10)); + }, [c10, r10, o10, b10, function(e21) { + e21.stopPropagation(); + var t11 = PO(e21); + if ("Escape" === t11 && k10(), "Enter" === t11 || "Tab" === t11) { + m10 = true; + var n11 = g10(); + l10(n11, ns.nextInside); + } + "Ctrl+F" === t11 && (e21.preventDefault(), f10(false)), "Ctrl+H" === t11 && (e21.preventDefault(), f10(true)); + }, function(e21) { + if (e21.stopPropagation(), h10 && e21.clipboardData) { + var t11 = e21.clipboardData.getData("text/plain"); + h10(t11); + } + }, function() { + var e21 = document.hasFocus(), t11 = g10(); + i10("handleBlur", { hasFocus: e21, closed: m10, value: a10, newValue: t11 }), document.hasFocus() && !m10 && (m10 = true, t11 !== a10 && l10(t11, ns.self)); + }, a10, l10, u10, f10, h10, p10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(1, r10 = e21); + }); + }]; + } + var eA = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, ZE, XE, Zo, { value: 7, shortText: 0, onChange: 8, onCancel: 9, onFind: 10, onPaste: 11, onValueClass: 12 }, YE), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function tA(e20) { + var t10, n10; + return t10 = new eA({ props: { value: e20[1].escapeValue(e20[0]), onChange: e20[3], onCancel: e20[4], onPaste: e20[5], onFind: e20[2], onValueClass: e20[6] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = jo(n11, 1)[0], o10 = {}; + 3 & r10 && (o10.value = e21[1].escapeValue(e21[0])), 4 & r10 && (o10.onFind = e21[2]), t10.$set(o10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function nA(e20, t10, n10) { + var r10 = t10.path, o10 = t10.value, i10 = t10.parser, a10 = t10.normalization, s10 = t10.enforceString, c10 = t10.onPatch, l10 = t10.onPasteJson, u10 = t10.onSelect, f10 = t10.onFind, d10 = t10.focus, h10 = t10.findNextInside; + function v10(e21) { + return s10 ? e21 : ru(e21, i10); + } + return e20.$$set = function(e21) { + "path" in e21 && n10(7, r10 = e21.path), "value" in e21 && n10(0, o10 = e21.value), "parser" in e21 && n10(8, i10 = e21.parser), "normalization" in e21 && n10(1, a10 = e21.normalization), "enforceString" in e21 && n10(9, s10 = e21.enforceString), "onPatch" in e21 && n10(10, c10 = e21.onPatch), "onPasteJson" in e21 && n10(11, l10 = e21.onPasteJson), "onSelect" in e21 && n10(12, u10 = e21.onSelect), "onFind" in e21 && n10(2, f10 = e21.onFind), "focus" in e21 && n10(13, d10 = e21.focus), "findNextInside" in e21 && n10(14, h10 = e21.findNextInside); + }, [o10, a10, f10, function(e21, t11) { + c10([{ op: "replace", path: Zs(r10), value: v10(a10.unescapeValue(e21)) }], function(e23, n11) { + if (!n11.selection || Ow(r10, JE(n11.selection))) { + var o11 = t11 === ns.nextInside ? h10(r10) : RE(r10, false); + return { state: Ro(Ro({}, n11), {}, { selection: o11 }) }; + } + }), d10(); + }, function() { + u10(RE(r10, false)), d10(); + }, function(e21) { + try { + var t11 = i10.parse(e21); + Ql(t11) && l10({ path: r10, contents: t11 }); + } catch (e23) { + } + }, function(e21) { + return QE(v10(a10.unescapeValue(e21)), i10); + }, r10, i10, s10, c10, l10, u10, d10, h10]; + } + var rA = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, nA, tA, Zo, { path: 7, value: 0, parser: 8, normalization: 1, enforceString: 9, onPatch: 10, onPasteJson: 11, onSelect: 12, onFind: 2, focus: 13, findNextInside: 14 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function oA(e20, t10, n10) { + var r10 = Qk(t10), o10 = Ws(e20, r10); + if (Ts(o10)) { + var i10 = Ul(vb(t10)); + return n10.map(function(e21, t11) { + return { op: "add", path: Zs(r10.concat(String(i10 + t11))), value: e21.value }; + }); + } + if (Rs(o10)) { + var a10 = vb(t10), s10 = Object.keys(o10), c10 = void 0 !== a10 ? iE(s10, a10, true) : []; + return [].concat(Bo(n10.map(function(e21) { + var t11 = eM(e21.key, s10); + return { op: "add", path: Zs(r10.concat(t11)), value: e21.value }; + })), Bo(c10.map(function(e21) { + return uA(r10, e21); + }))); + } + throw new Error("Cannot create insert operations: parent must be an Object or Array"); + } + function iA(e20, t10, n10) { + var r10 = Ws(e20, t10); + if (Array.isArray(r10)) { + var o10 = r10.length; + return n10.map(function(e21, n11) { + return { op: "add", path: Zs(t10.concat(String(o10 + n11))), value: e21.value }; + }); + } + return n10.map(function(e21) { + var n11 = eM(e21.key, Object.keys(r10)); + return { op: "add", path: Zs(t10.concat(n11)), value: e21.value }; + }); + } + function aA(e20, t10, n10, r10) { + var o10 = eM(r10, t10.filter(function(e21) { + return e21 !== n10; + })), i10 = iE(t10, n10, false); + return [{ op: "move", from: Zs(e20.concat(n10)), path: Zs(e20.concat(o10)) }].concat(Bo(i10.map(function(t11) { + return uA(e20, t11); + }))); + } + function sA(e20, t10) { + var n10 = vb(t10); + if (_w(n10)) + throw new Error("Cannot duplicate root object"); + var r10 = Qk(n10), o10 = vb(n10), i10 = Ws(e20, r10); + if (Ts(i10)) { + var a10 = vb(t10), s10 = a10 ? Ul(vb(a10)) + 1 : 0; + return Bo(t10.map(function(e21, t11) { + return { op: "copy", from: Zs(e21), path: Zs(r10.concat(String(t11 + s10))) }; + })); + } + if (Rs(i10)) { + var c10 = Object.keys(i10), l10 = void 0 !== o10 ? iE(c10, o10, false) : []; + return [].concat(Bo(t10.map(function(e21) { + var t11 = eM(vb(e21), c10); + return { op: "copy", from: Zs(e21), path: Zs(r10.concat(t11)) }; + })), Bo(l10.map(function(e21) { + return uA(r10, e21); + }))); + } + throw new Error("Cannot create duplicate operations: parent must be an Object or Array"); + } + function cA(e20, t10, n10, r10) { + if (vE(t10)) { + var o10 = B_(n10, r10), i10 = Qk(t10.path), a10 = Ws(e20, i10); + return aA(i10, Object.keys(a10), vb(t10.path), "string" == typeof o10 ? o10 : n10); + } + if (pE(t10) || mE(t10) && _w(t10.focusPath)) + try { + return [{ op: "replace", path: Zs(JE(t10)), value: L_(n10, function(e21) { + return z_(e21, r10); + }) }]; + } catch (e21) { + return [{ op: "replace", path: Zs(JE(t10)), value: n10 }]; + } + if (mE(t10)) { + var s10 = fA(n10, r10); + return function(e21, t11, n11) { + var r11 = Qk(ck(t11)), o11 = Ws(e21, r11); + if (Ts(o11)) { + var i11 = ck(t11), a11 = i11 ? Ul(vb(i11)) : 0; + return [].concat(Bo(lA(t11)), Bo(n11.map(function(e23, t12) { + return { op: "add", path: Zs(r11.concat(String(t12 + a11))), value: e23.value }; + }))); + } + if (Rs(o11)) { + var s11 = vb(t11), c11 = Qk(s11), l11 = vb(s11), u11 = Object.keys(o11), f11 = void 0 !== l11 ? iE(u11, l11, false) : [], d11 = new Set(t11.map(function(e23) { + return vb(e23); + })), h11 = u11.filter(function(e23) { + return !d11.has(e23); + }); + return [].concat(Bo(lA(t11)), Bo(n11.map(function(e23) { + var t12 = eM(e23.key, h11); + return { op: "add", path: Zs(c11.concat(t12)), value: e23.value }; + })), Bo(f11.map(function(e23) { + return uA(c11, e23); + }))); + } + throw new Error("Cannot create replace operations: parent must be an Object or Array"); + }(e20, kE(e20, t10), s10); + } + if (dE(t10)) { + var c10 = fA(n10, r10), l10 = t10.path, u10 = Qk(l10), f10 = Ws(e20, u10); + if (Ts(f10)) { + var d10 = Ul(vb(l10)); + return oA(e20, u10.concat(String(d10 + 1)), c10); + } + if (Rs(f10)) { + var h10 = String(vb(l10)), v10 = Object.keys(f10); + if (_w(v10) || vb(v10) === h10) + return iA(e20, u10, c10); + var p10 = v10.indexOf(h10), m10 = v10[p10 + 1]; + return oA(e20, u10.concat(m10), c10); + } + throw new Error("Cannot create insert operations: parent must be an Object or Array"); + } + if (hE(t10)) { + var g10 = fA(n10, r10), y10 = t10.path, b10 = Ws(e20, y10); + if (Ts(b10)) + return oA(e20, y10.concat("0"), g10); + if (Rs(b10)) { + var k10 = Object.keys(b10); + if (_w(k10)) + return iA(e20, y10, g10); + var w10 = ck(k10); + return oA(e20, y10.concat(w10), g10); + } + throw new Error("Cannot create insert operations: parent must be an Object or Array"); + } + throw new Error("Cannot insert: unsupported type of selection " + JSON.stringify(t10)); + } + function lA(e20) { + return e20.map(function(e21) { + return { op: "remove", path: Zs(e21) }; + }).reverse(); + } + function uA(e20, t10) { + return { op: "move", from: Zs(e20.concat(t10)), path: Zs(e20.concat(t10)) }; + } + function fA(e20, t10) { + var n10 = /^\s*{/.test(e20), r10 = /^\s*\[/.test(e20), o10 = B_(e20, t10), i10 = void 0 !== o10 ? o10 : L_(e20, function(e21) { + return z_(e21, t10); + }); + return n10 && Gl(i10) || r10 && Array.isArray(i10) ? [{ key: "New item", value: i10 }] : Array.isArray(i10) ? i10.map(function(e21, t11) { + return { key: "New item " + t11, value: e21 }; + }) : Gl(i10) ? Object.keys(i10).map(function(e21) { + return { key: e21, value: i10[e21] }; + }) : [{ key: "New item", value: i10 }]; + } + function dA(e20, t10) { + if (vE(t10)) { + var n10 = Qk(t10.path), r10 = Ws(e20, n10), o10 = aA(n10, Object.keys(r10), vb(t10.path), ""); + return { operations: o10, newSelection: _E(e20, o10) }; + } + if (pE(t10)) + return { operations: [{ op: "replace", path: Zs(t10.path), value: "" }], newSelection: t10 }; + if (mE(t10)) { + var i10 = kE(e20, t10), a10 = lA(i10), s10 = vb(i10); + if (_w(s10)) { + return { operations: [{ op: "replace", path: "", value: "" }], newSelection: RE([], false) }; + } + var c10 = Qk(s10), l10 = Ws(e20, c10); + if (Ts(l10)) { + var u10 = Ul(vb(ck(i10))); + return { operations: a10, newSelection: 0 === u10 ? NE(c10) : IE(c10.concat(String(u10 - 1))) }; + } + if (Rs(l10)) { + var f10 = Object.keys(l10), d10 = vb(ck(i10)), h10 = f10.indexOf(d10), v10 = f10[h10 - 1]; + return { operations: a10, newSelection: 0 === h10 ? NE(c10) : IE(c10.concat(v10)) }; + } + throw new Error("Cannot create remove operations: parent must be an Object or Array"); + } + throw new Error("Cannot remove: unsupported type of selection " + JSON.stringify(t10)); + } + function hA(e20, t10) { + return vc(e20, t10, { before: function(e21, t11, n10) { + if (Is(t11)) { + var r10 = Xs(t11.path); + return { revertOperations: [].concat(Bo(n10), Bo(vA(e21, r10))) }; + } + if (zs(t11)) { + var o10 = Xs(t11.from); + return { revertOperations: [].concat(Bo(n10), Bo(vA(e21, o10))) }; + } + return { document: e21 }; + } }); + } + function vA(e20, t10) { + var n10 = Qk(t10), r10 = vb(t10), o10 = Ws(e20, n10); + return Rs(o10) ? iE(Object.keys(o10), r10, false).map(function(e21) { + return uA(n10, e21); + }) : []; + } + function pA(e20) { + var t10 = e20.activeIndex < e20.items.length - 1 ? e20.activeIndex + 1 : e20.items.length > 0 ? 0 : -1, n10 = e20.items[t10], r10 = e20.items.map(function(e21, n11) { + return Ro(Ro({}, e21), {}, { active: n11 === t10 }); + }); + return Ro(Ro({}, e20), {}, { items: r10, itemsMap: Ak(r10, function(e21) { + return Zs(e21.path); + }), activeItem: n10, activeIndex: t10 }); + } + function mA(e20) { + var t10 = e20.activeIndex > 0 ? e20.activeIndex - 1 : e20.items.length - 1, n10 = e20.items[t10], r10 = e20.items.map(function(e21, n11) { + return Ro(Ro({}, e21), {}, { active: n11 === t10 }); + }); + return Ro(Ro({}, e20), {}, { items: r10, itemsMap: Ak(r10, function(e21) { + return Zs(e21.path); + }), activeItem: n10, activeIndex: t10 }); + } + function gA(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 / 0, r10 = [], o10 = []; + function i10(e21) { + r10.length < n10 && r10.push(e21); + } + "string" == typeof e20 && "" !== e20 && function e21(t11, a10) { + if (Ts(a10)) { + var s10 = o10.length; + o10.push("0"); + for (var c10 = 0; c10 < a10.length; c10++) + if (o10[s10] = String(c10), e21(t11, a10[c10]), r10.length >= n10) + return; + o10.pop(); + } else if (Rs(a10)) { + var l10 = Object.keys(a10), u10 = o10.length; + o10.push(""); + for (var f10 = 0, d10 = l10; f10 < d10.length; f10++) { + var h10 = d10[f10]; + if (o10[u10] = h10, yA(h10, t11, o10, es.key, i10), e21(t11, a10[h10]), r10.length >= n10) + return; + } + o10.pop(); + } else + yA(String(a10), t11, o10, es.value, i10); + }(e20.toLowerCase(), t10); + return r10; + } + function yA(e20, t10, n10, r10, o10) { + var i10 = e20.toLowerCase(), a10 = 0, s10 = -1, c10 = -1; + do { + -1 !== (c10 = i10.indexOf(t10, s10)) && (s10 = c10 + t10.length, o10({ path: n10.slice(0), field: r10, fieldIndex: a10, start: c10, end: s10 }), a10++); + } while (-1 !== c10); + } + function bA(e20, t10, n10, r10) { + return e20.substring(0, n10) + t10 + e20.substring(r10); + } + function kA(e20, t10, n10) { + var r10 = e20; + return Ab(n10, function(e21) { + r10 = bA(r10, t10, e21.start, e21.end); + }), r10; + } + function wA(e20, t10, n10, r10, o10) { + var i10 = r10.field, a10 = r10.path, s10 = r10.start, c10 = r10.end; + if (i10 === es.key) { + var l10 = Qk(a10), u10 = Ws(e20, l10), f10 = vb(a10), d10 = aA(l10, Object.keys(u10), f10, bA(f10, n10, s10, c10)); + return { newSelection: _E(e20, d10), operations: d10 }; + } + if (i10 === es.value) { + var h10 = Ws(e20, a10); + if (void 0 === h10) + throw new Error("Cannot replace: path not found ".concat(Zs(a10))); + var v10 = "string" == typeof h10 ? h10 : String(h10), p10 = Zs(a10), m10 = oE(h10, t10.enforceStringMap, p10, o10), g10 = bA(v10, n10, s10, c10), y10 = [{ op: "replace", path: Zs(a10), value: m10 ? g10 : ru(g10, o10) }]; + return { newSelection: _E(e20, y10), operations: y10 }; + } + throw new Error("Cannot replace: unknown type of search result field ".concat(i10)); + } + function xA(e20, t10, n10, r10, o10) { + for (var i10 = gA(n10, e20, 1 / 0), a10 = [], s10 = 0; s10 < i10.length; s10++) { + var c10 = i10[s10 - 1], l10 = i10[s10]; + 0 !== s10 && l10.field === c10.field && Ow(l10.path, c10.path) ? vb(a10).items.push(l10) : a10.push({ path: l10.path, field: l10.field, items: [l10] }); + } + a10.sort(function(e21, t11) { + return e21.field !== t11.field ? e21.field === es.key ? 1 : -1 : t11.path.length - e21.path.length; + }); + var u10 = [], f10 = null; + return a10.forEach(function(n11) { + var i11 = n11.field, a11 = n11.path, s11 = n11.items; + if (i11 === es.key) { + var c11 = Qk(a11), l11 = Ws(e20, c11), d10 = vb(a11), h10 = aA(c11, Object.keys(l11), d10, kA(d10, r10, s11)); + u10 = u10.concat(h10), f10 = _E(e20, h10); + } else { + if (i11 !== es.value) + throw new Error("Cannot replace: unknown type of search result field ".concat(i11)); + var v10 = Ws(e20, a11); + if (void 0 === v10) + throw new Error("Cannot replace: path not found ".concat(Zs(a11))); + var p10 = "string" == typeof v10 ? v10 : String(v10), m10 = Zs(a11), g10 = oE(v10, t10.enforceStringMap, m10, o10), y10 = kA(p10, r10, s11), b10 = [{ op: "replace", path: Zs(a11), value: g10 ? y10 : ru(y10, o10) }]; + u10 = u10.concat(b10), f10 = _E(e20, b10); + } + }), { operations: u10, newSelection: f10 }; + } + function jA(e20) { + return e20.path.concat(e20.field, String(e20.fieldIndex)); + } + function SA(e20, t10) { + var n10, r10 = null == e20 || null === (n10 = e20[t10]) || void 0 === n10 ? void 0 : n10.filter(function(e21) { + return e21.field === es.key; + }); + if (r10 && 0 !== r10.length) + return r10; + } + function CA(e20, t10) { + var n10, r10 = null == e20 || null === (n10 = e20[t10]) || void 0 === n10 ? void 0 : n10.filter(function(e21) { + return e21.field === es.value; + }); + if (r10 && 0 !== r10.length) + return r10; + } + function $A(e20) { + mi(e20, "svelte-1n1l5ny", ".jse-highlight.svelte-1n1l5ny{background-color:var(--jse-search-match-color, #ffe665);outline:var(--jse-search-match-outline, 1px solid #ffd700)}.jse-highlight.jse-active.svelte-1n1l5ny{background-color:var(--jse-search-match-active-color, #ffd700);outline:var(--jse-search-match-active-outline, 1px solid #e1be00)}"); + } + function _A(e20, t10, n10) { + var r10 = e20.slice(); + return r10[3] = t10[n10], r10; + } + function OA(e20) { + var t10, n10, r10 = gO(e20[3].text) + ""; + return { c: function() { + t10 = ji("span"), n10 = Ci(r10), Ai(t10, "class", "jse-highlight svelte-1n1l5ny"), zi(t10, "jse-active", e20[3].active); + }, m: function(e21, r11) { + ki(e21, t10, r11), pi(t10, n10); + }, p: function(e21, o10) { + 1 & o10 && r10 !== (r10 = gO(e21[3].text) + "") && Ni(n10, r10), 1 & o10 && zi(t10, "jse-active", e21[3].active); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function MA(e20) { + var t10, n10 = e20[3].text + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = e21[3].text + "") && Ni(t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function EA(e20) { + var t10; + function n10(e21, t11) { + return "normal" === e21[3].type ? MA : OA; + } + var r10 = n10(e20), o10 = r10(e20); + return { c: function() { + o10.c(), t10 = _i(); + }, m: function(e21, n11) { + o10.m(e21, n11), ki(e21, t10, n11); + }, p: function(e21, i10) { + r10 === (r10 = n10(e21)) && o10 ? o10.p(e21, i10) : (o10.d(1), (o10 = r10(e21)) && (o10.c(), o10.m(t10.parentNode, t10))); + }, d: function(e21) { + e21 && wi(t10), o10.d(e21); + } }; + } + function AA(e20) { + for (var t10, n10 = Ca(e20[0]), r10 = [], o10 = 0; o10 < n10.length; o10 += 1) + r10[o10] = EA(_A(e20, n10, o10)); + return { c: function() { + for (var e21 = 0; e21 < r10.length; e21 += 1) + r10[e21].c(); + t10 = _i(); + }, m: function(e21, n11) { + for (var o11 = 0; o11 < r10.length; o11 += 1) + r10[o11] && r10[o11].m(e21, n11); + ki(e21, t10, n11); + }, p: function(e21, o11) { + var i10 = jo(o11, 1)[0]; + if (1 & i10) { + var a10; + for (n10 = Ca(e21[0]), a10 = 0; a10 < n10.length; a10 += 1) { + var s10 = _A(e21, n10, a10); + r10[a10] ? r10[a10].p(s10, i10) : (r10[a10] = EA(s10), r10[a10].c(), r10[a10].m(t10.parentNode, t10)); + } + for (; a10 < r10.length; a10 += 1) + r10[a10].d(1); + r10.length = n10.length; + } + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), xi(r10, e21); + } }; + } + function PA(e20, t10, n10) { + var r10, o10 = t10.text, i10 = t10.searchResultItems; + return e20.$$set = function(e21) { + "text" in e21 && n10(1, o10 = e21.text), "searchResultItems" in e21 && n10(2, i10 = e21.searchResultItems); + }, e20.$$.update = function() { + 6 & e20.$$.dirty && n10(0, r10 = function(e21, t11) { + var n11, r11 = [], o11 = 0, i11 = bo(t11); + try { + for (i11.s(); !(n11 = i11.n()).done; ) { + var a10 = n11.value, s10 = e21.slice(o11, a10.start); + "" !== s10 && r11.push({ type: "normal", text: s10, active: false }); + var c10 = e21.slice(a10.start, a10.end); + r11.push({ type: "highlight", text: c10, active: a10.active }), o11 = a10.end; + } + } catch (e23) { + i11.e(e23); + } finally { + i11.f(); + } + var l10 = vb(t11); + return l10 && l10.end < e21.length && r11.push({ type: "normal", text: e21.slice(l10.end), active: false }), r11; + }(String(o10), i10)); + }, [r10, o10, i10]; + } + var TA = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, PA, AA, Xo, { text: 1, searchResultItems: 2 }, $A), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function RA(e20) { + mi(e20, "svelte-1v88515", '.jse-value.jse-string.svelte-1v88515{color:var(--jse-value-color-string, #008000)}.jse-value.jse-object.svelte-1v88515,.jse-value.jse-array.svelte-1v88515{min-width:16px;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-value.jse-number.svelte-1v88515{color:var(--jse-value-color-number, #ee422e)}.jse-value.jse-boolean.svelte-1v88515{color:var(--jse-value-color-boolean, #ff8c00)}.jse-value.jse-null.svelte-1v88515{color:var(--jse-value-color-null, #004ed0)}.jse-value.jse-invalid.svelte-1v88515{color:var(--jse-text-color, #4d4d4d)}.jse-value.jse-url.svelte-1v88515{color:var(--jse-value-color-url, #008000);text-decoration:underline}.jse-value.svelte-1v88515{min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;cursor:var(--jse-contents-cursor, pointer);word-break:normal;overflow-wrap:anywhere;white-space:pre-wrap}.jse-value.svelte-1v88515:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-value.jse-empty.svelte-1v88515{min-width:4em;outline:1px dotted var(--jse-tag-background, rgba(0, 0, 0, 0.2));-moz-outline-radius:2px}.jse-value.jse-empty.svelte-1v88515::after{pointer-events:none;color:var(--jse-tag-background, rgba(0, 0, 0, 0.2));content:"value"}'); + } + function NA(e20) { + var t10, n10 = gO(e20[1].escapeValue(e20[0])) + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 3 & r10 && n10 !== (n10 = gO(e21[1].escapeValue(e21[0])) + "") && Ni(t10, n10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function IA(e20) { + var t10, n10; + return t10 = new TA({ props: { text: e20[1].escapeValue(e20[0]), searchResultItems: e20[3] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 3 & n11 && (r10.text = e21[1].escapeValue(e21[0])), 8 & n11 && (r10.searchResultItems = e21[3]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function DA(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = [IA, NA], u10 = []; + function f10(e21, t11) { + return e21[3] ? 0 : 1; + } + return n10 = f10(e20), r10 = u10[n10] = l10[n10](e20), { c: function() { + t10 = ji("div"), r10.c(), Ai(t10, "role", "button"), Ai(t10, "tabindex", "-1"), Ai(t10, "data-type", "selectable-value"), Ai(t10, "class", o10 = si(QE(e20[0], e20[2])) + " svelte-1v88515"), Ai(t10, "title", i10 = e20[4] ? "Ctrl+Click or Ctrl+Enter to open url in new window" : null); + }, m: function(r11, o11) { + ki(r11, t10, o11), u10[n10].m(t10, null), a10 = true, s10 || (c10 = [Oi(t10, "click", e20[5]), Oi(t10, "dblclick", e20[6])], s10 = true); + }, p: function(e21, s11) { + var c11 = jo(s11, 1)[0], d10 = n10; + (n10 = f10(e21)) === d10 ? u10[n10].p(e21, c11) : (ba(), xa(u10[d10], 1, 1, function() { + u10[d10] = null; + }), ka(), (r10 = u10[n10]) ? r10.p(e21, c11) : (r10 = u10[n10] = l10[n10](e21)).c(), wa(r10, 1), r10.m(t10, null)), (!a10 || 5 & c11 && o10 !== (o10 = si(QE(e21[0], e21[2])) + " svelte-1v88515")) && Ai(t10, "class", o10), (!a10 || 16 & c11 && i10 !== (i10 = e21[4] ? "Ctrl+Click or Ctrl+Enter to open url in new window" : null)) && Ai(t10, "title", i10); + }, i: function(e21) { + a10 || (wa(r10), a10 = true); + }, o: function(e21) { + xa(r10), a10 = false; + }, d: function(e21) { + e21 && wi(t10), u10[n10].d(), s10 = false, Qo(c10); + } }; + } + function qA(e20, t10, n10) { + var r10, o10 = t10.path, i10 = t10.value, a10 = t10.readOnly, s10 = t10.normalization, c10 = t10.parser, l10 = t10.onSelect, u10 = t10.searchResultItems; + return e20.$$set = function(e21) { + "path" in e21 && n10(7, o10 = e21.path), "value" in e21 && n10(0, i10 = e21.value), "readOnly" in e21 && n10(8, a10 = e21.readOnly), "normalization" in e21 && n10(1, s10 = e21.normalization), "parser" in e21 && n10(2, c10 = e21.parser), "onSelect" in e21 && n10(9, l10 = e21.onSelect), "searchResultItems" in e21 && n10(3, u10 = e21.searchResultItems); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && n10(4, r10 = nu(i10)); + }, [i10, s10, c10, u10, r10, function(e21) { + "string" == typeof i10 && r10 && e21.ctrlKey && (e21.preventDefault(), e21.stopPropagation(), window.open(i10, "_blank")); + }, function(e21) { + a10 || (e21.preventDefault(), l10(RE(o10, true))); + }, o10, a10, l10]; + } + var zA = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, qA, DA, Zo, { path: 7, value: 0, readOnly: 8, normalization: 1, parser: 2, onSelect: 9, searchResultItems: 3 }, RA), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function BA(e20) { + mi(e20, "svelte-1sftg37", '.jse-tooltip.svelte-1sftg37{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px);border-radius:3px;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));white-space:nowrap;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}'); + } + function LA(e20) { + var t10, n10; + return { c: function() { + t10 = ji("div"), n10 = Ci(e20[0]), Ai(t10, "class", "jse-tooltip svelte-1sftg37"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: function(e21, t11) { + 1 & jo(t11, 1)[0] && Ni(n10, e21[0]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function FA(e20, t10, n10) { + var r10 = t10.text; + return e20.$$set = function(e21) { + "text" in e21 && n10(0, r10 = e21.text); + }, [r10]; + } + var VA = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, FA, LA, Xo, { text: 0 }, BA), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function HA(e20, t10) { + var n10, r10 = t10.text, o10 = t10.openAbsolutePopup, i10 = t10.closeAbsolutePopup; + function a10() { + n10 = o10(VA, { text: r10 }, { position: "top", width: 10 * r10.length, offsetTop: 3, anchor: e20, closeOnOuterClick: true }); + } + function s10() { + i10(n10); + } + return e20.addEventListener("mouseenter", a10), e20.addEventListener("mouseleave", s10), { destroy: function() { + e20.removeEventListener("mouseenter", a10), e20.removeEventListener("mouseleave", s10); + } }; + } + function WA(e20) { + mi(e20, "svelte-1sqrs1u", ".jse-timestamp.svelte-1sqrs1u{padding:0;margin:0;vertical-align:middle;display:inline-flex;color:var(--jse-value-color-number, #ee422e)}"); + } + function UA(e20) { + var t10, n10, r10, o10, i10, a10; + return n10 = new jM({ props: { data: sM } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-timestamp svelte-1sqrs1u"); + }, m: function(s10, c10) { + ki(s10, t10, c10), Ta(n10, t10, null), o10 = true, i10 || (a10 = ci(r10 = HA.call(null, t10, Ro({ text: e20[0] }, e20[1]))), i10 = true); + }, p: function(e21, t11) { + var n11 = jo(t11, 1)[0]; + r10 && Yo(r10.update) && 1 & n11 && r10.update.call(null, Ro({ text: e21[0] }, e21[1])); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), i10 = false, a10(); + } }; + } + function JA(e20, t10, n10) { + var r10, o10 = Zi("absolute-popup"), i10 = t10.value; + return e20.$$set = function(e21) { + "value" in e21 && n10(2, i10 = e21.value); + }, e20.$$.update = function() { + 4 & e20.$$.dirty && n10(0, r10 = "Time: ".concat(new Date(i10).toString())); + }, [r10, o10, i10]; + } + var KA = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, JA, UA, Zo, { value: 2 }, WA), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function GA(e20) { + var t10 = e20.path, n10 = e20.value, r10 = e20.readOnly, o10 = e20.enforceString, i10 = e20.searchResultItems, a10 = e20.isEditing, s10 = e20.parser, c10 = e20.normalization, l10 = e20.onPatch, u10 = e20.onPasteJson, f10 = e20.onSelect, d10 = e20.onFind, h10 = e20.findNextInside, v10 = e20.focus, p10 = []; + return !a10 && /* @__PURE__ */ function(e21) { + return true === e21 || false === e21; + }(n10) && p10.push({ component: _M, props: { path: t10, value: n10, readOnly: r10, onPatch: l10, focus: v10 } }), !a10 && function(e21) { + return "string" == typeof e21 && e21.length < 99 && !!Xl(e21); + }(n10) && p10.push({ component: NM, props: { path: t10, value: n10, readOnly: r10, onPatch: l10, focus: v10 } }), a10 && p10.push({ component: rA, props: { path: t10, value: n10, enforceString: o10, parser: s10, normalization: c10, onPatch: l10, onPasteJson: u10, onSelect: f10, onFind: d10, findNextInside: h10, focus: v10 } }), a10 || p10.push({ component: zA, props: { path: t10, value: n10, readOnly: r10, parser: s10, normalization: c10, searchResultItems: i10, onSelect: f10 } }), !a10 && Yl(n10) && p10.push({ component: KA, props: { value: n10 } }), p10; + } + var QA = { prefix: "fas", iconName: "trash-can", icon: [448, 512, [61460, "trash-alt"], "f2ed", "M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"] }; + var YA = { prefix: "fas", iconName: "caret-right", icon: [256, 512, [], "f0da", "M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"] }; + var XA = { prefix: "fas", iconName: "paste", icon: [512, 512, ["file-clipboard"], "f0ea", "M160 0c-23.7 0-44.4 12.9-55.4 32H48C21.5 32 0 53.5 0 80V400c0 26.5 21.5 48 48 48H192V176c0-44.2 35.8-80 80-80h48V80c0-26.5-21.5-48-48-48H215.4C204.4 12.9 183.7 0 160 0zM272 128c-26.5 0-48 21.5-48 48V448v16c0 26.5 21.5 48 48 48H464c26.5 0 48-21.5 48-48V243.9c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1H320 272zM160 40a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"] }; + var ZA = { prefix: "fas", iconName: "circle-notch", icon: [512, 512, [], "f1ce", "M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z"] }; + var eP = { prefix: "fas", iconName: "scissors", icon: [512, 512, [9984, 9986, 9988, "cut"], "f0c4", "M256 192l-39.5-39.5c4.9-12.6 7.5-26.2 7.5-40.5C224 50.1 173.9 0 112 0S0 50.1 0 112s50.1 112 112 112c14.3 0 27.9-2.7 40.5-7.5L192 256l-39.5 39.5c-12.6-4.9-26.2-7.5-40.5-7.5C50.1 288 0 338.1 0 400s50.1 112 112 112s112-50.1 112-112c0-14.3-2.7-27.9-7.5-40.5L499.2 76.8c7.1-7.1 7.1-18.5 0-25.6c-28.3-28.3-74.1-28.3-102.4 0L256 192zm22.6 150.6L396.8 460.8c28.3 28.3 74.1 28.3 102.4 0c7.1-7.1 7.1-18.5 0-25.6L342.6 278.6l-64 64zM64 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm48 240a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"] }; + var tP = { prefix: "fas", iconName: "square-caret-down", icon: [448, 512, ["caret-square-down"], "f150", "M384 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"] }; + var nP = { prefix: "fas", iconName: "caret-left", icon: [256, 512, [], "f0d9", "M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z"] }; + var rP = { prefix: "fas", iconName: "pen-to-square", icon: [512, 512, ["edit"], "f044", "M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160V416c0 53 43 96 96 96H352c53 0 96-43 96-96V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96z"] }; + var oP = { prefix: "fas", iconName: "chevron-up", icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"] }; + var iP = { prefix: "fas", iconName: "angle-right", icon: [320, 512, [8250], "f105", "M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"] }; + var aP = { prefix: "fas", iconName: "square-caret-up", icon: [448, 512, ["caret-square-up"], "f151", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM224 160c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9s-12.5 14.4-22 14.4H120c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z"] }; + var sP = { prefix: "fas", iconName: "caret-up", icon: [320, 512, [], "f0d8", "M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H288c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"] }; + var cP = { prefix: "fas", iconName: "filter", icon: [512, 512, [], "f0b0", "M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"] }; + var lP = { prefix: "fas", iconName: "code", icon: [640, 512, [], "f121", "M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"] }; + var uP = { prefix: "fas", iconName: "wrench", icon: [512, 512, [128295], "f0ad", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7H336c-8.8 0-16-7.2-16-16V118.6c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"] }; + var fP = { prefix: "fas", iconName: "eye", icon: [576, 512, [128065], "f06e", "M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"] }; + var dP = { prefix: "fas", iconName: "pen", icon: [512, 512, [128394], "f304", "M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"] }; + var hP = { prefix: "fas", iconName: "arrow-rotate-right", icon: [512, 512, [8635, "arrow-right-rotate", "arrow-rotate-forward", "redo"], "f01e", "M386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H464c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"] }; + var vP = { prefix: "fas", iconName: "arrow-rotate-left", icon: [512, 512, [8634, "arrow-left-rotate", "arrow-rotate-back", "arrow-rotate-backward", "undo"], "f0e2", "M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"] }; + var pP = { prefix: "fas", iconName: "crop-simple", icon: [512, 512, ["crop-alt"], "f565", "M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32V64H32C14.3 64 0 78.3 0 96s14.3 32 32 32H64V384c0 35.3 28.7 64 64 64H352V384H128V32zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32V448h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H448l0-256c0-35.3-28.7-64-64-64L160 64v64l224 0 0 352z"] }; + var mP = { prefix: "fas", iconName: "gear", icon: [512, 512, [9881, "cog"], "f013", "M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"] }; + var gP = { prefix: "fas", iconName: "caret-down", icon: [320, 512, [], "f0d7", "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"] }; + var yP = { prefix: "fas", iconName: "ellipsis-vertical", icon: [128, 512, ["ellipsis-v"], "f142", "M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"] }; + var bP = { prefix: "fas", iconName: "arrow-right-arrow-left", icon: [448, 512, [8644, "exchange"], "f0ec", "M438.6 150.6c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.7 96 32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l306.7 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96zm-333.3 352c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 416 416 416c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96z"] }; + var kP = { prefix: "fas", iconName: "arrow-down-short-wide", icon: [576, 512, ["sort-amount-desc", "sort-amount-down-alt"], "f884", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32z"] }; + var wP = { prefix: "fas", iconName: "angle-down", icon: [448, 512, [8964], "f107", "M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"] }; + var xP = { prefix: "fas", iconName: "arrow-down", icon: [384, 512, [8595], "f063", "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"] }; + var jP = { prefix: "fas", iconName: "magnifying-glass", icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"] }; + var SP = { prefix: "fas", iconName: "chevron-down", icon: [512, 512, [], "f078", "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"] }; + var CP = { prefix: "fas", iconName: "copy", icon: [448, 512, [], "f0c5", "M208 0H332.1c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9V336c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V48c0-26.5 21.5-48 48-48zM48 128h80v64H64V448H256V416h64v48c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V176c0-26.5 21.5-48 48-48z"] }; + var $P = { prefix: "fas", iconName: "plus", icon: [448, 512, [10133, 61543, "add"], "2b", "M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"] }; + var _P = { prefix: "fas", iconName: "xmark", icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"] }; + var OP = _P; + var MP = _P; + var EP = { prefix: "fas", iconName: "rotate", icon: [512, 512, [128260, "sync-alt"], "f2f1", "M142.9 142.9c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5c0 0 0 0 0 0H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5c7.7-21.8 20.2-42.3 37.8-59.8zM16 312v7.6 .7V440c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l41.6-41.6c87.6 86.5 228.7 86.2 315.8-1c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.2 62.2-162.7 62.5-225.3 1L185 329c6.9-6.9 8.9-17.2 5.2-26.2s-12.5-14.8-22.2-14.8H48.4h-.7H40c-13.3 0-24 10.7-24 24z"] }; + var AP = { prefix: "fas", iconName: "clone", icon: [512, 512, [], "f24d", "M288 448H64V224h64V160H64c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H288c35.3 0 64-28.7 64-64V384H288v64zm-64-96H448c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H224c-35.3 0-64 28.7-64 64V288c0 35.3 28.7 64 64 64z"] }; + var PP = { prefix: "fas", iconName: "check", icon: [448, 512, [10003, 10004], "f00c", "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"] }; + var TP = { prefix: "fas", iconName: "triangle-exclamation", icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"] }; + var RP = {}; + var NP = { showWizard: true, showOriginal: true }; + var IP = Math.min; + var DP = Math.max; + var qP = Math.round; + var zP = Math.floor; + var BP = function(e20) { + return { x: e20, y: e20 }; + }; + var LP = { left: "right", right: "left", bottom: "top", top: "bottom" }; + var FP = { start: "end", end: "start" }; + function VP(e20, t10, n10) { + return DP(e20, IP(t10, n10)); + } + function HP(e20, t10) { + return "function" == typeof e20 ? e20(t10) : e20; + } + function WP(e20) { + return e20.split("-")[0]; + } + function UP(e20) { + return e20.split("-")[1]; + } + function JP(e20) { + return "x" === e20 ? "y" : "x"; + } + function KP(e20) { + return "y" === e20 ? "height" : "width"; + } + function GP(e20) { + return ["top", "bottom"].includes(WP(e20)) ? "y" : "x"; + } + function QP(e20) { + return JP(GP(e20)); + } + function YP(e20, t10, n10) { + void 0 === n10 && (n10 = false); + var r10 = UP(e20), o10 = QP(e20), i10 = KP(o10), a10 = "x" === o10 ? r10 === (n10 ? "end" : "start") ? "right" : "left" : "start" === r10 ? "bottom" : "top"; + return t10.reference[i10] > t10.floating[i10] && (a10 = tT(a10)), [a10, tT(a10)]; + } + function XP(e20) { + var t10 = tT(e20); + return [ZP(e20), t10, ZP(t10)]; + } + function ZP(e20) { + return e20.replace(/start|end/g, function(e21) { + return FP[e21]; + }); + } + function eT(e20, t10, n10, r10) { + var o10 = UP(e20), i10 = function(e21, t11, n11) { + var r11 = ["left", "right"], o11 = ["right", "left"]; + switch (e21) { + case "top": + case "bottom": + return n11 ? t11 ? o11 : r11 : t11 ? r11 : o11; + case "left": + case "right": + return t11 ? ["top", "bottom"] : ["bottom", "top"]; + default: + return []; + } + }(WP(e20), "start" === n10, r10); + return o10 && (i10 = i10.map(function(e21) { + return e21 + "-" + o10; + }), t10 && (i10 = i10.concat(i10.map(ZP)))), i10; + } + function tT(e20) { + return e20.replace(/left|right|bottom|top/g, function(e21) { + return LP[e21]; + }); + } + function nT(e20) { + return "number" != typeof e20 ? function(e21) { + return Ro({ top: 0, right: 0, bottom: 0, left: 0 }, e21); + }(e20) : { top: e20, right: e20, bottom: e20, left: e20 }; + } + function rT(e20) { + return Ro(Ro({}, e20), {}, { top: e20.y, left: e20.x, right: e20.x + e20.width, bottom: e20.y + e20.height }); + } + function oT(e20, t10, n10) { + var r10, o10 = e20.reference, i10 = e20.floating, a10 = GP(t10), s10 = QP(t10), c10 = KP(s10), l10 = WP(t10), u10 = "y" === a10, f10 = o10.x + o10.width / 2 - i10.width / 2, d10 = o10.y + o10.height / 2 - i10.height / 2, h10 = o10[c10] / 2 - i10[c10] / 2; + switch (l10) { + case "top": + r10 = { x: f10, y: o10.y - i10.height }; + break; + case "bottom": + r10 = { x: f10, y: o10.y + o10.height }; + break; + case "right": + r10 = { x: o10.x + o10.width, y: d10 }; + break; + case "left": + r10 = { x: o10.x - i10.width, y: d10 }; + break; + default: + r10 = { x: o10.x, y: o10.y }; + } + switch (UP(t10)) { + case "start": + r10[s10] -= h10 * (n10 && u10 ? -1 : 1); + break; + case "end": + r10[s10] += h10 * (n10 && u10 ? -1 : 1); + } + return r10; + } + var iT = function() { + var e20 = xo(ko().mark(function e21(t10, n10, r10) { + var o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return o10 = r10.placement, i10 = void 0 === o10 ? "bottom" : o10, a10 = r10.strategy, s10 = void 0 === a10 ? "absolute" : a10, c10 = r10.middleware, l10 = void 0 === c10 ? [] : c10, u10 = r10.platform, f10 = l10.filter(Boolean), e23.next = 4, null == u10.isRTL ? void 0 : u10.isRTL(n10); + case 4: + return d10 = e23.sent, e23.next = 7, u10.getElementRects({ reference: t10, floating: n10, strategy: s10 }); + case 7: + h10 = e23.sent, v10 = oT(h10, i10, d10), p10 = v10.x, m10 = v10.y, g10 = i10, y10 = {}, b10 = 0, k10 = 0; + case 13: + if (!(k10 < f10.length)) { + e23.next = 46; + break; + } + return w10 = f10[k10], x10 = w10.name, j10 = w10.fn, e23.next = 17, j10({ x: p10, y: m10, initialPlacement: i10, placement: g10, strategy: s10, middlewareData: y10, rects: h10, platform: u10, elements: { reference: t10, floating: n10 } }); + case 17: + if (S10 = e23.sent, C10 = S10.x, $10 = S10.y, _10 = S10.data, O10 = S10.reset, p10 = null != C10 ? C10 : p10, m10 = null != $10 ? $10 : m10, y10 = Ro(Ro({}, y10), {}, qo({}, x10, Ro(Ro({}, y10[x10]), _10))), !(O10 && b10 <= 50)) { + e23.next = 43; + break; + } + if (b10++, "object" !== Ho(O10)) { + e23.next = 41; + break; + } + if (O10.placement && (g10 = O10.placement), !O10.rects) { + e23.next = 38; + break; + } + if (true !== O10.rects) { + e23.next = 36; + break; + } + return e23.next = 33, u10.getElementRects({ reference: t10, floating: n10, strategy: s10 }); + case 33: + e23.t0 = e23.sent, e23.next = 37; + break; + case 36: + e23.t0 = O10.rects; + case 37: + h10 = e23.t0; + case 38: + M10 = oT(h10, g10, d10), p10 = M10.x, m10 = M10.y; + case 41: + return k10 = -1, e23.abrupt("continue", 43); + case 43: + k10++, e23.next = 13; + break; + case 46: + return e23.abrupt("return", { x: p10, y: m10, placement: g10, strategy: s10, middlewareData: y10 }); + case 47: + case "end": + return e23.stop(); + } + }, e21); + })); + return function(t10, n10, r10) { + return e20.apply(this, arguments); + }; + }(); + function aT(e20, t10) { + return sT.apply(this, arguments); + } + function sT() { + return sT = xo(ko().mark(function e20(t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + return void 0 === n10 && (n10 = {}), o10 = t10.x, i10 = t10.y, a10 = t10.platform, s10 = t10.rects, c10 = t10.elements, l10 = t10.strategy, u10 = HP(n10, t10), f10 = u10.boundary, d10 = void 0 === f10 ? "clippingAncestors" : f10, h10 = u10.rootBoundary, v10 = void 0 === h10 ? "viewport" : h10, p10 = u10.elementContext, m10 = void 0 === p10 ? "floating" : p10, g10 = u10.altBoundary, y10 = void 0 !== g10 && g10, b10 = u10.padding, k10 = nT(void 0 === b10 ? 0 : b10), w10 = "floating" === m10 ? "reference" : "floating", x10 = c10[y10 ? w10 : m10], e21.t0 = rT, e21.t1 = a10, e21.next = 10, null == a10.isElement ? void 0 : a10.isElement(x10); + case 10: + if (e21.t2 = r10 = e21.sent, null == e21.t2) { + e21.next = 15; + break; + } + e21.t3 = r10, e21.next = 16; + break; + case 15: + e21.t3 = true; + case 16: + if (!e21.t3) { + e21.next = 20; + break; + } + e21.t4 = x10, e21.next = 26; + break; + case 20: + if (e21.t5 = x10.contextElement, e21.t5) { + e21.next = 25; + break; + } + return e21.next = 24, null == a10.getDocumentElement ? void 0 : a10.getDocumentElement(c10.floating); + case 24: + e21.t5 = e21.sent; + case 25: + e21.t4 = e21.t5; + case 26: + return e21.t6 = e21.t4, e21.t7 = d10, e21.t8 = v10, e21.t9 = l10, e21.t10 = { element: e21.t6, boundary: e21.t7, rootBoundary: e21.t8, strategy: e21.t9 }, e21.next = 33, e21.t1.getClippingRect.call(e21.t1, e21.t10); + case 33: + return e21.t11 = e21.sent, j10 = (0, e21.t0)(e21.t11), S10 = "floating" === m10 ? Ro(Ro({}, s10.floating), {}, { x: o10, y: i10 }) : s10.reference, e21.next = 38, null == a10.getOffsetParent ? void 0 : a10.getOffsetParent(c10.floating); + case 38: + return C10 = e21.sent, e21.next = 41, null == a10.isElement ? void 0 : a10.isElement(C10); + case 41: + if (!e21.sent) { + e21.next = 50; + break; + } + return e21.next = 44, null == a10.getScale ? void 0 : a10.getScale(C10); + case 44: + if (e21.t13 = e21.sent, e21.t13) { + e21.next = 47; + break; + } + e21.t13 = { x: 1, y: 1 }; + case 47: + e21.t12 = e21.t13, e21.next = 51; + break; + case 50: + e21.t12 = { x: 1, y: 1 }; + case 51: + if ($10 = e21.t12, e21.t14 = rT, !a10.convertOffsetParentRelativeRectToViewportRelativeRect) { + e21.next = 59; + break; + } + return e21.next = 56, a10.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: S10, offsetParent: C10, strategy: l10 }); + case 56: + e21.t15 = e21.sent, e21.next = 60; + break; + case 59: + e21.t15 = S10; + case 60: + return e21.t16 = e21.t15, _10 = (0, e21.t14)(e21.t16), e21.abrupt("return", { top: (j10.top - _10.top + k10.top) / $10.y, bottom: (_10.bottom - j10.bottom + k10.bottom) / $10.y, left: (j10.left - _10.left + k10.left) / $10.x, right: (_10.right - j10.right + k10.right) / $10.x }); + case 63: + case "end": + return e21.stop(); + } + }, e20); + })), sT.apply(this, arguments); + } + function cT(e20, t10) { + return lT.apply(this, arguments); + } + function lT() { + return lT = xo(ko().mark(function e20(t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + return r10 = t10.placement, o10 = t10.platform, i10 = t10.elements, e21.next = 3, null == o10.isRTL ? void 0 : o10.isRTL(i10.floating); + case 3: + return a10 = e21.sent, s10 = WP(r10), c10 = UP(r10), l10 = "y" === GP(r10), u10 = ["left", "top"].includes(s10) ? -1 : 1, f10 = a10 && l10 ? -1 : 1, d10 = HP(n10, t10), h10 = "number" == typeof d10 ? { mainAxis: d10, crossAxis: 0, alignmentAxis: null } : Ro({ mainAxis: 0, crossAxis: 0, alignmentAxis: null }, d10), v10 = h10.mainAxis, p10 = h10.crossAxis, m10 = h10.alignmentAxis, c10 && "number" == typeof m10 && (p10 = "end" === c10 ? -1 * m10 : m10), e21.abrupt("return", l10 ? { x: p10 * f10, y: v10 * u10 } : { x: v10 * u10, y: p10 * f10 }); + case 13: + case "end": + return e21.stop(); + } + }, e20); + })), lT.apply(this, arguments); + } + function uT(e20) { + return hT(e20) ? (e20.nodeName || "").toLowerCase() : "#document"; + } + function fT(e20) { + var t10; + return (null == e20 || null == (t10 = e20.ownerDocument) ? void 0 : t10.defaultView) || window; + } + function dT(e20) { + var t10; + return null == (t10 = (hT(e20) ? e20.ownerDocument : e20.document) || window.document) ? void 0 : t10.documentElement; + } + function hT(e20) { + return e20 instanceof Node || e20 instanceof fT(e20).Node; + } + function vT(e20) { + return e20 instanceof Element || e20 instanceof fT(e20).Element; + } + function pT(e20) { + return e20 instanceof HTMLElement || e20 instanceof fT(e20).HTMLElement; + } + function mT(e20) { + return "undefined" != typeof ShadowRoot && (e20 instanceof ShadowRoot || e20 instanceof fT(e20).ShadowRoot); + } + function gT(e20) { + var t10 = xT(e20), n10 = t10.overflow, r10 = t10.overflowX, o10 = t10.overflowY, i10 = t10.display; + return /auto|scroll|overlay|hidden|clip/.test(n10 + o10 + r10) && !["inline", "contents"].includes(i10); + } + function yT(e20) { + return ["table", "td", "th"].includes(uT(e20)); + } + function bT(e20) { + var t10 = kT(), n10 = xT(e20); + return "none" !== n10.transform || "none" !== n10.perspective || !!n10.containerType && "normal" !== n10.containerType || !t10 && !!n10.backdropFilter && "none" !== n10.backdropFilter || !t10 && !!n10.filter && "none" !== n10.filter || ["transform", "perspective", "filter"].some(function(e21) { + return (n10.willChange || "").includes(e21); + }) || ["paint", "layout", "strict", "content"].some(function(e21) { + return (n10.contain || "").includes(e21); + }); + } + function kT() { + return !("undefined" == typeof CSS || !CSS.supports) && CSS.supports("-webkit-backdrop-filter", "none"); + } + function wT(e20) { + return ["html", "body", "#document"].includes(uT(e20)); + } + function xT(e20) { + return fT(e20).getComputedStyle(e20); + } + function jT(e20) { + return vT(e20) ? { scrollLeft: e20.scrollLeft, scrollTop: e20.scrollTop } : { scrollLeft: e20.pageXOffset, scrollTop: e20.pageYOffset }; + } + function ST(e20) { + if ("html" === uT(e20)) + return e20; + var t10 = e20.assignedSlot || e20.parentNode || mT(e20) && e20.host || dT(e20); + return mT(t10) ? t10.host : t10; + } + function CT(e20) { + var t10 = ST(e20); + return wT(t10) ? e20.ownerDocument ? e20.ownerDocument.body : e20.body : pT(t10) && gT(t10) ? t10 : CT(t10); + } + function $T(e20, t10, n10) { + var r10; + void 0 === t10 && (t10 = []), void 0 === n10 && (n10 = true); + var o10 = CT(e20), i10 = o10 === (null == (r10 = e20.ownerDocument) ? void 0 : r10.body), a10 = fT(o10); + return i10 ? t10.concat(a10, a10.visualViewport || [], gT(o10) ? o10 : [], a10.frameElement && n10 ? $T(a10.frameElement) : []) : t10.concat(o10, $T(o10, [], n10)); + } + function _T(e20) { + var t10 = xT(e20), n10 = parseFloat(t10.width) || 0, r10 = parseFloat(t10.height) || 0, o10 = pT(e20), i10 = o10 ? e20.offsetWidth : n10, a10 = o10 ? e20.offsetHeight : r10, s10 = qP(n10) !== i10 || qP(r10) !== a10; + return s10 && (n10 = i10, r10 = a10), { width: n10, height: r10, $: s10 }; + } + function OT(e20) { + return vT(e20) ? e20 : e20.contextElement; + } + function MT(e20) { + var t10 = OT(e20); + if (!pT(t10)) + return BP(1); + var n10 = t10.getBoundingClientRect(), r10 = _T(t10), o10 = r10.width, i10 = r10.height, a10 = r10.$, s10 = (a10 ? qP(n10.width) : n10.width) / o10, c10 = (a10 ? qP(n10.height) : n10.height) / i10; + return s10 && Number.isFinite(s10) || (s10 = 1), c10 && Number.isFinite(c10) || (c10 = 1), { x: s10, y: c10 }; + } + var ET = BP(0); + function AT(e20) { + var t10 = fT(e20); + return kT() && t10.visualViewport ? { x: t10.visualViewport.offsetLeft, y: t10.visualViewport.offsetTop } : ET; + } + function PT(e20, t10, n10, r10) { + void 0 === t10 && (t10 = false), void 0 === n10 && (n10 = false); + var o10 = e20.getBoundingClientRect(), i10 = OT(e20), a10 = BP(1); + t10 && (r10 ? vT(r10) && (a10 = MT(r10)) : a10 = MT(e20)); + var s10 = function(e21, t11, n11) { + return void 0 === t11 && (t11 = false), !(!n11 || t11 && n11 !== fT(e21)) && t11; + }(i10, n10, r10) ? AT(i10) : BP(0), c10 = (o10.left + s10.x) / a10.x, l10 = (o10.top + s10.y) / a10.y, u10 = o10.width / a10.x, f10 = o10.height / a10.y; + if (i10) + for (var d10 = fT(i10), h10 = r10 && vT(r10) ? fT(r10) : r10, v10 = d10.frameElement; v10 && r10 && h10 !== d10; ) { + var p10 = MT(v10), m10 = v10.getBoundingClientRect(), g10 = xT(v10), y10 = m10.left + (v10.clientLeft + parseFloat(g10.paddingLeft)) * p10.x, b10 = m10.top + (v10.clientTop + parseFloat(g10.paddingTop)) * p10.y; + c10 *= p10.x, l10 *= p10.y, u10 *= p10.x, f10 *= p10.y, c10 += y10, l10 += b10, v10 = fT(v10).frameElement; + } + return rT({ width: u10, height: f10, x: c10, y: l10 }); + } + function TT(e20) { + return PT(dT(e20)).left + jT(e20).scrollLeft; + } + function RT(e20, t10, n10) { + var r10; + if ("viewport" === t10) + r10 = function(e21, t11) { + var n11 = fT(e21), r11 = dT(e21), o11 = n11.visualViewport, i10 = r11.clientWidth, a10 = r11.clientHeight, s10 = 0, c10 = 0; + if (o11) { + i10 = o11.width, a10 = o11.height; + var l10 = kT(); + (!l10 || l10 && "fixed" === t11) && (s10 = o11.offsetLeft, c10 = o11.offsetTop); + } + return { width: i10, height: a10, x: s10, y: c10 }; + }(e20, n10); + else if ("document" === t10) + r10 = function(e21) { + var t11 = dT(e21), n11 = jT(e21), r11 = e21.ownerDocument.body, o11 = DP(t11.scrollWidth, t11.clientWidth, r11.scrollWidth, r11.clientWidth), i10 = DP(t11.scrollHeight, t11.clientHeight, r11.scrollHeight, r11.clientHeight), a10 = -n11.scrollLeft + TT(e21), s10 = -n11.scrollTop; + return "rtl" === xT(r11).direction && (a10 += DP(t11.clientWidth, r11.clientWidth) - o11), { width: o11, height: i10, x: a10, y: s10 }; + }(dT(e20)); + else if (vT(t10)) + r10 = function(e21, t11) { + var n11 = PT(e21, true, "fixed" === t11), r11 = n11.top + e21.clientTop, o11 = n11.left + e21.clientLeft, i10 = pT(e21) ? MT(e21) : BP(1); + return { width: e21.clientWidth * i10.x, height: e21.clientHeight * i10.y, x: o11 * i10.x, y: r11 * i10.y }; + }(t10, n10); + else { + var o10 = AT(e20); + r10 = Ro(Ro({}, t10), {}, { x: t10.x - o10.x, y: t10.y - o10.y }); + } + return rT(r10); + } + function NT(e20, t10) { + var n10 = ST(e20); + return !(n10 === t10 || !vT(n10) || wT(n10)) && ("fixed" === xT(n10).position || NT(n10, t10)); + } + function IT(e20, t10, n10) { + var r10 = pT(t10), o10 = dT(t10), i10 = "fixed" === n10, a10 = PT(e20, true, i10, t10), s10 = { scrollLeft: 0, scrollTop: 0 }, c10 = BP(0); + if (r10 || !r10 && !i10) + if (("body" !== uT(t10) || gT(o10)) && (s10 = jT(t10)), r10) { + var l10 = PT(t10, true, i10, t10); + c10.x = l10.x + t10.clientLeft, c10.y = l10.y + t10.clientTop; + } else + o10 && (c10.x = TT(o10)); + return { x: a10.left + s10.scrollLeft - c10.x, y: a10.top + s10.scrollTop - c10.y, width: a10.width, height: a10.height }; + } + function DT(e20, t10) { + return pT(e20) && "fixed" !== xT(e20).position ? t10 ? t10(e20) : e20.offsetParent : null; + } + function qT(e20, t10) { + var n10 = fT(e20); + if (!pT(e20)) + return n10; + for (var r10 = DT(e20, t10); r10 && yT(r10) && "static" === xT(r10).position; ) + r10 = DT(r10, t10); + return r10 && ("html" === uT(r10) || "body" === uT(r10) && "static" === xT(r10).position && !bT(r10)) ? n10 : r10 || function(e21) { + for (var t11 = ST(e21); pT(t11) && !wT(t11); ) { + if (bT(t11)) + return t11; + t11 = ST(t11); + } + return null; + }(e20) || n10; + } + var zT = { convertOffsetParentRelativeRectToViewportRelativeRect: function(e20) { + var t10 = e20.rect, n10 = e20.offsetParent, r10 = e20.strategy, o10 = pT(n10), i10 = dT(n10); + if (n10 === i10) + return t10; + var a10 = { scrollLeft: 0, scrollTop: 0 }, s10 = BP(1), c10 = BP(0); + if ((o10 || !o10 && "fixed" !== r10) && (("body" !== uT(n10) || gT(i10)) && (a10 = jT(n10)), pT(n10))) { + var l10 = PT(n10); + s10 = MT(n10), c10.x = l10.x + n10.clientLeft, c10.y = l10.y + n10.clientTop; + } + return { width: t10.width * s10.x, height: t10.height * s10.y, x: t10.x * s10.x - a10.scrollLeft * s10.x + c10.x, y: t10.y * s10.y - a10.scrollTop * s10.y + c10.y }; + }, getDocumentElement: dT, getClippingRect: function(e20) { + var t10 = e20.element, n10 = e20.boundary, r10 = e20.rootBoundary, o10 = e20.strategy, i10 = "clippingAncestors" === n10 ? function(e21, t11) { + var n11 = t11.get(e21); + if (n11) + return n11; + for (var r11 = $T(e21, [], false).filter(function(e23) { + return vT(e23) && "body" !== uT(e23); + }), o11 = null, i11 = "fixed" === xT(e21).position, a11 = i11 ? ST(e21) : e21; vT(a11) && !wT(a11); ) { + var s11 = xT(a11), c11 = bT(a11); + c11 || "fixed" !== s11.position || (o11 = null), (i11 ? !c11 && !o11 : !c11 && "static" === s11.position && o11 && ["absolute", "fixed"].includes(o11.position) || gT(a11) && !c11 && NT(e21, a11)) ? r11 = r11.filter(function(e23) { + return e23 !== a11; + }) : o11 = s11, a11 = ST(a11); + } + return t11.set(e21, r11), r11; + }(t10, this._c) : [].concat(n10), a10 = [].concat(Bo(i10), [r10]), s10 = a10[0], c10 = a10.reduce(function(e21, n11) { + var r11 = RT(t10, n11, o10); + return e21.top = DP(r11.top, e21.top), e21.right = IP(r11.right, e21.right), e21.bottom = IP(r11.bottom, e21.bottom), e21.left = DP(r11.left, e21.left), e21; + }, RT(t10, s10, o10)); + return { width: c10.right - c10.left, height: c10.bottom - c10.top, x: c10.left, y: c10.top }; + }, getOffsetParent: qT, getElementRects: function() { + var e20 = xo(ko().mark(function e21(t10) { + var n10, r10, o10, i10, a10; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return n10 = t10.reference, r10 = t10.floating, o10 = t10.strategy, i10 = this.getOffsetParent || qT, a10 = this.getDimensions, e23.t0 = IT, e23.t1 = n10, e23.next = 7, i10(r10); + case 7: + return e23.t2 = e23.sent, e23.t3 = o10, e23.t4 = (0, e23.t0)(e23.t1, e23.t2, e23.t3), e23.t5 = Ro, e23.t6 = { x: 0, y: 0 }, e23.next = 14, a10(r10); + case 14: + return e23.t7 = e23.sent, e23.t8 = (0, e23.t5)(e23.t6, e23.t7), e23.abrupt("return", { reference: e23.t4, floating: e23.t8 }); + case 17: + case "end": + return e23.stop(); + } + }, e21, this); + })); + return function(t10) { + return e20.apply(this, arguments); + }; + }(), getClientRects: function(e20) { + return Array.from(e20.getClientRects()); + }, getDimensions: function(e20) { + var t10 = _T(e20); + return { width: t10.width, height: t10.height }; + }, getScale: MT, isElement: vT, isRTL: function(e20) { + return "rtl" === xT(e20).direction; + } }; + function BT(e20, t10, n10, r10) { + void 0 === r10 && (r10 = {}); + var o10 = r10, i10 = o10.ancestorScroll, a10 = void 0 === i10 || i10, s10 = o10.ancestorResize, c10 = void 0 === s10 || s10, l10 = o10.elementResize, u10 = void 0 === l10 ? "function" == typeof ResizeObserver : l10, f10 = o10.layoutShift, d10 = void 0 === f10 ? "function" == typeof IntersectionObserver : f10, h10 = o10.animationFrame, v10 = void 0 !== h10 && h10, p10 = OT(e20), m10 = a10 || c10 ? [].concat(Bo(p10 ? $T(p10) : []), Bo($T(t10))) : []; + m10.forEach(function(e21) { + a10 && e21.addEventListener("scroll", n10, { passive: true }), c10 && e21.addEventListener("resize", n10); + }); + var g10, y10 = p10 && d10 ? function(e21, t11) { + var n11, r11 = null, o11 = dT(e21); + function i11() { + clearTimeout(n11), r11 && r11.disconnect(), r11 = null; + } + return function a11(s11, c11) { + void 0 === s11 && (s11 = false), void 0 === c11 && (c11 = 1), i11(); + var l11 = e21.getBoundingClientRect(), u11 = l11.left, f11 = l11.top, d11 = l11.width, h11 = l11.height; + if (s11 || t11(), d11 && h11) { + var v11 = { rootMargin: -zP(f11) + "px " + -zP(o11.clientWidth - (u11 + d11)) + "px " + -zP(o11.clientHeight - (f11 + h11)) + "px " + -zP(u11) + "px", threshold: DP(0, IP(1, c11)) || 1 }, p11 = true; + try { + r11 = new IntersectionObserver(m11, Ro(Ro({}, v11), {}, { root: o11.ownerDocument })); + } catch (e23) { + r11 = new IntersectionObserver(m11, v11); + } + r11.observe(e21); + } + function m11(e23) { + var t12 = e23[0].intersectionRatio; + if (t12 !== c11) { + if (!p11) + return a11(); + t12 ? a11(false, t12) : n11 = setTimeout(function() { + a11(false, 1e-7); + }, 100); + } + p11 = false; + } + }(true), i11; + }(p10, n10) : null, b10 = -1, k10 = null; + u10 && (k10 = new ResizeObserver(function(e21) { + var r11 = jo(e21, 1)[0]; + r11 && r11.target === p10 && k10 && (k10.unobserve(t10), cancelAnimationFrame(b10), b10 = requestAnimationFrame(function() { + k10 && k10.observe(t10); + })), n10(); + }), p10 && !v10 && k10.observe(p10), k10.observe(t10)); + var w10 = v10 ? PT(e20) : null; + return v10 && function t11() { + var r11 = PT(e20); + !w10 || r11.x === w10.x && r11.y === w10.y && r11.width === w10.width && r11.height === w10.height || n10(); + w10 = r11, g10 = requestAnimationFrame(t11); + }(), n10(), function() { + m10.forEach(function(e21) { + a10 && e21.removeEventListener("scroll", n10), c10 && e21.removeEventListener("resize", n10); + }), y10 && y10(), k10 && k10.disconnect(), k10 = null, v10 && cancelAnimationFrame(g10); + }; + } + var LT = function(e20) { + return void 0 === e20 && (e20 = {}), { name: "shift", options: e20, fn: function(t10) { + return xo(ko().mark(function n10() { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10; + return ko().wrap(function(n11) { + for (; ; ) + switch (n11.prev = n11.next) { + case 0: + return r10 = t10.x, o10 = t10.y, i10 = t10.placement, a10 = HP(e20, t10), s10 = a10.mainAxis, c10 = void 0 === s10 || s10, l10 = a10.crossAxis, u10 = void 0 !== l10 && l10, f10 = a10.limiter, d10 = void 0 === f10 ? { fn: function(e21) { + return { x: e21.x, y: e21.y }; + } } : f10, h10 = yo(a10, po), v10 = { x: r10, y: o10 }, n11.next = 5, aT(t10, h10); + case 5: + return p10 = n11.sent, m10 = GP(WP(i10)), g10 = JP(m10), y10 = v10[g10], b10 = v10[m10], c10 && (k10 = "y" === g10 ? "bottom" : "right", w10 = y10 + p10["y" === g10 ? "top" : "left"], x10 = y10 - p10[k10], y10 = VP(w10, y10, x10)), u10 && (j10 = "y" === m10 ? "bottom" : "right", S10 = b10 + p10["y" === m10 ? "top" : "left"], C10 = b10 - p10[j10], b10 = VP(S10, b10, C10)), $10 = d10.fn(Ro(Ro({}, t10), {}, qo(qo({}, g10, y10), m10, b10))), n11.abrupt("return", Ro(Ro({}, $10), {}, { data: { x: $10.x - r10, y: $10.y - o10 } })); + case 14: + case "end": + return n11.stop(); + } + }, n10); + }))(); + } }; + }; + var FT = function(e20) { + return void 0 === e20 && (e20 = {}), { name: "flip", options: e20, fn: function(t10) { + return xo(ko().mark(function n10() { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10, E10, A10, P10, T8, R8, N8, I10, D10, q10, z10; + return ko().wrap(function(n11) { + for (; ; ) + switch (n11.prev = n11.next) { + case 0: + if (i10 = t10.placement, a10 = t10.middlewareData, s10 = t10.rects, c10 = t10.initialPlacement, l10 = t10.platform, u10 = t10.elements, f10 = HP(e20, t10), d10 = f10.mainAxis, h10 = void 0 === d10 || d10, v10 = f10.crossAxis, p10 = void 0 === v10 || v10, m10 = f10.fallbackPlacements, g10 = f10.fallbackStrategy, y10 = void 0 === g10 ? "bestFit" : g10, b10 = f10.fallbackAxisSideDirection, k10 = void 0 === b10 ? "none" : b10, w10 = f10.flipAlignment, x10 = void 0 === w10 || w10, j10 = yo(f10, vo), null == (r10 = a10.arrow) || !r10.alignmentOffset) { + n11.next = 4; + break; + } + return n11.abrupt("return", {}); + case 4: + return S10 = WP(i10), C10 = WP(c10) === c10, n11.next = 8, null == l10.isRTL ? void 0 : l10.isRTL(u10.floating); + case 8: + return $10 = n11.sent, _10 = m10 || (C10 || !x10 ? [tT(c10)] : XP(c10)), m10 || "none" === k10 || _10.push.apply(_10, Bo(eT(c10, x10, k10, $10))), O10 = [c10].concat(Bo(_10)), n11.next = 14, aT(t10, j10); + case 14: + if (M10 = n11.sent, E10 = [], A10 = (null == (o10 = a10.flip) ? void 0 : o10.overflows) || [], h10 && E10.push(M10[S10]), p10 && (P10 = YP(i10, s10, $10), E10.push(M10[P10[0]], M10[P10[1]])), A10 = [].concat(Bo(A10), [{ placement: i10, overflows: E10 }]), E10.every(function(e21) { + return e21 <= 0; + })) { + n11.next = 37; + break; + } + if (N8 = ((null == (T8 = a10.flip) ? void 0 : T8.index) || 0) + 1, !(I10 = O10[N8])) { + n11.next = 25; + break; + } + return n11.abrupt("return", { data: { index: N8, overflows: A10 }, reset: { placement: I10 } }); + case 25: + if (D10 = null == (R8 = A10.filter(function(e21) { + return e21.overflows[0] <= 0; + }).sort(function(e21, t11) { + return e21.overflows[1] - t11.overflows[1]; + })[0]) ? void 0 : R8.placement) { + n11.next = 35; + break; + } + n11.t0 = y10, n11.next = "bestFit" === n11.t0 ? 30 : "initialPlacement" === n11.t0 ? 33 : 35; + break; + case 30: + return z10 = null == (q10 = A10.map(function(e21) { + return [e21.placement, e21.overflows.filter(function(e23) { + return e23 > 0; + }).reduce(function(e23, t11) { + return e23 + t11; + }, 0)]; + }).sort(function(e21, t11) { + return e21[1] - t11[1]; + })[0]) ? void 0 : q10[0], z10 && (D10 = z10), n11.abrupt("break", 35); + case 33: + return D10 = c10, n11.abrupt("break", 35); + case 35: + if (i10 === D10) { + n11.next = 37; + break; + } + return n11.abrupt("return", { reset: { placement: D10 } }); + case 37: + return n11.abrupt("return", {}); + case 38: + case "end": + return n11.stop(); + } + }, n10); + }))(); + } }; + }; + var VT = function(e20, t10, n10) { + var r10 = /* @__PURE__ */ new Map(), o10 = Ro({ platform: zT }, n10), i10 = Ro(Ro({}, o10.platform), {}, { _c: r10 }); + return iT(e20, t10, Ro(Ro({}, o10), {}, { platform: i10 })); + }; + function HT(e20) { + var t10 = e20.loadOptions, n10 = e20.filterText, r10 = e20.items, o10 = e20.multiple, i10 = e20.value, a10 = e20.itemId, s10 = e20.groupBy, c10 = e20.filterSelectedItems, l10 = e20.itemFilter, u10 = e20.convertStringItemsToObjects, f10 = e20.filterGroupedItems, d10 = e20.label; + if (r10 && t10) + return r10; + if (!r10) + return []; + r10 && r10.length > 0 && "object" !== Ho(r10[0]) && (r10 = u10(r10)); + var h10 = r10.filter(function(e21) { + var t11 = l10(e21[d10], n10, e21); + return t11 && o10 && null != i10 && i10.length && (t11 = !i10.some(function(t12) { + return !!c10 && t12[a10] === e21[a10]; + })), t11; + }); + return s10 && (h10 = f10(h10)), h10; + } + function WT(e20) { + return UT.apply(this, arguments); + } + function UT() { + return UT = xo(ko().mark(function e20(t10) { + var n10, r10, o10, i10, a10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + return n10 = t10.dispatch, r10 = t10.loadOptions, o10 = t10.convertStringItemsToObjects, i10 = t10.filterText, e21.next = 3, r10(i10).catch(function(e23) { + console.warn("svelte-select loadOptions error :>> ", e23), n10("error", { type: "loadOptions", details: e23 }); + }); + case 3: + if (!(a10 = e21.sent) || a10.cancelled) { + e21.next = 7; + break; + } + return a10 ? (a10 && a10.length > 0 && "object" !== Ho(a10[0]) && (a10 = o10(a10)), n10("loaded", { items: a10 })) : a10 = [], e21.abrupt("return", { filteredItems: a10, loading: false, focused: true, listOpen: true }); + case 7: + case "end": + return e21.stop(); + } + }, e20); + })), UT.apply(this, arguments); + } + function JT(e20) { + mi(e20, "svelte-qbd276", "svg.svelte-qbd276{width:var(--chevron-icon-width, 20px);height:var(--chevron-icon-width, 20px);color:var(--chevron-icon-colour, currentColor)}"); + } + function KT(e20) { + var t10, n10; + return { c: function() { + t10 = Si("svg"), Ai(n10 = Si("path"), "fill", "currentColor"), Ai(n10, "d", "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747\n 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0\n 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502\n 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0\n 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"), Ai(t10, "width", "100%"), Ai(t10, "height", "100%"), Ai(t10, "viewBox", "0 0 20 20"), Ai(t10, "focusable", "false"), Ai(t10, "aria-hidden", "true"), Ai(t10, "class", "svelte-qbd276"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + var GT = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, null, KT, Xo, {}, JT), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function QT(e20) { + mi(e20, "svelte-whdbu1", "svg.svelte-whdbu1{width:var(--clear-icon-width, 20px);height:var(--clear-icon-width, 20px);color:var(--clear-icon-color, currentColor)}"); + } + function YT(e20) { + var t10, n10; + return { c: function() { + t10 = Si("svg"), Ai(n10 = Si("path"), "fill", "currentColor"), Ai(n10, "d", "M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124\n l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z"), Ai(t10, "width", "100%"), Ai(t10, "height", "100%"), Ai(t10, "viewBox", "-2 -2 50 50"), Ai(t10, "focusable", "false"), Ai(t10, "aria-hidden", "true"), Ai(t10, "role", "presentation"), Ai(t10, "class", "svelte-whdbu1"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + var XT = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, null, YT, Xo, {}, QT), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function ZT(e20) { + mi(e20, "svelte-1p3nqvd", ".loading.svelte-1p3nqvd{width:var(--spinner-width, 20px);height:var(--spinner-height, 20px);color:var(--spinner-color, var(--icons-color));animation:svelte-1p3nqvd-rotate 0.75s linear infinite;transform-origin:center center;transform:none}.circle_path.svelte-1p3nqvd{stroke-dasharray:90;stroke-linecap:round}@keyframes svelte-1p3nqvd-rotate{100%{transform:rotate(360deg)}}"); + } + function eR(e20) { + var t10, n10; + return { c: function() { + t10 = Si("svg"), Ai(n10 = Si("circle"), "class", "circle_path svelte-1p3nqvd"), Ai(n10, "cx", "50"), Ai(n10, "cy", "50"), Ai(n10, "r", "20"), Ai(n10, "fill", "none"), Ai(n10, "stroke", "currentColor"), Ai(n10, "stroke-width", "5"), Ai(n10, "stroke-miterlimit", "10"), Ai(t10, "class", "loading svelte-1p3nqvd"), Ai(t10, "viewBox", "25 25 50 50"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + var tR = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, null, eR, Xo, {}, ZT), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function nR(e20) { + mi(e20, "svelte-82qwg8", ".svelte-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{--borderRadius:var(--border-radius);--clearSelectColor:var(--clear-select-color);--clearSelectWidth:var(--clear-select-width);--disabledBackground:var(--disabled-background);--disabledBorderColor:var(--disabled-border-color);--disabledColor:var(--disabled-color);--disabledPlaceholderColor:var(--disabled-placeholder-color);--disabledPlaceholderOpacity:var(--disabled-placeholder-opacity);--errorBackground:var(--error-background);--errorBorder:var(--error-border);--groupItemPaddingLeft:var(--group-item-padding-left);--groupTitleColor:var(--group-title-color);--groupTitleFontSize:var(--group-title-font-size);--groupTitleFontWeight:var(--group-title-font-weight);--groupTitlePadding:var(--group-title-padding);--groupTitleTextTransform:var(--group-title-text-transform);--groupTitleBorderColor:var(--group-title-border-color);--groupTitleBorderWidth:var(--group-title-border-width);--groupTitleBorderStyle:var(--group-title-border-style);--indicatorColor:var(--chevron-color);--indicatorHeight:var(--chevron-height);--indicatorWidth:var(--chevron-width);--inputColor:var(--input-color);--inputLeft:var(--input-left);--inputLetterSpacing:var(--input-letter-spacing);--inputMargin:var(--input-margin);--inputPadding:var(--input-padding);--itemActiveBackground:var(--item-active-background);--itemColor:var(--item-color);--itemFirstBorderRadius:var(--item-first-border-radius);--itemHoverBG:var(--item-hover-bg);--itemHoverColor:var(--item-hover-color);--itemIsActiveBG:var(--item-is-active-bg);--itemIsActiveColor:var(--item-is-active-color);--itemIsNotSelectableColor:var(--item-is-not-selectable-color);--itemPadding:var(--item-padding);--listBackground:var(--list-background);--listBorder:var(--list-border);--listBorderRadius:var(--list-border-radius);--listEmptyColor:var(--list-empty-color);--listEmptyPadding:var(--list-empty-padding);--listEmptyTextAlign:var(--list-empty-text-align);--listMaxHeight:var(--list-max-height);--listPosition:var(--list-position);--listShadow:var(--list-shadow);--listZIndex:var(--list-z-index);--multiItemBG:var(--multi-item-bg);--multiItemBorderRadius:var(--multi-item-border-radius);--multiItemDisabledHoverBg:var(--multi-item-disabled-hover-bg);--multiItemDisabledHoverColor:var(--multi-item-disabled-hover-color);--multiItemHeight:var(--multi-item-height);--multiItemMargin:var(--multi-item-margin);--multiItemPadding:var(--multi-item-padding);--multiSelectInputMargin:var(--multi-select-input-margin);--multiSelectInputPadding:var(--multi-select-input-padding);--multiSelectPadding:var(--multi-select-padding);--placeholderColor:var(--placeholder-color);--placeholderOpacity:var(--placeholder-opacity);--selectedItemPadding:var(--selected-item-padding);--spinnerColor:var(--spinner-color);--spinnerHeight:var(--spinner-height);--spinnerWidth:var(--spinner-width);--internal-padding:0 0 0 16px;border:var(--border, 1px solid #d8dbdf);border-radius:var(--border-radius, 6px);min-height:var(--height, 42px);position:relative;display:flex;align-items:stretch;padding:var(--padding, var(--internal-padding));background:var(--background, #fff);margin:var(--margin, 0);width:var(--width, 100%);font-size:var(--font-size, 16px);max-height:var(--max-height)}.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{box-sizing:var(--box-sizing, border-box)}.svelte-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:hover{border:var(--border-hover, 1px solid #b2b8bf)}.value-container.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;flex:1 1 0%;flex-wrap:wrap;align-items:center;gap:5px 10px;padding:var(--value-container-padding, 5px 0);position:relative;overflow:var(--value-container-overflow, hidden);align-self:stretch}.prepend.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.indicators.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;flex-shrink:0;align-items:center}.indicators.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:var(--indicators-position);top:var(--indicators-top);right:var(--indicators-right);bottom:var(--indicators-bottom)}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:absolute;cursor:default;border:none;color:var(--input-color, var(--item-color));padding:var(--input-padding, 0);letter-spacing:var(--input-letter-spacing, inherit);margin:var(--input-margin, 0);min-width:10px;top:0;right:0;bottom:0;left:0;background:transparent;font-size:var(--font-size, 16px)}.svelte-82qwg8:not(.multi)>.value-container.svelte-82qwg8>input.svelte-82qwg8{width:100%;height:100%}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8::placeholder{color:var(--placeholder-color, #78848f);opacity:var(--placeholder-opacity, 1)}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:none}.svelte-select.focused.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border:var(--border-focused, 1px solid #006fe8);border-radius:var(--border-radius-focused, var(--border-radius, 6px))}.disabled.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--disabled-background, #ebedef);border-color:var(--disabled-border-color, #ebedef);color:var(--disabled-color, #c1c6cc)}.disabled.svelte-82qwg8 input.svelte-82qwg8.svelte-82qwg8::placeholder{color:var(--disabled-placeholder-color, #c1c6cc);opacity:var(--disabled-placeholder-opacity, 1)}.selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:relative;overflow:var(--selected-item-overflow, hidden);padding:var(--selected-item-padding, 0 20px 0 0);text-overflow:ellipsis;white-space:nowrap;color:var(--selected-item-color, inherit);font-size:var(--font-size, 16px)}.multi.svelte-82qwg8 .selected-item.svelte-82qwg8.svelte-82qwg8{position:absolute;line-height:var(--height, 42px);height:var(--height, 42px)}.selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:none}.hide-selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0}.icon.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;align-items:center;justify-content:center}.clear-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{all:unset;display:flex;align-items:center;justify-content:center;width:var(--clear-select-width, 40px);height:var(--clear-select-height, 100%);color:var(--clear-select-color, var(--icons-color));margin:var(--clear-select-margin, 0);pointer-events:all;flex-shrink:0}.clear-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:var(--clear-select-focus-outline, 1px solid #006fe8)}.loading.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{width:var(--loading-width, 40px);height:var(--loading-height);color:var(--loading-color, var(--icons-color));margin:var(--loading--margin, 0);flex-shrink:0}.chevron.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{width:var(--chevron-width, 40px);height:var(--chevron-height, 40px);background:var(--chevron-background, transparent);pointer-events:var(--chevron-pointer-events, none);color:var(--chevron-color, var(--icons-color));border:var(--chevron-border, 0 0 0 1px solid #d8dbdf);flex-shrink:0}.multi.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{padding:var(--multi-select-padding, var(--internal-padding))}.multi.svelte-82qwg8 input.svelte-82qwg8.svelte-82qwg8{padding:var(--multi-select-input-padding, 0);position:relative;margin:var(--multi-select-input-margin, 5px 0);flex:1 1 40px}.svelte-select.error.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border:var(--error-border, 1px solid #ff2d55);background:var(--error-background, #fff)}.a11y-text.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{z-index:9999;border:0px;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0px;white-space:nowrap}.multi-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--multi-item-bg, #ebedef);margin:var(--multi-item-margin, 0);outline:var(--multi-item-outline, 1px solid #ddd);border-radius:var(--multi-item-border-radius, 4px);height:var(--multi-item-height, 25px);line-height:var(--multi-item-height, 25px);display:flex;cursor:default;padding:var(--multi-item-padding, 0 5px);overflow:hidden;gap:var(--multi-item-gap, 4px);outline-offset:-1px;max-width:var(--multi-max-width, none);color:var(--multi-item-color, var(--item-color))}.multi-item.disabled.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:hover{background:var(--multi-item-disabled-hover-bg, #ebedef);color:var(--multi-item-disabled-hover-color, #c1c6cc)}.multi-item-text.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multi-item-clear.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;align-items:center;justify-content:center;--clear-icon-color:var(--multi-item-clear-icon-color, #000)}.multi-item.active.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{outline:var(--multi-item-active-outline, 1px solid #006fe8)}.svelte-select-list.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{box-shadow:var(--list-shadow, 0 2px 3px 0 rgba(44, 62, 80, 0.24));border-radius:var(--list-border-radius, 4px);max-height:var(--list-max-height, 252px);overflow-y:auto;background:var(--list-background, #fff);position:var(--list-position, absolute);z-index:var(--list-z-index, 2);border:var(--list-border)}.prefloat.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0;pointer-events:none}.list-group-title.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{color:var(--group-title-color, #8f8f8f);cursor:default;font-size:var(--group-title-font-size, 16px);font-weight:var(--group-title-font-weight, 600);height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--group-title-padding, 0 20px);text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:var(--group-title-text-transform, uppercase);border-width:var(--group-title-border-width, medium);border-style:var(--group-title-border-style, none);border-color:var(--group-title-border-color, color)}.empty.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{text-align:var(--list-empty-text-align, center);padding:var(--list-empty-padding, 20px 0);color:var(--list-empty-color, #78848f)}.item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{cursor:default;height:var(--item-height, var(--height, 42px));line-height:var(--item-line-height, var(--height, 42px));padding:var(--item-padding, 0 20px);color:var(--item-color, inherit);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:var(--item-transition, all 0.2s);align-items:center;width:100%}.item.group-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{padding-left:var(--group-item-padding-left, 40px)}.item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:active{background:var(--item-active-background, #b9daff)}.item.active.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--item-is-active-bg, #007aff);color:var(--item-is-active-color, #fff)}.item.first.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border-radius:var(--item-first-border-radius, 4px 4px 0 0)}.item.hover.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:not(.active){background:var(--item-hover-bg, #e7f2ff);color:var(--item-hover-color, inherit)}.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.hover.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.active.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:active{color:var(--item-is-not-selectable-color, #999);background:transparent}.required.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0;z-index:-1;position:absolute;top:0;left:0;bottom:0;right:0}"); + } + var rR = function(e20) { + return { value: 8 & e20[0] }; + }; + var oR = function(e20) { + return { value: e20[3] }; + }; + var iR = function(e20) { + return { value: 8 & e20[0] }; + }; + var aR = function(e20) { + return { value: e20[3] }; + }; + var sR = function(e20) { + return { listOpen: 64 & e20[0] }; + }; + var cR = function(e20) { + return { listOpen: e20[6] }; + }; + var lR = function(e20) { + return {}; + }; + var uR = function(e20) { + return {}; + }; + var fR = function(e20) { + return {}; + }; + var dR = function(e20) { + return {}; + }; + var hR = function(e20) { + return { selection: 8 & e20[0] }; + }; + var vR = function(e20) { + return { selection: e20[3] }; + }; + function pR(e20, t10, n10) { + var r10 = e20.slice(); + return r10[126] = t10[n10], r10[128] = n10, r10; + } + var mR = function(e20) { + return {}; + }; + var gR = function(e20) { + return {}; + }; + var yR = function(e20) { + return { selection: 8 & e20[0] }; + }; + var bR = function(e20) { + return { selection: e20[126], index: e20[128] }; + }; + var kR = function(e20) { + return {}; + }; + var wR = function(e20) { + return {}; + }; + var xR = function(e20) { + return {}; + }; + var jR = function(e20) { + return {}; + }; + var SR = function(e20) { + return {}; + }; + var CR = function(e20) { + return {}; + }; + function $R(e20, t10, n10) { + var r10 = e20.slice(); + return r10[126] = t10[n10], r10[128] = n10, r10; + } + var _R = function(e20) { + return { item: 16777216 & e20[0] }; + }; + var OR = function(e20) { + return { item: e20[126], index: e20[128] }; + }; + var MR = function(e20) { + return { filteredItems: 16777216 & e20[0] }; + }; + var ER = function(e20) { + return { filteredItems: e20[24] }; + }; + var AR = function(e20) { + return {}; + }; + var PR = function(e20) { + return {}; + }; + function TR(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = e20[50]["list-prepend"] && RR(e20), u10 = [DR, IR, NR], f10 = []; + function d10(e21, t11) { + return e21[50].list ? 0 : e21[24].length > 0 ? 1 : e21[19] ? -1 : 2; + } + ~(r10 = d10(e20)) && (o10 = f10[r10] = u10[r10](e20)); + var h10 = e20[50]["list-append"] && zR(e20); + return { c: function() { + t10 = ji("div"), l10 && l10.c(), n10 = $i(), o10 && o10.c(), i10 = $i(), h10 && h10.c(), Ai(t10, "class", "svelte-select-list svelte-82qwg8"), Ai(t10, "role", "none"), zi(t10, "prefloat", e20[28]); + }, m: function(o11, u11) { + ki(o11, t10, u11), l10 && l10.m(t10, null), pi(t10, n10), ~r10 && f10[r10].m(t10, null), pi(t10, i10), h10 && h10.m(t10, null), e20[91](t10), a10 = true, s10 || (c10 = [ci(e20[49].call(null, t10)), Oi(t10, "scroll", e20[41]), Oi(t10, "pointerup", Ei(Mi(e20[85]))), Oi(t10, "mousedown", Ei(Mi(e20[86])))], s10 = true); + }, p: function(e21, s11) { + e21[50]["list-prepend"] ? l10 ? (l10.p(e21, s11), 524288 & s11[1] && wa(l10, 1)) : ((l10 = RR(e21)).c(), wa(l10, 1), l10.m(t10, n10)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()); + var c11 = r10; + (r10 = d10(e21)) === c11 ? ~r10 && f10[r10].p(e21, s11) : (o10 && (ba(), xa(f10[c11], 1, 1, function() { + f10[c11] = null; + }), ka()), ~r10 ? ((o10 = f10[r10]) ? o10.p(e21, s11) : (o10 = f10[r10] = u10[r10](e21)).c(), wa(o10, 1), o10.m(t10, i10)) : o10 = null), e21[50]["list-append"] ? h10 ? (h10.p(e21, s11), 524288 & s11[1] && wa(h10, 1)) : ((h10 = zR(e21)).c(), wa(h10, 1), h10.m(t10, null)) : h10 && (ba(), xa(h10, 1, 1, function() { + h10 = null; + }), ka()), (!a10 || 268435456 & s11[0]) && zi(t10, "prefloat", e21[28]); + }, i: function(e21) { + a10 || (wa(l10), wa(o10), wa(h10), a10 = true); + }, o: function(e21) { + xa(l10), xa(o10), xa(h10), a10 = false; + }, d: function(n11) { + n11 && wi(t10), l10 && l10.d(), ~r10 && f10[r10].d(), h10 && h10.d(), e20[91](null), s10 = false, Qo(c10); + } }; + } + function RR(e20) { + var t10, n10 = e20[83]["list-prepend"], r10 = ei(n10, e20, e20[82], PR); + return { c: function() { + r10 && r10.c(); + }, m: function(e21, n11) { + r10 && r10.m(e21, n11), t10 = true; + }, p: function(e21, o10) { + r10 && r10.p && (!t10 || 1048576 & o10[2]) && ri(r10, n10, e21, e21[82], t10 ? ni(n10, e21[82], o10, AR) : oi(e21[82]), PR); + }, i: function(e21) { + t10 || (wa(r10, e21), t10 = true); + }, o: function(e21) { + xa(r10, e21), t10 = false; + }, d: function(e21) { + r10 && r10.d(e21); + } }; + } + function NR(e20) { + var t10, n10, r10 = e20[83].empty, o10 = ei(r10, e20, e20[82], CR), i10 = o10 || { c: function() { + (n10 = ji("div")).textContent = "No options", Ai(n10, "class", "empty svelte-82qwg8"); + }, m: function(e21, t11) { + ki(e21, n10, t11); + }, p: Wo, d: function(e21) { + e21 && wi(n10); + } }; + return { c: function() { + i10 && i10.c(); + }, m: function(e21, n11) { + i10 && i10.m(e21, n11), t10 = true; + }, p: function(e21, n11) { + o10 && o10.p && (!t10 || 1048576 & n11[2]) && ri(o10, r10, e21, e21[82], t10 ? ni(r10, e21[82], n11, SR) : oi(e21[82]), CR); + }, i: function(e21) { + t10 || (wa(i10, e21), t10 = true); + }, o: function(e21) { + xa(i10, e21), t10 = false; + }, d: function(e21) { + i10 && i10.d(e21); + } }; + } + function IR(e20) { + for (var t10, n10, r10 = Ca(e20[24]), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = qR($R(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }; + return { c: function() { + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + t10 = _i(); + }, m: function(e21, r11) { + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(e21, r11); + ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + if (1627402376 & n11[0] | 28672 & n11[1] | 1048576 & n11[2]) { + var i11; + for (r10 = Ca(e21[24]), i11 = 0; i11 < r10.length; i11 += 1) { + var s10 = $R(e21, r10, i11); + o10[i11] ? (o10[i11].p(s10, n11), wa(o10[i11], 1)) : (o10[i11] = qR(s10), o10[i11].c(), wa(o10[i11], 1), o10[i11].m(t10.parentNode, t10)); + } + for (ba(), i11 = r10.length; i11 < o10.length; i11 += 1) + a10(i11); + ka(); + } + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21); + } }; + } + function DR(e20) { + var t10, n10 = e20[83].list, r10 = ei(n10, e20, e20[82], ER); + return { c: function() { + r10 && r10.c(); + }, m: function(e21, n11) { + r10 && r10.m(e21, n11), t10 = true; + }, p: function(e21, o10) { + r10 && r10.p && (!t10 || 16777216 & o10[0] | 1048576 & o10[2]) && ri(r10, n10, e21, e21[82], t10 ? ni(n10, e21[82], o10, MR) : oi(e21[82]), ER); + }, i: function(e21) { + t10 || (wa(r10, e21), t10 = true); + }, o: function(e21) { + xa(r10, e21), t10 = false; + }, d: function(e21) { + r10 && r10.d(e21); + } }; + } + function qR(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = e20[83].item, u10 = ei(l10, e20, e20[82], OR), f10 = u10 || function(e21) { + var t11, n11, r11 = (null === (t11 = e21[126]) || void 0 === t11 ? void 0 : t11[e21[12]]) + ""; + return { c: function() { + n11 = Ci(r11); + }, m: function(e23, t12) { + ki(e23, n11, t12); + }, p: function(e23, t12) { + var o11; + 16781312 & t12[0] && r11 !== (r11 = (null === (o11 = e23[126]) || void 0 === o11 ? void 0 : o11[e23[12]]) + "") && Ni(n11, r11); + }, d: function(e23) { + e23 && wi(n11); + } }; + }(e20); + function d10() { + return e20[88](e20[128]); + } + function h10() { + return e20[89](e20[128]); + } + function v10() { + return e20[90](e20[126], e20[128]); + } + return { c: function() { + var r11; + t10 = ji("div"), n10 = ji("div"), f10 && f10.c(), i10 = $i(), Ai(n10, "class", "item svelte-82qwg8"), zi(n10, "list-group-title", e20[126].groupHeader), zi(n10, "active", e20[45](e20[126], e20[3], e20[13])), zi(n10, "first", 0 === e20[128]), zi(n10, "hover", e20[7] === e20[128]), zi(n10, "group-item", e20[126].groupItem), zi(n10, "not-selectable", false === (null === (r11 = e20[126]) || void 0 === r11 ? void 0 : r11.selectable)), Ai(t10, "class", "list-item svelte-82qwg8"), Ai(t10, "tabindex", "-1"), Ai(t10, "role", "none"); + }, m: function(l11, u11) { + ki(l11, t10, u11), pi(t10, n10), f10 && f10.m(n10, null), pi(t10, i10), a10 = true, s10 || (c10 = [ci(r10 = e20[46].call(null, n10, { scroll: e20[45](e20[126], e20[3], e20[13]), listDom: e20[30] })), ci(o10 = e20[47].call(null, n10, { scroll: e20[29] === e20[128], listDom: e20[30] })), Oi(t10, "mouseover", d10), Oi(t10, "focus", h10), Oi(t10, "click", Ei(v10)), Oi(t10, "keydown", Ei(Mi(e20[87])))], s10 = true); + }, p: function(t11, i11) { + var s11; + (e20 = t11, u10 ? u10.p && (!a10 || 16777216 & i11[0] | 1048576 & i11[2]) && ri(u10, l10, e20, e20[82], a10 ? ni(l10, e20[82], i11, _R) : oi(e20[82]), OR) : f10 && f10.p && (!a10 || 16781312 & i11[0]) && f10.p(e20, a10 ? i11 : [-1, -1, -1, -1, -1]), r10 && Yo(r10.update) && 1090527240 & i11[0] && r10.update.call(null, { scroll: e20[45](e20[126], e20[3], e20[13]), listDom: e20[30] }), o10 && Yo(o10.update) && 1610612736 & i11[0] && o10.update.call(null, { scroll: e20[29] === e20[128], listDom: e20[30] }), (!a10 || 16777216 & i11[0]) && zi(n10, "list-group-title", e20[126].groupHeader), (!a10 || 16785416 & i11[0] | 16384 & i11[1]) && zi(n10, "active", e20[45](e20[126], e20[3], e20[13])), (!a10 || 128 & i11[0]) && zi(n10, "hover", e20[7] === e20[128]), (!a10 || 16777216 & i11[0]) && zi(n10, "group-item", e20[126].groupItem), !a10 || 16777216 & i11[0]) && zi(n10, "not-selectable", false === (null === (s11 = e20[126]) || void 0 === s11 ? void 0 : s11.selectable)); + }, i: function(e21) { + a10 || (wa(f10, e21), a10 = true); + }, o: function(e21) { + xa(f10, e21), a10 = false; + }, d: function(e21) { + e21 && wi(t10), f10 && f10.d(e21), s10 = false, Qo(c10); + } }; + } + function zR(e20) { + var t10, n10 = e20[83]["list-append"], r10 = ei(n10, e20, e20[82], jR); + return { c: function() { + r10 && r10.c(); + }, m: function(e21, n11) { + r10 && r10.m(e21, n11), t10 = true; + }, p: function(e21, o10) { + r10 && r10.p && (!t10 || 1048576 & o10[2]) && ri(r10, n10, e21, e21[82], t10 ? ni(n10, e21[82], o10, xR) : oi(e21[82]), jR); + }, i: function(e21) { + t10 || (wa(r10, e21), t10 = true); + }, o: function(e21) { + xa(r10, e21), t10 = false; + }, d: function(e21) { + r10 && r10.d(e21); + } }; + } + function BR(e20) { + var t10, n10, r10, o10, i10; + return { c: function() { + t10 = ji("span"), n10 = Ci(e20[32]), r10 = $i(), o10 = ji("span"), i10 = Ci(e20[31]), Ai(t10, "id", "aria-selection"), Ai(t10, "class", "svelte-82qwg8"), Ai(o10, "id", "aria-context"), Ai(o10, "class", "svelte-82qwg8"); + }, m: function(e21, a10) { + ki(e21, t10, a10), pi(t10, n10), ki(e21, r10, a10), ki(e21, o10, a10), pi(o10, i10); + }, p: function(e21, t11) { + 2 & t11[1] && Ni(n10, e21[32]), 1 & t11[1] && Ni(i10, e21[31]); + }, d: function(e21) { + e21 && (wi(t10), wi(r10), wi(o10)); + } }; + } + function LR(e20) { + var t10, n10, r10, o10, i10 = [VR, FR], a10 = []; + function s10(e21, t11) { + return e21[9] ? 0 : 1; + } + return t10 = s10(e20), n10 = a10[t10] = i10[t10](e20), { c: function() { + n10.c(), r10 = _i(); + }, m: function(e21, n11) { + a10[t10].m(e21, n11), ki(e21, r10, n11), o10 = true; + }, p: function(e21, o11) { + var c10 = t10; + (t10 = s10(e21)) === c10 ? a10[t10].p(e21, o11) : (ba(), xa(a10[c10], 1, 1, function() { + a10[c10] = null; + }), ka(), (n10 = a10[t10]) ? n10.p(e21, o11) : (n10 = a10[t10] = i10[t10](e21)).c(), wa(n10, 1), n10.m(r10.parentNode, r10)); + }, i: function(e21) { + o10 || (wa(n10), o10 = true); + }, o: function(e21) { + xa(n10), o10 = false; + }, d: function(e21) { + e21 && wi(r10), a10[t10].d(e21); + } }; + } + function FR(e20) { + var t10, n10, r10 = e20[83].selection, o10 = ei(r10, e20, e20[82], vR), i10 = o10 || function(e21) { + var t11, n11 = e21[3][e21[12]] + ""; + return { c: function() { + t11 = Ci(n11); + }, m: function(e23, n12) { + ki(e23, t11, n12); + }, p: function(e23, r11) { + 4104 & r11[0] && n11 !== (n11 = e23[3][e23[12]] + "") && Ni(t11, n11); + }, d: function(e23) { + e23 && wi(t11); + } }; + }(e20); + return { c: function() { + t10 = ji("div"), i10 && i10.c(), Ai(t10, "class", "selected-item svelte-82qwg8"), zi(t10, "hide-selected-item", e20[35]); + }, m: function(e21, r11) { + ki(e21, t10, r11), i10 && i10.m(t10, null), n10 = true; + }, p: function(e21, a10) { + o10 ? o10.p && (!n10 || 8 & a10[0] | 1048576 & a10[2]) && ri(o10, r10, e21, e21[82], n10 ? ni(r10, e21[82], a10, hR) : oi(e21[82]), vR) : i10 && i10.p && (!n10 || 4104 & a10[0]) && i10.p(e21, n10 ? a10 : [-1, -1, -1, -1, -1]), (!n10 || 16 & a10[1]) && zi(t10, "hide-selected-item", e21[35]); + }, i: function(e21) { + n10 || (wa(i10, e21), n10 = true); + }, o: function(e21) { + xa(i10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), i10 && i10.d(e21); + } }; + } + function VR(e20) { + for (var t10, n10, r10 = Ca(e20[3]), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = WR(pR(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }; + return { c: function() { + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + t10 = _i(); + }, m: function(e21, r11) { + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(e21, r11); + ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + if (67116040 & n11[0] | 32 & n11[1] | 1048576 & n11[2]) { + var i11; + for (r10 = Ca(e21[3]), i11 = 0; i11 < r10.length; i11 += 1) { + var s10 = pR(e21, r10, i11); + o10[i11] ? (o10[i11].p(s10, n11), wa(o10[i11], 1)) : (o10[i11] = WR(s10), o10[i11].c(), wa(o10[i11], 1), o10[i11].m(t10.parentNode, t10)); + } + for (ba(), i11 = r10.length; i11 < o10.length; i11 += 1) + a10(i11); + ka(); + } + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21); + } }; + } + function HR(e20) { + var t10, n10, r10, o10, i10 = e20[83]["multi-clear-icon"], a10 = ei(i10, e20, e20[82], gR), s10 = a10 || function(e21) { + var t11, n11; + return t11 = new XT({}), { c: function() { + Pa(t11.$$.fragment); + }, m: function(e23, r11) { + Ta(t11, e23, r11), n11 = true; + }, i: function(e23) { + n11 || (wa(t11.$$.fragment, e23), n11 = true); + }, o: function(e23) { + xa(t11.$$.fragment, e23), n11 = false; + }, d: function(e23) { + Ra(t11, e23); + } }; + }(); + function c10() { + return e20[92](e20[128]); + } + return { c: function() { + t10 = ji("div"), s10 && s10.c(), Ai(t10, "class", "multi-item-clear svelte-82qwg8"); + }, m: function(e21, i11) { + ki(e21, t10, i11), s10 && s10.m(t10, null), n10 = true, r10 || (o10 = Oi(t10, "pointerup", Ei(Mi(c10))), r10 = true); + }, p: function(t11, r11) { + e20 = t11, a10 && a10.p && (!n10 || 1048576 & r11[2]) && ri(a10, i10, e20, e20[82], n10 ? ni(i10, e20[82], r11, mR) : oi(e20[82]), gR); + }, i: function(e21) { + n10 || (wa(s10, e21), n10 = true); + }, o: function(e21) { + xa(s10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), s10 && s10.d(e21), r10 = false, o10(); + } }; + } + function WR(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10 = e20[83].selection, l10 = ei(c10, e20, e20[82], bR), u10 = l10 || function(e21) { + var t11, n11 = e21[126][e21[12]] + ""; + return { c: function() { + t11 = Ci(n11); + }, m: function(e23, n12) { + ki(e23, t11, n12); + }, p: function(e23, r11) { + 4104 & r11[0] && n11 !== (n11 = e23[126][e23[12]] + "") && Ni(t11, n11); + }, d: function(e23) { + e23 && wi(t11); + } }; + }(e20), f10 = !e20[11] && !e20[10] && XT && HR(e20); + function d10() { + return e20[93](e20[128]); + } + return { c: function() { + t10 = ji("div"), n10 = ji("span"), u10 && u10.c(), r10 = $i(), f10 && f10.c(), o10 = $i(), Ai(n10, "class", "multi-item-text svelte-82qwg8"), Ai(t10, "class", "multi-item svelte-82qwg8"), Ai(t10, "role", "none"), zi(t10, "active", e20[26] === e20[128]), zi(t10, "disabled", e20[11]); + }, m: function(c11, l11) { + ki(c11, t10, l11), pi(t10, n10), u10 && u10.m(n10, null), pi(t10, r10), f10 && f10.m(t10, null), pi(t10, o10), i10 = true, a10 || (s10 = [Oi(t10, "click", Mi(d10)), Oi(t10, "keydown", Ei(Mi(e20[84])))], a10 = true); + }, p: function(n11, r11) { + e20 = n11, l10 ? l10.p && (!i10 || 8 & r11[0] | 1048576 & r11[2]) && ri(l10, c10, e20, e20[82], i10 ? ni(c10, e20[82], r11, yR) : oi(e20[82]), bR) : u10 && u10.p && (!i10 || 4104 & r11[0]) && u10.p(e20, i10 ? r11 : [-1, -1, -1, -1, -1]), e20[11] || e20[10] || !XT ? f10 && (ba(), xa(f10, 1, 1, function() { + f10 = null; + }), ka()) : f10 ? (f10.p(e20, r11), 3072 & r11[0] && wa(f10, 1)) : ((f10 = HR(e20)).c(), wa(f10, 1), f10.m(t10, o10)), (!i10 || 67108864 & r11[0]) && zi(t10, "active", e20[26] === e20[128]), (!i10 || 2048 & r11[0]) && zi(t10, "disabled", e20[11]); + }, i: function(e21) { + i10 || (wa(u10, e21), wa(f10), i10 = true); + }, o: function(e21) { + xa(u10, e21), xa(f10), i10 = false; + }, d: function(e21) { + e21 && wi(t10), u10 && u10.d(e21), f10 && f10.d(), a10 = false, Qo(s10); + } }; + } + function UR(e20) { + var t10, n10, r10 = e20[83]["loading-icon"], o10 = ei(r10, e20, e20[82], dR), i10 = o10 || function(e21) { + var t11, n11; + return t11 = new tR({}), { c: function() { + Pa(t11.$$.fragment); + }, m: function(e23, r11) { + Ta(t11, e23, r11), n11 = true; + }, i: function(e23) { + n11 || (wa(t11.$$.fragment, e23), n11 = true); + }, o: function(e23) { + xa(t11.$$.fragment, e23), n11 = false; + }, d: function(e23) { + Ra(t11, e23); + } }; + }(); + return { c: function() { + t10 = ji("div"), i10 && i10.c(), Ai(t10, "class", "icon loading svelte-82qwg8"), Ai(t10, "aria-hidden", "true"); + }, m: function(e21, r11) { + ki(e21, t10, r11), i10 && i10.m(t10, null), n10 = true; + }, p: function(e21, t11) { + o10 && o10.p && (!n10 || 1048576 & t11[2]) && ri(o10, r10, e21, e21[82], n10 ? ni(r10, e21[82], t11, fR) : oi(e21[82]), dR); + }, i: function(e21) { + n10 || (wa(i10, e21), n10 = true); + }, o: function(e21) { + xa(i10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), i10 && i10.d(e21); + } }; + } + function JR(e20) { + var t10, n10, r10, o10, i10 = e20[83]["clear-icon"], a10 = ei(i10, e20, e20[82], uR), s10 = a10 || function(e21) { + var t11, n11; + return t11 = new XT({}), { c: function() { + Pa(t11.$$.fragment); + }, m: function(e23, r11) { + Ta(t11, e23, r11), n11 = true; + }, i: function(e23) { + n11 || (wa(t11.$$.fragment, e23), n11 = true); + }, o: function(e23) { + xa(t11.$$.fragment, e23), n11 = false; + }, d: function(e23) { + Ra(t11, e23); + } }; + }(); + return { c: function() { + t10 = ji("button"), s10 && s10.c(), Ai(t10, "type", "button"), Ai(t10, "class", "icon clear-select svelte-82qwg8"); + }, m: function(i11, a11) { + ki(i11, t10, a11), s10 && s10.m(t10, null), n10 = true, r10 || (o10 = Oi(t10, "click", e20[22]), r10 = true); + }, p: function(e21, t11) { + a10 && a10.p && (!n10 || 1048576 & t11[2]) && ri(a10, i10, e21, e21[82], n10 ? ni(i10, e21[82], t11, lR) : oi(e21[82]), uR); + }, i: function(e21) { + n10 || (wa(s10, e21), n10 = true); + }, o: function(e21) { + xa(s10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), s10 && s10.d(e21), r10 = false, o10(); + } }; + } + function KR(e20) { + var t10, n10, r10 = e20[83]["chevron-icon"], o10 = ei(r10, e20, e20[82], cR), i10 = o10 || function(e21) { + var t11, n11; + return t11 = new GT({}), { c: function() { + Pa(t11.$$.fragment); + }, m: function(e23, r11) { + Ta(t11, e23, r11), n11 = true; + }, i: function(e23) { + n11 || (wa(t11.$$.fragment, e23), n11 = true); + }, o: function(e23) { + xa(t11.$$.fragment, e23), n11 = false; + }, d: function(e23) { + Ra(t11, e23); + } }; + }(); + return { c: function() { + t10 = ji("div"), i10 && i10.c(), Ai(t10, "class", "icon chevron svelte-82qwg8"), Ai(t10, "aria-hidden", "true"); + }, m: function(e21, r11) { + ki(e21, t10, r11), i10 && i10.m(t10, null), n10 = true; + }, p: function(e21, t11) { + o10 && o10.p && (!n10 || 64 & t11[0] | 1048576 & t11[2]) && ri(o10, r10, e21, e21[82], n10 ? ni(r10, e21[82], t11, sR) : oi(e21[82]), cR); + }, i: function(e21) { + n10 || (wa(i10, e21), n10 = true); + }, o: function(e21) { + xa(i10, e21), n10 = false; + }, d: function(e21) { + e21 && wi(t10), i10 && i10.d(e21); + } }; + } + function GR(e20) { + var t10, n10, r10 = e20[83].required, o10 = ei(r10, e20, e20[82], oR), i10 = o10 || { c: function() { + Ai(n10 = ji("select"), "class", "required svelte-82qwg8"), n10.required = true, Ai(n10, "tabindex", "-1"), Ai(n10, "aria-hidden", "true"); + }, m: function(e21, t11) { + ki(e21, n10, t11); + }, p: Wo, d: function(e21) { + e21 && wi(n10); + } }; + return { c: function() { + i10 && i10.c(); + }, m: function(e21, n11) { + i10 && i10.m(e21, n11), t10 = true; + }, p: function(e21, n11) { + o10 && o10.p && (!t10 || 8 & n11[0] | 1048576 & n11[2]) && ri(o10, r10, e21, e21[82], t10 ? ni(r10, e21[82], n11, rR) : oi(e21[82]), oR); + }, i: function(e21) { + t10 || (wa(i10, e21), t10 = true); + }, o: function(e21) { + xa(i10, e21), t10 = false; + }, d: function(e21) { + i10 && i10.d(e21); + } }; + } + function QR(e20) { + for (var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10 = e20[6] && TR(e20), x10 = e20[2] && BR(e20), j10 = e20[83].prepend, S10 = ei(j10, e20, e20[82], wR), C10 = e20[25] && LR(e20), $10 = [{ readOnly: u10 = !e20[17] }, e20[27], { placeholder: e20[33] }, { style: e20[18] }, { disabled: e20[11] }], _10 = {}, O10 = 0; O10 < $10.length; O10 += 1) + _10 = Jo(_10, $10[O10]); + var M10 = e20[5] && UR(e20), E10 = e20[34] && JR(e20), A10 = e20[20] && KR(e20), P10 = e20[83]["input-hidden"], T8 = ei(P10, e20, e20[82], aR), R8 = T8 || /* @__PURE__ */ function(e21) { + var t11, n11; + return { c: function() { + Ai(t11 = ji("input"), "name", e21[8]), Ai(t11, "type", "hidden"), t11.value = n11 = e21[3] ? JSON.stringify(e21[3]) : null, Ai(t11, "class", "svelte-82qwg8"); + }, m: function(e23, n12) { + ki(e23, t11, n12); + }, p: function(e23, r11) { + 256 & r11[0] && Ai(t11, "name", e23[8]), 8 & r11[0] && n11 !== (n11 = e23[3] ? JSON.stringify(e23[3]) : null) && (t11.value = n11); + }, d: function(e23) { + e23 && wi(t11); + } }; + }(e20), N8 = e20[16] && (!e20[3] || 0 === e20[3].length) && GR(e20); + return { c: function() { + t10 = ji("div"), w10 && w10.c(), n10 = $i(), r10 = ji("span"), x10 && x10.c(), o10 = $i(), i10 = ji("div"), S10 && S10.c(), a10 = $i(), s10 = ji("div"), C10 && C10.c(), c10 = $i(), l10 = ji("input"), f10 = $i(), d10 = ji("div"), M10 && M10.c(), h10 = $i(), E10 && E10.c(), v10 = $i(), A10 && A10.c(), p10 = $i(), R8 && R8.c(), m10 = $i(), N8 && N8.c(), Ai(r10, "aria-live", "polite"), Ai(r10, "aria-atomic", "false"), Ai(r10, "aria-relevant", "additions text"), Ai(r10, "class", "a11y-text svelte-82qwg8"), Ai(i10, "class", "prepend svelte-82qwg8"), Ti(l10, _10), zi(l10, "svelte-82qwg8", true), Ai(s10, "class", "value-container svelte-82qwg8"), Ai(d10, "class", "indicators svelte-82qwg8"), Ai(t10, "class", g10 = "svelte-select " + e20[21] + " svelte-82qwg8"), Ai(t10, "style", e20[14]), Ai(t10, "role", "none"), zi(t10, "multi", e20[9]), zi(t10, "disabled", e20[11]), zi(t10, "focused", e20[2]), zi(t10, "list-open", e20[6]), zi(t10, "show-chevron", e20[20]), zi(t10, "error", e20[15]); + }, m: function(u11, g11) { + ki(u11, t10, g11), w10 && w10.m(t10, null), pi(t10, n10), pi(t10, r10), x10 && x10.m(r10, null), pi(t10, o10), pi(t10, i10), S10 && S10.m(i10, null), pi(t10, a10), pi(t10, s10), C10 && C10.m(s10, null), pi(s10, c10), pi(s10, l10), l10.autofocus && l10.focus(), e20[94](l10), Ii(l10, e20[4]), pi(t10, f10), pi(t10, d10), M10 && M10.m(d10, null), pi(d10, h10), E10 && E10.m(d10, null), pi(d10, v10), A10 && A10.m(d10, null), pi(t10, p10), R8 && R8.m(t10, null), pi(t10, m10), N8 && N8.m(t10, null), e20[96](t10), y10 = true, b10 || (k10 = [Oi(window, "click", e20[42]), Oi(window, "keydown", e20[37]), Oi(l10, "keydown", e20[37]), Oi(l10, "blur", e20[39]), Oi(l10, "focus", e20[38]), Oi(l10, "input", e20[95]), Oi(t10, "pointerup", Mi(e20[40])), ci(e20[48].call(null, t10))], b10 = true); + }, p: function(e21, o11) { + e21[6] ? w10 ? (w10.p(e21, o11), 64 & o11[0] && wa(w10, 1)) : ((w10 = TR(e21)).c(), wa(w10, 1), w10.m(t10, n10)) : w10 && (ba(), xa(w10, 1, 1, function() { + w10 = null; + }), ka()), e21[2] ? x10 ? x10.p(e21, o11) : ((x10 = BR(e21)).c(), x10.m(r10, null)) : x10 && (x10.d(1), x10 = null), S10 && S10.p && (!y10 || 1048576 & o11[2]) && ri(S10, j10, e21, e21[82], y10 ? ni(j10, e21[82], o11, kR) : oi(e21[82]), wR), e21[25] ? C10 ? (C10.p(e21, o11), 33554432 & o11[0] && wa(C10, 1)) : ((C10 = LR(e21)).c(), wa(C10, 1), C10.m(s10, c10)) : C10 && (ba(), xa(C10, 1, 1, function() { + C10 = null; + }), ka()), Ti(l10, _10 = Ma($10, [(!y10 || 131072 & o11[0] && u10 !== (u10 = !e21[17])) && { readOnly: u10 }, 134217728 & o11[0] && e21[27], (!y10 || 4 & o11[1]) && { placeholder: e21[33] }, (!y10 || 262144 & o11[0]) && { style: e21[18] }, (!y10 || 2048 & o11[0]) && { disabled: e21[11] }])), 16 & o11[0] && l10.value !== e21[4] && Ii(l10, e21[4]), zi(l10, "svelte-82qwg8", true), e21[5] ? M10 ? (M10.p(e21, o11), 32 & o11[0] && wa(M10, 1)) : ((M10 = UR(e21)).c(), wa(M10, 1), M10.m(d10, h10)) : M10 && (ba(), xa(M10, 1, 1, function() { + M10 = null; + }), ka()), e21[34] ? E10 ? (E10.p(e21, o11), 8 & o11[1] && wa(E10, 1)) : ((E10 = JR(e21)).c(), wa(E10, 1), E10.m(d10, v10)) : E10 && (ba(), xa(E10, 1, 1, function() { + E10 = null; + }), ka()), e21[20] ? A10 ? (A10.p(e21, o11), 1048576 & o11[0] && wa(A10, 1)) : ((A10 = KR(e21)).c(), wa(A10, 1), A10.m(d10, null)) : A10 && (ba(), xa(A10, 1, 1, function() { + A10 = null; + }), ka()), T8 ? T8.p && (!y10 || 8 & o11[0] | 1048576 & o11[2]) && ri(T8, P10, e21, e21[82], y10 ? ni(P10, e21[82], o11, iR) : oi(e21[82]), aR) : R8 && R8.p && (!y10 || 264 & o11[0]) && R8.p(e21, y10 ? o11 : [-1, -1, -1, -1, -1]), !e21[16] || e21[3] && 0 !== e21[3].length ? N8 && (ba(), xa(N8, 1, 1, function() { + N8 = null; + }), ka()) : N8 ? (N8.p(e21, o11), 65544 & o11[0] && wa(N8, 1)) : ((N8 = GR(e21)).c(), wa(N8, 1), N8.m(t10, null)), (!y10 || 2097152 & o11[0] && g10 !== (g10 = "svelte-select " + e21[21] + " svelte-82qwg8")) && Ai(t10, "class", g10), (!y10 || 16384 & o11[0]) && Ai(t10, "style", e21[14]), (!y10 || 2097664 & o11[0]) && zi(t10, "multi", e21[9]), (!y10 || 2099200 & o11[0]) && zi(t10, "disabled", e21[11]), (!y10 || 2097156 & o11[0]) && zi(t10, "focused", e21[2]), (!y10 || 2097216 & o11[0]) && zi(t10, "list-open", e21[6]), (!y10 || 3145728 & o11[0]) && zi(t10, "show-chevron", e21[20]), (!y10 || 2129920 & o11[0]) && zi(t10, "error", e21[15]); + }, i: function(e21) { + y10 || (wa(w10), wa(S10, e21), wa(C10), wa(M10), wa(E10), wa(A10), wa(R8, e21), wa(N8), y10 = true); + }, o: function(e21) { + xa(w10), xa(S10, e21), xa(C10), xa(M10), xa(E10), xa(A10), xa(R8, e21), xa(N8), y10 = false; + }, d: function(n11) { + n11 && wi(t10), w10 && w10.d(), x10 && x10.d(), S10 && S10.d(n11), C10 && C10.d(), e20[94](null), M10 && M10.d(), E10 && E10.d(), A10 && A10.d(), R8 && R8.d(n11), N8 && N8.d(), e20[96](null), b10 = false, Qo(k10); + } }; + } + function YR(e20) { + return e20.map(function(e21, t10) { + return { index: t10, value: e21, label: "".concat(e21) }; + }); + } + function XR(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10 = t10.$$slots, k10 = void 0 === b10 ? {} : b10, w10 = t10.$$scope, x10 = function(e21) { + var t11 = {}; + for (var n11 in e21) + t11[n11] = true; + return t11; + }(k10), j10 = Yi(), S10 = t10.justValue, C10 = void 0 === S10 ? null : S10, $10 = t10.filter, _10 = void 0 === $10 ? HT : $10, O10 = t10.getItems, M10 = void 0 === O10 ? WT : O10, E10 = t10.id, A10 = void 0 === E10 ? null : E10, P10 = t10.name, T8 = void 0 === P10 ? null : P10, R8 = t10.container, N8 = void 0 === R8 ? void 0 : R8, I10 = t10.input, D10 = void 0 === I10 ? void 0 : I10, q10 = t10.multiple, z10 = void 0 !== q10 && q10, B10 = t10.multiFullItemClearable, L10 = void 0 !== B10 && B10, F10 = t10.disabled, V10 = void 0 !== F10 && F10, H10 = t10.focused, W10 = void 0 !== H10 && H10, U10 = t10.value, J10 = void 0 === U10 ? null : U10, K10 = t10.filterText, G10 = void 0 === K10 ? "" : K10, Q10 = t10.placeholder, Y10 = void 0 === Q10 ? "Please select" : Q10, X10 = t10.placeholderAlwaysShow, Z10 = void 0 !== X10 && X10, ee2 = t10.items, te2 = void 0 === ee2 ? null : ee2, ne2 = t10.label, re2 = void 0 === ne2 ? "label" : ne2, oe2 = t10.itemFilter, ie2 = void 0 === oe2 ? function(e21, t11, n11) { + return "".concat(e21).toLowerCase().includes(t11.toLowerCase()); + } : oe2, ae2 = t10.groupBy, se2 = void 0 === ae2 ? void 0 : ae2, ce2 = t10.groupFilter, le2 = void 0 === ce2 ? function(e21) { + return e21; + } : ce2, ue2 = t10.groupHeaderSelectable, fe2 = void 0 !== ue2 && ue2, de2 = t10.itemId, he2 = void 0 === de2 ? "value" : de2, ve2 = t10.loadOptions, pe2 = void 0 === ve2 ? void 0 : ve2, me2 = t10.containerStyles, ge2 = void 0 === me2 ? "" : me2, ye2 = t10.hasError, be2 = void 0 !== ye2 && ye2, ke2 = t10.filterSelectedItems, we2 = void 0 === ke2 || ke2, xe2 = t10.required, je2 = void 0 !== xe2 && xe2, Se2 = t10.closeListOnChange, Ce2 = void 0 === Se2 || Se2, $e2 = t10.clearFilterTextOnBlur, _e2 = void 0 === $e2 || $e2, Oe2 = t10.createGroupHeaderItem, Me2 = void 0 === Oe2 ? function(e21, t11) { + return qo({ value: e21 }, re2, e21); + } : Oe2, Ee2 = t10.searchable, Ae2 = void 0 === Ee2 || Ee2, Pe2 = t10.inputStyles, Te2 = void 0 === Pe2 ? "" : Pe2, Re2 = t10.clearable, Ne2 = void 0 === Re2 || Re2, Ie2 = t10.loading, De2 = void 0 !== Ie2 && Ie2, qe2 = t10.listOpen, ze2 = void 0 !== qe2 && qe2, Be2 = t10.debounce, Le2 = void 0 === Be2 ? function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; + clearTimeout(d10), d10 = setTimeout(e21, t11); + } : Be2, Fe2 = t10.debounceWait, Ve2 = void 0 === Fe2 ? 300 : Fe2, He2 = t10.hideEmptyState, We2 = void 0 !== He2 && He2, Ue2 = t10.inputAttributes, Je2 = void 0 === Ue2 ? {} : Ue2, Ke2 = t10.listAutoWidth, Ge2 = void 0 === Ke2 || Ke2, Qe2 = t10.showChevron, Ye2 = void 0 !== Qe2 && Qe2, Xe2 = t10.listOffset, Ze2 = void 0 === Xe2 ? 5 : Xe2, et2 = t10.hoverItemIndex, tt2 = void 0 === et2 ? 0 : et2, nt2 = t10.floatingConfig, rt2 = void 0 === nt2 ? {} : nt2, ot2 = t10.class, it2 = void 0 === ot2 ? "" : ot2; + function at2(e21) { + var t11 = [], n11 = {}; + e21.forEach(function(e23) { + var r12 = se2(e23); + t11.includes(r12) || (t11.push(r12), n11[r12] = [], r12 && n11[r12].push(Object.assign(Me2(r12, e23), { id: r12, groupHeader: true, selectable: fe2 }))), n11[r12].push(Object.assign({ groupItem: !!r12 }, e23)); + }); + var r11 = []; + return le2(t11).forEach(function(e23) { + n11[e23] && r11.push.apply(r11, Bo(n11[e23])); + }), r11; + } + function st2() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, t11 = arguments.length > 1 ? arguments[1] : void 0; + n10(7, tt2 = e21 < 0 ? 0 : e21), !t11 && se2 && l10[tt2] && !l10[tt2].selectable && Mt2(1); + } + function ct2() { + var e21 = true; + if (J10) { + var t11 = [], r11 = []; + J10.forEach(function(n11) { + t11.includes(n11[he2]) ? e21 = false : (t11.push(n11[he2]), r11.push(n11)); + }), e21 || n10(3, J10 = r11); + } + return e21; + } + function lt2(e21) { + var t11 = e21 ? e21[he2] : J10[he2]; + return te2.find(function(e23) { + return e23[he2] === t11; + }); + } + function ut2(e21) { + return ft2.apply(this, arguments); + } + function ft2() { + return ft2 = xo(ko().mark(function e21(t11) { + var r11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + r11 = J10[t11], 1 === J10.length ? n10(3, J10 = void 0) : n10(3, J10 = J10.filter(function(e24) { + return e24 !== r11; + })), j10("clear", r11); + case 3: + case "end": + return e23.stop(); + } + }, e21); + })), ft2.apply(this, arguments); + } + function dt2(e21) { + var t11, r11; + W10 && D10 === (null === (t11 = document) || void 0 === t11 ? void 0 : t11.activeElement) || (e21 && j10("focus", e21), null === (r11 = D10) || void 0 === r11 || r11.focus(), n10(2, W10 = true)); + } + function ht2(e21) { + return vt2.apply(this, arguments); + } + function vt2() { + return (vt2 = xo(ko().mark(function e21(t11) { + var r11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (!Ct2) { + e23.next = 2; + break; + } + return e23.abrupt("return"); + case 2: + (ze2 || W10) && (j10("blur", t11), pt2(), n10(2, W10 = false), n10(26, h10 = void 0), null === (r11 = D10) || void 0 === r11 || r11.blur()); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function pt2() { + _e2 && n10(4, G10 = ""), n10(6, ze2 = false); + } + y10 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + n10(78, v10 = J10), n10(79, p10 = G10), n10(80, m10 = z10); + case 3: + case "end": + return e23.stop(); + } + }, e21); + })), Ki().$$.before_update.push(y10), Gi(function() { + ze2 && n10(2, W10 = true), W10 && D10 && D10.focus(); + }); + var mt2 = t10.ariaValues, gt2 = void 0 === mt2 ? function(e21) { + return "Option ".concat(e21, ", selected."); + } : mt2, yt2 = t10.ariaListOpen, bt2 = void 0 === yt2 ? function(e21, t11) { + return "You are currently focused on option ".concat(e21, ". There are ").concat(t11, " results available."); + } : yt2, kt2 = t10.ariaFocused, wt2 = void 0 === kt2 ? function() { + return "Select is focused, type to refine list, press down to open the menu."; + } : kt2; + var xt2, jt2 = null; + function St2() { + clearTimeout(xt2), xt2 = setTimeout(function() { + Ct2 = false; + }, 100); + } + Qi(function() { + var e21; + null === (e21 = jt2) || void 0 === e21 || e21.remove(); + }); + var Ct2 = false; + function $t2(e21) { + e21 && false !== e21.selectable && function(e23) { + if (e23) { + n10(4, G10 = ""); + var t11 = Object.assign({}, e23); + if (t11.groupHeader && !t11.selectable) + return; + n10(3, J10 = z10 ? J10 ? J10.concat([t11]) : [t11] : n10(3, J10 = t11)), setTimeout(function() { + Ce2 && pt2(), n10(26, h10 = void 0), j10("change", J10), j10("select", e23); + }); + } + }(e21); + } + function _t2(e21) { + Ct2 || n10(7, tt2 = e21); + } + function Ot2(e21) { + var t11 = e21.item, r11 = e21.i; + if (false !== (null == t11 ? void 0 : t11.selectable)) + return J10 && !z10 && J10[he2] === t11[he2] ? pt2() : void (function(e23) { + return e23.groupHeader && e23.selectable || e23.selectable || !e23.hasOwnProperty("selectable"); + }(t11) && (n10(7, tt2 = r11), $t2(t11))); + } + function Mt2(e21) { + if (0 === l10.filter(function(e23) { + return !Object.hasOwn(e23, "selectable") || true === e23.selectable; + }).length) + return n10(7, tt2 = 0); + e21 > 0 && tt2 === l10.length - 1 ? n10(7, tt2 = 0) : n10(7, e21 < 0 && 0 === tt2 ? tt2 = l10.length - 1 : tt2 += e21); + var t11 = l10[tt2]; + t11 && false === t11.selectable && (1 !== e21 && -1 !== e21 || Mt2(e21)); + } + var Et2 = Pt2, At2 = Pt2; + function Pt2(e21) { + return { update: function(t11) { + t11.scroll && (St2(), e21.scrollIntoView({ behavior: "auto", block: "nearest" })); + } }; + } + var Tt2, Rt2 = { strategy: "absolute", placement: "bottom-start", middleware: [(Tt2 = Ze2, void 0 === Tt2 && (Tt2 = 0), { name: "offset", options: Tt2, fn: function(e21) { + return xo(ko().mark(function t11() { + var n11, r11, o11, i11, a11, s11, c11; + return ko().wrap(function(t12) { + for (; ; ) + switch (t12.prev = t12.next) { + case 0: + return o11 = e21.x, i11 = e21.y, a11 = e21.placement, s11 = e21.middlewareData, t12.next = 3, cT(e21, Tt2); + case 3: + if (c11 = t12.sent, a11 !== (null == (n11 = s11.offset) ? void 0 : n11.placement) || null == (r11 = s11.arrow) || !r11.alignmentOffset) { + t12.next = 6; + break; + } + return t12.abrupt("return", {}); + case 6: + return t12.abrupt("return", { x: o11 + c11.x, y: i11 + c11.y, data: Ro(Ro({}, c11), {}, { placement: a11 }) }); + case 7: + case "end": + return t12.stop(); + } + }, t11); + }))(); + } }), FT(), LT()], autoUpdate: false }, Nt2 = /* @__PURE__ */ function(e21) { + var t11, n11, r11 = { autoUpdate: true }, o11 = e21, i11 = function(t12) { + return Ro(Ro(Ro({}, r11), e21 || {}), t12 || {}); + }, a11 = function(e23) { + t11 && n11 && (o11 = i11(e23), VT(t11, n11, o11).then(function(e24) { + var t12; + Object.assign(n11.style, { position: e24.strategy, left: "".concat(e24.x, "px"), top: "".concat(e24.y, "px") }), (null === (t12 = o11) || void 0 === t12 ? void 0 : t12.onComputed) && o11.onComputed(e24); + })); + }, s11 = function(e23) { + Qi(e23.subscribe(function(e24) { + void 0 === t11 ? (t11 = e24, a11()) : (Object.assign(t11, e24), a11()); + })); + }; + return [function(e23) { + if ("subscribe" in e23) + return s11(e23), {}; + t11 = e23, a11(); + }, function(e23, r12) { + var s12; + n11 = e23, o11 = i11(r12), setTimeout(function() { + return a11(r12); + }, 0), a11(r12); + var c11 = function() { + s12 && (s12(), s12 = void 0); + }, l11 = function() { + var e24 = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : o11 || {}).autoUpdate; + c11(), false !== e24 && ca().then(function() { + return BT(t11, n11, function() { + return a11(o11); + }, true === e24 ? {} : e24); + }); + }; + return s12 = l11(), { update: function(e24) { + a11(e24), s12 = l11(e24); + }, destroy: function() { + c11(); + } }; + }, a11]; + }(Rt2), It2 = jo(Nt2, 3), Dt2 = It2[0], qt2 = It2[1], zt2 = It2[2], Bt2 = true; + return e20.$$set = function(e21) { + "justValue" in e21 && n10(52, C10 = e21.justValue), "filter" in e21 && n10(53, _10 = e21.filter), "getItems" in e21 && n10(54, M10 = e21.getItems), "id" in e21 && n10(55, A10 = e21.id), "name" in e21 && n10(8, T8 = e21.name), "container" in e21 && n10(0, N8 = e21.container), "input" in e21 && n10(1, D10 = e21.input), "multiple" in e21 && n10(9, z10 = e21.multiple), "multiFullItemClearable" in e21 && n10(10, L10 = e21.multiFullItemClearable), "disabled" in e21 && n10(11, V10 = e21.disabled), "focused" in e21 && n10(2, W10 = e21.focused), "value" in e21 && n10(3, J10 = e21.value), "filterText" in e21 && n10(4, G10 = e21.filterText), "placeholder" in e21 && n10(56, Y10 = e21.placeholder), "placeholderAlwaysShow" in e21 && n10(57, Z10 = e21.placeholderAlwaysShow), "items" in e21 && n10(51, te2 = e21.items), "label" in e21 && n10(12, re2 = e21.label), "itemFilter" in e21 && n10(58, ie2 = e21.itemFilter), "groupBy" in e21 && n10(59, se2 = e21.groupBy), "groupFilter" in e21 && n10(60, le2 = e21.groupFilter), "groupHeaderSelectable" in e21 && n10(61, fe2 = e21.groupHeaderSelectable), "itemId" in e21 && n10(13, he2 = e21.itemId), "loadOptions" in e21 && n10(62, pe2 = e21.loadOptions), "containerStyles" in e21 && n10(14, ge2 = e21.containerStyles), "hasError" in e21 && n10(15, be2 = e21.hasError), "filterSelectedItems" in e21 && n10(63, we2 = e21.filterSelectedItems), "required" in e21 && n10(16, je2 = e21.required), "closeListOnChange" in e21 && n10(64, Ce2 = e21.closeListOnChange), "clearFilterTextOnBlur" in e21 && n10(65, _e2 = e21.clearFilterTextOnBlur), "createGroupHeaderItem" in e21 && n10(66, Me2 = e21.createGroupHeaderItem), "searchable" in e21 && n10(17, Ae2 = e21.searchable), "inputStyles" in e21 && n10(18, Te2 = e21.inputStyles), "clearable" in e21 && n10(68, Ne2 = e21.clearable), "loading" in e21 && n10(5, De2 = e21.loading), "listOpen" in e21 && n10(6, ze2 = e21.listOpen), "debounce" in e21 && n10(69, Le2 = e21.debounce), "debounceWait" in e21 && n10(70, Ve2 = e21.debounceWait), "hideEmptyState" in e21 && n10(19, We2 = e21.hideEmptyState), "inputAttributes" in e21 && n10(71, Je2 = e21.inputAttributes), "listAutoWidth" in e21 && n10(72, Ge2 = e21.listAutoWidth), "showChevron" in e21 && n10(20, Ye2 = e21.showChevron), "listOffset" in e21 && n10(73, Ze2 = e21.listOffset), "hoverItemIndex" in e21 && n10(7, tt2 = e21.hoverItemIndex), "floatingConfig" in e21 && n10(74, rt2 = e21.floatingConfig), "class" in e21 && n10(21, it2 = e21.class), "ariaValues" in e21 && n10(75, gt2 = e21.ariaValues), "ariaListOpen" in e21 && n10(76, bt2 = e21.ariaListOpen), "ariaFocused" in e21 && n10(77, wt2 = e21.ariaFocused), "$$scope" in e21 && n10(82, w10 = e21.$$scope); + }, e20.$$.update = function() { + var t11, d11, y11, b11, k11; + (8 & e20.$$.dirty[0] | 1048576 & e20.$$.dirty[1] && J10 && function() { + if ("string" == typeof J10) { + var e21 = (te2 || []).find(function(e23) { + return e23[he2] === J10; + }); + n10(3, J10 = e21 || qo(qo({}, he2, J10), "label", J10)); + } else + z10 && Array.isArray(J10) && J10.length > 0 && n10(3, J10 = J10.map(function(e23) { + return "string" == typeof e23 ? { value: e23, label: e23 } : e23; + })); + }(), 131072 & e20.$$.dirty[0] | 512 & e20.$$.dirty[2] && (!Je2 && Ae2 || (n10(27, g10 = Object.assign({ autocapitalize: "none", autocomplete: "off", autocorrect: "off", spellcheck: false, tabindex: 0, type: "text", "aria-autocomplete": "list" }, Je2)), A10 && n10(27, g10.id = A10, g10), Ae2 || n10(27, g10.readonly = true, g10))), 512 & e20.$$.dirty[0] && z10 && J10 && (Array.isArray(J10) ? n10(3, J10 = Bo(J10)) : n10(3, J10 = [J10])), 512 & e20.$$.dirty[0] | 262144 & e20.$$.dirty[2] && m10 && !z10 && J10 && n10(3, J10 = null), 520 & e20.$$.dirty[0] && z10 && J10 && J10.length > 1 && ct2(), 8 & e20.$$.dirty[0] && J10 && (z10 ? JSON.stringify(J10) !== JSON.stringify(v10) && ct2() && j10("input", J10) : v10 && JSON.stringify(J10[he2]) === JSON.stringify(v10[he2]) || j10("input", J10)), 520 & e20.$$.dirty[0] | 65536 & e20.$$.dirty[2] && !J10 && z10 && v10 && j10("input", J10), 6 & e20.$$.dirty[0] && !W10 && D10 && pt2(), 16 & e20.$$.dirty[0] | 131072 & e20.$$.dirty[2] && G10 !== p10 && (pe2 || 0 !== G10.length) && (pe2 ? Le2(xo(ko().mark(function e21() { + var t12; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return n10(5, De2 = true), e23.next = 3, M10({ dispatch: j10, loadOptions: pe2, convertStringItemsToObjects: YR, filterText: G10 }); + case 3: + (t12 = e23.sent) ? (n10(5, De2 = t12.loading), n10(6, ze2 = ze2 ? t12.listOpen : G10.length > 0), n10(2, W10 = ze2 && t12.focused), n10(51, te2 = se2 ? at2(t12.filteredItems) : t12.filteredItems)) : (n10(5, De2 = false), n10(2, W10 = true), n10(6, ze2 = true)); + case 5: + case "end": + return e23.stop(); + } + }, e21); + })), Ve2) : (n10(6, ze2 = true), z10 && n10(26, h10 = void 0))), 12824 & e20.$$.dirty[0] | 407896064 & e20.$$.dirty[1] | 3 & e20.$$.dirty[2] && n10(24, l10 = _10({ loadOptions: pe2, filterText: G10, items: te2, multiple: z10, value: J10, itemId: he2, groupBy: se2, label: re2, filterSelectedItems: we2, itemFilter: ie2, convertStringItemsToObjects: YR, filterGroupedItems: at2 })), 16777800 & e20.$$.dirty[0] && !z10 && ze2 && J10 && l10 && (t11 = l10.findIndex(function(e21) { + return e21[he2] === J10[he2]; + }), st2(t11, true)), 576 & e20.$$.dirty[0] && ze2 && z10 && n10(7, tt2 = 0), 16 & e20.$$.dirty[0] && G10 && n10(7, tt2 = 0), 128 & e20.$$.dirty[0] && function(e21) { + j10("hoverItem", e21); + }(tt2), 520 & e20.$$.dirty[0] && n10(25, r10 = z10 ? J10 && J10.length > 0 : J10), 33554448 & e20.$$.dirty[0] && n10(35, o10 = r10 && G10.length > 0), 33556512 & e20.$$.dirty[0] | 64 & e20.$$.dirty[2] && n10(34, i10 = r10 && Ne2 && !V10 && !De2), 520 & e20.$$.dirty[0] | 100663296 & e20.$$.dirty[1]) && n10(33, a10 = Z10 && z10 || z10 && 0 === (null === (d11 = J10) || void 0 === d11 ? void 0 : d11.length) ? Y10 : J10 ? "" : Y10); + (520 & e20.$$.dirty[0] && n10(32, s10 = J10 ? (y11 = void 0, y11 = z10 && J10.length > 0 ? J10.map(function(e21) { + return e21[re2]; + }).join(", ") : J10[re2], gt2(y11)) : ""), 16777412 & e20.$$.dirty[0] && n10(31, c10 = function() { + if (!l10 || 0 === l10.length) + return ""; + var e21 = l10[tt2]; + if (ze2 && e21) { + var t12 = l10 ? l10.length : 0; + return bt2(e21[re2], t12); + } + return wt2(); + }()), 1048576 & e20.$$.dirty[1] && function(e21) { + e21 && 0 !== e21.length && !e21.some(function(e23) { + return "object" !== Ho(e23); + }) && J10 && (z10 ? !J10.some(function(e23) { + return !e23 || !e23[he2]; + }) : J10[he2]) && (Array.isArray(J10) ? n10(3, J10 = J10.map(function(e23) { + return lt2(e23) || e23; + })) : n10(3, J10 = lt2() || J10)); + }(te2), 8712 & e20.$$.dirty[0] && n10(52, C10 = z10 ? J10 ? J10.map(function(e21) { + return e21[he2]; + }) : null : J10 ? J10[he2] : J10), 520 & e20.$$.dirty[0] | 65536 & e20.$$.dirty[2] && (z10 || !v10 || J10 || j10("input", J10)), 16777800 & e20.$$.dirty[0] && ze2 && l10 && !z10 && !J10 && st2(), 16777216 & e20.$$.dirty[0] && function(e21) { + ze2 && j10("filter", e21); + }(l10), 1 & e20.$$.dirty[0] | 4096 & e20.$$.dirty[2]) && (N8 && void 0 === (null === (b11 = rt2) || void 0 === b11 ? void 0 : b11.autoUpdate) && n10(81, Rt2.autoUpdate = true, Rt2)); + 1 & e20.$$.dirty[0] | 528384 & e20.$$.dirty[2] && N8 && rt2 && zt2(Object.assign(Rt2, rt2)), 8388608 & e20.$$.dirty[0] && n10(30, u10 = !!jt2), 8388672 & e20.$$.dirty[0] && function(e21, t12) { + if (!e21 || !t12) + return n10(28, Bt2 = true); + setTimeout(function() { + n10(28, Bt2 = false); + }, 0); + }(jt2, ze2), 8388673 & e20.$$.dirty[0] && ze2 && N8 && jt2 && (k11 = N8.getBoundingClientRect().width, n10(23, jt2.style.width = Ge2 ? k11 + "px" : "auto", jt2)), 128 & e20.$$.dirty[0] && n10(29, f10 = tt2), 70 & e20.$$.dirty[0] && D10 && ze2 && !W10 && dt2(); + }, [N8, D10, W10, J10, G10, De2, ze2, tt2, T8, z10, L10, V10, re2, he2, ge2, be2, je2, Ae2, Te2, We2, Ye2, it2, function() { + j10("clear", J10), n10(3, J10 = void 0), pt2(), dt2(); + }, jt2, l10, r10, h10, g10, Bt2, f10, u10, c10, s10, a10, i10, o10, ut2, function(e21) { + if (W10) + switch (e21.stopPropagation(), e21.key) { + case "Escape": + e21.preventDefault(), pt2(); + break; + case "Enter": + if (e21.preventDefault(), ze2) { + if (0 === l10.length) + break; + var t11 = l10[tt2]; + if (J10 && !z10 && J10[he2] === t11[he2]) { + pt2(); + break; + } + $t2(l10[tt2]); + } + break; + case "ArrowDown": + e21.preventDefault(), ze2 ? Mt2(1) : (n10(6, ze2 = true), n10(26, h10 = void 0)); + break; + case "ArrowUp": + e21.preventDefault(), ze2 ? Mt2(-1) : (n10(6, ze2 = true), n10(26, h10 = void 0)); + break; + case "Tab": + if (ze2 && W10) { + if (0 === l10.length || J10 && J10[he2] === l10[tt2][he2]) + return pt2(); + e21.preventDefault(), $t2(l10[tt2]), pt2(); + } + break; + case "Backspace": + if (!z10 || G10.length > 0) + return; + if (z10 && J10 && J10.length > 0) { + if (ut2(void 0 !== h10 ? h10 : J10.length - 1), 0 === h10 || void 0 === h10) + break; + n10(26, h10 = J10.length > h10 ? h10 - 1 : void 0); + } + break; + case "ArrowLeft": + if (!J10 || !z10 || G10.length > 0) + return; + void 0 === h10 ? n10(26, h10 = J10.length - 1) : J10.length > h10 && 0 !== h10 && n10(26, h10 -= 1); + break; + case "ArrowRight": + if (!J10 || !z10 || G10.length > 0 || void 0 === h10) + return; + h10 === J10.length - 1 ? n10(26, h10 = void 0) : h10 < J10.length - 1 && n10(26, h10 += 1); + } + }, dt2, ht2, function() { + if (!V10) + return G10.length > 0 ? n10(6, ze2 = true) : void n10(6, ze2 = !ze2); + }, St2, function(e21) { + var t11; + ze2 || W10 || !N8 || N8.contains(e21.target) || null !== (t11 = jt2) && void 0 !== t11 && t11.contains(e21.target) || ht2(); + }, _t2, Ot2, function(e21, t11, n11) { + if (!z10) + return t11 && t11[n11] === e21[n11]; + }, Et2, At2, Dt2, qt2, x10, te2, C10, _10, M10, A10, Y10, Z10, ie2, se2, le2, fe2, pe2, we2, Ce2, _e2, Me2, function() { + return l10; + }, Ne2, Le2, Ve2, Je2, Ge2, Ze2, rt2, gt2, bt2, wt2, v10, p10, m10, Rt2, w10, k10, function(t11) { + ea.call(this, e20, t11); + }, function(t11) { + ea.call(this, e20, t11); + }, function(t11) { + ea.call(this, e20, t11); + }, function(t11) { + ea.call(this, e20, t11); + }, function(e21) { + return _t2(e21); + }, function(e21) { + return _t2(e21); + }, function(e21, t11) { + return Ot2({ item: e21, i: t11 }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(23, jt2 = e21); + }); + }, function(e21) { + return ut2(e21); + }, function(e21) { + return L10 ? ut2(e21) : {}; + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(1, D10 = e21); + }); + }, function() { + G10 = this.value, n10(4, G10); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(0, N8 = e21); + }); + }]; + } + var ZR = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, XR, QR, Xo, { justValue: 52, filter: 53, getItems: 54, id: 55, name: 8, container: 0, input: 1, multiple: 9, multiFullItemClearable: 10, disabled: 11, focused: 2, value: 3, filterText: 4, placeholder: 56, placeholderAlwaysShow: 57, items: 51, label: 12, itemFilter: 58, groupBy: 59, groupFilter: 60, groupHeaderSelectable: 61, itemId: 13, loadOptions: 62, containerStyles: 14, hasError: 15, filterSelectedItems: 63, required: 16, closeListOnChange: 64, clearFilterTextOnBlur: 65, createGroupHeaderItem: 66, getFilteredItems: 67, searchable: 17, inputStyles: 18, clearable: 68, loading: 5, listOpen: 6, debounce: 69, debounceWait: 70, hideEmptyState: 19, inputAttributes: 71, listAutoWidth: 72, showChevron: 20, listOffset: 73, hoverItemIndex: 7, floatingConfig: 74, class: 21, handleClear: 22, ariaValues: 75, ariaListOpen: 76, ariaFocused: 77 }, nR, [-1, -1, -1, -1, -1]), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "getFilteredItems", get: function() { + return this.$$.ctx[67]; + } }, { key: "handleClear", get: function() { + return this.$$.ctx[22]; + } }]), t10; + }(); + function eN(e20) { + mi(e20, "svelte-ijtq0l", "table.jse-transform-wizard.svelte-ijtq0l.svelte-ijtq0l{border-collapse:collapse;border-spacing:0;width:100%}table.jse-transform-wizard.svelte-ijtq0l input.svelte-ijtq0l{font-family:inherit;font-size:inherit}table.jse-transform-wizard.svelte-ijtq0l tr th.svelte-ijtq0l{font-weight:normal;text-align:left;width:60px}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l{width:100%;display:flex;flex-direction:row;margin-bottom:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select .multi-item{align-items:center}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select .value-container{gap:0 !important}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-filter-path{flex:4;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-filter-relation{flex:1.5;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-sort-path{flex:3;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-sort-direction{flex:1}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-projection-paths{flex:1}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select input{box-sizing:border-box}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal .jse-filter-value.svelte-ijtq0l{flex:4;padding:4px 8px;border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:var(--jse-input-radius, 3px);outline:none;background:var(--jse-input-background, var(--jse-background-color, #fff));color:inherit}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal .jse-filter-value.svelte-ijtq0l:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}"); + } + function tN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10, E10, A10, P10, T8, R8, N8; + function I10(t11) { + e20[16](t11); + } + var D10 = { class: "jse-filter-path", showChevron: true, items: e20[7] }; + function q10(t11) { + e20[17](t11); + } + void 0 !== e20[0] && (D10.value = e20[0]), s10 = new ZR({ props: D10 }), na.push(function() { + return Aa(s10, "value", I10); + }); + var z10 = { class: "jse-filter-relation", showChevron: true, items: e20[8] }; + function B10(t11) { + e20[19](t11); + } + void 0 !== e20[1] && (z10.value = e20[1]), u10 = new ZR({ props: z10 }), na.push(function() { + return Aa(u10, "value", q10); + }); + var L10 = { class: "jse-sort-path", showChevron: true, items: e20[7] }; + function F10(t11) { + e20[20](t11); + } + void 0 !== e20[3] && (L10.value = e20[3]), k10 = new ZR({ props: L10 }), na.push(function() { + return Aa(k10, "value", B10); + }); + var V10 = { class: "jse-sort-direction", showChevron: true, items: e20[9] }; + function H10(t11) { + e20[21](t11); + } + void 0 !== e20[4] && (V10.value = e20[4]), j10 = new ZR({ props: V10 }), na.push(function() { + return Aa(j10, "value", F10); + }); + var W10 = { class: "jse-projection-paths", multiple: true, showChevron: true, items: e20[6] }; + return void 0 !== e20[5] && (W10.value = e20[5]), A10 = new ZR({ props: W10 }), na.push(function() { + return Aa(A10, "value", H10); + }), { c: function() { + t10 = ji("table"), n10 = ji("tr"), (r10 = ji("th")).textContent = "Filter", o10 = $i(), i10 = ji("td"), a10 = ji("div"), Pa(s10.$$.fragment), l10 = $i(), Pa(u10.$$.fragment), d10 = $i(), h10 = ji("input"), v10 = $i(), p10 = ji("tr"), (m10 = ji("th")).textContent = "Sort", g10 = $i(), y10 = ji("td"), b10 = ji("div"), Pa(k10.$$.fragment), x10 = $i(), Pa(j10.$$.fragment), C10 = $i(), $10 = ji("tr"), (_10 = ji("th")).textContent = "Pick", O10 = $i(), M10 = ji("td"), E10 = ji("div"), Pa(A10.$$.fragment), Ai(r10, "class", "svelte-ijtq0l"), Ai(h10, "class", "jse-filter-value svelte-ijtq0l"), Ai(a10, "class", "jse-horizontal svelte-ijtq0l"), Ai(m10, "class", "svelte-ijtq0l"), Ai(b10, "class", "jse-horizontal svelte-ijtq0l"), Ai(_10, "class", "svelte-ijtq0l"), Ai(E10, "class", "jse-horizontal svelte-ijtq0l"), Ai(t10, "class", "jse-transform-wizard svelte-ijtq0l"); + }, m: function(c11, f11) { + ki(c11, t10, f11), pi(t10, n10), pi(n10, r10), pi(n10, o10), pi(n10, i10), pi(i10, a10), Ta(s10, a10, null), pi(a10, l10), Ta(u10, a10, null), pi(a10, d10), pi(a10, h10), Ii(h10, e20[2]), pi(t10, v10), pi(t10, p10), pi(p10, m10), pi(p10, g10), pi(p10, y10), pi(y10, b10), Ta(k10, b10, null), pi(b10, x10), Ta(j10, b10, null), pi(t10, C10), pi(t10, $10), pi($10, _10), pi($10, O10), pi($10, M10), pi(M10, E10), Ta(A10, E10, null), T8 = true, R8 || (N8 = Oi(h10, "input", e20[18]), R8 = true); + }, p: function(e21, t11) { + var n11 = jo(t11, 1)[0], r11 = {}; + 128 & n11 && (r11.items = e21[7]), !c10 && 1 & n11 && (c10 = true, r11.value = e21[0], ua(function() { + return c10 = false; + })), s10.$set(r11); + var o11 = {}; + !f10 && 2 & n11 && (f10 = true, o11.value = e21[1], ua(function() { + return f10 = false; + })), u10.$set(o11), 4 & n11 && h10.value !== e21[2] && Ii(h10, e21[2]); + var i11 = {}; + 128 & n11 && (i11.items = e21[7]), !w10 && 8 & n11 && (w10 = true, i11.value = e21[3], ua(function() { + return w10 = false; + })), k10.$set(i11); + var a11 = {}; + !S10 && 16 & n11 && (S10 = true, a11.value = e21[4], ua(function() { + return S10 = false; + })), j10.$set(a11); + var l11 = {}; + 64 & n11 && (l11.items = e21[6]), !P10 && 32 & n11 && (P10 = true, l11.value = e21[5], ua(function() { + return P10 = false; + })), A10.$set(l11); + }, i: function(e21) { + T8 || (wa(s10.$$.fragment, e21), wa(u10.$$.fragment, e21), wa(k10.$$.fragment, e21), wa(j10.$$.fragment, e21), wa(A10.$$.fragment, e21), T8 = true); + }, o: function(e21) { + xa(s10.$$.fragment, e21), xa(u10.$$.fragment, e21), xa(k10.$$.fragment, e21), xa(j10.$$.fragment, e21), xa(A10.$$.fragment, e21), T8 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(s10), Ra(u10), Ra(k10), Ra(j10), Ra(A10), R8 = false, N8(); + } }; + } + function nN(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10 = Da("jsoneditor:TransformWizard"), p10 = t10.json, m10 = t10.queryOptions, g10 = void 0 === m10 ? {} : m10, y10 = t10.onChange, b10 = ["==", "!=", "<", "<=", ">", ">="].map(function(e21) { + return { value: e21, label: e21 }; + }), k10 = [{ value: "asc", label: "ascending" }, { value: "desc", label: "descending" }], w10 = null !== (r10 = g10) && void 0 !== r10 && null !== (r10 = r10.filter) && void 0 !== r10 && r10.path ? GO(g10.filter.path) : null, x10 = null !== (o10 = g10) && void 0 !== o10 && null !== (o10 = o10.filter) && void 0 !== o10 && o10.relation ? b10.find(function(e21) { + var t11; + return e21.value === (null === (t11 = g10.filter) || void 0 === t11 ? void 0 : t11.relation); + }) : null, j10 = (null === (i10 = g10) || void 0 === i10 || null === (i10 = i10.filter) || void 0 === i10 ? void 0 : i10.value) || "", S10 = null !== (a10 = g10) && void 0 !== a10 && null !== (a10 = a10.sort) && void 0 !== a10 && a10.path ? GO(g10.sort.path) : null, C10 = null !== (s10 = g10) && void 0 !== s10 && null !== (s10 = s10.sort) && void 0 !== s10 && s10.direction ? k10.find(function(e21) { + var t11; + return e21.value === (null === (t11 = g10.sort) || void 0 === t11 ? void 0 : t11.direction); + }) : null; + return e20.$$set = function(e21) { + "json" in e21 && n10(11, p10 = e21.json), "queryOptions" in e21 && n10(10, g10 = e21.queryOptions), "onChange" in e21 && n10(12, y10 = e21.onChange); + }, e20.$$.update = function() { + var t11, r11, o11, i11, a11, s11, m11, b11, k11, $10, _10, O10, M10; + (2048 & e20.$$.dirty && n10(15, c10 = Array.isArray(p10)), 34816 & e20.$$.dirty && n10(14, l10 = c10 ? T_(p10) : []), 34816 & e20.$$.dirty && n10(13, u10 = c10 ? T_(p10, true) : []), 16384 & e20.$$.dirty && n10(7, f10 = l10.map(GO)), 8192 & e20.$$.dirty && n10(6, d10 = u10 ? u10.map(GO) : []), 1088 & e20.$$.dirty) && n10(5, h10 = null !== (t11 = g10) && void 0 !== t11 && null !== (t11 = t11.projection) && void 0 !== t11 && t11.paths && d10 ? g10.projection.paths.map(function(e21) { + return d10.find(function(t12) { + return Ow(t12.value, e21); + }); + }).filter(function(e21) { + return !!e21; + }) : null); + 1 & e20.$$.dirty && (o11 = null === (r11 = w10) || void 0 === r11 ? void 0 : r11.value, Ow(null === (i11 = g10) || void 0 === i11 || null === (i11 = i11.filter) || void 0 === i11 ? void 0 : i11.path, o11) || (v10("changeFilterPath", o11), n10(10, g10 = Us(g10, ["filter", "path"], o11, true)), y10(g10))); + 2 & e20.$$.dirty && (s11 = null === (a11 = x10) || void 0 === a11 ? void 0 : a11.value, Ow(null === (m11 = g10) || void 0 === m11 || null === (m11 = m11.filter) || void 0 === m11 ? void 0 : m11.relation, s11) || (v10("changeFilterRelation", s11), n10(10, g10 = Us(g10, ["filter", "relation"], s11, true)), y10(g10))); + (4 & e20.$$.dirty && (b11 = j10, Ow(null === (k11 = g10) || void 0 === k11 || null === (k11 = k11.filter) || void 0 === k11 ? void 0 : k11.value, b11) || (v10("changeFilterValue", b11), n10(10, g10 = Us(g10, ["filter", "value"], b11, true)), y10(g10))), 8 & e20.$$.dirty) && function(e21) { + var t12; + Ow(null === (t12 = g10) || void 0 === t12 || null === (t12 = t12.sort) || void 0 === t12 ? void 0 : t12.path, e21) || (v10("changeSortPath", e21), n10(10, g10 = Us(g10, ["sort", "path"], e21, true)), y10(g10)); + }(null === ($10 = S10) || void 0 === $10 ? void 0 : $10.value); + 16 & e20.$$.dirty && (O10 = null === (_10 = C10) || void 0 === _10 ? void 0 : _10.value, Ow(null === (M10 = g10) || void 0 === M10 || null === (M10 = M10.sort) || void 0 === M10 ? void 0 : M10.direction, O10) || (v10("changeSortDirection", O10), n10(10, g10 = Us(g10, ["sort", "direction"], O10, true)), y10(g10))); + 32 & e20.$$.dirty && function(e21) { + var t12; + Ow(null === (t12 = g10) || void 0 === t12 || null === (t12 = t12.projection) || void 0 === t12 ? void 0 : t12.paths, e21) || (v10("changeProjectionPaths", e21), n10(10, g10 = Us(g10, ["projection", "paths"], e21, true)), y10(g10)); + }(h10 ? h10.map(function(e21) { + return e21.value; + }) : void 0); + }, [w10, x10, j10, S10, C10, h10, d10, f10, b10, k10, g10, p10, y10, u10, l10, c10, function(e21) { + n10(0, w10 = e21); + }, function(e21) { + n10(1, x10 = e21); + }, function() { + j10 = this.value, n10(2, j10); + }, function(e21) { + n10(3, S10 = e21); + }, function(e21) { + n10(4, C10 = e21); + }, function(e21) { + n10(5, h10 = e21), n10(10, g10), n10(6, d10), n10(13, u10), n10(15, c10), n10(11, p10); + }]; + } + var rN = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, nN, tN, Zo, { json: 11, queryOptions: 10, onChange: 12 }, eN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function oN(e20) { + mi(e20, "svelte-1wg043c", '.jse-select-query-language.svelte-1wg043c.svelte-1wg043c{position:relative;width:32px}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container.svelte-1wg043c{position:absolute;top:0;right:0;display:flex;flex-direction:column;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container .jse-query-language.svelte-1wg043c{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;text-align:left;padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));white-space:nowrap;color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));background:var(--jse-context-menu-background, #656565)}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container .jse-query-language.svelte-1wg043c:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}'); + } + function iN(e20, t10, n10) { + var r10 = e20.slice(); + return r10[5] = t10[n10], r10; + } + function aN(e20) { + var t10, n10; + return t10 = new jM({ props: { data: aM } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function sN(e20) { + var t10, n10; + return t10 = new jM({ props: { data: iM } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function cN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = e20[5].name + "", d10 = [sN, aN], h10 = []; + function v10(e21, t11) { + return e21[5].id === e21[0] ? 0 : 1; + } + function p10() { + return e20[4](e20[5]); + } + return n10 = v10(e20), r10 = h10[n10] = d10[n10](e20), { c: function() { + t10 = ji("button"), r10.c(), o10 = $i(), i10 = Ci(f10), a10 = $i(), Ai(t10, "type", "button"), Ai(t10, "class", "jse-query-language svelte-1wg043c"), Ai(t10, "title", s10 = "Select ".concat(e20[5].name, " as query language")), zi(t10, "selected", e20[5].id === e20[0]); + }, m: function(e21, r11) { + ki(e21, t10, r11), h10[n10].m(t10, null), pi(t10, o10), pi(t10, i10), pi(t10, a10), c10 = true, l10 || (u10 = Oi(t10, "click", p10), l10 = true); + }, p: function(a11, l11) { + var u11 = n10; + (n10 = v10(e20 = a11)) !== u11 && (ba(), xa(h10[u11], 1, 1, function() { + h10[u11] = null; + }), ka(), (r10 = h10[n10]) || (r10 = h10[n10] = d10[n10](e20)).c(), wa(r10, 1), r10.m(t10, o10)), (!c10 || 2 & l11) && f10 !== (f10 = e20[5].name + "") && Ni(i10, f10), (!c10 || 2 & l11 && s10 !== (s10 = "Select ".concat(e20[5].name, " as query language"))) && Ai(t10, "title", s10), (!c10 || 3 & l11) && zi(t10, "selected", e20[5].id === e20[0]); + }, i: function(e21) { + c10 || (wa(r10), c10 = true); + }, o: function(e21) { + xa(r10), c10 = false; + }, d: function(e21) { + e21 && wi(t10), h10[n10].d(), l10 = false, u10(); + } }; + } + function lN(e20) { + for (var t10, n10, r10, o10 = Ca(e20[1]), i10 = [], a10 = 0; a10 < o10.length; a10 += 1) + i10[a10] = cN(iN(e20, o10, a10)); + var s10 = function(e21) { + return xa(i10[e21], 1, 1, function() { + i10[e21] = null; + }); + }; + return { c: function() { + t10 = ji("div"), n10 = ji("div"); + for (var e21 = 0; e21 < i10.length; e21 += 1) + i10[e21].c(); + Ai(n10, "class", "jse-select-query-language-container svelte-1wg043c"), Ai(t10, "class", "jse-select-query-language svelte-1wg043c"); + }, m: function(e21, o11) { + ki(e21, t10, o11), pi(t10, n10); + for (var a11 = 0; a11 < i10.length; a11 += 1) + i10[a11] && i10[a11].m(n10, null); + r10 = true; + }, p: function(e21, t11) { + var r11 = jo(t11, 1)[0]; + if (7 & r11) { + var a11; + for (o10 = Ca(e21[1]), a11 = 0; a11 < o10.length; a11 += 1) { + var c10 = iN(e21, o10, a11); + i10[a11] ? (i10[a11].p(c10, r11), wa(i10[a11], 1)) : (i10[a11] = cN(c10), i10[a11].c(), wa(i10[a11], 1), i10[a11].m(n10, null)); + } + for (ba(), a11 = o10.length; a11 < i10.length; a11 += 1) + s10(a11); + ka(); + } + }, i: function(e21) { + if (!r10) { + for (var t11 = 0; t11 < o10.length; t11 += 1) + wa(i10[t11]); + r10 = true; + } + }, o: function(e21) { + i10 = i10.filter(Boolean); + for (var t11 = 0; t11 < i10.length; t11 += 1) + xa(i10[t11]); + r10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(i10, e21); + } }; + } + function uN(e20, t10, n10) { + var r10 = t10.queryLanguages, o10 = t10.queryLanguageId, i10 = t10.onChangeQueryLanguage; + function a10(e21) { + n10(0, o10 = e21), i10(e21); + } + return e20.$$set = function(e21) { + "queryLanguages" in e21 && n10(1, r10 = e21.queryLanguages), "queryLanguageId" in e21 && n10(0, o10 = e21.queryLanguageId), "onChangeQueryLanguage" in e21 && n10(3, i10 = e21.onChangeQueryLanguage); + }, [o10, r10, a10, i10, function(e21) { + return a10(e21.id); + }]; + } + var fN = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, uN, lN, Xo, { queryLanguages: 1, queryLanguageId: 0, onChangeQueryLanguage: 3 }, oN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function dN(e20) { + mi(e20, "svelte-1n68mbh", ".jse-header.svelte-1n68mbh.svelte-1n68mbh{display:flex;background:var(--jse-theme-color, #3883fa);color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff))}.jse-header.svelte-1n68mbh .jse-title.svelte-1n68mbh{flex:1;padding:5px;vertical-align:middle}.jse-header.svelte-1n68mbh button.svelte-1n68mbh{border:none;background:transparent;min-width:32px;color:inherit;cursor:pointer}.jse-header.svelte-1n68mbh button.svelte-1n68mbh:hover{background:rgba(255, 255, 255, 0.1)}"); + } + function hN(e20) { + var t10, n10, r10, o10, i10; + return n10 = new jM({ props: { data: mP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-config svelte-1n68mbh"), Ai(t10, "title", "Select a query language"); + }, m: function(a10, s10) { + ki(a10, t10, s10), Ta(n10, t10, null), e20[6](t10), r10 = true, o10 || (i10 = Oi(t10, "click", e20[3]), o10 = true); + }, p: Wo, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(r11) { + r11 && wi(t10), Ra(n10), e20[6](null), o10 = false, i10(); + } }; + } + function vN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10 = e20[0].length > 1 && hN(e20); + return a10 = new jM({ props: { data: MP } }), { c: function() { + t10 = ji("div"), (n10 = ji("div")).textContent = "Transform", r10 = $i(), u10 && u10.c(), o10 = $i(), i10 = ji("button"), Pa(a10.$$.fragment), Ai(n10, "class", "jse-title svelte-1n68mbh"), Ai(i10, "type", "button"), Ai(i10, "class", "jse-close svelte-1n68mbh"), Ai(t10, "class", "jse-header svelte-1n68mbh"); + }, m: function(f10, d10) { + ki(f10, t10, d10), pi(t10, n10), pi(t10, r10), u10 && u10.m(t10, null), pi(t10, o10), pi(t10, i10), Ta(a10, i10, null), s10 = true, c10 || (l10 = Oi(i10, "click", e20[7]), c10 = true); + }, p: function(e21, n11) { + var r11 = jo(n11, 1)[0]; + e21[0].length > 1 ? u10 ? (u10.p(e21, r11), 1 & r11 && wa(u10, 1)) : ((u10 = hN(e21)).c(), wa(u10, 1), u10.m(t10, o10)) : u10 && (ba(), xa(u10, 1, 1, function() { + u10 = null; + }), ka()); + }, i: function(e21) { + s10 || (wa(u10), wa(a10.$$.fragment, e21), s10 = true); + }, o: function(e21) { + xa(u10), xa(a10.$$.fragment, e21), s10 = false; + }, d: function(e21) { + e21 && wi(t10), u10 && u10.d(), Ra(a10), c10 = false, l10(); + } }; + } + function pN(e20, t10, n10) { + var r10, o10, i10 = t10.queryLanguages, a10 = t10.queryLanguageId, s10 = t10.onChangeQueryLanguage, c10 = Zi("simple-modal").close, l10 = Zi("absolute-popup"), u10 = l10.openAbsolutePopup, f10 = l10.closeAbsolutePopup; + return e20.$$set = function(e21) { + "queryLanguages" in e21 && n10(0, i10 = e21.queryLanguages), "queryLanguageId" in e21 && n10(4, a10 = e21.queryLanguageId), "onChangeQueryLanguage" in e21 && n10(5, s10 = e21.onChangeQueryLanguage); + }, [i10, r10, c10, function() { + var e21 = { queryLanguages: i10, queryLanguageId: a10, onChangeQueryLanguage: function(e23) { + f10(o10), s10(e23); + } }; + o10 = u10(fN, e21, { offsetTop: -2, offsetLeft: 0, anchor: r10, closeOnOuterClick: true }); + }, a10, s10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(1, r10 = e21); + }); + }, function() { + return c10(); + }]; + } + var mN = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, pN, vN, Zo, { queryLanguages: 0, queryLanguageId: 4, onChangeQueryLanguage: 5 }, dN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var gN = Da("jsoneditor:AutoScrollHandler"); + var yN = function(e20, t10, n10, r10) { + return (e20 /= r10 / 2) < 1 ? n10 / 2 * e20 * e20 + t10 : -n10 / 2 * (--e20 * (e20 - 2) - 1) + t10; + }; + var bN = function() { + var e20, t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10; + function h10(t11) { + return t11.getBoundingClientRect().top - (e20.getBoundingClientRect ? e20.getBoundingClientRect().top : 0) + n10; + } + function v10(t11) { + e20.scrollTo ? e20.scrollTo(e20.scrollLeft, t11) : e20.scrollTop = t11; + } + function p10(e21) { + l10 || (l10 = e21), v10(i10(u10 = e21 - l10, n10, s10, c10)), d10 = true, u10 < c10 ? requestAnimationFrame(p10) : function() { + if (v10(n10 + s10), t10 && a10) { + t10.setAttribute("tabindex", "-1"), t10.focus(); + } + "function" == typeof f10 && f10(); + l10 = 0, d10 = false; + }(); + } + return function(u11) { + var v11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + switch (c10 = 1e3, o10 = v11.offset || 0, f10 = v11.callback, i10 = v11.easing || yN, a10 = v11.a11y || false, Ho(v11.container)) { + case "object": + e20 = v11.container; + break; + case "string": + e20 = document.querySelector(v11.container); + break; + default: + e20 = window.document.documentElement; + } + switch (n10 = e20.scrollTop, Ho(u11)) { + case "number": + t10 = void 0, a10 = false, r10 = n10 + u11; + break; + case "object": + r10 = h10(t10 = u11); + break; + case "string": + t10 = document.querySelector(u11), r10 = h10(t10); + } + switch (s10 = r10 - n10 + o10, Ho(v11.duration)) { + case "number": + c10 = v11.duration; + break; + case "function": + c10 = v11.duration(s10); + } + d10 ? l10 = 0 : requestAnimationFrame(p10); + }; + }; + var kN = 1e3; + var wN = Da("jsoneditor:History"); + function xN() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t10 = e20.maxItems || kN, n10 = [], r10 = 0; + function o10() { + return r10 < n10.length; + } + function i10() { + return r10 > 0; + } + function a10() { + return { canUndo: o10(), canRedo: i10(), length: n10.length }; + } + function s10() { + e20.onChange && e20.onChange(a10()); + } + return { add: function(e21) { + wN("add", e21), n10 = [e21].concat(n10.slice(r10)).slice(0, t10), r10 = 0, s10(); + }, clear: function() { + wN("clear"), n10 = [], r10 = 0, s10(); + }, getState: a10, undo: function() { + if (o10()) { + var e21 = n10[r10]; + return r10 += 1, wN("undo", e21), s10(), e21; + } + }, redo: function() { + if (i10()) + return wN("redo", n10[r10 -= 1]), s10(), n10[r10]; + } }; + } + function jN(e20, t10) { + var n10 = Date.now(), r10 = e20(); + return t10(Date.now() - n10), r10; + } + var SN = Da("validation"); + function CN(e20, t10, n10, r10) { + if (SN("validateJSON"), !t10) + return []; + if (n10 !== r10) { + var o10 = n10.stringify(e20); + return t10(void 0 !== o10 ? r10.parse(o10) : void 0); + } + return t10(e20); + } + function $N(e20, t10, n10, r10) { + if (SN("validateText"), e20.length > hs) + return { validationErrors: [{ path: [], message: "Validation turned off: the document is too large", severity: Za.info }] }; + if (0 === e20.length) + return null; + try { + var o10 = jN(function() { + return n10.parse(e20); + }, function(e21) { + return SN("validate: parsed json in ".concat(e21, " ms")); + }); + if (!t10) + return null; + var i10 = n10 === r10 ? o10 : jN(function() { + return r10.parse(e20); + }, function(e21) { + return SN("validate: parsed json with the validationParser in ".concat(e21, " ms")); + }), a10 = jN(function() { + return t10(i10); + }, function(e21) { + return SN("validate: validated json in ".concat(e21, " ms")); + }); + return _w(a10) ? null : { validationErrors: a10 }; + } catch (t11) { + var s10 = jN(function() { + return function(e21, t12) { + if (e21.length > vs) + return false; + try { + return t12.parse(Hl(e21)), true; + } catch (e23) { + return false; + } + }(e20, n10); + }, function(e21) { + return SN("validate: checked whether repairable in ".concat(e21, " ms")); + }); + return { parseError: H_(e20, t11.message || t11.toString()), isRepairable: s10 }; + } + } + var _N = Da("jsoneditor:FocusTracker"); + function ON(e20) { + var t10, n10 = e20.onMount, r10 = e20.onDestroy, o10 = e20.getWindow, i10 = e20.hasFocus, a10 = e20.onFocus, s10 = e20.onBlur, c10 = false; + function l10() { + var e21 = i10(); + e21 && (clearTimeout(t10), c10 || (_N("focus"), a10(), c10 = e21)); + } + function u10() { + c10 && (clearTimeout(t10), t10 = setTimeout(function() { + i10() || (_N("blur"), c10 = false, s10()); + })); + } + n10(function() { + _N("mount FocusTracker"); + var e21 = o10(); + e21 && (e21.addEventListener("focusin", l10, true), e21.addEventListener("focusout", u10, true)); + }), r10(function() { + _N("destroy FocusTracker"); + var e21 = o10(); + e21 && (e21.removeEventListener("focusin", l10, true), e21.removeEventListener("focusout", u10, true)); + }); + } + function MN(e20) { + mi(e20, "svelte-p1zf9f", '.jse-message.svelte-p1zf9f.svelte-p1zf9f{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);padding:var(--jse-padding, 10px);display:flex;gap:var(--jse-padding, 10px);flex-wrap:wrap;align-items:stretch}.jse-message.jse-success.svelte-p1zf9f.svelte-p1zf9f{background:var(--message-success-background, #9ac45d);color:var(--jse-message-success-color, #fff)}.jse-message.svelte-p1zf9f .jse-text.svelte-p1zf9f{display:flex;flex:1;min-width:60%;align-items:center}.jse-message.svelte-p1zf9f .jse-text.jse-clickable.svelte-p1zf9f{cursor:pointer}.jse-message.svelte-p1zf9f .jse-text.jse-clickable.svelte-p1zf9f:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-message.jse-error.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-error-background, var(--jse-error-color, #ee5341));color:var(--jse-message-error-color, #fff)}.jse-message.jse-warning.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-warning-background, #ffde5c);color:var(--jse-message-warning-color, #4d4d4d)}.jse-message.jse-info.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-info-background, #4f91ff);color:var(--jse-message-info-color, #fff)}.jse-message.svelte-p1zf9f .jse-actions.svelte-p1zf9f{display:flex;gap:var(--jse-padding, 10px)}.jse-message.svelte-p1zf9f .jse-actions button.jse-action.svelte-p1zf9f{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-message-action-background, rgba(255, 255, 255, 0.2));color:inherit;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px)}.jse-message.svelte-p1zf9f .jse-actions button.jse-action.svelte-p1zf9f:hover{background:var(--jse-message-action-background-highlight, rgba(255, 255, 255, 0.3))}'); + } + function EN(e20, t10, n10) { + var r10 = e20.slice(); + return r10[9] = t10[n10], r10; + } + function AN(e20) { + var t10, n10; + return t10 = new jM({ props: { data: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 2 & n11 && (r10.data = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function PN(e20) { + var t10, n10; + return t10 = new jM({ props: { data: e20[9].icon } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 8 & n11 && (r10.data = e21[9].icon), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function TN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10 = e20[9].text + "", f10 = e20[9].icon && PN(e20); + function d10() { + return e20[7](e20[9]); + } + function h10() { + return e20[8](e20[9]); + } + return { c: function() { + t10 = ji("button"), f10 && f10.c(), n10 = $i(), r10 = Ci(u10), o10 = $i(), Ai(t10, "type", "button"), Ai(t10, "class", "jse-button jse-action jse-primary svelte-p1zf9f"), Ai(t10, "title", i10 = e20[9].title), t10.disabled = a10 = e20[9].disabled; + }, m: function(e21, i11) { + ki(e21, t10, i11), f10 && f10.m(t10, null), pi(t10, n10), pi(t10, r10), pi(t10, o10), s10 = true, c10 || (l10 = [Oi(t10, "click", d10), Oi(t10, "mousedown", h10)], c10 = true); + }, p: function(o11, c11) { + (e20 = o11)[9].icon ? f10 ? (f10.p(e20, c11), 8 & c11 && wa(f10, 1)) : ((f10 = PN(e20)).c(), wa(f10, 1), f10.m(t10, n10)) : f10 && (ba(), xa(f10, 1, 1, function() { + f10 = null; + }), ka()), (!s10 || 8 & c11) && u10 !== (u10 = e20[9].text + "") && Ni(r10, u10), (!s10 || 8 & c11 && i10 !== (i10 = e20[9].title)) && Ai(t10, "title", i10), (!s10 || 8 & c11 && a10 !== (a10 = e20[9].disabled)) && (t10.disabled = a10); + }, i: function(e21) { + s10 || (wa(f10), s10 = true); + }, o: function(e21) { + xa(f10), s10 = false; + }, d: function(e21) { + e21 && wi(t10), f10 && f10.d(), c10 = false, Qo(l10); + } }; + } + function RN(e20) { + for (var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10 = e20[1] && AN(e20), h10 = Ca(e20[3]), v10 = [], p10 = 0; p10 < h10.length; p10 += 1) + v10[p10] = TN(EN(e20, h10, p10)); + var m10 = function(e21) { + return xa(v10[e21], 1, 1, function() { + v10[e21] = null; + }); + }; + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = ji("div"), d10 && d10.c(), o10 = $i(), i10 = Ci(e20[2]), a10 = $i(), s10 = ji("div"); + for (var l11 = 0; l11 < v10.length; l11 += 1) + v10[l11].c(); + Ai(r10, "class", "jse-text-centered"), Ai(n10, "role", "button"), Ai(n10, "tabindex", "-1"), Ai(n10, "class", "jse-text svelte-p1zf9f"), zi(n10, "jse-clickable", !!e20[4]), Ai(s10, "class", "jse-actions svelte-p1zf9f"), Ai(t10, "class", c10 = "jse-message jse-" + e20[0] + " svelte-p1zf9f"); + }, m: function(c11, h11) { + ki(c11, t10, h11), pi(t10, n10), pi(n10, r10), d10 && d10.m(r10, null), pi(r10, o10), pi(r10, i10), pi(t10, a10), pi(t10, s10); + for (var p11 = 0; p11 < v10.length; p11 += 1) + v10[p11] && v10[p11].m(s10, null); + l10 = true, u10 || (f10 = Oi(n10, "click", e20[5]), u10 = true); + }, p: function(e21, a11) { + var u11 = jo(a11, 1)[0]; + if (e21[1] ? d10 ? (d10.p(e21, u11), 2 & u11 && wa(d10, 1)) : ((d10 = AN(e21)).c(), wa(d10, 1), d10.m(r10, o10)) : d10 && (ba(), xa(d10, 1, 1, function() { + d10 = null; + }), ka()), (!l10 || 4 & u11) && Ni(i10, e21[2]), (!l10 || 16 & u11) && zi(n10, "jse-clickable", !!e21[4]), 8 & u11) { + var f11; + for (h10 = Ca(e21[3]), f11 = 0; f11 < h10.length; f11 += 1) { + var p11 = EN(e21, h10, f11); + v10[f11] ? (v10[f11].p(p11, u11), wa(v10[f11], 1)) : (v10[f11] = TN(p11), v10[f11].c(), wa(v10[f11], 1), v10[f11].m(s10, null)); + } + for (ba(), f11 = h10.length; f11 < v10.length; f11 += 1) + m10(f11); + ka(); + } + (!l10 || 1 & u11 && c10 !== (c10 = "jse-message jse-" + e21[0] + " svelte-p1zf9f")) && Ai(t10, "class", c10); + }, i: function(e21) { + if (!l10) { + wa(d10); + for (var t11 = 0; t11 < h10.length; t11 += 1) + wa(v10[t11]); + l10 = true; + } + }, o: function(e21) { + xa(d10), v10 = v10.filter(Boolean); + for (var t11 = 0; t11 < v10.length; t11 += 1) + xa(v10[t11]); + l10 = false; + }, d: function(e21) { + e21 && wi(t10), d10 && d10.d(), xi(v10, e21), u10 = false, f10(); + } }; + } + function NN(e20, t10, n10) { + var r10 = t10.type, o10 = void 0 === r10 ? "success" : r10, i10 = t10.icon, a10 = void 0 === i10 ? void 0 : i10, s10 = t10.message, c10 = void 0 === s10 ? void 0 : s10, l10 = t10.actions, u10 = void 0 === l10 ? [] : l10, f10 = t10.onClick, d10 = void 0 === f10 ? void 0 : f10, h10 = t10.onClose, v10 = void 0 === h10 ? void 0 : h10; + v10 && Qi(v10); + return e20.$$set = function(e21) { + "type" in e21 && n10(0, o10 = e21.type), "icon" in e21 && n10(1, a10 = e21.icon), "message" in e21 && n10(2, c10 = e21.message), "actions" in e21 && n10(3, u10 = e21.actions), "onClick" in e21 && n10(4, d10 = e21.onClick), "onClose" in e21 && n10(6, v10 = e21.onClose); + }, [o10, a10, c10, u10, d10, function() { + d10 && d10(); + }, v10, function(e21) { + e21.onClick && e21.onClick(); + }, function(e21) { + e21.onMouseDown && e21.onMouseDown(); + }]; + } + var IN = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, NN, RN, Zo, { type: 0, icon: 1, message: 2, actions: 3, onClick: 4, onClose: 6 }, MN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function DN(e20) { + mi(e20, "svelte-1ifg4t0", '.jse-validation-errors-overview.svelte-1ifg4t0.svelte-1ifg4t0{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);background:var(--jse-message-warning-background, #ffde5c);color:var(--jse-message-warning-color, #4d4d4d);overflow:auto;max-height:25%}.jse-validation-errors-overview.svelte-1ifg4t0 table.svelte-1ifg4t0{border-collapse:collapse;width:100%}.jse-validation-errors-overview.svelte-1ifg4t0 table tr.svelte-1ifg4t0{cursor:pointer}.jse-validation-errors-overview.svelte-1ifg4t0 table tr.svelte-1ifg4t0:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-validation-errors-overview.svelte-1ifg4t0 table tr td.svelte-1ifg4t0{padding:4px var(--jse-padding, 10px);vertical-align:middle}.jse-validation-errors-overview.svelte-1ifg4t0 table tr td.jse-validation-error-icon.svelte-1ifg4t0{width:36px;box-sizing:border-box}.jse-validation-errors-overview.svelte-1ifg4t0 table tr td.jse-validation-error-action.svelte-1ifg4t0{width:36px;box-sizing:border-box;padding:0}.jse-validation-errors-overview.svelte-1ifg4t0 table tr td.jse-validation-error-action button.jse-validation-errors-collapse.svelte-1ifg4t0{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:36px;height:26px;cursor:pointer}.jse-validation-errors-overview.svelte-1ifg4t0 table tr td.jse-validation-error-action button.jse-validation-errors-collapse.svelte-1ifg4t0:hover{background-color:rgba(255, 255, 255, 0.2)}.jse-validation-errors-overview.svelte-1ifg4t0 table tr td div.jse-validation-errors-expand.svelte-1ifg4t0{display:inline-block;position:relative;top:3px}'); + } + function qN(e20, t10, n10) { + var r10 = e20.slice(); + return r10[7] = t10[n10], r10[9] = n10, r10; + } + function zN(e20) { + var t10, n10, r10, o10, i10 = [LN, BN], a10 = []; + function s10(e21, t11) { + return e21[2] || 1 === e21[3] ? 0 : 1; + } + return n10 = s10(e20), r10 = a10[n10] = i10[n10](e20), { c: function() { + t10 = ji("div"), r10.c(), Ai(t10, "class", "jse-validation-errors-overview svelte-1ifg4t0"); + }, m: function(e21, r11) { + ki(e21, t10, r11), a10[n10].m(t10, null), o10 = true; + }, p: function(e21, o11) { + var c10 = n10; + (n10 = s10(e21)) === c10 ? a10[n10].p(e21, o11) : (ba(), xa(a10[c10], 1, 1, function() { + a10[c10] = null; + }), ka(), (r10 = a10[n10]) ? r10.p(e21, o11) : (r10 = a10[n10] = i10[n10](e21)).c(), wa(r10, 1), r10.m(t10, null)); + }, i: function(e21) { + o10 || (wa(r10), o10 = true); + }, o: function(e21) { + xa(r10), o10 = false; + }, d: function(e21) { + e21 && wi(t10), a10[n10].d(); + } }; + } + function BN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10; + return i10 = new jM({ props: { data: TP } }), f10 = new jM({ props: { data: iP } }), { c: function() { + t10 = ji("table"), n10 = ji("tbody"), r10 = ji("tr"), o10 = ji("td"), Pa(i10.$$.fragment), a10 = $i(), s10 = ji("td"), c10 = Ci(e20[3]), l10 = Ci(" validation errors\n "), u10 = ji("div"), Pa(f10.$$.fragment), Ai(o10, "class", "jse-validation-error-icon svelte-1ifg4t0"), Ai(u10, "class", "jse-validation-errors-expand svelte-1ifg4t0"), Ai(s10, "class", "jse-validation-error-count svelte-1ifg4t0"), Ai(r10, "class", "jse-validation-error svelte-1ifg4t0"), Ai(t10, "class", "jse-validation-errors-overview-collapsed svelte-1ifg4t0"); + }, m: function(p10, m10) { + ki(p10, t10, m10), pi(t10, n10), pi(n10, r10), pi(r10, o10), Ta(i10, o10, null), pi(r10, a10), pi(r10, s10), pi(s10, c10), pi(s10, l10), pi(s10, u10), Ta(f10, u10, null), d10 = true, h10 || (v10 = Oi(r10, "click", e20[5]), h10 = true); + }, p: function(e21, t11) { + (!d10 || 8 & t11) && Ni(c10, e21[3]); + }, i: function(e21) { + d10 || (wa(i10.$$.fragment, e21), wa(f10.$$.fragment, e21), d10 = true); + }, o: function(e21) { + xa(i10.$$.fragment, e21), xa(f10.$$.fragment, e21), d10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(i10), Ra(f10), h10 = false, v10(); + } }; + } + function LN(e20) { + for (var t10, n10, r10, o10, i10 = Ca(N_(e20[0], us)), a10 = [], s10 = 0; s10 < i10.length; s10 += 1) + a10[s10] = VN(qN(e20, i10, s10)); + var c10 = function(e21) { + return xa(a10[e21], 1, 1, function() { + a10[e21] = null; + }); + }, l10 = e20[3] > us && HN(e20); + return { c: function() { + t10 = ji("table"), n10 = ji("tbody"); + for (var e21 = 0; e21 < a10.length; e21 += 1) + a10[e21].c(); + r10 = $i(), l10 && l10.c(), Ai(t10, "class", "jse-validation-errors-overview-expanded svelte-1ifg4t0"); + }, m: function(e21, i11) { + ki(e21, t10, i11), pi(t10, n10); + for (var s11 = 0; s11 < a10.length; s11 += 1) + a10[s11] && a10[s11].m(n10, null); + pi(n10, r10), l10 && l10.m(n10, null), o10 = true; + }, p: function(e21, t11) { + if (19 & t11) { + var o11; + for (i10 = Ca(N_(e21[0], us)), o11 = 0; o11 < i10.length; o11 += 1) { + var s11 = qN(e21, i10, o11); + a10[o11] ? (a10[o11].p(s11, t11), wa(a10[o11], 1)) : (a10[o11] = VN(s11), a10[o11].c(), wa(a10[o11], 1), a10[o11].m(n10, r10)); + } + for (ba(), o11 = i10.length; o11 < a10.length; o11 += 1) + c10(o11); + ka(); + } + e21[3] > us ? l10 ? l10.p(e21, t11) : ((l10 = HN(e21)).c(), l10.m(n10, null)) : l10 && (l10.d(1), l10 = null); + }, i: function(e21) { + if (!o10) { + for (var t11 = 0; t11 < i10.length; t11 += 1) + wa(a10[t11]); + o10 = true; + } + }, o: function(e21) { + a10 = a10.filter(Boolean); + for (var t11 = 0; t11 < a10.length; t11 += 1) + xa(a10[t11]); + o10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(a10, e21), l10 && l10.d(); + } }; + } + function FN(e20) { + var t10, n10, r10, o10, i10; + return n10 = new jM({ props: { data: wP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-validation-errors-collapse svelte-1ifg4t0"), Ai(t10, "title", "Collapse validation errors"); + }, m: function(a10, s10) { + ki(a10, t10, s10), Ta(n10, t10, null), r10 = true, o10 || (i10 = Oi(t10, "click", Ei(e20[4])), o10 = true); + }, p: Wo, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), o10 = false, i10(); + } }; + } + function VN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10 = JO(e20[7].path) + "", m10 = e20[7].message + ""; + r10 = new jM({ props: { data: TP } }); + var g10 = 0 === e20[9] && e20[0].length > 1 && FN(e20); + function y10() { + return e20[6](e20[7]); + } + return { c: function() { + t10 = ji("tr"), n10 = ji("td"), Pa(r10.$$.fragment), o10 = $i(), i10 = ji("td"), a10 = Ci(p10), s10 = $i(), c10 = ji("td"), l10 = Ci(m10), u10 = $i(), f10 = ji("td"), g10 && g10.c(), Ai(n10, "class", "jse-validation-error-icon svelte-1ifg4t0"), Ai(i10, "class", "jse-validation-error-path svelte-1ifg4t0"), Ai(c10, "class", "jse-validation-error-message svelte-1ifg4t0"), Ai(f10, "class", "jse-validation-error-action svelte-1ifg4t0"), Ai(t10, "class", "jse-validation-error svelte-1ifg4t0"); + }, m: function(e21, p11) { + ki(e21, t10, p11), pi(t10, n10), Ta(r10, n10, null), pi(t10, o10), pi(t10, i10), pi(i10, a10), pi(t10, s10), pi(t10, c10), pi(c10, l10), pi(t10, u10), pi(t10, f10), g10 && g10.m(f10, null), d10 = true, h10 || (v10 = Oi(t10, "click", y10), h10 = true); + }, p: function(t11, n11) { + e20 = t11, (!d10 || 1 & n11) && p10 !== (p10 = JO(e20[7].path) + "") && Ni(a10, p10), (!d10 || 1 & n11) && m10 !== (m10 = e20[7].message + "") && Ni(l10, m10), 0 === e20[9] && e20[0].length > 1 ? g10 ? (g10.p(e20, n11), 1 & n11 && wa(g10, 1)) : ((g10 = FN(e20)).c(), wa(g10, 1), g10.m(f10, null)) : g10 && (ba(), xa(g10, 1, 1, function() { + g10 = null; + }), ka()); + }, i: function(e21) { + d10 || (wa(r10.$$.fragment, e21), wa(g10), d10 = true); + }, o: function(e21) { + xa(r10.$$.fragment, e21), xa(g10), d10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(r10), g10 && g10.d(), h10 = false, v10(); + } }; + } + function HN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10 = e20[3] - us + ""; + return { c: function() { + t10 = ji("tr"), n10 = ji("td"), r10 = $i(), o10 = ji("td"), i10 = $i(), a10 = ji("td"), s10 = Ci("(and "), c10 = Ci(d10), l10 = Ci(" more errors)"), u10 = $i(), f10 = ji("td"), Ai(n10, "class", "svelte-1ifg4t0"), Ai(o10, "class", "svelte-1ifg4t0"), Ai(a10, "class", "svelte-1ifg4t0"), Ai(f10, "class", "svelte-1ifg4t0"), Ai(t10, "class", "jse-validation-error svelte-1ifg4t0"); + }, m: function(e21, d11) { + ki(e21, t10, d11), pi(t10, n10), pi(t10, r10), pi(t10, o10), pi(t10, i10), pi(t10, a10), pi(a10, s10), pi(a10, c10), pi(a10, l10), pi(t10, u10), pi(t10, f10); + }, p: function(e21, t11) { + 8 & t11 && d10 !== (d10 = e21[3] - us + "") && Ni(c10, d10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function WN(e20) { + var t10, n10, r10 = !_w(e20[0]), o10 = r10 && zN(e20); + return { c: function() { + o10 && o10.c(), t10 = _i(); + }, m: function(e21, r11) { + o10 && o10.m(e21, r11), ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + var i10 = jo(n11, 1)[0]; + 1 & i10 && (r10 = !_w(e21[0])), r10 ? o10 ? (o10.p(e21, i10), 1 & i10 && wa(o10, 1)) : ((o10 = zN(e21)).c(), wa(o10, 1), o10.m(t10.parentNode, t10)) : o10 && (ba(), xa(o10, 1, 1, function() { + o10 = null; + }), ka()); + }, i: function(e21) { + n10 || (wa(o10), n10 = true); + }, o: function(e21) { + xa(o10), n10 = false; + }, d: function(e21) { + e21 && wi(t10), o10 && o10.d(e21); + } }; + } + function UN(e20, t10, n10) { + var r10, o10 = t10.validationErrors, i10 = t10.selectError, a10 = true; + return e20.$$set = function(e21) { + "validationErrors" in e21 && n10(0, o10 = e21.validationErrors), "selectError" in e21 && n10(1, i10 = e21.selectError); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && n10(3, r10 = o10.length); + }, [o10, i10, a10, r10, function() { + n10(2, a10 = false); + }, function() { + n10(2, a10 = true); + }, function(e21) { + setTimeout(function() { + return i10(e21); + }); + }]; + } + var JN = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, UN, WN, Zo, { validationErrors: 0, selectError: 1 }, DN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var KN = "undefined" != typeof navigator && navigator.platform.toUpperCase().indexOf("MAC") >= 0; + function GN(e20) { + mi(e20, "svelte-1n68mbh", ".jse-header.svelte-1n68mbh.svelte-1n68mbh{display:flex;background:var(--jse-theme-color, #3883fa);color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff))}.jse-header.svelte-1n68mbh .jse-title.svelte-1n68mbh{flex:1;padding:5px;vertical-align:middle}.jse-header.svelte-1n68mbh button.svelte-1n68mbh{border:none;background:transparent;min-width:32px;color:inherit;cursor:pointer}.jse-header.svelte-1n68mbh button.svelte-1n68mbh:hover{background:rgba(255, 255, 255, 0.1)}"); + } + function QN(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10; + return a10 = new jM({ props: { data: MP } }), { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = Ci(e20[0]), o10 = $i(), i10 = ji("button"), Pa(a10.$$.fragment), Ai(n10, "class", "jse-title svelte-1n68mbh"), Ai(i10, "type", "button"), Ai(i10, "class", "jse-close svelte-1n68mbh"), Ai(t10, "class", "jse-header svelte-1n68mbh"); + }, m: function(u10, f10) { + ki(u10, t10, f10), pi(t10, n10), pi(n10, r10), pi(t10, o10), pi(t10, i10), Ta(a10, i10, null), s10 = true, c10 || (l10 = Oi(i10, "click", e20[3]), c10 = true); + }, p: function(e21, t11) { + var n11 = jo(t11, 1)[0]; + (!s10 || 1 & n11) && Ni(r10, e21[0]); + }, i: function(e21) { + s10 || (wa(a10.$$.fragment, e21), s10 = true); + }, o: function(e21) { + xa(a10.$$.fragment, e21), s10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(a10), c10 = false, l10(); + } }; + } + function YN(e20, t10, n10) { + var r10 = t10.title, o10 = void 0 === r10 ? "Modal" : r10, i10 = t10.onClose, a10 = void 0 === i10 ? void 0 : i10, s10 = Zi("simple-modal").close; + return e20.$$set = function(e21) { + "title" in e21 && n10(0, o10 = e21.title), "onClose" in e21 && n10(1, a10 = e21.onClose); + }, [o10, a10, s10, function() { + a10 ? a10() : s10(); + }]; + } + var XN = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, YN, QN, Zo, { title: 0, onClose: 1 }, GN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function ZN(e20) { + mi(e20, "svelte-18bor9q", '.jse-modal.svelte-18bor9q.svelte-18bor9q{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-18bor9q .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-18bor9q .jse-modal-contents.svelte-18bor9q{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-18bor9q .jse-modal-contents .jse-actions.svelte-18bor9q{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-18bor9q .jse-modal-contents .jse-actions button.jse-primary.svelte-18bor9q{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-18bor9q .jse-modal-contents .jse-actions button.jse-primary.svelte-18bor9q:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-18bor9q .jse-modal-contents .jse-actions button.jse-primary.svelte-18bor9q:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;height:auto;min-height:500px;max-height:calc(100vh - 6rem);display:flex}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0}.jse-modal.jse-copy-paste.svelte-18bor9q .jse-shortcuts.svelte-18bor9q{display:flex;flex-wrap:wrap;justify-content:space-around;margin:calc(2 * var(--jse-padding, 10px)) 0}.jse-modal.jse-copy-paste.svelte-18bor9q .jse-shortcuts .jse-shortcut .jse-key.svelte-18bor9q{font-size:200%;color:var(--jse-theme-color, #3883fa)}'); + } + function eI(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10; + return n10 = new XN({ props: { title: "Copying and pasting" } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), r10 = $i(), o10 = ji("div"), (i10 = ji("div")).textContent = "These actions are unavailable via the menu. Please use:", a10 = $i(), s10 = ji("div"), c10 = ji("div"), (l10 = ji("div")).textContent = "".concat(e20[1], "+C"), u10 = Ci("\n for copy"), f10 = $i(), d10 = ji("div"), (h10 = ji("div")).textContent = "".concat(e20[1], "+X"), v10 = Ci("\n for cut"), p10 = $i(), m10 = ji("div"), (g10 = ji("div")).textContent = "".concat(e20[1], "+V"), y10 = Ci("\n for paste"), b10 = $i(), k10 = ji("div"), (w10 = ji("button")).textContent = "Close", Ai(l10, "class", "jse-key svelte-18bor9q"), Ai(c10, "class", "jse-shortcut"), Ai(h10, "class", "jse-key svelte-18bor9q"), Ai(d10, "class", "jse-shortcut"), Ai(g10, "class", "jse-key svelte-18bor9q"), Ai(m10, "class", "jse-shortcut"), Ai(s10, "class", "jse-shortcuts svelte-18bor9q"), Ai(w10, "type", "button"), Ai(w10, "class", "jse-primary svelte-18bor9q"), Ai(k10, "class", "jse-actions svelte-18bor9q"), Ai(o10, "class", "jse-modal-contents svelte-18bor9q"), Ai(t10, "class", "jse-modal jse-copy-paste svelte-18bor9q"); + }, m: function(C10, $10) { + ki(C10, t10, $10), Ta(n10, t10, null), pi(t10, r10), pi(t10, o10), pi(o10, i10), pi(o10, a10), pi(o10, s10), pi(s10, c10), pi(c10, l10), pi(c10, u10), pi(s10, f10), pi(s10, d10), pi(d10, h10), pi(d10, v10), pi(s10, p10), pi(s10, m10), pi(m10, g10), pi(m10, y10), pi(o10, b10), pi(o10, k10), pi(k10, w10), x10 = true, j10 || (S10 = Oi(w10, "click", e20[2]), j10 = true); + }, p: Wo, i: function(e21) { + x10 || (wa(n10.$$.fragment, e21), x10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), x10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), j10 = false, S10(); + } }; + } + function tI(e20) { + var t10 = Zi("simple-modal").close; + return [t10, KN ? "\u2318" : "Ctrl", function() { + return t10(); + }]; + } + var nI = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, tI, eI, Zo, {}, ZN), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function rI(e20) { + return !!e20 && ("space" === e20.type || true === e20.space); + } + function oI(e20) { + return !!e20 && ("separator" === e20.type || true === e20.separator); + } + function iI(e20) { + return !!e20 && ("label" === e20.type && "string" == typeof e20.text); + } + function aI(e20) { + return !!e20 && "function" == typeof e20.onClick; + } + function sI(e20) { + return !!e20 && ("dropdown-button" === e20.type && aI(e20.main) && Array.isArray(e20.items)); + } + function cI(e20) { + return !!e20 && ("row" === e20.type && Array.isArray(e20.items)); + } + function lI(e20) { + return !!e20 && ("column" === e20.type && Array.isArray(e20.items)); + } + function uI(e20) { + return Gl(e20) && Gl(e20.parseError); + } + function fI(e20) { + return Gl(e20) && Array.isArray(e20.validationErrors); + } + function dI(e20) { + return Gl(e20) && Array.isArray(e20.path) && "string" == typeof e20.message && "severity" in e20; + } + function hI(e20) { + return Gl(e20) && dI(e20) && "boolean" == typeof e20.isChildError; + } + function vI(e20) { + mi(e20, "svelte-7deygj", '.jse-menu.svelte-7deygj.svelte-7deygj{background:var(--jse-theme-color, #3883fa);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-main-menu, 14px);color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));display:flex;flex-wrap:wrap;align-items:stretch;position:relative}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj{font-family:inherit;font-size:inherit;line-height:1.5em;border:none;background:transparent;color:inherit;cursor:pointer;width:var(--jse-menu-button-size, 32px);height:var(--jse-menu-button-size, 32px);padding:calc(0.5 * var(--jse-padding, 10px));margin:0;border-radius:0;display:inline-flex;align-items:center;text-align:center;justify-content:center}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:hover,.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:focus{background:var(--jse-theme-color-highlight, #5f9dff)}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:disabled{color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));opacity:0.5;background:transparent}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj{width:auto;height:calc(var(--jse-menu-button-size, 32px) - var(--jse-padding, 10px));margin:calc(0.5 * var(--jse-padding, 10px)) 0;padding:0 calc(0.5 * var(--jse-padding, 10px)) 1px;border:1px solid var(--jse-menu-color, var(--jse-text-color-inverse, #fff))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:not(.jse-last){border-right:none}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-first.svelte-7deygj{margin-left:calc(0.5 * var(--jse-padding, 10px))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-last.svelte-7deygj{margin-right:calc(0.5 * var(--jse-padding, 10px))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:hover,.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:focus{background:var(--jse-theme-color-highlight, #5f9dff)}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-selected.svelte-7deygj{background:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));color:var(--jse-theme-color, #3883fa)}.jse-menu.svelte-7deygj .jse-space.svelte-7deygj{flex:1}.jse-menu.svelte-7deygj .jse-separator.svelte-7deygj{background:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));opacity:0.3;width:1px;margin:3px}'); + } + var pI = function(e20) { + return {}; + }; + var mI = function(e20) { + return {}; + }; + function gI(e20, t10, n10) { + var r10 = e20.slice(); + return r10[3] = t10[n10], r10; + } + var yI = function(e20) { + return {}; + }; + var bI = function(e20) { + return {}; + }; + function kI(e20) { + var t10, n10 = OI(e20[3]) + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = OI(e21[3]) + "") && Ni(t10, n10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function wI(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = e20[3].icon && SI(e20), u10 = e20[3].text && CI(e20); + return { c: function() { + t10 = ji("button"), l10 && l10.c(), n10 = $i(), u10 && u10.c(), Ai(t10, "type", "button"), Ai(t10, "class", r10 = "jse-button " + e20[3].className + " svelte-7deygj"), Ai(t10, "title", o10 = e20[3].title), t10.disabled = i10 = e20[3].disabled || false; + }, m: function(r11, o11) { + ki(r11, t10, o11), l10 && l10.m(t10, null), pi(t10, n10), u10 && u10.m(t10, null), a10 = true, s10 || (c10 = Oi(t10, "click", function() { + Yo(e20[3].onClick) && e20[3].onClick.apply(this, arguments); + }), s10 = true); + }, p: function(s11, c11) { + (e20 = s11)[3].icon ? l10 ? (l10.p(e20, c11), 1 & c11 && wa(l10, 1)) : ((l10 = SI(e20)).c(), wa(l10, 1), l10.m(t10, n10)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()), e20[3].text ? u10 ? u10.p(e20, c11) : ((u10 = CI(e20)).c(), u10.m(t10, null)) : u10 && (u10.d(1), u10 = null), (!a10 || 1 & c11 && r10 !== (r10 = "jse-button " + e20[3].className + " svelte-7deygj")) && Ai(t10, "class", r10), (!a10 || 1 & c11 && o10 !== (o10 = e20[3].title)) && Ai(t10, "title", o10), (!a10 || 1 & c11 && i10 !== (i10 = e20[3].disabled || false)) && (t10.disabled = i10); + }, i: function(e21) { + a10 || (wa(l10), a10 = true); + }, o: function(e21) { + xa(l10), a10 = false; + }, d: function(e21) { + e21 && wi(t10), l10 && l10.d(), u10 && u10.d(), s10 = false, c10(); + } }; + } + function xI(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("div"), "class", "jse-space svelte-7deygj"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function jI(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("div"), "class", "jse-separator svelte-7deygj"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function SI(e20) { + var t10, n10; + return t10 = new jM({ props: { data: e20[3].icon } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.data = e21[3].icon), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function CI(e20) { + var t10, n10 = e20[3].text + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = e21[3].text + "") && Ni(t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function $I(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10 = [jI, xI, wI, kI], l10 = []; + function u10(e21, o11) { + return 1 & o11 && (t10 = null), 1 & o11 && (n10 = null), 1 & o11 && (r10 = null), null == t10 && (t10 = !!oI(e21[3])), t10 ? 0 : (null == n10 && (n10 = !!rI(e21[3])), n10 ? 1 : (null == r10 && (r10 = !!aI(e21[3])), r10 ? 2 : 3)); + } + return o10 = u10(e20, -1), i10 = l10[o10] = c10[o10](e20), { c: function() { + i10.c(), a10 = _i(); + }, m: function(e21, t11) { + l10[o10].m(e21, t11), ki(e21, a10, t11), s10 = true; + }, p: function(e21, t11) { + var n11 = o10; + (o10 = u10(e21, t11)) === n11 ? l10[o10].p(e21, t11) : (ba(), xa(l10[n11], 1, 1, function() { + l10[n11] = null; + }), ka(), (i10 = l10[o10]) ? i10.p(e21, t11) : (i10 = l10[o10] = c10[o10](e21)).c(), wa(i10, 1), i10.m(a10.parentNode, a10)); + }, i: function(e21) { + s10 || (wa(i10), s10 = true); + }, o: function(e21) { + xa(i10), s10 = false; + }, d: function(e21) { + e21 && wi(a10), l10[o10].d(e21); + } }; + } + function _I(e20) { + for (var t10, n10, r10, o10, i10 = e20[2].left, a10 = ei(i10, e20, e20[1], bI), s10 = Ca(e20[0]), c10 = [], l10 = 0; l10 < s10.length; l10 += 1) + c10[l10] = $I(gI(e20, s10, l10)); + var u10 = function(e21) { + return xa(c10[e21], 1, 1, function() { + c10[e21] = null; + }); + }, f10 = e20[2].right, d10 = ei(f10, e20, e20[1], mI); + return { c: function() { + t10 = ji("div"), a10 && a10.c(), n10 = $i(); + for (var e21 = 0; e21 < c10.length; e21 += 1) + c10[e21].c(); + r10 = $i(), d10 && d10.c(), Ai(t10, "class", "jse-menu svelte-7deygj"); + }, m: function(e21, i11) { + ki(e21, t10, i11), a10 && a10.m(t10, null), pi(t10, n10); + for (var s11 = 0; s11 < c10.length; s11 += 1) + c10[s11] && c10[s11].m(t10, null); + pi(t10, r10), d10 && d10.m(t10, null), o10 = true; + }, p: function(e21, n11) { + var l11 = jo(n11, 1)[0]; + if (a10 && a10.p && (!o10 || 2 & l11) && ri(a10, i10, e21, e21[1], o10 ? ni(i10, e21[1], l11, yI) : oi(e21[1]), bI), 1 & l11) { + var h10; + for (s10 = Ca(e21[0]), h10 = 0; h10 < s10.length; h10 += 1) { + var v10 = gI(e21, s10, h10); + c10[h10] ? (c10[h10].p(v10, l11), wa(c10[h10], 1)) : (c10[h10] = $I(v10), c10[h10].c(), wa(c10[h10], 1), c10[h10].m(t10, r10)); + } + for (ba(), h10 = s10.length; h10 < c10.length; h10 += 1) + u10(h10); + ka(); + } + d10 && d10.p && (!o10 || 2 & l11) && ri(d10, f10, e21, e21[1], o10 ? ni(f10, e21[1], l11, pI) : oi(e21[1]), mI); + }, i: function(e21) { + if (!o10) { + wa(a10, e21); + for (var t11 = 0; t11 < s10.length; t11 += 1) + wa(c10[t11]); + wa(d10, e21), o10 = true; + } + }, o: function(e21) { + xa(a10, e21), c10 = c10.filter(Boolean); + for (var t11 = 0; t11 < c10.length; t11 += 1) + xa(c10[t11]); + xa(d10, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), a10 && a10.d(e21), xi(c10, e21), d10 && d10.d(e21); + } }; + } + function OI(e20) { + return console.error("Unknown type of menu item", e20), "???"; + } + function MI(e20, t10, n10) { + var r10 = t10.$$slots, o10 = void 0 === r10 ? {} : r10, i10 = t10.$$scope, a10 = t10.items, s10 = void 0 === a10 ? [] : a10; + return e20.$$set = function(e21) { + "items" in e21 && n10(0, s10 = e21.items), "$$scope" in e21 && n10(1, i10 = e21.$$scope); + }, [s10, i10, o10]; + } + var EI = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, MI, _I, Zo, { items: 0 }, vI), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function AI(e20) { + mi(e20, "svelte-1d84pok", '.jse-json-repair-component.svelte-1d84pok.svelte-1d84pok{flex:1;display:flex;flex-direction:column;background:var(--jse-background-color, #fff);color:var(--jse-text-color, #4d4d4d)}.jse-json-repair-component.svelte-1d84pok .jse-menu .jse-info.svelte-1d84pok{padding:calc(0.5 * var(--jse-padding, 10px));font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);vertical-align:center}.jse-json-repair-component.svelte-1d84pok .jse-json-text.svelte-1d84pok{flex:1;border:none;padding:2px;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);background:var(--jse-input-background, var(--jse-background-color, #fff));color:var(--jse-text-color, #4d4d4d);resize:none;outline:none}'); + } + function PI(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).textContent = "Repair invalid JSON, then click apply", Ai(t10, "slot", "left"), Ai(t10, "class", "jse-info svelte-1d84pok"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function TI(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "success", message: "JSON is valid now and can be parsed.", actions: e20[5] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 32 & n11 && (r10.actions = e21[5]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function RI(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "error", icon: TP, message: "Cannot parse JSON: ".concat(e20[2].message), actions: e20[6] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 4 & n11 && (r10.message = "Cannot parse JSON: ".concat(e21[2].message)), 64 & n11 && (r10.actions = e21[6]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function NI(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10; + n10 = new EI({ props: { items: e20[4], $$slots: { left: [PI] }, $$scope: { ctx: e20 } } }); + var f10 = [RI, TI], d10 = []; + function h10(e21, t11) { + return e21[2] ? 0 : 1; + } + return o10 = h10(e20), i10 = d10[o10] = f10[o10](e20), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), r10 = $i(), i10.c(), a10 = $i(), (s10 = ji("textarea")).readOnly = e20[1], Ai(s10, "class", "jse-json-text svelte-1d84pok"), Ai(s10, "autocomplete", "off"), Ai(s10, "autocapitalize", "off"), Ai(s10, "spellcheck", "false"), s10.value = e20[0], Ai(t10, "class", "jse-json-repair-component svelte-1d84pok"); + }, m: function(i11, f11) { + ki(i11, t10, f11), Ta(n10, t10, null), pi(t10, r10), d10[o10].m(t10, null), pi(t10, a10), pi(t10, s10), e20[16](s10), c10 = true, l10 || (u10 = Oi(s10, "input", e20[7]), l10 = true); + }, p: function(e21, r11) { + var l11 = jo(r11, 1)[0], u11 = {}; + 16 & l11 && (u11.items = e21[4]), 8388608 & l11 && (u11.$$scope = { dirty: l11, ctx: e21 }), n10.$set(u11); + var v10 = o10; + (o10 = h10(e21)) === v10 ? d10[o10].p(e21, l11) : (ba(), xa(d10[v10], 1, 1, function() { + d10[v10] = null; + }), ka(), (i10 = d10[o10]) ? i10.p(e21, l11) : (i10 = d10[o10] = f10[o10](e21)).c(), wa(i10, 1), i10.m(t10, a10)), (!c10 || 2 & l11) && (s10.readOnly = e21[1]), (!c10 || 1 & l11) && (s10.value = e21[0]); + }, i: function(e21) { + c10 || (wa(n10.$$.fragment, e21), wa(i10), c10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), xa(i10), c10 = false; + }, d: function(r11) { + r11 && wi(t10), Ra(n10), d10[o10].d(), e20[16](null), l10 = false, u10(); + } }; + } + function II(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10 = t10.text, d10 = void 0 === f10 ? "" : f10, h10 = t10.readOnly, v10 = void 0 !== h10 && h10, p10 = t10.onParse, m10 = t10.onRepair, g10 = t10.onChange, y10 = void 0 === g10 ? null : g10, b10 = t10.onApply, k10 = t10.onCancel, w10 = Da("jsoneditor:JSONRepair"); + function x10() { + b10(d10); + } + return e20.$$set = function(e21) { + "text" in e21 && n10(0, d10 = e21.text), "readOnly" in e21 && n10(1, v10 = e21.readOnly), "onParse" in e21 && n10(8, p10 = e21.onParse), "onRepair" in e21 && n10(9, m10 = e21.onRepair), "onChange" in e21 && n10(10, y10 = e21.onChange), "onApply" in e21 && n10(11, b10 = e21.onApply), "onCancel" in e21 && n10(12, k10 = e21.onCancel); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && n10(2, r10 = function(e21) { + try { + return p10(e21), null; + } catch (t11) { + return H_(e21, t11.message); + } + }(d10)), 1 & e20.$$.dirty && n10(15, o10 = function(e21) { + try { + return m10(e21), true; + } catch (e23) { + return false; + } + }(d10)), 4 & e20.$$.dirty && w10("error", r10), 4096 & e20.$$.dirty && n10(4, u10 = [{ type: "space" }, { type: "button", icon: MP, title: "Cancel repair", className: "jse-cancel", onClick: k10 }]), 57344 & e20.$$.dirty && n10(6, s10 = o10 ? [i10, a10] : [i10]), 2 & e20.$$.dirty && n10(5, c10 = [{ icon: PP, text: "Apply", title: "Apply fixed JSON", disabled: v10, onClick: x10 }]); + }, n10(13, i10 = { icon: xP, text: "Show me", title: "Scroll to the error location", onClick: function() { + if (l10 && r10) { + var e21 = null != r10.position ? r10.position : 0; + l10.setSelectionRange(e21, e21), l10.focus(); + } + } }), n10(14, a10 = { icon: uP, text: "Auto repair", title: "Automatically repair JSON", onClick: function() { + try { + n10(0, d10 = m10(d10)), y10 && y10(d10); + } catch (e21) { + } + } }), [d10, v10, r10, l10, u10, c10, s10, function(e21) { + w10("handleChange"); + var t11 = e21.target.value; + d10 !== t11 && (n10(0, d10 = t11), y10 && y10(d10)); + }, p10, m10, y10, b10, k10, i10, a10, o10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(3, l10 = e21); + }); + }]; + } + var DI = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, II, NI, Zo, { text: 0, readOnly: 1, onParse: 8, onRepair: 9, onChange: 10, onApply: 11, onCancel: 12 }, AI), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var qI = []; + function zI(e20) { + if ("Escape" === e20.key) { + var t10 = vb(qI); + t10 && t10(); + } + } + function BI(e20, t10) { + return _w(qI) && window.addEventListener("keydown", zI), qI.push(t10), { destroy: function() { + _w(qI = qI.filter(function(e21) { + return e21 !== t10; + })) && window.removeEventListener("keydown", zI); + } }; + } + function LI(e20) { + mi(e20, "svelte-rn18r0", '.jse-modal.jse-repair.svelte-rn18r0{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}'); + } + function FI(e20) { + var t10, n10, r10, o10, i10, a10; + function s10(t11) { + e20[7](t11); + } + var c10 = { onParse: e20[1], onRepair: e20[2], onApply: e20[4], onCancel: e20[5] }; + return void 0 !== e20[0] && (c10.text = e20[0]), n10 = new DI({ props: c10 }), na.push(function() { + return Aa(n10, "text", s10); + }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-modal jse-repair svelte-rn18r0"); + }, m: function(r11, s11) { + ki(r11, t10, s11), Ta(n10, t10, null), o10 = true, i10 || (a10 = ci(BI.call(null, t10, e20[3])), i10 = true); + }, p: function(e21, t11) { + var o11 = jo(t11, 1)[0], i11 = {}; + 2 & o11 && (i11.onParse = e21[1]), 4 & o11 && (i11.onRepair = e21[2]), !r10 && 1 & o11 && (r10 = true, i11.text = e21[0], ua(function() { + return r10 = false; + })), n10.$set(i11); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), i10 = false, a10(); + } }; + } + function VI(e20, t10, n10) { + var r10 = t10.text, o10 = t10.onParse, i10 = t10.onRepair, a10 = t10.onApply, s10 = Zi("simple-modal").close; + return e20.$$set = function(e21) { + "text" in e21 && n10(0, r10 = e21.text), "onParse" in e21 && n10(1, o10 = e21.onParse), "onRepair" in e21 && n10(2, i10 = e21.onRepair), "onApply" in e21 && n10(6, a10 = e21.onApply); + }, [r10, o10, i10, s10, function(e21) { + s10(), a10(e21); + }, function() { + s10(); + }, a10, function(e21) { + n10(0, r10 = e21); + }]; + } + var HI = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, VI, FI, Zo, { text: 0, onParse: 1, onRepair: 2, onApply: 6 }, LI), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function WI(e20) { + mi(e20, "svelte-szeu2l", 'button.jse-context-menu-button.svelte-szeu2l{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;flex:1;white-space:nowrap;padding:var(--jse-padding, 10px);color:inherit}button.jse-context-menu-button.svelte-szeu2l:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}button.jse-context-menu-button.svelte-szeu2l:focus{background:var(--jse-context-menu-background-highlight, #7a7a7a);z-index:1}button.jse-context-menu-button.svelte-szeu2l:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}button.jse-context-menu-button.left.svelte-szeu2l{text-align:left}button.jse-context-menu-button.svelte-szeu2l svg{width:16px}'); + } + function UI(e20) { + var t10, n10; + return t10 = new jM({ props: { data: e20[0].icon } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.data = e21[0].icon), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function JI(e20) { + var t10, n10 = e20[0].text + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = e21[0].text + "") && Ni(t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function KI(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = e20[0].icon && UI(e20), u10 = e20[0].text && JI(e20); + return { c: function() { + t10 = ji("button"), l10 && l10.c(), n10 = $i(), u10 && u10.c(), Ai(t10, "type", "button"), Ai(t10, "class", r10 = si(GE("jse-context-menu-button", e20[1], e20[0].className)) + " svelte-szeu2l"), Ai(t10, "title", o10 = e20[0].title), t10.disabled = i10 = e20[0].disabled || false; + }, m: function(r11, o11) { + ki(r11, t10, o11), l10 && l10.m(t10, null), pi(t10, n10), u10 && u10.m(t10, null), a10 = true, s10 || (c10 = Oi(t10, "click", e20[3]), s10 = true); + }, p: function(e21, s11) { + var c11 = jo(s11, 1)[0]; + e21[0].icon ? l10 ? (l10.p(e21, c11), 1 & c11 && wa(l10, 1)) : ((l10 = UI(e21)).c(), wa(l10, 1), l10.m(t10, n10)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()), e21[0].text ? u10 ? u10.p(e21, c11) : ((u10 = JI(e21)).c(), u10.m(t10, null)) : u10 && (u10.d(1), u10 = null), (!a10 || 3 & c11 && r10 !== (r10 = si(GE("jse-context-menu-button", e21[1], e21[0].className)) + " svelte-szeu2l")) && Ai(t10, "class", r10), (!a10 || 1 & c11 && o10 !== (o10 = e21[0].title)) && Ai(t10, "title", o10), (!a10 || 1 & c11 && i10 !== (i10 = e21[0].disabled || false)) && (t10.disabled = i10); + }, i: function(e21) { + a10 || (wa(l10), a10 = true); + }, o: function(e21) { + xa(l10), a10 = false; + }, d: function(e21) { + e21 && wi(t10), l10 && l10.d(), u10 && u10.d(), s10 = false, c10(); + } }; + } + function GI(e20, t10, n10) { + var r10 = t10.item, o10 = t10.className, i10 = void 0 === o10 ? void 0 : o10, a10 = t10.onCloseContextMenu; + return e20.$$set = function(e21) { + "item" in e21 && n10(0, r10 = e21.item), "className" in e21 && n10(1, i10 = e21.className), "onCloseContextMenu" in e21 && n10(2, a10 = e21.onCloseContextMenu); + }, [r10, i10, a10, function(e21) { + a10(), r10.onClick(e21); + }]; + } + var QI = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, GI, KI, Xo, { item: 0, className: 1, onCloseContextMenu: 2 }, WI), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function YI(e20) { + mi(e20, "svelte-9i012w", '.jse-dropdown-button.svelte-9i012w.svelte-9i012w{flex:1;line-height:normal;border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;position:relative;padding:0;display:flex}.jse-dropdown-button.svelte-9i012w ul.svelte-9i012w{margin:0;padding:0}.jse-dropdown-button.svelte-9i012w ul li.svelte-9i012w{margin:0;padding:0;list-style-type:none}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:2em;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));border-radius:0}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.jse-visible.svelte-9i012w{background:var(--jse-context-menu-background, #656565)}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:focus{z-index:1}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items.svelte-9i012w{display:none;position:absolute;top:100%;left:0;z-index:1;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items.jse-visible.svelte-9i012w{display:block}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:100%;text-align:left;padding:var(--jse-padding, 10px);margin:0}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}'); + } + function XI(e20, t10, n10) { + var r10 = e20.slice(); + return r10[11] = t10[n10], r10; + } + var ZI = function(e20) { + return {}; + }; + var eD = function(e20) { + return {}; + }; + function tD(e20) { + var t10, n10; + return t10 = new jM({ props: { data: e20[11].icon } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.data = e21[11].icon), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function nD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10 = e20[11].text + "", h10 = e20[11].icon && tD(e20); + function v10() { + for (var t11, n11 = arguments.length, r11 = new Array(n11), o11 = 0; o11 < n11; o11++) + r11[o11] = arguments[o11]; + return (t11 = e20)[9].apply(t11, [e20[11]].concat(r11)); + } + return { c: function() { + t10 = ji("li"), n10 = ji("button"), h10 && h10.c(), r10 = $i(), o10 = Ci(d10), c10 = $i(), Ai(n10, "type", "button"), Ai(n10, "title", i10 = e20[11].title), n10.disabled = a10 = e20[11].disabled, Ai(n10, "class", s10 = si(e20[11].className) + " svelte-9i012w"), Ai(t10, "class", "svelte-9i012w"); + }, m: function(e21, i11) { + ki(e21, t10, i11), pi(t10, n10), h10 && h10.m(n10, null), pi(n10, r10), pi(n10, o10), pi(t10, c10), l10 = true, u10 || (f10 = Oi(n10, "click", v10), u10 = true); + }, p: function(t11, c11) { + (e20 = t11)[11].icon ? h10 ? (h10.p(e20, c11), 1 & c11 && wa(h10, 1)) : ((h10 = tD(e20)).c(), wa(h10, 1), h10.m(n10, r10)) : h10 && (ba(), xa(h10, 1, 1, function() { + h10 = null; + }), ka()), (!l10 || 1 & c11) && d10 !== (d10 = e20[11].text + "") && Ni(o10, d10), (!l10 || 1 & c11 && i10 !== (i10 = e20[11].title)) && Ai(n10, "title", i10), (!l10 || 1 & c11 && a10 !== (a10 = e20[11].disabled)) && (n10.disabled = a10), (!l10 || 1 & c11 && s10 !== (s10 = si(e20[11].className) + " svelte-9i012w")) && Ai(n10, "class", s10); + }, i: function(e21) { + l10 || (wa(h10), l10 = true); + }, o: function(e21) { + xa(h10), l10 = false; + }, d: function(e21) { + e21 && wi(t10), h10 && h10.d(), u10 = false, f10(); + } }; + } + function rD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = e20[8].defaultItem, d10 = ei(f10, e20, e20[7], eD); + o10 = new jM({ props: { data: gP } }); + for (var h10 = Ca(e20[0]), v10 = [], p10 = 0; p10 < h10.length; p10 += 1) + v10[p10] = nD(XI(e20, h10, p10)); + var m10 = function(e21) { + return xa(v10[e21], 1, 1, function() { + v10[e21] = null; + }); + }; + return { c: function() { + t10 = ji("div"), d10 && d10.c(), n10 = $i(), r10 = ji("button"), Pa(o10.$$.fragment), i10 = $i(), a10 = ji("div"), s10 = ji("ul"); + for (var c11 = 0; c11 < v10.length; c11 += 1) + v10[c11].c(); + Ai(r10, "type", "button"), Ai(r10, "class", "jse-open-dropdown svelte-9i012w"), Ai(r10, "data-type", "jse-open-dropdown"), r10.disabled = e20[4], zi(r10, "jse-visible", e20[3]), Ai(s10, "class", "svelte-9i012w"), Ai(a10, "class", "jse-dropdown-items svelte-9i012w"), Di(a10, "width", e20[2]), zi(a10, "jse-visible", e20[3]), Ai(t10, "role", "button"), Ai(t10, "tabindex", "0"), Ai(t10, "class", "jse-dropdown-button svelte-9i012w"), Ai(t10, "title", e20[1]); + }, m: function(f11, h11) { + ki(f11, t10, h11), d10 && d10.m(t10, null), pi(t10, n10), pi(t10, r10), Ta(o10, r10, null), pi(t10, i10), pi(t10, a10), pi(a10, s10); + for (var p11 = 0; p11 < v10.length; p11 += 1) + v10[p11] && v10[p11].m(s10, null); + c10 = true, l10 || (u10 = [Oi(r10, "click", e20[5]), Oi(t10, "click", e20[6])], l10 = true); + }, p: function(e21, n11) { + var o11 = jo(n11, 1)[0]; + if (d10 && d10.p && (!c10 || 128 & o11) && ri(d10, f10, e21, e21[7], c10 ? ni(f10, e21[7], o11, ZI) : oi(e21[7]), eD), (!c10 || 16 & o11) && (r10.disabled = e21[4]), (!c10 || 8 & o11) && zi(r10, "jse-visible", e21[3]), 1 & o11) { + var i11; + for (h10 = Ca(e21[0]), i11 = 0; i11 < h10.length; i11 += 1) { + var l11 = XI(e21, h10, i11); + v10[i11] ? (v10[i11].p(l11, o11), wa(v10[i11], 1)) : (v10[i11] = nD(l11), v10[i11].c(), wa(v10[i11], 1), v10[i11].m(s10, null)); + } + for (ba(), i11 = h10.length; i11 < v10.length; i11 += 1) + m10(i11); + ka(); + } + (!c10 || 4 & o11) && Di(a10, "width", e21[2]), (!c10 || 8 & o11) && zi(a10, "jse-visible", e21[3]), (!c10 || 2 & o11) && Ai(t10, "title", e21[1]); + }, i: function(e21) { + if (!c10) { + wa(d10, e21), wa(o10.$$.fragment, e21); + for (var t11 = 0; t11 < h10.length; t11 += 1) + wa(v10[t11]); + c10 = true; + } + }, o: function(e21) { + xa(d10, e21), xa(o10.$$.fragment, e21), v10 = v10.filter(Boolean); + for (var t11 = 0; t11 < v10.length; t11 += 1) + xa(v10[t11]); + c10 = false; + }, d: function(e21) { + e21 && wi(t10), d10 && d10.d(e21), Ra(o10), xi(v10, e21), l10 = false, Qo(u10); + } }; + } + function oD(e20, t10, n10) { + var r10, o10 = t10.$$slots, i10 = void 0 === o10 ? {} : o10, a10 = t10.$$scope, s10 = t10.items, c10 = void 0 === s10 ? [] : s10, l10 = t10.title, u10 = void 0 === l10 ? void 0 : l10, f10 = t10.width, d10 = void 0 === f10 ? "120px" : f10, h10 = false; + function v10() { + n10(3, h10 = false); + } + function p10(e21) { + "Escape" === PO(e21) && (e21.preventDefault(), n10(3, h10 = false)); + } + Gi(function() { + document.addEventListener("click", v10), document.addEventListener("keydown", p10); + }), Qi(function() { + document.removeEventListener("click", v10), document.removeEventListener("keydown", p10); + }); + return e20.$$set = function(e21) { + "items" in e21 && n10(0, c10 = e21.items), "title" in e21 && n10(1, u10 = e21.title), "width" in e21 && n10(2, d10 = e21.width), "$$scope" in e21 && n10(7, a10 = e21.$$scope); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && n10(4, r10 = c10.every(function(e21) { + return true === e21.disabled; + })); + }, [c10, u10, d10, h10, r10, function() { + var e21 = h10; + setTimeout(function() { + return n10(3, h10 = !e21); + }); + }, v10, a10, i10, function(e21, t11) { + return e21.onClick(t11); + }]; + } + var iD = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, oD, rD, Zo, { items: 0, title: 1, width: 2 }, YI), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function aD(e20) { + mi(e20, "svelte-szeu2l", 'button.jse-context-menu-button.svelte-szeu2l{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;flex:1;white-space:nowrap;padding:var(--jse-padding, 10px);color:inherit}button.jse-context-menu-button.svelte-szeu2l:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}button.jse-context-menu-button.svelte-szeu2l:focus{background:var(--jse-context-menu-background-highlight, #7a7a7a);z-index:1}button.jse-context-menu-button.svelte-szeu2l:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}button.jse-context-menu-button.left.svelte-szeu2l{text-align:left}button.jse-context-menu-button.svelte-szeu2l svg{width:16px}'); + } + function sD(e20) { + var t10, n10; + return t10 = new jM({ props: { data: e20[0].main.icon } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.data = e21[0].main.icon), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function cD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10 = e20[0].main.text + "", f10 = e20[0].main.icon && sD(e20); + return { c: function() { + t10 = ji("button"), f10 && f10.c(), n10 = $i(), r10 = Ci(u10), Ai(t10, "class", o10 = si(GE("jse-context-menu-button", e20[1], e20[0].main.className)) + " svelte-szeu2l"), Ai(t10, "type", "button"), Ai(t10, "slot", "defaultItem"), Ai(t10, "title", i10 = e20[0].main.title), t10.disabled = a10 = e20[0].main.disabled || false; + }, m: function(o11, i11) { + ki(o11, t10, i11), f10 && f10.m(t10, null), pi(t10, n10), pi(t10, r10), s10 = true, c10 || (l10 = Oi(t10, "click", e20[3]), c10 = true); + }, p: function(e21, c11) { + e21[0].main.icon ? f10 ? (f10.p(e21, c11), 1 & c11 && wa(f10, 1)) : ((f10 = sD(e21)).c(), wa(f10, 1), f10.m(t10, n10)) : f10 && (ba(), xa(f10, 1, 1, function() { + f10 = null; + }), ka()), (!s10 || 1 & c11) && u10 !== (u10 = e21[0].main.text + "") && Ni(r10, u10), (!s10 || 3 & c11 && o10 !== (o10 = si(GE("jse-context-menu-button", e21[1], e21[0].main.className)) + " svelte-szeu2l")) && Ai(t10, "class", o10), (!s10 || 1 & c11 && i10 !== (i10 = e21[0].main.title)) && Ai(t10, "title", i10), (!s10 || 1 & c11 && a10 !== (a10 = e21[0].main.disabled || false)) && (t10.disabled = a10); + }, i: function(e21) { + s10 || (wa(f10), s10 = true); + }, o: function(e21) { + xa(f10), s10 = false; + }, d: function(e21) { + e21 && wi(t10), f10 && f10.d(), c10 = false, l10(); + } }; + } + function lD(e20) { + var t10, n10; + return t10 = new iD({ props: { width: e20[0].width, items: e20[0].items, $$slots: { defaultItem: [cD] }, $$scope: { ctx: e20 } } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = jo(n11, 1)[0], o10 = {}; + 1 & r10 && (o10.width = e21[0].width), 1 & r10 && (o10.items = e21[0].items), 23 & r10 && (o10.$$scope = { dirty: r10, ctx: e21 }), t10.$set(o10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function uD(e20, t10, n10) { + var r10 = t10.item, o10 = t10.className, i10 = void 0 === o10 ? void 0 : o10, a10 = t10.onCloseContextMenu; + return e20.$$set = function(e21) { + "item" in e21 && n10(0, r10 = e21.item), "className" in e21 && n10(1, i10 = e21.className), "onCloseContextMenu" in e21 && n10(2, a10 = e21.onCloseContextMenu); + }, [r10, i10, a10, function(e21) { + a10(), r10.main.onClick(e21); + }]; + } + var fD = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, uD, lD, Xo, { item: 0, className: 1, onCloseContextMenu: 2 }, aD), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function dD(e20) { + mi(e20, "svelte-vtd7md", '.jse-contextmenu.svelte-vtd7md.svelte-vtd7md{box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24));font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff))}.jse-contextmenu.svelte-vtd7md .jse-row.svelte-vtd7md{display:flex;flex-direction:row;align-items:flex-start;justify-content:stretch}.jse-contextmenu.svelte-vtd7md .jse-row div.jse-label.svelte-vtd7md{flex:1;white-space:nowrap;padding:var(--jse-padding, 10px);color:var(--jse-context-menu-color-disabled, #9d9d9d);line-height:normal}.jse-contextmenu.svelte-vtd7md .jse-row div.jse-tip.svelte-vtd7md{flex:1;background:var(--jse-context-menu-tip-background, rgba(255, 255, 255, 0.2));color:var(--context-menu-tip-color, inherit);margin:calc(0.5 * var(--jse-padding, 10px));padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px);font-size:80%;line-height:1.3em;display:flex;flex-direction:row;align-items:start;gap:var(--jse-padding, 10px);border-radius:3px}.jse-contextmenu.svelte-vtd7md .jse-row div.jse-tip div.jse-tip-icon.svelte-vtd7md{padding-top:calc(0.5 * var(--jse-padding, 10px))}.jse-contextmenu.svelte-vtd7md .jse-column.svelte-vtd7md{flex:1;display:flex;flex-direction:column;align-items:stretch}.jse-contextmenu.svelte-vtd7md .jse-column.svelte-vtd7md:not(:last-child){border-right:1px solid var(--jse-context-menu-separator-color, #7a7a7a)}.jse-contextmenu.svelte-vtd7md .jse-separator.svelte-vtd7md{width:100%;height:1px;background:var(--jse-context-menu-separator-color, #7a7a7a)}'); + } + function hD(e20, t10, n10) { + var r10 = e20.slice(); + return r10[7] = t10[n10], r10; + } + function vD(e20, t10, n10) { + var r10 = e20.slice(); + return r10[10] = t10[n10], r10; + } + function pD(e20, t10, n10) { + var r10 = e20.slice(); + return r10[13] = t10[n10], r10; + } + function mD(e20) { + var t10, n10 = ID(e20[7]) + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = ID(e21[7]) + "") && Ni(t10, n10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function gD(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("div"), "class", "jse-separator svelte-vtd7md"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function yD(e20) { + for (var t10, n10, r10 = Ca(e20[7].items), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = PD(vD(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }; + return { c: function() { + t10 = ji("div"); + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + Ai(t10, "class", "jse-row svelte-vtd7md"); + }, m: function(e21, r11) { + ki(e21, t10, r11); + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(t10, null); + n10 = true; + }, p: function(e21, n11) { + if (3 & n11) { + var i11; + for (r10 = Ca(e21[7].items), i11 = 0; i11 < r10.length; i11 += 1) { + var s10 = vD(e21, r10, i11); + o10[i11] ? (o10[i11].p(s10, n11), wa(o10[i11], 1)) : (o10[i11] = PD(s10), o10[i11].c(), wa(o10[i11], 1), o10[i11].m(t10, null)); + } + for (ba(), i11 = r10.length; i11 < o10.length; i11 += 1) + a10(i11); + ka(); + } + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21); + } }; + } + function bD(e20) { + var t10, n10; + return t10 = new fD({ props: { item: e20[7], onCloseContextMenu: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.item = e21[7]), 2 & n11 && (r10.onCloseContextMenu = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function kD(e20) { + var t10, n10; + return t10 = new QI({ props: { item: e20[7], onCloseContextMenu: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.item = e21[7]), 2 & n11 && (r10.onCloseContextMenu = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function wD(e20) { + var t10, n10 = ID(e20[10]) + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = ID(e21[10]) + "") && Ni(t10, n10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function xD(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("div"), "class", "jse-separator svelte-vtd7md"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function jD(e20) { + for (var t10, n10, r10 = Ca(e20[10].items), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = AD(pD(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }; + return { c: function() { + t10 = ji("div"); + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + Ai(t10, "class", "jse-column svelte-vtd7md"); + }, m: function(e21, r11) { + ki(e21, t10, r11); + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(t10, null); + n10 = true; + }, p: function(e21, n11) { + if (3 & n11) { + var i11; + for (r10 = Ca(e21[10].items), i11 = 0; i11 < r10.length; i11 += 1) { + var s10 = pD(e21, r10, i11); + o10[i11] ? (o10[i11].p(s10, n11), wa(o10[i11], 1)) : (o10[i11] = AD(s10), o10[i11].c(), wa(o10[i11], 1), o10[i11].m(t10, null)); + } + for (ba(), i11 = r10.length; i11 < o10.length; i11 += 1) + a10(i11); + ka(); + } + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21); + } }; + } + function SD(e20) { + var t10, n10; + return t10 = new fD({ props: { item: e20[10], onCloseContextMenu: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.item = e21[10]), 2 & n11 && (r10.onCloseContextMenu = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function CD(e20) { + var t10, n10; + return t10 = new QI({ props: { item: e20[10], onCloseContextMenu: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.item = e21[10]), 2 & n11 && (r10.onCloseContextMenu = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function $D(e20) { + var t10, n10 = ID(e20[13]) + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 1 & r10 && n10 !== (n10 = ID(e21[13]) + "") && Ni(t10, n10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function _D(e20) { + var t10, n10, r10 = e20[13].text + ""; + return { c: function() { + t10 = ji("div"), n10 = Ci(r10), Ai(t10, "class", "jse-label svelte-vtd7md"); + }, m: function(e21, r11) { + ki(e21, t10, r11), pi(t10, n10); + }, p: function(e21, t11) { + 1 & t11 && r10 !== (r10 = e21[13].text + "") && Ni(n10, r10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function OD(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("div"), "class", "jse-separator svelte-vtd7md"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function MD(e20) { + var t10, n10; + return t10 = new fD({ props: { className: "left", item: e20[13], onCloseContextMenu: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.item = e21[13]), 2 & n11 && (r10.onCloseContextMenu = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function ED(e20) { + var t10, n10; + return t10 = new QI({ props: { className: "left", item: e20[13], onCloseContextMenu: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11 && (r10.item = e21[13]), 2 & n11 && (r10.onCloseContextMenu = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function AD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = [ED, MD, OD, _D, $D], u10 = []; + function f10(e21, i11) { + return 1 & i11 && (t10 = null), 1 & i11 && (n10 = null), 1 & i11 && (r10 = null), 1 & i11 && (o10 = null), null == t10 && (t10 = !!aI(e21[13])), t10 ? 0 : (null == n10 && (n10 = !!sI(e21[13])), n10 ? 1 : (null == r10 && (r10 = !!oI(e21[13])), r10 ? 2 : (null == o10 && (o10 = !!iI(e21[13])), o10 ? 3 : 4))); + } + return i10 = f10(e20, -1), a10 = u10[i10] = l10[i10](e20), { c: function() { + a10.c(), s10 = _i(); + }, m: function(e21, t11) { + u10[i10].m(e21, t11), ki(e21, s10, t11), c10 = true; + }, p: function(e21, t11) { + var n11 = i10; + (i10 = f10(e21, t11)) === n11 ? u10[i10].p(e21, t11) : (ba(), xa(u10[n11], 1, 1, function() { + u10[n11] = null; + }), ka(), (a10 = u10[i10]) ? a10.p(e21, t11) : (a10 = u10[i10] = l10[i10](e21)).c(), wa(a10, 1), a10.m(s10.parentNode, s10)); + }, i: function(e21) { + c10 || (wa(a10), c10 = true); + }, o: function(e21) { + xa(a10), c10 = false; + }, d: function(e21) { + e21 && wi(s10), u10[i10].d(e21); + } }; + } + function PD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = [CD, SD, jD, xD, wD], u10 = []; + function f10(e21, i11) { + return 1 & i11 && (t10 = null), 1 & i11 && (n10 = null), 1 & i11 && (r10 = null), 1 & i11 && (o10 = null), null == t10 && (t10 = !!aI(e21[10])), t10 ? 0 : (null == n10 && (n10 = !!sI(e21[10])), n10 ? 1 : (null == r10 && (r10 = !!lI(e21[10])), r10 ? 2 : (null == o10 && (o10 = !!oI(e21[10])), o10 ? 3 : 4))); + } + return i10 = f10(e20, -1), a10 = u10[i10] = l10[i10](e20), { c: function() { + a10.c(), s10 = _i(); + }, m: function(e21, t11) { + u10[i10].m(e21, t11), ki(e21, s10, t11), c10 = true; + }, p: function(e21, t11) { + var n11 = i10; + (i10 = f10(e21, t11)) === n11 ? u10[i10].p(e21, t11) : (ba(), xa(u10[n11], 1, 1, function() { + u10[n11] = null; + }), ka(), (a10 = u10[i10]) ? a10.p(e21, t11) : (a10 = u10[i10] = l10[i10](e21)).c(), wa(a10, 1), a10.m(s10.parentNode, s10)); + }, i: function(e21) { + c10 || (wa(a10), c10 = true); + }, o: function(e21) { + xa(a10), c10 = false; + }, d: function(e21) { + e21 && wi(s10), u10[i10].d(e21); + } }; + } + function TD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = [kD, bD, yD, gD, mD], u10 = []; + function f10(e21, i11) { + return 1 & i11 && (t10 = null), 1 & i11 && (n10 = null), 1 & i11 && (r10 = null), 1 & i11 && (o10 = null), null == t10 && (t10 = !!aI(e21[7])), t10 ? 0 : (null == n10 && (n10 = !!sI(e21[7])), n10 ? 1 : (null == r10 && (r10 = !!cI(e21[7])), r10 ? 2 : (null == o10 && (o10 = !!oI(e21[7])), o10 ? 3 : 4))); + } + return i10 = f10(e20, -1), a10 = u10[i10] = l10[i10](e20), { c: function() { + a10.c(), s10 = _i(); + }, m: function(e21, t11) { + u10[i10].m(e21, t11), ki(e21, s10, t11), c10 = true; + }, p: function(e21, t11) { + var n11 = i10; + (i10 = f10(e21, t11)) === n11 ? u10[i10].p(e21, t11) : (ba(), xa(u10[n11], 1, 1, function() { + u10[n11] = null; + }), ka(), (a10 = u10[i10]) ? a10.p(e21, t11) : (a10 = u10[i10] = l10[i10](e21)).c(), wa(a10, 1), a10.m(s10.parentNode, s10)); + }, i: function(e21) { + c10 || (wa(a10), c10 = true); + }, o: function(e21) { + xa(a10), c10 = false; + }, d: function(e21) { + e21 && wi(s10), u10[i10].d(e21); + } }; + } + function RD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10; + return o10 = new jM({ props: { data: oM } }), { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = ji("div"), Pa(o10.$$.fragment), i10 = $i(), a10 = ji("div"), s10 = Ci(e20[2]), Ai(r10, "class", "jse-tip-icon svelte-vtd7md"), Ai(a10, "class", "jse-tip-text"), Ai(n10, "class", "jse-tip svelte-vtd7md"), Ai(t10, "class", "jse-row svelte-vtd7md"); + }, m: function(e21, l10) { + ki(e21, t10, l10), pi(t10, n10), pi(n10, r10), Ta(o10, r10, null), pi(n10, i10), pi(n10, a10), pi(a10, s10), c10 = true; + }, p: function(e21, t11) { + (!c10 || 4 & t11) && Ni(s10, e21[2]); + }, i: function(e21) { + c10 || (wa(o10.$$.fragment, e21), c10 = true); + }, o: function(e21) { + xa(o10.$$.fragment, e21), c10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(o10); + } }; + } + function ND(e20) { + for (var t10, n10, r10, o10, i10, a10 = Ca(e20[0]), s10 = [], c10 = 0; c10 < a10.length; c10 += 1) + s10[c10] = TD(hD(e20, a10, c10)); + var l10 = function(e21) { + return xa(s10[e21], 1, 1, function() { + s10[e21] = null; + }); + }, u10 = e20[2] && RD(e20); + return { c: function() { + t10 = ji("div"); + for (var e21 = 0; e21 < s10.length; e21 += 1) + s10[e21].c(); + n10 = $i(), u10 && u10.c(), Ai(t10, "role", "menu"), Ai(t10, "tabindex", "-1"), Ai(t10, "class", "jse-contextmenu svelte-vtd7md"); + }, m: function(a11, c11) { + ki(a11, t10, c11); + for (var l11 = 0; l11 < s10.length; l11 += 1) + s10[l11] && s10[l11].m(t10, null); + pi(t10, n10), u10 && u10.m(t10, null), e20[5](t10), r10 = true, o10 || (i10 = Oi(t10, "keydown", e20[4]), o10 = true); + }, p: function(e21, r11) { + var o11 = jo(r11, 1)[0]; + if (3 & o11) { + var i11; + for (a10 = Ca(e21[0]), i11 = 0; i11 < a10.length; i11 += 1) { + var c11 = hD(e21, a10, i11); + s10[i11] ? (s10[i11].p(c11, o11), wa(s10[i11], 1)) : (s10[i11] = TD(c11), s10[i11].c(), wa(s10[i11], 1), s10[i11].m(t10, n10)); + } + for (ba(), i11 = a10.length; i11 < s10.length; i11 += 1) + l10(i11); + ka(); + } + e21[2] ? u10 ? (u10.p(e21, o11), 4 & o11 && wa(u10, 1)) : ((u10 = RD(e21)).c(), wa(u10, 1), u10.m(t10, null)) : u10 && (ba(), xa(u10, 1, 1, function() { + u10 = null; + }), ka()); + }, i: function(e21) { + if (!r10) { + for (var t11 = 0; t11 < a10.length; t11 += 1) + wa(s10[t11]); + wa(u10), r10 = true; + } + }, o: function(e21) { + s10 = s10.filter(Boolean); + for (var t11 = 0; t11 < s10.length; t11 += 1) + xa(s10[t11]); + xa(u10), r10 = false; + }, d: function(n11) { + n11 && wi(t10), xi(s10, n11), u10 && u10.d(), e20[5](null), o10 = false, i10(); + } }; + } + function ID(e20) { + return console.error("Unknown type of context menu item", e20), "???"; + } + function DD(e20, t10, n10) { + var r10, o10 = t10.items, i10 = t10.onCloseContextMenu, a10 = t10.tip; + Gi(function() { + var e21 = Array.from(r10.querySelectorAll("button")).find(function(e23) { + return !e23.disabled; + }); + e21 && e21.focus(); + }); + var s10 = { ArrowUp: "Up", ArrowDown: "Down", ArrowLeft: "Left", ArrowRight: "Right" }; + return e20.$$set = function(e21) { + "items" in e21 && n10(0, o10 = e21.items), "onCloseContextMenu" in e21 && n10(1, i10 = e21.onCloseContextMenu), "tip" in e21 && n10(2, a10 = e21.tip); + }, [o10, i10, a10, r10, function(e21) { + var t11 = PO(e21), n11 = s10[t11]; + if (n11 && e21.target) { + e21.preventDefault(); + var o11 = EO({ allElements: Array.from(r10.querySelectorAll("button:not([disabled])")), currentElement: e21.target, direction: n11, hasPrio: function(e23) { + return "jse-open-dropdown" !== e23.getAttribute("data-type"); + } }); + o11 && o11.focus(); + } + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(3, r10 = e21); + }); + }]; + } + var qD = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, DD, ND, Zo, { items: 0, onCloseContextMenu: 1, tip: 2 }, dD), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function zD(e20) { + var t10, n10; + return t10 = new qD({ props: { items: e20[2], onCloseContextMenu: e20[1], tip: e20[0] ? "Tip: you can open this context menu via right-click or with Ctrl+Q" : void 0 } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 4 & n11[0] && (r10.items = e21[2]), 2 & n11[0] && (r10.onCloseContextMenu = e21[1]), 1 & n11[0] && (r10.tip = e21[0] ? "Tip: you can open this context menu via right-click or with Ctrl+Q" : void 0), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function BD(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10 = t10.json, C10 = t10.documentState, $10 = t10.parser, _10 = t10.showTip, O10 = t10.onCloseContextMenu, M10 = t10.onRenderContextMenu, E10 = t10.onEditKey, A10 = t10.onEditValue, P10 = t10.onToggleEnforceString, T8 = t10.onCut, R8 = t10.onCopy, N8 = t10.onPaste, I10 = t10.onRemove, D10 = t10.onDuplicate, q10 = t10.onExtract, z10 = t10.onInsertBefore, B10 = t10.onInsert, L10 = t10.onConvert, F10 = t10.onInsertAfter, V10 = t10.onSort, H10 = t10.onTransform; + function W10(e21) { + l10 ? L10(e21) : B10(e21); + } + return e20.$$set = function(e21) { + "json" in e21 && n10(3, S10 = e21.json), "documentState" in e21 && n10(4, C10 = e21.documentState), "parser" in e21 && n10(5, $10 = e21.parser), "showTip" in e21 && n10(0, _10 = e21.showTip), "onCloseContextMenu" in e21 && n10(1, O10 = e21.onCloseContextMenu), "onRenderContextMenu" in e21 && n10(6, M10 = e21.onRenderContextMenu), "onEditKey" in e21 && n10(7, E10 = e21.onEditKey), "onEditValue" in e21 && n10(8, A10 = e21.onEditValue), "onToggleEnforceString" in e21 && n10(9, P10 = e21.onToggleEnforceString), "onCut" in e21 && n10(10, T8 = e21.onCut), "onCopy" in e21 && n10(11, R8 = e21.onCopy), "onPaste" in e21 && n10(12, N8 = e21.onPaste), "onRemove" in e21 && n10(13, I10 = e21.onRemove), "onDuplicate" in e21 && n10(14, D10 = e21.onDuplicate), "onExtract" in e21 && n10(15, q10 = e21.onExtract), "onInsertBefore" in e21 && n10(16, z10 = e21.onInsertBefore), "onInsert" in e21 && n10(17, B10 = e21.onInsert), "onConvert" in e21 && n10(18, L10 = e21.onConvert), "onInsertAfter" in e21 && n10(19, F10 = e21.onInsertAfter), "onSort" in e21 && n10(20, V10 = e21.onSort), "onTransform" in e21 && n10(21, H10 = e21.onTransform); + }, e20.$$.update = function() { + 16 & e20.$$.dirty[0] && n10(39, r10 = C10.selection), 8 & e20.$$.dirty[0] && n10(41, o10 = void 0 !== S10), 256 & e20.$$.dirty[1] && n10(33, i10 = !!r10), 256 & e20.$$.dirty[1] && n10(23, a10 = !!r10 && _w(JE(r10))), 8 & e20.$$.dirty[0] | 256 & e20.$$.dirty[1] && n10(40, s10 = r10 ? Ws(S10, JE(r10)) : void 0), 512 & e20.$$.dirty[1] && n10(37, c10 = Array.isArray(s10) ? "Edit array" : Gl(s10) ? "Edit object" : "Edit value"), 1280 & e20.$$.dirty[1] && n10(24, l10 = o10 && (mE(r10) || vE(r10) || pE(r10))), 25165824 & e20.$$.dirty[0] | 1024 & e20.$$.dirty[1] && n10(32, u10 = o10 && l10 && !a10), 8388608 & e20.$$.dirty[0] | 1280 & e20.$$.dirty[1] && n10(31, f10 = o10 && null != r10 && (mE(r10) || pE(r10)) && !a10), 8388616 & e20.$$.dirty[0] | 1280 & e20.$$.dirty[1] && n10(38, d10 = o10 && null != r10 && ME(r10) && !a10 && !Array.isArray(Ws(S10, Qk(JE(r10))))), 1280 & e20.$$.dirty[1] && n10(36, h10 = o10 && null != r10 && ME(r10)), 544 & e20.$$.dirty[1] && n10(34, v10 = h10 && !Ql(s10)), 16777216 & e20.$$.dirty[0] && n10(27, p10 = l10), 134217728 & e20.$$.dirty[0] && n10(26, m10 = p10 ? "Convert to:" : "Insert:"), 134217728 & e20.$$.dirty[0] | 4 & e20.$$.dirty[1] && n10(30, g10 = !p10 && i10), 134217728 & e20.$$.dirty[0] | 772 & e20.$$.dirty[1] && n10(29, y10 = p10 ? LE(r10) && !Gl(s10) : i10), 134217728 & e20.$$.dirty[0] | 772 & e20.$$.dirty[1] && n10(28, b10 = p10 ? LE(r10) && !Array.isArray(s10) : i10), 134217728 & e20.$$.dirty[0] | 772 & e20.$$.dirty[1] && n10(25, k10 = p10 ? LE(r10) && Ql(s10) : i10), 48 & e20.$$.dirty[0] | 768 & e20.$$.dirty[1] && n10(35, w10 = !(null == r10 || !s10) && oE(s10, C10.enforceStringMap, Zs(JE(r10)), $10)), 2142896e3 & e20.$$.dirty[0] | 255 & e20.$$.dirty[1] && n10(22, j10 = [{ type: "row", items: [{ type: "button", onClick: function() { + return E10(); + }, icon: dP, text: "Edit key", title: "Edit the key (Double-click on the key)", disabled: !d10 }, { type: "dropdown-button", main: { type: "button", onClick: function() { + return A10(); + }, icon: dP, text: c10, title: "Edit the value (Double-click on the value)", disabled: !h10 }, width: "11em", items: [{ type: "button", icon: dP, text: c10, title: "Edit the value (Double-click on the value)", onClick: function() { + return A10(); + }, disabled: !h10 }, { type: "button", icon: w10 ? iM : aM, text: "Enforce string", title: "Enforce keeping the value as string when it contains a numeric value", onClick: function() { + return P10(); + }, disabled: !v10 }] }] }, { type: "separator" }, { type: "row", items: [{ type: "dropdown-button", main: { type: "button", onClick: function() { + return T8(true); + }, icon: eP, text: "Cut", title: "Cut selected contents, formatted with indentation (Ctrl+X)", disabled: !l10 }, width: "10em", items: [{ type: "button", icon: eP, text: "Cut formatted", title: "Cut selected contents, formatted with indentation (Ctrl+X)", onClick: function() { + return T8(true); + }, disabled: !l10 }, { type: "button", icon: eP, text: "Cut compacted", title: "Cut selected contents, without indentation (Ctrl+Shift+X)", onClick: function() { + return T8(false); + }, disabled: !l10 }] }, { type: "dropdown-button", main: { type: "button", onClick: function() { + return R8(true); + }, icon: CP, text: "Copy", title: "Copy selected contents, formatted with indentation (Ctrl+C)", disabled: !l10 }, width: "12em", items: [{ type: "button", icon: CP, text: "Copy formatted", title: "Copy selected contents, formatted with indentation (Ctrl+C)", onClick: function() { + return R8(true); + }, disabled: !l10 }, { type: "button", icon: CP, text: "Copy compacted", title: "Copy selected contents, without indentation (Ctrl+Shift+C)", onClick: function() { + return R8(false); + }, disabled: !l10 }] }, { type: "button", onClick: function() { + return N8(); + }, icon: XA, text: "Paste", title: "Paste clipboard contents (Ctrl+V)", disabled: !i10 }] }, { type: "separator" }, { type: "row", items: [{ type: "column", items: [{ type: "button", onClick: function() { + return D10(); + }, icon: AP, text: "Duplicate", title: "Duplicate selected contents (Ctrl+D)", disabled: !u10 }, { type: "button", onClick: function() { + return q10(); + }, icon: pP, text: "Extract", title: "Extract selected contents", disabled: !f10 }, { type: "button", onClick: function() { + return V10(); + }, icon: kP, text: "Sort", title: "Sort array or object contents", disabled: !l10 }, { type: "button", onClick: function() { + return H10(); + }, icon: cP, text: "Transform", title: "Transform array or object contents (filter, sort, project)", disabled: !l10 }, { type: "button", onClick: function() { + return I10(); + }, icon: QA, text: "Remove", title: "Remove selected contents (Delete)", disabled: !l10 }] }, { type: "column", items: [{ type: "label", text: m10 }, { type: "button", onClick: function() { + return W10("structure"); + }, icon: p10 ? bP : $P, text: "Structure", title: m10 + " structure", disabled: !g10 }, { type: "button", onClick: function() { + return W10("object"); + }, icon: p10 ? bP : $P, text: "Object", title: m10 + " structure", disabled: !y10 }, { type: "button", onClick: function() { + return W10("array"); + }, icon: p10 ? bP : $P, text: "Array", title: m10 + " array", disabled: !b10 }, { type: "button", onClick: function() { + return W10("value"); + }, icon: p10 ? bP : $P, text: "Value", title: m10 + " value", disabled: !k10 }] }] }, { type: "separator" }, { type: "row", items: [{ type: "button", onClick: function() { + return z10(); + }, icon: aP, text: "Insert before", title: "Select area before current entry to insert or paste contents", disabled: !l10 || a10 }, { type: "button", onClick: function() { + return F10(); + }, icon: tP, text: "Insert after", title: "Select area after current entry to insert or paste contents", disabled: !l10 || a10 }] }]), 4194368 & e20.$$.dirty[0] && n10(2, x10 = M10(j10)); + }, [_10, O10, x10, S10, C10, $10, M10, E10, A10, P10, T8, R8, N8, I10, D10, q10, z10, B10, L10, F10, V10, H10, j10, a10, l10, k10, m10, p10, b10, y10, g10, f10, u10, i10, v10, w10, h10, c10, d10, r10, s10, o10]; + } + var LD = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, BD, zD, Zo, { json: 3, documentState: 4, parser: 5, showTip: 0, onCloseContextMenu: 1, onRenderContextMenu: 6, onEditKey: 7, onEditValue: 8, onToggleEnforceString: 9, onCut: 10, onCopy: 11, onPaste: 12, onRemove: 13, onDuplicate: 14, onExtract: 15, onInsertBefore: 16, onInsert: 17, onConvert: 18, onInsertAfter: 19, onSort: 20, onTransform: 21 }, null, [-1, -1]), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function FD(e20) { + mi(e20, "svelte-lajpxi", 'div.jse-collapsed-items.svelte-lajpxi.svelte-lajpxi{margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)));font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);color:var(--jse-collapsed-items-link-color, rgba(0, 0, 0, 0.38));padding:calc(0.5 * var(--jse-padding, 10px));border:8px solid transparent;border-width:8px 0;background-color:var(--jse-contents-background-color, transparent);background-image:linear-gradient(var(--jse-collapsed-items-background-color, #f5f5f5), var(--jse-collapsed-items-background-color, #f5f5f5)), linear-gradient(to bottom right, transparent 50.5%, var(--jse-collapsed-items-background-color, #f5f5f5) 50.5%), linear-gradient(to bottom left, transparent 50.5%, var(--jse-collapsed-items-background-color, #f5f5f5) 50.5%), linear-gradient(to top right, transparent 50.5%, var(--jse-collapsed-items-background-color, #f5f5f5) 50.5%), linear-gradient(to top left, transparent 50.5%, var(--jse-collapsed-items-background-color, #f5f5f5) 50.5%);background-repeat:repeat, repeat-x, repeat-x, repeat-x, repeat-x;background-position:0 0, 8px 0, 8px 0, 8px 100%, 8px 100%;background-size:auto auto, 16px 16px, 16px 16px, 16px 16px, 16px 16px;background-clip:padding-box, border-box, border-box, border-box, border-box;background-origin:padding-box, border-box, border-box, border-box, border-box;display:flex}div.jse-collapsed-items.svelte-lajpxi div.jse-text.svelte-lajpxi,div.jse-collapsed-items.svelte-lajpxi button.jse-expand-items.svelte-lajpxi{margin:0 calc(0.5 * var(--jse-padding, 10px))}div.jse-collapsed-items.svelte-lajpxi div.jse-text.svelte-lajpxi{display:inline}div.jse-collapsed-items.svelte-lajpxi button.jse-expand-items.svelte-lajpxi{font-family:inherit;font-size:inherit;color:var(--jse-collapsed-items-link-color, rgba(0, 0, 0, 0.38));background:none;border:none;padding:0;text-decoration:underline;cursor:pointer}div.jse-collapsed-items.svelte-lajpxi button.jse-expand-items.svelte-lajpxi:hover,div.jse-collapsed-items.svelte-lajpxi button.jse-expand-items.svelte-lajpxi:focus{color:var(--jse-collapsed-items-link-color-highlight, #ee5341)}'); + } + function VD(e20, t10, n10) { + var r10 = e20.slice(); + return r10[13] = t10[n10], r10; + } + function HD(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = e20[13].start + "", u10 = e20[13].end + ""; + function f10() { + return e20[12](e20[13]); + } + return { c: function() { + t10 = ji("button"), n10 = Ci("show "), r10 = Ci(l10), o10 = Ci("-"), i10 = Ci(u10), a10 = $i(), Ai(t10, "type", "button"), Ai(t10, "class", "jse-expand-items svelte-lajpxi"); + }, m: function(e21, l11) { + ki(e21, t10, l11), pi(t10, n10), pi(t10, r10), pi(t10, o10), pi(t10, i10), pi(t10, a10), s10 || (c10 = Oi(t10, "click", f10), s10 = true); + }, p: function(t11, n11) { + e20 = t11, 16 & n11 && l10 !== (l10 = e20[13].start + "") && Ni(r10, l10), 16 & n11 && u10 !== (u10 = e20[13].end + "") && Ni(i10, u10); + }, d: function(e21) { + e21 && wi(t10), s10 = false, c10(); + } }; + } + function WD(e20) { + for (var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = Ca(e20[4]), d10 = [], h10 = 0; h10 < f10.length; h10 += 1) + d10[h10] = HD(VD(e20, f10, h10)); + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = ji("div"), o10 = Ci("Items "), i10 = Ci(e20[3]), a10 = Ci("-"), s10 = Ci(e20[2]), c10 = $i(); + for (var l11 = 0; l11 < d10.length; l11 += 1) + d10[l11].c(); + Ai(r10, "class", "jse-text svelte-lajpxi"), Ai(t10, "role", "none"), Ai(t10, "class", "jse-collapsed-items svelte-lajpxi"), zi(t10, "jse-selected", e20[5]), Di(t10, "--level", e20[0].length + 2); + }, m: function(e21, f11) { + ki(e21, t10, f11), pi(t10, n10), pi(n10, r10), pi(r10, o10), pi(r10, i10), pi(r10, a10), pi(r10, s10), pi(n10, c10); + for (var h11 = 0; h11 < d10.length; h11 += 1) + d10[h11] && d10[h11].m(n10, null); + l10 || (u10 = Oi(t10, "mousemove", UD), l10 = true); + }, p: function(e21, r11) { + var o11 = jo(r11, 1)[0]; + if (8 & o11 && Ni(i10, e21[3]), 4 & o11 && Ni(s10, e21[2]), 19 & o11) { + var a11; + for (f10 = Ca(e21[4]), a11 = 0; a11 < f10.length; a11 += 1) { + var c11 = VD(e21, f10, a11); + d10[a11] ? d10[a11].p(c11, o11) : (d10[a11] = HD(c11), d10[a11].c(), d10[a11].m(n10, null)); + } + for (; a11 < d10.length; a11 += 1) + d10[a11].d(1); + d10.length = f10.length; + } + 32 & o11 && zi(t10, "jse-selected", e21[5]), 1 & o11 && Di(t10, "--level", e21[0].length + 2); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), xi(d10, e21), l10 = false, u10(); + } }; + } + function UD(e20) { + e20.stopPropagation(); + } + function JD(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10 = t10.visibleSections, l10 = t10.sectionIndex, u10 = t10.total, f10 = t10.path, d10 = t10.selection, h10 = t10.onExpandSection, v10 = t10.context; + return e20.$$set = function(e21) { + "visibleSections" in e21 && n10(6, c10 = e21.visibleSections), "sectionIndex" in e21 && n10(7, l10 = e21.sectionIndex), "total" in e21 && n10(8, u10 = e21.total), "path" in e21 && n10(0, f10 = e21.path), "selection" in e21 && n10(9, d10 = e21.selection), "onExpandSection" in e21 && n10(1, h10 = e21.onExpandSection), "context" in e21 && n10(10, v10 = e21.context); + }, e20.$$.update = function() { + 192 & e20.$$.dirty && n10(11, r10 = c10[l10]), 2048 & e20.$$.dirty && n10(3, o10 = r10.end), 448 & e20.$$.dirty && n10(2, i10 = c10[l10 + 1] ? c10[l10 + 1].start : u10), 1545 & e20.$$.dirty && n10(5, a10 = WE(v10.getJson(), d10, f10.concat(String(o10)))), 12 & e20.$$.dirty && n10(4, s10 = function(e21, t11) { + var n11 = { start: e21, end: Math.min(qM(e21), t11) }, r11 = Math.max(zM((e21 + t11) / 2), e21), o11 = { start: r11, end: Math.min(qM(r11), t11) }, i11 = zM(t11), a11 = i11 === t11 ? i11 - ls : i11, s11 = { start: Math.max(a11, e21), end: t11 }, c11 = [n11], l11 = o11.start >= n11.end && o11.end <= s11.start; + return l11 && c11.push(o11), s11.start >= (l11 ? o11.end : n11.end) && c11.push(s11), c11; + }(o10, i10)); + }, [f10, h10, i10, o10, s10, a10, c10, l10, u10, d10, v10, r10, function(e21) { + return h10(f10, e21); + }]; + } + var KD = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, JD, WD, Zo, { visibleSections: 6, sectionIndex: 7, total: 8, path: 0, selection: 9, onExpandSection: 1, context: 10 }, FD), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function GD(e20) { + mi(e20, "svelte-6k6355", ".jse-context-menu-pointer.svelte-6k6355{position:absolute;top:calc(-0.5 * var(--jse-context-menu-pointer-size, calc(1em + 4px)));right:calc(-0.5 * var(--jse-context-menu-pointer-size, calc(1em + 4px)));width:var(--jse-context-menu-pointer-size, calc(1em + 4px));height:var(--jse-context-menu-pointer-size, calc(1em + 4px));padding:0;margin:0;cursor:pointer;background:transparent;border-radius:2px;background:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565));color:var(--jse-context-menu-pointer-color, var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff)));border:none;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-context-menu-pointer.svelte-6k6355:hover{background:var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a))}"); + } + function QD(e20) { + var t10, n10, r10, o10, i10; + return n10 = new jM({ props: { data: gP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-context-menu-pointer svelte-6k6355"), Ai(t10, "title", xs), zi(t10, "jse-selected", e20[0]); + }, m: function(a10, s10) { + ki(a10, t10, s10), Ta(n10, t10, null), r10 = true, o10 || (i10 = Oi(t10, "click", e20[1]), o10 = true); + }, p: function(e21, n11) { + var o11 = jo(n11, 1)[0]; + (!r10 || 1 & o11) && zi(t10, "jse-selected", e21[0]); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), o10 = false, i10(); + } }; + } + function YD(e20, t10, n10) { + var r10 = t10.selected, o10 = t10.onContextMenu; + return e20.$$set = function(e21) { + "selected" in e21 && n10(0, r10 = e21.selected), "onContextMenu" in e21 && n10(2, o10 = e21.onContextMenu); + }, [r10, function(e21) { + for (var t11 = e21.target; t11 && "BUTTON" !== t11.nodeName; ) + t11 = t11.parentNode; + t11 && o10({ anchor: t11, left: 0, top: 0, width: Ms, height: Os, offsetTop: 2, offsetLeft: 0, showTip: true }); + }, o10]; + } + var XD = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, YD, QD, Zo, { selected: 0, onContextMenu: 2 }, GD), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function ZD(e20) { + mi(e20, "svelte-10xe8tv", '.jse-key.svelte-10xe8tv{display:inline-block;min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;color:var(--jse-key-color, #1a1a1a);cursor:var(--jse-contents-cursor, pointer);word-break:normal;overflow-wrap:normal;white-space:pre-wrap}.jse-key.svelte-10xe8tv:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-key.svelte-10xe8tv:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-key.jse-empty.svelte-10xe8tv{min-width:3em;outline:1px dotted var(--jse-tag-background, rgba(0, 0, 0, 0.2));-moz-outline-radius:2px}.jse-key.jse-empty.svelte-10xe8tv::after{pointer-events:none;color:var(--jse-tag-background, rgba(0, 0, 0, 0.2));content:"key"}'); + } + function eq(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10 = [rq, nq], l10 = []; + function u10(e21, t11) { + return e21[1] ? 0 : 1; + } + return n10 = u10(e20), r10 = l10[n10] = c10[n10](e20), { c: function() { + t10 = ji("div"), r10.c(), Ai(t10, "role", "none"), Ai(t10, "data-type", "selectable-key"), Ai(t10, "class", o10 = si(e20[6](e20[0])) + " svelte-10xe8tv"); + }, m: function(r11, o11) { + ki(r11, t10, o11), l10[n10].m(t10, null), i10 = true, a10 || (s10 = Oi(t10, "dblclick", e20[5]), a10 = true); + }, p: function(e21, a11) { + var s11 = n10; + (n10 = u10(e21)) === s11 ? l10[n10].p(e21, a11) : (ba(), xa(l10[s11], 1, 1, function() { + l10[s11] = null; + }), ka(), (r10 = l10[n10]) ? r10.p(e21, a11) : (r10 = l10[n10] = c10[n10](e21)).c(), wa(r10, 1), r10.m(t10, null)), (!i10 || 1 & a11 && o10 !== (o10 = si(e21[6](e21[0])) + " svelte-10xe8tv")) && Ai(t10, "class", o10); + }, i: function(e21) { + i10 || (wa(r10), i10 = true); + }, o: function(e21) { + xa(r10), i10 = false; + }, d: function(e21) { + e21 && wi(t10), l10[n10].d(), a10 = false, s10(); + } }; + } + function tq(e20) { + var t10, n10; + return t10 = new eA({ props: { value: e20[2].normalization.escapeValue(e20[0]), shortText: true, onChange: e20[7], onCancel: e20[8], onFind: e20[2].onFind } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 5 & n11 && (r10.value = e21[2].normalization.escapeValue(e21[0])), 4 & n11 && (r10.onFind = e21[2].onFind), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function nq(e20) { + var t10, n10 = gO(e20[2].normalization.escapeValue(e20[0])) + ""; + return { c: function() { + t10 = Ci(n10); + }, m: function(e21, n11) { + ki(e21, t10, n11); + }, p: function(e21, r10) { + 5 & r10 && n10 !== (n10 = gO(e21[2].normalization.escapeValue(e21[0])) + "") && Ni(t10, n10); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function rq(e20) { + var t10, n10; + return t10 = new TA({ props: { text: e20[2].normalization.escapeValue(e20[0]), searchResultItems: e20[1] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 5 & n11 && (r10.text = e21[2].normalization.escapeValue(e21[0])), 2 & n11 && (r10.searchResultItems = e21[1]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function oq(e20) { + var t10, n10; + return t10 = new XD({ props: { selected: true, onContextMenu: e20[2].onContextMenu } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 4 & n11 && (r10.onContextMenu = e21[2].onContextMenu), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function iq(e20) { + var t10, n10, r10, o10, i10, a10 = [tq, eq], s10 = []; + function c10(e21, t11) { + return !e21[2].readOnly && e21[4] ? 0 : 1; + } + t10 = c10(e20), n10 = s10[t10] = a10[t10](e20); + var l10 = !e20[2].readOnly && e20[3] && !e20[4] && oq(e20); + return { c: function() { + n10.c(), r10 = $i(), l10 && l10.c(), o10 = _i(); + }, m: function(e21, n11) { + s10[t10].m(e21, n11), ki(e21, r10, n11), l10 && l10.m(e21, n11), ki(e21, o10, n11), i10 = true; + }, p: function(e21, i11) { + var u10 = jo(i11, 1)[0], f10 = t10; + (t10 = c10(e21)) === f10 ? s10[t10].p(e21, u10) : (ba(), xa(s10[f10], 1, 1, function() { + s10[f10] = null; + }), ka(), (n10 = s10[t10]) ? n10.p(e21, u10) : (n10 = s10[t10] = a10[t10](e21)).c(), wa(n10, 1), n10.m(r10.parentNode, r10)), e21[2].readOnly || !e21[3] || e21[4] ? l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()) : l10 ? (l10.p(e21, u10), 28 & u10 && wa(l10, 1)) : ((l10 = oq(e21)).c(), wa(l10, 1), l10.m(o10.parentNode, o10)); + }, i: function(e21) { + i10 || (wa(n10), wa(l10), i10 = true); + }, o: function(e21) { + xa(n10), xa(l10), i10 = false; + }, d: function(e21) { + e21 && (wi(r10), wi(o10)), s10[t10].d(e21), l10 && l10.d(e21); + } }; + } + function aq(e20, t10, n10) { + var r10, o10, i10 = t10.path, a10 = t10.key, s10 = t10.selection, c10 = t10.searchResultItems, l10 = t10.onUpdateKey, u10 = t10.context; + return e20.$$set = function(e21) { + "path" in e21 && n10(9, i10 = e21.path), "key" in e21 && n10(0, a10 = e21.key), "selection" in e21 && n10(10, s10 = e21.selection), "searchResultItems" in e21 && n10(1, c10 = e21.searchResultItems), "onUpdateKey" in e21 && n10(11, l10 = e21.onUpdateKey), "context" in e21 && n10(2, u10 = e21.context); + }, e20.$$.update = function() { + 1536 & e20.$$.dirty && n10(3, r10 = !!s10 && (vE(s10) && Ow(s10.path, i10))), 1032 & e20.$$.dirty && n10(4, o10 = r10 && zE(s10)); + }, [a10, c10, u10, r10, o10, function(e21) { + o10 || u10.readOnly || (e21.preventDefault(), u10.onSelect(TE(i10, true))); + }, function(e21) { + return GE("jse-key", { "jse-empty": "" === e21 }); + }, function(e21, t11) { + var n11 = l10(a10, u10.normalization.unescapeValue(e21)), r11 = Qk(i10).concat(n11); + u10.onSelect(t11 === ns.nextInside ? RE(r11, false) : TE(r11, false)), t11 !== ns.self && u10.focus(); + }, function() { + u10.onSelect(TE(i10, false)), u10.focus(); + }, i10, s10, l10]; + } + var sq = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, aq, iq, Zo, { path: 9, key: 0, selection: 10, searchResultItems: 1, onUpdateKey: 11, context: 2 }, ZD), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function cq(e20, t10, n10) { + var r10 = e20.slice(); + return r10[8] = t10[n10], r10; + } + function lq(e20) { + var t10, n10, r10, o10 = [e20[8].props], i10 = e20[8].component; + function a10(e21, t11) { + var n11 = {}; + if (void 0 !== t11 && 1 & t11) + n11 = Ma(o10, [Ea(e21[8].props)]); + else + for (var r11 = 0; r11 < o10.length; r11 += 1) + n11 = Jo(n11, o10[r11]); + return { props: n11 }; + } + return i10 && (t10 = Li(i10, a10(e20))), { c: function() { + t10 && Pa(t10.$$.fragment), n10 = _i(); + }, m: function(e21, o11) { + t10 && Ta(t10, e21, o11), ki(e21, n10, o11), r10 = true; + }, p: function(e21, r11) { + if (1 & r11 && i10 !== (i10 = e21[8].component)) { + if (t10) { + ba(); + var s10 = t10; + xa(s10.$$.fragment, 1, 0, function() { + Ra(s10, 1); + }), ka(); + } + i10 ? (Pa((t10 = Li(i10, a10(e21, r11))).$$.fragment), wa(t10.$$.fragment, 1), Ta(t10, n10.parentNode, n10)) : t10 = null; + } else if (i10) { + var c10 = 1 & r11 ? Ma(o10, [Ea(e21[8].props)]) : {}; + t10.$set(c10); + } + }, i: function(e21) { + r10 || (t10 && wa(t10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + t10 && xa(t10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(n10), t10 && Ra(t10, e21); + } }; + } + function uq(e20) { + var t10, n10, r10 = e20[8].component, o10 = lq(e20); + return { c: function() { + o10.c(), t10 = _i(); + }, m: function(e21, r11) { + o10.m(e21, r11), ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + 1 & n11 && Zo(r10, r10 = e21[8].component) ? (ba(), xa(o10, 1, 1, Wo), ka(), (o10 = lq(e21)).c(), wa(o10, 1), o10.m(t10.parentNode, t10)) : o10.p(e21, n11); + }, i: function(e21) { + n10 || (wa(o10), n10 = true); + }, o: function(e21) { + xa(o10), n10 = false; + }, d: function(e21) { + e21 && wi(t10), o10.d(e21); + } }; + } + function fq(e20) { + for (var t10, n10, r10 = Ca(e20[0]), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = uq(cq(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }; + return { c: function() { + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + t10 = _i(); + }, m: function(e21, r11) { + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(e21, r11); + ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + var i11 = jo(n11, 1)[0]; + if (1 & i11) { + var s10; + for (r10 = Ca(e21[0]), s10 = 0; s10 < r10.length; s10 += 1) { + var c10 = cq(e21, r10, s10); + o10[s10] ? (o10[s10].p(c10, i11), wa(o10[s10], 1)) : (o10[s10] = uq(c10), o10[s10].c(), wa(o10[s10], 1), o10[s10].m(t10.parentNode, t10)); + } + for (ba(), s10 = r10.length; s10 < o10.length; s10 += 1) + a10(s10); + ka(); + } + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21); + } }; + } + function dq(e20, t10, n10) { + var r10, o10, i10 = t10.path, a10 = t10.value, s10 = t10.context, c10 = t10.enforceString, l10 = t10.selection, u10 = t10.searchResultItems; + return e20.$$set = function(e21) { + "path" in e21 && n10(1, i10 = e21.path), "value" in e21 && n10(2, a10 = e21.value), "context" in e21 && n10(3, s10 = e21.context), "enforceString" in e21 && n10(4, c10 = e21.enforceString), "selection" in e21 && n10(5, l10 = e21.selection), "searchResultItems" in e21 && n10(6, u10 = e21.searchResultItems); + }, e20.$$.update = function() { + 32 & e20.$$.dirty && n10(7, r10 = pE(l10) && zE(l10)), 254 & e20.$$.dirty && n10(0, o10 = s10.onRenderValue({ path: i10, value: a10, readOnly: s10.readOnly, enforceString: c10, isEditing: r10, parser: s10.parser, normalization: s10.normalization, selection: l10, searchResultItems: u10, onPatch: s10.onPatch, onPasteJson: s10.onPasteJson, onSelect: s10.onSelect, onFind: s10.onFind, findNextInside: s10.findNextInside, focus: s10.focus })); + }, [o10, i10, a10, s10, c10, l10, u10, r10]; + } + var hq = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, dq, fq, Zo, { path: 1, value: 2, context: 3, enforceString: 4, selection: 5, searchResultItems: 6 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var vq = hq; + var pq = { selecting: false, selectionAnchor: null, selectionAnchorType: null, selectionFocus: null, dragging: false }; + function mq(e20) { + var t10 = e20.json, n10 = e20.documentState, r10 = e20.deltaY, o10 = e20.items; + if (!n10.selection) + return { operations: void 0, updatedSelection: null, offset: 0 }; + var i10 = n10.selection, a10 = r10 < 0 ? function(e21) { + var t11 = e21.json, n11 = e21.items, r11 = e21.selection, o11 = e21.deltaY, i11 = xE(t11, r11), a11 = n11.findIndex(function(e23) { + return Ow(e23.path, i11); + }), s11 = function() { + var e23; + return null === (e23 = n11[c11 - 1]) || void 0 === e23 ? void 0 : e23.height; + }, c11 = a11, l11 = 0; + for (; void 0 !== s11() && Math.abs(o11) > l11 + s11() / 2; ) + l11 += s11(), c11 -= 1; + var u10 = n11[c11].path, f10 = c11 - a11; + return c11 !== a11 && void 0 !== n11[c11] ? { beforePath: u10, offset: f10 } : void 0; + }({ json: t10, selection: i10, deltaY: r10, items: o10 }) : function(e21) { + var t11, n11 = e21.json, r11 = e21.items, o11 = e21.selection, i11 = e21.deltaY, a11 = jE(n11, o11), s11 = r11.findIndex(function(e23) { + return Ow(e23.path, a11); + }), c11 = 0, l11 = s11, u10 = function() { + var e23; + return null === (e23 = r11[l11 + 1]) || void 0 === e23 ? void 0 : e23.height; + }; + for (; void 0 !== u10() && Math.abs(i11) > c11 + u10() / 2; ) + c11 += u10(), l11 += 1; + var f10 = Qk(a11), d10 = Ws(n11, f10), h10 = Array.isArray(d10), v10 = h10 ? l11 : l11 + 1, p10 = null === (t11 = r11[v10]) || void 0 === t11 ? void 0 : t11.path, m10 = l11 - s11; + return p10 ? { beforePath: p10, offset: m10 } : { append: true, offset: m10 }; + }({ json: t10, selection: i10, deltaY: r10, items: o10 }); + if (!a10 || 0 === a10.offset) + return { operations: void 0, updatedSelection: null, offset: 0 }; + var s10 = function(e21, t11, n11) { + if (!t11) + return []; + var r11 = "beforePath" in n11 ? n11.beforePath : void 0, o11 = "append" in n11 ? n11.append : void 0, i11 = Qk(JE(t11)), a11 = Ws(e21, i11); + if (!(o11 || r11 && AE(r11, i11) && r11.length > i11.length)) + return []; + var s11 = xE(e21, t11), c11 = jE(e21, t11), l11 = vb(s11), u10 = vb(c11), f10 = r11 ? r11[i11.length] : void 0; + if (!Rs(a11)) { + if (Ts(a11)) { + var d10 = Ul(l11), h10 = Ul(u10), v10 = void 0 !== f10 ? Ul(f10) : a11.length; + return YC(h10 - d10 + 1, v10 < d10 ? function(e23) { + return { op: "move", from: Zs(i11.concat(String(d10 + e23))), path: Zs(i11.concat(String(v10 + e23))) }; + } : function() { + return { op: "move", from: Zs(i11.concat(String(d10))), path: Zs(i11.concat(String(v10))) }; + }); + } + throw new Error("Cannot create move operations: parent must be an Object or Array"); + } + var p10 = Object.keys(a11), m10 = p10.indexOf(l11), g10 = p10.indexOf(u10), y10 = o11 ? p10.length : void 0 !== f10 ? p10.indexOf(f10) : -1; + return -1 !== m10 && -1 !== g10 && -1 !== y10 ? y10 > m10 ? [].concat(Bo(p10.slice(m10, g10 + 1)), Bo(p10.slice(y10, p10.length))).map(function(e23) { + return uA(i11, e23); + }) : [].concat(Bo(p10.slice(y10, m10)), Bo(p10.slice(g10 + 1, p10.length))).map(function(e23) { + return uA(i11, e23); + }) : []; + }(t10, i10, a10), c10 = Ws(t10, Qk(xE(t10, i10))); + if (Array.isArray(c10)) { + var l10 = function(e21) { + var t11, n11, r11 = e21.items, o11 = e21.json, i11 = e21.selection, a11 = e21.offset, s11 = xE(o11, i11), c11 = jE(o11, i11), l11 = r11.findIndex(function(e23) { + return Ow(e23.path, s11); + }), u10 = r11.findIndex(function(e23) { + return Ow(e23.path, c11); + }), f10 = null === (t11 = r11[l11 + a11]) || void 0 === t11 ? void 0 : t11.path, d10 = null === (n11 = r11[u10 + a11]) || void 0 === n11 ? void 0 : n11.path; + return DE(f10, d10); + }({ items: o10, json: t10, selection: i10, offset: a10.offset }); + return { operations: s10, updatedSelection: l10, offset: a10.offset }; + } + return { operations: s10, updatedSelection: null, offset: a10.offset }; + } + function gq(e20, t10) { + return function(e21, t11) { + if (e21) { + for (var n10 = {}, r10 = 0, o10 = Object.keys(e21); r10 < o10.length; r10++) { + var i10 = o10[r10]; + t11(i10, e21[i10]) && (n10[i10] = e21[i10]); + } + return Object.keys(n10).length > 0 ? n10 : void 0; + } + }(e20, function(e21) { + return nc(e21, t10); + }); + } + function yq(e20) { + mi(e20, "svelte-g0bfge", 'button.jse-validation-error.svelte-g0bfge{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-warning-color, #fdc539)}'); + } + function bq(e20) { + var t10, n10, r10, o10, i10, a10; + return n10 = new jM({ props: { data: TP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-validation-error svelte-g0bfge"); + }, m: function(s10, c10) { + ki(s10, t10, c10), Ta(n10, t10, null), o10 = true, i10 || (a10 = [Oi(t10, "click", function() { + Yo(e20[0]) && e20[0].apply(this, arguments); + }), ci(r10 = HA.call(null, t10, Ro({ text: e20[1] }, e20[2])))], i10 = true); + }, p: function(t11, n11) { + var o11 = jo(n11, 1)[0]; + e20 = t11, r10 && Yo(r10.update) && 2 & o11 && r10.update.call(null, Ro({ text: e20[1] }, e20[2])); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), i10 = false, Qo(a10); + } }; + } + function kq(e20, t10, n10) { + var r10, o10 = Zi("absolute-popup"), i10 = t10.validationError, a10 = t10.onExpand; + return e20.$$set = function(e21) { + "validationError" in e21 && n10(3, i10 = e21.validationError), "onExpand" in e21 && n10(0, a10 = e21.onExpand); + }, e20.$$.update = function() { + 8 & e20.$$.dirty && n10(1, r10 = hI(i10) && i10.isChildError ? "Contains invalid data" : i10.message); + }, [a10, r10, o10, i10]; + } + var wq = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, kq, bq, Xo, { validationError: 3, onExpand: 0 }, yq), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function xq(e20) { + mi(e20, "svelte-1koa14y", '.jse-json-node.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{position:relative;color:var(--jse-text-color, #4d4d4d)}.jse-json-node.jse-root.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{min-height:100%;padding-bottom:2px;box-sizing:border-box}.jse-json-node.jse-root.svelte-1koa14y>.jse-header-outer.svelte-1koa14y .jse-context-menu-pointer,.jse-json-node.jse-root.svelte-1koa14y>.jse-contents-outer.svelte-1koa14y>.jse-contents.svelte-1koa14y .jse-context-menu-pointer{top:0;right:calc(-2px - var(--jse-context-menu-pointer-size, calc(1em + 4px)))}.jse-json-node.jse-root.svelte-1koa14y>.jse-contents-outer.svelte-1koa14y>.jse-contents.svelte-1koa14y.svelte-1koa14y{padding-left:0}.jse-json-node.svelte-1koa14y .jse-props.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.svelte-1koa14y .jse-items.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{position:relative}.jse-json-node.svelte-1koa14y .jse-header-outer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.svelte-1koa14y .jse-footer-outer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:flex;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)))}.jse-json-node.svelte-1koa14y .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{position:relative}.jse-json-node.svelte-1koa14y .jse-header .jse-meta.svelte-1koa14y>.jse-meta-inner.svelte-1koa14y.svelte-1koa14y{display:flex;justify-content:center}.jse-json-node.svelte-1koa14y .jse-contents-outer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:flex;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)))}.jse-json-node.svelte-1koa14y .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.svelte-1koa14y .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:flex;flex-direction:row;align-items:start}.jse-json-node.svelte-1koa14y .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{padding-left:var(--jse-indent-size, calc(1em + 4px))}.jse-json-node.svelte-1koa14y .jse-footer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:inline-flex;padding-left:calc(var(--jse-indent-size, calc(1em + 4px)) + 5px)}.jse-json-node.svelte-1koa14y .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.svelte-1koa14y .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.svelte-1koa14y .jse-footer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{background:var(--jse-contents-background-color, transparent)}.jse-json-node.svelte-1koa14y .jse-insert-selection-area.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{visibility:hidden;padding:0 calc(0.5 * var(--jse-padding, 10px));flex:1}.jse-json-node.svelte-1koa14y .jse-insert-selection-area.jse-inside.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:inline-flex;align-items:center}.jse-json-node.svelte-1koa14y .jse-insert-selection-area.jse-after.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:flex;align-items:flex-end}.jse-json-node.svelte-1koa14y .jse-context-menu-pointer-anchor.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{position:relative}.jse-json-node.svelte-1koa14y .jse-insert-area.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{display:flex;position:relative;z-index:1;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)));max-width:250px;min-width:100px;height:0;margin-right:calc(0.5 * var(--jse-padding, 10px));outline:1px solid}.jse-json-node.svelte-1koa14y .jse-insert-area.svelte-1koa14y .jse-context-menu-pointer{right:-1px;background:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-json-node.svelte-1koa14y .jse-insert-area.jse-hovered.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{outline-color:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-json-node.svelte-1koa14y:hover>.jse-contents-outer .jse-insert-selection-area.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y:not(.jse-selected),.jse-json-node.svelte-1koa14y .jse-header-outer.svelte-1koa14y:hover>.jse-insert-selection-area.svelte-1koa14y.svelte-1koa14y:not(.jse-selected),.jse-json-node.svelte-1koa14y .jse-footer-outer:hover .jse-insert-selection-area.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y:not(.jse-selected){visibility:visible}.jse-json-node.jse-hovered.svelte-1koa14y>.jse-header-outer.svelte-1koa14y>.jse-header.svelte-1koa14y>.jse-meta.svelte-1koa14y,.jse-json-node.jse-hovered.svelte-1koa14y .jse-props .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-hovered.svelte-1koa14y .jse-items .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-hovered.svelte-1koa14y .jse-props .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-hovered.svelte-1koa14y .jse-items .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-hovered.svelte-1koa14y .jse-footer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-json-node.jse-selected.svelte-1koa14y>.jse-header-outer.svelte-1koa14y>.jse-header.svelte-1koa14y>.jse-meta.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-props .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-items .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-props .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-items .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-footer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected.svelte-1koa14y .jse-key,.jse-json-node.jse-selected.svelte-1koa14y .jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-selected.svelte-1koa14y .jse-expand.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{background:var(--jse-selection-background-color, #d3d3d3)}.jse-json-node.jse-selected-key.svelte-1koa14y>.jse-contents-outer.svelte-1koa14y>.jse-contents.svelte-1koa14y>.jse-identifier>.jse-key,.jse-json-node.jse-selected-key.svelte-1koa14y>.jse-header-outer.svelte-1koa14y>.jse-header.svelte-1koa14y>.jse-identifier>.jse-key{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-contents-outer.svelte-1koa14y>.jse-contents.svelte-1koa14y>.jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.svelte-1koa14y .jse-collapsed-items.jse-selected,.jse-json-node.jse-selected.svelte-1koa14y .jse-collapsed-items,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-collapsed-items{background-color:var(--jse-selection-background-color, #d3d3d3);--jse-collapsed-items-background-color:var(--jse-collapsed-items-selected-background-color, #c2c2c2)}.jse-json-node.jse-selected-value.svelte-1koa14y .jse-meta.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-header-outer.svelte-1koa14y>.jse-header.svelte-1koa14y>.jse-meta.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-footer-outer.svelte-1koa14y>.jse-footer.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-footer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-expand.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-contents.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-header.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-footer.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-expand.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{background:var(--jse-selection-background-color, #d3d3d3)}.jse-json-node.jse-selected-value.svelte-1koa14y .jse-meta.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-meta.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-header-outer.svelte-1koa14y>.jse-header.svelte-1koa14y>.jse-meta.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-header-outer.svelte-1koa14y>.jse-header.svelte-1koa14y>.jse-meta.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-footer-outer.svelte-1koa14y>.jse-footer.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y>.jse-footer-outer.svelte-1koa14y>.jse-footer.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-contents.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-contents.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-header.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-header.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-footer.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-footer.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-expand.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-props .jse-expand.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-contents.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-contents.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-header.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-header.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-footer.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-footer.svelte-1koa14y .jse-value,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-expand.svelte-1koa14y .jse-key,.jse-json-node.jse-selected-value.svelte-1koa14y .jse-items .jse-expand.svelte-1koa14y .jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-readonly.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{--jse-contents-selected-cursor:pointer}.jse-json-node.svelte-1koa14y .jse-insert-area.jse-selected.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{outline-color:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565))}.jse-json-node.svelte-1koa14y .jse-insert-area.jse-selected.svelte-1koa14y .jse-context-menu-pointer{background:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565))}.jse-json-node.svelte-1koa14y .jse-insert-area.jse-selected.svelte-1koa14y .jse-context-menu-pointer:hover{background:var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a))}.jse-main:not(.jse-focus) .jse-json-node.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{--jse-selection-background-color:var(--jse-selection-background-inactive-color, #e8e8e8);--jse-context-menu-pointer-background:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-expand.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{width:var(--jse-indent-size, calc(1em + 4px));padding:0;margin:0;border:none;cursor:pointer;background:transparent;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38));font-size:var(--jse-font-size-mono, 14px);height:var(--jse-line-height, calc(1em + 4px))}.jse-expand.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y:hover{opacity:0.8}.jse-meta.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-separator.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-index.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y,.jse-bracket.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{vertical-align:top;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-index.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{padding:0 calc(0.5 * var(--jse-padding, 10px))}.jse-bracket.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{padding:0 2px}.jse-bracket.jse-expanded.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{padding-right:var(--jse-padding, 10px)}.jse-tag.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{border:none;font-size:80%;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);color:var(--jse-tag-color, var(--jse-text-color-inverse, #fff));background:var(--jse-tag-background, rgba(0, 0, 0, 0.2));border-radius:2px;cursor:pointer;display:inline-block;padding:0 4px;line-height:normal;margin:1px 0}.jse-tag.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y:hover{opacity:0.8}.jse-tag.jse-expanded.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{opacity:0.7;cursor:inherit}.jse-identifier.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y.svelte-1koa14y{vertical-align:top;position:relative}'); + } + var jq = function(e20) { + return {}; + }; + var Sq = function(e20) { + return {}; + }; + function Cq(e20, t10, n10) { + var r10 = e20.slice(); + return r10[52] = t10[n10], r10; + } + var $q = function(e20) { + return {}; + }; + var _q = function(e20) { + return {}; + }; + function Oq(e20, t10, n10) { + var r10 = e20.slice(); + return r10[46] = t10[n10], r10[48] = n10, r10; + } + function Mq(e20, t10, n10) { + var r10 = e20.slice(); + return r10[49] = t10[n10], r10; + } + var Eq = function(e20) { + return {}; + }; + var Aq = function(e20) { + return {}; + }; + function Pq(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10 = !e20[8].readOnly && e20[16] && e20[7] && (pE(e20[7]) || mE(e20[7])) && !zE(e20[7]) && Ow(JE(e20[7]), e20[1]), f10 = e20[33].identifier, d10 = ei(f10, e20, e20[34], Sq), h10 = !e20[17] && Nq(); + i10 = new vq({ props: { path: e20[1], value: e20[0], enforceString: e20[13] || false, selection: e20[16] ? e20[7] : null, searchResultItems: CA(e20[6], e20[9]), context: e20[8] } }); + var v10 = u10 && Iq(e20), p10 = e20[15] && Dq(e20), m10 = !e20[17] && qq(e20); + return { c: function() { + t10 = ji("div"), n10 = ji("div"), d10 && d10.c(), r10 = $i(), h10 && h10.c(), o10 = $i(), Pa(i10.$$.fragment), a10 = $i(), v10 && v10.c(), s10 = $i(), p10 && p10.c(), c10 = $i(), m10 && m10.c(), Ai(n10, "class", "jse-contents svelte-1koa14y"), Ai(t10, "class", "jse-contents-outer svelte-1koa14y"); + }, m: function(e21, u11) { + ki(e21, t10, u11), pi(t10, n10), d10 && d10.m(n10, null), pi(n10, r10), h10 && h10.m(n10, null), pi(n10, o10), Ta(i10, n10, null), pi(n10, a10), v10 && v10.m(n10, null), pi(t10, s10), p10 && p10.m(t10, null), pi(t10, c10), m10 && m10.m(t10, null), l10 = true; + }, p: function(e21, r11) { + d10 && d10.p && (!l10 || 8 & r11[1]) && ri(d10, f10, e21, e21[34], l10 ? ni(f10, e21[34], r11, jq) : oi(e21[34]), Sq), e21[17] ? h10 && (h10.d(1), h10 = null) : h10 || ((h10 = Nq()).c(), h10.m(n10, o10)); + var a11 = {}; + 2 & r11[0] && (a11.path = e21[1]), 1 & r11[0] && (a11.value = e21[0]), 8192 & r11[0] && (a11.enforceString = e21[13] || false), 65664 & r11[0] && (a11.selection = e21[16] ? e21[7] : null), 576 & r11[0] && (a11.searchResultItems = CA(e21[6], e21[9])), 256 & r11[0] && (a11.context = e21[8]), i10.$set(a11), 65922 & r11[0] && (u10 = !e21[8].readOnly && e21[16] && e21[7] && (pE(e21[7]) || mE(e21[7])) && !zE(e21[7]) && Ow(JE(e21[7]), e21[1])), u10 ? v10 ? (v10.p(e21, r11), 65922 & r11[0] && wa(v10, 1)) : ((v10 = Iq(e21)).c(), wa(v10, 1), v10.m(n10, null)) : v10 && (ba(), xa(v10, 1, 1, function() { + v10 = null; + }), ka()), e21[15] ? p10 ? (p10.p(e21, r11), 32768 & r11[0] && wa(p10, 1)) : ((p10 = Dq(e21)).c(), wa(p10, 1), p10.m(t10, c10)) : p10 && (ba(), xa(p10, 1, 1, function() { + p10 = null; + }), ka()), e21[17] ? m10 && (m10.d(1), m10 = null) : m10 ? m10.p(e21, r11) : ((m10 = qq(e21)).c(), m10.m(t10, null)); + }, i: function(e21) { + l10 || (wa(d10, e21), wa(i10.$$.fragment, e21), wa(v10), wa(p10), l10 = true); + }, o: function(e21) { + xa(d10, e21), xa(i10.$$.fragment, e21), xa(v10), xa(p10), l10 = false; + }, d: function(e21) { + e21 && wi(t10), d10 && d10.d(e21), h10 && h10.d(), Ra(i10), v10 && v10.d(), p10 && p10.d(), m10 && m10.d(); + } }; + } + function Tq(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10 = !e20[8].readOnly && e20[16] && e20[7] && (pE(e20[7]) || mE(e20[7])) && !zE(e20[7]) && Ow(JE(e20[7]), e20[1]), k10 = [Bq, zq], w10 = []; + function x10(e21, t11) { + return e21[12] ? 0 : 1; + } + o10 = x10(e20), i10 = w10[o10] = k10[o10](e20); + var j10 = e20[33].identifier, S10 = ei(j10, e20, e20[34], _q), C10 = !e20[17] && Lq(); + function $10(e21, t11) { + return e21[12] ? Vq : Fq; + } + var _10 = $10(e20), O10 = _10(e20), M10 = b10 && Hq(e20), E10 = e20[15] && (!e20[12] || !e20[15].isChildError) && Wq(e20); + function A10(e21, t11) { + return e21[12] ? Jq : e21[17] ? void 0 : Uq; + } + var P10 = A10(e20), T8 = P10 && P10(e20), R8 = e20[12] && Kq(e20); + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = ji("button"), i10.c(), a10 = $i(), S10 && S10.c(), s10 = $i(), C10 && C10.c(), c10 = $i(), l10 = ji("div"), u10 = ji("div"), O10.c(), f10 = $i(), M10 && M10.c(), d10 = $i(), E10 && E10.c(), h10 = $i(), T8 && T8.c(), v10 = $i(), R8 && R8.c(), p10 = _i(), Ai(r10, "type", "button"), Ai(r10, "class", "jse-expand svelte-1koa14y"), Ai(r10, "title", "Expand or collapse this object (Ctrl+Click to expand/collapse recursively)"), Ai(u10, "class", "jse-meta-inner svelte-1koa14y"), Ai(l10, "class", "jse-meta svelte-1koa14y"), Ai(l10, "data-type", "selectable-value"), Ai(n10, "class", "jse-header svelte-1koa14y"), Ai(t10, "class", "jse-header-outer svelte-1koa14y"); + }, m: function(i11, b11) { + ki(i11, t10, b11), pi(t10, n10), pi(n10, r10), w10[o10].m(r10, null), pi(n10, a10), S10 && S10.m(n10, null), pi(n10, s10), C10 && C10.m(n10, null), pi(n10, c10), pi(n10, l10), pi(l10, u10), O10.m(u10, null), pi(n10, f10), M10 && M10.m(n10, null), pi(t10, d10), E10 && E10.m(t10, null), pi(t10, h10), T8 && T8.m(t10, null), ki(i11, v10, b11), R8 && R8.m(i11, b11), ki(i11, p10, b11), m10 = true, g10 || (y10 = Oi(r10, "click", e20[20]), g10 = true); + }, p: function(e21, a11) { + var s11 = o10; + (o10 = x10(e21)) !== s11 && (ba(), xa(w10[s11], 1, 1, function() { + w10[s11] = null; + }), ka(), (i10 = w10[o10]) || (i10 = w10[o10] = k10[o10](e21)).c(), wa(i10, 1), i10.m(r10, null)), S10 && S10.p && (!m10 || 8 & a11[1]) && ri(S10, j10, e21, e21[34], m10 ? ni(j10, e21[34], a11, $q) : oi(e21[34]), _q), e21[17] ? C10 && (C10.d(1), C10 = null) : C10 || ((C10 = Lq()).c(), C10.m(n10, c10)), _10 === (_10 = $10(e21)) && O10 ? O10.p(e21, a11) : (O10.d(1), (O10 = _10(e21)) && (O10.c(), O10.m(u10, null))), 65922 & a11[0] && (b10 = !e21[8].readOnly && e21[16] && e21[7] && (pE(e21[7]) || mE(e21[7])) && !zE(e21[7]) && Ow(JE(e21[7]), e21[1])), b10 ? M10 ? (M10.p(e21, a11), 65922 & a11[0] && wa(M10, 1)) : ((M10 = Hq(e21)).c(), wa(M10, 1), M10.m(n10, null)) : M10 && (ba(), xa(M10, 1, 1, function() { + M10 = null; + }), ka()), !e21[15] || e21[12] && e21[15].isChildError ? E10 && (ba(), xa(E10, 1, 1, function() { + E10 = null; + }), ka()) : E10 ? (E10.p(e21, a11), 36864 & a11[0] && wa(E10, 1)) : ((E10 = Wq(e21)).c(), wa(E10, 1), E10.m(t10, h10)), P10 === (P10 = A10(e21)) && T8 ? T8.p(e21, a11) : (T8 && T8.d(1), (T8 = P10 && P10(e21)) && (T8.c(), T8.m(t10, null))), e21[12] ? R8 ? (R8.p(e21, a11), 4096 & a11[0] && wa(R8, 1)) : ((R8 = Kq(e21)).c(), wa(R8, 1), R8.m(p10.parentNode, p10)) : R8 && (ba(), xa(R8, 1, 1, function() { + R8 = null; + }), ka()); + }, i: function(e21) { + m10 || (wa(i10), wa(S10, e21), wa(M10), wa(E10), wa(R8), m10 = true); + }, o: function(e21) { + xa(i10), xa(S10, e21), xa(M10), xa(E10), xa(R8), m10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(v10), wi(p10)), w10[o10].d(), S10 && S10.d(e21), C10 && C10.d(), O10.d(), M10 && M10.d(), E10 && E10.d(), T8 && T8.d(), R8 && R8.d(e21), g10 = false, y10(); + } }; + } + function Rq(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10 = !e20[8].readOnly && e20[16] && e20[7] && (pE(e20[7]) || mE(e20[7])) && !zE(e20[7]) && Ow(JE(e20[7]), e20[1]), k10 = [ez, Zq], w10 = []; + function x10(e21, t11) { + return e21[12] ? 0 : 1; + } + o10 = x10(e20), i10 = w10[o10] = k10[o10](e20); + var j10 = e20[33].identifier, S10 = ei(j10, e20, e20[34], Aq), C10 = !e20[17] && tz(); + function $10(e21, t11) { + return e21[12] ? rz : nz; + } + var _10 = $10(e20), O10 = _10(e20), M10 = b10 && oz(e20), E10 = e20[15] && (!e20[12] || !e20[15].isChildError) && iz(e20); + function A10(e21, t11) { + return e21[12] ? sz : az; + } + var P10 = A10(e20), T8 = P10(e20), R8 = e20[12] && cz(e20); + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = ji("button"), i10.c(), a10 = $i(), S10 && S10.c(), s10 = $i(), C10 && C10.c(), c10 = $i(), l10 = ji("div"), u10 = ji("div"), O10.c(), f10 = $i(), M10 && M10.c(), d10 = $i(), E10 && E10.c(), h10 = $i(), T8.c(), v10 = $i(), R8 && R8.c(), p10 = _i(), Ai(r10, "type", "button"), Ai(r10, "class", "jse-expand svelte-1koa14y"), Ai(r10, "title", "Expand or collapse this array (Ctrl+Click to expand/collapse recursively)"), Ai(u10, "class", "jse-meta-inner svelte-1koa14y"), Ai(u10, "data-type", "selectable-value"), Ai(l10, "class", "jse-meta svelte-1koa14y"), Ai(n10, "class", "jse-header svelte-1koa14y"), Ai(t10, "class", "jse-header-outer svelte-1koa14y"); + }, m: function(i11, b11) { + ki(i11, t10, b11), pi(t10, n10), pi(n10, r10), w10[o10].m(r10, null), pi(n10, a10), S10 && S10.m(n10, null), pi(n10, s10), C10 && C10.m(n10, null), pi(n10, c10), pi(n10, l10), pi(l10, u10), O10.m(u10, null), pi(n10, f10), M10 && M10.m(n10, null), pi(t10, d10), E10 && E10.m(t10, null), pi(t10, h10), T8.m(t10, null), ki(i11, v10, b11), R8 && R8.m(i11, b11), ki(i11, p10, b11), m10 = true, g10 || (y10 = Oi(r10, "click", e20[20]), g10 = true); + }, p: function(e21, a11) { + var s11 = o10; + (o10 = x10(e21)) !== s11 && (ba(), xa(w10[s11], 1, 1, function() { + w10[s11] = null; + }), ka(), (i10 = w10[o10]) || (i10 = w10[o10] = k10[o10](e21)).c(), wa(i10, 1), i10.m(r10, null)), S10 && S10.p && (!m10 || 8 & a11[1]) && ri(S10, j10, e21, e21[34], m10 ? ni(j10, e21[34], a11, Eq) : oi(e21[34]), Aq), e21[17] ? C10 && (C10.d(1), C10 = null) : C10 || ((C10 = tz()).c(), C10.m(n10, c10)), _10 === (_10 = $10(e21)) && O10 ? O10.p(e21, a11) : (O10.d(1), (O10 = _10(e21)) && (O10.c(), O10.m(u10, null))), 65922 & a11[0] && (b10 = !e21[8].readOnly && e21[16] && e21[7] && (pE(e21[7]) || mE(e21[7])) && !zE(e21[7]) && Ow(JE(e21[7]), e21[1])), b10 ? M10 ? (M10.p(e21, a11), 65922 & a11[0] && wa(M10, 1)) : ((M10 = oz(e21)).c(), wa(M10, 1), M10.m(n10, null)) : M10 && (ba(), xa(M10, 1, 1, function() { + M10 = null; + }), ka()), !e21[15] || e21[12] && e21[15].isChildError ? E10 && (ba(), xa(E10, 1, 1, function() { + E10 = null; + }), ka()) : E10 ? (E10.p(e21, a11), 36864 & a11[0] && wa(E10, 1)) : ((E10 = iz(e21)).c(), wa(E10, 1), E10.m(t10, h10)), P10 === (P10 = A10(e21)) && T8 ? T8.p(e21, a11) : (T8.d(1), (T8 = P10(e21)) && (T8.c(), T8.m(t10, null))), e21[12] ? R8 ? (R8.p(e21, a11), 4096 & a11[0] && wa(R8, 1)) : ((R8 = cz(e21)).c(), wa(R8, 1), R8.m(p10.parentNode, p10)) : R8 && (ba(), xa(R8, 1, 1, function() { + R8 = null; + }), ka()); + }, i: function(e21) { + m10 || (wa(i10), wa(S10, e21), wa(M10), wa(E10), wa(R8), m10 = true); + }, o: function(e21) { + xa(i10), xa(S10, e21), xa(M10), xa(E10), xa(R8), m10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(v10), wi(p10)), w10[o10].d(), S10 && S10.d(e21), C10 && C10.d(), O10.d(), M10 && M10.d(), E10 && E10.d(), T8.d(), R8 && R8.d(e21), g10 = false, y10(); + } }; + } + function Nq(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).textContent = ":", Ai(t10, "class", "jse-separator svelte-1koa14y"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function Iq(e20) { + var t10, n10, r10; + return n10 = new XD({ props: { selected: true, onContextMenu: e20[8].onContextMenu } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-context-menu-pointer-anchor svelte-1koa14y"); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 256 & t11[0] && (r11.onContextMenu = e21[8].onContextMenu), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function Dq(e20) { + var t10, n10; + return t10 = new wq({ props: { validationError: e20[15], onExpand: e20[21] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 32768 & n11[0] && (r10.validationError = e21[15]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function qq(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-after svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-after"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[29]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function zq(e20) { + var t10, n10; + return t10 = new jM({ props: { data: YA } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Bq(e20) { + var t10, n10; + return t10 = new jM({ props: { data: gP } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Lq(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).textContent = ":", Ai(t10, "class", "jse-separator svelte-1koa14y"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function Fq(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = Object.keys(e20[0]).length + "", d10 = 1 === Object.keys(e20[0]).length ? "prop" : "props"; + return { c: function() { + (t10 = ji("div")).textContent = "{", n10 = $i(), r10 = ji("button"), o10 = Ci(f10), i10 = $i(), a10 = Ci(d10), s10 = $i(), (c10 = ji("div")).textContent = "}", Ai(t10, "class", "jse-bracket svelte-1koa14y"), Ai(r10, "type", "button"), Ai(r10, "class", "jse-tag svelte-1koa14y"), Ai(c10, "class", "jse-bracket svelte-1koa14y"); + }, m: function(f11, d11) { + ki(f11, t10, d11), ki(f11, n10, d11), ki(f11, r10, d11), pi(r10, o10), pi(r10, i10), pi(r10, a10), ki(f11, s10, d11), ki(f11, c10, d11), l10 || (u10 = Oi(r10, "click", e20[21]), l10 = true); + }, p: function(e21, t11) { + 1 & t11[0] && f10 !== (f10 = Object.keys(e21[0]).length + "") && Ni(o10, f10), 1 & t11[0] && d10 !== (d10 = 1 === Object.keys(e21[0]).length ? "prop" : "props") && Ni(a10, d10); + }, d: function(e21) { + e21 && (wi(t10), wi(n10), wi(r10), wi(s10), wi(c10)), l10 = false, u10(); + } }; + } + function Vq(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).textContent = "{", Ai(t10, "class", "jse-bracket jse-expanded svelte-1koa14y"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function Hq(e20) { + var t10, n10, r10; + return n10 = new XD({ props: { selected: true, onContextMenu: e20[8].onContextMenu } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-context-menu-pointer-anchor svelte-1koa14y"); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 256 & t11[0] && (r11.onContextMenu = e21[8].onContextMenu), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function Wq(e20) { + var t10, n10; + return t10 = new wq({ props: { validationError: e20[15], onExpand: e20[21] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 32768 & n11[0] && (r10.validationError = e21[15]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Uq(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-after svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-after"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[29]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function Jq(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-inside svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-inside"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[28]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function Kq(e20) { + for (var t10, n10, r10, o10, i10, a10, s10, c10 = !e20[8].readOnly && (e20[10] === js || e20[16] && hE(e20[7])), l10 = c10 && Gq(e20), u10 = Ca(e20[18](e20[1], e20[0], e20[2], e20[3], e20[4], e20[5], e20[6], e20[7], e20[11])), f10 = [], d10 = 0; d10 < u10.length; d10 += 1) + f10[d10] = Yq(Cq(e20, u10, d10)); + var h10 = function(e21) { + return xa(f10[e21], 1, 1, function() { + f10[e21] = null; + }); + }, v10 = !e20[17] && Xq(e20); + return { c: function() { + t10 = ji("div"), l10 && l10.c(), n10 = $i(); + for (var e21 = 0; e21 < f10.length; e21 += 1) + f10[e21].c(); + r10 = $i(), o10 = ji("div"), (i10 = ji("div")).innerHTML = '
}
', a10 = $i(), v10 && v10.c(), Ai(t10, "class", "jse-props svelte-1koa14y"), Ai(i10, "data-type", "selectable-value"), Ai(i10, "class", "jse-footer svelte-1koa14y"), Ai(o10, "class", "jse-footer-outer svelte-1koa14y"); + }, m: function(e21, c11) { + ki(e21, t10, c11), l10 && l10.m(t10, null), pi(t10, n10); + for (var u11 = 0; u11 < f10.length; u11 += 1) + f10[u11] && f10[u11].m(t10, null); + ki(e21, r10, c11), ki(e21, o10, c11), pi(o10, i10), pi(o10, a10), v10 && v10.m(o10, null), s10 = true; + }, p: function(e21, r11) { + if (66944 & r11[0] && (c10 = !e21[8].readOnly && (e21[10] === js || e21[16] && hE(e21[7]))), c10 ? l10 ? (l10.p(e21, r11), 66944 & r11[0] && wa(l10, 1)) : ((l10 = Gq(e21)).c(), wa(l10, 1), l10.m(t10, n10)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()), 38013439 & r11[0]) { + var i11; + for (u10 = Ca(e21[18](e21[1], e21[0], e21[2], e21[3], e21[4], e21[5], e21[6], e21[7], e21[11])), i11 = 0; i11 < u10.length; i11 += 1) { + var a11 = Cq(e21, u10, i11); + f10[i11] ? (f10[i11].p(a11, r11), wa(f10[i11], 1)) : (f10[i11] = Yq(a11), f10[i11].c(), wa(f10[i11], 1), f10[i11].m(t10, null)); + } + for (ba(), i11 = u10.length; i11 < f10.length; i11 += 1) + h10(i11); + ka(); + } + e21[17] ? v10 && (v10.d(1), v10 = null) : v10 ? v10.p(e21, r11) : ((v10 = Xq(e21)).c(), v10.m(o10, null)); + }, i: function(e21) { + if (!s10) { + wa(l10); + for (var t11 = 0; t11 < u10.length; t11 += 1) + wa(f10[t11]); + s10 = true; + } + }, o: function(e21) { + xa(l10), f10 = f10.filter(Boolean); + for (var t11 = 0; t11 < f10.length; t11 += 1) + xa(f10[t11]); + s10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(r10), wi(o10)), l10 && l10.d(), xi(f10, e21), v10 && v10.d(); + } }; + } + function Gq(e20) { + var t10, n10, r10; + return n10 = new XD({ props: { selected: e20[16] && hE(e20[7]), onContextMenu: e20[30] } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-insert-area jse-inside svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-inside"), Ai(t10, "title", ws), zi(t10, "jse-hovered", e20[10] === js), zi(t10, "jse-selected", e20[16] && hE(e20[7])), Di(t10, "--level", e20[1].length + 1); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, o10) { + var i10 = {}; + 65664 & o10[0] && (i10.selected = e21[16] && hE(e21[7])), n10.$set(i10), (!r10 || 1024 & o10[0]) && zi(t10, "jse-hovered", e21[10] === js), (!r10 || 65664 & o10[0]) && zi(t10, "jse-selected", e21[16] && hE(e21[7])), 2 & o10[0] && Di(t10, "--level", e21[1].length + 1); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function Qq(e20) { + var t10, n10, r10, o10; + return n10 = new sq({ props: { path: e20[52].path, key: e20[52].key, selection: e20[52].selection, searchResultItems: e20[52].keySearchResultItemsMap, context: e20[8], onUpdateKey: e20[22] } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), r10 = $i(), Ai(t10, "slot", "identifier"), Ai(t10, "class", "jse-identifier svelte-1koa14y"); + }, m: function(e21, i10) { + ki(e21, t10, i10), Ta(n10, t10, null), pi(t10, r10), o10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 2303 & t11[0] && (r11.path = e21[52].path), 2303 & t11[0] && (r11.key = e21[52].key), 2303 & t11[0] && (r11.selection = e21[52].selection), 2303 & t11[0] && (r11.searchResultItems = e21[52].keySearchResultItemsMap), 256 & t11[0] && (r11.context = e21[8]), n10.$set(r11); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function Yq(e20) { + var t10, n10; + return t10 = new yz({ props: { value: e20[52].value, path: e20[52].path, expandedMap: e20[52].expandedMap, enforceStringMap: e20[52].enforceStringMap, visibleSectionsMap: e20[52].visibleSectionsMap, validationErrorsMap: e20[52].validationErrorsMap, searchResultItemsMap: e20[52].valueSearchResultItemsMap, selection: e20[52].selection, context: e20[8], onDragSelectionStart: e20[25], $$slots: { identifier: [Qq] }, $$scope: { ctx: e20 } } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 2303 & n11[0] && (r10.value = e21[52].value), 2303 & n11[0] && (r10.path = e21[52].path), 2303 & n11[0] && (r10.expandedMap = e21[52].expandedMap), 2303 & n11[0] && (r10.enforceStringMap = e21[52].enforceStringMap), 2303 & n11[0] && (r10.visibleSectionsMap = e21[52].visibleSectionsMap), 2303 & n11[0] && (r10.validationErrorsMap = e21[52].validationErrorsMap), 2303 & n11[0] && (r10.searchResultItemsMap = e21[52].valueSearchResultItemsMap), 2303 & n11[0] && (r10.selection = e21[52].selection), 256 & n11[0] && (r10.context = e21[8]), 2559 & n11[0] | 8 & n11[1] && (r10.$$scope = { dirty: n11, ctx: e21 }), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Xq(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-after svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-after"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[29]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function Zq(e20) { + var t10, n10; + return t10 = new jM({ props: { data: YA } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function ez(e20) { + var t10, n10; + return t10 = new jM({ props: { data: gP } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function tz(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).textContent = ":", Ai(t10, "class", "jse-separator svelte-1koa14y"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function nz(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = e20[0].length + "", d10 = 1 === e20[0].length ? "item" : "items"; + return { c: function() { + (t10 = ji("div")).textContent = "[", n10 = $i(), r10 = ji("button"), o10 = Ci(f10), i10 = $i(), a10 = Ci(d10), s10 = $i(), (c10 = ji("div")).textContent = "]", Ai(t10, "class", "jse-bracket svelte-1koa14y"), Ai(r10, "type", "button"), Ai(r10, "class", "jse-tag svelte-1koa14y"), Ai(c10, "class", "jse-bracket svelte-1koa14y"); + }, m: function(f11, d11) { + ki(f11, t10, d11), ki(f11, n10, d11), ki(f11, r10, d11), pi(r10, o10), pi(r10, i10), pi(r10, a10), ki(f11, s10, d11), ki(f11, c10, d11), l10 || (u10 = Oi(r10, "click", e20[21]), l10 = true); + }, p: function(e21, t11) { + 1 & t11[0] && f10 !== (f10 = e21[0].length + "") && Ni(o10, f10), 1 & t11[0] && d10 !== (d10 = 1 === e21[0].length ? "item" : "items") && Ni(a10, d10); + }, d: function(e21) { + e21 && (wi(t10), wi(n10), wi(r10), wi(s10), wi(c10)), l10 = false, u10(); + } }; + } + function rz(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10 = e20[0].length + "", l10 = 1 === e20[0].length ? "item" : "items"; + return { c: function() { + (t10 = ji("div")).textContent = "[", n10 = $i(), r10 = ji("span"), o10 = Ci(c10), i10 = $i(), a10 = Ci(l10), s10 = Ci("\n \xA0"), Ai(t10, "class", "jse-bracket svelte-1koa14y"), Ai(r10, "class", "jse-tag jse-expanded svelte-1koa14y"); + }, m: function(e21, c11) { + ki(e21, t10, c11), ki(e21, n10, c11), ki(e21, r10, c11), pi(r10, o10), pi(r10, i10), pi(r10, a10), ki(e21, s10, c11); + }, p: function(e21, t11) { + 1 & t11[0] && c10 !== (c10 = e21[0].length + "") && Ni(o10, c10), 1 & t11[0] && l10 !== (l10 = 1 === e21[0].length ? "item" : "items") && Ni(a10, l10); + }, d: function(e21) { + e21 && (wi(t10), wi(n10), wi(r10), wi(s10)); + } }; + } + function oz(e20) { + var t10, n10, r10; + return n10 = new XD({ props: { selected: true, onContextMenu: e20[8].onContextMenu } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-context-menu-pointer-anchor svelte-1koa14y"); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 256 & t11[0] && (r11.onContextMenu = e21[8].onContextMenu), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function iz(e20) { + var t10, n10; + return t10 = new wq({ props: { validationError: e20[15], onExpand: e20[21] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 32768 & n11[0] && (r10.validationError = e21[15]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function az(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-after svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-after"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[29]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function sz(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-inside svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-inside"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[28]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function cz(e20) { + for (var t10, n10, r10, o10, i10, a10, s10, c10 = !e20[8].readOnly && (e20[10] === js || e20[16] && hE(e20[7])), l10 = [], u10 = /* @__PURE__ */ new Map(), f10 = c10 && lz(e20), d10 = Ca(e20[14] || ds), h10 = function(e21) { + return e21[48]; + }, v10 = 0; v10 < d10.length; v10 += 1) { + var p10 = Oq(e20, d10, v10), m10 = h10(p10); + u10.set(m10, l10[v10] = hz(m10, p10)); + } + var g10 = !e20[17] && vz(e20); + return { c: function() { + t10 = ji("div"), f10 && f10.c(), n10 = $i(); + for (var e21 = 0; e21 < l10.length; e21 += 1) + l10[e21].c(); + r10 = $i(), o10 = ji("div"), (i10 = ji("div")).innerHTML = ']', a10 = $i(), g10 && g10.c(), Ai(t10, "class", "jse-items svelte-1koa14y"), Ai(i10, "data-type", "selectable-value"), Ai(i10, "class", "jse-footer svelte-1koa14y"), Ai(o10, "class", "jse-footer-outer svelte-1koa14y"); + }, m: function(e21, c11) { + ki(e21, t10, c11), f10 && f10.m(t10, null), pi(t10, n10); + for (var u11 = 0; u11 < l10.length; u11 += 1) + l10[u11] && l10[u11].m(t10, null); + ki(e21, r10, c11), ki(e21, o10, c11), pi(o10, i10), pi(o10, a10), g10 && g10.m(o10, null), s10 = true; + }, p: function(e21, r11) { + 66944 & r11[0] && (c10 = !e21[8].readOnly && (e21[10] === js || e21[16] && hE(e21[7]))), c10 ? f10 ? (f10.p(e21, r11), 66944 & r11[0] && wa(f10, 1)) : ((f10 = lz(e21)).c(), wa(f10, 1), f10.m(t10, n10)) : f10 && (ba(), xa(f10, 1, 1, function() { + f10 = null; + }), ka()), 34097663 & r11[0] && (d10 = Ca(e21[14] || ds), ba(), l10 = Oa(l10, r11, h10, 1, e21, d10, u10, t10, _a, hz, null, Oq), ka()), e21[17] ? g10 && (g10.d(1), g10 = null) : g10 ? g10.p(e21, r11) : ((g10 = vz(e21)).c(), g10.m(o10, null)); + }, i: function(e21) { + if (!s10) { + wa(f10); + for (var t11 = 0; t11 < d10.length; t11 += 1) + wa(l10[t11]); + s10 = true; + } + }, o: function(e21) { + xa(f10); + for (var t11 = 0; t11 < l10.length; t11 += 1) + xa(l10[t11]); + s10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(r10), wi(o10)), f10 && f10.d(); + for (var n11 = 0; n11 < l10.length; n11 += 1) + l10[n11].d(); + g10 && g10.d(); + } }; + } + function lz(e20) { + var t10, n10, r10; + return n10 = new XD({ props: { selected: e20[16] && hE(e20[7]), onContextMenu: e20[30] } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-insert-area jse-inside svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-inside"), Ai(t10, "title", ws), zi(t10, "jse-hovered", e20[10] === js), zi(t10, "jse-selected", e20[16] && hE(e20[7])), Di(t10, "--level", e20[1].length + 1); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, o10) { + var i10 = {}; + 65664 & o10[0] && (i10.selected = e21[16] && hE(e21[7])), n10.$set(i10), (!r10 || 1024 & o10[0]) && zi(t10, "jse-hovered", e21[10] === js), (!r10 || 65664 & o10[0]) && zi(t10, "jse-selected", e21[16] && hE(e21[7])), 2 & o10[0] && Di(t10, "--level", e21[1].length + 1); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function uz(e20) { + var t10, n10, r10, o10 = e20[49].index + ""; + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = Ci(o10), Ai(n10, "class", "jse-index svelte-1koa14y"), Ai(t10, "slot", "identifier"), Ai(t10, "class", "jse-identifier svelte-1koa14y"); + }, m: function(e21, o11) { + ki(e21, t10, o11), pi(t10, n10), pi(n10, r10); + }, p: function(e21, t11) { + 18687 & t11[0] && o10 !== (o10 = e21[49].index + "") && Ni(r10, o10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function fz(e20, t10) { + var n10, r10, o10; + return r10 = new yz({ props: { value: t10[49].value, path: t10[49].path, expandedMap: t10[49].expandedMap, enforceStringMap: t10[49].enforceStringMap, visibleSectionsMap: t10[49].visibleSectionsMap, validationErrorsMap: t10[49].validationErrorsMap, searchResultItemsMap: t10[49].searchResultItemsMap, selection: t10[49].selection, context: t10[8], onDragSelectionStart: t10[25], $$slots: { identifier: [uz] }, $$scope: { ctx: t10 } } }), { key: e20, first: null, c: function() { + n10 = _i(), Pa(r10.$$.fragment), this.first = n10; + }, m: function(e21, t11) { + ki(e21, n10, t11), Ta(r10, e21, t11), o10 = true; + }, p: function(e21, n11) { + t10 = e21; + var o11 = {}; + 18687 & n11[0] && (o11.value = t10[49].value), 18687 & n11[0] && (o11.path = t10[49].path), 18687 & n11[0] && (o11.expandedMap = t10[49].expandedMap), 18687 & n11[0] && (o11.enforceStringMap = t10[49].enforceStringMap), 18687 & n11[0] && (o11.visibleSectionsMap = t10[49].visibleSectionsMap), 18687 & n11[0] && (o11.validationErrorsMap = t10[49].validationErrorsMap), 18687 & n11[0] && (o11.searchResultItemsMap = t10[49].searchResultItemsMap), 18687 & n11[0] && (o11.selection = t10[49].selection), 256 & n11[0] && (o11.context = t10[8]), 18687 & n11[0] | 8 & n11[1] && (o11.$$scope = { dirty: n11, ctx: t10 }), r10.$set(o11); + }, i: function(e21) { + o10 || (wa(r10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(r10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(n10), Ra(r10, e21); + } }; + } + function dz(e20) { + var t10, n10; + return t10 = new KD({ props: { visibleSections: e20[14] || ds, sectionIndex: e20[48], total: e20[0].length, path: e20[1], onExpandSection: e20[8].onExpandSection, selection: e20[7], context: e20[8] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 16384 & n11[0] && (r10.visibleSections = e21[14] || ds), 16384 & n11[0] && (r10.sectionIndex = e21[48]), 1 & n11[0] && (r10.total = e21[0].length), 2 & n11[0] && (r10.path = e21[1]), 256 & n11[0] && (r10.onExpandSection = e21[8].onExpandSection), 128 & n11[0] && (r10.selection = e21[7]), 256 & n11[0] && (r10.context = e21[8]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function hz(e20, t10) { + for (var n10, r10, o10, i10, a10 = [], s10 = /* @__PURE__ */ new Map(), c10 = Ca(t10[19](t10[1], t10[0], t10[46], t10[2], t10[3], t10[4], t10[5], t10[6], t10[7], t10[11])), l10 = function(e21) { + return e21[49].index; + }, u10 = 0; u10 < c10.length; u10 += 1) { + var f10 = Mq(t10, c10, u10), d10 = l10(f10); + s10.set(d10, a10[u10] = fz(d10, f10)); + } + var h10 = t10[46].end < t10[0].length && dz(t10); + return { key: e20, first: null, c: function() { + n10 = _i(); + for (var e21 = 0; e21 < a10.length; e21 += 1) + a10[e21].c(); + r10 = $i(), h10 && h10.c(), o10 = _i(), this.first = n10; + }, m: function(e21, t11) { + ki(e21, n10, t11); + for (var s11 = 0; s11 < a10.length; s11 += 1) + a10[s11] && a10[s11].m(e21, t11); + ki(e21, r10, t11), h10 && h10.m(e21, t11), ki(e21, o10, t11), i10 = true; + }, p: function(e21, n11) { + t10 = e21, 34097663 & n11[0] && (c10 = Ca(t10[19](t10[1], t10[0], t10[46], t10[2], t10[3], t10[4], t10[5], t10[6], t10[7], t10[11])), ba(), a10 = Oa(a10, n11, l10, 1, t10, c10, s10, r10.parentNode, _a, fz, r10, Mq), ka()), t10[46].end < t10[0].length ? h10 ? (h10.p(t10, n11), 16385 & n11[0] && wa(h10, 1)) : ((h10 = dz(t10)).c(), wa(h10, 1), h10.m(o10.parentNode, o10)) : h10 && (ba(), xa(h10, 1, 1, function() { + h10 = null; + }), ka()); + }, i: function(e21) { + if (!i10) { + for (var t11 = 0; t11 < c10.length; t11 += 1) + wa(a10[t11]); + wa(h10), i10 = true; + } + }, o: function(e21) { + for (var t11 = 0; t11 < a10.length; t11 += 1) + xa(a10[t11]); + xa(h10), i10 = false; + }, d: function(e21) { + e21 && (wi(n10), wi(r10), wi(o10)); + for (var t11 = 0; t11 < a10.length; t11 += 1) + a10[t11].d(e21); + h10 && h10.d(e21); + } }; + } + function vz(e20) { + var t10, n10, r10; + return { c: function() { + Ai(t10 = ji("div"), "role", "none"), Ai(t10, "class", "jse-insert-selection-area jse-after svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-after"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = Oi(t10, "click", e20[29]), n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, r10(); + } }; + } + function pz(e20) { + var t10, n10, r10; + return n10 = new XD({ props: { selected: e20[16] && dE(e20[7]), onContextMenu: e20[31] } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-insert-area jse-after svelte-1koa14y"), Ai(t10, "data-type", "insert-selection-area-after"), Ai(t10, "title", ws), zi(t10, "jse-hovered", e20[10] === Ss), zi(t10, "jse-selected", e20[16] && dE(e20[7])); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, o10) { + var i10 = {}; + 65664 & o10[0] && (i10.selected = e21[16] && dE(e21[7])), n10.$set(i10), (!r10 || 1024 & o10[0]) && zi(t10, "jse-hovered", e21[10] === Ss), (!r10 || 65664 & o10[0]) && zi(t10, "jse-selected", e21[16] && dE(e21[7])); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function mz(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10 = !e20[8].readOnly && (e20[10] === Ss || e20[16] && dE(e20[7])), h10 = [Rq, Tq, Pq], v10 = []; + function p10(e21, t11) { + return 1 & t11[0] && (n10 = null), 1 & t11[0] && (r10 = null), null == n10 && (n10 = !!Array.isArray(e21[0])), n10 ? 0 : (null == r10 && (r10 = !!Gl(e21[0])), r10 ? 1 : 2); + } + o10 = p10(e20, [-1, -1]), i10 = v10[o10] = h10[o10](e20); + var m10 = d10 && pz(e20); + return { c: function() { + t10 = ji("div"), i10.c(), a10 = $i(), m10 && m10.c(), Ai(t10, "role", "treeitem"), Ai(t10, "tabindex", "-1"), Ai(t10, "class", s10 = si(GE("jse-json-node", { "jse-expanded": e20[12] }, e20[8].onClassName(e20[1], e20[0]))) + " svelte-1koa14y"), Ai(t10, "data-path", c10 = OO(e20[1])), Ai(t10, "aria-selected", e20[16]), zi(t10, "jse-root", e20[17]), zi(t10, "jse-selected", e20[16] && mE(e20[7])), zi(t10, "jse-selected-key", e20[16] && vE(e20[7])), zi(t10, "jse-selected-value", e20[16] && pE(e20[7])), zi(t10, "jse-readonly", e20[8].readOnly), zi(t10, "jse-hovered", e20[10] === Cs), Di(t10, "--level", e20[1].length); + }, m: function(n11, r11) { + ki(n11, t10, r11), v10[o10].m(t10, null), pi(t10, a10), m10 && m10.m(t10, null), l10 = true, u10 || (f10 = [Oi(t10, "mousedown", e20[23]), Oi(t10, "mousemove", e20[24]), Oi(t10, "mouseover", e20[26]), Oi(t10, "mouseout", e20[27]), Oi(t10, "focus", void 0), Oi(t10, "blur", void 0)], u10 = true); + }, p: function(e21, n11) { + var r11 = o10; + (o10 = p10(e21, n11)) === r11 ? v10[o10].p(e21, n11) : (ba(), xa(v10[r11], 1, 1, function() { + v10[r11] = null; + }), ka(), (i10 = v10[o10]) ? i10.p(e21, n11) : (i10 = v10[o10] = h10[o10](e21)).c(), wa(i10, 1), i10.m(t10, a10)), 66944 & n11[0] && (d10 = !e21[8].readOnly && (e21[10] === Ss || e21[16] && dE(e21[7]))), d10 ? m10 ? (m10.p(e21, n11), 66944 & n11[0] && wa(m10, 1)) : ((m10 = pz(e21)).c(), wa(m10, 1), m10.m(t10, null)) : m10 && (ba(), xa(m10, 1, 1, function() { + m10 = null; + }), ka()), (!l10 || 4355 & n11[0] && s10 !== (s10 = si(GE("jse-json-node", { "jse-expanded": e21[12] }, e21[8].onClassName(e21[1], e21[0]))) + " svelte-1koa14y")) && Ai(t10, "class", s10), (!l10 || 2 & n11[0] && c10 !== (c10 = OO(e21[1]))) && Ai(t10, "data-path", c10), (!l10 || 65536 & n11[0]) && Ai(t10, "aria-selected", e21[16]), (!l10 || 135427 & n11[0]) && zi(t10, "jse-root", e21[17]), (!l10 || 70019 & n11[0]) && zi(t10, "jse-selected", e21[16] && mE(e21[7])), (!l10 || 70019 & n11[0]) && zi(t10, "jse-selected-key", e21[16] && vE(e21[7])), (!l10 || 70019 & n11[0]) && zi(t10, "jse-selected-value", e21[16] && pE(e21[7])), (!l10 || 4355 & n11[0]) && zi(t10, "jse-readonly", e21[8].readOnly), (!l10 || 5379 & n11[0]) && zi(t10, "jse-hovered", e21[10] === Cs), 2 & n11[0] && Di(t10, "--level", e21[1].length); + }, i: function(e21) { + l10 || (wa(i10), wa(m10), l10 = true); + }, o: function(e21) { + xa(i10), xa(m10), l10 = false; + }, d: function(e21) { + e21 && wi(t10), v10[o10].d(), m10 && m10.d(), u10 = false, Qo(f10); + } }; + } + function gz(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10 = t10.$$slots, f10 = void 0 === u10 ? {} : u10, d10 = t10.$$scope, h10 = t10.value, v10 = t10.path, p10 = t10.expandedMap, m10 = t10.enforceStringMap, g10 = t10.visibleSectionsMap, y10 = t10.validationErrorsMap, b10 = t10.searchResultItemsMap, k10 = t10.selection, w10 = t10.context, x10 = t10.onDragSelectionStart, j10 = Da("jsoneditor:JSONNode"), S10 = void 0, C10 = void 0, $10 = void 0, _10 = rv(function(e21) { + return e21; + }, JO); + function O10(e21) { + w10.onDrag(e21); + } + function M10(e21) { + pq.selecting && (pq.selecting = false, e21.stopPropagation()), w10.onDragEnd(), document.removeEventListener("mousemove", O10, true), document.removeEventListener("mouseup", M10); + } + function E10() { + var e21; + return (null === (e21 = w10.findElement([])) || void 0 === e21 || null === (e21 = e21.getBoundingClientRect()) || void 0 === e21 ? void 0 : e21.top) || 0; + } + function A10(e21, t11) { + var n11 = E10() - e21.initialContentTop; + return t11.clientY - e21.initialClientY - n11; + } + function P10(e21) { + if ($10) { + var t11 = w10.getJson(); + if (void 0 === t11) + return; + var r11 = w10.getDocumentState(), o11 = A10($10, e21), i11 = mq({ json: t11, documentState: r11, deltaY: o11, items: $10.items }).offset; + i11 !== $10.offset && (j10("drag selection", i11, o11), n10(11, $10 = Ro(Ro({}, $10), {}, { offset: i11, didMoveItems: true }))); + } + } + function T8(e21) { + if ($10) { + var t11 = w10.getJson(); + if (void 0 === t11) + return; + var r11 = mq({ json: t11, documentState: w10.getDocumentState(), deltaY: A10($10, e21), items: $10.items }), o11 = r11.operations, i11 = r11.updatedSelection; + if (o11) + w10.onPatch(o11, function(e23, t12) { + return { state: Ro(Ro({}, t12), {}, { selection: i11 || k10 }) }; + }); + else if (e21.target === $10.initialTarget && !$10.didMoveItems) { + var a11 = _O(e21.target), s11 = MO(e21.target); + s11 && w10.onSelect(VE(0, a11, s11)); + } + n10(11, $10 = void 0), pq.dragging = false, document.removeEventListener("mousemove", P10, true), document.removeEventListener("mouseup", T8); + } + } + return e20.$$set = function(e21) { + "value" in e21 && n10(0, h10 = e21.value), "path" in e21 && n10(1, v10 = e21.path), "expandedMap" in e21 && n10(2, p10 = e21.expandedMap), "enforceStringMap" in e21 && n10(3, m10 = e21.enforceStringMap), "visibleSectionsMap" in e21 && n10(4, g10 = e21.visibleSectionsMap), "validationErrorsMap" in e21 && n10(5, y10 = e21.validationErrorsMap), "searchResultItemsMap" in e21 && n10(6, b10 = e21.searchResultItemsMap), "selection" in e21 && n10(7, k10 = e21.selection), "context" in e21 && n10(8, w10 = e21.context), "onDragSelectionStart" in e21 && n10(32, x10 = e21.onDragSelectionStart), "$$scope" in e21 && n10(34, d10 = e21.$$scope); + }, e20.$$.update = function() { + 2 & e20.$$.dirty[0] && n10(9, o10 = Zs(v10)), 516 & e20.$$.dirty[0] && n10(12, i10 = !!p10 && true === p10[o10]), 777 & e20.$$.dirty[0] && n10(13, a10 = oE(h10, m10, o10, w10.parser)), 528 & e20.$$.dirty[0] && n10(14, s10 = g10 ? g10[o10] : void 0), 544 & e20.$$.dirty[0] && n10(15, c10 = y10 ? y10[o10] : void 0), 386 & e20.$$.dirty[0] && n10(16, l10 = WE(w10.getJson(), k10, v10)), 2 & e20.$$.dirty[0] && n10(17, r10 = 0 === v10.length); + }, [h10, v10, p10, m10, g10, y10, b10, k10, w10, o10, S10, $10, i10, a10, s10, c10, l10, r10, function(e21, t11, n11, r11, i11, a11, s11, c11, l11) { + var u11 = Object.keys(t11).map(function(l12) { + var u12 = _10(e21.concat(l12)), f11 = tc(o10, l12); + return { key: l12, value: t11[l12], path: u12, expandedMap: gq(n11, f11), enforceStringMap: gq(r11, f11), visibleSectionsMap: gq(i11, f11), validationErrorsMap: gq(a11, f11), keySearchResultItemsMap: SA(s11, f11), valueSearchResultItemsMap: gq(s11, f11), selection: HE(w10.getJson(), c11, u12) }; + }); + return l11 && 0 !== l11.offset && (u11 = q_(u11, l11.selectionStartIndex, l11.selectionItemsCount, l11.offset)), u11; + }, function(e21, t11, n11, r11, i11, a11, s11, c11, l11, u11) { + for (var f11 = n11.start, d11 = Math.min(n11.end, t11.length), h11 = [], v11 = f11; v11 < d11; v11++) { + var p11 = _10(e21.concat(String(v11))), m11 = tc(o10, v11); + h11.push({ index: v11, value: t11[v11], path: p11, expandedMap: gq(r11, m11), enforceStringMap: gq(i11, m11), visibleSectionsMap: gq(a11, m11), validationErrorsMap: gq(s11, m11), searchResultItemsMap: gq(c11, m11), selection: HE(w10.getJson(), l11, p11) }); + } + if (u11 && 0 !== u11.offset) { + var g11 = h11.map(function(e23) { + return e23.index; + }); + h11 = q_(h11, u11.selectionStartIndex, u11.selectionItemsCount, u11.offset); + for (var y11 = 0; y11 < h11.length; y11++) + h11[y11].index = g11[y11]; + } + return h11; + }, function(e21) { + e21.stopPropagation(); + var t11 = e21.ctrlKey; + w10.onExpand(v10, !i10, t11); + }, function(e21) { + e21.stopPropagation(), w10.onExpand(v10, true); + }, function(e21, t11) { + var n11 = aA(v10, Object.keys(h10), e21, t11); + return w10.onPatch(n11), vb(Xs(n11[0].path)); + }, function(e21) { + if (!(function(e23) { + return "DIV" === e23.nodeName && "true" === e23.contentEditable; + }(e21.target) || 1 === e21.which && yO(e21.target, "BUTTON"))) { + e21.stopPropagation(), e21.preventDefault(), w10.focus(), document.addEventListener("mousemove", O10, true), document.addEventListener("mouseup", M10); + var t11 = _O(e21.target), n11 = w10.getJson(), o11 = w10.getDocumentState(); + if (!k10 || t11 === Ya.after || t11 === Ya.inside || k10.type !== t11 && k10.type !== Ya.multi || !WE(n11, k10, v10)) + if (pq.selecting = true, pq.selectionAnchor = v10, pq.selectionAnchorType = t11, pq.selectionFocus = v10, e21.shiftKey) { + var i11 = w10.getDocumentState().selection; + i11 && w10.onSelect(DE(KE(i11), v10)); + } else if (t11 === Ya.multi) + if (r10 && e21.target.hasAttribute("data-path")) { + var a11 = vb(sE(h10, o11)); + w10.onSelect(FE(a11)); + } else + w10.onSelect(DE(v10, v10)); + else + void 0 !== n11 && w10.onSelect(VE(0, t11, v10)); + else + 0 === e21.button && x10(e21); + } + }, function(e21) { + if (pq.selecting) { + e21.preventDefault(), e21.stopPropagation(), null == pq.selectionFocus && window.getSelection && window.getSelection().empty(); + var t11 = _O(e21.target); + Ow(v10, pq.selectionFocus) && t11 === pq.selectionAnchorType || (pq.selectionFocus = v10, pq.selectionAnchorType = t11, w10.onSelect(DE(pq.selectionAnchor || pq.selectionFocus, pq.selectionFocus))); + } + }, function(e21) { + if (!w10.readOnly && k10) { + var t11 = Qk(JE(k10)); + if (Ow(v10, t11)) { + var r11 = function(e23, t12) { + var n11 = []; + function r12(e24) { + var t13 = v10.concat(e24), r13 = w10.findElement(t13); + null != r13 && n11.push({ path: t13, height: r13.clientHeight }); + } + if (Array.isArray(h10)) { + var o12 = w10.getJson(); + if (void 0 === o12) + return null; + var i12 = xE(o12, e23), a12 = jE(o12, e23), s11 = parseInt(vb(i12), 10), c12 = parseInt(vb(a12), 10), l11 = t12.find(function(e24) { + return s11 >= e24.start && c12 <= e24.end; + }); + if (!l11) + return null; + var u11 = l11.start, f11 = l11.end; + R_(u11, Math.min(h10.length, f11), function(e24) { + return r12(String(e24)); + }); + } else + Object.keys(h10).forEach(r12); + return n11; + }(k10, s10 || ds); + if (j10("dragSelectionStart", { selection: k10, items: r11 }), r11) { + var o11 = w10.getJson(); + if (void 0 !== o11) { + var i11 = xE(o11, k10), a11 = r11.findIndex(function(e23) { + return Ow(e23.path, i11); + }), c11 = mq({ json: o11, documentState: w10.getDocumentState(), deltaY: 0, items: r11 }).offset; + n10(11, $10 = { initialTarget: e21.target, initialClientY: e21.clientY, initialContentTop: E10(), selectionStartIndex: a11, selectionItemsCount: kE(o11, k10).length, items: r11, offset: c11, didMoveItems: false }), pq.dragging = true, document.addEventListener("mousemove", P10, true), document.addEventListener("mouseup", T8); + } + } else + j10("Cannot drag the current selection (probably spread over multiple sections)"); + } else + x10(e21); + } + }, function(e21) { + pq.selecting || pq.dragging || (e21.stopPropagation(), bO(e21.target, "data-type", "selectable-value") ? n10(10, S10 = Cs) : bO(e21.target, "data-type", "insert-selection-area-inside") ? n10(10, S10 = js) : bO(e21.target, "data-type", "insert-selection-area-after") && n10(10, S10 = Ss), clearTimeout(C10)); + }, function(e21) { + e21.stopPropagation(), C10 = window.setTimeout(function() { + return n10(10, S10 = void 0); + }); + }, function(e21) { + e21.shiftKey || (e21.stopPropagation(), e21.preventDefault(), w10.onSelect(NE(v10))); + }, function(e21) { + e21.shiftKey || (e21.stopPropagation(), e21.preventDefault(), w10.onSelect(IE(v10))); + }, function(e21) { + w10.onSelect(NE(v10)), w10.onContextMenu(e21); + }, function(e21) { + w10.onSelect(IE(v10)), w10.onContextMenu(e21); + }, x10, f10, d10]; + } + var yz = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, gz, mz, Zo, { value: 0, path: 1, expandedMap: 2, enforceStringMap: 3, visibleSectionsMap: 4, validationErrorsMap: 5, searchResultItemsMap: 6, selection: 7, context: 8, onDragSelectionStart: 32 }, xq, [-1, -1]), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var bz = yz; + var kz = { prefix: "fas", iconName: "jsoneditor-expand", icon: [512, 512, [], "", "M 0,448 V 512 h 512 v -64 z M 0,0 V 64 H 512 V 0 Z M 256,96 128,224 h 256 z M 256,416 384,288 H 128 Z"] }; + var wz = { prefix: "fas", iconName: "jsoneditor-collapse", icon: [512, 512, [], "", "m 0,224 v 64 h 512 v -64 z M 256,192 384,64 H 128 Z M 256,320 128,448 h 256 z"] }; + var xz = { prefix: "fas", iconName: "jsoneditor-format", icon: [512, 512, [], "", "M 0,32 v 64 h 416 v -64 z M 160,160 v 64 h 352 v -64 z M 160,288 v 64 h 288 v -64 z M 0,416 v 64 h 320 v -64 z"] }; + var jz = { prefix: "fas", iconName: "jsoneditor-compact", icon: [512, 512, [], "", "M 0,32 v 64 h 512 v -64 z M 0,160 v 64 h 512 v -64 z M 0,288 v 64 h 352 v -64 z"] }; + function Sz(e20) { + var t10, n10; + return t10 = new EI({ props: { items: e20[0] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & jo(n11, 1)[0] && (r10.items = e21[0]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Cz(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10 = t10.json, f10 = t10.selection, d10 = t10.readOnly, h10 = t10.showSearch, v10 = void 0 !== h10 && h10, p10 = t10.historyState, m10 = t10.onExpandAll, g10 = t10.onCollapseAll, y10 = t10.onUndo, b10 = t10.onRedo, k10 = t10.onSort, w10 = t10.onTransform, x10 = t10.onContextMenu, j10 = t10.onCopy, S10 = t10.onRenderMenu; + function C10() { + n10(1, v10 = !v10); + } + return e20.$$set = function(e21) { + "json" in e21 && n10(2, u10 = e21.json), "selection" in e21 && n10(3, f10 = e21.selection), "readOnly" in e21 && n10(4, d10 = e21.readOnly), "showSearch" in e21 && n10(1, v10 = e21.showSearch), "historyState" in e21 && n10(5, p10 = e21.historyState), "onExpandAll" in e21 && n10(6, m10 = e21.onExpandAll), "onCollapseAll" in e21 && n10(7, g10 = e21.onCollapseAll), "onUndo" in e21 && n10(8, y10 = e21.onUndo), "onRedo" in e21 && n10(9, b10 = e21.onRedo), "onSort" in e21 && n10(10, k10 = e21.onSort), "onTransform" in e21 && n10(11, w10 = e21.onTransform), "onContextMenu" in e21 && n10(12, x10 = e21.onContextMenu), "onCopy" in e21 && n10(13, j10 = e21.onCopy), "onRenderMenu" in e21 && n10(14, S10 = e21.onRenderMenu); + }, e20.$$.update = function() { + 4 & e20.$$.dirty && n10(20, r10 = void 0 !== u10), 1048584 & e20.$$.dirty && n10(19, o10 = r10 && (mE(f10) || vE(f10) || pE(f10))), 68 & e20.$$.dirty && n10(15, a10 = { type: "button", icon: kz, title: "Expand all", className: "jse-expand-all", onClick: m10, disabled: !Ql(u10) }), 132 & e20.$$.dirty && n10(16, s10 = { type: "button", icon: wz, title: "Collapse all", className: "jse-collapse-all", onClick: g10, disabled: !Ql(u10) }), 4 & e20.$$.dirty && n10(17, c10 = { type: "button", icon: jP, title: "Search (Ctrl+F)", className: "jse-search", onClick: C10, disabled: void 0 === u10 }), 769844 & e20.$$.dirty && n10(18, l10 = d10 ? [a10, s10, { type: "separator" }, { type: "button", icon: CP, title: "Copy (Ctrl+C)", className: "jse-copy", onClick: j10, disabled: !o10 }, { type: "separator" }, c10, { type: "space" }] : [a10, s10, { type: "separator" }, { type: "button", icon: kP, title: "Sort", className: "jse-sort", onClick: k10, disabled: d10 || void 0 === u10 }, { type: "button", icon: cP, title: "Transform contents (filter, sort, project)", className: "jse-transform", onClick: w10, disabled: d10 || void 0 === u10 }, c10, { type: "button", icon: yP, title: xs, className: "jse-contextmenu", onClick: x10 }, { type: "separator" }, { type: "button", icon: vP, title: "Undo (Ctrl+Z)", className: "jse-undo", onClick: y10, disabled: !p10.canUndo }, { type: "button", icon: hP, title: "Redo (Ctrl+Shift+Z)", className: "jse-redo", onClick: b10, disabled: !p10.canRedo }, { type: "space" }]), 278528 & e20.$$.dirty && n10(0, i10 = S10(l10)); + }, [i10, v10, u10, f10, d10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, a10, s10, c10, l10, o10, r10]; + } + var $z = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, Cz, Sz, Zo, { json: 2, selection: 3, readOnly: 4, showSearch: 1, historyState: 5, onExpandAll: 6, onCollapseAll: 7, onUndo: 8, onRedo: 9, onSort: 10, onTransform: 11, onContextMenu: 12, onCopy: 13, onRenderMenu: 14 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function _z(e20) { + mi(e20, "svelte-s2toti", '.jse-welcome.svelte-s2toti.svelte-s2toti{flex:1;overflow:auto;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);display:flex;flex-direction:column;align-items:center;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-welcome.svelte-s2toti.svelte-s2toti:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-welcome.svelte-s2toti .jse-space.jse-before.svelte-s2toti{flex:1}.jse-welcome.svelte-s2toti .jse-space.jse-after.svelte-s2toti{flex:2}.jse-welcome.svelte-s2toti .jse-contents.svelte-s2toti{display:flex;flex-direction:column;max-width:300px;margin:2em var(--jse-padding, 10px);gap:var(--jse-padding, 10px)}.jse-welcome.svelte-s2toti .jse-contents .jse-welcome-info.svelte-s2toti{color:var(--jse-panel-color-readonly, #b2b2b2)}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}'); + } + function Oz(e20) { + var t10, n10, r10, o10, i10, a10, s10; + return { c: function() { + (t10 = ji("div")).innerHTML = "You can paste clipboard data using Ctrl+V, or use the following options:", n10 = $i(), (r10 = ji("button")).textContent = "Create object", o10 = $i(), (i10 = ji("button")).textContent = "Create array", Ai(t10, "class", "jse-welcome-info svelte-s2toti"), Ai(r10, "title", "Create an empty JSON object (press '{')"), Ai(r10, "class", "svelte-s2toti"), Ai(i10, "title", "Create an empty JSON array (press '[')"), Ai(i10, "class", "svelte-s2toti"); + }, m: function(c10, l10) { + ki(c10, t10, l10), ki(c10, n10, l10), ki(c10, r10, l10), ki(c10, o10, l10), ki(c10, i10, l10), a10 || (s10 = [Oi(r10, "click", Ei(e20[4])), Oi(i10, "click", Ei(e20[5]))], a10 = true); + }, p: Wo, d: function(e21) { + e21 && (wi(t10), wi(n10), wi(r10), wi(o10), wi(i10)), a10 = false, Qo(s10); + } }; + } + function Mz(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = !e20[0] && Oz(e20); + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = $i(), o10 = ji("div"), (i10 = ji("div")).textContent = "Empty document", a10 = $i(), f10 && f10.c(), s10 = $i(), c10 = ji("div"), Ai(n10, "class", "jse-space jse-before svelte-s2toti"), Ai(i10, "class", "jse-welcome-title"), Ai(o10, "class", "jse-contents svelte-s2toti"), Ai(c10, "class", "jse-space jse-after svelte-s2toti"), Ai(t10, "class", "jse-welcome svelte-s2toti"), Ai(t10, "role", "none"); + }, m: function(d10, h10) { + ki(d10, t10, h10), pi(t10, n10), pi(t10, r10), pi(t10, o10), pi(o10, i10), pi(o10, a10), f10 && f10.m(o10, null), pi(t10, s10), pi(t10, c10), l10 || (u10 = Oi(t10, "click", e20[6]), l10 = true); + }, p: function(e21, t11) { + var n11 = jo(t11, 1)[0]; + e21[0] ? f10 && (f10.d(1), f10 = null) : f10 ? f10.p(e21, n11) : ((f10 = Oz(e21)).c(), f10.m(o10, null)); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), f10 && f10.d(), l10 = false, u10(); + } }; + } + function Ez(e20, t10, n10) { + var r10 = t10.readOnly, o10 = t10.onCreateArray, i10 = t10.onCreateObject, a10 = t10.onClick; + return e20.$$set = function(e21) { + "readOnly" in e21 && n10(0, r10 = e21.readOnly), "onCreateArray" in e21 && n10(1, o10 = e21.onCreateArray), "onCreateObject" in e21 && n10(2, i10 = e21.onCreateObject), "onClick" in e21 && n10(3, a10 = e21.onClick); + }, [r10, o10, i10, a10, function() { + return i10(); + }, function() { + return o10(); + }, function() { + return a10(); + }]; + } + var Az = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, Ez, Mz, Zo, { readOnly: 0, onCreateArray: 1, onCreateObject: 2, onClick: 3 }, _z), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var Pz = { exports: {} }; + var Tz = function(e20, t10) { + var n10, r10, o10 = 1, i10 = 0, a10 = 0, s10 = String.alphabet; + function c10(e21, t11, r11) { + if (r11) { + for (n10 = t11; (r11 = c10(e21, n10)) < 76 && r11 > 65; ) + ++n10; + return +e21.slice(t11 - 1, n10); + } + return (r11 = s10 && s10.indexOf(e21.charAt(t11))) > -1 ? r11 + 76 : (r11 = e21.charCodeAt(t11) || 0) < 45 || r11 > 127 ? r11 : r11 < 46 ? 65 : r11 < 48 ? r11 - 1 : r11 < 58 ? r11 + 18 : r11 < 65 ? r11 - 11 : r11 < 91 ? r11 + 11 : r11 < 97 ? r11 - 37 : r11 < 123 ? r11 + 5 : r11 - 63; + } + if ((e20 += "") != (t10 += "")) { + for (; o10; ) + if (r10 = c10(e20, i10++), o10 = c10(t10, a10++), r10 < 76 && o10 < 76 && r10 > 66 && o10 > 66 && (r10 = c10(e20, i10, i10), o10 = c10(t10, a10, i10 = n10), a10 = n10), r10 != o10) + return r10 < o10 ? -1 : 1; + } + return 0; + }; + try { + Pz.exports = Tz; + } catch (e20) { + String.naturalCompare = Tz; + } + var Rz = yc(Pz.exports); + function Nz(e20, t10) { + var n10 = "string" == typeof e20 ? e20.toLowerCase() : e20, r10 = "string" == typeof t10 ? t10.toLowerCase() : t10; + return Rz(n10, r10); + } + function Iz(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1; + if (Ts(Ws(e20, t10))) { + if (void 0 === n10) + throw new Error("Cannot sort: no property selected by which to sort the array"); + return function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], r11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1, o10 = /* @__PURE__ */ function(e23, t12) { + return function(n12, r12) { + var o11 = Ws(n12, e23), i11 = Ws(r12, e23); + return void 0 === o11 ? t12 : void 0 === i11 ? -t12 : "string" != typeof o11 && "string" != typeof i11 ? o11 > i11 ? t12 : o11 < i11 ? -t12 : 0 : t12 * Nz(o11, i11); + }; + }(n11, r11), i10 = Ws(e21, t11); + return [{ op: "replace", path: Zs(t11), value: i10.slice(0).sort(o10) }]; + }(e20, t10, n10, r10); + } + if (Gl(e20)) + return function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, r11 = Ws(e21, t11), o10 = Object.keys(r11), i10 = o10.slice(); + i10.sort(function(e23, t12) { + return n11 * Nz(e23, t12); + }); + for (var a10 = [], s10 = 0; s10 < i10.length; s10++) { + var c10 = i10[s10], l10 = Zs(t11.concat(c10)); + a10.push({ op: "move", from: l10, path: l10 }); + } + return a10; + }(e20, t10, r10); + throw new Error("Cannot sort: no array or object"); + } + function Dz(e20) { + mi(e20, "svelte-12glmu0", '.jse-navigation-bar-dropdown.svelte-12glmu0.svelte-12glmu0{position:absolute;top:100%;left:0;z-index:3;background:var(--jse-navigation-bar-background, var(--jse-background-color, #fff));color:var(--jse-navigation-bar-dropdown-color, #656565);box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24));display:flex;flex-direction:column;max-height:300px;overflow:auto;min-width:80px}.jse-navigation-bar-dropdown.svelte-12glmu0 button.jse-navigation-bar-dropdown-item.svelte-12glmu0{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);border:none;background:transparent;color:inherit;cursor:pointer;outline:none;text-align:left;white-space:nowrap;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding, 10px)) 36px}.jse-navigation-bar-dropdown.svelte-12glmu0 button.jse-navigation-bar-dropdown-item.svelte-12glmu0:focus,.jse-navigation-bar-dropdown.svelte-12glmu0 button.jse-navigation-bar-dropdown-item.svelte-12glmu0:hover{background:var(--jse-navigation-bar-background-highlight, #e5e5e5)}.jse-navigation-bar-dropdown.svelte-12glmu0 button.jse-navigation-bar-dropdown-item.jse-selected.svelte-12glmu0{background:var(--jse-navigation-bar-dropdown-color, #656565);color:var(--jse-navigation-bar-background, var(--jse-background-color, #fff))}'); + } + function qz(e20, t10, n10) { + var r10 = e20.slice(); + return r10[4] = t10[n10], r10; + } + function zz(e20, t10) { + var n10, r10, o10, i10, a10, s10 = tM(t10[4].toString(), Vz) + ""; + function c10() { + return t10[3](t10[4]); + } + return { key: e20, first: null, c: function() { + n10 = ji("button"), r10 = Ci(s10), Ai(n10, "type", "button"), Ai(n10, "class", "jse-navigation-bar-dropdown-item svelte-12glmu0"), Ai(n10, "title", o10 = t10[4].toString()), zi(n10, "jse-selected", t10[4] === t10[1]), this.first = n10; + }, m: function(e21, t11) { + ki(e21, n10, t11), pi(n10, r10), i10 || (a10 = Oi(n10, "click", Ei(c10)), i10 = true); + }, p: function(e21, i11) { + t10 = e21, 1 & i11 && s10 !== (s10 = tM(t10[4].toString(), Vz) + "") && Ni(r10, s10), 1 & i11 && o10 !== (o10 = t10[4].toString()) && Ai(n10, "title", o10), 3 & i11 && zi(n10, "jse-selected", t10[4] === t10[1]); + }, d: function(e21) { + e21 && wi(n10), i10 = false, a10(); + } }; + } + function Bz(e20) { + var t10, n10; + return { c: function() { + t10 = ji("button"), n10 = Ci("..."), Ai(t10, "type", "button"), Ai(t10, "class", "jse-navigation-bar-dropdown-item svelte-12glmu0"), Ai(t10, "title", "Limited to " + Fz + " items"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function Lz(e20) { + for (var t10, n10, r10 = [], o10 = /* @__PURE__ */ new Map(), i10 = Ca(N_(e20[0], Fz)), a10 = function(e21) { + return e21[4]; + }, s10 = 0; s10 < i10.length; s10 += 1) { + var c10 = qz(e20, i10, s10), l10 = a10(c10); + o10.set(l10, r10[s10] = zz(l10, c10)); + } + var u10 = e20[0].length > Fz && Bz(); + return { c: function() { + t10 = ji("div"); + for (var e21 = 0; e21 < r10.length; e21 += 1) + r10[e21].c(); + n10 = $i(), u10 && u10.c(), Ai(t10, "class", "jse-navigation-bar-dropdown svelte-12glmu0"); + }, m: function(e21, o11) { + ki(e21, t10, o11); + for (var i11 = 0; i11 < r10.length; i11 += 1) + r10[i11] && r10[i11].m(t10, null); + pi(t10, n10), u10 && u10.m(t10, null); + }, p: function(e21, s11) { + var c11 = jo(s11, 1)[0]; + 7 & c11 && (i10 = Ca(N_(e21[0], Fz)), r10 = Oa(r10, c11, a10, 1, e21, i10, o10, t10, $a, zz, n10, qz)), e21[0].length > Fz ? u10 ? u10.p(e21, c11) : ((u10 = Bz()).c(), u10.m(t10, null)) : u10 && (u10.d(1), u10 = null); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + for (var n11 = 0; n11 < r10.length; n11 += 1) + r10[n11].d(); + u10 && u10.d(); + } }; + } + var Fz = 100; + var Vz = 30; + function Hz(e20, t10, n10) { + var r10 = t10.items, o10 = t10.selectedItem, i10 = t10.onSelect; + return e20.$$set = function(e21) { + "items" in e21 && n10(0, r10 = e21.items), "selectedItem" in e21 && n10(1, o10 = e21.selectedItem), "onSelect" in e21 && n10(2, i10 = e21.onSelect); + }, [r10, o10, i10, function(e21) { + return i10(e21); + }]; + } + var Wz = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, Hz, Lz, Zo, { items: 0, selectedItem: 1, onSelect: 2 }, Dz), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function Uz(e20) { + mi(e20, "svelte-x08607", ".jse-navigation-bar-item.svelte-x08607.svelte-x08607{position:relative;display:flex}.jse-navigation-bar-item.svelte-x08607 button.jse-navigation-bar-button.svelte-x08607{font-family:inherit;font-size:inherit;padding:calc(0.5 * var(--jse-padding, 10px)) 2px;border:none;background:transparent;color:inherit;cursor:pointer;outline:none;min-width:2em;white-space:nowrap}.jse-navigation-bar-item.svelte-x08607 button.jse-navigation-bar-button.svelte-x08607:focus,.jse-navigation-bar-item.svelte-x08607 button.jse-navigation-bar-button.svelte-x08607:hover{background:var(--jse-panel-button-background-highlight, #e0e0e0);color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d))}.jse-navigation-bar-item.svelte-x08607 button.jse-navigation-bar-button.jse-navigation-bar-arrow.svelte-x08607{padding:2px var(--jse-padding, 10px) 0}.jse-navigation-bar-item.svelte-x08607 button.jse-navigation-bar-button.jse-navigation-bar-arrow.jse-open.svelte-x08607{background:var(--jse-navigation-bar-background, var(--jse-background-color, #fff));color:var(--jse-navigation-bar-dropdown-color, #656565)}.jse-navigation-bar-item.svelte-x08607.svelte-x08607:last-child{padding-right:var(--jse-padding, 10px)}"); + } + function Jz(e20) { + var t10, n10, r10, o10; + return { c: function() { + t10 = ji("button"), n10 = Ci(e20[2]), Ai(t10, "type", "button"), Ai(t10, "class", "jse-navigation-bar-button svelte-x08607"); + }, m: function(i10, a10) { + ki(i10, t10, a10), pi(t10, n10), r10 || (o10 = Oi(t10, "click", e20[9]), r10 = true); + }, p: function(e21, t11) { + 4 & t11 && Ni(n10, e21[2]); + }, d: function(e21) { + e21 && wi(t10), r10 = false, o10(); + } }; + } + function Kz(e20) { + var t10, n10, r10, o10, i10, a10, s10; + r10 = new jM({ props: { data: iP } }); + var c10 = void 0 !== e20[2] && Jz(e20); + return { c: function() { + t10 = ji("div"), n10 = ji("button"), Pa(r10.$$.fragment), o10 = $i(), c10 && c10.c(), Ai(n10, "type", "button"), Ai(n10, "class", "jse-navigation-bar-button jse-navigation-bar-arrow svelte-x08607"), zi(n10, "jse-open", e20[1]), Ai(t10, "class", "jse-navigation-bar-item svelte-x08607"); + }, m: function(l10, u10) { + ki(l10, t10, u10), pi(t10, n10), Ta(r10, n10, null), pi(t10, o10), c10 && c10.m(t10, null), e20[10](t10), i10 = true, a10 || (s10 = Oi(n10, "click", e20[4]), a10 = true); + }, p: function(e21, r11) { + var o11 = jo(r11, 1)[0]; + (!i10 || 2 & o11) && zi(n10, "jse-open", e21[1]), void 0 !== e21[2] ? c10 ? c10.p(e21, o11) : ((c10 = Jz(e21)).c(), c10.m(t10, null)) : c10 && (c10.d(1), c10 = null); + }, i: function(e21) { + i10 || (wa(r10.$$.fragment, e21), i10 = true); + }, o: function(e21) { + xa(r10.$$.fragment, e21), i10 = false; + }, d: function(n11) { + n11 && wi(t10), Ra(r10), c10 && c10.d(), e20[10](null), a10 = false, s10(); + } }; + } + function Gz(e20, t10, n10) { + var r10, o10, i10, a10, s10 = Zi("absolute-popup"), c10 = s10.openAbsolutePopup, l10 = s10.closeAbsolutePopup, u10 = t10.path, f10 = t10.index, d10 = t10.onSelect, h10 = t10.getItems, v10 = false; + function p10(e21) { + l10(a10), d10(r10.concat(e21)); + } + return e20.$$set = function(e21) { + "path" in e21 && n10(5, u10 = e21.path), "index" in e21 && n10(6, f10 = e21.index), "onSelect" in e21 && n10(7, d10 = e21.onSelect), "getItems" in e21 && n10(8, h10 = e21.getItems); + }, e20.$$.update = function() { + 96 & e20.$$.dirty && (r10 = u10.slice(0, f10)), 96 & e20.$$.dirty && n10(2, o10 = u10[f10]); + }, [i10, v10, o10, p10, function() { + if (i10) { + n10(1, v10 = true); + var e21 = { items: h10(r10), selectedItem: o10, onSelect: p10 }; + a10 = c10(Wz, e21, { anchor: i10, closeOnOuterClick: true, onClose: function() { + n10(1, v10 = false); + } }); + } + }, u10, f10, d10, h10, function() { + return p10(o10); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(0, i10 = e21); + }); + }]; + } + var Qz = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, Gz, Kz, Zo, { path: 5, index: 6, onSelect: 7, getItems: 8 }, Uz), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function Yz(e20) { + var t10, n10; + if (navigator.clipboard) + return navigator.clipboard.writeText(e20); + if (null !== (t10 = (n10 = document).queryCommandSupported) && void 0 !== t10 && t10.call(n10, "copy")) { + var r10 = document.createElement("textarea"); + r10.value = e20, r10.style.position = "fixed", r10.style.opacity = "0", document.body.appendChild(r10), r10.select(); + try { + document.execCommand("copy"); + } catch (e21) { + console.error(e21); + } finally { + document.body.removeChild(r10); + } + } else + console.error("Copy failed."); + } + function Xz(e20) { + mi(e20, "svelte-1844qyt", ".jse-navigation-bar-path-editor.svelte-1844qyt.svelte-1844qyt{flex:1;display:flex;border:var(--jse-edit-outline, 2px solid #656565);background:var(--jse-background-color, #fff)}.jse-navigation-bar-path-editor.svelte-1844qyt input.jse-navigation-bar-text.svelte-1844qyt{flex:1;font-family:inherit;font-size:inherit;padding:0 5px 1px;background:var(--jse-background-color, #fff);color:var(--jse-text-color, #4d4d4d);border:none;outline:none}.jse-navigation-bar-path-editor.svelte-1844qyt button.svelte-1844qyt{border:none;background:var(--jse-background-color, #fff);cursor:pointer;font-family:inherit;font-size:80%;color:inherit}.jse-navigation-bar-path-editor.svelte-1844qyt button.jse-navigation-bar-copy.copied.svelte-1844qyt{color:var(--message-success-background, #9ac45d)}.jse-navigation-bar-path-editor.svelte-1844qyt button.jse-navigation-bar-validation-error.svelte-1844qyt{color:var(--jse-error-color, #ee5341)}.jse-navigation-bar-path-editor.error.svelte-1844qyt.svelte-1844qyt{border-color:var(--jse-error-color, #ee5341)}.jse-navigation-bar-path-editor.error.svelte-1844qyt input.jse-navigation-bar-text.svelte-1844qyt{color:var(--jse-error-color, #ee5341)}.jse-navigation-bar-path-editor.svelte-1844qyt .jse-copied-text.svelte-1844qyt{background:var(--message-success-background, #9ac45d);color:var(--jse-message-success-color, #fff);position:relative;margin:2px;padding:0 5px;border-radius:3px}"); + } + function Zz(e20) { + var t10, n10, r10, o10, i10, a10; + return n10 = new jM({ props: { data: TP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-navigation-bar-validation-error svelte-1844qyt"); + }, m: function(s10, c10) { + ki(s10, t10, c10), Ta(n10, t10, null), o10 = true, i10 || (a10 = ci(r10 = HA.call(null, t10, Ro({ text: String(e20[3] || "") }, e20[4]))), i10 = true); + }, p: function(e21, t11) { + r10 && Yo(r10.update) && 8 & t11 && r10.update.call(null, Ro({ text: String(e21[3] || "") }, e21[4])); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), i10 = false, a10(); + } }; + } + function eB(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).textContent = "Copied!", Ai(t10, "class", "jse-copied-text svelte-1844qyt"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function tB(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10 = e20[3] && Zz(e20), d10 = e20[2] && eB(); + return s10 = new jM({ props: { data: CP } }), { c: function() { + t10 = ji("div"), n10 = ji("input"), r10 = $i(), f10 && f10.c(), o10 = $i(), d10 && d10.c(), i10 = $i(), a10 = ji("button"), Pa(s10.$$.fragment), Ai(n10, "type", "text"), Ai(n10, "class", "jse-navigation-bar-text svelte-1844qyt"), n10.value = e20[0], Ai(a10, "type", "button"), Ai(a10, "class", "jse-navigation-bar-copy svelte-1844qyt"), Ai(a10, "title", "Copy selected path to the clipboard"), zi(a10, "copied", e20[2]), Ai(t10, "class", "jse-navigation-bar-path-editor svelte-1844qyt"), zi(t10, "error", e20[3]); + }, m: function(h10, v10) { + ki(h10, t10, v10), pi(t10, n10), e20[15](n10), pi(t10, r10), f10 && f10.m(t10, null), pi(t10, o10), d10 && d10.m(t10, null), pi(t10, i10), pi(t10, a10), Ta(s10, a10, null), c10 = true, l10 || (u10 = [Oi(n10, "keydown", Ei(e20[6])), Oi(n10, "input", e20[5]), Oi(a10, "click", e20[7])], l10 = true); + }, p: function(e21, r11) { + var s11 = jo(r11, 1)[0]; + (!c10 || 1 & s11 && n10.value !== e21[0]) && (n10.value = e21[0]), e21[3] ? f10 ? (f10.p(e21, s11), 8 & s11 && wa(f10, 1)) : ((f10 = Zz(e21)).c(), wa(f10, 1), f10.m(t10, o10)) : f10 && (ba(), xa(f10, 1, 1, function() { + f10 = null; + }), ka()), e21[2] ? d10 || ((d10 = eB()).c(), d10.m(t10, i10)) : d10 && (d10.d(1), d10 = null), (!c10 || 4 & s11) && zi(a10, "copied", e21[2]), (!c10 || 8 & s11) && zi(t10, "error", e21[3]); + }, i: function(e21) { + c10 || (wa(f10), wa(s10.$$.fragment, e21), c10 = true); + }, o: function(e21) { + xa(f10), xa(s10.$$.fragment, e21), c10 = false; + }, d: function(n11) { + n11 && wi(t10), e20[15](null), f10 && f10.d(), d10 && d10.d(), Ra(s10), l10 = false, Qo(u10); + } }; + } + function nB(e20, t10, n10) { + var r10, o10, i10, a10 = Zi("absolute-popup"), s10 = t10.path, c10 = t10.pathParser, l10 = t10.onChange, u10 = t10.onClose, f10 = t10.onError, d10 = t10.pathExists, h10 = false, v10 = void 0, p10 = false; + function m10() { + o10.focus(); + } + function g10(e21) { + try { + var t11 = c10.parse(e21); + return function(e23) { + if (!d10(e23)) + throw new Error("Path does not exist in current document"); + }(t11), { path: t11, error: void 0 }; + } catch (e23) { + return { path: void 0, error: e23 }; + } + } + return Gi(function() { + m10(); + }), Qi(function() { + clearTimeout(v10); + }), e20.$$set = function(e21) { + "path" in e21 && n10(8, s10 = e21.path), "pathParser" in e21 && n10(9, c10 = e21.pathParser), "onChange" in e21 && n10(10, l10 = e21.onChange), "onClose" in e21 && n10(11, u10 = e21.onClose), "onError" in e21 && n10(12, f10 = e21.onError), "pathExists" in e21 && n10(13, d10 = e21.pathExists); + }, e20.$$.update = function() { + 768 & e20.$$.dirty && n10(0, i10 = c10.stringify(s10)), 16385 & e20.$$.dirty && n10(3, r10 = h10 ? g10(i10).error : void 0); + }, [i10, o10, p10, r10, a10, function(e21) { + n10(0, i10 = e21.currentTarget.value); + }, function(e21) { + var t11 = PO(e21); + if ("Escape" === t11 && u10(), "Enter" === t11) { + n10(14, h10 = true); + var r11 = g10(i10); + void 0 !== r11.path ? l10(r11.path) : f10(r11.error); + } + }, function() { + Yz(i10), n10(2, p10 = true), v10 = window.setTimeout(function() { + return n10(2, p10 = false); + }, 1e3), m10(); + }, s10, c10, l10, u10, f10, d10, h10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(1, o10 = e21); + }); + }]; + } + var rB = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, nB, tB, Xo, { path: 8, pathParser: 9, onChange: 10, onClose: 11, onError: 12, pathExists: 13 }, Xz), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function oB(e20) { + mi(e20, "svelte-1aycet9", '.jse-navigation-bar.svelte-1aycet9.svelte-1aycet9{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-button-color, inherit);padding:0;margin:0;display:flex;overflow:auto;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-navigation-bar.svelte-1aycet9 .jse-navigation-bar-edit.svelte-1aycet9{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px);color:var(--jse-panel-color-readonly, #b2b2b2);background:transparent;border:none;display:flex;cursor:pointer;outline:none;align-items:center}.jse-navigation-bar.svelte-1aycet9 .jse-navigation-bar-edit.flex.svelte-1aycet9{flex:1}.jse-navigation-bar.svelte-1aycet9 .jse-navigation-bar-edit.svelte-1aycet9:focus,.jse-navigation-bar.svelte-1aycet9 .jse-navigation-bar-edit.svelte-1aycet9:hover,.jse-navigation-bar.svelte-1aycet9 .jse-navigation-bar-edit.editing.svelte-1aycet9{background:var(--jse-panel-button-background-highlight, #e0e0e0);color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));transition:color 0.2s ease-in, background 0.2s ease-in}.jse-navigation-bar.svelte-1aycet9 .jse-navigation-bar-edit .jse-navigation-bar-space.svelte-1aycet9{flex:1;text-align:left}'); + } + function iB(e20, t10, n10) { + var r10 = e20.slice(); + return r10[18] = t10[n10], r10[20] = n10, r10; + } + function aB(e20) { + var t10, n10; + return t10 = new rB({ props: { path: e20[3], onClose: e20[11], onChange: e20[12], onError: e20[1], pathExists: e20[8], pathParser: e20[2] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 8 & n11 && (r10.path = e21[3]), 2 & n11 && (r10.onError = e21[1]), 4 & n11 && (r10.pathParser = e21[2]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function sB(e20) { + for (var t10, n10, r10, o10 = [], i10 = /* @__PURE__ */ new Map(), a10 = Ca(e20[3]), s10 = function(e21) { + return e21[20]; + }, c10 = 0; c10 < a10.length; c10 += 1) { + var l10 = iB(e20, a10, c10), u10 = s10(l10); + i10.set(u10, o10[c10] = cB(u10, l10)); + } + var f10 = e20[6] && lB(e20); + return { c: function() { + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + t10 = $i(), f10 && f10.c(), n10 = _i(); + }, m: function(e21, i11) { + for (var a11 = 0; a11 < o10.length; a11 += 1) + o10[a11] && o10[a11].m(e21, i11); + ki(e21, t10, i11), f10 && f10.m(e21, i11), ki(e21, n10, i11), r10 = true; + }, p: function(e21, r11) { + 648 & r11 && (a10 = Ca(e21[3]), ba(), o10 = Oa(o10, r11, s10, 1, e21, a10, i10, t10.parentNode, _a, cB, t10, iB), ka()), e21[6] ? f10 ? (f10.p(e21, r11), 64 & r11 && wa(f10, 1)) : ((f10 = lB(e21)).c(), wa(f10, 1), f10.m(n10.parentNode, n10)) : f10 && (ba(), xa(f10, 1, 1, function() { + f10 = null; + }), ka()); + }, i: function(e21) { + if (!r10) { + for (var t11 = 0; t11 < a10.length; t11 += 1) + wa(o10[t11]); + wa(f10), r10 = true; + } + }, o: function(e21) { + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + xa(f10), r10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(n10)); + for (var r11 = 0; r11 < o10.length; r11 += 1) + o10[r11].d(e21); + f10 && f10.d(e21); + } }; + } + function cB(e20, t10) { + var n10, r10, o10; + return r10 = new Qz({ props: { getItems: t10[7], path: t10[3], index: t10[20], onSelect: t10[9] } }), { key: e20, first: null, c: function() { + n10 = _i(), Pa(r10.$$.fragment), this.first = n10; + }, m: function(e21, t11) { + ki(e21, n10, t11), Ta(r10, e21, t11), o10 = true; + }, p: function(e21, n11) { + t10 = e21; + var o11 = {}; + 8 & n11 && (o11.path = t10[3]), 8 & n11 && (o11.index = t10[20]), r10.$set(o11); + }, i: function(e21) { + o10 || (wa(r10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(r10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(n10), Ra(r10, e21); + } }; + } + function lB(e20) { + var t10, n10; + return t10 = new Qz({ props: { getItems: e20[7], path: e20[3], index: e20[3].length, onSelect: e20[9] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 8 & n11 && (r10.path = e21[3]), 8 & n11 && (r10.index = e21[3].length), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function uB(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10 = Ql(e20[0]) || e20[5] ? "\xA0" : "Navigation bar", p10 = [sB, aB], m10 = []; + function g10(e21, t11) { + return e21[5] ? 1 : 0; + } + return n10 = g10(e20), r10 = m10[n10] = p10[n10](e20), l10 = new jM({ props: { data: e20[5] ? OP : rP } }), { c: function() { + t10 = ji("div"), r10.c(), o10 = $i(), i10 = ji("button"), a10 = ji("span"), s10 = Ci(v10), c10 = $i(), Pa(l10.$$.fragment), Ai(a10, "class", "jse-navigation-bar-space svelte-1aycet9"), Ai(i10, "type", "button"), Ai(i10, "class", "jse-navigation-bar-edit svelte-1aycet9"), Ai(i10, "title", u10 = e20[5] ? "Cancel editing the selected path" : "Edit the selected path"), zi(i10, "flex", !e20[5]), zi(i10, "editing", e20[5]), Ai(t10, "class", "jse-navigation-bar svelte-1aycet9"); + }, m: function(r11, u11) { + ki(r11, t10, u11), m10[n10].m(t10, null), pi(t10, o10), pi(t10, i10), pi(i10, a10), pi(a10, s10), pi(i10, c10), Ta(l10, i10, null), e20[15](t10), f10 = true, d10 || (h10 = Oi(i10, "click", e20[10]), d10 = true); + }, p: function(e21, a11) { + var c11 = jo(a11, 1)[0], d11 = n10; + (n10 = g10(e21)) === d11 ? m10[n10].p(e21, c11) : (ba(), xa(m10[d11], 1, 1, function() { + m10[d11] = null; + }), ka(), (r10 = m10[n10]) ? r10.p(e21, c11) : (r10 = m10[n10] = p10[n10](e21)).c(), wa(r10, 1), r10.m(t10, o10)), (!f10 || 33 & c11) && v10 !== (v10 = Ql(e21[0]) || e21[5] ? "\xA0" : "Navigation bar") && Ni(s10, v10); + var h11 = {}; + 32 & c11 && (h11.data = e21[5] ? OP : rP), l10.$set(h11), (!f10 || 32 & c11 && u10 !== (u10 = e21[5] ? "Cancel editing the selected path" : "Edit the selected path")) && Ai(i10, "title", u10), (!f10 || 32 & c11) && zi(i10, "flex", !e21[5]), (!f10 || 32 & c11) && zi(i10, "editing", e21[5]); + }, i: function(e21) { + f10 || (wa(r10), wa(l10.$$.fragment, e21), f10 = true); + }, o: function(e21) { + xa(r10), xa(l10.$$.fragment, e21), f10 = false; + }, d: function(r11) { + r11 && wi(t10), m10[n10].d(), Ra(l10), e20[15](null), d10 = false, h10(); + } }; + } + function fB(e20, t10, n10) { + var r10, o10, i10, a10 = Da("jsoneditor:NavigationBar"), s10 = t10.json, c10 = t10.selection, l10 = t10.onSelect, u10 = t10.onError, f10 = t10.pathParser, d10 = false; + function h10(e21) { + a10("select path", JSON.stringify(e21)), l10(DE(e21, e21)); + } + function v10() { + n10(5, d10 = false); + } + return e20.$$set = function(e21) { + "json" in e21 && n10(0, s10 = e21.json), "selection" in e21 && n10(13, c10 = e21.selection), "onSelect" in e21 && n10(14, l10 = e21.onSelect), "onError" in e21 && n10(1, u10 = e21.onError), "pathParser" in e21 && n10(2, f10 = e21.pathParser); + }, e20.$$.update = function() { + 8192 & e20.$$.dirty && n10(3, r10 = c10 ? JE(c10) : []), 9 & e20.$$.dirty && n10(6, o10 = Ql(Ws(s10, r10))), 8 & e20.$$.dirty && setTimeout(function() { + if (i10 && i10.scrollTo) { + var e21 = i10.scrollWidth - i10.clientWidth; + e21 > 0 && (a10("scrollTo ", e21), i10.scrollTo({ left: e21, behavior: "smooth" })); + } + }); + }, [s10, u10, f10, r10, i10, d10, o10, function(e21) { + a10("get items for path", e21); + var t11 = Ws(s10, e21); + if (Array.isArray(t11)) + return hS(0, t11.length).map(String); + if (Gl(t11)) { + var n11 = Object.keys(t11).slice(0); + return n11.sort(Nz), n11; + } + return []; + }, function(e21) { + return Ys(s10, e21); + }, h10, function() { + n10(5, d10 = !d10); + }, v10, function(e21) { + v10(), h10(e21); + }, c10, l10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(4, i10 = e21); + }); + }]; + } + var dB = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, fB, uB, Zo, { json: 0, selection: 13, onSelect: 14, onError: 1, pathParser: 2 }, oB), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function hB(e20) { + mi(e20, "svelte-1vkjt6l", '.jse-search-box.svelte-1vkjt6l.svelte-1vkjt6l{border:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7));border-radius:3px;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24));display:inline-block;width:400px;max-width:100%;overflow:auto}.jse-search-box.svelte-1vkjt6l .jse-search-form.svelte-1vkjt6l{display:flex;align-items:stretch}.jse-search-box.svelte-1vkjt6l .jse-search-form button.svelte-1vkjt6l,.jse-search-box.svelte-1vkjt6l .jse-search-form input.svelte-1vkjt6l{font-family:inherit;font-size:inherit}.jse-search-box.svelte-1vkjt6l .jse-search-form button.svelte-1vkjt6l{display:block;text-align:center;border:none;padding:0 5px;margin:0;cursor:pointer;color:var(--jse-panel-button-color, inherit);background:var(--jse-panel-button-background, transparent)}.jse-search-box.svelte-1vkjt6l .jse-search-form button.svelte-1vkjt6l:hover{color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-search-box.svelte-1vkjt6l .jse-search-form input.svelte-1vkjt6l{color:var(--jse-panel-color, var(--jse-text-color, #4d4d4d));border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:3px;background:var(--jse-input-background, var(--jse-background-color, #fff));height:28px;padding:0 5px;margin:0;flex:1;width:0;min-width:50px;outline:none}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-replace-toggle.svelte-1vkjt6l{padding:var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px));min-width:20px;background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents.svelte-1vkjt6l{flex:1;display:flex;flex-direction:column;padding:calc(0.5 * var(--jse-padding, 10px));gap:calc(0.5 * var(--jse-padding, 10px))}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-search-section.svelte-1vkjt6l{flex:1;display:flex;align-items:center;position:relative;padding-left:32px}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-search-section .jse-search-icon.svelte-1vkjt6l{color:inherit;cursor:inherit;background:inherit;position:absolute;top:calc(0.5 * var(--jse-padding, 10px));left:calc(0.5 * var(--jse-padding, 10px))}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-search-section label.jse-search-input-label.svelte-1vkjt6l{flex:1;display:flex}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.svelte-1vkjt6l{color:inherit;font-size:80%;visibility:hidden;padding:0 5px;min-width:36px;text-align:center}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.jse-visible.svelte-1vkjt6l{visibility:visible}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-replace-section.svelte-1vkjt6l{padding-left:32px;flex:1;display:flex}.jse-search-box.svelte-1vkjt6l .jse-search-form .jse-search-contents .jse-replace-section button.svelte-1vkjt6l{width:auto}'); + } + function vB(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10 = (-1 !== e20[3] ? "".concat(e20[3] + 1, "/") : "") + "", E10 = !e20[4] && pB(e20), A10 = [gB, mB], P10 = []; + function T8(e21, t11) { + return e21[2] ? 0 : 1; + } + s10 = T8(e20), c10 = P10[s10] = A10[s10](e20), y10 = new jM({ props: { data: SP } }), w10 = new jM({ props: { data: oP } }), S10 = new jM({ props: { data: MP } }); + var R8 = e20[0] && !e20[4] && yB(e20); + return { c: function() { + t10 = ji("div"), n10 = ji("form"), E10 && E10.c(), r10 = $i(), o10 = ji("div"), i10 = ji("div"), a10 = ji("div"), c10.c(), l10 = $i(), u10 = ji("label"), f10 = ji("input"), d10 = $i(), h10 = ji("div"), v10 = Ci(M10), p10 = Ci(e20[10]), m10 = $i(), g10 = ji("button"), Pa(y10.$$.fragment), b10 = $i(), k10 = ji("button"), Pa(w10.$$.fragment), x10 = $i(), j10 = ji("button"), Pa(S10.$$.fragment), C10 = $i(), R8 && R8.c(), Ai(a10, "class", "jse-search-icon svelte-1vkjt6l"), Ai(f10, "class", "jse-search-input svelte-1vkjt6l"), Ai(f10, "title", "Enter text to search"), Ai(f10, "type", "text"), Ai(f10, "placeholder", "Find"), Ai(u10, "class", "jse-search-input-label svelte-1vkjt6l"), Ai(u10, "about", "jse-search input"), Ai(h10, "class", "jse-search-count svelte-1vkjt6l"), zi(h10, "jse-visible", "" !== e20[8]), Ai(g10, "type", "button"), Ai(g10, "class", "jse-search-next svelte-1vkjt6l"), Ai(g10, "title", "Go to next search result (Enter)"), Ai(k10, "type", "button"), Ai(k10, "class", "jse-search-previous svelte-1vkjt6l"), Ai(k10, "title", "Go to previous search result (Shift+Enter)"), Ai(j10, "type", "button"), Ai(j10, "class", "jse-search-clear svelte-1vkjt6l"), Ai(j10, "title", "Close search box (Esc)"), Ai(i10, "class", "jse-search-section svelte-1vkjt6l"), Ai(o10, "class", "jse-search-contents svelte-1vkjt6l"), Ai(n10, "class", "jse-search-form svelte-1vkjt6l"), Ai(t10, "class", "jse-search-box svelte-1vkjt6l"); + }, m: function(c11, M11) { + ki(c11, t10, M11), pi(t10, n10), E10 && E10.m(n10, null), pi(n10, r10), pi(n10, o10), pi(o10, i10), pi(i10, a10), P10[s10].m(a10, null), pi(i10, l10), pi(i10, u10), pi(u10, f10), Ii(f10, e20[8]), pi(i10, d10), pi(i10, h10), pi(h10, v10), pi(h10, p10), pi(i10, m10), pi(i10, g10), Ta(y10, g10, null), pi(i10, b10), pi(i10, k10), Ta(w10, k10, null), pi(i10, x10), pi(i10, j10), Ta(S10, j10, null), pi(o10, C10), R8 && R8.m(o10, null), $10 = true, _10 || (O10 = [Oi(f10, "input", e20[21]), ci(kB.call(null, f10)), Oi(g10, "click", e20[22]), Oi(k10, "click", e20[23]), Oi(j10, "click", e20[24]), Oi(n10, "submit", e20[12]), Oi(n10, "keydown", e20[13])], _10 = true); + }, p: function(e21, t11) { + e21[4] ? E10 && (ba(), xa(E10, 1, 1, function() { + E10 = null; + }), ka()) : E10 ? (E10.p(e21, t11), 16 & t11 && wa(E10, 1)) : ((E10 = pB(e21)).c(), wa(E10, 1), E10.m(n10, r10)); + var i11 = s10; + (s10 = T8(e21)) !== i11 && (ba(), xa(P10[i11], 1, 1, function() { + P10[i11] = null; + }), ka(), (c10 = P10[s10]) || (c10 = P10[s10] = A10[s10](e21)).c(), wa(c10, 1), c10.m(a10, null)), 256 & t11 && f10.value !== e21[8] && Ii(f10, e21[8]), (!$10 || 8 & t11) && M10 !== (M10 = (-1 !== e21[3] ? "".concat(e21[3] + 1, "/") : "") + "") && Ni(v10, M10), (!$10 || 1024 & t11) && Ni(p10, e21[10]), (!$10 || 256 & t11) && zi(h10, "jse-visible", "" !== e21[8]), e21[0] && !e21[4] ? R8 ? R8.p(e21, t11) : ((R8 = yB(e21)).c(), R8.m(o10, null)) : R8 && (R8.d(1), R8 = null); + }, i: function(e21) { + $10 || (wa(E10), wa(c10), wa(y10.$$.fragment, e21), wa(w10.$$.fragment, e21), wa(S10.$$.fragment, e21), $10 = true); + }, o: function(e21) { + xa(E10), xa(c10), xa(y10.$$.fragment, e21), xa(w10.$$.fragment, e21), xa(S10.$$.fragment, e21), $10 = false; + }, d: function(e21) { + e21 && wi(t10), E10 && E10.d(), P10[s10].d(), Ra(y10), Ra(w10), Ra(S10), R8 && R8.d(), _10 = false, Qo(O10); + } }; + } + function pB(e20) { + var t10, n10, r10, o10, i10; + return n10 = new jM({ props: { data: e20[0] ? gP : YA } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-replace-toggle svelte-1vkjt6l"), Ai(t10, "title", "Toggle visibility of replace options (Ctrl+H)"); + }, m: function(a10, s10) { + ki(a10, t10, s10), Ta(n10, t10, null), r10 = true, o10 || (i10 = Oi(t10, "click", e20[11]), o10 = true); + }, p: function(e21, t11) { + var r11 = {}; + 1 & t11 && (r11.data = e21[0] ? gP : YA), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), o10 = false, i10(); + } }; + } + function mB(e20) { + var t10, n10; + return t10 = new jM({ props: { data: jP } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function gB(e20) { + var t10, n10; + return t10 = new jM({ props: { data: ZA, spin: true } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function yB(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10; + return { c: function() { + t10 = ji("div"), n10 = ji("input"), r10 = $i(), (o10 = ji("button")).textContent = "Replace", i10 = $i(), (a10 = ji("button")).textContent = "All", Ai(n10, "class", "jse-replace-input svelte-1vkjt6l"), Ai(n10, "title", "Enter replacement text"), Ai(n10, "type", "text"), Ai(n10, "placeholder", "Replace"), Ai(o10, "type", "button"), Ai(o10, "title", "Replace current occurrence (Ctrl+Enter)"), Ai(o10, "class", "svelte-1vkjt6l"), Ai(a10, "type", "button"), Ai(a10, "title", "Replace all occurrences"), Ai(a10, "class", "svelte-1vkjt6l"), Ai(t10, "class", "jse-replace-section svelte-1vkjt6l"); + }, m: function(l10, u10) { + ki(l10, t10, u10), pi(t10, n10), Ii(n10, e20[9]), pi(t10, r10), pi(t10, o10), pi(t10, i10), pi(t10, a10), s10 || (c10 = [Oi(n10, "input", e20[25]), Oi(o10, "click", e20[14]), Oi(a10, "click", e20[15])], s10 = true); + }, p: function(e21, t11) { + 512 & t11 && n10.value !== e21[9] && Ii(n10, e21[9]); + }, d: function(e21) { + e21 && wi(t10), s10 = false, Qo(c10); + } }; + } + function bB(e20) { + var t10, n10, r10 = e20[1] && vB(e20); + return { c: function() { + r10 && r10.c(), t10 = _i(); + }, m: function(e21, o10) { + r10 && r10.m(e21, o10), ki(e21, t10, o10), n10 = true; + }, p: function(e21, n11) { + var o10 = jo(n11, 1)[0]; + e21[1] ? r10 ? (r10.p(e21, o10), 2 & o10 && wa(r10, 1)) : ((r10 = vB(e21)).c(), wa(r10, 1), r10.m(t10.parentNode, t10)) : r10 && (ba(), xa(r10, 1, 1, function() { + r10 = null; + }), ka()); + }, i: function(e21) { + n10 || (wa(r10), n10 = true); + }, o: function(e21) { + xa(r10), n10 = false; + }, d: function(e21) { + e21 && wi(t10), r10 && r10.d(e21); + } }; + } + function kB(e20) { + e20.select(); + } + function wB(e20, t10, n10) { + var r10, o10, i10 = t10.show, a10 = void 0 !== i10 && i10, s10 = t10.searching, c10 = t10.resultCount, l10 = void 0 === c10 ? 0 : c10, u10 = t10.activeIndex, f10 = void 0 === u10 ? 0 : u10, d10 = t10.showReplace, h10 = void 0 !== d10 && d10, v10 = t10.readOnly, p10 = void 0 !== v10 && v10, m10 = t10.onChange, g10 = void 0 === m10 ? Mf : m10, y10 = t10.onPrevious, b10 = void 0 === y10 ? Mf : y10, k10 = t10.onNext, w10 = void 0 === k10 ? Mf : k10, x10 = t10.onReplace, j10 = void 0 === x10 ? Mf : x10, S10 = t10.onReplaceAll, C10 = void 0 === S10 ? Mf : S10, $10 = t10.onClose, _10 = void 0 === $10 ? Mf : $10, O10 = "", M10 = "", E10 = ""; + function A10() { + n10(0, h10 = !h10 && !p10); + } + function P10() { + p10 || j10(O10, E10); + } + return e20.$$set = function(e21) { + "show" in e21 && n10(1, a10 = e21.show), "searching" in e21 && n10(2, s10 = e21.searching), "resultCount" in e21 && n10(16, l10 = e21.resultCount), "activeIndex" in e21 && n10(3, f10 = e21.activeIndex), "showReplace" in e21 && n10(0, h10 = e21.showReplace), "readOnly" in e21 && n10(4, p10 = e21.readOnly), "onChange" in e21 && n10(17, g10 = e21.onChange), "onPrevious" in e21 && n10(5, b10 = e21.onPrevious), "onNext" in e21 && n10(6, w10 = e21.onNext), "onReplace" in e21 && n10(18, j10 = e21.onReplace), "onReplaceAll" in e21 && n10(19, C10 = e21.onReplaceAll), "onClose" in e21 && n10(7, _10 = e21.onClose); + }, e20.$$.update = function() { + 65536 & e20.$$.dirty && n10(10, r10 = l10 >= cs ? "".concat(999, "+") : String(l10)), 131072 & e20.$$.dirty && n10(20, o10 = Vy(g10, 300)), 1048832 & e20.$$.dirty && o10(O10), 2 & e20.$$.dirty && a10 && "" !== O10 && g10(O10); + }, [h10, a10, s10, f10, p10, b10, w10, _10, O10, E10, r10, A10, function(e21) { + e21.preventDefault(), O10 !== M10 ? (M10 = O10, o10.cancel(), g10(O10)) : w10(); + }, function(e21) { + e21.stopPropagation(); + var t11 = PO(e21); + "Enter" === t11 && (e21.preventDefault(), w10()), "Shift+Enter" === t11 && (e21.preventDefault(), b10()), "Ctrl+Enter" === t11 && (e21.preventDefault(), h10 ? P10() : w10()), "Ctrl+H" === t11 && (e21.preventDefault(), A10()), "Escape" === t11 && (e21.preventDefault(), _10()); + }, P10, function() { + p10 || C10(O10, E10); + }, l10, g10, j10, C10, o10, function() { + O10 = this.value, n10(8, O10); + }, function() { + return w10(); + }, function() { + return b10(); + }, function() { + return _10(); + }, function() { + E10 = this.value, n10(9, E10); + }]; + } + var xB = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, wB, bB, Zo, { show: 1, searching: 2, resultCount: 16, activeIndex: 3, showReplace: 0, readOnly: 4, onChange: 17, onPrevious: 5, onNext: 6, onReplace: 18, onReplaceAll: 19, onClose: 7 }, hB), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var jB = Number.isNaN || function(e20) { + return "number" == typeof e20 && e20 != e20; + }; + function SB(e20, t10) { + if (e20.length !== t10.length) + return false; + for (var n10 = 0; n10 < e20.length; n10++) + if (r10 = e20[n10], o10 = t10[n10], !(r10 === o10 || jB(r10) && jB(o10))) + return false; + var r10, o10; + return true; + } + function CB(e20, t10) { + void 0 === t10 && (t10 = SB); + var n10 = null; + function r10() { + for (var r11 = [], o10 = 0; o10 < arguments.length; o10++) + r11[o10] = arguments[o10]; + if (n10 && n10.lastThis === this && t10(r11, n10.lastArgs)) + return n10.lastResult; + var i10 = e20.apply(this, r11); + return n10 = { lastResult: i10, lastArgs: r11, lastThis: this }, i10; + } + return r10.clear = function() { + n10 = null; + }, r10; + } + var $B = Symbol("path"); + function _B(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 / 0, r10 = {}; + Array.isArray(e20) && function(e21, t11, n11) { + if (e21.length < t11) + e21.forEach(n11); + else + for (var r11 = t11 > 1 ? (e21.length - 1) / (t11 - 1) : e21.length, o11 = 0; o11 < t11; o11++) { + var i10 = Math.floor(o11 * r11); + n11(e21[i10], i10, e21); + } + }(e20, n10, function(e21) { + Gl(e21) ? OB(e21, r10, t10) : r10[$B] = true; + }); + var o10 = []; + return $B in r10 && o10.push([]), MB(r10, [], o10, t10), o10; + } + function OB(e20, t10, n10) { + for (var r10 in e20) { + var o10 = e20[r10], i10 = t10[r10] || (t10[r10] = {}); + Gl(o10) && n10 ? OB(o10, i10, n10) : void 0 === i10[$B] && (i10[$B] = true); + } + } + function MB(e20, t10, n10, r10) { + for (var o10 in e20) { + var i10 = t10.concat(o10), a10 = e20[o10]; + a10 && true === a10[$B] && n10.push(i10), Rs(a10) && r10 && MB(a10, i10, n10, r10); + } + } + function EB(e20, t10, n10, r10, o10) { + for (var i10 = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 80, a10 = Ts(n10) ? n10.length : 0, s10 = function(e21, t11) { + var n11 = Object.values(e21); + if (_w(n11)) + return t11; + var r11 = function(e23, t12) { + return e23 + t12; + }, o11 = n11.reduce(r11); + return o11 / n11.length; + }(r10, o10), c10 = e20 - i10, l10 = t10 + 2 * i10, u10 = function(e21) { + return r10[e21] || o10; + }, f10 = 0, d10 = 0; d10 < c10 && f10 < a10; ) + d10 += u10(f10), f10++; + f10 > 0 && (d10 -= u10(--f10)); + for (var h10 = f10, v10 = 0; v10 < l10 && h10 < a10; ) + v10 += u10(h10), h10++; + for (var p10 = 0, m10 = h10; m10 < a10; m10++) + p10 += u10(m10); + return { startIndex: f10, endIndex: h10, startHeight: d10, endHeight: p10, averageItemHeight: s10, visibleHeight: v10, visibleItems: Ts(n10) ? n10.slice(f10, h10) : [] }; + } + function AB(e20, t10, n10, r10) { + for (var o10 = PB(e20, t10).rowIndex, i10 = 0, a10 = 0; a10 < o10; a10++) + i10 += n10[a10] || r10; + return i10; + } + function PB(e20, t10) { + var n10, r10 = Co(n10 = e20) || Fo(n10) || Lo(n10) || So(), o10 = r10[0], i10 = r10.slice(1), a10 = parseInt(o10, 10); + return { rowIndex: isNaN(a10) ? -1 : a10, columnIndex: t10.findIndex(function(e21) { + return AE(i10, e21); + }) }; + } + function TB(e20, t10) { + var n10 = e20.rowIndex, r10 = e20.columnIndex; + return [String(n10)].concat(Bo(t10[r10])); + } + function RB(e20, t10) { + var n10 = jo(Lj(e20, function(e21) { + return Jl(e21.path[0]); + }), 2), r10 = n10[0], o10 = n10[1], i10 = dx(Ak(r10, IB), function(e21) { + var n11 = { row: [], columns: {} }; + return e21.forEach(function(e23) { + var r11 = function(e24, t11) { + var n12 = PB(e24.path, t11); + if (-1 !== n12.columnIndex) + return n12.columnIndex; + return -1; + }(e23, t10); + -1 !== r11 ? (void 0 === n11.columns[r11] && (n11.columns[r11] = []), n11.columns[r11].push(e23)) : n11.row.push(e23); + }), n11; + }); + return { root: o10, rows: i10 }; + } + function NB(e20, t10) { + if (t10 && 0 !== t10.length) + return 1 === t10.length ? t10[0] : { path: e20, message: "Multiple validation issues: " + t10.map(function(e21) { + return JO(e21.path) + " " + e21.message; + }).join(", "), severity: Za.warning }; + } + function IB(e20) { + return parseInt(e20.path[0], 10); + } + function DB(e20, t10, n10) { + return t10.some(function(t11) { + return function(e21, t12, n11) { + if (!e21) + return false; + if ("replace" === t12.op) { + var r10 = PB(Xs(t12.path), n11), o10 = r10.rowIndex, i10 = r10.columnIndex, a10 = n11.findIndex(function(t13) { + return Ow(t13, e21.path); + }); + if (-1 !== o10 && -1 !== i10 && i10 !== a10) + return false; + } + return true; + }(e20.sortedColumn, t11, n10); + }) ? Ro(Ro({}, e20), {}, { sortedColumn: null }) : e20; + } + var qB = Da("jsoneditor:actions"); + function zB(e20) { + return BB.apply(this, arguments); + } + function BB() { + return BB = xo(ko().mark(function e20(t10) { + var n10, r10, o10, i10, a10, s10, c10, l10, u10, f10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + if (n10 = t10.json, r10 = t10.documentState, o10 = t10.indentation, i10 = t10.readOnly, a10 = t10.parser, s10 = t10.onPatch, !i10 && void 0 !== n10 && r10.selection && BE(r10.selection)) { + e21.next = 3; + break; + } + return e21.abrupt("return"); + case 3: + if (null != (c10 = qE(n10, r10.selection, o10, a10))) { + e21.next = 6; + break; + } + return e21.abrupt("return"); + case 6: + return qB("cut", { selection: r10.selection, clipboard: c10, indentation: o10 }), e21.next = 9, Yz(c10); + case 9: + l10 = dA(n10, r10.selection), u10 = l10.operations, f10 = l10.newSelection, s10(u10, function(e23, t11) { + return { state: Ro(Ro({}, t11), {}, { selection: f10 }) }; + }); + case 11: + case "end": + return e21.stop(); + } + }, e20); + })), BB.apply(this, arguments); + } + function LB(e20) { + return FB.apply(this, arguments); + } + function FB() { + return FB = xo(ko().mark(function e20(t10) { + var n10, r10, o10, i10, a10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + if (n10 = t10.json, r10 = t10.documentState, o10 = t10.indentation, i10 = t10.parser, null != (a10 = qE(n10, r10.selection, o10, i10))) { + e21.next = 4; + break; + } + return e21.abrupt("return"); + case 4: + return qB("copy", { clipboard: a10, indentation: o10 }), e21.next = 7, Yz(a10); + case 7: + case "end": + return e21.stop(); + } + }, e20); + })), FB.apply(this, arguments); + } + function VB(e20) { + var t10 = e20.clipboardText, n10 = e20.json, r10 = e20.selection, o10 = e20.readOnly, i10 = e20.parser, a10 = e20.onPatch, s10 = e20.onChangeText, c10 = e20.openRepairModal; + if (!o10) + try { + l10(t10); + } catch (e21) { + c10(t10, function(e23) { + qB("repaired pasted text: ", e23), l10(e23); + }); + } + function l10(e21) { + if (void 0 !== n10) { + var o11 = r10 || RE([], false), c11 = cA(n10, o11, e21, i10); + qB("paste", { pastedText: e21, operations: c11, selectionNonNull: o11 }), a10(c11, function(e23, t11) { + var r11 = t11; + return c11.filter(function(e24) { + return (Ns(e24) || Ds(e24)) && Ql(e24.value); + }).forEach(function(t12) { + var o12 = dc(n10, t12.path); + r11 = lE(e23, r11, o12); + }), { state: r11 }; + }); + } else + qB("paste text", { pastedText: e21 }), s10(t10, function(e23, t11) { + if (e23) { + return { state: lE(e23, t11, []) }; + } + }); + } + } + function HB(e20) { + var t10 = e20.json, n10 = e20.text, r10 = e20.documentState, o10 = e20.keepSelection, i10 = e20.readOnly, a10 = e20.onChange, s10 = e20.onPatch; + if (!i10 && r10.selection) { + var c10 = void 0 !== t10 && (vE(r10.selection) || pE(r10.selection)) ? DE(r10.selection.path, r10.selection.path) : r10.selection; + if (_w(JE(r10.selection))) + qB("remove root", { selection: r10.selection }), a10 && a10({ text: "", json: void 0 }, void 0 !== t10 ? { text: void 0, json: t10 } : { text: n10 || "", json: t10 }, { contentErrors: null, patchResult: null }); + else if (void 0 !== t10) { + var l10 = dA(t10, c10), u10 = l10.operations, f10 = l10.newSelection; + qB("remove", { operations: u10, selection: r10.selection, newSelection: f10 }), s10(u10, function(e21, t11) { + return { state: Ro(Ro({}, t11), {}, { selection: o10 ? r10.selection : f10 }) }; + }); + } + } + } + function WB(e20) { + var t10 = e20.json, n10 = e20.documentState, r10 = e20.columns, o10 = e20.readOnly, i10 = e20.onPatch; + if (!o10 && void 0 !== t10 && n10.selection && BE(n10.selection)) { + var a10 = PB(JE(n10.selection), r10), s10 = a10.rowIndex, c10 = a10.columnIndex; + qB("duplicate row", { rowIndex: s10 }); + var l10 = [String(s10)]; + i10(sA(t10, [l10]), function(e21, n11) { + var o11 = RE(TB({ rowIndex: s10 < t10.length ? s10 + 1 : s10, columnIndex: c10 }, r10), false); + return { state: Ro(Ro({}, n11), {}, { selection: o11 }) }; + }); + } + } + function UB(e20) { + var t10 = e20.json, n10 = e20.documentState, r10 = e20.columns, o10 = e20.readOnly, i10 = e20.onPatch; + if (!o10 && void 0 !== t10 && n10.selection && BE(n10.selection)) { + var a10 = PB(JE(n10.selection), r10).rowIndex; + qB("insert before row", { rowIndex: a10 }), i10(oA(t10, [String(a10)], [{ key: "", value: Rs(t10[0]) ? {} : "" }])); + } + } + function JB(e20) { + var t10 = e20.json, n10 = e20.documentState, r10 = e20.columns, o10 = e20.readOnly, i10 = e20.onPatch; + if (!o10 && void 0 !== t10 && n10.selection && BE(n10.selection)) { + var a10 = PB(JE(n10.selection), r10), s10 = a10.rowIndex, c10 = a10.columnIndex; + qB("insert after row", { rowIndex: s10 }); + var l10 = s10 + 1, u10 = [String(l10)], f10 = [{ key: "", value: Rs(t10[0]) ? {} : "" }]; + i10(l10 < t10.length ? oA(t10, u10, f10) : iA(t10, [], f10), function(e21, t11) { + var n11 = RE(TB({ rowIndex: l10, columnIndex: c10 }, r10), false); + return { state: Ro(Ro({}, t11), {}, { selection: n11 }) }; + }); + } + } + function KB(e20) { + var t10 = e20.json, n10 = e20.documentState, r10 = e20.columns, o10 = e20.readOnly, i10 = e20.onPatch; + if (!o10 && void 0 !== t10 && n10.selection && BE(n10.selection)) { + var a10 = PB(JE(n10.selection), r10), s10 = a10.rowIndex, c10 = a10.columnIndex; + qB("remove row", { rowIndex: s10 }), i10(lA([[String(s10)]]), function(e21, t11) { + var n11 = s10 < e21.length ? s10 : s10 > 0 ? s10 - 1 : void 0, o11 = void 0 !== n11 ? RE(TB({ rowIndex: n11, columnIndex: c10 }, r10), false) : null; + return qB("remove row new selection", { rowIndex: s10, newRowIndex: n11, newSelection: o11 }), { state: Ro(Ro({}, t11), {}, { selection: o11 }) }; + }); + } + } + function GB(e20) { + var t10 = e20.insertType, n10 = e20.selectInside, r10 = e20.refJsonEditor, o10 = e20.json, i10 = e20.selection, a10 = e20.readOnly, s10 = e20.parser, c10 = e20.onPatch, l10 = e20.onReplaceJson; + if (!a10) { + var u10 = function(e21, t11, n11) { + if ("object" === n11) + return {}; + if ("array" === n11) + return []; + if ("structure" === n11 && void 0 !== e21) { + var r11 = Ws(e21, t11 ? wE(t11) : []); + if (Array.isArray(r11) && !_w(r11)) { + var o11 = ck(r11); + return Ql(o11) ? xg(o11, function(e23) { + return Array.isArray(e23) ? [] : Gl(e23) ? void 0 : ""; + }) : ""; + } + } + return ""; + }(o10, i10, t10); + if (void 0 !== o10) { + var f10 = s10.stringify(u10), d10 = cA(o10, i10, f10, s10); + qB("onInsert", { insertType: t10, operations: d10, newValue: u10, data: f10 }); + var h10 = vb(d10.filter(function(e21) { + return "add" === e21.op || "replace" === e21.op; + })); + c10(d10, function(e21, t11) { + if (h10) { + var r11 = dc(e21, h10.path); + if (Ql(u10)) + return { state: Ro(Ro({}, HM(e21, t11, r11, fE)), {}, { selection: n10 ? NE(r11) : t11.selection }) }; + if ("" === u10) { + var o11 = _w(r11) ? null : Ws(e21, Qk(r11)); + return { state: VM(e21, Ro(Ro({}, t11), {}, { selection: Gl(o11) ? TE(r11, true) : RE(r11, true) }), r11) }; + } + } else + ; + }), qB("after patch"), h10 && "" === u10 && eL(function() { + return jO(r10, "", true, tL); + }); + } else { + qB("onInsert", { insertType: t10, newValue: u10 }); + var v10 = []; + l10(u10, function(e21, t11) { + return { state: Ro(Ro({}, lE(e21, t11, v10)), {}, { selection: Ql(u10) ? NE(v10) : RE(v10, true) }) }; + }); + } + } + } + function QB(e20) { + return YB.apply(this, arguments); + } + function YB() { + return YB = xo(ko().mark(function e20(t10) { + var n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + if (n10 = t10.char, r10 = t10.selectInside, o10 = t10.refJsonEditor, i10 = t10.json, a10 = t10.selection, s10 = t10.readOnly, c10 = t10.parser, l10 = t10.onPatch, u10 = t10.onReplaceJson, f10 = t10.onSelect, !s10) { + e21.next = 3; + break; + } + return e21.abrupt("return"); + case 3: + if (!vE(a10)) { + e21.next = 8; + break; + } + return d10 = !a10.edit, f10(Ro(Ro({}, a10), {}, { edit: true })), eL(function() { + return jO(o10, n10, d10, tL); + }), e21.abrupt("return"); + case 8: + if ("{" !== n10) { + e21.next = 12; + break; + } + GB({ insertType: "object", selectInside: r10, refJsonEditor: o10, json: i10, selection: a10, readOnly: s10, parser: c10, onPatch: l10, onReplaceJson: u10 }), e21.next = 23; + break; + case 12: + if ("[" !== n10) { + e21.next = 16; + break; + } + GB({ insertType: "array", selectInside: r10, refJsonEditor: o10, json: i10, selection: a10, readOnly: s10, parser: c10, onPatch: l10, onReplaceJson: u10 }), e21.next = 23; + break; + case 16: + if (!pE(a10) || void 0 === i10) { + e21.next = 20; + break; + } + Ql(Ws(i10, a10.path)) || (h10 = !a10.edit, f10(Ro(Ro({}, a10), {}, { edit: true })), eL(function() { + return jO(o10, n10, h10, tL); + })), e21.next = 23; + break; + case 20: + return qB("onInsertValueWithCharacter", { char: n10 }), e21.next = 23, XB({ char: n10, refJsonEditor: o10, json: i10, selection: a10, readOnly: s10, parser: c10, onPatch: l10, onReplaceJson: u10 }); + case 23: + case "end": + return e21.stop(); + } + }, e20); + })), YB.apply(this, arguments); + } + function XB(e20) { + return ZB.apply(this, arguments); + } + function ZB() { + return ZB = xo(ko().mark(function e20(t10) { + var n10, r10, o10, i10, a10, s10, c10, l10, u10; + return ko().wrap(function(e21) { + for (; ; ) + switch (e21.prev = e21.next) { + case 0: + if (n10 = t10.char, r10 = t10.refJsonEditor, o10 = t10.json, i10 = t10.selection, a10 = t10.readOnly, s10 = t10.parser, c10 = t10.onPatch, l10 = t10.onReplaceJson, !a10) { + e21.next = 3; + break; + } + return e21.abrupt("return"); + case 3: + GB({ insertType: "value", selectInside: false, refJsonEditor: r10, json: o10, selection: i10, readOnly: a10, parser: s10, onPatch: c10, onReplaceJson: l10 }), u10 = !zE(i10), eL(function() { + return jO(r10, n10, u10, tL); + }); + case 6: + case "end": + return e21.stop(); + } + }, e20); + })), ZB.apply(this, arguments); + } + function eL(e20) { + setTimeout(function() { + return setTimeout(e20); + }); + } + function tL(e20) { + null == e20 || e20.refresh(); + } + function nL(e20) { + mi(e20, "svelte-l2z0i3", '.jse-json-preview.svelte-l2z0i3{flex:1;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-panel-color-readonly, #b2b2b2);overflow:auto;white-space:pre-wrap;padding:2px;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}'); + } + function rL(e20) { + var t10, n10; + return { c: function() { + t10 = ji("div"), n10 = Ci(e20[0]), Ai(t10, "class", "jse-json-preview svelte-l2z0i3"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: function(e21, t11) { + 1 & jo(t11, 1)[0] && Ni(n10, e21[0]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function oL(e20, t10, n10) { + var r10, o10, i10 = t10.text, a10 = t10.json, s10 = t10.indentation, c10 = t10.parser; + return e20.$$set = function(e21) { + "text" in e21 && n10(1, i10 = e21.text), "json" in e21 && n10(2, a10 = e21.json), "indentation" in e21 && n10(3, s10 = e21.indentation), "parser" in e21 && n10(4, c10 = e21.parser); + }, e20.$$.update = function() { + 6 & e20.$$.dirty && n10(5, r10 = void 0 !== a10 ? { json: a10 } : { text: i10 || "" }), 56 & e20.$$.dirty && n10(0, o10 = tM(Y_(r10, s10, c10), fs)); + }, [o10, i10, a10, s10, c10, r10]; + } + var iL = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, oL, rL, Xo, { text: 1, json: 2, indentation: 3, parser: 4 }, nL), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var aL = vi.window; + function sL(e20) { + mi(e20, "svelte-vx4hzc", '.jse-tree-mode.svelte-vx4hzc.svelte-vx4hzc{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color, #fff);min-width:0;min-height:0;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-text-color, #4d4d4d);line-height:var(--jse-line-height, calc(1em + 4px))}.jse-tree-mode.svelte-vx4hzc .jse-hidden-input-label .jse-hidden-input.svelte-vx4hzc{position:fixed;top:-10px;left:-10px;width:1px;height:1px;padding:0;border:0;outline:none}.jse-tree-mode.svelte-vx4hzc .jse-search-box-container.svelte-vx4hzc{position:relative;height:0;top:var(--jse-padding, 10px);margin-right:calc(var(--jse-padding, 10px) + 20px);margin-left:var(--jse-padding, 10px);text-align:right;z-index:3}.jse-tree-mode.no-main-menu.svelte-vx4hzc.svelte-vx4hzc{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-tree-mode.svelte-vx4hzc .jse-contents.svelte-vx4hzc{border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);flex:1;overflow:auto;position:relative;padding:2px;display:flex;flex-direction:column}.jse-tree-mode.svelte-vx4hzc .jse-contents.svelte-vx4hzc:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-tree-mode.svelte-vx4hzc .jse-contents .jse-loading-space.svelte-vx4hzc{flex:1}.jse-tree-mode.svelte-vx4hzc .jse-contents .jse-loading.svelte-vx4hzc{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}'); + } + function cL(e20) { + var t10, n10, r10; + function o10(t11) { + e20[79](t11); + } + var i10 = { json: e20[11], selection: e20[12].selection, readOnly: e20[0], historyState: e20[23], onExpandAll: e20[41], onCollapseAll: e20[42], onUndo: e20[37], onRedo: e20[38], onSort: e20[39], onTransform: e20[40], onContextMenu: e20[46], onCopy: e20[34], onRenderMenu: e20[7] }; + return void 0 !== e20[20] && (i10.showSearch = e20[20]), t10 = new $z({ props: i10 }), na.push(function() { + return Aa(t10, "showSearch", o10); + }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, n11) { + Ta(t10, e21, n11), r10 = true; + }, p: function(e21, r11) { + var o11 = {}; + 2048 & r11[0] && (o11.json = e21[11]), 4096 & r11[0] && (o11.selection = e21[12].selection), 1 & r11[0] && (o11.readOnly = e21[0]), 8388608 & r11[0] && (o11.historyState = e21[23]), 128 & r11[0] && (o11.onRenderMenu = e21[7]), !n10 && 1048576 & r11[0] && (n10 = true, o11.showSearch = e21[20], ua(function() { + return n10 = false; + })), t10.$set(o11); + }, i: function(e21) { + r10 || (wa(t10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function lL(e20) { + var t10, n10; + return t10 = new dB({ props: { json: e20[11], selection: e20[12].selection, onSelect: e20[50], onError: e20[6], pathParser: e20[4] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 2048 & n11[0] && (r10.json = e21[11]), 4096 & n11[0] && (r10.selection = e21[12].selection), 64 & n11[0] && (r10.onError = e21[6]), 16 & n11[0] && (r10.pathParser = e21[4]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function uL(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).innerHTML = '
loading...
', Ai(t10, "class", "jse-contents svelte-vx4hzc"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function fL(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10 = [hL, dL], f10 = []; + function d10(e21, t11) { + return void 0 === e21[11] ? 0 : 1; + } + return o10 = d10(e20), i10 = f10[o10] = u10[o10](e20), { c: function() { + t10 = ji("label"), n10 = ji("input"), r10 = $i(), i10.c(), a10 = _i(), Ai(n10, "type", "text"), n10.readOnly = true, Ai(n10, "tabindex", "-1"), Ai(n10, "class", "jse-hidden-input svelte-vx4hzc"), Ai(t10, "class", "jse-hidden-input-label"); + }, m: function(i11, u11) { + ki(i11, t10, u11), pi(t10, n10), e20[80](n10), ki(i11, r10, u11), f10[o10].m(i11, u11), ki(i11, a10, u11), s10 = true, c10 || (l10 = Oi(n10, "paste", e20[35]), c10 = true); + }, p: function(e21, t11) { + var n11 = o10; + (o10 = d10(e21)) === n11 ? f10[o10].p(e21, t11) : (ba(), xa(f10[n11], 1, 1, function() { + f10[n11] = null; + }), ka(), (i10 = f10[o10]) ? i10.p(e21, t11) : (i10 = f10[o10] = u10[o10](e21)).c(), wa(i10, 1), i10.m(a10.parentNode, a10)); + }, i: function(e21) { + s10 || (wa(i10), s10 = true); + }, o: function(e21) { + xa(i10), s10 = false; + }, d: function(n11) { + n11 && (wi(t10), wi(r10), wi(a10)), e20[80](null), f10[o10].d(n11), c10 = false, l10(); + } }; + } + function dL(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10; + i10 = new xB({ props: { show: e20[20], resultCount: (null === (t10 = e20[18]) || void 0 === t10 || null === (t10 = t10.items) || void 0 === t10 ? void 0 : t10.length) || 0, activeIndex: (null === (n10 = e20[18]) || void 0 === n10 ? void 0 : n10.activeIndex) || 0, showReplace: e20[21], searching: e20[22], readOnly: e20[0], onChange: e20[27], onNext: e20[28], onPrevious: e20[29], onReplace: e20[30], onReplaceAll: e20[31], onClose: e20[32] } }), c10 = new bz({ props: { value: e20[11], path: [], expandedMap: e20[12].expandedMap, enforceStringMap: e20[12].enforceStringMap, visibleSectionsMap: e20[12].visibleSectionsMap, validationErrorsMap: e20[25], searchResultItemsMap: null === (r10 = e20[18]) || void 0 === r10 ? void 0 : r10.itemsMap, selection: e20[12].selection, context: e20[14], onDragSelectionStart: Mf } }); + var v10 = e20[19] && vL(e20), p10 = e20[24] && pL(e20); + return d10 = new JN({ props: { validationErrors: e20[13], selectError: e20[33] } }), { c: function() { + o10 = ji("div"), Pa(i10.$$.fragment), a10 = $i(), s10 = ji("div"), Pa(c10.$$.fragment), l10 = $i(), v10 && v10.c(), u10 = $i(), p10 && p10.c(), f10 = $i(), Pa(d10.$$.fragment), Ai(o10, "class", "jse-search-box-container svelte-vx4hzc"), Ai(s10, "class", "jse-contents svelte-vx4hzc"), Ai(s10, "data-jsoneditor-scrollable-contents", true); + }, m: function(t11, n11) { + ki(t11, o10, n11), Ta(i10, o10, null), ki(t11, a10, n11), ki(t11, s10, n11), Ta(c10, s10, null), e20[84](s10), ki(t11, l10, n11), v10 && v10.m(t11, n11), ki(t11, u10, n11), p10 && p10.m(t11, n11), ki(t11, f10, n11), Ta(d10, t11, n11), h10 = true; + }, p: function(e21, t11) { + var n11, r11, o11, a11 = {}; + 1048576 & t11[0] && (a11.show = e21[20]), 262144 & t11[0] && (a11.resultCount = (null === (n11 = e21[18]) || void 0 === n11 || null === (n11 = n11.items) || void 0 === n11 ? void 0 : n11.length) || 0), 262144 & t11[0] && (a11.activeIndex = (null === (r11 = e21[18]) || void 0 === r11 ? void 0 : r11.activeIndex) || 0), 2097152 & t11[0] && (a11.showReplace = e21[21]), 4194304 & t11[0] && (a11.searching = e21[22]), 1 & t11[0] && (a11.readOnly = e21[0]), i10.$set(a11); + var s11 = {}; + 2048 & t11[0] && (s11.value = e21[11]), 4096 & t11[0] && (s11.expandedMap = e21[12].expandedMap), 4096 & t11[0] && (s11.enforceStringMap = e21[12].enforceStringMap), 4096 & t11[0] && (s11.visibleSectionsMap = e21[12].visibleSectionsMap), 33554432 & t11[0] && (s11.validationErrorsMap = e21[25]), 262144 & t11[0] && (s11.searchResultItemsMap = null === (o11 = e21[18]) || void 0 === o11 ? void 0 : o11.itemsMap), 4096 & t11[0] && (s11.selection = e21[12].selection), 16384 & t11[0] && (s11.context = e21[14]), c10.$set(s11), e21[19] ? v10 ? (v10.p(e21, t11), 524288 & t11[0] && wa(v10, 1)) : ((v10 = vL(e21)).c(), wa(v10, 1), v10.m(u10.parentNode, u10)) : v10 && (ba(), xa(v10, 1, 1, function() { + v10 = null; + }), ka()), e21[24] ? p10 ? (p10.p(e21, t11), 16777216 & t11[0] && wa(p10, 1)) : ((p10 = pL(e21)).c(), wa(p10, 1), p10.m(f10.parentNode, f10)) : p10 && (ba(), xa(p10, 1, 1, function() { + p10 = null; + }), ka()); + var l11 = {}; + 8192 & t11[0] && (l11.validationErrors = e21[13]), d10.$set(l11); + }, i: function(e21) { + h10 || (wa(i10.$$.fragment, e21), wa(c10.$$.fragment, e21), wa(v10), wa(p10), wa(d10.$$.fragment, e21), h10 = true); + }, o: function(e21) { + xa(i10.$$.fragment, e21), xa(c10.$$.fragment, e21), xa(v10), xa(p10), xa(d10.$$.fragment, e21), h10 = false; + }, d: function(t11) { + t11 && (wi(o10), wi(a10), wi(s10), wi(l10), wi(u10), wi(f10)), Ra(i10), Ra(c10), e20[84](null), v10 && v10.d(t11), p10 && p10.d(t11), Ra(d10, t11); + } }; + } + function hL(e20) { + var t10, n10, r10, o10, i10 = [gL, mL], a10 = []; + function s10(e21, t11) { + return "" === e21[17] || void 0 === e21[17] ? 0 : 1; + } + return t10 = s10(e20), n10 = a10[t10] = i10[t10](e20), { c: function() { + n10.c(), r10 = _i(); + }, m: function(e21, n11) { + a10[t10].m(e21, n11), ki(e21, r10, n11), o10 = true; + }, p: function(e21, o11) { + var c10 = t10; + (t10 = s10(e21)) === c10 ? a10[t10].p(e21, o11) : (ba(), xa(a10[c10], 1, 1, function() { + a10[c10] = null; + }), ka(), (n10 = a10[t10]) ? n10.p(e21, o11) : (n10 = a10[t10] = i10[t10](e21)).c(), wa(n10, 1), n10.m(r10.parentNode, r10)); + }, i: function(e21) { + o10 || (wa(n10), o10 = true); + }, o: function(e21) { + xa(n10), o10 = false; + }, d: function(e21) { + e21 && wi(r10), a10[t10].d(e21); + } }; + } + function vL(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "info", message: "You pasted a JSON ".concat(Array.isArray(e20[19].contents) ? "array" : "object", " as text"), actions: [{ icon: uP, text: "Paste as JSON instead", title: "Replace the value with the pasted JSON", onMouseDown: e20[47] }, { text: "Leave as is", title: "Keep the JSON embedded in the value", onClick: e20[48] }] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 524288 & n11[0] && (r10.message = "You pasted a JSON ".concat(Array.isArray(e21[19].contents) ? "array" : "object", " as text")), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function pL(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "success", message: "The loaded JSON document was invalid but is successfully repaired.", actions: e20[0] ? [] : [{ icon: PP, text: "Ok", title: "Accept the repaired document", onClick: e20[8] }, { icon: lP, text: "Repair manually instead", title: "Leave the document unchanged and repair it manually instead", onClick: e20[49] }], onClose: e20[9] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11[0] && (r10.actions = e21[0] ? [] : [{ icon: PP, text: "Ok", title: "Accept the repaired document", onClick: e21[8] }, { icon: lP, text: "Repair manually instead", title: "Leave the document unchanged and repair it manually instead", onClick: e21[49] }]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function mL(e20) { + var t10, n10, r10, o10; + return t10 = new IN({ props: { type: "error", message: "The loaded JSON document is invalid and could not be repaired automatically.", actions: e20[0] ? [] : [{ icon: lP, text: "Repair manually", title: 'Open the document in "code" mode and repair it manually', onClick: e20[49] }] } }), r10 = new iL({ props: { text: e20[17], json: e20[11], indentation: e20[5], parser: e20[3] } }), { c: function() { + Pa(t10.$$.fragment), n10 = $i(), Pa(r10.$$.fragment); + }, m: function(e21, i10) { + Ta(t10, e21, i10), ki(e21, n10, i10), Ta(r10, e21, i10), o10 = true; + }, p: function(e21, n11) { + var o11 = {}; + 1 & n11[0] && (o11.actions = e21[0] ? [] : [{ icon: lP, text: "Repair manually", title: 'Open the document in "code" mode and repair it manually', onClick: e21[49] }]), t10.$set(o11); + var i10 = {}; + 131072 & n11[0] && (i10.text = e21[17]), 2048 & n11[0] && (i10.json = e21[11]), 32 & n11[0] && (i10.indentation = e21[5]), 8 & n11[0] && (i10.parser = e21[3]), r10.$set(i10); + }, i: function(e21) { + o10 || (wa(t10.$$.fragment, e21), wa(r10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), xa(r10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(n10), Ra(t10, e21), Ra(r10, e21); + } }; + } + function gL(e20) { + var t10, n10; + return t10 = new Az({ props: { readOnly: e20[0], onCreateObject: e20[81], onCreateArray: e20[82], onClick: e20[83] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11[0] && (r10.readOnly = e21[0]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function yL(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = e20[1] && cL(e20), u10 = e20[2] && lL(e20), f10 = [fL, uL], d10 = []; + return o10 = function(e21, t11) { + return e21[26] ? 1 : 0; + }(e20), i10 = d10[o10] = f10[o10](e20), { c: function() { + t10 = ji("div"), l10 && l10.c(), n10 = $i(), u10 && u10.c(), r10 = $i(), i10.c(), Ai(t10, "role", "tree"), Ai(t10, "tabindex", "-1"), Ai(t10, "class", "jse-tree-mode svelte-vx4hzc"), zi(t10, "no-main-menu", !e20[1]); + }, m: function(i11, f11) { + ki(i11, t10, f11), l10 && l10.m(t10, null), pi(t10, n10), u10 && u10.m(t10, null), pi(t10, r10), d10[o10].m(t10, null), e20[85](t10), a10 = true, s10 || (c10 = [Oi(aL, "mousedown", e20[51]), Oi(t10, "keydown", e20[43]), Oi(t10, "mousedown", e20[44]), Oi(t10, "contextmenu", e20[45])], s10 = true); + }, p: function(e21, o11) { + e21[1] ? l10 ? (l10.p(e21, o11), 2 & o11[0] && wa(l10, 1)) : ((l10 = cL(e21)).c(), wa(l10, 1), l10.m(t10, n10)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()), e21[2] ? u10 ? (u10.p(e21, o11), 4 & o11[0] && wa(u10, 1)) : ((u10 = lL(e21)).c(), wa(u10, 1), u10.m(t10, r10)) : u10 && (ba(), xa(u10, 1, 1, function() { + u10 = null; + }), ka()), i10.p(e21, o11), (!a10 || 2 & o11[0]) && zi(t10, "no-main-menu", !e21[1]); + }, i: function(e21) { + a10 || (wa(l10), wa(u10), wa(i10), a10 = true); + }, o: function(e21) { + xa(l10), xa(u10), xa(i10), a10 = false; + }, d: function(n11) { + n11 && wi(t10), l10 && l10.d(), u10 && u10.d(), d10[o10].d(), e20[85](null), s10 = false, Qo(c10); + } }; + } + function bL(e20, t10, n10) { + var r10, o10 = Da("jsoneditor:TreeMode"), i10 = "undefined" == typeof window; + o10("isSSR:", i10); + var a10, s10, c10, l10, u10, f10 = Zi("simple-modal").open, d10 = A$(), h10 = A$(), v10 = Zi("absolute-popup"), p10 = v10.openAbsolutePopup, m10 = v10.closeAbsolutePopup, g10 = false, y10 = bN(), b10 = t10.readOnly, k10 = t10.externalContent, w10 = t10.externalSelection, x10 = t10.mainMenuBar, j10 = t10.navigationBar, S10 = t10.escapeControlCharacters, C10 = t10.escapeUnicodeCharacters, $10 = t10.parser, _10 = t10.parseMemoizeOne, O10 = t10.validator, M10 = t10.validationParser, E10 = t10.pathParser, A10 = t10.indentation, P10 = t10.onError, T8 = t10.onChange, R8 = t10.onChangeMode, N8 = t10.onSelect, I10 = t10.onRenderValue, D10 = t10.onRenderMenu, q10 = t10.onRenderContextMenu, z10 = t10.onClassName, B10 = t10.onFocus, L10 = t10.onBlur, F10 = t10.onSortModal, V10 = t10.onTransformModal, H10 = t10.onJSONEditorModal, W10 = false; + ON({ onMount: Gi, onDestroy: Qi, getWindow: function() { + return SO(c10); + }, hasFocus: function() { + return W10 && document.hasFocus() || CO(c10); + }, onFocus: function() { + g10 = true, B10 && B10(); + }, onBlur: function() { + g10 = false, L10 && L10(); + } }); + var U10 = void 0; + function J10(e21) { + o10("updateSelection", e21); + var t11 = "function" == typeof e21 ? e21(X10.selection) || null : e21; + Ow(t11, X10.selection) || (n10(12, X10 = Ro(Ro({}, X10), {}, { selection: t11 })), N8(t11)); + } + var K10, G10, Q10, Y10 = false, X10 = BM(), Z10 = false, ee2 = false, te2 = false, ne2 = ""; + function re2(e21) { + return oe2.apply(this, arguments); + } + function oe2() { + return oe2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return o10("search text updated", t11), n10(78, ne2 = t11), e23.next = 4, ca(); + case 4: + return e23.next = 6, le2(); + case 6: + case "end": + return e23.stop(); + } + }, e21); + })), oe2.apply(this, arguments); + } + function ie2() { + return (ie2 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return n10(18, K10 = K10 ? pA(K10) : void 0), e23.next = 3, le2(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function ae2() { + return (ae2 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return n10(18, K10 = K10 ? mA(K10) : void 0), e23.next = 3, le2(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function se2() { + return (se2 = xo(ko().mark(function e21(t11, n11) { + var r11, i11, a11, s11, c11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (i11 = null === (r11 = K10) || void 0 === r11 ? void 0 : r11.activeItem, o10("handleReplace", { replacementText: n11, activeItem: i11 }), i11 && void 0 !== l10) { + e23.next = 4; + break; + } + return e23.abrupt("return"); + case 4: + return a11 = wA(l10, X10, n11, i11, $10), s11 = a11.operations, c11 = a11.newSelection, ot2(s11, function(e24, t12) { + return { state: Ro(Ro({}, t12), {}, { selection: c11 }) }; + }), e23.next = 8, ca(); + case 8: + return e23.next = 10, le2(); + case 10: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function ce2() { + return ce2 = xo(ko().mark(function e21(t11, n11) { + var r11, i11, a11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return o10("handleReplaceAll", { text: t11, replacementText: n11 }), r11 = xA(l10, X10, t11, n11, $10), i11 = r11.operations, a11 = r11.newSelection, ot2(i11, function(e24, t12) { + return { state: Ro(Ro({}, t12), {}, { selection: a11 }) }; + }), e23.next = 5, ca(); + case 5: + return e23.next = 7, le2(); + case 7: + case "end": + return e23.stop(); + } + }, e21); + })), ce2.apply(this, arguments); + } + function le2() { + return ue2.apply(this, arguments); + } + function ue2() { + return (ue2 = xo(ko().mark(function e21() { + var t11, r11, i11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (r11 = null === (t11 = K10) || void 0 === t11 ? void 0 : t11.activeItem, o10("focusActiveSearchResult", K10), !r11 || void 0 === l10) { + e23.next = 9; + break; + } + return i11 = r11.path, n10(12, X10 = Ro(Ro({}, VM(l10, X10, i11)), {}, { selection: null })), e23.next = 7, ca(); + case 7: + return e23.next = 9, Ze2(i11); + case 9: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + var fe2 = xN({ onChange: function(e21) { + n10(23, de2 = e21); + } }), de2 = fe2.getState(); + var he2, ve2, pe2 = UC(function(e21, t11) { + if ("" === e21) + return o10("clearing search result"), void (void 0 !== K10 && n10(18, K10 = void 0)); + n10(22, te2 = true), setTimeout(function() { + o10("searching...", e21); + var r11 = gA(e21, t11, cs); + n10(18, K10 = function(e23, t12, n11) { + var r12 = null != n11 && n11.activeItem ? jA(n11.activeItem) : void 0, o11 = t12.findIndex(function(e24) { + return Ow(r12, jA(e24)); + }), i11 = -1 !== o11 ? o11 : void 0 !== (null == n11 ? void 0 : n11.activeIndex) && (null == n11 ? void 0 : n11.activeIndex) < t12.length ? null == n11 ? void 0 : n11.activeIndex : t12.length > 0 ? 0 : -1, a11 = t12.map(function(e24, t13) { + return Ro(Ro({}, e24), {}, { active: t13 === i11 }); + }), s11 = a11[i11]; + return { items: a11, itemsMap: Ak(a11, function(e24) { + return Zs(e24.path); + }), activeItem: s11, activeIndex: i11 }; + }(0, r11, K10)), n10(22, te2 = false); + }); + }, 300), me2 = false, ge2 = [], ye2 = CB(CN); + function be2(e21, t11, r11, i11) { + jN(function() { + var a11; + try { + a11 = ye2(e21, t11, r11, i11); + } catch (e23) { + a11 = [{ path: [], message: "Failed to validate: " + e23.message, severity: Za.warning }]; + } + Ow(a11, ge2) || (o10("validationErrors changed:", a11), n10(13, ge2 = a11)); + }, function(e23) { + return o10("validationErrors updated in ".concat(e23, " ms")); + }); + } + function ke2() { + return o10("validate"), U10 ? { parseError: U10, isRepairable: false } : (be2(l10, O10, $10, M10), _w(ge2) ? null : { validationErrors: ge2 }); + } + function we2() { + return l10; + } + function xe2() { + return X10; + } + function je2(e21) { + K_(e21) ? function(e23) { + if (void 0 === e23) + return; + var t11 = !Ow(l10, e23); + if (o10("update external json", { isChanged: t11, currentlyText: void 0 === l10 }), !t11) + return; + var r11 = { json: l10, text: u10 }, i11 = X10, a11 = l10, s11 = u10, c11 = me2; + n10(11, l10 = e23), Se2(l10), n10(17, u10 = void 0), n10(24, me2 = false), U10 = void 0, Ce2(l10), $e2({ previousJson: a11, previousState: i11, previousText: s11, previousTextIsRepaired: c11 }), rt2(r11, null); + }(e21.json) : J_(e21) && function(e23) { + if (void 0 === e23 || K_(k10)) + return; + var t11 = e23 !== u10; + if (o10("update external text", { isChanged: t11 }), !t11) + return; + var r11 = { json: l10, text: u10 }, i11 = l10, a11 = X10, s11 = u10, c11 = me2; + try { + n10(11, l10 = _10(e23)), Se2(l10), n10(17, u10 = e23), n10(24, me2 = false), U10 = void 0; + } catch (t12) { + try { + n10(11, l10 = _10(Hl(e23))), Se2(l10), n10(17, u10 = e23), n10(24, me2 = true), U10 = void 0, Ce2(l10); + } catch (e24) { + n10(11, l10 = void 0), n10(17, u10 = k10.text), n10(24, me2 = false), U10 = void 0 !== u10 && "" !== u10 ? H_(u10, t12.message || String(t12)) : void 0; + } + } + Ce2(l10), $e2({ previousJson: i11, previousState: a11, previousText: s11, previousTextIsRepaired: c11 }), rt2(r11, null); + }(e21.text); + } + function Se2(e21) { + Y10 || (Y10 = true, n10(12, X10 = HM(e21, X10, [], function(e23) { + return X_({ json: e23 }, ms) ? uE : fE; + }(e21)))); + } + function Ce2(e21) { + X10.selection && (Ys(e21, KE(X10.selection)) && Ys(e21, JE(X10.selection)) || (o10("clearing selection: path does not exist anymore", X10.selection), n10(12, X10 = Ro(Ro({}, X10), {}, { selection: $E(e21, X10) })))); + } + function $e2(e21) { + var t11 = e21.previousJson, n11 = e21.previousState, r11 = e21.previousText, o11 = e21.previousTextIsRepaired; + void 0 === t11 && void 0 === r11 || (void 0 !== l10 ? void 0 !== t11 ? fe2.add({ undo: { patch: [{ op: "replace", path: "", value: t11 }], state: PE(n11), json: void 0, text: r11, textIsRepaired: o11 }, redo: { patch: [{ op: "replace", path: "", value: l10 }], state: PE(X10), json: void 0, text: u10, textIsRepaired: me2 } }) : fe2.add({ undo: { patch: void 0, json: void 0, text: r11, state: PE(n11), textIsRepaired: o11 }, redo: { patch: void 0, json: l10, state: PE(X10), text: u10, textIsRepaired: me2 } }) : void 0 !== t11 && fe2.add({ undo: { patch: void 0, json: t11, state: PE(n11), text: r11, textIsRepaired: o11 }, redo: { patch: void 0, json: void 0, text: u10, textIsRepaired: me2, state: PE(X10) } })); + } + function _e2(e21, t11) { + if (o10("patch", e21, t11), void 0 === l10) + throw new Error("Cannot apply patch: no JSON"); + var r11 = { json: l10, text: u10 }, i11 = l10, a11 = X10, s11 = u10, c11 = me2, f11 = hA(l10, e21), d11 = JM(l10, X10, e21), h11 = _E(l10, e21), v11 = function(e23, t12) { + return t12 || !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2] ? Ro(Ro({}, e23), {}, { selection: t12 }) : e23; + }(d11.documentState, h11, false); + o10("patch updatedSelection", h11); + var p11 = "function" == typeof t11 ? t11(d11.json, v11) : void 0; + n10(11, l10 = p11 && void 0 !== p11.json ? p11.json : d11.json); + var m11 = p11 && void 0 !== p11.state ? p11.state : v11; + n10(12, X10 = m11), n10(17, u10 = void 0), n10(24, me2 = false), n10(19, Q10 = void 0), U10 = void 0, Ce2(l10), fe2.add({ undo: { patch: f11, json: void 0, text: s11, state: PE(a11), textIsRepaired: c11 }, redo: { patch: e21, json: void 0, state: PE(m11), text: u10, textIsRepaired: me2 } }); + var g11 = { json: l10, previousJson: i11, undo: f11, redo: e21 }; + return rt2(r11, g11), g11; + } + function Oe2() { + !b10 && X10.selection && J10(TE(JE(X10.selection), true)); + } + function Me2() { + if (!b10 && X10.selection) { + var e21 = JE(X10.selection), t11 = Ws(l10, e21); + Ql(t11) ? function(e23, t12) { + o10("openJSONEditorModal", { path: e23, value: t12 }), W10 = true, H10({ content: { json: t12 }, path: e23, onPatch: ve2.onPatch, onClose: function() { + W10 = false, vt2(); + } }); + }(e21, t11) : J10(RE(e21, true)); + } + } + function Ee2() { + if (!b10 && pE(X10.selection)) { + var e21 = JE(X10.selection), t11 = Zs(e21), n11 = Ws(l10, e21), r11 = !oE(n11, X10.enforceStringMap, t11, $10), i11 = r11 ? String(n11) : ru(String(n11), $10); + o10("handleToggleEnforceString", { enforceString: r11, value: n11, updatedValue: i11 }), ot2([{ op: "replace", path: t11, value: i11 }], function(e23, n12) { + return { state: UM(n12, t11, r11) }; + }); + } + } + function Ae2() { + return Pe2.apply(this, arguments); + } + function Pe2() { + return Pe2 = xo(ko().mark(function e21() { + var t11, n11 = arguments; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return t11 = !(n11.length > 0 && void 0 !== n11[0]) || n11[0], e23.next = 3, zB({ json: l10, documentState: X10, indentation: t11 ? A10 : void 0, readOnly: b10, parser: $10, onPatch: ot2 }); + case 3: + case "end": + return e23.stop(); + } + }, e21); + })), Pe2.apply(this, arguments); + } + function Te2() { + return Re2.apply(this, arguments); + } + function Re2() { + return Re2 = xo(ko().mark(function e21() { + var t11, n11 = arguments; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (t11 = !(n11.length > 0 && void 0 !== n11[0]) || n11[0], void 0 !== l10) { + e23.next = 3; + break; + } + return e23.abrupt("return"); + case 3: + return e23.next = 5, LB({ json: l10, documentState: X10, indentation: t11 ? A10 : void 0, parser: $10 }); + case 5: + case "end": + return e23.stop(); + } + }, e21); + })), Re2.apply(this, arguments); + } + function Ne2() { + f10(nI, {}, Ro(Ro({}, gs), {}, { styleWindow: { width: "450px" } }), { onClose: function() { + return vt2(); + } }); + } + function Ie2(e21, t11) { + f10(HI, { text: e21, onParse: function(e23) { + return L_(e23, function(e24) { + return z_(e24, $10); + }); + }, onRepair: F_, onApply: t11 }, Ro(Ro({}, gs), {}, { styleWindow: { width: "600px", height: "500px" }, styleContent: { padding: 0, height: "100%" } }), { onClose: function() { + return vt2(); + } }); + } + function De2() { + HB({ json: l10, text: u10, documentState: X10, keepSelection: false, readOnly: b10, onChange: T8, onPatch: ot2 }); + } + function qe2() { + !b10 && void 0 !== l10 && X10.selection && BE(X10.selection) && !_w(JE(X10.selection)) && (o10("duplicate", { selection: X10.selection }), ot2(sA(l10, kE(l10, X10.selection)))); + } + function ze2() { + if (!b10 && X10.selection && (mE(X10.selection) || pE(X10.selection)) && !_w(JE(X10.selection))) { + o10("extract", { selection: X10.selection }); + var e21 = function(e23, t11) { + if (pE(t11)) + return [{ op: "move", from: Zs(t11.path), path: "" }]; + if (!mE(t11)) + throw new Error("Cannot create extract operations: parent must be an Object or Array"); + var n11 = Ws(e23, Qk(t11.focusPath)); + if (Ts(n11)) + return [{ op: "replace", path: "", value: kE(e23, t11).map(function(e24) { + var t12 = Ul(vb(e24)); + return n11[t12]; + }) }]; + if (Rs(n11)) { + var r11 = {}; + return kE(e23, t11).forEach(function(e24) { + var t12 = String(vb(e24)); + r11[t12] = n11[t12]; + }), [{ op: "replace", path: "", value: r11 }]; + } + throw new Error("Cannot extract: unsupported type of selection " + JSON.stringify(t11)); + }(l10, X10.selection); + ot2(e21, function(e23, t11) { + if (Ql(e23)) { + return { state: lE(e23, t11, []) }; + } + }); + } + } + function Be2(e21) { + void 0 !== l10 && GB({ insertType: e21, selectInside: true, refJsonEditor: c10, json: l10, selection: X10.selection, readOnly: b10, parser: $10, onPatch: ot2, onReplaceJson: it2 }); + } + function Le2(e21) { + vE(X10.selection) && J10(RE(X10.selection.path, false)), X10.selection || J10($E(l10, X10)), Be2(e21); + } + function Fe2(e21) { + if (!b10 && X10.selection) + if (LE(X10.selection)) + try { + var t11 = KE(X10.selection), n11 = Ws(l10, t11), r11 = function(e23, t12, n12) { + if ("array" === t12) { + if (Array.isArray(e23)) + return e23; + if (Gl(e23)) + return D_(e23); + if ("string" == typeof e23) + try { + var r12 = n12.parse(e23); + if (Array.isArray(r12)) + return r12; + if (Gl(r12)) + return D_(r12); + } catch (t13) { + return [e23]; + } + return [e23]; + } + if ("object" === t12) { + if (Array.isArray(e23)) + return I_(e23); + if (Gl(e23)) + return e23; + if ("string" == typeof e23) + try { + var o11 = n12.parse(e23); + if (Gl(o11)) + return o11; + if (Array.isArray(o11)) + return I_(o11); + } catch (t13) { + return { value: e23 }; + } + return { value: e23 }; + } + if ("value" === t12) + return Ql(e23) ? n12.stringify(e23) : e23; + throw new Error("Cannot convert ".concat(eu(e23, n12), " to ").concat(t12)); + }(n11, e21, $10); + if (r11 === n11) + return; + var i11 = [{ op: "replace", path: Zs(t11), value: r11 }]; + o10("handleConvert", { selection: X10.selection, path: t11, type: e21, operations: i11 }), ot2(i11, function(e23, t12) { + return { state: X10.selection ? lE(e23, t12, JE(X10.selection)) : X10 }; + }); + } catch (e23) { + P10(e23); + } + else + P10(new Error("Cannot convert current selection to ".concat(e21))); + } + function Ve2() { + if (X10.selection) { + var e21 = SE(l10, X10, false), t11 = Qk(JE(X10.selection)); + e21 && !_w(JE(e21)) && Ow(t11, Qk(JE(e21))) ? J10(IE(JE(e21))) : J10(NE(t11)), o10("insert before", { selection: X10.selection, selectionBefore: e21, parentPath: t11 }), ca().then(function() { + return dt2(); + }); + } + } + function He2() { + if (X10.selection) { + var e21 = jE(l10, X10.selection); + o10("insert after", e21), J10(IE(e21)), ca().then(function() { + return dt2(); + }); + } + } + function We2(e21) { + return Ue2.apply(this, arguments); + } + function Ue2() { + return (Ue2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, QB({ char: t11, selectInside: true, refJsonEditor: c10, json: l10, selection: X10.selection, readOnly: b10, parser: $10, onPatch: ot2, onReplaceJson: it2, onSelect: J10 }); + case 2: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function Je2() { + if (!b10 && fe2.getState().canUndo) { + var e21 = fe2.undo(); + if (e21) { + var t11 = { json: l10, text: u10 }; + n10(11, l10 = e21.undo.patch ? rc(l10, e21.undo.patch) : e21.undo.json), n10(12, X10 = e21.undo.state), n10(17, u10 = e21.undo.text), n10(24, me2 = e21.undo.textIsRepaired), U10 = void 0, o10("undo", { item: e21, json: l10, documentState: X10 }), rt2(t11, e21.undo.patch && e21.redo.patch ? { json: l10, previousJson: t11.json, redo: e21.undo.patch, undo: e21.redo.patch } : null), vt2(), X10.selection && Ze2(JE(X10.selection), false); + } + } + } + function Ke2() { + if (!b10 && fe2.getState().canRedo) { + var e21 = fe2.redo(); + if (e21) { + var t11 = { json: l10, text: u10 }; + n10(11, l10 = e21.redo.patch ? rc(l10, e21.redo.patch) : e21.redo.json), n10(12, X10 = e21.redo.state), n10(17, u10 = e21.redo.text), n10(24, me2 = e21.redo.textIsRepaired), U10 = void 0, o10("redo", { item: e21, json: l10, documentState: X10 }), rt2(t11, e21.undo.patch && e21.redo.patch ? { json: l10, previousJson: t11.json, redo: e21.redo.patch, undo: e21.undo.patch } : null), vt2(), X10.selection && Ze2(JE(X10.selection), false); + } + } + } + function Ge2(e21) { + var t11; + b10 || void 0 === l10 || (W10 = true, F10({ id: d10, json: l10, rootPath: e21, onSort: (t11 = xo(ko().mark(function t12(n11) { + var r11; + return ko().wrap(function(t13) { + for (; ; ) + switch (t13.prev = t13.next) { + case 0: + r11 = n11.operations, o10("onSort", e21, r11), ot2(r11, function(t14, n12) { + return { state: Ro(Ro({}, lE(t14, n12, e21)), {}, { selection: RE(e21, false) }) }; + }); + case 3: + case "end": + return t13.stop(); + } + }, t12); + })), function(e23) { + return t11.apply(this, arguments); + }), onClose: function() { + W10 = false, vt2(); + } })); + } + function Qe2() { + X10.selection && Ge2(EE(l10, X10.selection)); + } + function Ye2(e21) { + if (void 0 !== l10) { + var t11 = e21.id, n11 = e21.onTransform, r11 = e21.onClose, i11 = e21.rootPath || []; + W10 = true, V10({ id: t11 || h10, json: l10, rootPath: i11, onTransform: function(e23) { + n11 ? n11({ operations: e23, json: l10, transformedJson: rc(l10, e23) }) : (o10("onTransform", i11, e23), ot2(e23, function(e24, t12) { + return { state: Ro(Ro({}, lE(e24, t12, i11)), {}, { selection: RE(i11, false) }) }; + })); + }, onClose: function() { + W10 = false, vt2(), r11 && r11(); + } }); + } + } + function Xe2() { + X10.selection && Ye2({ rootPath: EE(l10, X10.selection) }); + } + function Ze2(e21) { + return et2.apply(this, arguments); + } + function et2() { + return et2 = xo(ko().mark(function e21(t11) { + var r11, i11, s11, c11, u11, f11 = arguments; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return r11 = !(f11.length > 1 && void 0 !== f11[1]) || f11[1], n10(12, X10 = VM(l10, X10, t11)), e23.next = 4, ca(); + case 4: + if (i11 = tt2(t11), o10("scrollTo", { path: t11, elem: i11, refContents: a10 }), i11 && a10) { + e23.next = 8; + break; + } + return e23.abrupt("return", Promise.resolve()); + case 8: + if (s11 = a10.getBoundingClientRect(), c11 = i11.getBoundingClientRect(), r11) { + e23.next = 13; + break; + } + if (!(c11.bottom > s11.top && c11.top < s11.bottom)) { + e23.next = 13; + break; + } + return e23.abrupt("return", Promise.resolve()); + case 13: + return u11 = -s11.height / 4, e23.abrupt("return", new Promise(function(e24) { + y10(i11, { container: a10, offset: u11, duration: 300, callback: function() { + return e24(); + } }); + })); + case 15: + case "end": + return e23.stop(); + } + }, e21); + })), et2.apply(this, arguments); + } + function tt2(e21) { + return a10 ? a10.querySelector('div[data-path="'.concat(OO(e21), '"]')) : null; + } + function nt2(e21) { + var t11 = tt2(e21); + if (t11 && a10) { + var n11 = a10.getBoundingClientRect(), r11 = t11.getBoundingClientRect(), o11 = Ql(Ws(l10, e21)) ? 20 : r11.height; + r11.top < n11.top + 20 ? y10(t11, { container: a10, offset: -20, duration: 0 }) : r11.top + o11 > n11.bottom - 20 && y10(t11, { container: a10, offset: -(n11.height - o11 - 20), duration: 0 }); + } + } + function rt2(e21, t11) { + var n11; + if (void 0 !== e21.json || void 0 !== (null == e21 ? void 0 : e21.text)) { + if (void 0 !== u10) + null === (n11 = T8) || void 0 === n11 || n11({ text: u10, json: void 0 }, e21, { contentErrors: ke2(), patchResult: t11 }); + else if (void 0 !== l10) { + var r11; + null === (r11 = T8) || void 0 === r11 || r11({ text: void 0, json: l10 }, e21, { contentErrors: ke2(), patchResult: t11 }); + } + } + } + function ot2(e21, t11) { + return b10 ? { json: l10, previousJson: l10, undo: [], redo: [] } : (o10("handlePatch", e21, t11), _e2(e21, t11)); + } + function it2(e21, t11) { + var r11 = X10, o11 = l10, i11 = u10, a11 = { json: l10, text: u10 }, s11 = me2, c11 = HM(l10, X10, [], uE), f11 = "function" == typeof t11 ? t11(e21, c11) : void 0; + n10(11, l10 = f11 && void 0 !== f11.json ? f11.json : e21), n10(12, X10 = f11 && void 0 !== f11.state ? f11.state : c11), n10(17, u10 = void 0), n10(24, me2 = false), U10 = void 0, Ce2(l10), $e2({ previousJson: o11, previousState: r11, previousText: i11, previousTextIsRepaired: s11 }); + rt2(a11, null); + } + function at2(e21, t11) { + o10("handleChangeText"); + var r11 = X10, i11 = l10, a11 = u10, s11 = { json: l10, text: u10 }, c11 = me2; + try { + n10(11, l10 = _10(e21)), n10(12, X10 = HM(l10, X10, [], uE)), n10(17, u10 = void 0), n10(24, me2 = false), U10 = void 0; + } catch (t12) { + try { + n10(11, l10 = _10(Hl(e21))), n10(12, X10 = HM(l10, X10, [], uE)), n10(17, u10 = e21), n10(24, me2 = true), U10 = void 0; + } catch (r12) { + n10(11, l10 = void 0), n10(12, X10 = BM({ json: l10, expand: uE })), n10(17, u10 = e21), n10(24, me2 = false), U10 = "" !== u10 ? H_(u10, t12.message || String(t12)) : void 0; + } + } + if ("function" == typeof t11) { + var f11 = t11(l10, X10); + n10(11, l10 = f11 && f11.json ? f11.json : l10), n10(12, X10 = f11 && f11.state ? f11.state : X10); + } + Ce2(l10), $e2({ previousJson: i11, previousState: r11, previousText: a11, previousTextIsRepaired: c11 }); + rt2(s11, null); + } + function st2(e21, t11) { + var r11 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + o10("expand", { path: e21, expanded: t11, recursive: r11 }), n10(12, X10 = t11 ? r11 ? HM(l10, X10, e21, fE) : function(e23, t12) { + return Ro(Ro({}, e23), {}, { expandedMap: Ro(Ro({}, e23.expandedMap), {}, qo({}, Zs(t12), true)) }); + }(X10, e21) : WM(X10, e21)), X10.selection && !t11 && function(e23, t12) { + return AE(JE(e23), t12) && (JE(e23).length > t12.length || hE(e23)); + }(X10.selection, e21) && J10(null), vt2(); + } + function ct2(e21) { + o10("openFind", { findAndReplace: e21 }), n10(20, Z10 = false), n10(21, ee2 = false), ca().then(function() { + n10(20, Z10 = true), n10(21, ee2 = e21); + }); + } + function lt2(e21, t11) { + o10("handleExpandSection", e21, t11); + var r11 = Zs(e21); + n10(12, X10 = function(e23, t12, n11, r12) { + return Ro(Ro({}, t12), {}, { visibleSectionsMap: Ro(Ro({}, t12.visibleSectionsMap), {}, qo({}, n11, IM(LM(t12, n11).concat(r12)))) }); + }(0, X10, r11, t11)); + } + function ut2(e21) { + o10("pasted json as text", e21), n10(19, Q10 = e21); + } + function ft2(e21) { + var t11 = e21.anchor, n11 = e21.left, r11 = e21.top, o11 = e21.width, i11 = e21.height, a11 = e21.offsetTop, s11 = e21.offsetLeft, c11 = e21.showTip; + W10 = true; + var u11 = p10(LD, { json: l10, documentState: X10, parser: $10, showTip: c11, onEditKey: Oe2, onEditValue: Me2, onToggleEnforceString: Ee2, onCut: Ae2, onCopy: Te2, onPaste: Ne2, onRemove: De2, onDuplicate: qe2, onExtract: ze2, onInsertBefore: Ve2, onInsert: Le2, onConvert: Fe2, onInsertAfter: He2, onSort: Qe2, onTransform: Xe2, onRenderContextMenu: q10, onCloseContextMenu: function() { + m10(u11), vt2(); + } }, { left: n11, top: r11, offsetTop: a11, offsetLeft: s11, width: o11, height: i11, anchor: t11, closeOnOuterClick: true, onClose: function() { + W10 = false, vt2(); + } }); + } + function dt2(e21) { + if (!b10 && !zE(X10.selection)) { + if (e21 && (e21.stopPropagation(), e21.preventDefault()), e21 && "contextmenu" === e21.type && e21.target !== s10) + ft2({ left: e21.clientX, top: e21.clientY, width: Ms, height: Os, showTip: false }); + else { + var t11, n11 = null === (t11 = a10) || void 0 === t11 ? void 0 : t11.querySelector(".jse-context-menu-pointer.jse-selected"); + if (n11) + ft2({ anchor: n11, offsetTop: 2, width: Ms, height: Os, showTip: false }); + else { + var r11, o11 = null === (r11 = a10) || void 0 === r11 ? void 0 : r11.getBoundingClientRect(); + o11 && ft2({ top: o11.top + 2, left: o11.left + 2, width: Ms, height: Os, showTip: false }); + } + } + return false; + } + } + function ht2() { + return (ht2 = xo(ko().mark(function e21() { + var t11, r11, i11, s11, c11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (o10("apply pasted json", Q10), Q10) { + e23.next = 3; + break; + } + return e23.abrupt("return"); + case 3: + i11 = (r11 = Q10).path, s11 = r11.contents, n10(19, Q10 = void 0), AO(c11 = (null === (t11 = a10) || void 0 === t11 ? void 0 : t11.querySelector(".jse-editable-div")) || null) && c11.cancel(), ot2([{ op: "replace", path: Zs(i11), value: s11 }], function(e24, t12) { + return { state: lE(e24, t12, i11) }; + }), setTimeout(vt2); + case 10: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function vt2() { + o10("focus"), s10 && (s10.focus(), s10.select()); + } + function pt2(e21) { + return function(e23, t11, n11) { + var r11 = Qk(n11), o11 = [vb(n11)], i11 = Ws(e23, r11), a11 = i11 ? cE(i11, t11, o11) : void 0; + return a11 ? RE(r11.concat(a11), false) : IE(n11); + }(l10, X10, e21); + } + function mt2(e21) { + r10 && r10.onDrag(e21); + } + function gt2() { + r10 && r10.onDragEnd(); + } + return e20.$$set = function(e21) { + "readOnly" in e21 && n10(0, b10 = e21.readOnly), "externalContent" in e21 && n10(52, k10 = e21.externalContent), "externalSelection" in e21 && n10(53, w10 = e21.externalSelection), "mainMenuBar" in e21 && n10(1, x10 = e21.mainMenuBar), "navigationBar" in e21 && n10(2, j10 = e21.navigationBar), "escapeControlCharacters" in e21 && n10(54, S10 = e21.escapeControlCharacters), "escapeUnicodeCharacters" in e21 && n10(55, C10 = e21.escapeUnicodeCharacters), "parser" in e21 && n10(3, $10 = e21.parser), "parseMemoizeOne" in e21 && n10(56, _10 = e21.parseMemoizeOne), "validator" in e21 && n10(57, O10 = e21.validator), "validationParser" in e21 && n10(58, M10 = e21.validationParser), "pathParser" in e21 && n10(4, E10 = e21.pathParser), "indentation" in e21 && n10(5, A10 = e21.indentation), "onError" in e21 && n10(6, P10 = e21.onError), "onChange" in e21 && n10(59, T8 = e21.onChange), "onChangeMode" in e21 && n10(60, R8 = e21.onChangeMode), "onSelect" in e21 && n10(61, N8 = e21.onSelect), "onRenderValue" in e21 && n10(62, I10 = e21.onRenderValue), "onRenderMenu" in e21 && n10(7, D10 = e21.onRenderMenu), "onRenderContextMenu" in e21 && n10(63, q10 = e21.onRenderContextMenu), "onClassName" in e21 && n10(64, z10 = e21.onClassName), "onFocus" in e21 && n10(65, B10 = e21.onFocus), "onBlur" in e21 && n10(66, L10 = e21.onBlur), "onSortModal" in e21 && n10(67, F10 = e21.onSortModal), "onTransformModal" in e21 && n10(68, V10 = e21.onTransformModal), "onJSONEditorModal" in e21 && n10(69, H10 = e21.onJSONEditorModal); + }, e20.$$.update = function() { + 25165824 & e20.$$.dirty[1] && n10(77, G10 = aO({ escapeControlCharacters: S10, escapeUnicodeCharacters: C10 })), 4096 & e20.$$.dirty[0] && o10("selection", X10.selection), 2097152 & e20.$$.dirty[1] && je2(k10), 4194304 & e20.$$.dirty[1] && function(e21) { + Ow(X10.selection, e21) || (o10("applyExternalSelection", e21), (yE(e21) || null === e21) && J10(e21)); + }(w10), 2048 & e20.$$.dirty[0] | 65536 & e20.$$.dirty[2] && pe2(ne2, l10), 2056 & e20.$$.dirty[0] | 201326592 & e20.$$.dirty[1] && be2(l10, O10, $10, M10), 8192 & e20.$$.dirty[0] && n10(25, he2 = function(e21) { + var t11 = {}; + return e21.forEach(function(e23) { + t11[Zs(e23.path)] = e23; + }), e21.forEach(function(e23) { + for (var n11 = e23.path; n11.length > 0; ) { + var r11 = Zs(n11 = Qk(n11)); + r11 in t11 || (t11[r11] = { isChildError: true, path: n11, message: "Contains invalid data", severity: Za.warning }); + } + }), t11; + }(ge2)), 1024 & e20.$$.dirty[0] && (r10 = a10 ? function(e21) { + var t11, n11; + function r11(e23) { + return e23 < 20 ? is : e23 < 50 ? as : ss; + } + function o11() { + if (e21) { + var n12 = (t11 || 0) * (os / 1e3); + e21.scrollTop += n12; + } + } + function i11(e23) { + n11 && e23 === t11 || (a11(), gN("startAutoScroll", e23), t11 = e23, n11 = setInterval(o11, os)); + } + function a11() { + n11 && (gN("stopAutoScroll"), clearInterval(n11), n11 = void 0, t11 = void 0); + } + return gN("createAutoScrollHandler", e21), { onDrag: function(t12) { + if (e21) { + var n12 = t12.clientY, o12 = e21.getBoundingClientRect(), s11 = o12.top, c11 = o12.bottom; + n12 < s11 ? i11(-r11(s11 - n12)) : n12 > c11 ? i11(r11(n12 - c11)) : a11(); + } + }, onDragEnd: function() { + a11(); + } }; + }(a10) : void 0), 9 & e20.$$.dirty[0] | 32773 & e20.$$.dirty[2] && n10(14, ve2 = { readOnly: b10, parser: $10, normalization: G10, getJson: we2, getDocumentState: xe2, findElement: tt2, findNextInside: pt2, focus: vt2, onPatch: ot2, onInsert: Be2, onExpand: st2, onSelect: J10, onFind: ct2, onExpandSection: lt2, onPasteJson: ut2, onRenderValue: I10, onContextMenu: ft2, onClassName: z10 || function() { + }, onDrag: mt2, onDragEnd: gt2 }), 16384 & e20.$$.dirty[0] && o10("context changed", ve2); + }, [b10, x10, j10, $10, E10, A10, P10, D10, function() { + return me2 && void 0 !== l10 && it2(l10), void 0 !== l10 ? { json: l10 } : { text: u10 || "" }; + }, vt2, a10, l10, X10, ge2, ve2, s10, c10, u10, K10, Q10, Z10, ee2, te2, de2, me2, he2, i10, re2, function() { + return ie2.apply(this, arguments); + }, function() { + return ae2.apply(this, arguments); + }, function(e21, t11) { + return se2.apply(this, arguments); + }, function(e21, t11) { + return ce2.apply(this, arguments); + }, function() { + n10(20, Z10 = false), n10(21, ee2 = false), re2(""), vt2(); + }, function(e21) { + o10("select validation error", e21), J10(RE(e21.path, false)), Ze2(e21.path); + }, Te2, function(e21) { + var t11; + e21.preventDefault(); + var n11 = null === (t11 = e21.clipboardData) || void 0 === t11 ? void 0 : t11.getData("text/plain"); + void 0 !== n11 && VB({ clipboardText: n11, json: l10, selection: X10.selection, readOnly: b10, parser: $10, onPatch: ot2, onChangeText: at2, openRepairModal: Ie2 }); + }, We2, Je2, Ke2, function() { + Ge2([]); + }, function() { + Ye2({ rootPath: [] }); + }, function() { + st2([], true, true); + }, function() { + st2([], false, true); + }, function(e21) { + var t11 = PO(e21), n11 = e21.shiftKey; + if (o10("keydown", { combo: t11, key: e21.key }), "Ctrl+X" === t11 && (e21.preventDefault(), Ae2(true)), "Ctrl+Shift+X" === t11 && (e21.preventDefault(), Ae2(false)), "Ctrl+C" === t11 && (e21.preventDefault(), Te2(true)), "Ctrl+Shift+C" === t11 && (e21.preventDefault(), Te2(false)), "Ctrl+D" === t11 && (e21.preventDefault(), qe2()), "Delete" !== t11 && "Backspace" !== t11 || (e21.preventDefault(), De2()), "Insert" === t11 && (e21.preventDefault(), Be2("structure")), "Ctrl+A" === t11 && (e21.preventDefault(), J10(RE([], false))), "Ctrl+Q" === t11 && dt2(e21), "ArrowUp" === t11 || "Shift+ArrowUp" === t11) { + e21.preventDefault(); + var r11 = X10.selection ? SE(l10, X10, n11) || X10.selection : $E(l10, X10); + J10(r11), nt2(JE(r11)); + } + if ("ArrowDown" === t11 || "Shift+ArrowDown" === t11) { + e21.preventDefault(); + var i11 = X10.selection ? function(e23, t12) { + var n12 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r12 = t12.selection; + if (!r12) + return null; + var o11 = n12 ? JE(r12) : jE(e23, r12), i12 = Ql(Ws(e23, o11)) ? WM(t12, o11) : t12, a12 = cE(e23, t12, o11), s12 = cE(e23, i12, o11); + if (n12) + return hE(r12) ? null !== a12 ? DE(a12, a12) : null : dE(r12) ? null !== s12 ? DE(s12, s12) : null : null !== s12 ? DE(KE(r12), s12) : null; + if (dE(r12)) + return null !== s12 ? RE(s12, false) : null; + if (hE(r12)) + return null !== a12 ? RE(a12, false) : null; + if (pE(r12)) + return null !== a12 ? RE(a12, false) : null; + if (vE(r12)) { + if (null === a12 || 0 === a12.length) + return null; + var c12 = Ws(e23, Qk(a12)); + return Array.isArray(c12) ? RE(a12, false) : TE(a12, false); + } + return mE(r12) ? null !== s12 ? RE(s12, false) : null !== a12 ? RE(a12, false) : null : null; + }(l10, X10, n11) || X10.selection : $E(l10, X10); + J10(i11), nt2(JE(i11)); + } + if ("ArrowLeft" === t11 || "Shift+ArrowLeft" === t11) { + e21.preventDefault(); + var a11 = X10.selection ? function(e23, t12) { + var n12 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r12 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], o11 = t12.selection; + if (!o11) + return null; + var i12 = CE(e23, t12, r12), a12 = i12.caret, s12 = i12.previous; + if (n12) + return mE(o11) ? null : DE(o11.path, o11.path); + if (a12 && s12) + return FE(s12); + var c12 = Ws(e23, Qk(JE(o11))); + return pE(o11) && Array.isArray(c12) ? DE(o11.path, o11.path) : mE(o11) && !Array.isArray(c12) ? TE(o11.focusPath, false) : null; + }(l10, X10, n11, !b10) || X10.selection : $E(l10, X10); + J10(a11), nt2(JE(a11)); + } + if ("ArrowRight" === t11 || "Shift+ArrowRight" === t11) { + e21.preventDefault(); + var s11 = X10.selection && void 0 !== l10 ? function(e23, t12) { + var n12 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r12 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], o11 = t12.selection; + if (!o11) + return null; + var i12 = CE(e23, t12, r12), a12 = i12.caret, s12 = i12.next; + return n12 ? mE(o11) ? null : DE(o11.path, o11.path) : a12 && s12 ? FE(s12) : mE(o11) ? RE(o11.focusPath, false) : null; + }(l10, X10, n11, !b10) || X10.selection : $E(l10, X10); + J10(s11), nt2(JE(s11)); + } + if ("Enter" === t11 && X10.selection) { + if (gE(X10.selection)) { + var c11 = X10.selection.focusPath, u11 = Ws(l10, Qk(c11)); + Array.isArray(u11) && J10(RE(c11, false)); + } + if (vE(X10.selection) && (e21.preventDefault(), J10(Ro(Ro({}, X10.selection), {}, { edit: true }))), pE(X10.selection)) + e21.preventDefault(), Ql(Ws(l10, X10.selection.path)) ? st2(X10.selection.path, true) : J10(Ro(Ro({}, X10.selection), {}, { edit: true })); + } + if (1 === t11.replace(/^Shift\+/, "").length && X10.selection) + return e21.preventDefault(), void We2(e21.key); + if ("Enter" === t11 && (dE(X10.selection) || hE(X10.selection))) + return e21.preventDefault(), void We2(""); + if ("Ctrl+Enter" === t11 && pE(X10.selection)) { + var f11 = Ws(l10, X10.selection.path); + nu(f11) && window.open(String(f11), "_blank"); + } + "Escape" === t11 && X10.selection && (e21.preventDefault(), J10(null)), "Ctrl+F" === t11 && (e21.preventDefault(), ct2(false)), "Ctrl+H" === t11 && (e21.preventDefault(), ct2(true)), "Ctrl+Z" === t11 && (e21.preventDefault(), Je2()), "Ctrl+Shift+Z" === t11 && (e21.preventDefault(), Ke2()); + }, function(e21) { + o10("handleMouseDown", e21); + var t11 = e21.target; + yO(t11, "BUTTON") || t11.isContentEditable || (vt2(), X10.selection || void 0 !== l10 || "" !== u10 && void 0 !== u10 || (o10("createDefaultSelection"), n10(12, X10 = Ro(Ro({}, X10), {}, { selection: RE([], false) })))); + }, dt2, function(e21) { + b10 || ft2({ anchor: $O(e21.target, "BUTTON"), offsetTop: 0, width: Ms, height: Os, showTip: true }); + }, function() { + return ht2.apply(this, arguments); + }, function() { + o10("clear pasted json"), n10(19, Q10 = void 0), vt2(); + }, function() { + R8(Qa.text); + }, function(e21) { + J10(e21), vt2(), Ze2(JE(e21)); + }, function(e21) { + var t11 = !kO(e21.target, function(e23) { + return e23 === c10; + }); + t11 && zE(X10.selection) && (o10("click outside the editor, stop edit mode"), J10(function(e23) { + return vE(e23) || pE(e23) ? Ro(Ro({}, e23), {}, { edit: false }) : e23; + }), g10 && s10 && (s10.focus(), s10.blur()), o10("blur (outside editor)"), s10 && s10.blur()); + }, k10, w10, S10, C10, _10, O10, M10, T8, R8, N8, I10, q10, z10, B10, L10, F10, V10, H10, function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : fE; + o10("expand"); + var t11 = Ro(Ro({}, X10), {}, { expandedMap: {}, visibleSectionsMap: {} }); + n10(12, X10 = HM(l10, t11, [], e21)); + }, ke2, we2, _e2, Ye2, Ze2, tt2, G10, ne2, function(e21) { + n10(20, Z10 = e21); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(15, s10 = e21); + }); + }, function() { + vt2(), We2("{"); + }, function() { + vt2(), We2("["); + }, function() { + vt2(); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(10, a10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(16, c10 = e21); + }); + }]; + } + var kL = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, bL, yL, Zo, { readOnly: 0, externalContent: 52, externalSelection: 53, mainMenuBar: 1, navigationBar: 2, escapeControlCharacters: 54, escapeUnicodeCharacters: 55, parser: 3, parseMemoizeOne: 56, validator: 57, validationParser: 58, pathParser: 4, indentation: 5, onError: 6, onChange: 59, onChangeMode: 60, onSelect: 61, onRenderValue: 62, onRenderMenu: 7, onRenderContextMenu: 63, onClassName: 64, onFocus: 65, onBlur: 66, onSortModal: 67, onTransformModal: 68, onJSONEditorModal: 69, expand: 70, validate: 71, getJson: 72, patch: 73, acceptAutoRepair: 8, openTransformModal: 74, scrollTo: 75, findElement: 76, focus: 9 }, sL, [-1, -1, -1, -1, -1]), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "expand", get: function() { + return this.$$.ctx[70]; + } }, { key: "validate", get: function() { + return this.$$.ctx[71]; + } }, { key: "getJson", get: function() { + return this.$$.ctx[72]; + } }, { key: "patch", get: function() { + return this.$$.ctx[73]; + } }, { key: "acceptAutoRepair", get: function() { + return this.$$.ctx[8]; + } }, { key: "openTransformModal", get: function() { + return this.$$.ctx[74]; + } }, { key: "scrollTo", get: function() { + return this.$$.ctx[75]; + } }, { key: "findElement", get: function() { + return this.$$.ctx[76]; + } }, { key: "focus", get: function() { + return this.$$.ctx[9]; + } }]), t10; + }(); + function wL(e20) { + mi(e20, "svelte-l4qqoi", '.jse-modal.svelte-l4qqoi.svelte-l4qqoi{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-l4qqoi .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-l4qqoi .jse-modal-contents.svelte-l4qqoi{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-l4qqoi .jse-modal-contents .jse-actions.svelte-l4qqoi{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-l4qqoi .jse-modal-contents .jse-actions button.jse-primary.svelte-l4qqoi{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-l4qqoi .jse-modal-contents .jse-actions button.jse-primary.svelte-l4qqoi:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-l4qqoi .jse-modal-contents .jse-actions button.jse-primary.svelte-l4qqoi:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;height:auto;min-height:500px;max-height:calc(100vh - 6rem);display:flex}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents.svelte-l4qqoi{color:inherit;min-height:0;padding:0}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents.svelte-l4qqoi{flex:1;display:flex;gap:calc(2 * var(--jse-padding, 10px));min-height:0;box-sizing:border-box;padding:0 calc(2 * var(--jse-padding, 10px)) var(--jse-padding, 10px)}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents.svelte-l4qqoi{flex:1;display:flex;flex-direction:column}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-l4qqoi p{margin:var(--jse-padding, 10px) 0}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-l4qqoi p:first-child{margin-top:0}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-l4qqoi p:last-child{margin-bottom:0}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-l4qqoi code{background:var(--jse-modal-code-background, rgba(0, 0, 0, 0.05));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px)}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-l4qqoi{flex:1;outline:none;resize:vertical}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-l4qqoi{flex:1;display:flex;flex-direction:column;gap:calc(2 * var(--jse-padding, 10px))}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.svelte-l4qqoi{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.jse-hide.svelte-l4qqoi{flex:none}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-data-contents .jse-preview-data.svelte-l4qqoi{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-data-contents.jse-hide-original-data.svelte-l4qqoi{flex-direction:column;gap:0;margin-bottom:0}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-actions.svelte-l4qqoi{padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px)) calc(2 * var(--jse-padding, 10px))}@media screen and (max-width: 1200px){.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents.svelte-l4qqoi{flex-direction:column;overflow:auto}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-l4qqoi{min-height:150px;flex:none}.jse-modal.jse-transform.svelte-l4qqoi .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-l4qqoi .jse-tree-mode{height:300px;flex:none}}.jse-modal.jse-transform.svelte-l4qqoi .jse-label.svelte-l4qqoi{font-weight:bold;display:block;box-sizing:border-box}.jse-modal.jse-transform.svelte-l4qqoi .jse-label .jse-label-inner.svelte-l4qqoi{margin-top:calc(2 * var(--jse-padding, 10px));margin-bottom:calc(0.5 * var(--jse-padding, 10px));box-sizing:border-box}.jse-modal.jse-transform.svelte-l4qqoi .jse-label .jse-label-inner button.svelte-l4qqoi{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;font-weight:bold;padding:0}.jse-modal.jse-transform.svelte-l4qqoi .jse-tree-mode{flex:1;background:var(--jse-input-background-readonly, transparent);box-shadow:none;box-sizing:border-box;--jse-main-border:var(--jse-input-border, 1px solid #d8dbdf)}.jse-modal.jse-transform.svelte-l4qqoi input.svelte-l4qqoi,.jse-modal.jse-transform.svelte-l4qqoi textarea.svelte-l4qqoi{border:var(--jse-input-border, 1px solid #d8dbdf);outline:none;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding, 10px));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:inherit;background:var(--jse-input-background, var(--jse-background-color, #fff))}.jse-modal.jse-transform.svelte-l4qqoi input.svelte-l4qqoi:focus,.jse-modal.jse-transform.svelte-l4qqoi textarea.svelte-l4qqoi:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}.jse-modal.jse-transform.svelte-l4qqoi input.svelte-l4qqoi:read-only,.jse-modal.jse-transform.svelte-l4qqoi textarea.svelte-l4qqoi:read-only{background:var(--jse-input-background-readonly, transparent)}.jse-modal.jse-transform.svelte-l4qqoi .jse-preview.jse-error.svelte-l4qqoi{flex:1;background:var(--jse-input-background-readonly, transparent);border:var(--jse-input-border, 1px solid #d8dbdf);color:var(--jse-error-color, #ee5341);padding:calc(0.5 * var(--jse-padding, 10px))}.jse-modal.jse-transform.svelte-l4qqoi a{color:var(--jse-a-color, #156fc5)}.jse-modal.jse-transform.svelte-l4qqoi a:hover{color:var(--jse-a-color-highlight, #0f508d)}'); + } + function xL(e20) { + var t10, n10, r10, o10, i10, a10 = [SL, jL], s10 = []; + function c10(e21, n11) { + return 16384 & n11[0] && (t10 = null), null == t10 && (t10 = !!Array.isArray(e21[14])), t10 ? 0 : 1; + } + return n10 = c10(e20, [-1, -1]), r10 = s10[n10] = a10[n10](e20), { c: function() { + r10.c(), o10 = _i(); + }, m: function(e21, t11) { + s10[n10].m(e21, t11), ki(e21, o10, t11), i10 = true; + }, p: function(e21, t11) { + var i11 = n10; + (n10 = c10(e21, t11)) === i11 ? s10[n10].p(e21, t11) : (ba(), xa(s10[i11], 1, 1, function() { + s10[i11] = null; + }), ka(), (r10 = s10[n10]) ? r10.p(e21, t11) : (r10 = s10[n10] = a10[n10](e21)).c(), wa(r10, 1), r10.m(o10.parentNode, o10)); + }, i: function(e21) { + i10 || (wa(r10), i10 = true); + }, o: function(e21) { + xa(r10), i10 = false; + }, d: function(e21) { + e21 && wi(o10), s10[n10].d(e21); + } }; + } + function jL(e20) { + var t10; + return { c: function() { + t10 = Ci("(Only available for arrays, not for objects)"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function SL(e20) { + var t10, n10; + return t10 = new rN({ props: { queryOptions: e20[15], json: e20[14], onChange: e20[24] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 32768 & n11[0] && (r10.queryOptions = e21[15]), 16384 & n11[0] && (r10.json = e21[14]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function CL(e20) { + var t10, n10; + return t10 = new kL({ props: { externalContent: e20[17], externalSelection: null, readOnly: true, mainMenuBar: false, navigationBar: false, indentation: e20[2], escapeControlCharacters: e20[3], escapeUnicodeCharacters: e20[4], parser: e20[5], parseMemoizeOne: e20[6], onRenderValue: e20[10], onRenderMenu: e20[11], onRenderContextMenu: e20[12], onError: console.error, onChange: Mf, onChangeMode: Mf, onSelect: Mf, onFocus: Mf, onBlur: Mf, onSortModal: Mf, onTransformModal: Mf, onJSONEditorModal: Mf, onClassName: e20[13], validator: null, validationParser: e20[7], pathParser: e20[8] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 131072 & n11[0] && (r10.externalContent = e21[17]), 4 & n11[0] && (r10.indentation = e21[2]), 8 & n11[0] && (r10.escapeControlCharacters = e21[3]), 16 & n11[0] && (r10.escapeUnicodeCharacters = e21[4]), 32 & n11[0] && (r10.parser = e21[5]), 64 & n11[0] && (r10.parseMemoizeOne = e21[6]), 1024 & n11[0] && (r10.onRenderValue = e21[10]), 2048 & n11[0] && (r10.onRenderMenu = e21[11]), 4096 & n11[0] && (r10.onRenderContextMenu = e21[12]), 8192 & n11[0] && (r10.onClassName = e21[13]), 128 & n11[0] && (r10.validationParser = e21[7]), 256 & n11[0] && (r10.pathParser = e21[8]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function $L(e20) { + var t10, n10; + return { c: function() { + t10 = ji("div"), n10 = Ci(e20[20]), Ai(t10, "class", "jse-preview jse-error svelte-l4qqoi"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: function(e21, t11) { + 1048576 & t11[0] && Ni(n10, e21[20]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function _L(e20) { + var t10, n10; + return t10 = new kL({ props: { externalContent: e20[21], externalSelection: null, readOnly: true, mainMenuBar: false, navigationBar: false, indentation: e20[2], escapeControlCharacters: e20[3], escapeUnicodeCharacters: e20[4], parser: e20[5], parseMemoizeOne: e20[6], onRenderValue: e20[10], onRenderMenu: e20[11], onRenderContextMenu: e20[12], onError: console.error, onChange: Mf, onChangeMode: Mf, onSelect: Mf, onFocus: Mf, onBlur: Mf, onSortModal: Mf, onTransformModal: Mf, onJSONEditorModal: Mf, onClassName: e20[13], validator: null, validationParser: e20[7], pathParser: e20[8] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 2097152 & n11[0] && (r10.externalContent = e21[21]), 4 & n11[0] && (r10.indentation = e21[2]), 8 & n11[0] && (r10.escapeControlCharacters = e21[3]), 16 & n11[0] && (r10.escapeUnicodeCharacters = e21[4]), 32 & n11[0] && (r10.parser = e21[5]), 64 & n11[0] && (r10.parseMemoizeOne = e21[6]), 1024 & n11[0] && (r10.onRenderValue = e21[10]), 2048 & n11[0] && (r10.onRenderMenu = e21[11]), 4096 & n11[0] && (r10.onRenderContextMenu = e21[12]), 8192 & n11[0] && (r10.onClassName = e21[13]), 128 & n11[0] && (r10.validationParser = e21[7]), 256 & n11[0] && (r10.pathParser = e21[8]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function OL(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10, E10, A10, P10, T8, R8, N8, I10, D10, q10, z10, B10, L10, F10, V10, H10, W10, U10, J10, K10 = e20[23](e20[0]).description + ""; + t10 = new mN({ props: { queryLanguages: e20[9], queryLanguageId: e20[0], onChangeQueryLanguage: e20[29] } }), y10 = new jM({ props: { data: e20[18] ? gP : YA } }); + var G10 = e20[18] && xL(e20); + A10 = new jM({ props: { data: e20[19] ? gP : YA } }); + var Q10 = e20[19] && CL(e20), Y10 = [_L, $L], X10 = []; + function Z10(e21, t11) { + return e21[20] ? 1 : 0; + } + return q10 = Z10(e20), z10 = X10[q10] = Y10[q10](e20), { c: function() { + Pa(t10.$$.fragment), n10 = $i(), r10 = ji("div"), o10 = ji("div"), i10 = ji("div"), (a10 = ji("div")).innerHTML = '
Language
', s10 = $i(), c10 = ji("div"), l10 = $i(), (u10 = ji("div")).innerHTML = '
Path
', f10 = $i(), d10 = ji("input"), v10 = $i(), p10 = ji("div"), m10 = ji("div"), g10 = ji("button"), Pa(y10.$$.fragment), b10 = Ci("\n Wizard"), k10 = $i(), G10 && G10.c(), w10 = $i(), (x10 = ji("div")).innerHTML = '
Query
', j10 = $i(), S10 = ji("textarea"), C10 = $i(), $10 = ji("div"), _10 = ji("div"), O10 = ji("div"), M10 = ji("div"), E10 = ji("button"), Pa(A10.$$.fragment), P10 = Ci("\n Original"), T8 = $i(), Q10 && Q10.c(), R8 = $i(), N8 = ji("div"), (I10 = ji("div")).innerHTML = '
Preview
', D10 = $i(), z10.c(), B10 = $i(), L10 = ji("div"), F10 = ji("button"), V10 = Ci("Transform"), Ai(a10, "class", "jse-label svelte-l4qqoi"), Ai(c10, "class", "jse-description svelte-l4qqoi"), Ai(u10, "class", "jse-label svelte-l4qqoi"), Ai(d10, "class", "jse-path svelte-l4qqoi"), Ai(d10, "type", "text"), d10.readOnly = true, Ai(d10, "title", "Selected path"), d10.value = h10 = _w(e20[1]) ? "(document root)" : JO(e20[1]), Ai(g10, "type", "button"), Ai(g10, "class", "svelte-l4qqoi"), Ai(m10, "class", "jse-label-inner svelte-l4qqoi"), Ai(p10, "class", "jse-label svelte-l4qqoi"), Ai(x10, "class", "jse-label svelte-l4qqoi"), Ai(S10, "class", "jse-query svelte-l4qqoi"), Ai(S10, "spellcheck", "false"), S10.value = e20[16], Ai(i10, "class", "jse-query-contents svelte-l4qqoi"), Ai(E10, "type", "button"), Ai(E10, "class", "svelte-l4qqoi"), Ai(M10, "class", "jse-label-inner svelte-l4qqoi"), Ai(O10, "class", "jse-label svelte-l4qqoi"), Ai(_10, "class", "jse-original-data svelte-l4qqoi"), zi(_10, "jse-hide", !e20[19]), Ai(I10, "class", "jse-label svelte-l4qqoi"), Ai(N8, "class", "jse-preview-data svelte-l4qqoi"), Ai($10, "class", "jse-data-contents svelte-l4qqoi"), zi($10, "jse-hide-original-data", !e20[19]), Ai(o10, "class", "jse-main-contents svelte-l4qqoi"), Ai(F10, "type", "button"), Ai(F10, "class", "jse-primary svelte-l4qqoi"), F10.disabled = H10 = !!e20[20], Ai(L10, "class", "jse-actions svelte-l4qqoi"), Ai(r10, "class", "jse-modal-contents svelte-l4qqoi"); + }, m: function(h11, z11) { + Ta(t10, h11, z11), ki(h11, n10, z11), ki(h11, r10, z11), pi(r10, o10), pi(o10, i10), pi(i10, a10), pi(i10, s10), pi(i10, c10), c10.innerHTML = K10, pi(i10, l10), pi(i10, u10), pi(i10, f10), pi(i10, d10), pi(i10, v10), pi(i10, p10), pi(p10, m10), pi(m10, g10), Ta(y10, g10, null), pi(g10, b10), pi(i10, k10), G10 && G10.m(i10, null), pi(i10, w10), pi(i10, x10), pi(i10, j10), pi(i10, S10), pi(o10, C10), pi(o10, $10), pi($10, _10), pi(_10, O10), pi(O10, M10), pi(M10, E10), Ta(A10, E10, null), pi(E10, P10), pi(_10, T8), Q10 && Q10.m(_10, null), pi($10, R8), pi($10, N8), pi(N8, I10), pi(N8, D10), X10[q10].m(N8, null), pi(r10, B10), pi(r10, L10), pi(L10, F10), pi(F10, V10), W10 = true, U10 || (J10 = [Oi(g10, "click", e20[27]), Oi(S10, "input", e20[25]), Oi(E10, "click", e20[28]), Oi(F10, "click", e20[26]), ci(EL.call(null, F10))], U10 = true); + }, p: function(e21, n11) { + var r11 = {}; + 512 & n11[0] && (r11.queryLanguages = e21[9]), 1 & n11[0] && (r11.queryLanguageId = e21[0]), t10.$set(r11), (!W10 || 1 & n11[0]) && K10 !== (K10 = e21[23](e21[0]).description + "") && (c10.innerHTML = K10), (!W10 || 2 & n11[0] && h10 !== (h10 = _w(e21[1]) ? "(document root)" : JO(e21[1])) && d10.value !== h10) && (d10.value = h10); + var o11 = {}; + 262144 & n11[0] && (o11.data = e21[18] ? gP : YA), y10.$set(o11), e21[18] ? G10 ? (G10.p(e21, n11), 262144 & n11[0] && wa(G10, 1)) : ((G10 = xL(e21)).c(), wa(G10, 1), G10.m(i10, w10)) : G10 && (ba(), xa(G10, 1, 1, function() { + G10 = null; + }), ka()), (!W10 || 65536 & n11[0]) && (S10.value = e21[16]); + var a11 = {}; + 524288 & n11[0] && (a11.data = e21[19] ? gP : YA), A10.$set(a11), e21[19] ? Q10 ? (Q10.p(e21, n11), 524288 & n11[0] && wa(Q10, 1)) : ((Q10 = CL(e21)).c(), wa(Q10, 1), Q10.m(_10, null)) : Q10 && (ba(), xa(Q10, 1, 1, function() { + Q10 = null; + }), ka()), (!W10 || 524288 & n11[0]) && zi(_10, "jse-hide", !e21[19]); + var s11 = q10; + (q10 = Z10(e21)) === s11 ? X10[q10].p(e21, n11) : (ba(), xa(X10[s11], 1, 1, function() { + X10[s11] = null; + }), ka(), (z10 = X10[q10]) ? z10.p(e21, n11) : (z10 = X10[q10] = Y10[q10](e21)).c(), wa(z10, 1), z10.m(N8, null)), (!W10 || 524288 & n11[0]) && zi($10, "jse-hide-original-data", !e21[19]), (!W10 || 1048576 & n11[0] && H10 !== (H10 = !!e21[20])) && (F10.disabled = H10); + }, i: function(e21) { + W10 || (wa(t10.$$.fragment, e21), wa(y10.$$.fragment, e21), wa(G10), wa(A10.$$.fragment, e21), wa(Q10), wa(z10), W10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), xa(y10.$$.fragment, e21), xa(G10), xa(A10.$$.fragment, e21), xa(Q10), xa(z10), W10 = false; + }, d: function(e21) { + e21 && (wi(n10), wi(r10)), Ra(t10, e21), Ra(y10), G10 && G10.d(), Ra(A10), Q10 && Q10.d(), X10[q10].d(), U10 = false, Qo(J10); + } }; + } + function ML(e20) { + var t10, n10, r10, o10, i10; + return n10 = new UO({ props: { $$slots: { default: [OL] }, $$scope: { ctx: e20 } } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-modal jse-transform svelte-l4qqoi"); + }, m: function(a10, s10) { + ki(a10, t10, s10), Ta(n10, t10, null), r10 = true, o10 || (i10 = ci(BI.call(null, t10, e20[22])), o10 = true); + }, p: function(e21, t11) { + var r11 = {}; + 4194303 & t11[0] | 2048 & t11[1] && (r11.$$scope = { dirty: t11, ctx: e21 }), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), o10 = false, i10(); + } }; + } + function EL(e20) { + e20.focus(); + } + function AL(e20, t10, n10) { + var r10, o10, i10 = Da("jsoneditor:TransformModal"), a10 = t10.id, s10 = void 0 === a10 ? "transform-modal-" + Ps() : a10, c10 = t10.json, l10 = t10.rootPath, u10 = void 0 === l10 ? [] : l10, f10 = t10.indentation, d10 = t10.escapeControlCharacters, h10 = t10.escapeUnicodeCharacters, v10 = t10.parser, p10 = t10.parseMemoizeOne, m10 = t10.validationParser, g10 = t10.pathParser, y10 = t10.queryLanguages, b10 = t10.queryLanguageId, k10 = t10.onChangeQueryLanguage, w10 = t10.onRenderValue, x10 = t10.onRenderMenu, j10 = t10.onRenderContextMenu, S10 = t10.onClassName, C10 = t10.onTransform, $10 = Zi("simple-modal").close, _10 = "".concat(s10, ":").concat(Zs(u10)), O10 = RP[_10] || {}, M10 = false !== NP.showWizard, E10 = false !== NP.showOriginal, A10 = O10.queryOptions || {}, P10 = b10 === O10.queryLanguageId && O10.query ? O10.query : I10(b10).createQuery(c10, O10.queryOptions || {}), T8 = O10.isManual || false, R8 = void 0, N8 = { text: "" }; + function I10(e21) { + return y10.find(function(t11) { + return t11.id === e21; + }) || y10[0]; + } + var D10 = Vy(function(e21, t11) { + if (void 0 === e21) + return n10(21, N8 = { text: "" }), void n10(20, R8 = "Error: No JSON"); + try { + i10("previewTransform", { query: t11 }); + var r11 = I10(b10).executeQuery(e21, t11, v10); + n10(21, N8 = { json: r11 }), n10(20, R8 = void 0); + } catch (e23) { + n10(21, N8 = { text: "" }), n10(20, R8 = String(e23)); + } + }, 300); + return e20.$$set = function(e21) { + "id" in e21 && n10(30, s10 = e21.id), "json" in e21 && n10(31, c10 = e21.json), "rootPath" in e21 && n10(1, u10 = e21.rootPath), "indentation" in e21 && n10(2, f10 = e21.indentation), "escapeControlCharacters" in e21 && n10(3, d10 = e21.escapeControlCharacters), "escapeUnicodeCharacters" in e21 && n10(4, h10 = e21.escapeUnicodeCharacters), "parser" in e21 && n10(5, v10 = e21.parser), "parseMemoizeOne" in e21 && n10(6, p10 = e21.parseMemoizeOne), "validationParser" in e21 && n10(7, m10 = e21.validationParser), "pathParser" in e21 && n10(8, g10 = e21.pathParser), "queryLanguages" in e21 && n10(9, y10 = e21.queryLanguages), "queryLanguageId" in e21 && n10(0, b10 = e21.queryLanguageId), "onChangeQueryLanguage" in e21 && n10(32, k10 = e21.onChangeQueryLanguage), "onRenderValue" in e21 && n10(10, w10 = e21.onRenderValue), "onRenderMenu" in e21 && n10(11, x10 = e21.onRenderMenu), "onRenderContextMenu" in e21 && n10(12, j10 = e21.onRenderContextMenu), "onClassName" in e21 && n10(13, S10 = e21.onClassName), "onTransform" in e21 && n10(33, C10 = e21.onTransform); + }, e20.$$.update = function() { + 2 & e20.$$.dirty[0] | 1 & e20.$$.dirty[1] && n10(14, r10 = Ws(c10, u10)), 16384 & e20.$$.dirty[0] && n10(17, o10 = r10 ? { json: r10 } : { text: "" }), 81920 & e20.$$.dirty[0] && D10(r10, P10), 98305 & e20.$$.dirty[0] | 24 & e20.$$.dirty[1] && (n10(34, RP[_10] = { queryOptions: A10, query: P10, queryLanguageId: b10, isManual: T8 }, RP), i10("store state in memory", _10, RP[_10])); + }, [b10, u10, f10, d10, h10, v10, p10, m10, g10, y10, w10, x10, j10, S10, r10, A10, P10, o10, M10, E10, R8, N8, $10, I10, function(e21) { + n10(15, A10 = e21), n10(16, P10 = I10(b10).createQuery(c10, e21)), n10(35, T8 = false), i10("updateQueryByWizard", { queryOptions: A10, query: P10, isManual: T8 }); + }, function(e21) { + n10(16, P10 = e21.target.value), n10(35, T8 = true), i10("handleChangeQuery", { query: P10, isManual: T8 }); + }, function() { + if (void 0 === r10) + return n10(21, N8 = { text: "" }), void n10(20, R8 = "Error: No JSON"); + try { + i10("handleTransform", { query: P10 }); + var e21 = I10(b10).executeQuery(r10, P10, v10); + C10([{ op: "replace", path: Zs(u10), value: e21 }]), $10(); + } catch (e23) { + console.error(e23), n10(21, N8 = { text: "" }), n10(20, R8 = String(e23)); + } + }, function() { + n10(18, M10 = !M10), NP.showWizard = M10; + }, function() { + n10(19, E10 = !E10), NP.showOriginal = E10; + }, function(e21) { + i10("handleChangeQueryLanguage", e21), n10(0, b10 = e21), k10(e21); + var t11 = I10(b10); + n10(16, P10 = t11.createQuery(c10, A10)), n10(35, T8 = false); + }, s10, c10, k10, C10, RP, T8]; + } + var PL = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, AL, ML, Zo, { id: 30, json: 31, rootPath: 1, indentation: 2, escapeControlCharacters: 3, escapeUnicodeCharacters: 4, parser: 5, parseMemoizeOne: 6, validationParser: 7, pathParser: 8, queryLanguages: 9, queryLanguageId: 0, onChangeQueryLanguage: 32, onRenderValue: 10, onRenderMenu: 11, onRenderContextMenu: 12, onClassName: 13, onTransform: 33 }, wL, [-1, -1]), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var TL = {}; + function RL(e20) { + mi(e20, "svelte-qjdk97", '.jse-modal.svelte-qjdk97.svelte-qjdk97{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-qjdk97 .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-qjdk97 .jse-modal-contents.svelte-qjdk97{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-qjdk97 .jse-modal-contents .jse-actions.svelte-qjdk97{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-qjdk97 .jse-modal-contents .jse-actions button.jse-primary.svelte-qjdk97{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-qjdk97 .jse-modal-contents .jse-actions button.jse-primary.svelte-qjdk97:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-qjdk97 .jse-modal-contents .jse-actions button.jse-primary.svelte-qjdk97:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;height:auto;min-height:500px;max-height:calc(100vh - 6rem);display:flex}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0}.jse-modal.jse-sort.svelte-qjdk97 table.svelte-qjdk97{width:100%;border-collapse:collapse;border-spacing:0}.jse-modal.jse-sort.svelte-qjdk97 table th.svelte-qjdk97,.jse-modal.jse-sort.svelte-qjdk97 table td.svelte-qjdk97{text-align:left;vertical-align:middle;font-weight:normal;padding-bottom:var(--jse-padding, 10px)}.jse-modal.jse-sort.svelte-qjdk97 table th input.jse-path.svelte-qjdk97,.jse-modal.jse-sort.svelte-qjdk97 table td input.jse-path.svelte-qjdk97{width:100%;box-sizing:border-box;padding:6px 16px;border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:var(--jse-input-radius, 3px);font-family:inherit;font-size:inherit;background:inherit;color:inherit;outline:none}.jse-modal.jse-sort.svelte-qjdk97 table th input.jse-path.svelte-qjdk97:read-only,.jse-modal.jse-sort.svelte-qjdk97 table td input.jse-path.svelte-qjdk97:read-only{background:var(--jse-input-background-readonly, transparent)}.jse-modal.jse-sort.svelte-qjdk97 table th.svelte-qjdk97 .svelte-select input,.jse-modal.jse-sort.svelte-qjdk97 table td.svelte-qjdk97 .svelte-select input{box-sizing:border-box}.jse-modal.jse-sort.svelte-qjdk97 .jse-space.svelte-qjdk97{height:200px}.jse-modal.jse-sort.svelte-qjdk97 .jse-space .jse-error.svelte-qjdk97{color:var(--jse-error-color, #ee5341)}'); + } + function NL(e20) { + var t10, n10, r10, o10, i10, a10, s10; + function c10(t11) { + e20[14](t11); + } + var l10 = { showChevron: true, items: e20[5] }; + return void 0 !== e20[1] && (l10.value = e20[1]), i10 = new ZR({ props: l10 }), na.push(function() { + return Aa(i10, "value", c10); + }), { c: function() { + t10 = ji("tr"), (n10 = ji("th")).textContent = "Property", r10 = $i(), o10 = ji("td"), Pa(i10.$$.fragment), Ai(n10, "class", "svelte-qjdk97"), Ai(o10, "class", "svelte-qjdk97"); + }, m: function(e21, a11) { + ki(e21, t10, a11), pi(t10, n10), pi(t10, r10), pi(t10, o10), Ta(i10, o10, null), s10 = true; + }, p: function(e21, t11) { + var n11 = {}; + 32 & t11 && (n11.items = e21[5]), !a10 && 2 & t11 && (a10 = true, n11.value = e21[1], ua(function() { + return a10 = false; + })), i10.$set(n11); + }, i: function(e21) { + s10 || (wa(i10.$$.fragment, e21), s10 = true); + }, o: function(e21) { + xa(i10.$$.fragment, e21), s10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(i10); + } }; + } + function IL(e20) { + var t10, n10; + return { c: function() { + t10 = ji("div"), n10 = Ci(e20[4]), Ai(t10, "class", "jse-error svelte-qjdk97"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: function(e21, t11) { + 16 & t11 && Ni(n10, e21[4]); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function DL(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10, E10, A10, P10, T8; + r10 = new XN({ props: { title: e20[3] ? "Sort array items" : "Sort object keys" } }); + var R8 = e20[3] && (e20[5] && (null === (t10 = e20[5]) || void 0 === t10 ? void 0 : t10.length) > 1 || void 0 === e20[1]) && NL(e20); + function N8(t11) { + e20[15](t11); + } + var I10 = { showChevron: true, clearable: false, items: e20[7] }; + void 0 !== e20[2] && (I10.value = e20[2]), x10 = new ZR({ props: I10 }), na.push(function() { + return Aa(x10, "value", N8); + }); + var D10 = e20[4] && IL(e20); + return { c: function() { + var t11; + n10 = ji("div"), Pa(r10.$$.fragment), o10 = $i(), i10 = ji("div"), a10 = ji("table"), (s10 = ji("colgroup")).innerHTML = ' ', c10 = $i(), l10 = ji("tbody"), u10 = ji("tr"), (f10 = ji("th")).textContent = "Path", d10 = $i(), h10 = ji("td"), v10 = ji("input"), m10 = $i(), R8 && R8.c(), g10 = $i(), y10 = ji("tr"), (b10 = ji("th")).textContent = "Direction", k10 = $i(), w10 = ji("td"), Pa(x10.$$.fragment), S10 = $i(), C10 = ji("div"), D10 && D10.c(), $10 = $i(), _10 = ji("div"), O10 = ji("button"), M10 = Ci("Sort"), Ai(f10, "class", "svelte-qjdk97"), Ai(v10, "class", "jse-path svelte-qjdk97"), Ai(v10, "type", "text"), v10.readOnly = true, Ai(v10, "title", "Selected path"), v10.value = p10 = _w(e20[0]) ? "(document root)" : JO(e20[0]), Ai(h10, "class", "svelte-qjdk97"), Ai(b10, "class", "svelte-qjdk97"), Ai(w10, "class", "svelte-qjdk97"), Ai(a10, "class", "svelte-qjdk97"), Ai(C10, "class", "jse-space svelte-qjdk97"), Ai(O10, "type", "button"), Ai(O10, "class", "jse-primary svelte-qjdk97"), O10.disabled = E10 = !!(e20[3] && e20[5] && (null === (t11 = e20[5]) || void 0 === t11 ? void 0 : t11.length) > 1) && !e20[1], Ai(_10, "class", "jse-actions svelte-qjdk97"), Ai(i10, "class", "jse-modal-contents svelte-qjdk97"), Ai(n10, "class", "jse-modal jse-sort svelte-qjdk97"); + }, m: function(t11, p11) { + ki(t11, n10, p11), Ta(r10, n10, null), pi(n10, o10), pi(n10, i10), pi(i10, a10), pi(a10, s10), pi(a10, c10), pi(a10, l10), pi(l10, u10), pi(u10, f10), pi(u10, d10), pi(u10, h10), pi(h10, v10), pi(l10, m10), R8 && R8.m(l10, null), pi(l10, g10), pi(l10, y10), pi(y10, b10), pi(y10, k10), pi(y10, w10), Ta(x10, w10, null), pi(i10, S10), pi(i10, C10), D10 && D10.m(C10, null), pi(i10, $10), pi(i10, _10), pi(_10, O10), pi(O10, M10), A10 = true, P10 || (T8 = [Oi(O10, "click", e20[8]), ci(qL.call(null, O10)), ci(BI.call(null, n10, e20[6]))], P10 = true); + }, p: function(e21, t11) { + var n11, o11, i11 = jo(t11, 1)[0], a11 = {}; + 8 & i11 && (a11.title = e21[3] ? "Sort array items" : "Sort object keys"), r10.$set(a11), (!A10 || 1 & i11 && p10 !== (p10 = _w(e21[0]) ? "(document root)" : JO(e21[0])) && v10.value !== p10) && (v10.value = p10), e21[3] && (e21[5] && (null === (n11 = e21[5]) || void 0 === n11 ? void 0 : n11.length) > 1 || void 0 === e21[1]) ? R8 ? (R8.p(e21, i11), 42 & i11 && wa(R8, 1)) : ((R8 = NL(e21)).c(), wa(R8, 1), R8.m(l10, g10)) : R8 && (ba(), xa(R8, 1, 1, function() { + R8 = null; + }), ka()); + var s11 = {}; + !j10 && 4 & i11 && (j10 = true, s11.value = e21[2], ua(function() { + return j10 = false; + })), x10.$set(s11), e21[4] ? D10 ? D10.p(e21, i11) : ((D10 = IL(e21)).c(), D10.m(C10, null)) : D10 && (D10.d(1), D10 = null), (!A10 || 42 & i11 && E10 !== (E10 = !!(e21[3] && e21[5] && (null === (o11 = e21[5]) || void 0 === o11 ? void 0 : o11.length) > 1) && !e21[1])) && (O10.disabled = E10); + }, i: function(e21) { + A10 || (wa(r10.$$.fragment, e21), wa(R8), wa(x10.$$.fragment, e21), A10 = true); + }, o: function(e21) { + xa(r10.$$.fragment, e21), xa(R8), xa(x10.$$.fragment, e21), A10 = false; + }, d: function(e21) { + e21 && wi(n10), Ra(r10), R8 && R8.d(), Ra(x10), D10 && D10.d(), P10 = false, Qo(T8); + } }; + } + function qL(e20) { + e20.focus(); + } + function zL(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10 = Da("jsoneditor:SortModal"), l10 = t10.id, u10 = t10.json, f10 = t10.rootPath, d10 = t10.onSort, h10 = Zi("simple-modal").close, v10 = "".concat(l10, ":").concat(Zs(f10)), p10 = Ws(u10, f10), m10 = { value: 1, label: "ascending" }, g10 = [m10, { value: -1, label: "descending" }], y10 = null === (r10 = TL[v10]) || void 0 === r10 ? void 0 : r10.selectedProperty, b10 = (null === (o10 = TL[v10]) || void 0 === o10 ? void 0 : o10.selectedDirection) || m10, k10 = void 0; + return e20.$$set = function(e21) { + "id" in e21 && n10(9, l10 = e21.id), "json" in e21 && n10(10, u10 = e21.json), "rootPath" in e21 && n10(0, f10 = e21.rootPath), "onSort" in e21 && n10(11, d10 = e21.onSort); + }, e20.$$.update = function() { + 8 & e20.$$.dirty && n10(13, a10 = i10 && void 0 !== p10 ? T_(p10) : void 0), 8192 & e20.$$.dirty && n10(5, s10 = a10 ? a10.map(GO) : void 0), 4102 & e20.$$.dirty && (n10(12, TL[v10] = { selectedProperty: y10, selectedDirection: b10 }, TL), c10("store state in memory", v10, TL[v10])); + }, n10(3, i10 = Array.isArray(p10)), [f10, y10, b10, i10, k10, s10, h10, g10, function() { + try { + var e21, t11, r11; + n10(4, k10 = void 0); + var o11 = (null === (e21 = y10) || void 0 === e21 ? void 0 : e21.value) || (null === (t11 = s10) || void 0 === t11 || null === (t11 = t11[0]) || void 0 === t11 ? void 0 : t11.value) || [], i11 = null === (r11 = b10) || void 0 === r11 ? void 0 : r11.value, a11 = Iz(u10, f10, o11, i11); + d10({ operations: a11, rootPath: f10, itemPath: o11, direction: i11 }), h10(); + } catch (e23) { + n10(4, k10 = String(e23)); + } + }, l10, u10, d10, TL, a10, function(e21) { + n10(1, y10 = e21); + }, function(e21) { + n10(2, b10 = e21); + }]; + } + var BL = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, zL, DL, Zo, { id: 9, json: 10, rootPath: 0, onSort: 11 }, RL), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function LL() { + } + function FL(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1e3; + if (e20 < 0.9 * t10) + return e20.toFixed() + " B"; + var n10 = e20 / t10; + if (n10 < 0.9 * t10) + return n10.toFixed(1) + " KB"; + var r10 = n10 / t10; + if (r10 < 0.9 * t10) + return r10.toFixed(1) + " MB"; + var o10 = r10 / t10; + return o10 < 0.9 * t10 ? o10.toFixed(1) + " GB" : (o10 / t10).toFixed(1) + " TB"; + } + function VL(e20) { + var t10, n10; + return t10 = new EI({ props: { items: e20[0] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & jo(n11, 1)[0] && (r10.items = e21[0]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function HL(e20, t10, n10) { + var r10, o10, i10 = t10.readOnly, a10 = void 0 !== i10 && i10, s10 = t10.onFormat, c10 = t10.onCompact, l10 = t10.onSort, u10 = t10.onTransform, f10 = t10.onToggleSearch, d10 = t10.onUndo, h10 = t10.onRedo, v10 = t10.canUndo, p10 = t10.canRedo, m10 = t10.canFormat, g10 = t10.canCompact, y10 = t10.canSort, b10 = t10.canTransform, k10 = t10.onRenderMenu, w10 = { type: "button", icon: jP, title: "Search (Ctrl+F)", className: "jse-search", onClick: f10 }; + return e20.$$set = function(e21) { + "readOnly" in e21 && n10(1, a10 = e21.readOnly), "onFormat" in e21 && n10(2, s10 = e21.onFormat), "onCompact" in e21 && n10(3, c10 = e21.onCompact), "onSort" in e21 && n10(4, l10 = e21.onSort), "onTransform" in e21 && n10(5, u10 = e21.onTransform), "onToggleSearch" in e21 && n10(6, f10 = e21.onToggleSearch), "onUndo" in e21 && n10(7, d10 = e21.onUndo), "onRedo" in e21 && n10(8, h10 = e21.onRedo), "canUndo" in e21 && n10(9, v10 = e21.canUndo), "canRedo" in e21 && n10(10, p10 = e21.canRedo), "canFormat" in e21 && n10(11, m10 = e21.canFormat), "canCompact" in e21 && n10(12, g10 = e21.canCompact), "canSort" in e21 && n10(13, y10 = e21.canSort), "canTransform" in e21 && n10(14, b10 = e21.canTransform), "onRenderMenu" in e21 && n10(15, k10 = e21.onRenderMenu); + }, e20.$$.update = function() { + 32702 & e20.$$.dirty && n10(16, o10 = a10 ? [w10, { type: "space" }] : [{ type: "button", icon: xz, title: "Format JSON: add proper indentation and new lines (Ctrl+I)", className: "jse-format", onClick: s10, disabled: a10 || !m10 }, { type: "button", icon: jz, title: "Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)", className: "jse-compact", onClick: c10, disabled: a10 || !g10 }, { type: "separator" }, { type: "button", icon: kP, title: "Sort", className: "jse-sort", onClick: l10, disabled: a10 || !y10 }, { type: "button", icon: cP, title: "Transform contents (filter, sort, project)", className: "jse-transform", onClick: u10, disabled: a10 || !b10 }, w10, { type: "separator" }, { type: "button", icon: vP, title: "Undo (Ctrl+Z)", className: "jse-undo", onClick: d10, disabled: !v10 }, { type: "button", icon: hP, title: "Redo (Ctrl+Shift+Z)", className: "jse-redo", onClick: h10, disabled: !p10 }, { type: "space" }]), 98304 & e20.$$.dirty && n10(0, r10 = k10(o10) || o10); + }, [r10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, o10]; + } + var WL = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, HL, VL, Zo, { readOnly: 1, onFormat: 2, onCompact: 3, onSort: 4, onTransform: 5, onToggleSearch: 6, onUndo: 7, onRedo: 8, canUndo: 9, canRedo: 10, canFormat: 11, canCompact: 12, canSort: 13, canTransform: 14, onRenderMenu: 15 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var UL = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "lineAt", value: function(e21) { + if (e21 < 0 || e21 > this.length) + throw new RangeError("Invalid position ".concat(e21, " in document of length ").concat(this.length)); + return this.lineInner(e21, false, 1, 0); + } }, { key: "line", value: function(e21) { + if (e21 < 1 || e21 > this.lines) + throw new RangeError("Invalid line number ".concat(e21, " in ").concat(this.lines, "-line document")); + return this.lineInner(e21, true, 1, 0); + } }, { key: "replace", value: function(e21, t10, n10) { + var r10 = jo(tF(this, e21, t10), 2); + e21 = r10[0], t10 = r10[1]; + var o10 = []; + return this.decompose(0, e21, o10, 2), n10.length && n10.decompose(0, n10.length, o10, 3), this.decompose(t10, this.length, o10, 1), KL.from(o10, this.length - (t10 - e21) + n10.length); + } }, { key: "append", value: function(e21) { + return this.replace(this.length, this.length, e21); + } }, { key: "slice", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length, n10 = jo(tF(this, e21, t10), 2); + e21 = n10[0], t10 = n10[1]; + var r10 = []; + return this.decompose(e21, t10, r10, 0), KL.from(r10, t10 - e21); + } }, { key: "eq", value: function(e21) { + if (e21 == this) + return true; + if (e21.length != this.length || e21.lines != this.lines) + return false; + for (var t10 = this.scanIdentical(e21, 1), n10 = this.length - this.scanIdentical(e21, -1), r10 = new YL(this), o10 = new YL(e21), i10 = t10, a10 = t10; ; ) { + if (r10.next(i10), o10.next(i10), i10 = 0, r10.lineBreak != o10.lineBreak || r10.done != o10.done || r10.value != o10.value) + return false; + if (a10 += r10.value.length, r10.done || a10 >= n10) + return true; + } + } }, { key: "iter", value: function() { + return new YL(this, arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1); + } }, { key: "iterRange", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length; + return new XL(this, e21, t10); + } }, { key: "iterLines", value: function(e21, t10) { + var n10; + if (null == e21) + n10 = this.iter(); + else { + null == t10 && (t10 = this.lines + 1); + var r10 = this.line(e21).from; + n10 = this.iterRange(r10, Math.max(r10, t10 == this.lines + 1 ? this.length : t10 <= 1 ? 0 : this.line(t10 - 1).to)); + } + return new ZL(n10); + } }, { key: "toString", value: function() { + return this.sliceString(0); + } }, { key: "toJSON", value: function() { + var e21 = []; + return this.flatten(e21), e21; + } }], [{ key: "of", value: function(t10) { + if (0 == t10.length) + throw new RangeError("A document must have at least one line"); + return 1 != t10.length || t10[0] ? t10.length <= 32 ? new JL(t10) : KL.from(JL.split(t10, [])) : e20.empty; + } }]), e20; + }(); + var JL = function(e20) { + function t10(e21) { + var n10, r10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function(e23) { + var t11, n11 = -1, r11 = bo(e23); + try { + for (r11.s(); !(t11 = r11.n()).done; ) { + n11 += t11.value.length + 1; + } + } catch (e24) { + r11.e(e24); + } finally { + r11.f(); + } + return n11; + }(e21); + return No(this, t10), (n10 = _o(this, t10)).text = e21, n10.length = r10, n10; + } + return Ao(t10, UL), Do(t10, [{ key: "lines", get: function() { + return this.text.length; + } }, { key: "children", get: function() { + return null; + } }, { key: "lineInner", value: function(e21, t11, n10, r10) { + for (var o10 = 0; ; o10++) { + var i10 = this.text[o10], a10 = r10 + i10.length; + if ((t11 ? n10 : a10) >= e21) + return new eF(r10, a10, n10, i10); + r10 = a10 + 1, n10++; + } + } }, { key: "decompose", value: function(e21, n10, r10, o10) { + var i10 = e21 <= 0 && n10 >= this.length ? this : new t10(QL(this.text, e21, n10), Math.min(n10, this.length) - Math.max(0, e21)); + if (1 & o10) { + var a10 = r10.pop(), s10 = GL(i10.text, a10.text.slice(), 0, i10.length); + if (s10.length <= 32) + r10.push(new t10(s10, a10.length + i10.length)); + else { + var c10 = s10.length >> 1; + r10.push(new t10(s10.slice(0, c10)), new t10(s10.slice(c10))); + } + } else + r10.push(i10); + } }, { key: "replace", value: function(e21, n10, r10) { + if (!(r10 instanceof t10)) + return go(Mo(t10.prototype), "replace", this).call(this, e21, n10, r10); + var o10 = jo(tF(this, e21, n10), 2); + e21 = o10[0], n10 = o10[1]; + var i10 = GL(this.text, GL(r10.text, QL(this.text, 0, e21)), n10), a10 = this.length + r10.length - (n10 - e21); + return i10.length <= 32 ? new t10(i10, a10) : KL.from(t10.split(i10, []), a10); + } }, { key: "sliceString", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length, n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "\n", r10 = jo(tF(this, e21, t11), 2); + e21 = r10[0], t11 = r10[1]; + for (var o10 = "", i10 = 0, a10 = 0; i10 <= t11 && a10 < this.text.length; a10++) { + var s10 = this.text[a10], c10 = i10 + s10.length; + i10 > e21 && a10 && (o10 += n10), e21 < c10 && t11 > i10 && (o10 += s10.slice(Math.max(0, e21 - i10), t11 - i10)), i10 = c10 + 1; + } + return o10; + } }, { key: "flatten", value: function(e21) { + var t11, n10 = bo(this.text); + try { + for (n10.s(); !(t11 = n10.n()).done; ) { + var r10 = t11.value; + e21.push(r10); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "scanIdentical", value: function() { + return 0; + } }], [{ key: "split", value: function(e21, n10) { + var r10, o10 = [], i10 = -1, a10 = bo(e21); + try { + for (a10.s(); !(r10 = a10.n()).done; ) { + var s10 = r10.value; + o10.push(s10), i10 += s10.length + 1, 32 == o10.length && (n10.push(new t10(o10, i10)), o10 = [], i10 = -1); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + return i10 > -1 && n10.push(new t10(o10, i10)), n10; + } }]), t10; + }(); + var KL = function(e20) { + function t10(e21, n10) { + var r10; + No(this, t10), (r10 = _o(this, t10)).children = e21, r10.length = n10, r10.lines = 0; + var o10, i10 = bo(e21); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + var a10 = o10.value; + r10.lines += a10.lines; + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + return r10; + } + return Ao(t10, UL), Do(t10, [{ key: "lineInner", value: function(e21, t11, n10, r10) { + for (var o10 = 0; ; o10++) { + var i10 = this.children[o10], a10 = r10 + i10.length, s10 = n10 + i10.lines - 1; + if ((t11 ? s10 : a10) >= e21) + return i10.lineInner(e21, t11, n10, r10); + r10 = a10 + 1, n10 = s10 + 1; + } + } }, { key: "decompose", value: function(e21, t11, n10, r10) { + for (var o10 = 0, i10 = 0; i10 <= t11 && o10 < this.children.length; o10++) { + var a10 = this.children[o10], s10 = i10 + a10.length; + if (e21 <= s10 && t11 >= i10) { + var c10 = r10 & ((i10 <= e21 ? 1 : 0) | (s10 >= t11 ? 2 : 0)); + i10 >= e21 && s10 <= t11 && !c10 ? n10.push(a10) : a10.decompose(e21 - i10, t11 - i10, n10, c10); + } + i10 = s10 + 1; + } + } }, { key: "replace", value: function(e21, n10, r10) { + var o10 = jo(tF(this, e21, n10), 2); + if (e21 = o10[0], n10 = o10[1], r10.lines < this.lines) + for (var i10 = 0, a10 = 0; i10 < this.children.length; i10++) { + var s10 = this.children[i10], c10 = a10 + s10.length; + if (e21 >= a10 && n10 <= c10) { + var l10 = s10.replace(e21 - a10, n10 - a10, r10), u10 = this.lines - s10.lines + l10.lines; + if (l10.lines < u10 >> 4 && l10.lines > u10 >> 6) { + var f10 = this.children.slice(); + return f10[i10] = l10, new t10(f10, this.length - (n10 - e21) + r10.length); + } + return go(Mo(t10.prototype), "replace", this).call(this, a10, c10, l10); + } + a10 = c10 + 1; + } + return go(Mo(t10.prototype), "replace", this).call(this, e21, n10, r10); + } }, { key: "sliceString", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length, n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "\n", r10 = jo(tF(this, e21, t11), 2); + e21 = r10[0], t11 = r10[1]; + for (var o10 = "", i10 = 0, a10 = 0; i10 < this.children.length && a10 <= t11; i10++) { + var s10 = this.children[i10], c10 = a10 + s10.length; + a10 > e21 && i10 && (o10 += n10), e21 < c10 && t11 > a10 && (o10 += s10.sliceString(e21 - a10, t11 - a10, n10)), a10 = c10 + 1; + } + return o10; + } }, { key: "flatten", value: function(e21) { + var t11, n10 = bo(this.children); + try { + for (n10.s(); !(t11 = n10.n()).done; ) { + t11.value.flatten(e21); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "scanIdentical", value: function(e21, n10) { + if (!(e21 instanceof t10)) + return 0; + for (var r10 = 0, o10 = jo(n10 > 0 ? [0, 0, this.children.length, e21.children.length] : [this.children.length - 1, e21.children.length - 1, -1, -1], 4), i10 = o10[0], a10 = o10[1], s10 = o10[2], c10 = o10[3]; ; i10 += n10, a10 += n10) { + if (i10 == s10 || a10 == c10) + return r10; + var l10 = this.children[i10], u10 = e21.children[a10]; + if (l10 != u10) + return r10 + l10.scanIdentical(u10, n10); + r10 += l10.length + 1; + } + } }], [{ key: "from", value: function(e21) { + var n10, r10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21.reduce(function(e23, t11) { + return e23 + t11.length + 1; + }, -1), o10 = 0, i10 = bo(e21); + try { + for (i10.s(); !(n10 = i10.n()).done; ) { + o10 += n10.value.lines; + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + if (o10 < 32) { + var a10, s10 = [], c10 = bo(e21); + try { + for (c10.s(); !(a10 = c10.n()).done; ) { + a10.value.flatten(s10); + } + } catch (e23) { + c10.e(e23); + } finally { + c10.f(); + } + return new JL(s10, r10); + } + var l10 = Math.max(32, o10 >> 5), u10 = l10 << 1, f10 = l10 >> 1, d10 = [], h10 = 0, v10 = -1, p10 = []; + function m10(e23) { + var n11; + if (e23.lines > u10 && e23 instanceof t10) { + var r11, o11 = bo(e23.children); + try { + for (o11.s(); !(r11 = o11.n()).done; ) { + m10(r11.value); + } + } catch (e24) { + o11.e(e24); + } finally { + o11.f(); + } + } else + e23.lines > f10 && (h10 > f10 || !h10) ? (g10(), d10.push(e23)) : e23 instanceof JL && h10 && (n11 = p10[p10.length - 1]) instanceof JL && e23.lines + n11.lines <= 32 ? (h10 += e23.lines, v10 += e23.length + 1, p10[p10.length - 1] = new JL(n11.text.concat(e23.text), n11.length + 1 + e23.length)) : (h10 + e23.lines > l10 && g10(), h10 += e23.lines, v10 += e23.length + 1, p10.push(e23)); + } + function g10() { + 0 != h10 && (d10.push(1 == p10.length ? p10[0] : t10.from(p10, v10)), v10 = -1, h10 = p10.length = 0); + } + var y10, b10 = bo(e21); + try { + for (b10.s(); !(y10 = b10.n()).done; ) { + m10(y10.value); + } + } catch (e23) { + b10.e(e23); + } finally { + b10.f(); + } + return g10(), 1 == d10.length ? d10[0] : new t10(d10, r10); + } }]), t10; + }(); + function GL(e20, t10) { + for (var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e9, o10 = 0, i10 = 0, a10 = true; i10 < e20.length && o10 <= r10; i10++) { + var s10 = e20[i10], c10 = o10 + s10.length; + c10 >= n10 && (c10 > r10 && (s10 = s10.slice(0, r10 - o10)), o10 < n10 && (s10 = s10.slice(n10 - o10)), a10 ? (t10[t10.length - 1] += s10, a10 = false) : t10.push(s10)), o10 = c10 + 1; + } + return t10; + } + function QL(e20, t10, n10) { + return GL(e20, [""], t10, n10); + } + UL.empty = new JL([""], 0); + var YL = function() { + function e20(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; + No(this, e20), this.dir = n10, this.done = false, this.lineBreak = false, this.value = "", this.nodes = [t10], this.offsets = [n10 > 0 ? 1 : (t10 instanceof JL ? t10.text.length : t10.children.length) << 1]; + } + return Do(e20, [{ key: "nextInner", value: function(e21, t10) { + for (this.done = this.lineBreak = false; ; ) { + var n10 = this.nodes.length - 1, r10 = this.nodes[n10], o10 = this.offsets[n10], i10 = o10 >> 1, a10 = r10 instanceof JL ? r10.text.length : r10.children.length; + if (i10 == (t10 > 0 ? a10 : 0)) { + if (0 == n10) + return this.done = true, this.value = "", this; + t10 > 0 && this.offsets[n10 - 1]++, this.nodes.pop(), this.offsets.pop(); + } else if ((1 & o10) == (t10 > 0 ? 0 : 1)) { + if (this.offsets[n10] += t10, 0 == e21) + return this.lineBreak = true, this.value = "\n", this; + e21--; + } else if (r10 instanceof JL) { + var s10 = r10.text[i10 + (t10 < 0 ? -1 : 0)]; + if (this.offsets[n10] += t10, s10.length > Math.max(0, e21)) + return this.value = 0 == e21 ? s10 : t10 > 0 ? s10.slice(e21) : s10.slice(0, s10.length - e21), this; + e21 -= s10.length; + } else { + var c10 = r10.children[i10 + (t10 < 0 ? -1 : 0)]; + e21 > c10.length ? (e21 -= c10.length, this.offsets[n10] += t10) : (t10 < 0 && this.offsets[n10]--, this.nodes.push(c10), this.offsets.push(t10 > 0 ? 1 : (c10 instanceof JL ? c10.text.length : c10.children.length) << 1)); + } + } + } }, { key: "next", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0; + return e21 < 0 && (this.nextInner(-e21, -this.dir), e21 = this.value.length), this.nextInner(e21, this.dir); + } }]), e20; + }(); + var XL = function() { + function e20(t10, n10, r10) { + No(this, e20), this.value = "", this.done = false, this.cursor = new YL(t10, n10 > r10 ? -1 : 1), this.pos = n10 > r10 ? t10.length : 0, this.from = Math.min(n10, r10), this.to = Math.max(n10, r10); + } + return Do(e20, [{ key: "nextInner", value: function(e21, t10) { + if (t10 < 0 ? this.pos <= this.from : this.pos >= this.to) + return this.value = "", this.done = true, this; + e21 += Math.max(0, t10 < 0 ? this.pos - this.to : this.from - this.pos); + var n10 = t10 < 0 ? this.pos - this.from : this.to - this.pos; + e21 > n10 && (e21 = n10), n10 -= e21; + var r10 = this.cursor.next(e21).value; + return this.pos += (r10.length + e21) * t10, this.value = r10.length <= n10 ? r10 : t10 < 0 ? r10.slice(r10.length - n10) : r10.slice(0, n10), this.done = !this.value, this; + } }, { key: "next", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0; + return e21 < 0 ? e21 = Math.max(e21, this.from - this.pos) : e21 > 0 && (e21 = Math.min(e21, this.to - this.pos)), this.nextInner(e21, this.cursor.dir); + } }, { key: "lineBreak", get: function() { + return this.cursor.lineBreak && "" != this.value; + } }]), e20; + }(); + var ZL = function() { + function e20(t10) { + No(this, e20), this.inner = t10, this.afterBreak = true, this.value = "", this.done = false; + } + return Do(e20, [{ key: "next", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, t10 = this.inner.next(e21), n10 = t10.done, r10 = t10.lineBreak, o10 = t10.value; + return n10 && this.afterBreak ? (this.value = "", this.afterBreak = false) : n10 ? (this.done = true, this.value = "") : r10 ? this.afterBreak ? this.value = "" : (this.afterBreak = true, this.next()) : (this.value = o10, this.afterBreak = false), this; + } }, { key: "lineBreak", get: function() { + return false; + } }]), e20; + }(); + "undefined" != typeof Symbol && (UL.prototype[Symbol.iterator] = function() { + return this.iter(); + }, YL.prototype[Symbol.iterator] = XL.prototype[Symbol.iterator] = ZL.prototype[Symbol.iterator] = function() { + return this; + }); + var eF = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.from = t10, this.to = n10, this.number = r10, this.text = o10; + } + return Do(e20, [{ key: "length", get: function() { + return this.to - this.from; + } }]), e20; + }(); + function tF(e20, t10, n10) { + return [t10 = Math.max(0, Math.min(e20.length, t10)), Math.max(t10, Math.min(e20.length, n10))]; + } + for (nF = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(e20) { + return e20 ? parseInt(e20, 36) : 1; + }), rF = 1; rF < nF.length; rF++) + nF[rF] += nF[rF - 1]; + var nF; + var rF; + function oF(e20) { + for (var t10 = 1; t10 < nF.length; t10 += 2) + if (nF[t10] > e20) + return nF[t10 - 1] <= e20; + return false; + } + function iF(e20) { + return e20 >= 127462 && e20 <= 127487; + } + var aF = 8205; + function sF(e20, t10) { + return (!(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2] ? cF : lF)(e20, t10, !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3]); + } + function cF(e20, t10, n10) { + if (t10 == e20.length) + return t10; + t10 && uF(e20.charCodeAt(t10)) && fF(e20.charCodeAt(t10 - 1)) && t10--; + var r10 = dF(e20, t10); + for (t10 += vF(r10); t10 < e20.length; ) { + var o10 = dF(e20, t10); + if (r10 == aF || o10 == aF || n10 && oF(o10)) + t10 += vF(o10), r10 = o10; + else { + if (!iF(o10)) + break; + for (var i10 = 0, a10 = t10 - 2; a10 >= 0 && iF(dF(e20, a10)); ) + i10++, a10 -= 2; + if (i10 % 2 == 0) + break; + t10 += 2; + } + } + return t10; + } + function lF(e20, t10, n10) { + for (; t10 > 0; ) { + var r10 = cF(e20, t10 - 2, n10); + if (r10 < t10) + return r10; + t10--; + } + return 0; + } + function uF(e20) { + return e20 >= 56320 && e20 < 57344; + } + function fF(e20) { + return e20 >= 55296 && e20 < 56320; + } + function dF(e20, t10) { + var n10 = e20.charCodeAt(t10); + if (!fF(n10) || t10 + 1 == e20.length) + return n10; + var r10 = e20.charCodeAt(t10 + 1); + return uF(r10) ? r10 - 56320 + (n10 - 55296 << 10) + 65536 : n10; + } + function hF(e20) { + return e20 <= 65535 ? String.fromCharCode(e20) : (e20 -= 65536, String.fromCharCode(55296 + (e20 >> 10), 56320 + (1023 & e20))); + } + function vF(e20) { + return e20 < 65536 ? 1 : 2; + } + var pF = /\r\n?|\n/; + var mF = function(e20) { + return e20[e20.Simple = 0] = "Simple", e20[e20.TrackDel = 1] = "TrackDel", e20[e20.TrackBefore = 2] = "TrackBefore", e20[e20.TrackAfter = 3] = "TrackAfter", e20; + }(mF || (mF = {})); + var gF = function() { + function e20(t10) { + No(this, e20), this.sections = t10; + } + return Do(e20, [{ key: "length", get: function() { + for (var e21 = 0, t10 = 0; t10 < this.sections.length; t10 += 2) + e21 += this.sections[t10]; + return e21; + } }, { key: "newLength", get: function() { + for (var e21 = 0, t10 = 0; t10 < this.sections.length; t10 += 2) { + var n10 = this.sections[t10 + 1]; + e21 += n10 < 0 ? this.sections[t10] : n10; + } + return e21; + } }, { key: "empty", get: function() { + return 0 == this.sections.length || 2 == this.sections.length && this.sections[1] < 0; + } }, { key: "iterGaps", value: function(e21) { + for (var t10 = 0, n10 = 0, r10 = 0; t10 < this.sections.length; ) { + var o10 = this.sections[t10++], i10 = this.sections[t10++]; + i10 < 0 ? (e21(n10, r10, o10), r10 += o10) : r10 += i10, n10 += o10; + } + } }, { key: "iterChangedRanges", value: function(e21) { + wF(this, e21, arguments.length > 1 && void 0 !== arguments[1] && arguments[1]); + } }, { key: "invertedDesc", get: function() { + for (var t10 = [], n10 = 0; n10 < this.sections.length; ) { + var r10 = this.sections[n10++], o10 = this.sections[n10++]; + o10 < 0 ? t10.push(r10, o10) : t10.push(o10, r10); + } + return new e20(t10); + } }, { key: "composeDesc", value: function(e21) { + return this.empty ? e21 : e21.empty ? this : jF(this, e21); + } }, { key: "mapDesc", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return e21.empty ? this : xF(this, e21, t10); + } }, { key: "mapPos", value: function(e21) { + for (var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1, n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : mF.Simple, r10 = 0, o10 = 0, i10 = 0; i10 < this.sections.length; ) { + var a10 = this.sections[i10++], s10 = this.sections[i10++], c10 = r10 + a10; + if (s10 < 0) { + if (c10 > e21) + return o10 + (e21 - r10); + o10 += a10; + } else { + if (n10 != mF.Simple && c10 >= e21 && (n10 == mF.TrackDel && r10 < e21 && c10 > e21 || n10 == mF.TrackBefore && r10 < e21 || n10 == mF.TrackAfter && c10 > e21)) + return null; + if (c10 > e21 || c10 == e21 && t10 < 0 && !a10) + return e21 == r10 || t10 < 0 ? o10 : o10 + s10; + o10 += s10; + } + r10 = c10; + } + if (e21 > r10) + throw new RangeError("Position ".concat(e21, " is out of range for changeset of length ").concat(r10)); + return o10; + } }, { key: "touchesRange", value: function(e21) { + for (var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21, n10 = 0, r10 = 0; n10 < this.sections.length && r10 <= t10; ) { + var o10 = r10 + this.sections[n10++]; + if (this.sections[n10++] >= 0 && r10 <= t10 && o10 >= e21) + return !(r10 < e21 && o10 > t10) || "cover"; + r10 = o10; + } + return false; + } }, { key: "toString", value: function() { + for (var e21 = "", t10 = 0; t10 < this.sections.length; ) { + var n10 = this.sections[t10++], r10 = this.sections[t10++]; + e21 += (e21 ? " " : "") + n10 + (r10 >= 0 ? ":" + r10 : ""); + } + return e21; + } }, { key: "toJSON", value: function() { + return this.sections; + } }], [{ key: "fromJSON", value: function(t10) { + if (!Array.isArray(t10) || t10.length % 2 || t10.some(function(e21) { + return "number" != typeof e21; + })) + throw new RangeError("Invalid JSON representation of ChangeDesc"); + return new e20(t10); + } }, { key: "create", value: function(t10) { + return new e20(t10); + } }]), e20; + }(); + var yF = function(e20) { + function t10(e21, n10) { + var r10; + return No(this, t10), (r10 = _o(this, t10, [e21])).inserted = n10, r10; + } + return Ao(t10, gF), Do(t10, [{ key: "apply", value: function(e21) { + if (this.length != e21.length) + throw new RangeError("Applying change set to a document with the wrong length"); + return wF(this, function(t11, n10, r10, o10, i10) { + return e21 = e21.replace(r10, r10 + (n10 - t11), i10); + }, false), e21; + } }, { key: "mapDesc", value: function(e21) { + return xF(this, e21, arguments.length > 1 && void 0 !== arguments[1] && arguments[1], true); + } }, { key: "invert", value: function(e21) { + for (var n10 = this.sections.slice(), r10 = [], o10 = 0, i10 = 0; o10 < n10.length; o10 += 2) { + var a10 = n10[o10], s10 = n10[o10 + 1]; + if (s10 >= 0) { + n10[o10] = s10, n10[o10 + 1] = a10; + for (var c10 = o10 >> 1; r10.length < c10; ) + r10.push(UL.empty); + r10.push(a10 ? e21.slice(i10, i10 + a10) : UL.empty); + } + i10 += a10; + } + return new t10(n10, r10); + } }, { key: "compose", value: function(e21) { + return this.empty ? e21 : e21.empty ? this : jF(this, e21, true); + } }, { key: "map", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return e21.empty ? this : xF(this, e21, t11, true); + } }, { key: "iterChanges", value: function(e21) { + wF(this, e21, arguments.length > 1 && void 0 !== arguments[1] && arguments[1]); + } }, { key: "desc", get: function() { + return gF.create(this.sections); + } }, { key: "filter", value: function(e21) { + var n10 = [], r10 = [], o10 = [], i10 = new SF(this); + e: + for (var a10 = 0, s10 = 0; ; ) { + for (var c10 = a10 == e21.length ? 1e9 : e21[a10++]; s10 < c10 || s10 == c10 && 0 == i10.len; ) { + if (i10.done) + break e; + var l10 = Math.min(i10.len, c10 - s10); + bF(o10, l10, -1); + var u10 = -1 == i10.ins ? -1 : 0 == i10.off ? i10.ins : 0; + bF(n10, l10, u10), u10 > 0 && kF(r10, n10, i10.text), i10.forward(l10), s10 += l10; + } + for (var f10 = e21[a10++]; s10 < f10; ) { + if (i10.done) + break e; + var d10 = Math.min(i10.len, f10 - s10); + bF(n10, d10, -1), bF(o10, d10, -1 == i10.ins ? -1 : 0 == i10.off ? i10.ins : 0), i10.forward(d10), s10 += d10; + } + } + return { changes: new t10(n10, r10), filtered: gF.create(o10) }; + } }, { key: "toJSON", value: function() { + for (var e21 = [], t11 = 0; t11 < this.sections.length; t11 += 2) { + var n10 = this.sections[t11], r10 = this.sections[t11 + 1]; + r10 < 0 ? e21.push(n10) : 0 == r10 ? e21.push([n10]) : e21.push([n10].concat(this.inserted[t11 >> 1].toJSON())); + } + return e21; + } }], [{ key: "of", value: function(e21, n10, r10) { + var o10 = [], i10 = [], a10 = 0, s10 = null; + function c10() { + if (arguments.length > 0 && void 0 !== arguments[0] && arguments[0] || o10.length) { + a10 < n10 && bF(o10, n10 - a10, -1); + var e23 = new t10(o10, i10); + s10 = s10 ? s10.compose(e23.map(s10)) : e23, o10 = [], i10 = [], a10 = 0; + } + } + return function e23(l10) { + if (Array.isArray(l10)) { + var u10, f10 = bo(l10); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + e23(u10.value); + } + } catch (e24) { + f10.e(e24); + } finally { + f10.f(); + } + } else if (l10 instanceof t10) { + if (l10.length != n10) + throw new RangeError("Mismatched change set length (got ".concat(l10.length, ", expected ").concat(n10, ")")); + c10(), s10 = s10 ? s10.compose(l10.map(s10)) : l10; + } else { + var d10 = l10.from, h10 = l10.to, v10 = void 0 === h10 ? d10 : h10, p10 = l10.insert; + if (d10 > v10 || d10 < 0 || v10 > n10) + throw new RangeError("Invalid change range ".concat(d10, " to ").concat(v10, " (in doc of length ").concat(n10, ")")); + var m10 = p10 ? "string" == typeof p10 ? UL.of(p10.split(r10 || pF)) : p10 : UL.empty, g10 = m10.length; + if (d10 == v10 && 0 == g10) + return; + d10 < a10 && c10(), d10 > a10 && bF(o10, d10 - a10, -1), bF(o10, v10 - d10, g10), kF(i10, o10, m10), a10 = v10; + } + }(e21), c10(!s10), s10; + } }, { key: "empty", value: function(e21) { + return new t10(e21 ? [e21, -1] : [], []); + } }, { key: "fromJSON", value: function(e21) { + if (!Array.isArray(e21)) + throw new RangeError("Invalid JSON representation of ChangeSet"); + for (var n10 = [], r10 = [], o10 = 0; o10 < e21.length; o10++) { + var i10 = e21[o10]; + if ("number" == typeof i10) + n10.push(i10, -1); + else { + if (!Array.isArray(i10) || "number" != typeof i10[0] || i10.some(function(e23, t11) { + return t11 && "string" != typeof e23; + })) + throw new RangeError("Invalid JSON representation of ChangeSet"); + if (1 == i10.length) + n10.push(i10[0], 0); + else { + for (; r10.length < o10; ) + r10.push(UL.empty); + r10[o10] = UL.of(i10.slice(1)), n10.push(i10[0], r10[o10].length); + } + } + } + return new t10(n10, r10); + } }, { key: "createSet", value: function(e21, n10) { + return new t10(e21, n10); + } }]), t10; + }(); + function bF(e20, t10, n10) { + var r10 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; + if (!(0 == t10 && n10 <= 0)) { + var o10 = e20.length - 2; + o10 >= 0 && n10 <= 0 && n10 == e20[o10 + 1] ? e20[o10] += t10 : 0 == t10 && 0 == e20[o10] ? e20[o10 + 1] += n10 : r10 ? (e20[o10] += t10, e20[o10 + 1] += n10) : e20.push(t10, n10); + } + } + function kF(e20, t10, n10) { + if (0 != n10.length) { + var r10 = t10.length - 2 >> 1; + if (r10 < e20.length) + e20[e20.length - 1] = e20[e20.length - 1].append(n10); + else { + for (; e20.length < r10; ) + e20.push(UL.empty); + e20.push(n10); + } + } + } + function wF(e20, t10, n10) { + for (var r10 = e20.inserted, o10 = 0, i10 = 0, a10 = 0; a10 < e20.sections.length; ) { + var s10 = e20.sections[a10++], c10 = e20.sections[a10++]; + if (c10 < 0) + o10 += s10, i10 += s10; + else { + for (var l10 = o10, u10 = i10, f10 = UL.empty; l10 += s10, u10 += c10, c10 && r10 && (f10 = f10.append(r10[a10 - 2 >> 1])), !(n10 || a10 == e20.sections.length || e20.sections[a10 + 1] < 0); ) + s10 = e20.sections[a10++], c10 = e20.sections[a10++]; + t10(o10, l10, i10, u10, f10), o10 = l10, i10 = u10; + } + } + } + function xF(e20, t10, n10) { + for (var r10 = [], o10 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3] ? [] : null, i10 = new SF(e20), a10 = new SF(t10), s10 = -1; ; ) + if (-1 == i10.ins && -1 == a10.ins) { + var c10 = Math.min(i10.len, a10.len); + bF(r10, c10, -1), i10.forward(c10), a10.forward(c10); + } else if (a10.ins >= 0 && (i10.ins < 0 || s10 == i10.i || 0 == i10.off && (a10.len < i10.len || a10.len == i10.len && !n10))) { + var l10 = a10.len; + for (bF(r10, a10.ins, -1); l10; ) { + var u10 = Math.min(i10.len, l10); + i10.ins >= 0 && s10 < i10.i && i10.len <= u10 && (bF(r10, 0, i10.ins), o10 && kF(o10, r10, i10.text), s10 = i10.i), i10.forward(u10), l10 -= u10; + } + a10.next(); + } else { + if (!(i10.ins >= 0)) { + if (i10.done && a10.done) + return o10 ? yF.createSet(r10, o10) : gF.create(r10); + throw new Error("Mismatched change set lengths"); + } + for (var f10 = 0, d10 = i10.len; d10; ) + if (-1 == a10.ins) { + var h10 = Math.min(d10, a10.len); + f10 += h10, d10 -= h10, a10.forward(h10); + } else { + if (!(0 == a10.ins && a10.len < d10)) + break; + d10 -= a10.len, a10.next(); + } + bF(r10, f10, s10 < i10.i ? i10.ins : 0), o10 && s10 < i10.i && kF(o10, r10, i10.text), s10 = i10.i, i10.forward(i10.len - d10); + } + } + function jF(e20, t10) { + for (var n10 = [], r10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2] ? [] : null, o10 = new SF(e20), i10 = new SF(t10), a10 = false; ; ) { + if (o10.done && i10.done) + return r10 ? yF.createSet(n10, r10) : gF.create(n10); + if (0 == o10.ins) + bF(n10, o10.len, 0, a10), o10.next(); + else if (0 != i10.len || i10.done) { + if (o10.done || i10.done) + throw new Error("Mismatched change set lengths"); + var s10 = Math.min(o10.len2, i10.len), c10 = n10.length; + if (-1 == o10.ins) { + var l10 = -1 == i10.ins ? -1 : i10.off ? 0 : i10.ins; + bF(n10, s10, l10, a10), r10 && l10 && kF(r10, n10, i10.text); + } else + -1 == i10.ins ? (bF(n10, o10.off ? 0 : o10.len, s10, a10), r10 && kF(r10, n10, o10.textBit(s10))) : (bF(n10, o10.off ? 0 : o10.len, i10.off ? 0 : i10.ins, a10), r10 && !i10.off && kF(r10, n10, i10.text)); + a10 = (o10.ins > s10 || i10.ins >= 0 && i10.len > s10) && (a10 || n10.length > c10), o10.forward2(s10), i10.forward(s10); + } else + bF(n10, 0, i10.ins, a10), r10 && kF(r10, n10, i10.text), i10.next(); + } + } + var SF = function() { + function e20(t10) { + No(this, e20), this.set = t10, this.i = 0, this.next(); + } + return Do(e20, [{ key: "next", value: function() { + var e21 = this.set.sections; + this.i < e21.length ? (this.len = e21[this.i++], this.ins = e21[this.i++]) : (this.len = 0, this.ins = -2), this.off = 0; + } }, { key: "done", get: function() { + return -2 == this.ins; + } }, { key: "len2", get: function() { + return this.ins < 0 ? this.len : this.ins; + } }, { key: "text", get: function() { + var e21 = this.set.inserted, t10 = this.i - 2 >> 1; + return t10 >= e21.length ? UL.empty : e21[t10]; + } }, { key: "textBit", value: function(e21) { + var t10 = this.set.inserted, n10 = this.i - 2 >> 1; + return n10 >= t10.length && !e21 ? UL.empty : t10[n10].slice(this.off, null == e21 ? void 0 : this.off + e21); + } }, { key: "forward", value: function(e21) { + e21 == this.len ? this.next() : (this.len -= e21, this.off += e21); + } }, { key: "forward2", value: function(e21) { + -1 == this.ins ? this.forward(e21) : e21 == this.ins ? this.next() : (this.ins -= e21, this.off += e21); + } }]), e20; + }(); + var CF = function() { + function e20(t10, n10, r10) { + No(this, e20), this.from = t10, this.to = n10, this.flags = r10; + } + return Do(e20, [{ key: "anchor", get: function() { + return 32 & this.flags ? this.to : this.from; + } }, { key: "head", get: function() { + return 32 & this.flags ? this.from : this.to; + } }, { key: "empty", get: function() { + return this.from == this.to; + } }, { key: "assoc", get: function() { + return 8 & this.flags ? -1 : 16 & this.flags ? 1 : 0; + } }, { key: "bidiLevel", get: function() { + var e21 = 7 & this.flags; + return 7 == e21 ? null : e21; + } }, { key: "goalColumn", get: function() { + var e21 = this.flags >> 6; + return 16777215 == e21 ? void 0 : e21; + } }, { key: "map", value: function(t10) { + var n10, r10, o10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1; + return this.empty ? n10 = r10 = t10.mapPos(this.from, o10) : (n10 = t10.mapPos(this.from, 1), r10 = t10.mapPos(this.to, -1)), n10 == this.from && r10 == this.to ? this : new e20(n10, r10, this.flags); + } }, { key: "extend", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21; + if (e21 <= this.anchor && t10 >= this.anchor) + return $F.range(e21, t10); + var n10 = Math.abs(e21 - this.anchor) > Math.abs(t10 - this.anchor) ? e21 : t10; + return $F.range(this.anchor, n10); + } }, { key: "eq", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return !(this.anchor != e21.anchor || this.head != e21.head || t10 && this.empty && this.assoc != e21.assoc); + } }, { key: "toJSON", value: function() { + return { anchor: this.anchor, head: this.head }; + } }], [{ key: "fromJSON", value: function(e21) { + if (!e21 || "number" != typeof e21.anchor || "number" != typeof e21.head) + throw new RangeError("Invalid JSON representation for SelectionRange"); + return $F.range(e21.anchor, e21.head); + } }, { key: "create", value: function(t10, n10, r10) { + return new e20(t10, n10, r10); + } }]), e20; + }(); + var $F = function() { + function e20(t10, n10) { + No(this, e20), this.ranges = t10, this.mainIndex = n10; + } + return Do(e20, [{ key: "map", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1; + return t10.empty ? this : e20.create(this.ranges.map(function(e21) { + return e21.map(t10, n10); + }), this.mainIndex); + } }, { key: "eq", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + if (this.ranges.length != e21.ranges.length || this.mainIndex != e21.mainIndex) + return false; + for (var n10 = 0; n10 < this.ranges.length; n10++) + if (!this.ranges[n10].eq(e21.ranges[n10], t10)) + return false; + return true; + } }, { key: "main", get: function() { + return this.ranges[this.mainIndex]; + } }, { key: "asSingle", value: function() { + return 1 == this.ranges.length ? this : new e20([this.main], 0); + } }, { key: "addRange", value: function(t10) { + var n10 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + return e20.create([t10].concat(this.ranges), n10 ? 0 : this.mainIndex + 1); + } }, { key: "replaceRange", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.mainIndex, r10 = this.ranges.slice(); + return r10[n10] = t10, e20.create(r10, this.mainIndex); + } }, { key: "toJSON", value: function() { + return { ranges: this.ranges.map(function(e21) { + return e21.toJSON(); + }), main: this.mainIndex }; + } }], [{ key: "fromJSON", value: function(t10) { + if (!t10 || !Array.isArray(t10.ranges) || "number" != typeof t10.main || t10.main >= t10.ranges.length) + throw new RangeError("Invalid JSON representation for EditorSelection"); + return new e20(t10.ranges.map(function(e21) { + return CF.fromJSON(e21); + }), t10.main); + } }, { key: "single", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t10; + return new e20([e20.range(t10, n10)], 0); + } }, { key: "create", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + if (0 == t10.length) + throw new RangeError("A selection needs at least one range"); + for (var r10 = 0, o10 = 0; o10 < t10.length; o10++) { + var i10 = t10[o10]; + if (i10.empty ? i10.from <= r10 : i10.from < r10) + return e20.normalized(t10.slice(), n10); + r10 = i10.to; + } + return new e20(t10, n10); + } }, { key: "cursor", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = arguments.length > 2 ? arguments[2] : void 0, r10 = arguments.length > 3 ? arguments[3] : void 0; + return CF.create(e21, e21, (0 == t10 ? 0 : t10 < 0 ? 8 : 16) | (null == n10 ? 7 : Math.min(6, n10)) | (null != r10 ? r10 : 16777215) << 6); + } }, { key: "range", value: function(e21, t10, n10, r10) { + var o10 = (null != n10 ? n10 : 16777215) << 6 | (null == r10 ? 7 : Math.min(6, r10)); + return t10 < e21 ? CF.create(t10, e21, 48 | o10) : CF.create(e21, t10, (t10 > e21 ? 8 : 0) | o10); + } }, { key: "normalized", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r10 = t10[n10]; + t10.sort(function(e21, t11) { + return e21.from - t11.from; + }), n10 = t10.indexOf(r10); + for (var o10 = 1; o10 < t10.length; o10++) { + var i10 = t10[o10], a10 = t10[o10 - 1]; + if (i10.empty ? i10.from <= a10.to : i10.from < a10.to) { + var s10 = a10.from, c10 = Math.max(i10.to, a10.to); + o10 <= n10 && n10--, t10.splice(--o10, 2, i10.anchor > i10.head ? e20.range(c10, s10) : e20.range(s10, c10)); + } + } + return new e20(t10, n10); + } }]), e20; + }(); + function _F(e20, t10) { + var n10, r10 = bo(e20.ranges); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + if (n10.value.to > t10) + throw new RangeError("Selection points outside of document"); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + } + var OF = 0; + var MF = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.combine = t10, this.compareInput = n10, this.compare = r10, this.isStatic = o10, this.id = OF++, this.default = t10([]), this.extensions = "function" == typeof i10 ? i10(this) : i10; + } + return Do(e20, [{ key: "reader", get: function() { + return this; + } }, { key: "of", value: function(e21) { + return new AF([], this, 0, e21); + } }, { key: "compute", value: function(e21, t10) { + if (this.isStatic) + throw new Error("Can't compute a static facet"); + return new AF(e21, this, 1, t10); + } }, { key: "computeN", value: function(e21, t10) { + if (this.isStatic) + throw new Error("Can't compute a static facet"); + return new AF(e21, this, 2, t10); + } }, { key: "from", value: function(e21, t10) { + return t10 || (t10 = function(e23) { + return e23; + }), this.compute([e21], function(n10) { + return t10(n10.field(e21)); + }); + } }], [{ key: "define", value: function() { + var t10 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return new e20(t10.combine || function(e21) { + return e21; + }, t10.compareInput || function(e21, t11) { + return e21 === t11; + }, t10.compare || (t10.combine ? function(e21, t11) { + return e21 === t11; + } : EF), !!t10.static, t10.enables); + } }]), e20; + }(); + function EF(e20, t10) { + return e20 == t10 || e20.length == t10.length && e20.every(function(e21, n10) { + return e21 === t10[n10]; + }); + } + var AF = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.dependencies = t10, this.facet = n10, this.type = r10, this.value = o10, this.id = OF++; + } + return Do(e20, [{ key: "dynamicSlot", value: function(e21) { + var t10, n10, r10 = this, o10 = this.value, i10 = this.facet.compareInput, a10 = this.id, s10 = e21[a10] >> 1, c10 = 2 == this.type, l10 = false, u10 = false, f10 = [], d10 = bo(this.dependencies); + try { + for (d10.s(); !(n10 = d10.n()).done; ) { + var h10 = n10.value; + "doc" == h10 ? l10 = true : "selection" == h10 ? u10 = true : 0 == (1 & (null !== (t10 = e21[h10.id]) && void 0 !== t10 ? t10 : 1)) && f10.push(e21[h10.id]); + } + } catch (e23) { + d10.e(e23); + } finally { + d10.f(); + } + return { create: function(e23) { + return e23.values[s10] = o10(e23), 1; + }, update: function(e23, t11) { + if (l10 && t11.docChanged || u10 && (t11.docChanged || t11.selection) || TF(e23, f10)) { + var n11 = o10(e23); + if (c10 ? !PF(n11, e23.values[s10], i10) : !i10(n11, e23.values[s10])) + return e23.values[s10] = n11, 1; + } + return 0; + }, reconfigure: function(e23, t11) { + var n11, l11 = t11.config.address[a10]; + if (null != l11) { + var u11 = JF(t11, l11); + if (r10.dependencies.every(function(n12) { + return n12 instanceof MF ? t11.facet(n12) === e23.facet(n12) : !(n12 instanceof NF) || t11.field(n12, false) == e23.field(n12, false); + }) || (c10 ? PF(n11 = o10(e23), u11, i10) : i10(n11 = o10(e23), u11))) + return e23.values[s10] = u11, 0; + } else + n11 = o10(e23); + return e23.values[s10] = n11, 1; + } }; + } }]), e20; + }(); + function PF(e20, t10, n10) { + if (e20.length != t10.length) + return false; + for (var r10 = 0; r10 < e20.length; r10++) + if (!n10(e20[r10], t10[r10])) + return false; + return true; + } + function TF(e20, t10) { + var n10, r10 = false, o10 = bo(t10); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + 1 & UF(e20, n10.value) && (r10 = true); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return r10; + } + var RF = MF.define({ static: true }); + var NF = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.id = t10, this.createF = n10, this.updateF = r10, this.compareF = o10, this.spec = i10, this.provides = void 0; + } + return Do(e20, [{ key: "create", value: function(e21) { + var t10 = this, n10 = e21.facet(RF).find(function(e23) { + return e23.field == t10; + }); + return ((null == n10 ? void 0 : n10.create) || this.createF)(e21); + } }, { key: "slot", value: function(e21) { + var t10 = this, n10 = e21[this.id] >> 1; + return { create: function(e23) { + return e23.values[n10] = t10.create(e23), 1; + }, update: function(e23, r10) { + var o10 = e23.values[n10], i10 = t10.updateF(o10, r10); + return t10.compareF(o10, i10) ? 0 : (e23.values[n10] = i10, 1); + }, reconfigure: function(e23, r10) { + return null != r10.config.address[t10.id] ? (e23.values[n10] = r10.field(t10), 0) : (e23.values[n10] = t10.create(e23), 1); + } }; + } }, { key: "init", value: function(e21) { + return [this, RF.of({ field: this, create: e21 })]; + } }, { key: "extension", get: function() { + return this; + } }], [{ key: "define", value: function(t10) { + var n10 = new e20(OF++, t10.create, t10.update, t10.compare || function(e21, t11) { + return e21 === t11; + }, t10); + return t10.provide && (n10.provides = t10.provide(n10)), n10; + } }]), e20; + }(); + var IF = 4; + var DF = 3; + var qF = 2; + var zF = 1; + function BF(e20) { + return function(t10) { + return new FF(t10, e20); + }; + } + var LF = { highest: BF(0), high: BF(zF), default: BF(qF), low: BF(DF), lowest: BF(IF) }; + var FF = Do(function e2(t10, n10) { + No(this, e2), this.inner = t10, this.prec = n10; + }); + var VF = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "of", value: function(e21) { + return new HF(this, e21); + } }, { key: "reconfigure", value: function(t10) { + return e20.reconfigure.of({ compartment: this, extension: t10 }); + } }, { key: "get", value: function(e21) { + return e21.config.compartments.get(this); + } }]), e20; + }(); + var HF = Do(function e3(t10, n10) { + No(this, e3), this.compartment = t10, this.inner = n10; + }); + var WF = function() { + function e20(t10, n10, r10, o10, i10, a10) { + for (No(this, e20), this.base = t10, this.compartments = n10, this.dynamicSlots = r10, this.address = o10, this.staticValues = i10, this.facets = a10, this.statusTemplate = []; this.statusTemplate.length < r10.length; ) + this.statusTemplate.push(0); + } + return Do(e20, [{ key: "staticFacet", value: function(e21) { + var t10 = this.address[e21.id]; + return null == t10 ? e21.default : this.staticValues[t10 >> 1]; + } }], [{ key: "resolve", value: function(t10, n10, r10) { + var o10, i10 = [], a10 = /* @__PURE__ */ Object.create(null), s10 = /* @__PURE__ */ new Map(), c10 = bo(function(e21, t11, n11) { + var r11 = [[], [], [], [], []], o11 = /* @__PURE__ */ new Map(); + function i11(e23, a11) { + var s11 = o11.get(e23); + if (null != s11) { + if (s11 <= a11) + return; + var c11 = r11[s11].indexOf(e23); + c11 > -1 && r11[s11].splice(c11, 1), e23 instanceof HF && n11.delete(e23.compartment); + } + if (o11.set(e23, a11), Array.isArray(e23)) { + var l11, u11 = bo(e23); + try { + for (u11.s(); !(l11 = u11.n()).done; ) { + i11(l11.value, a11); + } + } catch (e24) { + u11.e(e24); + } finally { + u11.f(); + } + } else if (e23 instanceof HF) { + if (n11.has(e23.compartment)) + throw new RangeError("Duplicate use of compartment in extensions"); + var f11 = t11.get(e23.compartment) || e23.inner; + n11.set(e23.compartment, f11), i11(f11, a11); + } else if (e23 instanceof FF) + i11(e23.inner, e23.prec); + else if (e23 instanceof NF) + r11[a11].push(e23), e23.provides && i11(e23.provides, a11); + else if (e23 instanceof AF) + r11[a11].push(e23), e23.facet.extensions && i11(e23.facet.extensions, qF); + else { + var d11 = e23.extension; + if (!d11) + throw new Error("Unrecognized extension value in extension set (".concat(e23, "). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.")); + i11(d11, a11); + } + } + return i11(e21, qF), r11.reduce(function(e23, t12) { + return e23.concat(t12); + }); + }(t10, n10, s10)); + try { + for (c10.s(); !(o10 = c10.n()).done; ) { + var l10 = o10.value; + l10 instanceof NF ? i10.push(l10) : (a10[l10.facet.id] || (a10[l10.facet.id] = [])).push(l10); + } + } catch (e21) { + c10.e(e21); + } finally { + c10.f(); + } + for (var u10 = /* @__PURE__ */ Object.create(null), f10 = [], d10 = [], h10 = function() { + var e21 = p10[v10]; + u10[e21.id] = d10.length << 1, d10.push(function(t11) { + return e21.slot(t11); + }); + }, v10 = 0, p10 = i10; v10 < p10.length; v10++) + h10(); + var m10 = null == r10 ? void 0 : r10.config.facets, g10 = function() { + var e21 = a10[y10], t11 = e21[0].facet, n11 = m10 && m10[y10] || []; + if (e21.every(function(e23) { + return 0 == e23.type; + })) + if (u10[t11.id] = f10.length << 1 | 1, EF(n11, e21)) + f10.push(r10.facet(t11)); + else { + var o11 = t11.combine(e21.map(function(e23) { + return e23.value; + })); + f10.push(r10 && t11.compare(o11, r10.facet(t11)) ? r10.facet(t11) : o11); + } + else { + var i11, s11 = bo(e21); + try { + var c11 = function() { + var e23 = i11.value; + 0 == e23.type ? (u10[e23.id] = f10.length << 1 | 1, f10.push(e23.value)) : (u10[e23.id] = d10.length << 1, d10.push(function(t12) { + return e23.dynamicSlot(t12); + })); + }; + for (s11.s(); !(i11 = s11.n()).done; ) + c11(); + } catch (e23) { + s11.e(e23); + } finally { + s11.f(); + } + u10[t11.id] = d10.length << 1, d10.push(function(n12) { + return function(e23, t12, n13) { + var r11 = n13.map(function(t13) { + return e23[t13.id]; + }), o12 = n13.map(function(e24) { + return e24.type; + }), i12 = r11.filter(function(e24) { + return !(1 & e24); + }), a11 = e23[t12.id] >> 1; + function s12(e24) { + for (var n14 = [], i13 = 0; i13 < r11.length; i13++) { + var a12 = JF(e24, r11[i13]); + if (2 == o12[i13]) { + var s13, c12 = bo(a12); + try { + for (c12.s(); !(s13 = c12.n()).done; ) { + var l11 = s13.value; + n14.push(l11); + } + } catch (e25) { + c12.e(e25); + } finally { + c12.f(); + } + } else + n14.push(a12); + } + return t12.combine(n14); + } + return { create: function(e24) { + var t13, n14 = bo(r11); + try { + for (n14.s(); !(t13 = n14.n()).done; ) + UF(e24, t13.value); + } catch (e25) { + n14.e(e25); + } finally { + n14.f(); + } + return e24.values[a11] = s12(e24), 1; + }, update: function(e24, n14) { + if (!TF(e24, i12)) + return 0; + var r12 = s12(e24); + return t12.compare(r12, e24.values[a11]) ? 0 : (e24.values[a11] = r12, 1); + }, reconfigure: function(e24, o13) { + var i13 = TF(e24, r11), c12 = o13.config.facets[t12.id], l11 = o13.facet(t12); + if (c12 && !i13 && EF(n13, c12)) + return e24.values[a11] = l11, 0; + var u11 = s12(e24); + return t12.compare(u11, l11) ? (e24.values[a11] = l11, 0) : (e24.values[a11] = u11, 1); + } }; + }(n12, t11, e21); + }); + } + }; + for (var y10 in a10) + g10(); + return new e20(t10, s10, d10.map(function(e21) { + return e21(u10); + }), u10, f10, a10); + } }]), e20; + }(); + function UF(e20, t10) { + if (1 & t10) + return 2; + var n10 = t10 >> 1, r10 = e20.status[n10]; + if (4 == r10) + throw new Error("Cyclic dependency between fields and/or facets"); + if (2 & r10) + return r10; + e20.status[n10] = 4; + var o10 = e20.computeSlot(e20, e20.config.dynamicSlots[n10]); + return e20.status[n10] = 2 | o10; + } + function JF(e20, t10) { + return 1 & t10 ? e20.config.staticValues[t10 >> 1] : e20.values[t10 >> 1]; + } + var KF = MF.define(); + var GF = MF.define({ combine: function(e20) { + return e20.some(function(e21) { + return e21; + }); + }, static: true }); + var QF = MF.define({ combine: function(e20) { + return e20.length ? e20[0] : void 0; + }, static: true }); + var YF = MF.define(); + var XF = MF.define(); + var ZF = MF.define(); + var eV = MF.define({ combine: function(e20) { + return !!e20.length && e20[0]; + } }); + var tV = function() { + function e20(t10, n10) { + No(this, e20), this.type = t10, this.value = n10; + } + return Do(e20, null, [{ key: "define", value: function() { + return new nV(); + } }]), e20; + }(); + var nV = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "of", value: function(e21) { + return new tV(this, e21); + } }]), e20; + }(); + var rV = function() { + function e20(t10) { + No(this, e20), this.map = t10; + } + return Do(e20, [{ key: "of", value: function(e21) { + return new oV(this, e21); + } }]), e20; + }(); + var oV = function() { + function e20(t10, n10) { + No(this, e20), this.type = t10, this.value = n10; + } + return Do(e20, [{ key: "map", value: function(t10) { + var n10 = this.type.map(this.value, t10); + return void 0 === n10 ? void 0 : n10 == this.value ? this : new e20(this.type, n10); + } }, { key: "is", value: function(e21) { + return this.type == e21; + } }], [{ key: "define", value: function() { + return new rV((arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).map || function(e21) { + return e21; + }); + } }, { key: "mapEffects", value: function(e21, t10) { + if (!e21.length) + return e21; + var n10, r10 = [], o10 = bo(e21); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value.map(t10); + i10 && r10.push(i10); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return r10; + } }]), e20; + }(); + oV.reconfigure = oV.define(), oV.appendConfig = oV.define(); + var iV = function() { + function e20(t10, n10, r10, o10, i10, a10) { + No(this, e20), this.startState = t10, this.changes = n10, this.selection = r10, this.effects = o10, this.annotations = i10, this.scrollIntoView = a10, this._doc = null, this._state = null, r10 && _F(r10, n10.newLength), i10.some(function(t11) { + return t11.type == e20.time; + }) || (this.annotations = i10.concat(e20.time.of(Date.now()))); + } + return Do(e20, [{ key: "newDoc", get: function() { + return this._doc || (this._doc = this.changes.apply(this.startState.doc)); + } }, { key: "newSelection", get: function() { + return this.selection || this.startState.selection.map(this.changes); + } }, { key: "state", get: function() { + return this._state || this.startState.applyTransaction(this), this._state; + } }, { key: "annotation", value: function(e21) { + var t10, n10 = bo(this.annotations); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + if (r10.type == e21) + return r10.value; + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "docChanged", get: function() { + return !this.changes.empty; + } }, { key: "reconfigured", get: function() { + return this.startState.config != this.state.config; + } }, { key: "isUserEvent", value: function(t10) { + var n10 = this.annotation(e20.userEvent); + return !(!n10 || !(n10 == t10 || n10.length > t10.length && n10.slice(0, t10.length) == t10 && "." == n10[t10.length])); + } }], [{ key: "create", value: function(t10, n10, r10, o10, i10, a10) { + return new e20(t10, n10, r10, o10, i10, a10); + } }]), e20; + }(); + function aV(e20, t10) { + for (var n10 = [], r10 = 0, o10 = 0; ; ) { + var i10 = void 0, a10 = void 0; + if (r10 < e20.length && (o10 == t10.length || t10[o10] >= e20[r10])) + i10 = e20[r10++], a10 = e20[r10++]; + else { + if (!(o10 < t10.length)) + return n10; + i10 = t10[o10++], a10 = t10[o10++]; + } + !n10.length || n10[n10.length - 1] < i10 ? n10.push(i10, a10) : n10[n10.length - 1] < a10 && (n10[n10.length - 1] = a10); + } + } + function sV(e20, t10, n10) { + var r10, o10, i10, a10; + return n10 ? (o10 = t10.changes, i10 = yF.empty(t10.changes.length), a10 = e20.changes.compose(t10.changes)) : (o10 = t10.changes.map(e20.changes), i10 = e20.changes.mapDesc(t10.changes, true), a10 = e20.changes.compose(o10)), { changes: a10, selection: t10.selection ? t10.selection.map(i10) : null === (r10 = e20.selection) || void 0 === r10 ? void 0 : r10.map(o10), effects: oV.mapEffects(e20.effects, o10).concat(oV.mapEffects(t10.effects, i10)), annotations: e20.annotations.length ? e20.annotations.concat(t10.annotations) : t10.annotations, scrollIntoView: e20.scrollIntoView || t10.scrollIntoView }; + } + function cV(e20, t10, n10) { + var r10 = t10.selection, o10 = fV(t10.annotations); + return t10.userEvent && (o10 = o10.concat(iV.userEvent.of(t10.userEvent))), { changes: t10.changes instanceof yF ? t10.changes : yF.of(t10.changes || [], n10, e20.facet(QF)), selection: r10 && (r10 instanceof $F ? r10 : $F.single(r10.anchor, r10.head)), effects: fV(t10.effects), annotations: o10, scrollIntoView: !!t10.scrollIntoView }; + } + function lV(e20, t10, n10) { + var r10 = cV(e20, t10.length ? t10[0] : {}, e20.doc.length); + t10.length && false === t10[0].filter && (n10 = false); + for (var o10 = 1; o10 < t10.length; o10++) { + false === t10[o10].filter && (n10 = false); + var i10 = !!t10[o10].sequential; + r10 = sV(r10, cV(e20, t10[o10], i10 ? r10.changes.newLength : e20.doc.length), i10); + } + var a10 = iV.create(e20, r10.changes, r10.selection, r10.effects, r10.annotations, r10.scrollIntoView); + return function(e21) { + for (var t11 = e21.startState, n11 = t11.facet(ZF), r11 = e21, o11 = n11.length - 1; o11 >= 0; o11--) { + var i11 = n11[o11](e21); + i11 && Object.keys(i11).length && (r11 = sV(r11, cV(t11, i11, e21.changes.newLength), true)); + } + return r11 == e21 ? e21 : iV.create(t11, e21.changes, e21.selection, r11.effects, r11.annotations, r11.scrollIntoView); + }(n10 ? function(e21) { + var t11, n11 = e21.startState, r11 = true, o11 = bo(n11.facet(YF)); + try { + for (o11.s(); !(t11 = o11.n()).done; ) { + var i11 = (0, t11.value)(e21); + if (false === i11) { + r11 = false; + break; + } + Array.isArray(i11) && (r11 = true === r11 ? i11 : aV(r11, i11)); + } + } catch (e23) { + o11.e(e23); + } finally { + o11.f(); + } + if (true !== r11) { + var a11, s10; + if (false === r11) + s10 = e21.changes.invertedDesc, a11 = yF.empty(n11.doc.length); + else { + var c10 = e21.changes.filter(r11); + a11 = c10.changes, s10 = c10.filtered.mapDesc(c10.changes).invertedDesc; + } + e21 = iV.create(n11, a11, e21.selection && e21.selection.map(s10), oV.mapEffects(e21.effects, s10), e21.annotations, e21.scrollIntoView); + } + for (var l10 = n11.facet(XF), u10 = l10.length - 1; u10 >= 0; u10--) { + var f10 = l10[u10](e21); + e21 = f10 instanceof iV ? f10 : Array.isArray(f10) && 1 == f10.length && f10[0] instanceof iV ? f10[0] : lV(n11, fV(f10), false); + } + return e21; + }(a10) : a10); + } + iV.time = tV.define(), iV.userEvent = tV.define(), iV.addToHistory = tV.define(), iV.remote = tV.define(); + var uV = []; + function fV(e20) { + return null == e20 ? uV : Array.isArray(e20) ? e20 : [e20]; + } + var dV; + var hV = function(e20) { + return e20[e20.Word = 0] = "Word", e20[e20.Space = 1] = "Space", e20[e20.Other = 2] = "Other", e20; + }(hV || (hV = {})); + var vV = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + try { + dV = new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u"); + } catch (E_2) { + } + function pV(e20) { + return function(t10) { + if (!/\S/.test(t10)) + return hV.Space; + if (function(e21) { + if (dV) + return dV.test(e21); + for (var t11 = 0; t11 < e21.length; t11++) { + var n11 = e21[t11]; + if (/\w/.test(n11) || n11 > "\x80" && (n11.toUpperCase() != n11.toLowerCase() || vV.test(n11))) + return true; + } + return false; + }(t10)) + return hV.Word; + for (var n10 = 0; n10 < e20.length; n10++) + if (t10.indexOf(e20[n10]) > -1) + return hV.Word; + return hV.Other; + }; + } + var mV = function() { + function e20(t10, n10, r10, o10, i10, a10) { + No(this, e20), this.config = t10, this.doc = n10, this.selection = r10, this.values = o10, this.status = t10.statusTemplate.slice(), this.computeSlot = i10, a10 && (a10._state = this); + for (var s10 = 0; s10 < this.config.dynamicSlots.length; s10++) + UF(this, s10 << 1); + this.computeSlot = null; + } + return Do(e20, [{ key: "field", value: function(e21) { + var t10 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n10 = this.config.address[e21.id]; + if (null != n10) + return UF(this, n10), JF(this, n10); + if (t10) + throw new RangeError("Field is not present in this state"); + } }, { key: "update", value: function() { + for (var e21 = arguments.length, t10 = new Array(e21), n10 = 0; n10 < e21; n10++) + t10[n10] = arguments[n10]; + return lV(this, t10, true); + } }, { key: "applyTransaction", value: function(t10) { + var n10, r10, o10 = this, i10 = this.config, a10 = i10, s10 = a10.base, c10 = a10.compartments, l10 = bo(t10.effects); + try { + for (l10.s(); !(n10 = l10.n()).done; ) { + var u10 = n10.value; + u10.is(VF.reconfigure) ? (i10 && (c10 = /* @__PURE__ */ new Map(), i10.compartments.forEach(function(e21, t11) { + return c10.set(t11, e21); + }), i10 = null), c10.set(u10.value.compartment, u10.value.extension)) : u10.is(oV.reconfigure) ? (i10 = null, s10 = u10.value) : u10.is(oV.appendConfig) && (i10 = null, s10 = fV(s10).concat(u10.value)); + } + } catch (e21) { + l10.e(e21); + } finally { + l10.f(); + } + i10 ? r10 = t10.startState.values.slice() : r10 = new e20(i10 = WF.resolve(s10, c10, this), this.doc, this.selection, i10.dynamicSlots.map(function() { + return null; + }), function(e21, t11) { + return t11.reconfigure(e21, o10); + }, null).values; + var f10 = t10.startState.facet(GF) ? t10.newSelection : t10.newSelection.asSingle(); + new e20(i10, t10.newDoc, f10, r10, function(e21, n11) { + return n11.update(e21, t10); + }, t10); + } }, { key: "replaceSelection", value: function(e21) { + return "string" == typeof e21 && (e21 = this.toText(e21)), this.changeByRange(function(t10) { + return { changes: { from: t10.from, to: t10.to, insert: e21 }, range: $F.cursor(t10.from + e21.length) }; + }); + } }, { key: "changeByRange", value: function(e21) { + for (var t10 = this.selection, n10 = e21(t10.ranges[0]), r10 = this.changes(n10.changes), o10 = [n10.range], i10 = fV(n10.effects), a10 = 1; a10 < t10.ranges.length; a10++) { + for (var s10 = e21(t10.ranges[a10]), c10 = this.changes(s10.changes), l10 = c10.map(r10), u10 = 0; u10 < a10; u10++) + o10[u10] = o10[u10].map(l10); + var f10 = r10.mapDesc(c10, true); + o10.push(s10.range.map(f10)), r10 = r10.compose(l10), i10 = oV.mapEffects(i10, l10).concat(oV.mapEffects(fV(s10.effects), f10)); + } + return { changes: r10, selection: $F.create(o10, t10.mainIndex), effects: i10 }; + } }, { key: "changes", value: function() { + var t10 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; + return t10 instanceof yF ? t10 : yF.of(t10, this.doc.length, this.facet(e20.lineSeparator)); + } }, { key: "toText", value: function(t10) { + return UL.of(t10.split(this.facet(e20.lineSeparator) || pF)); + } }, { key: "sliceDoc", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.doc.length; + return this.doc.sliceString(e21, t10, this.lineBreak); + } }, { key: "facet", value: function(e21) { + var t10 = this.config.address[e21.id]; + return null == t10 ? e21.default : (UF(this, t10), JF(this, t10)); + } }, { key: "toJSON", value: function(e21) { + var t10 = { doc: this.sliceDoc(), selection: this.selection.toJSON() }; + if (e21) + for (var n10 in e21) { + var r10 = e21[n10]; + r10 instanceof NF && null != this.config.address[r10.id] && (t10[n10] = r10.spec.toJSON(this.field(e21[n10]), this)); + } + return t10; + } }, { key: "tabSize", get: function() { + return this.facet(e20.tabSize); + } }, { key: "lineBreak", get: function() { + return this.facet(e20.lineSeparator) || "\n"; + } }, { key: "readOnly", get: function() { + return this.facet(eV); + } }, { key: "phrase", value: function(t10) { + for (var n10 = arguments.length, r10 = new Array(n10 > 1 ? n10 - 1 : 0), o10 = 1; o10 < n10; o10++) + r10[o10 - 1] = arguments[o10]; + var i10, a10 = bo(this.facet(e20.phrases)); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + if (Object.prototype.hasOwnProperty.call(s10, t10)) { + t10 = s10[t10]; + break; + } + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return r10.length && (t10 = t10.replace(/\$(\$|\d*)/g, function(e21, t11) { + if ("$" == t11) + return "$"; + var n11 = +(t11 || 1); + return !n11 || n11 > r10.length ? e21 : r10[n11 - 1]; + })), t10; + } }, { key: "languageDataAt", value: function(e21, t10) { + var n10, r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1, o10 = [], i10 = bo(this.facet(KF)); + try { + for (i10.s(); !(n10 = i10.n()).done; ) { + var a10, s10 = bo((0, n10.value)(this, t10, r10)); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + Object.prototype.hasOwnProperty.call(c10, e21) && o10.push(c10[e21]); + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + return o10; + } }, { key: "charCategorizer", value: function(e21) { + return pV(this.languageDataAt("wordChars", e21).join("")); + } }, { key: "wordAt", value: function(e21) { + for (var t10 = this.doc.lineAt(e21), n10 = t10.text, r10 = t10.from, o10 = t10.length, i10 = this.charCategorizer(e21), a10 = e21 - r10, s10 = e21 - r10; a10 > 0; ) { + var c10 = sF(n10, a10, false); + if (i10(n10.slice(c10, a10)) != hV.Word) + break; + a10 = c10; + } + for (; s10 < o10; ) { + var l10 = sF(n10, s10); + if (i10(n10.slice(s10, l10)) != hV.Word) + break; + s10 = l10; + } + return a10 == s10 ? null : $F.range(a10 + r10, s10 + r10); + } }], [{ key: "fromJSON", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r10 = arguments.length > 2 ? arguments[2] : void 0; + if (!t10 || "string" != typeof t10.doc) + throw new RangeError("Invalid JSON representation for EditorState"); + var o10 = []; + if (r10) { + var i10 = function() { + if (Object.prototype.hasOwnProperty.call(t10, a10)) { + var e21 = r10[a10], n11 = t10[a10]; + o10.push(e21.init(function(t11) { + return e21.spec.fromJSON(n11, t11); + })); + } + }; + for (var a10 in r10) + i10(); + } + return e20.create({ doc: t10.doc, selection: $F.fromJSON(t10.selection), extensions: n10.extensions ? o10.concat([n10.extensions]) : o10 }); + } }, { key: "create", value: function() { + var t10 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n10 = WF.resolve(t10.extensions || [], /* @__PURE__ */ new Map()), r10 = t10.doc instanceof UL ? t10.doc : UL.of((t10.doc || "").split(n10.staticFacet(e20.lineSeparator) || pF)), o10 = t10.selection ? t10.selection instanceof $F ? t10.selection : $F.single(t10.selection.anchor, t10.selection.head) : $F.single(0); + return _F(o10, r10.length), n10.staticFacet(GF) || (o10 = o10.asSingle()), new e20(n10, r10, o10, n10.dynamicSlots.map(function() { + return null; + }), function(e21, t11) { + return t11.create(e21); + }, null); + } }]), e20; + }(); + function gV(e20, t10) { + var n10, r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, o10 = {}, i10 = bo(e20); + try { + for (i10.s(); !(n10 = i10.n()).done; ) + for (var a10 = n10.value, s10 = 0, c10 = Object.keys(a10); s10 < c10.length; s10++) { + var l10 = c10[s10], u10 = a10[l10], f10 = o10[l10]; + if (void 0 === f10) + o10[l10] = u10; + else if (f10 === u10 || void 0 === u10) + ; + else { + if (!Object.hasOwnProperty.call(r10, l10)) + throw new Error("Config merge conflict for field " + l10); + o10[l10] = r10[l10](f10, u10); + } + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + for (var d10 in t10) + void 0 === o10[d10] && (o10[d10] = t10[d10]); + return o10; + } + mV.allowMultipleSelections = GF, mV.tabSize = MF.define({ combine: function(e20) { + return e20.length ? e20[0] : 4; + } }), mV.lineSeparator = QF, mV.readOnly = eV, mV.phrases = MF.define({ compare: function(e20, t10) { + var n10 = Object.keys(e20), r10 = Object.keys(t10); + return n10.length == r10.length && n10.every(function(n11) { + return e20[n11] == t10[n11]; + }); + } }), mV.languageData = KF, mV.changeFilter = YF, mV.transactionFilter = XF, mV.transactionExtender = ZF, VF.reconfigure = oV.define(); + var yV = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "eq", value: function(e21) { + return this == e21; + } }, { key: "range", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21; + return bV.create(e21, t10, this); + } }]), e20; + }(); + yV.prototype.startSide = yV.prototype.endSide = 0, yV.prototype.point = false, yV.prototype.mapMode = mF.TrackDel; + var bV = function() { + function e20(t10, n10, r10) { + No(this, e20), this.from = t10, this.to = n10, this.value = r10; + } + return Do(e20, null, [{ key: "create", value: function(t10, n10, r10) { + return new e20(t10, n10, r10); + } }]), e20; + }(); + function kV(e20, t10) { + return e20.from - t10.from || e20.value.startSide - t10.value.startSide; + } + var wV = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.from = t10, this.to = n10, this.value = r10, this.maxPoint = o10; + } + return Do(e20, [{ key: "length", get: function() { + return this.to[this.to.length - 1]; + } }, { key: "findIndex", value: function(e21, t10, n10) { + for (var r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o10 = n10 ? this.to : this.from, i10 = r10, a10 = o10.length; ; ) { + if (i10 == a10) + return i10; + var s10 = i10 + a10 >> 1, c10 = o10[s10] - e21 || (n10 ? this.value[s10].endSide : this.value[s10].startSide) - t10; + if (s10 == i10) + return c10 >= 0 ? i10 : a10; + c10 >= 0 ? a10 = s10 : i10 = s10 + 1; + } + } }, { key: "between", value: function(e21, t10, n10, r10) { + for (var o10 = this.findIndex(t10, -1e9, true), i10 = this.findIndex(n10, 1e9, false, o10); o10 < i10; o10++) + if (false === r10(this.from[o10] + e21, this.to[o10] + e21, this.value[o10])) + return false; + } }, { key: "map", value: function(t10, n10) { + for (var r10 = [], o10 = [], i10 = [], a10 = -1, s10 = -1, c10 = 0; c10 < this.value.length; c10++) { + var l10 = this.value[c10], u10 = this.from[c10] + t10, f10 = this.to[c10] + t10, d10 = void 0, h10 = void 0; + if (u10 == f10) { + var v10 = n10.mapPos(u10, l10.startSide, l10.mapMode); + if (null == v10) + continue; + if (d10 = h10 = v10, l10.startSide != l10.endSide && (h10 = n10.mapPos(u10, l10.endSide)) < d10) + continue; + } else if ((d10 = n10.mapPos(u10, l10.startSide)) > (h10 = n10.mapPos(f10, l10.endSide)) || d10 == h10 && l10.startSide > 0 && l10.endSide <= 0) + continue; + (h10 - d10 || l10.endSide - l10.startSide) < 0 || (a10 < 0 && (a10 = d10), l10.point && (s10 = Math.max(s10, h10 - d10)), r10.push(l10), o10.push(d10 - a10), i10.push(h10 - a10)); + } + return { mapped: r10.length ? new e20(o10, i10, r10, s10) : null, pos: a10 }; + } }]), e20; + }(); + var xV = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.chunkPos = t10, this.chunk = n10, this.nextLayer = r10, this.maxPoint = o10; + } + return Do(e20, [{ key: "length", get: function() { + var e21 = this.chunk.length - 1; + return e21 < 0 ? 0 : Math.max(this.chunkEnd(e21), this.nextLayer.length); + } }, { key: "size", get: function() { + if (this.isEmpty) + return 0; + var e21, t10 = this.nextLayer.size, n10 = bo(this.chunk); + try { + for (n10.s(); !(e21 = n10.n()).done; ) { + t10 += e21.value.value.length; + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + return t10; + } }, { key: "chunkEnd", value: function(e21) { + return this.chunkPos[e21] + this.chunk[e21].length; + } }, { key: "update", value: function(t10) { + var n10 = t10.add, r10 = void 0 === n10 ? [] : n10, o10 = t10.sort, i10 = void 0 !== o10 && o10, a10 = t10.filterFrom, s10 = void 0 === a10 ? 0 : a10, c10 = t10.filterTo, l10 = void 0 === c10 ? this.length : c10, u10 = t10.filter; + if (0 == r10.length && !u10) + return this; + if (i10 && (r10 = r10.slice().sort(kV)), this.isEmpty) + return r10.length ? e20.of(r10) : this; + for (var f10 = new CV(this, null, -1).goto(0), d10 = 0, h10 = [], v10 = new jV(); f10.value || d10 < r10.length; ) + if (d10 < r10.length && (f10.from - r10[d10].from || f10.startSide - r10[d10].value.startSide) >= 0) { + var p10 = r10[d10++]; + v10.addInner(p10.from, p10.to, p10.value) || h10.push(p10); + } else + 1 == f10.rangeIndex && f10.chunkIndex < this.chunk.length && (d10 == r10.length || this.chunkEnd(f10.chunkIndex) < r10[d10].from) && (!u10 || s10 > this.chunkEnd(f10.chunkIndex) || l10 < this.chunkPos[f10.chunkIndex]) && v10.addChunk(this.chunkPos[f10.chunkIndex], this.chunk[f10.chunkIndex]) ? f10.nextChunk() : ((!u10 || s10 > f10.to || l10 < f10.from || u10(f10.from, f10.to, f10.value)) && (v10.addInner(f10.from, f10.to, f10.value) || h10.push(bV.create(f10.from, f10.to, f10.value))), f10.next()); + return v10.finishInner(this.nextLayer.isEmpty && !h10.length ? e20.empty : this.nextLayer.update({ add: h10, filter: u10, filterFrom: s10, filterTo: l10 })); + } }, { key: "map", value: function(t10) { + if (t10.empty || this.isEmpty) + return this; + for (var n10 = [], r10 = [], o10 = -1, i10 = 0; i10 < this.chunk.length; i10++) { + var a10 = this.chunkPos[i10], s10 = this.chunk[i10], c10 = t10.touchesRange(a10, a10 + s10.length); + if (false === c10) + o10 = Math.max(o10, s10.maxPoint), n10.push(s10), r10.push(t10.mapPos(a10)); + else if (true === c10) { + var l10 = s10.map(a10, t10), u10 = l10.mapped, f10 = l10.pos; + u10 && (o10 = Math.max(o10, u10.maxPoint), n10.push(u10), r10.push(f10)); + } + } + var d10 = this.nextLayer.map(t10); + return 0 == n10.length ? d10 : new e20(r10, n10, d10 || e20.empty, o10); + } }, { key: "between", value: function(e21, t10, n10) { + if (!this.isEmpty) { + for (var r10 = 0; r10 < this.chunk.length; r10++) { + var o10 = this.chunkPos[r10], i10 = this.chunk[r10]; + if (t10 >= o10 && e21 <= o10 + i10.length && false === i10.between(o10, e21 - o10, t10 - o10, n10)) + return; + } + this.nextLayer.between(e21, t10, n10); + } + } }, { key: "iter", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0; + return $V.from([this]).goto(e21); + } }, { key: "isEmpty", get: function() { + return this.nextLayer == this; + } }], [{ key: "create", value: function(t10, n10, r10, o10) { + return new e20(t10, n10, r10, o10); + } }, { key: "iter", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + return $V.from(e21).goto(t10); + } }, { key: "compare", value: function(e21, t10, n10, r10) { + var o10 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : -1, i10 = e21.filter(function(e23) { + return e23.maxPoint > 0 || !e23.isEmpty && e23.maxPoint >= o10; + }), a10 = t10.filter(function(e23) { + return e23.maxPoint > 0 || !e23.isEmpty && e23.maxPoint >= o10; + }), s10 = SV(i10, a10, n10), c10 = new OV(i10, s10, o10), l10 = new OV(a10, s10, o10); + n10.iterGaps(function(e23, t11, n11) { + return MV(c10, e23, l10, t11, n11, r10); + }), n10.empty && 0 == n10.length && MV(c10, 0, l10, 0, 0, r10); + } }, { key: "eq", value: function(e21, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r10 = arguments.length > 3 ? arguments[3] : void 0; + null == r10 && (r10 = 999999999); + var o10 = e21.filter(function(e23) { + return !e23.isEmpty && t10.indexOf(e23) < 0; + }), i10 = t10.filter(function(t11) { + return !t11.isEmpty && e21.indexOf(t11) < 0; + }); + if (o10.length != i10.length) + return false; + if (!o10.length) + return true; + for (var a10 = SV(o10, i10), s10 = new OV(o10, a10, 0).goto(n10), c10 = new OV(i10, a10, 0).goto(n10); ; ) { + if (s10.to != c10.to || !EV(s10.active, c10.active) || s10.point && (!c10.point || !s10.point.eq(c10.point))) + return false; + if (s10.to > r10) + return true; + s10.next(), c10.next(); + } + } }, { key: "spans", value: function(e21, t10, n10, r10) { + for (var o10 = new OV(e21, null, arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : -1).goto(t10), i10 = t10, a10 = o10.openStart; ; ) { + var s10 = Math.min(o10.to, n10); + if (o10.point) { + var c10 = o10.activeForPoint(o10.to), l10 = o10.pointFrom < t10 ? c10.length + 1 : Math.min(c10.length, a10); + r10.point(i10, s10, o10.point, c10, l10, o10.pointRank), a10 = Math.min(o10.openEnd(s10), c10.length); + } else + s10 > i10 && (r10.span(i10, s10, o10.active, a10), a10 = o10.openEnd(s10)); + if (o10.to > n10) + return a10 + (o10.point && o10.to > n10 ? 1 : 0); + i10 = o10.to, o10.next(); + } + } }, { key: "of", value: function(e21) { + var t10, n10 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r10 = new jV(), o10 = bo(e21 instanceof bV ? [e21] : n10 ? function(e23) { + if (e23.length > 1) + for (var t11 = e23[0], n11 = 1; n11 < e23.length; n11++) { + var r11 = e23[n11]; + if (kV(t11, r11) > 0) + return e23.slice().sort(kV); + t11 = r11; + } + return e23; + }(e21) : e21); + try { + for (o10.s(); !(t10 = o10.n()).done; ) { + var i10 = t10.value; + r10.add(i10.from, i10.to, i10.value); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return r10.finish(); + } }, { key: "join", value: function(t10) { + if (!t10.length) + return e20.empty; + for (var n10 = t10[t10.length - 1], r10 = t10.length - 2; r10 >= 0; r10--) + for (var o10 = t10[r10]; o10 != e20.empty; o10 = o10.nextLayer) + n10 = new e20(o10.chunkPos, o10.chunk, n10, Math.max(o10.maxPoint, n10.maxPoint)); + return n10; + } }]), e20; + }(); + xV.empty = new xV([], [], null, -1), xV.empty.nextLayer = xV.empty; + var jV = function() { + function e20() { + No(this, e20), this.chunks = [], this.chunkPos = [], this.chunkStart = -1, this.last = null, this.lastFrom = -1e9, this.lastTo = -1e9, this.from = [], this.to = [], this.value = [], this.maxPoint = -1, this.setMaxPoint = -1, this.nextLayer = null; + } + return Do(e20, [{ key: "finishChunk", value: function(e21) { + this.chunks.push(new wV(this.from, this.to, this.value, this.maxPoint)), this.chunkPos.push(this.chunkStart), this.chunkStart = -1, this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint), this.maxPoint = -1, e21 && (this.from = [], this.to = [], this.value = []); + } }, { key: "add", value: function(t10, n10, r10) { + this.addInner(t10, n10, r10) || (this.nextLayer || (this.nextLayer = new e20())).add(t10, n10, r10); + } }, { key: "addInner", value: function(e21, t10, n10) { + var r10 = e21 - this.lastTo || n10.startSide - this.last.endSide; + if (r10 <= 0 && (e21 - this.lastFrom || n10.startSide - this.last.startSide) < 0) + throw new Error("Ranges must be added sorted by `from` position and `startSide`"); + return !(r10 < 0) && (250 == this.from.length && this.finishChunk(true), this.chunkStart < 0 && (this.chunkStart = e21), this.from.push(e21 - this.chunkStart), this.to.push(t10 - this.chunkStart), this.last = n10, this.lastFrom = e21, this.lastTo = t10, this.value.push(n10), n10.point && (this.maxPoint = Math.max(this.maxPoint, t10 - e21)), true); + } }, { key: "addChunk", value: function(e21, t10) { + if ((e21 - this.lastTo || t10.value[0].startSide - this.last.endSide) < 0) + return false; + this.from.length && this.finishChunk(true), this.setMaxPoint = Math.max(this.setMaxPoint, t10.maxPoint), this.chunks.push(t10), this.chunkPos.push(e21); + var n10 = t10.value.length - 1; + return this.last = t10.value[n10], this.lastFrom = t10.from[n10] + e21, this.lastTo = t10.to[n10] + e21, true; + } }, { key: "finish", value: function() { + return this.finishInner(xV.empty); + } }, { key: "finishInner", value: function(e21) { + if (this.from.length && this.finishChunk(false), 0 == this.chunks.length) + return e21; + var t10 = xV.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(e21) : e21, this.setMaxPoint); + return this.from = null, t10; + } }]), e20; + }(); + function SV(e20, t10, n10) { + var r10, o10 = /* @__PURE__ */ new Map(), i10 = bo(e20); + try { + for (i10.s(); !(r10 = i10.n()).done; ) + for (var a10 = r10.value, s10 = 0; s10 < a10.chunk.length; s10++) + a10.chunk[s10].maxPoint <= 0 && o10.set(a10.chunk[s10], a10.chunkPos[s10]); + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + var c10, l10 = /* @__PURE__ */ new Set(), u10 = bo(t10); + try { + for (u10.s(); !(c10 = u10.n()).done; ) + for (var f10 = c10.value, d10 = 0; d10 < f10.chunk.length; d10++) { + var h10 = o10.get(f10.chunk[d10]); + null == h10 || (n10 ? n10.mapPos(h10) : h10) != f10.chunkPos[d10] || (null == n10 ? void 0 : n10.touchesRange(h10, h10 + f10.chunk[d10].length)) || l10.add(f10.chunk[d10]); + } + } catch (e21) { + u10.e(e21); + } finally { + u10.f(); + } + return l10; + } + var CV = function() { + function e20(t10, n10, r10) { + var o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0; + No(this, e20), this.layer = t10, this.skip = n10, this.minPoint = r10, this.rank = o10; + } + return Do(e20, [{ key: "startSide", get: function() { + return this.value ? this.value.startSide : 0; + } }, { key: "endSide", get: function() { + return this.value ? this.value.endSide : 0; + } }, { key: "goto", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1e9; + return this.chunkIndex = this.rangeIndex = 0, this.gotoInner(e21, t10, false), this; + } }, { key: "gotoInner", value: function(e21, t10, n10) { + for (; this.chunkIndex < this.layer.chunk.length; ) { + var r10 = this.layer.chunk[this.chunkIndex]; + if (!(this.skip && this.skip.has(r10) || this.layer.chunkEnd(this.chunkIndex) < e21 || r10.maxPoint < this.minPoint)) + break; + this.chunkIndex++, n10 = false; + } + if (this.chunkIndex < this.layer.chunk.length) { + var o10 = this.layer.chunk[this.chunkIndex].findIndex(e21 - this.layer.chunkPos[this.chunkIndex], t10, true); + (!n10 || this.rangeIndex < o10) && this.setRangeIndex(o10); + } + this.next(); + } }, { key: "forward", value: function(e21, t10) { + (this.to - e21 || this.endSide - t10) < 0 && this.gotoInner(e21, t10, true); + } }, { key: "next", value: function() { + for (; ; ) { + if (this.chunkIndex == this.layer.chunk.length) { + this.from = this.to = 1e9, this.value = null; + break; + } + var e21 = this.layer.chunkPos[this.chunkIndex], t10 = this.layer.chunk[this.chunkIndex], n10 = e21 + t10.from[this.rangeIndex]; + if (this.from = n10, this.to = e21 + t10.to[this.rangeIndex], this.value = t10.value[this.rangeIndex], this.setRangeIndex(this.rangeIndex + 1), this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint) + break; + } + } }, { key: "setRangeIndex", value: function(e21) { + if (e21 == this.layer.chunk[this.chunkIndex].value.length) { + if (this.chunkIndex++, this.skip) + for (; this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]); ) + this.chunkIndex++; + this.rangeIndex = 0; + } else + this.rangeIndex = e21; + } }, { key: "nextChunk", value: function() { + this.chunkIndex++, this.rangeIndex = 0, this.next(); + } }, { key: "compare", value: function(e21) { + return this.from - e21.from || this.startSide - e21.startSide || this.rank - e21.rank || this.to - e21.to || this.endSide - e21.endSide; + } }]), e20; + }(); + var $V = function() { + function e20(t10) { + No(this, e20), this.heap = t10; + } + return Do(e20, [{ key: "startSide", get: function() { + return this.value ? this.value.startSide : 0; + } }, { key: "goto", value: function(e21) { + var t10, n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1e9, r10 = bo(this.heap); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + t10.value.goto(e21, n10); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + for (var o10 = this.heap.length >> 1; o10 >= 0; o10--) + _V(this.heap, o10); + return this.next(), this; + } }, { key: "forward", value: function(e21, t10) { + var n10, r10 = bo(this.heap); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + n10.value.forward(e21, t10); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + for (var o10 = this.heap.length >> 1; o10 >= 0; o10--) + _V(this.heap, o10); + (this.to - e21 || this.value.endSide - t10) < 0 && this.next(); + } }, { key: "next", value: function() { + if (0 == this.heap.length) + this.from = this.to = 1e9, this.value = null, this.rank = -1; + else { + var e21 = this.heap[0]; + this.from = e21.from, this.to = e21.to, this.value = e21.value, this.rank = e21.rank, e21.value && e21.next(), _V(this.heap, 0); + } + } }], [{ key: "from", value: function(t10) { + for (var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1, o10 = [], i10 = 0; i10 < t10.length; i10++) + for (var a10 = t10[i10]; !a10.isEmpty; a10 = a10.nextLayer) + a10.maxPoint >= r10 && o10.push(new CV(a10, n10, r10, i10)); + return 1 == o10.length ? o10[0] : new e20(o10); + } }]), e20; + }(); + function _V(e20, t10) { + for (var n10 = e20[t10]; ; ) { + var r10 = 1 + (t10 << 1); + if (r10 >= e20.length) + break; + var o10 = e20[r10]; + if (r10 + 1 < e20.length && o10.compare(e20[r10 + 1]) >= 0 && (o10 = e20[r10 + 1], r10++), n10.compare(o10) < 0) + break; + e20[r10] = n10, e20[t10] = o10, t10 = r10; + } + } + var OV = function() { + function e20(t10, n10, r10) { + No(this, e20), this.minPoint = r10, this.active = [], this.activeTo = [], this.activeRank = [], this.minActive = -1, this.point = null, this.pointFrom = 0, this.pointRank = 0, this.to = -1e9, this.endSide = 0, this.openStart = -1, this.cursor = $V.from(t10, n10, r10); + } + return Do(e20, [{ key: "goto", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1e9; + return this.cursor.goto(e21, t10), this.active.length = this.activeTo.length = this.activeRank.length = 0, this.minActive = -1, this.to = e21, this.endSide = t10, this.openStart = -1, this.next(), this; + } }, { key: "forward", value: function(e21, t10) { + for (; this.minActive > -1 && (this.activeTo[this.minActive] - e21 || this.active[this.minActive].endSide - t10) < 0; ) + this.removeActive(this.minActive); + this.cursor.forward(e21, t10); + } }, { key: "removeActive", value: function(e21) { + AV(this.active, e21), AV(this.activeTo, e21), AV(this.activeRank, e21), this.minActive = TV(this.active, this.activeTo); + } }, { key: "addActive", value: function(e21) { + for (var t10 = 0, n10 = this.cursor, r10 = n10.value, o10 = n10.to, i10 = n10.rank; t10 < this.activeRank.length && (i10 - this.activeRank[t10] || o10 - this.activeTo[t10]) > 0; ) + t10++; + PV(this.active, t10, r10), PV(this.activeTo, t10, o10), PV(this.activeRank, t10, i10), e21 && PV(e21, t10, this.cursor.from), this.minActive = TV(this.active, this.activeTo); + } }, { key: "next", value: function() { + var e21 = this.to, t10 = this.point; + this.point = null; + for (var n10 = this.openStart < 0 ? [] : null; ; ) { + var r10 = this.minActive; + if (r10 > -1 && (this.activeTo[r10] - this.cursor.from || this.active[r10].endSide - this.cursor.startSide) < 0) { + if (this.activeTo[r10] > e21) { + this.to = this.activeTo[r10], this.endSide = this.active[r10].endSide; + break; + } + this.removeActive(r10), n10 && AV(n10, r10); + } else { + if (!this.cursor.value) { + this.to = this.endSide = 1e9; + break; + } + if (this.cursor.from > e21) { + this.to = this.cursor.from, this.endSide = this.cursor.startSide; + break; + } + var o10 = this.cursor.value; + if (o10.point) { + if (!(t10 && this.cursor.to == this.to && this.cursor.from < this.cursor.to)) { + this.point = o10, this.pointFrom = this.cursor.from, this.pointRank = this.cursor.rank, this.to = this.cursor.to, this.endSide = o10.endSide, this.cursor.next(), this.forward(this.to, this.endSide); + break; + } + this.cursor.next(); + } else + this.addActive(n10), this.cursor.next(); + } + } + if (n10) { + this.openStart = 0; + for (var i10 = n10.length - 1; i10 >= 0 && n10[i10] < e21; i10--) + this.openStart++; + } + } }, { key: "activeForPoint", value: function(e21) { + if (!this.active.length) + return this.active; + for (var t10 = [], n10 = this.active.length - 1; n10 >= 0 && !(this.activeRank[n10] < this.pointRank); n10--) + (this.activeTo[n10] > e21 || this.activeTo[n10] == e21 && this.active[n10].endSide >= this.point.endSide) && t10.push(this.active[n10]); + return t10.reverse(); + } }, { key: "openEnd", value: function(e21) { + for (var t10 = 0, n10 = this.activeTo.length - 1; n10 >= 0 && this.activeTo[n10] > e21; n10--) + t10++; + return t10; + } }]), e20; + }(); + function MV(e20, t10, n10, r10, o10, i10) { + e20.goto(t10), n10.goto(r10); + for (var a10 = r10 + o10, s10 = r10, c10 = r10 - t10; ; ) { + var l10 = e20.to + c10 - n10.to || e20.endSide - n10.endSide, u10 = l10 < 0 ? e20.to + c10 : n10.to, f10 = Math.min(u10, a10); + if (e20.point || n10.point ? e20.point && n10.point && (e20.point == n10.point || e20.point.eq(n10.point)) && EV(e20.activeForPoint(e20.to), n10.activeForPoint(n10.to)) || i10.comparePoint(s10, f10, e20.point, n10.point) : f10 > s10 && !EV(e20.active, n10.active) && i10.compareRange(s10, f10, e20.active, n10.active), u10 > a10) + break; + s10 = u10, l10 <= 0 && e20.next(), l10 >= 0 && n10.next(); + } + } + function EV(e20, t10) { + if (e20.length != t10.length) + return false; + for (var n10 = 0; n10 < e20.length; n10++) + if (e20[n10] != t10[n10] && !e20[n10].eq(t10[n10])) + return false; + return true; + } + function AV(e20, t10) { + for (var n10 = t10, r10 = e20.length - 1; n10 < r10; n10++) + e20[n10] = e20[n10 + 1]; + e20.pop(); + } + function PV(e20, t10, n10) { + for (var r10 = e20.length - 1; r10 >= t10; r10--) + e20[r10 + 1] = e20[r10]; + e20[t10] = n10; + } + function TV(e20, t10) { + for (var n10 = -1, r10 = 1e9, o10 = 0; o10 < t10.length; o10++) + (t10[o10] - r10 || e20[o10].endSide - e20[n10].endSide) < 0 && (n10 = o10, r10 = t10[o10]); + return n10; + } + function RV(e20, t10) { + for (var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e20.length, r10 = 0, o10 = 0; o10 < n10; ) + 9 == e20.charCodeAt(o10) ? (r10 += t10 - r10 % t10, o10++) : (r10++, o10 = sF(e20, o10)); + return r10; + } + function NV(e20, t10, n10, r10) { + for (var o10 = 0, i10 = 0; ; ) { + if (i10 >= t10) + return o10; + if (o10 == e20.length) + break; + i10 += 9 == e20.charCodeAt(o10) ? n10 - i10 % n10 : 1, o10 = sF(e20, o10); + } + return true === r10 ? -1 : e20.length; + } + for (IV = "undefined" == typeof Symbol ? "__\u037C" : Symbol.for("\u037C"), DV = "undefined" == typeof Symbol ? "__styleSet" + Math.floor(1e8 * Math.random()) : Symbol("styleSet"), qV = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : {}, zV = function() { + function e20(t10, n10) { + No(this, e20), this.rules = []; + var r10 = (n10 || {}).finish; + function o10(e21) { + return /^@/.test(e21) ? [e21] : e21.split(/,\s*/); + } + function i10(e21, t11, n11, a11) { + var s10 = [], c10 = /^@(\w+)\b/.exec(e21[0]), l10 = c10 && "keyframes" == c10[1]; + if (c10 && null == t11) + return n11.push(e21[0] + ";"); + for (var u10 in t11) { + var f10 = t11[u10]; + if (/&/.test(u10)) + i10(u10.split(/,\s*/).map(function(t12) { + return e21.map(function(e23) { + return t12.replace(/&/, e23); + }); + }).reduce(function(e23, t12) { + return e23.concat(t12); + }), f10, n11); + else if (f10 && "object" == Ho(f10)) { + if (!c10) + throw new RangeError("The value of a property (" + u10 + ") should be a primitive value."); + i10(o10(u10), f10, s10, l10); + } else + null != f10 && s10.push(u10.replace(/_.*/, "").replace(/[A-Z]/g, function(e23) { + return "-" + e23.toLowerCase(); + }) + ": " + f10 + ";"); + } + (s10.length || l10) && n11.push((!r10 || c10 || a11 ? e21 : e21.map(r10)).join(", ") + " {" + s10.join(" ") + "}"); + } + for (var a10 in t10) + i10(o10(a10), t10[a10], this.rules); + } + return Do(e20, [{ key: "getRules", value: function() { + return this.rules.join("\n"); + } }], [{ key: "newName", value: function() { + var e21 = qV[IV] || 1; + return qV[IV] = e21 + 1, "\u037C" + e21.toString(36); + } }, { key: "mount", value: function(e21, t10, n10) { + var r10 = e21[DV], o10 = n10 && n10.nonce; + r10 ? o10 && r10.setNonce(o10) : r10 = new LV(e21, o10), r10.mount(Array.isArray(t10) ? t10 : [t10]); + } }]), e20; + }(), BV = /* @__PURE__ */ new Map(), LV = function() { + function e20(t10, n10) { + No(this, e20); + var r10 = t10.ownerDocument || t10, o10 = r10.defaultView; + if (!t10.head && t10.adoptedStyleSheets && o10.CSSStyleSheet) { + var i10 = BV.get(r10); + if (i10) + return t10.adoptedStyleSheets = [i10.sheet].concat(Bo(t10.adoptedStyleSheets)), t10[DV] = i10; + this.sheet = new o10.CSSStyleSheet(), t10.adoptedStyleSheets = [this.sheet].concat(Bo(t10.adoptedStyleSheets)), BV.set(r10, this); + } else { + this.styleTag = r10.createElement("style"), n10 && this.styleTag.setAttribute("nonce", n10); + var a10 = t10.head || t10; + a10.insertBefore(this.styleTag, a10.firstChild); + } + this.modules = [], t10[DV] = this; + } + return Do(e20, [{ key: "mount", value: function(e21) { + for (var t10 = this.sheet, n10 = 0, r10 = 0, o10 = 0; o10 < e21.length; o10++) { + var i10 = e21[o10], a10 = this.modules.indexOf(i10); + if (a10 < r10 && a10 > -1 && (this.modules.splice(a10, 1), r10--, a10 = -1), -1 == a10) { + if (this.modules.splice(r10++, 0, i10), t10) + for (var s10 = 0; s10 < i10.rules.length; s10++) + t10.insertRule(i10.rules[s10], n10++); + } else { + for (; r10 < a10; ) + n10 += this.modules[r10++].rules.length; + n10 += i10.rules.length, r10++; + } + } + if (!t10) { + for (var c10 = "", l10 = 0; l10 < this.modules.length; l10++) + c10 += this.modules[l10].getRules() + "\n"; + this.styleTag.textContent = c10; + } + } }, { key: "setNonce", value: function(e21) { + this.styleTag && this.styleTag.getAttribute("nonce") != e21 && this.styleTag.setAttribute("nonce", e21); + } }]), e20; + }(), FV = { 8: "Backspace", 9: "Tab", 10: "Enter", 12: "NumLock", 13: "Enter", 16: "Shift", 17: "Control", 18: "Alt", 20: "CapsLock", 27: "Escape", 32: " ", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 44: "PrintScreen", 45: "Insert", 46: "Delete", 59: ";", 61: "=", 91: "Meta", 92: "Meta", 106: "*", 107: "+", 108: ",", 109: "-", 110: ".", 111: "/", 144: "NumLock", 145: "ScrollLock", 160: "Shift", 161: "Shift", 162: "Control", 163: "Control", 164: "Alt", 165: "Alt", 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'" }, VV = { 48: ")", 49: "!", 50: "@", 51: "#", 52: "$", 53: "%", 54: "^", 55: "&", 56: "*", 57: "(", 59: ":", 61: "+", 173: "_", 186: ":", 187: "+", 188: "<", 189: "_", 190: ">", 191: "?", 192: "~", 219: "{", 220: "|", 221: "}", 222: '"' }, HV = "undefined" != typeof navigator && /Mac/.test(navigator.platform), WV = "undefined" != typeof navigator && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent), UV = 0; UV < 10; UV++) + FV[48 + UV] = FV[96 + UV] = String(UV); + var IV; + var DV; + var qV; + var zV; + var BV; + var LV; + var FV; + var VV; + var HV; + var WV; + var UV; + for (UV = 1; UV <= 24; UV++) + FV[UV + 111] = "F" + UV; + for (UV = 65; UV <= 90; UV++) + FV[UV] = String.fromCharCode(UV + 32), VV[UV] = String.fromCharCode(UV); + for (JV in FV) + VV.hasOwnProperty(JV) || (VV[JV] = FV[JV]); + var JV; + function KV(e20) { + return (11 == e20.nodeType ? e20.getSelection ? e20 : e20.ownerDocument : e20).getSelection(); + } + function GV(e20, t10) { + return !!t10 && (e20 == t10 || e20.contains(1 != t10.nodeType ? t10.parentNode : t10)); + } + function QV(e20, t10) { + if (!t10.anchorNode) + return false; + try { + return GV(e20, t10.anchorNode); + } catch (e21) { + return false; + } + } + function YV(e20) { + return 3 == e20.nodeType ? lH(e20, 0, e20.nodeValue.length).getClientRects() : 1 == e20.nodeType ? e20.getClientRects() : []; + } + function XV(e20, t10, n10, r10) { + return !!n10 && (eH(e20, t10, n10, r10, -1) || eH(e20, t10, n10, r10, 1)); + } + function ZV(e20) { + for (var t10 = 0; ; t10++) + if (!(e20 = e20.previousSibling)) + return t10; + } + function eH(e20, t10, n10, r10, o10) { + for (; ; ) { + if (e20 == n10 && t10 == r10) + return true; + if (t10 == (o10 < 0 ? 0 : tH(e20))) { + if ("DIV" == e20.nodeName) + return false; + var i10 = e20.parentNode; + if (!i10 || 1 != i10.nodeType) + return false; + t10 = ZV(e20) + (o10 < 0 ? 0 : 1), e20 = i10; + } else { + if (1 != e20.nodeType) + return false; + if (1 == (e20 = e20.childNodes[t10 + (o10 < 0 ? -1 : 0)]).nodeType && "false" == e20.contentEditable) + return false; + t10 = o10 < 0 ? tH(e20) : 0; + } + } + } + function tH(e20) { + return 3 == e20.nodeType ? e20.nodeValue.length : e20.childNodes.length; + } + function nH(e20, t10) { + var n10 = t10 ? e20.left : e20.right; + return { left: n10, right: n10, top: e20.top, bottom: e20.bottom }; + } + function rH(e20) { + return { left: 0, right: e20.innerWidth, top: 0, bottom: e20.innerHeight }; + } + function oH(e20, t10) { + var n10 = t10.width / e20.offsetWidth, r10 = t10.height / e20.offsetHeight; + return (n10 > 0.995 && n10 < 1.005 || !isFinite(n10) || Math.abs(t10.width - e20.offsetWidth) < 1) && (n10 = 1), (r10 > 0.995 && r10 < 1.005 || !isFinite(r10) || Math.abs(t10.height - e20.offsetHeight) < 1) && (r10 = 1), { scaleX: n10, scaleY: r10 }; + } + var iH; + var aH = function() { + function e20() { + No(this, e20), this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0; + } + return Do(e20, [{ key: "eq", value: function(e21) { + return this.anchorNode == e21.anchorNode && this.anchorOffset == e21.anchorOffset && this.focusNode == e21.focusNode && this.focusOffset == e21.focusOffset; + } }, { key: "setRange", value: function(e21) { + var t10 = e21.anchorNode, n10 = e21.focusNode; + this.set(t10, Math.min(e21.anchorOffset, t10 ? tH(t10) : 0), n10, Math.min(e21.focusOffset, n10 ? tH(n10) : 0)); + } }, { key: "set", value: function(e21, t10, n10, r10) { + this.anchorNode = e21, this.anchorOffset = t10, this.focusNode = n10, this.focusOffset = r10; + } }]), e20; + }(); + var sH = null; + function cH(e20) { + if (e20.setActive) + return e20.setActive(); + if (sH) + return e20.focus(sH); + for (var t10 = [], n10 = e20; n10 && (t10.push(n10, n10.scrollTop, n10.scrollLeft), n10 != n10.ownerDocument); n10 = n10.parentNode) + ; + if (e20.focus(null == sH ? { get preventScroll() { + return sH = { preventScroll: true }, true; + } } : void 0), !sH) { + sH = false; + for (var r10 = 0; r10 < t10.length; ) { + var o10 = t10[r10++], i10 = t10[r10++], a10 = t10[r10++]; + o10.scrollTop != i10 && (o10.scrollTop = i10), o10.scrollLeft != a10 && (o10.scrollLeft = a10); + } + } + } + function lH(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t10, r10 = iH || (iH = document.createRange()); + return r10.setEnd(e20, n10), r10.setStart(e20, t10), r10; + } + function uH(e20, t10, n10) { + var r10 = { key: t10, code: t10, keyCode: n10, which: n10, cancelable: true }, o10 = new KeyboardEvent("keydown", r10); + o10.synthetic = true, e20.dispatchEvent(o10); + var i10 = new KeyboardEvent("keyup", r10); + return i10.synthetic = true, e20.dispatchEvent(i10), o10.defaultPrevented || i10.defaultPrevented; + } + function fH(e20) { + for (; e20.attributes.length; ) + e20.removeAttributeNode(e20.attributes[0]); + } + function dH(e20) { + return e20.scrollTop > Math.max(1, e20.scrollHeight - e20.clientHeight - 4); + } + var hH = function() { + function e20(t10, n10) { + var r10 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; + No(this, e20), this.node = t10, this.offset = n10, this.precise = r10; + } + return Do(e20, null, [{ key: "before", value: function(t10, n10) { + return new e20(t10.parentNode, ZV(t10), n10); + } }, { key: "after", value: function(t10, n10) { + return new e20(t10.parentNode, ZV(t10) + 1, n10); + } }]), e20; + }(); + var vH = []; + var pH = function() { + function e20() { + No(this, e20), this.parent = null, this.dom = null, this.flags = 2; + } + return Do(e20, [{ key: "overrideDOMText", get: function() { + return null; + } }, { key: "posAtStart", get: function() { + return this.parent ? this.parent.posBefore(this) : 0; + } }, { key: "posAtEnd", get: function() { + return this.posAtStart + this.length; + } }, { key: "posBefore", value: function(e21) { + var t10, n10 = this.posAtStart, r10 = bo(this.children); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + var o10 = t10.value; + if (o10 == e21) + return n10; + n10 += o10.length + o10.breakAfter; + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + throw new RangeError("Invalid child in posBefore"); + } }, { key: "posAfter", value: function(e21) { + return this.posBefore(e21) + e21.length; + } }, { key: "sync", value: function(t10, n10) { + if (2 & this.flags) { + var r10, o10, i10 = this.dom, a10 = null, s10 = bo(this.children); + try { + for (s10.s(); !(o10 = s10.n()).done; ) { + var c10 = o10.value; + if (7 & c10.flags) { + if (!c10.dom && (r10 = a10 ? a10.nextSibling : i10.firstChild)) { + var l10 = e20.get(r10); + (!l10 || !l10.parent && l10.canReuseDOM(c10)) && c10.reuseDOM(r10); + } + c10.sync(t10, n10), c10.flags &= -8; + } + if (r10 = a10 ? a10.nextSibling : i10.firstChild, n10 && !n10.written && n10.node == i10 && r10 != c10.dom && (n10.written = true), c10.dom.parentNode == i10) + for (; r10 && r10 != c10.dom; ) + r10 = mH(r10); + else + i10.insertBefore(c10.dom, r10); + a10 = c10.dom; + } + } catch (e21) { + s10.e(e21); + } finally { + s10.f(); + } + for ((r10 = a10 ? a10.nextSibling : i10.firstChild) && n10 && n10.node == i10 && (n10.written = true); r10; ) + r10 = mH(r10); + } else if (1 & this.flags) { + var u10, f10 = bo(this.children); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value; + 7 & d10.flags && (d10.sync(t10, n10), d10.flags &= -8); + } + } catch (e21) { + f10.e(e21); + } finally { + f10.f(); + } + } + } }, { key: "reuseDOM", value: function(e21) { + } }, { key: "localPosFromDOM", value: function(t10, n10) { + var r10; + if (t10 == this.dom) + r10 = this.dom.childNodes[n10]; + else { + for (var o10 = 0 == tH(t10) ? 0 : 0 == n10 ? -1 : 1; ; ) { + var i10 = t10.parentNode; + if (i10 == this.dom) + break; + 0 == o10 && i10.firstChild != i10.lastChild && (o10 = t10 == i10.firstChild ? -1 : 1), t10 = i10; + } + r10 = o10 < 0 ? t10 : t10.nextSibling; + } + if (r10 == this.dom.firstChild) + return 0; + for (; r10 && !e20.get(r10); ) + r10 = r10.nextSibling; + if (!r10) + return this.length; + for (var a10 = 0, s10 = 0; ; a10++) { + var c10 = this.children[a10]; + if (c10.dom == r10) + return s10; + s10 += c10.length + c10.breakAfter; + } + } }, { key: "domBoundsAround", value: function(e21, t10) { + for (var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r10 = -1, o10 = -1, i10 = -1, a10 = -1, s10 = 0, c10 = n10, l10 = n10; s10 < this.children.length; s10++) { + var u10 = this.children[s10], f10 = c10 + u10.length; + if (c10 < e21 && f10 > t10) + return u10.domBoundsAround(e21, t10, c10); + if (f10 >= e21 && -1 == r10 && (r10 = s10, o10 = c10), c10 > t10 && u10.dom.parentNode == this.dom) { + i10 = s10, a10 = l10; + break; + } + l10 = f10, c10 = f10 + u10.breakAfter; + } + return { from: o10, to: a10 < 0 ? n10 + this.length : a10, startDOM: (r10 ? this.children[r10 - 1].dom.nextSibling : null) || this.dom.firstChild, endDOM: i10 < this.children.length && i10 >= 0 ? this.children[i10].dom : null }; + } }, { key: "markDirty", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; + this.flags |= 2, this.markParentsDirty(e21); + } }, { key: "markParentsDirty", value: function(e21) { + for (var t10 = this.parent; t10; t10 = t10.parent) { + if (e21 && (t10.flags |= 2), 1 & t10.flags) + return; + t10.flags |= 1, e21 = false; + } + } }, { key: "setParent", value: function(e21) { + this.parent != e21 && (this.parent = e21, 7 & this.flags && this.markParentsDirty(true)); + } }, { key: "setDOM", value: function(e21) { + this.dom != e21 && (this.dom && (this.dom.cmView = null), this.dom = e21, e21.cmView = this); + } }, { key: "rootView", get: function() { + for (var e21 = this; ; ) { + var t10 = e21.parent; + if (!t10) + return e21; + e21 = t10; + } + } }, { key: "replaceChildren", value: function(e21, t10) { + var n10, r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : vH; + this.markDirty(); + for (var o10 = e21; o10 < t10; o10++) { + var i10 = this.children[o10]; + i10.parent == this && r10.indexOf(i10) < 0 && i10.destroy(); + } + (n10 = this.children).splice.apply(n10, [e21, t10 - e21].concat(Bo(r10))); + for (var a10 = 0; a10 < r10.length; a10++) + r10[a10].setParent(this); + } }, { key: "ignoreMutation", value: function(e21) { + return false; + } }, { key: "ignoreEvent", value: function(e21) { + return false; + } }, { key: "childCursor", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.length; + return new gH(this.children, e21, this.children.length); + } }, { key: "childPos", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; + return this.childCursor().findPos(e21, t10); + } }, { key: "toString", value: function() { + var e21 = this.constructor.name.replace("View", ""); + return e21 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + ("Text" == e21 ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : ""); + } }, { key: "isEditable", get: function() { + return true; + } }, { key: "isWidget", get: function() { + return false; + } }, { key: "isHidden", get: function() { + return false; + } }, { key: "merge", value: function(e21, t10, n10, r10, o10, i10) { + return false; + } }, { key: "become", value: function(e21) { + return false; + } }, { key: "canReuseDOM", value: function(e21) { + return e21.constructor == this.constructor && !(8 & (this.flags | e21.flags)); + } }, { key: "getSide", value: function() { + return 0; + } }, { key: "destroy", value: function() { + var e21, t10 = bo(this.children); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + var n10 = e21.value; + n10.parent == this && n10.destroy(); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + this.parent = null; + } }], [{ key: "get", value: function(e21) { + return e21.cmView; + } }]), e20; + }(); + function mH(e20) { + var t10 = e20.nextSibling; + return e20.parentNode.removeChild(e20), t10; + } + pH.prototype.breakAfter = 0; + var gH = function() { + function e20(t10, n10, r10) { + No(this, e20), this.children = t10, this.pos = n10, this.i = r10, this.off = 0; + } + return Do(e20, [{ key: "findPos", value: function(e21) { + for (var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; ; ) { + if (e21 > this.pos || e21 == this.pos && (t10 > 0 || 0 == this.i || this.children[this.i - 1].breakAfter)) + return this.off = e21 - this.pos, this; + var n10 = this.children[--this.i]; + this.pos -= n10.length + n10.breakAfter; + } + } }]), e20; + }(); + function yH(e20, t10, n10, r10, o10, i10, a10, s10, c10) { + var l10 = e20.children, u10 = l10.length ? l10[t10] : null, f10 = i10.length ? i10[i10.length - 1] : null, d10 = f10 ? f10.breakAfter : a10; + if (!(t10 == r10 && u10 && !a10 && !d10 && i10.length < 2 && u10.merge(n10, o10, i10.length ? f10 : null, 0 == n10, s10, c10))) { + if (r10 < l10.length) { + var h10 = l10[r10]; + h10 && (o10 < h10.length || h10.breakAfter && (null == f10 ? void 0 : f10.breakAfter)) ? (t10 == r10 && (h10 = h10.split(o10), o10 = 0), !d10 && f10 && h10.merge(0, o10, f10, true, 0, c10) ? i10[i10.length - 1] = h10 : ((o10 || h10.children.length && !h10.children[0].length) && h10.merge(0, o10, null, false, 0, c10), i10.push(h10))) : (null == h10 ? void 0 : h10.breakAfter) && (f10 ? f10.breakAfter = 1 : a10 = 1), r10++; + } + for (u10 && (u10.breakAfter = a10, n10 > 0 && (!a10 && i10.length && u10.merge(n10, u10.length, i10[0], false, s10, 0) ? u10.breakAfter = i10.shift().breakAfter : (n10 < u10.length || u10.children.length && 0 == u10.children[u10.children.length - 1].length) && u10.merge(n10, u10.length, null, false, s10, 0), t10++)); t10 < r10 && i10.length; ) + if (l10[r10 - 1].become(i10[i10.length - 1])) + r10--, i10.pop(), c10 = i10.length ? 0 : s10; + else { + if (!l10[t10].become(i10[0])) + break; + t10++, i10.shift(), s10 = i10.length ? 0 : c10; + } + !i10.length && t10 && r10 < l10.length && !l10[t10 - 1].breakAfter && l10[r10].merge(0, 0, l10[t10 - 1], false, s10, c10) && t10--, (t10 < r10 || i10.length) && e20.replaceChildren(t10, r10, i10); + } + } + function bH(e20, t10, n10, r10, o10, i10) { + var a10, s10 = e20.childCursor(), c10 = s10.findPos(n10, 1), l10 = c10.i, u10 = c10.off, f10 = s10.findPos(t10, -1), d10 = f10.i, h10 = f10.off, v10 = t10 - n10, p10 = bo(r10); + try { + for (p10.s(); !(a10 = p10.n()).done; ) { + v10 += a10.value.length; + } + } catch (e21) { + p10.e(e21); + } finally { + p10.f(); + } + e20.length += v10, yH(e20, d10, h10, l10, u10, r10, 0, o10, i10); + } + var kH = "undefined" != typeof navigator ? navigator : { userAgent: "", vendor: "", platform: "" }; + var wH = "undefined" != typeof document ? document : { documentElement: { style: {} } }; + var xH = /Edge\/(\d+)/.exec(kH.userAgent); + var jH = /MSIE \d/.test(kH.userAgent); + var SH = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(kH.userAgent); + var CH = !!(jH || SH || xH); + var $H = !CH && /gecko\/(\d+)/i.test(kH.userAgent); + var _H = !CH && /Chrome\/(\d+)/.exec(kH.userAgent); + var OH = "webkitFontSmoothing" in wH.documentElement.style; + var MH = !CH && /Apple Computer/.test(kH.vendor); + var EH = MH && (/Mobile\/\w+/.test(kH.userAgent) || kH.maxTouchPoints > 2); + var AH = { mac: EH || /Mac/.test(kH.platform), windows: /Win/.test(kH.platform), linux: /Linux|X11/.test(kH.platform), ie: CH, ie_version: jH ? wH.documentMode || 6 : SH ? +SH[1] : xH ? +xH[1] : 0, gecko: $H, gecko_version: $H ? +(/Firefox\/(\d+)/.exec(kH.userAgent) || [0, 0])[1] : 0, chrome: !!_H, chrome_version: _H ? +_H[1] : 0, ios: EH, android: /Android\b/.test(kH.userAgent), webkit: OH, safari: MH, webkit_version: OH ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0, tabSize: null != wH.documentElement.style.tabSize ? "tab-size" : "-moz-tab-size" }; + var PH = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).text = e21, n10; + } + return Ao(t10, pH), Do(t10, [{ key: "length", get: function() { + return this.text.length; + } }, { key: "createDOM", value: function(e21) { + this.setDOM(e21 || document.createTextNode(this.text)); + } }, { key: "sync", value: function(e21, t11) { + this.dom || this.createDOM(), this.dom.nodeValue != this.text && (t11 && t11.node == this.dom && (t11.written = true), this.dom.nodeValue = this.text); + } }, { key: "reuseDOM", value: function(e21) { + 3 == e21.nodeType && this.createDOM(e21); + } }, { key: "merge", value: function(e21, n10, r10) { + return !(8 & this.flags || r10 && (!(r10 instanceof t10) || this.length - (n10 - e21) + r10.length > 256 || 8 & r10.flags)) && (this.text = this.text.slice(0, e21) + (r10 ? r10.text : "") + this.text.slice(n10), this.markDirty(), true); + } }, { key: "split", value: function(e21) { + var n10 = new t10(this.text.slice(e21)); + return this.text = this.text.slice(0, e21), this.markDirty(), n10.flags |= 8 & this.flags, n10; + } }, { key: "localPosFromDOM", value: function(e21, t11) { + return e21 == this.dom ? t11 : t11 ? this.text.length : 0; + } }, { key: "domAtPos", value: function(e21) { + return new hH(this.dom, e21); + } }, { key: "domBoundsAround", value: function(e21, t11, n10) { + return { from: n10, to: n10 + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling }; + } }, { key: "coordsAt", value: function(e21, t11) { + return function(e23, t12, n10) { + var r10 = e23.nodeValue.length; + t12 > r10 && (t12 = r10); + var o10 = t12, i10 = t12, a10 = 0; + 0 == t12 && n10 < 0 || t12 == r10 && n10 >= 0 ? AH.chrome || AH.gecko || (t12 ? (o10--, a10 = 1) : i10 < r10 && (i10++, a10 = -1)) : n10 < 0 ? o10-- : i10 < r10 && i10++; + var s10 = lH(e23, o10, i10).getClientRects(); + if (!s10.length) + return null; + var c10 = s10[(a10 ? a10 < 0 : n10 >= 0) ? 0 : s10.length - 1]; + AH.safari && !a10 && 0 == c10.width && (c10 = Array.prototype.find.call(s10, function(e24) { + return e24.width; + }) || c10); + return a10 ? nH(c10, a10 < 0) : c10 || null; + }(this.dom, e21, t11); + } }]), t10; + }(); + var TH = function(e20) { + function t10(e21) { + var n10, r10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], o10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0; + No(this, t10), (n10 = _o(this, t10)).mark = e21, n10.children = r10, n10.length = o10; + var i10, a10 = bo(r10); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + i10.value.setParent(Eo(n10)); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + return n10; + } + return Ao(t10, pH), Do(t10, [{ key: "setAttrs", value: function(e21) { + if (fH(e21), this.mark.class && (e21.className = this.mark.class), this.mark.attrs) + for (var t11 in this.mark.attrs) + e21.setAttribute(t11, this.mark.attrs[t11]); + return e21; + } }, { key: "canReuseDOM", value: function(e21) { + return go(Mo(t10.prototype), "canReuseDOM", this).call(this, e21) && !(8 & (this.flags | e21.flags)); + } }, { key: "reuseDOM", value: function(e21) { + e21.nodeName == this.mark.tagName.toUpperCase() && (this.setDOM(e21), this.flags |= 6); + } }, { key: "sync", value: function(e21, n10) { + this.dom ? 4 & this.flags && this.setAttrs(this.dom) : this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))), go(Mo(t10.prototype), "sync", this).call(this, e21, n10); + } }, { key: "merge", value: function(e21, n10, r10, o10, i10, a10) { + return (!r10 || !(!(r10 instanceof t10 && r10.mark.eq(this.mark)) || e21 && i10 <= 0 || n10 < this.length && a10 <= 0)) && (bH(this, e21, n10, r10 ? r10.children.slice() : [], i10 - 1, a10 - 1), this.markDirty(), true); + } }, { key: "split", value: function(e21) { + var n10, r10 = [], o10 = 0, i10 = -1, a10 = 0, s10 = bo(this.children); + try { + for (s10.s(); !(n10 = s10.n()).done; ) { + var c10 = n10.value, l10 = o10 + c10.length; + l10 > e21 && r10.push(o10 < e21 ? c10.split(e21 - o10) : c10), i10 < 0 && o10 >= e21 && (i10 = a10), o10 = l10, a10++; + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + var u10 = this.length - e21; + return this.length = e21, i10 > -1 && (this.children.length = i10, this.markDirty()), new t10(this.mark, r10, u10); + } }, { key: "domAtPos", value: function(e21) { + return IH(this, e21); + } }, { key: "coordsAt", value: function(e21, t11) { + return qH(this, e21, t11); + } }]), t10; + }(); + var RH = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10)).widget = e21, o10.length = n10, o10.side = r10, o10.prevWidget = null, o10; + } + return Ao(t10, pH), Do(t10, [{ key: "split", value: function(e21) { + var n10 = t10.create(this.widget, this.length - e21, this.side); + return this.length -= e21, n10; + } }, { key: "sync", value: function(e21) { + this.dom && this.widget.updateDOM(this.dom, e21) || (this.dom && this.prevWidget && this.prevWidget.destroy(this.dom), this.prevWidget = null, this.setDOM(this.widget.toDOM(e21)), this.widget.editable || (this.dom.contentEditable = "false")); + } }, { key: "getSide", value: function() { + return this.side; + } }, { key: "merge", value: function(e21, n10, r10, o10, i10, a10) { + return !(r10 && (!(r10 instanceof t10 && this.widget.compare(r10.widget)) || e21 > 0 && i10 <= 0 || n10 < this.length && a10 <= 0)) && (this.length = e21 + (r10 ? r10.length : 0) + (this.length - n10), true); + } }, { key: "become", value: function(e21) { + return e21 instanceof t10 && e21.side == this.side && this.widget.constructor == e21.widget.constructor && (this.widget.compare(e21.widget) || this.markDirty(true), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e21.widget, this.length = e21.length, true); + } }, { key: "ignoreMutation", value: function() { + return true; + } }, { key: "ignoreEvent", value: function(e21) { + return this.widget.ignoreEvent(e21); + } }, { key: "overrideDOMText", get: function() { + if (0 == this.length) + return UL.empty; + for (var e21 = this; e21.parent; ) + e21 = e21.parent; + var t11 = e21.view, n10 = t11 && t11.state.doc, r10 = this.posAtStart; + return n10 ? n10.slice(r10, r10 + this.length) : UL.empty; + } }, { key: "domAtPos", value: function(e21) { + return (this.length ? 0 == e21 : this.side > 0) ? hH.before(this.dom) : hH.after(this.dom, e21 == this.length); + } }, { key: "domBoundsAround", value: function() { + return null; + } }, { key: "coordsAt", value: function(e21, t11) { + var n10 = this.widget.coordsAt(this.dom, e21, t11); + if (n10) + return n10; + var r10 = this.dom.getClientRects(), o10 = null; + if (!r10.length) + return null; + for (var i10 = this.side ? this.side < 0 : e21 > 0, a10 = i10 ? r10.length - 1 : 0; o10 = r10[a10], !(e21 > 0 ? 0 == a10 : a10 == r10.length - 1 || o10.top < o10.bottom); a10 += i10 ? -1 : 1) + ; + return nH(o10, !i10); + } }, { key: "isEditable", get: function() { + return false; + } }, { key: "isWidget", get: function() { + return true; + } }, { key: "isHidden", get: function() { + return this.widget.isHidden; + } }, { key: "destroy", value: function() { + go(Mo(t10.prototype), "destroy", this).call(this), this.dom && this.widget.destroy(this.dom); + } }], [{ key: "create", value: function(e21, n10, r10) { + return new t10(e21, n10, r10); + } }]), t10; + }(); + var NH = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).side = e21, n10; + } + return Ao(t10, pH), Do(t10, [{ key: "length", get: function() { + return 0; + } }, { key: "merge", value: function() { + return false; + } }, { key: "become", value: function(e21) { + return e21 instanceof t10 && e21.side == this.side; + } }, { key: "split", value: function() { + return new t10(this.side); + } }, { key: "sync", value: function() { + if (!this.dom) { + var e21 = document.createElement("img"); + e21.className = "cm-widgetBuffer", e21.setAttribute("aria-hidden", "true"), this.setDOM(e21); + } + } }, { key: "getSide", value: function() { + return this.side; + } }, { key: "domAtPos", value: function(e21) { + return this.side > 0 ? hH.before(this.dom) : hH.after(this.dom); + } }, { key: "localPosFromDOM", value: function() { + return 0; + } }, { key: "domBoundsAround", value: function() { + return null; + } }, { key: "coordsAt", value: function(e21) { + return this.dom.getBoundingClientRect(); + } }, { key: "overrideDOMText", get: function() { + return UL.empty; + } }, { key: "isHidden", get: function() { + return true; + } }]), t10; + }(); + function IH(e20, t10) { + for (var n10 = e20.dom, r10 = e20.children, o10 = 0, i10 = 0; o10 < r10.length; o10++) { + var a10 = r10[o10], s10 = i10 + a10.length; + if (!(s10 == i10 && a10.getSide() <= 0)) { + if (t10 > i10 && t10 < s10 && a10.dom.parentNode == n10) + return a10.domAtPos(t10 - i10); + if (t10 <= i10) + break; + i10 = s10; + } + } + for (var c10 = o10; c10 > 0; c10--) { + var l10 = r10[c10 - 1]; + if (l10.dom.parentNode == n10) + return l10.domAtPos(l10.length); + } + for (var u10 = o10; u10 < r10.length; u10++) { + var f10 = r10[u10]; + if (f10.dom.parentNode == n10) + return f10.domAtPos(0); + } + return new hH(n10, 0); + } + function DH(e20, t10, n10) { + var r10, o10 = e20.children; + n10 > 0 && t10 instanceof TH && o10.length && (r10 = o10[o10.length - 1]) instanceof TH && r10.mark.eq(t10.mark) ? DH(r10, t10.children[0], n10 - 1) : (o10.push(t10), t10.setParent(e20)), e20.length += t10.length; + } + function qH(e20, t10, n10) { + var r10 = null, o10 = -1, i10 = null, a10 = -1; + !function e21(t11, s11) { + for (var c10 = 0, l10 = 0; c10 < t11.children.length && l10 <= s11; c10++) { + var u10 = t11.children[c10], f10 = l10 + u10.length; + f10 >= s11 && (u10.children.length ? e21(u10, s11 - l10) : (!i10 || i10.isHidden && n10 > 0) && (f10 > s11 || l10 == f10 && u10.getSide() > 0) ? (i10 = u10, a10 = s11 - l10) : (l10 < s11 || l10 == f10 && u10.getSide() < 0 && !u10.isHidden) && (r10 = u10, o10 = s11 - l10)), l10 = f10; + } + }(e20, t10); + var s10 = (n10 < 0 ? r10 : i10) || r10 || i10; + return s10 ? s10.coordsAt(Math.max(0, s10 == r10 ? o10 : a10), n10) : function(e21) { + var t11 = e21.dom.lastChild; + if (!t11) + return e21.dom.getBoundingClientRect(); + var n11 = YV(t11); + return n11[n11.length - 1] || null; + }(e20); + } + function zH(e20, t10) { + for (var n10 in e20) + "class" == n10 && t10.class ? t10.class += " " + e20.class : "style" == n10 && t10.style ? t10.style += ";" + e20.style : t10[n10] = e20[n10]; + return t10; + } + PH.prototype.children = RH.prototype.children = NH.prototype.children = vH; + var BH = /* @__PURE__ */ Object.create(null); + function LH(e20, t10, n10) { + if (e20 == t10) + return true; + e20 || (e20 = BH), t10 || (t10 = BH); + var r10 = Object.keys(e20), o10 = Object.keys(t10); + if (r10.length - (n10 && r10.indexOf(n10) > -1 ? 1 : 0) != o10.length - (n10 && o10.indexOf(n10) > -1 ? 1 : 0)) + return false; + for (var i10 = 0, a10 = r10; i10 < a10.length; i10++) { + var s10 = a10[i10]; + if (s10 != n10 && (-1 == o10.indexOf(s10) || e20[s10] !== t10[s10])) + return false; + } + return true; + } + function FH(e20, t10, n10) { + var r10 = false; + if (t10) + for (var o10 in t10) + n10 && o10 in n10 || (r10 = true, "style" == o10 ? e20.style.cssText = "" : e20.removeAttribute(o10)); + if (n10) + for (var i10 in n10) + t10 && t10[i10] == n10[i10] || (r10 = true, "style" == i10 ? e20.style.cssText = n10[i10] : e20.setAttribute(i10, n10[i10])); + return r10; + } + function VH(e20) { + for (var t10 = /* @__PURE__ */ Object.create(null), n10 = 0; n10 < e20.attributes.length; n10++) { + var r10 = e20.attributes[n10]; + t10[r10.name] = r10.value; + } + return t10; + } + var HH = function(e20) { + function t10() { + var e21; + return No(this, t10), (e21 = _o(this, t10, arguments)).children = [], e21.length = 0, e21.prevAttrs = void 0, e21.attrs = null, e21.breakAfter = 0, e21; + } + return Ao(t10, pH), Do(t10, [{ key: "merge", value: function(e21, n10, r10, o10, i10, a10) { + if (r10) { + if (!(r10 instanceof t10)) + return false; + this.dom || r10.transferDOM(this); + } + return o10 && this.setDeco(r10 ? r10.attrs : null), bH(this, e21, n10, r10 ? r10.children.slice() : [], i10, a10), true; + } }, { key: "split", value: function(e21) { + var n10 = new t10(); + if (n10.breakAfter = this.breakAfter, 0 == this.length) + return n10; + var r10 = this.childPos(e21), o10 = r10.i, i10 = r10.off; + i10 && (n10.append(this.children[o10].split(i10), 0), this.children[o10].merge(i10, this.children[o10].length, null, false, 0, 0), o10++); + for (var a10 = o10; a10 < this.children.length; a10++) + n10.append(this.children[a10], 0); + for (; o10 > 0 && 0 == this.children[o10 - 1].length; ) + this.children[--o10].destroy(); + return this.children.length = o10, this.markDirty(), this.length = e21, n10; + } }, { key: "transferDOM", value: function(e21) { + this.dom && (this.markDirty(), e21.setDOM(this.dom), e21.prevAttrs = void 0 === this.prevAttrs ? this.attrs : this.prevAttrs, this.prevAttrs = void 0, this.dom = null); + } }, { key: "setDeco", value: function(e21) { + LH(this.attrs, e21) || (this.dom && (this.prevAttrs = this.attrs, this.markDirty()), this.attrs = e21); + } }, { key: "append", value: function(e21, t11) { + DH(this, e21, t11); + } }, { key: "addLineDeco", value: function(e21) { + var t11 = e21.spec.attributes, n10 = e21.spec.class; + t11 && (this.attrs = zH(t11, this.attrs || {})), n10 && (this.attrs = zH({ class: n10 }, this.attrs || {})); + } }, { key: "domAtPos", value: function(e21) { + return IH(this, e21); + } }, { key: "reuseDOM", value: function(e21) { + "DIV" == e21.nodeName && (this.setDOM(e21), this.flags |= 6); + } }, { key: "sync", value: function(e21, n10) { + var r10; + this.dom ? 4 & this.flags && (fH(this.dom), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0) : (this.setDOM(document.createElement("div")), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0), void 0 !== this.prevAttrs && (FH(this.dom, this.prevAttrs, this.attrs), this.dom.classList.add("cm-line"), this.prevAttrs = void 0), go(Mo(t10.prototype), "sync", this).call(this, e21, n10); + for (var o10 = this.dom.lastChild; o10 && pH.get(o10) instanceof TH; ) + o10 = o10.lastChild; + if (!(o10 && this.length && ("BR" == o10.nodeName || 0 != (null === (r10 = pH.get(o10)) || void 0 === r10 ? void 0 : r10.isEditable) || AH.ios && this.children.some(function(e23) { + return e23 instanceof PH; + })))) { + var i10 = document.createElement("BR"); + i10.cmIgnore = true, this.dom.appendChild(i10); + } + } }, { key: "measureTextSize", value: function() { + if (0 == this.children.length || this.length > 20) + return null; + var e21, t11, n10 = 0, r10 = bo(this.children); + try { + for (r10.s(); !(t11 = r10.n()).done; ) { + var o10 = t11.value; + if (!(o10 instanceof PH) || /[^ -~]/.test(o10.text)) + return null; + var i10 = YV(o10.dom); + if (1 != i10.length) + return null; + n10 += i10[0].width, e21 = i10[0].height; + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + return n10 ? { lineHeight: this.dom.getBoundingClientRect().height, charWidth: n10 / this.length, textHeight: e21 } : null; + } }, { key: "coordsAt", value: function(e21, t11) { + var n10 = qH(this, e21, t11); + if (!this.children.length && n10 && this.parent) { + var r10 = this.parent.view.viewState.heightOracle, o10 = n10.bottom - n10.top; + if (Math.abs(o10 - r10.lineHeight) < 2 && r10.textHeight < o10) { + var i10 = (o10 - r10.textHeight) / 2; + return { top: n10.top + i10, bottom: n10.bottom - i10, left: n10.left, right: n10.left }; + } + } + return n10; + } }, { key: "become", value: function(e21) { + return false; + } }, { key: "covers", value: function() { + return true; + } }], [{ key: "find", value: function(e21, n10) { + for (var r10 = 0, o10 = 0; r10 < e21.children.length; r10++) { + var i10 = e21.children[r10], a10 = o10 + i10.length; + if (a10 >= n10) { + if (i10 instanceof t10) + return i10; + if (a10 > n10) + break; + } + o10 = a10 + i10.breakAfter; + } + return null; + } }]), t10; + }(); + var WH = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10)).widget = e21, o10.length = n10, o10.deco = r10, o10.breakAfter = 0, o10.prevWidget = null, o10; + } + return Ao(t10, pH), Do(t10, [{ key: "merge", value: function(e21, n10, r10, o10, i10, a10) { + return !(r10 && (!(r10 instanceof t10 && this.widget.compare(r10.widget)) || e21 > 0 && i10 <= 0 || n10 < this.length && a10 <= 0)) && (this.length = e21 + (r10 ? r10.length : 0) + (this.length - n10), true); + } }, { key: "domAtPos", value: function(e21) { + return 0 == e21 ? hH.before(this.dom) : hH.after(this.dom, e21 == this.length); + } }, { key: "split", value: function(e21) { + var n10 = this.length - e21; + this.length = e21; + var r10 = new t10(this.widget, n10, this.deco); + return r10.breakAfter = this.breakAfter, r10; + } }, { key: "children", get: function() { + return vH; + } }, { key: "sync", value: function(e21) { + this.dom && this.widget.updateDOM(this.dom, e21) || (this.dom && this.prevWidget && this.prevWidget.destroy(this.dom), this.prevWidget = null, this.setDOM(this.widget.toDOM(e21)), this.widget.editable || (this.dom.contentEditable = "false")); + } }, { key: "overrideDOMText", get: function() { + return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : UL.empty; + } }, { key: "domBoundsAround", value: function() { + return null; + } }, { key: "become", value: function(e21) { + return e21 instanceof t10 && e21.widget.constructor == this.widget.constructor && (e21.widget.compare(this.widget) || this.markDirty(true), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e21.widget, this.length = e21.length, this.deco = e21.deco, this.breakAfter = e21.breakAfter, true); + } }, { key: "ignoreMutation", value: function() { + return true; + } }, { key: "ignoreEvent", value: function(e21) { + return this.widget.ignoreEvent(e21); + } }, { key: "isEditable", get: function() { + return false; + } }, { key: "isWidget", get: function() { + return true; + } }, { key: "coordsAt", value: function(e21, t11) { + return this.widget.coordsAt(this.dom, e21, t11); + } }, { key: "destroy", value: function() { + go(Mo(t10.prototype), "destroy", this).call(this), this.dom && this.widget.destroy(this.dom); + } }, { key: "covers", value: function(e21) { + var t11 = this.deco, n10 = t11.startSide, r10 = t11.endSide; + return n10 != r10 && (e21 < 0 ? n10 < 0 : r10 > 0); + } }]), t10; + }(); + var UH = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "eq", value: function(e21) { + return false; + } }, { key: "updateDOM", value: function(e21, t10) { + return false; + } }, { key: "compare", value: function(e21) { + return this == e21 || this.constructor == e21.constructor && this.eq(e21); + } }, { key: "estimatedHeight", get: function() { + return -1; + } }, { key: "lineBreaks", get: function() { + return 0; + } }, { key: "ignoreEvent", value: function(e21) { + return true; + } }, { key: "coordsAt", value: function(e21, t10, n10) { + return null; + } }, { key: "isHidden", get: function() { + return false; + } }, { key: "editable", get: function() { + return false; + } }, { key: "destroy", value: function(e21) { + } }]), e20; + }(); + var JH = function(e20) { + return e20[e20.Text = 0] = "Text", e20[e20.WidgetBefore = 1] = "WidgetBefore", e20[e20.WidgetAfter = 2] = "WidgetAfter", e20[e20.WidgetRange = 3] = "WidgetRange", e20; + }(JH || (JH = {})); + var KH = function(e20) { + function t10(e21, n10, r10, o10) { + var i10; + return No(this, t10), (i10 = _o(this, t10)).startSide = e21, i10.endSide = n10, i10.widget = r10, i10.spec = o10, i10; + } + return Ao(t10, yV), Do(t10, [{ key: "heightRelevant", get: function() { + return false; + } }, { key: "hasHeight", value: function() { + return !!this.widget && this.widget.estimatedHeight > -1; + } }], [{ key: "mark", value: function(e21) { + return new GH(e21); + } }, { key: "widget", value: function(e21) { + var t11 = Math.max(-1e4, Math.min(1e4, e21.side || 0)), n10 = !!e21.block; + return t11 += n10 && !e21.inlineOrder ? t11 > 0 ? 3e8 : -4e8 : t11 > 0 ? 1e8 : -1e8, new YH(e21, t11, t11, n10, e21.widget || null, false); + } }, { key: "replace", value: function(e21) { + var t11, n10, r10 = !!e21.block; + if (e21.isBlockGap) + t11 = -5e8, n10 = 4e8; + else { + var o10 = XH(e21, r10); + t11 = (o10.start ? r10 ? -3e8 : -1 : 5e8) - 1, n10 = 1 + (o10.end ? r10 ? 2e8 : 1 : -6e8); + } + return new YH(e21, t11, n10, r10, e21.widget || null, true); + } }, { key: "line", value: function(e21) { + return new QH(e21); + } }, { key: "set", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + return xV.of(e21, t11); + } }]), t10; + }(); + KH.none = xV.empty; + var GH = function(e20) { + function t10(e21) { + var n10; + No(this, t10); + var r10 = XH(e21); + return (n10 = _o(this, t10, [r10.start ? -1 : 5e8, r10.end ? 1 : -6e8, null, e21])).tagName = e21.tagName || "span", n10.class = e21.class || "", n10.attrs = e21.attributes || null, n10; + } + return Ao(t10, KH), Do(t10, [{ key: "eq", value: function(e21) { + var n10, r10; + return this == e21 || e21 instanceof t10 && this.tagName == e21.tagName && (this.class || (null === (n10 = this.attrs) || void 0 === n10 ? void 0 : n10.class)) == (e21.class || (null === (r10 = e21.attrs) || void 0 === r10 ? void 0 : r10.class)) && LH(this.attrs, e21.attrs, "class"); + } }, { key: "range", value: function(e21) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21; + if (e21 >= n10) + throw new RangeError("Mark decorations may not be empty"); + return go(Mo(t10.prototype), "range", this).call(this, e21, n10); + } }]), t10; + }(); + GH.prototype.point = false; + var QH = function(e20) { + function t10(e21) { + return No(this, t10), _o(this, t10, [-2e8, -2e8, null, e21]); + } + return Ao(t10, KH), Do(t10, [{ key: "eq", value: function(e21) { + return e21 instanceof t10 && this.spec.class == e21.spec.class && LH(this.spec.attributes, e21.spec.attributes); + } }, { key: "range", value: function(e21) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21; + if (n10 != e21) + throw new RangeError("Line decoration ranges must be zero-length"); + return go(Mo(t10.prototype), "range", this).call(this, e21, n10); + } }]), t10; + }(); + QH.prototype.mapMode = mF.TrackBefore, QH.prototype.point = true; + var YH = function(e20) { + function t10(e21, n10, r10, o10, i10, a10) { + var s10; + return No(this, t10), (s10 = _o(this, t10, [n10, r10, i10, e21])).block = o10, s10.isReplace = a10, s10.mapMode = o10 ? n10 <= 0 ? mF.TrackBefore : mF.TrackAfter : mF.TrackDel, s10; + } + return Ao(t10, KH), Do(t10, [{ key: "type", get: function() { + return this.startSide != this.endSide ? JH.WidgetRange : this.startSide <= 0 ? JH.WidgetBefore : JH.WidgetAfter; + } }, { key: "heightRelevant", get: function() { + return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0); + } }, { key: "eq", value: function(e21) { + return e21 instanceof t10 && (n10 = this.widget, r10 = e21.widget, n10 == r10 || !!(n10 && r10 && n10.compare(r10))) && this.block == e21.block && this.startSide == e21.startSide && this.endSide == e21.endSide; + var n10, r10; + } }, { key: "range", value: function(e21) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21; + if (this.isReplace && (e21 > n10 || e21 == n10 && this.startSide > 0 && this.endSide <= 0)) + throw new RangeError("Invalid range for replacement decoration"); + if (!this.isReplace && n10 != e21) + throw new RangeError("Widget decorations can only have zero-length ranges"); + return go(Mo(t10.prototype), "range", this).call(this, e21, n10); + } }]), t10; + }(); + function XH(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n10 = e20.inclusiveStart, r10 = e20.inclusiveEnd; + return null == n10 && (n10 = e20.inclusive), null == r10 && (r10 = e20.inclusive), { start: null != n10 ? n10 : t10, end: null != r10 ? r10 : t10 }; + } + function ZH(e20, t10, n10) { + var r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o10 = n10.length - 1; + o10 >= 0 && n10[o10] + r10 >= e20 ? n10[o10] = Math.max(n10[o10], t10) : n10.push(e20, t10); + } + YH.prototype.point = true; + var eW = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.doc = t10, this.pos = n10, this.end = r10, this.disallowBlockEffectsFor = o10, this.content = [], this.curLine = null, this.breakAtStart = 0, this.pendingBuffer = 0, this.bufferMarks = [], this.atCursorPos = true, this.openStart = -1, this.openEnd = -1, this.text = "", this.textOff = 0, this.cursor = t10.iter(), this.skip = n10; + } + return Do(e20, [{ key: "posCovered", value: function() { + if (0 == this.content.length) + return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos; + var e21 = this.content[this.content.length - 1]; + return !(e21.breakAfter || e21 instanceof WH && e21.deco.endSide < 0); + } }, { key: "getLine", value: function() { + return this.curLine || (this.content.push(this.curLine = new HH()), this.atCursorPos = true), this.curLine; + } }, { key: "flushBuffer", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.bufferMarks; + this.pendingBuffer && (this.curLine.append(tW(new NH(-1), e21), e21.length), this.pendingBuffer = 0); + } }, { key: "addBlockWidget", value: function(e21) { + this.flushBuffer(), this.curLine = null, this.content.push(e21); + } }, { key: "finish", value: function(e21) { + this.pendingBuffer && e21 <= this.bufferMarks.length ? this.flushBuffer() : this.pendingBuffer = 0, this.posCovered() || e21 && this.content.length && this.content[this.content.length - 1] instanceof WH || this.getLine(); + } }, { key: "buildText", value: function(e21, t10, n10) { + for (; e21 > 0; ) { + if (this.textOff == this.text.length) { + var r10 = this.cursor.next(this.skip), o10 = r10.value, i10 = r10.lineBreak, a10 = r10.done; + if (this.skip = 0, a10) + throw new Error("Ran out of text content when drawing inline views"); + if (i10) { + this.posCovered() || this.getLine(), this.content.length ? this.content[this.content.length - 1].breakAfter = 1 : this.breakAtStart = 1, this.flushBuffer(), this.curLine = null, this.atCursorPos = true, e21--; + continue; + } + this.text = o10, this.textOff = 0; + } + var s10 = Math.min(this.text.length - this.textOff, e21, 512); + this.flushBuffer(t10.slice(t10.length - n10)), this.getLine().append(tW(new PH(this.text.slice(this.textOff, this.textOff + s10)), t10), n10), this.atCursorPos = true, this.textOff += s10, e21 -= s10, n10 = 0; + } + } }, { key: "span", value: function(e21, t10, n10, r10) { + this.buildText(t10 - e21, n10, r10), this.pos = t10, this.openStart < 0 && (this.openStart = r10); + } }, { key: "point", value: function(e21, t10, n10, r10, o10, i10) { + if (this.disallowBlockEffectsFor[i10] && n10 instanceof YH) { + if (n10.block) + throw new RangeError("Block decorations may not be specified via plugins"); + if (t10 > this.doc.lineAt(this.pos).to) + throw new RangeError("Decorations that replace line breaks may not be specified via plugins"); + } + var a10 = t10 - e21; + if (n10 instanceof YH) + if (n10.block) + n10.startSide > 0 && !this.posCovered() && this.getLine(), this.addBlockWidget(new WH(n10.widget || new nW("div"), a10, n10)); + else { + var s10 = RH.create(n10.widget || new nW("span"), a10, a10 ? 0 : n10.startSide), c10 = this.atCursorPos && !s10.isEditable && o10 <= r10.length && (e21 < t10 || n10.startSide > 0), l10 = !s10.isEditable && (e21 < t10 || o10 > r10.length || n10.startSide <= 0), u10 = this.getLine(); + 2 != this.pendingBuffer || c10 || s10.isEditable || (this.pendingBuffer = 0), this.flushBuffer(r10), c10 && (u10.append(tW(new NH(1), r10), o10), o10 = r10.length + Math.max(0, o10 - r10.length)), u10.append(tW(s10, r10), o10), this.atCursorPos = l10, this.pendingBuffer = l10 ? e21 < t10 || o10 > r10.length ? 1 : 2 : 0, this.pendingBuffer && (this.bufferMarks = r10.slice()); + } + else + this.doc.lineAt(this.pos).from == this.pos && this.getLine().addLineDeco(n10); + a10 && (this.textOff + a10 <= this.text.length ? this.textOff += a10 : (this.skip += a10 - (this.text.length - this.textOff), this.text = "", this.textOff = 0), this.pos = t10), this.openStart < 0 && (this.openStart = o10); + } }], [{ key: "build", value: function(t10, n10, r10, o10, i10) { + var a10 = new e20(t10, n10, r10, i10); + return a10.openEnd = xV.spans(o10, n10, r10, a10), a10.openStart < 0 && (a10.openStart = a10.openEnd), a10.finish(a10.openEnd), a10; + } }]), e20; + }(); + function tW(e20, t10) { + var n10, r10 = bo(t10); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + e20 = new TH(o10, [e20], e20.length); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + return e20; + } + var nW = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).tag = e21, n10; + } + return Ao(t10, UH), Do(t10, [{ key: "eq", value: function(e21) { + return e21.tag == this.tag; + } }, { key: "toDOM", value: function() { + return document.createElement(this.tag); + } }, { key: "updateDOM", value: function(e21) { + return e21.nodeName.toLowerCase() == this.tag; + } }, { key: "isHidden", get: function() { + return true; + } }]), t10; + }(); + var rW = function(e20) { + return e20[e20.LTR = 0] = "LTR", e20[e20.RTL = 1] = "RTL", e20; + }(rW || (rW = {})); + var oW = rW.LTR; + var iW = rW.RTL; + function aW(e20) { + for (var t10 = [], n10 = 0; n10 < e20.length; n10++) + t10.push(1 << +e20[n10]); + return t10; + } + for (sW = aW("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), cW = aW("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), lW = /* @__PURE__ */ Object.create(null), uW = [], fW = 0, dW = ["()", "[]", "{}"]; fW < dW.length; fW++) { + hW = dW[fW], vW = hW.charCodeAt(0), pW = hW.charCodeAt(1); + lW[vW] = pW, lW[pW] = -vW; + } + var hW; + var vW; + var pW; + var sW; + var cW; + var lW; + var uW; + var fW; + var dW; + function mW(e20) { + return e20 <= 247 ? sW[e20] : 1424 <= e20 && e20 <= 1524 ? 2 : 1536 <= e20 && e20 <= 1785 ? cW[e20 - 1536] : 1774 <= e20 && e20 <= 2220 ? 4 : 8192 <= e20 && e20 <= 8204 ? 256 : 64336 <= e20 && e20 <= 65023 ? 4 : 1; + } + var gW = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/; + var yW = function() { + function e20(t10, n10, r10) { + No(this, e20), this.from = t10, this.to = n10, this.level = r10; + } + return Do(e20, [{ key: "dir", get: function() { + return this.level % 2 ? iW : oW; + } }, { key: "side", value: function(e21, t10) { + return this.dir == t10 == e21 ? this.to : this.from; + } }, { key: "forward", value: function(e21, t10) { + return e21 == (this.dir == t10); + } }], [{ key: "find", value: function(e21, t10, n10, r10) { + for (var o10 = -1, i10 = 0; i10 < e21.length; i10++) { + var a10 = e21[i10]; + if (a10.from <= t10 && a10.to >= t10) { + if (a10.level == n10) + return i10; + (o10 < 0 || (0 != r10 ? r10 < 0 ? a10.from < t10 : a10.to > t10 : e21[o10].level > a10.level)) && (o10 = i10); + } + } + if (o10 < 0) + throw new RangeError("Index out of range"); + return o10; + } }]), e20; + }(); + function bW(e20, t10) { + if (e20.length != t10.length) + return false; + for (var n10 = 0; n10 < e20.length; n10++) { + var r10 = e20[n10], o10 = t10[n10]; + if (r10.from != o10.from || r10.to != o10.to || r10.direction != o10.direction || !bW(r10.inner, o10.inner)) + return false; + } + return true; + } + var kW = []; + function wW(e20, t10, n10, r10, o10, i10, a10) { + var s10 = r10 % 2 ? 2 : 1; + if (r10 % 2 == o10 % 2) + for (var c10 = t10, l10 = 0; c10 < n10; ) { + var u10 = true, f10 = false; + if (l10 == i10.length || c10 < i10[l10].from) { + var d10 = kW[c10]; + d10 != s10 && (u10 = false, f10 = 16 == d10); + } + var h10 = u10 || 1 != s10 ? null : [], v10 = u10 ? r10 : r10 + 1, p10 = c10; + e: + for (; ; ) + if (l10 < i10.length && p10 == i10[l10].from) { + if (f10) + break e; + var m10 = i10[l10]; + if (!u10) + for (var g10 = m10.to, y10 = l10 + 1; ; ) { + if (g10 == n10) + break e; + if (!(y10 < i10.length && i10[y10].from == g10)) { + if (kW[g10] == s10) + break e; + break; + } + g10 = i10[y10++].to; + } + if (l10++, h10) + h10.push(m10); + else + m10.from > c10 && a10.push(new yW(c10, m10.from, v10)), xW(e20, m10.direction == oW != !(v10 % 2) ? r10 + 1 : r10, o10, m10.inner, m10.from, m10.to, a10), c10 = m10.to; + p10 = m10.to; + } else { + if (p10 == n10 || (u10 ? kW[p10] != s10 : kW[p10] == s10)) + break; + p10++; + } + h10 ? wW(e20, c10, p10, r10 + 1, o10, h10, a10) : c10 < p10 && a10.push(new yW(c10, p10, v10)), c10 = p10; + } + else + for (var b10 = n10, k10 = i10.length; b10 > t10; ) { + var w10 = true, x10 = false; + if (!k10 || b10 > i10[k10 - 1].to) { + var j10 = kW[b10 - 1]; + j10 != s10 && (w10 = false, x10 = 16 == j10); + } + var S10 = w10 || 1 != s10 ? null : [], C10 = w10 ? r10 : r10 + 1, $10 = b10; + e: + for (; ; ) + if (k10 && $10 == i10[k10 - 1].to) { + if (x10) + break e; + var _10 = i10[--k10]; + if (!w10) + for (var O10 = _10.from, M10 = k10; ; ) { + if (O10 == t10) + break e; + if (!M10 || i10[M10 - 1].to != O10) { + if (kW[O10 - 1] == s10) + break e; + break; + } + O10 = i10[--M10].from; + } + if (S10) + S10.push(_10); + else + _10.to < b10 && a10.push(new yW(_10.to, b10, C10)), xW(e20, _10.direction == oW != !(C10 % 2) ? r10 + 1 : r10, o10, _10.inner, _10.from, _10.to, a10), b10 = _10.from; + $10 = _10.from; + } else { + if ($10 == t10 || (w10 ? kW[$10 - 1] != s10 : kW[$10 - 1] == s10)) + break; + $10--; + } + S10 ? wW(e20, $10, b10, r10 + 1, o10, S10, a10) : $10 < b10 && a10.push(new yW($10, b10, C10)), b10 = $10; + } + } + function xW(e20, t10, n10, r10, o10, i10, a10) { + var s10 = t10 % 2 ? 2 : 1; + !function(e21, t11, n11, r11, o11) { + for (var i11 = 0; i11 <= r11.length; i11++) { + for (var a11 = i11 ? r11[i11 - 1].to : t11, s11 = i11 < r11.length ? r11[i11].from : n11, c10 = i11 ? 256 : o11, l10 = a11, u10 = c10, f10 = c10; l10 < s11; l10++) { + var d10 = mW(e21.charCodeAt(l10)); + 512 == d10 ? d10 = u10 : 8 == d10 && 4 == f10 && (d10 = 16), kW[l10] = 4 == d10 ? 2 : d10, 7 & d10 && (f10 = d10), u10 = d10; + } + for (var h10 = a11, v10 = c10, p10 = c10; h10 < s11; h10++) { + var m10 = kW[h10]; + if (128 == m10) + h10 < s11 - 1 && v10 == kW[h10 + 1] && 24 & v10 ? m10 = kW[h10] = v10 : kW[h10] = 256; + else if (64 == m10) { + for (var g10 = h10 + 1; g10 < s11 && 64 == kW[g10]; ) + g10++; + for (var y10 = h10 && 8 == v10 || g10 < n11 && 8 == kW[g10] ? 1 == p10 ? 1 : 8 : 256, b10 = h10; b10 < g10; b10++) + kW[b10] = y10; + h10 = g10 - 1; + } else + 8 == m10 && 1 == p10 && (kW[h10] = 1); + v10 = m10, 7 & m10 && (p10 = m10); + } + } + }(e20, o10, i10, r10, s10), function(e21, t11, n11, r11, o11) { + for (var i11 = 1 == o11 ? 2 : 1, a11 = 0, s11 = 0, c10 = 0; a11 <= r11.length; a11++) + for (var l10, u10, f10, d10 = a11 ? r11[a11 - 1].to : t11, h10 = a11 < r11.length ? r11[a11].from : n11, v10 = d10; v10 < h10; v10++) + if (u10 = lW[l10 = e21.charCodeAt(v10)]) + if (u10 < 0) { + for (var p10 = s11 - 3; p10 >= 0; p10 -= 3) + if (uW[p10 + 1] == -u10) { + var m10 = uW[p10 + 2], g10 = 2 & m10 ? o11 : 4 & m10 ? 1 & m10 ? i11 : o11 : 0; + g10 && (kW[v10] = kW[uW[p10]] = g10), s11 = p10; + break; + } + } else { + if (189 == uW.length) + break; + uW[s11++] = v10, uW[s11++] = l10, uW[s11++] = c10; + } + else if (2 == (f10 = kW[v10]) || 1 == f10) { + var y10 = f10 == o11; + c10 = y10 ? 0 : 1; + for (var b10 = s11 - 3; b10 >= 0; b10 -= 3) { + var k10 = uW[b10 + 2]; + if (2 & k10) + break; + if (y10) + uW[b10 + 2] |= 2; + else { + if (4 & k10) + break; + uW[b10 + 2] |= 4; + } + } + } + }(e20, o10, i10, r10, s10), function(e21, t11, n11, r11) { + for (var o11 = 0, i11 = r11; o11 <= n11.length; o11++) + for (var a11 = o11 ? n11[o11 - 1].to : e21, s11 = o11 < n11.length ? n11[o11].from : t11, c10 = a11; c10 < s11; ) { + var l10 = kW[c10]; + if (256 == l10) { + for (var u10 = c10 + 1; ; ) + if (u10 == s11) { + if (o11 == n11.length) + break; + u10 = n11[o11++].to, s11 = o11 < n11.length ? n11[o11].from : t11; + } else { + if (256 != kW[u10]) + break; + u10++; + } + for (var f10 = 1 == i11, d10 = f10 == (1 == (u10 < t11 ? kW[u10] : r11)) ? f10 ? 1 : 2 : r11, h10 = u10, v10 = o11, p10 = v10 ? n11[v10 - 1].to : e21; h10 > c10; ) + h10 == p10 && (h10 = n11[--v10].from, p10 = v10 ? n11[v10 - 1].to : e21), kW[--h10] = d10; + c10 = u10; + } else + i11 = l10, c10++; + } + }(o10, i10, r10, s10), wW(e20, o10, i10, t10, n10, r10, a10); + } + function jW(e20) { + return [new yW(0, e20, 0)]; + } + var SW = ""; + function CW(e20, t10, n10, r10, o10) { + var i10, a10 = r10.head - e20.from, s10 = yW.find(t10, a10, null !== (i10 = r10.bidiLevel) && void 0 !== i10 ? i10 : -1, r10.assoc), c10 = t10[s10], l10 = c10.side(o10, n10); + if (a10 == l10) { + var u10 = s10 += o10 ? 1 : -1; + if (u10 < 0 || u10 >= t10.length) + return null; + a10 = (c10 = t10[s10 = u10]).side(!o10, n10), l10 = c10.side(o10, n10); + } + var f10 = sF(e20.text, a10, c10.forward(o10, n10)); + (f10 < c10.from || f10 > c10.to) && (f10 = l10), SW = e20.text.slice(Math.min(a10, f10), Math.max(a10, f10)); + var d10 = s10 == (o10 ? t10.length - 1 : 0) ? null : t10[s10 + (o10 ? 1 : -1)]; + return d10 && f10 == l10 && d10.level + (o10 ? 0 : 1) < c10.level ? $F.cursor(d10.side(!o10, n10) + e20.from, d10.forward(o10, n10) ? 1 : -1, d10.level) : $F.cursor(f10 + e20.from, c10.forward(o10, n10) ? -1 : 1, c10.level); + } + function $W(e20, t10, n10) { + for (var r10 = t10; r10 < n10; r10++) { + var o10 = mW(e20.charCodeAt(r10)); + if (1 == o10) + return oW; + if (2 == o10 || 4 == o10) + return iW; + } + return oW; + } + var _W = MF.define(); + var OW = MF.define(); + var MW = MF.define(); + var EW = MF.define(); + var AW = MF.define(); + var PW = MF.define(); + var TW = MF.define(); + var RW = MF.define({ combine: function(e20) { + return e20.some(function(e21) { + return e21; + }); + } }); + var NW = MF.define({ combine: function(e20) { + return e20.some(function(e21) { + return e21; + }); + } }); + var IW = function() { + function e20(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "nearest", r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "nearest", o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 5, i10 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 5, a10 = arguments.length > 5 && void 0 !== arguments[5] && arguments[5]; + No(this, e20), this.range = t10, this.y = n10, this.x = r10, this.yMargin = o10, this.xMargin = i10, this.isSnapshot = a10; + } + return Do(e20, [{ key: "map", value: function(t10) { + return t10.empty ? this : new e20(this.range.map(t10), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); + } }, { key: "clip", value: function(t10) { + return this.range.to <= t10.doc.length ? this : new e20($F.cursor(t10.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot); + } }]), e20; + }(); + var DW = oV.define({ map: function(e20, t10) { + return e20.map(t10); + } }); + function qW(e20, t10, n10) { + var r10 = e20.facet(EW); + r10.length ? r10[0](t10) : window.onerror ? window.onerror(String(t10), n10, void 0, void 0, t10) : n10 ? console.error(n10 + ":", t10) : console.error(t10); + } + var zW = MF.define({ combine: function(e20) { + return !e20.length || e20[0]; + } }); + var BW = 0; + var LW = MF.define(); + var FW = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.id = t10, this.create = n10, this.domEventHandlers = r10, this.domEventObservers = o10, this.extension = i10(this); + } + return Do(e20, null, [{ key: "define", value: function(t10, n10) { + var r10 = n10 || {}, o10 = r10.eventHandlers, i10 = r10.eventObservers, a10 = r10.provide, s10 = r10.decorations; + return new e20(BW++, t10, o10, i10, function(e21) { + var t11 = [LW.of(e21)]; + return s10 && t11.push(UW.of(function(t12) { + var n11 = t12.plugin(e21); + return n11 ? s10(n11) : KH.none; + })), a10 && t11.push(a10(e21)), t11; + }); + } }, { key: "fromClass", value: function(t10, n10) { + return e20.define(function(e21) { + return new t10(e21); + }, n10); + } }]), e20; + }(); + var VW = function() { + function e20(t10) { + No(this, e20), this.spec = t10, this.mustUpdate = null, this.value = null; + } + return Do(e20, [{ key: "update", value: function(e21) { + if (this.value) { + if (this.mustUpdate) { + var t10 = this.mustUpdate; + if (this.mustUpdate = null, this.value.update) + try { + this.value.update(t10); + } catch (e23) { + if (qW(t10.state, e23, "CodeMirror plugin crashed"), this.value.destroy) + try { + this.value.destroy(); + } catch (e24) { + } + this.deactivate(); + } + } + } else if (this.spec) + try { + this.value = this.spec.create(e21); + } catch (t11) { + qW(e21.state, t11, "CodeMirror plugin crashed"), this.deactivate(); + } + return this; + } }, { key: "destroy", value: function(e21) { + var t10; + if (null === (t10 = this.value) || void 0 === t10 ? void 0 : t10.destroy) + try { + this.value.destroy(); + } catch (t11) { + qW(e21.state, t11, "CodeMirror plugin crashed"); + } + } }, { key: "deactivate", value: function() { + this.spec = this.value = null; + } }]), e20; + }(); + var HW = MF.define(); + var WW = MF.define(); + var UW = MF.define(); + var JW = MF.define(); + var KW = MF.define(); + var GW = MF.define(); + function QW(e20, t10) { + var n10 = e20.state.facet(GW); + if (!n10.length) + return n10; + var r10 = n10.map(function(t11) { + return t11 instanceof Function ? t11(e20) : t11; + }), o10 = []; + return xV.spans(r10, t10.from, t10.to, { point: function() { + }, span: function(e21, n11, r11, i10) { + for (var a10 = e21 - t10.from, s10 = n11 - t10.from, c10 = o10, l10 = r11.length - 1; l10 >= 0; l10--, i10--) { + var u10 = r11[l10].spec.bidiIsolate, f10 = void 0; + if (null == u10 && (u10 = $W(t10.text, a10, s10)), i10 > 0 && c10.length && (f10 = c10[c10.length - 1]).to == a10 && f10.direction == u10) + f10.to = s10, c10 = f10.inner; + else { + var d10 = { from: a10, to: s10, direction: u10, inner: [] }; + c10.push(d10), c10 = d10.inner; + } + } + } }), o10; + } + var YW = MF.define(); + function XW(e20) { + var t10, n10 = 0, r10 = 0, o10 = 0, i10 = 0, a10 = bo(e20.state.facet(YW)); + try { + for (a10.s(); !(t10 = a10.n()).done; ) { + var s10 = (0, t10.value)(e20); + s10 && (null != s10.left && (n10 = Math.max(n10, s10.left)), null != s10.right && (r10 = Math.max(r10, s10.right)), null != s10.top && (o10 = Math.max(o10, s10.top)), null != s10.bottom && (i10 = Math.max(i10, s10.bottom))); + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return { left: n10, right: r10, top: o10, bottom: i10 }; + } + var ZW = MF.define(); + var eU = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.fromA = t10, this.toA = n10, this.fromB = r10, this.toB = o10; + } + return Do(e20, [{ key: "join", value: function(t10) { + return new e20(Math.min(this.fromA, t10.fromA), Math.max(this.toA, t10.toA), Math.min(this.fromB, t10.fromB), Math.max(this.toB, t10.toB)); + } }, { key: "addToSet", value: function(e21) { + for (var t10 = e21.length, n10 = this; t10 > 0; t10--) { + var r10 = e21[t10 - 1]; + if (!(r10.fromA > n10.toA)) { + if (r10.toA < n10.fromA) + break; + n10 = n10.join(r10), e21.splice(t10 - 1, 1); + } + } + return e21.splice(t10, 0, n10), e21; + } }], [{ key: "extendWithRanges", value: function(t10, n10) { + if (0 == n10.length) + return t10; + for (var r10 = [], o10 = 0, i10 = 0, a10 = 0, s10 = 0; ; o10++) { + for (var c10 = o10 == t10.length ? null : t10[o10], l10 = a10 - s10, u10 = c10 ? c10.fromB : 1e9; i10 < n10.length && n10[i10] < u10; ) { + var f10 = n10[i10], d10 = n10[i10 + 1], h10 = Math.max(s10, f10), v10 = Math.min(u10, d10); + if (h10 <= v10 && new e20(h10 + l10, v10 + l10, h10, v10).addToSet(r10), d10 > u10) + break; + i10 += 2; + } + if (!c10) + return r10; + new e20(c10.fromA, c10.toA, c10.fromB, c10.toB).addToSet(r10), a10 = c10.toA, s10 = c10.toB; + } + } }]), e20; + }(); + var tU = function() { + function e20(t10, n10, r10) { + No(this, e20), this.view = t10, this.state = n10, this.transactions = r10, this.flags = 0, this.startState = t10.state, this.changes = yF.empty(this.startState.doc.length); + var o10, i10 = bo(r10); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + var a10 = o10.value; + this.changes = this.changes.compose(a10.changes); + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + var s10 = []; + this.changes.iterChangedRanges(function(e21, t11, n11, r11) { + return s10.push(new eU(e21, t11, n11, r11)); + }), this.changedRanges = s10; + } + return Do(e20, [{ key: "viewportChanged", get: function() { + return (4 & this.flags) > 0; + } }, { key: "heightChanged", get: function() { + return (2 & this.flags) > 0; + } }, { key: "geometryChanged", get: function() { + return this.docChanged || (10 & this.flags) > 0; + } }, { key: "focusChanged", get: function() { + return (1 & this.flags) > 0; + } }, { key: "docChanged", get: function() { + return !this.changes.empty; + } }, { key: "selectionSet", get: function() { + return this.transactions.some(function(e21) { + return e21.selection; + }); + } }, { key: "empty", get: function() { + return 0 == this.flags && 0 == this.transactions.length; + } }], [{ key: "create", value: function(t10, n10, r10) { + return new e20(t10, n10, r10); + } }]), e20; + }(); + var nU = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).view = e21, n10.decorations = [], n10.dynamicDecorationMap = [], n10.domChanged = null, n10.hasComposition = null, n10.markedForComposition = /* @__PURE__ */ new Set(), n10.minWidth = 0, n10.minWidthFrom = 0, n10.minWidthTo = 0, n10.impreciseAnchor = null, n10.impreciseHead = null, n10.forceSelection = false, n10.lastUpdate = Date.now(), n10.setDOM(e21.contentDOM), n10.children = [new HH()], n10.children[0].setParent(Eo(n10)), n10.updateDeco(), n10.updateInner([new eU(0, 0, 0, e21.state.doc.length)], 0, null), n10; + } + return Ao(t10, pH), Do(t10, [{ key: "length", get: function() { + return this.view.state.doc.length; + } }, { key: "update", value: function(e21) { + var t11, n10 = this, r10 = e21.changedRanges; + this.minWidth > 0 && r10.length && (r10.every(function(e23) { + var t12 = e23.fromA; + return e23.toA < n10.minWidthFrom || t12 > n10.minWidthTo; + }) ? (this.minWidthFrom = e21.changes.mapPos(this.minWidthFrom, 1), this.minWidthTo = e21.changes.mapPos(this.minWidthTo, 1)) : this.minWidth = this.minWidthFrom = this.minWidthTo = 0); + var o10 = -1; + this.view.inputState.composing >= 0 && ((null === (t11 = this.domChanged) || void 0 === t11 ? void 0 : t11.newSel) ? o10 = this.domChanged.newSel.head : function(e23, t12) { + var n11 = false; + t12 && e23.iterChangedRanges(function(e24, r11) { + e24 < t12.to && r11 > t12.from && (n11 = true); + }); + return n11; + }(e21.changes, this.hasComposition) || e21.selectionSet || (o10 = e21.state.selection.main.head)); + var i10 = o10 > -1 ? function(e23, t12, n11) { + var r11 = oU(e23, n11); + if (!r11) + return null; + var o11 = r11.node, i11 = r11.from, a11 = r11.to, s11 = o11.nodeValue; + if (/[\n\r]/.test(s11)) + return null; + if (e23.state.doc.sliceString(r11.from, r11.to) != s11) + return null; + for (var c11 = t12.invertedDesc, l11 = new eU(c11.mapPos(i11), c11.mapPos(a11), i11, a11), u11 = [], f11 = o11.parentNode; ; f11 = f11.parentNode) { + var d11 = pH.get(f11); + if (d11 instanceof TH) + u11.push({ node: f11, deco: d11.mark }); + else { + if (d11 instanceof HH || "DIV" == f11.nodeName && f11.parentNode == e23.contentDOM) + return { range: l11, text: o11, marks: u11, line: f11 }; + if (f11 == e23.contentDOM) + return null; + u11.push({ node: f11, deco: new GH({ inclusive: true, attributes: VH(f11), tagName: f11.tagName.toLowerCase() }) }); + } + } + }(this.view, e21.changes, o10) : null; + if (this.domChanged = null, this.hasComposition) { + this.markedForComposition.clear(); + var a10 = this.hasComposition, s10 = a10.from, c10 = a10.to; + r10 = new eU(s10, c10, e21.changes.mapPos(s10, -1), e21.changes.mapPos(c10, 1)).addToSet(r10.slice()); + } + this.hasComposition = i10 ? { from: i10.range.fromB, to: i10.range.toB } : null, (AH.ie || AH.chrome) && !i10 && e21 && e21.state.doc.lines != e21.startState.doc.lines && (this.forceSelection = true); + var l10, u10, f10, d10, h10 = this.decorations, v10 = this.updateDeco(), p10 = (l10 = h10, u10 = v10, f10 = e21.changes, d10 = new aU(), xV.compare(l10, u10, f10, d10), d10.changes); + return r10 = eU.extendWithRanges(r10, p10), !!(7 & this.flags || 0 != r10.length) && (this.updateInner(r10, e21.startState.doc.length, i10), e21.transactions.length && (this.lastUpdate = Date.now()), true); + } }, { key: "updateInner", value: function(e21, t11, n10) { + var r10 = this; + this.view.viewState.mustMeasureContent = true, this.updateChildren(e21, t11, n10); + var o10 = this.view.observer; + o10.ignore(function() { + r10.dom.style.height = r10.view.viewState.contentHeight / r10.view.scaleY + "px", r10.dom.style.flexBasis = r10.minWidth ? r10.minWidth + "px" : ""; + var e23 = AH.chrome || AH.ios ? { node: o10.selectionRange.focusNode, written: false } : void 0; + r10.sync(r10.view, e23), r10.flags &= -8, e23 && (e23.written || o10.selectionRange.focusNode != e23.node) && (r10.forceSelection = true), r10.dom.style.height = ""; + }), this.markedForComposition.forEach(function(e23) { + return e23.flags &= -9; + }); + var i10 = []; + if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) { + var a10, s10 = bo(this.children); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + c10 instanceof WH && c10.widget instanceof rU && i10.push(c10.dom); + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + } + o10.updateGaps(i10); + } }, { key: "updateChildren", value: function(e21, t11, n10) { + for (var r10 = n10 ? n10.range.addToSet(e21.slice()) : e21, o10 = this.childCursor(t11), i10 = r10.length - 1; ; i10--) { + var a10 = i10 >= 0 ? r10[i10] : null; + if (!a10) + break; + var s10 = a10.fromA, c10 = a10.toA, l10 = a10.fromB, u10 = a10.toB, f10 = void 0, d10 = void 0, h10 = void 0, v10 = void 0; + if (n10 && n10.range.fromB < u10 && n10.range.toB > l10) { + var p10 = eW.build(this.view.state.doc, l10, n10.range.fromB, this.decorations, this.dynamicDecorationMap), m10 = eW.build(this.view.state.doc, n10.range.toB, u10, this.decorations, this.dynamicDecorationMap); + d10 = p10.breakAtStart, h10 = p10.openStart, v10 = m10.openEnd; + var g10 = this.compositionView(n10); + m10.breakAtStart ? g10.breakAfter = 1 : m10.content.length && g10.merge(g10.length, g10.length, m10.content[0], false, m10.openStart, 0) && (g10.breakAfter = m10.content[0].breakAfter, m10.content.shift()), p10.content.length && g10.merge(0, 0, p10.content[p10.content.length - 1], true, 0, p10.openEnd) && p10.content.pop(), f10 = p10.content.concat(g10).concat(m10.content); + } else { + var y10 = eW.build(this.view.state.doc, l10, u10, this.decorations, this.dynamicDecorationMap); + f10 = y10.content, d10 = y10.breakAtStart, h10 = y10.openStart, v10 = y10.openEnd; + } + var b10 = o10.findPos(c10, 1), k10 = b10.i, w10 = b10.off, x10 = o10.findPos(s10, -1); + yH(this, x10.i, x10.off, k10, w10, f10, d10, h10, v10); + } + n10 && this.fixCompositionDOM(n10); + } }, { key: "compositionView", value: function(e21) { + var t11 = new PH(e21.text.nodeValue); + t11.flags |= 8; + var n10, r10 = bo(e21.marks); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value.deco; + t11 = new TH(o10, [t11], t11.length); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + var i10 = new HH(); + return i10.append(t11, 0), i10; + } }, { key: "fixCompositionDOM", value: function(e21) { + var t11 = this, n10 = function(e23, n11) { + n11.flags |= 8 | (n11.children.some(function(e24) { + return 7 & e24.flags; + }) ? 1 : 0), t11.markedForComposition.add(n11); + var r11 = pH.get(e23); + r11 && r11 != n11 && (r11.dom = null), n11.setDOM(e23); + }, r10 = this.childPos(e21.range.fromB, 1), o10 = this.children[r10.i]; + n10(e21.line, o10); + for (var i10 = e21.marks.length - 1; i10 >= -1; i10--) + r10 = o10.childPos(r10.off, 1), o10 = o10.children[r10.i], n10(i10 >= 0 ? e21.marks[i10].node : e21.text, o10); + } }, { key: "updateSelection", value: function() { + var e21 = this, t11 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; + !(arguments.length > 0 && void 0 !== arguments[0] && arguments[0]) && this.view.observer.selectionRange.focusNode || this.view.observer.readSelectionRange(); + var n10 = this.view.root.activeElement, r10 = n10 == this.dom, o10 = !r10 && QV(this.dom, this.view.observer.selectionRange) && !(n10 && this.dom.contains(n10)); + if (r10 || t11 || o10) { + var i10 = this.forceSelection; + this.forceSelection = false; + var a10, s10 = this.view.state.selection.main, c10 = this.moveToLine(this.domAtPos(s10.anchor)), l10 = s10.empty ? c10 : this.moveToLine(this.domAtPos(s10.head)); + if (AH.gecko && s10.empty && !this.hasComposition && (1 == (a10 = c10).node.nodeType && a10.node.firstChild && (0 == a10.offset || "false" == a10.node.childNodes[a10.offset - 1].contentEditable) && (a10.offset == a10.node.childNodes.length || "false" == a10.node.childNodes[a10.offset].contentEditable))) { + var u10 = document.createTextNode(""); + this.view.observer.ignore(function() { + return c10.node.insertBefore(u10, c10.node.childNodes[c10.offset] || null); + }), c10 = l10 = new hH(u10, 0), i10 = true; + } + var f10 = this.view.observer.selectionRange; + !i10 && f10.focusNode && (XV(c10.node, c10.offset, f10.anchorNode, f10.anchorOffset) && XV(l10.node, l10.offset, f10.focusNode, f10.focusOffset) || this.suppressWidgetCursorChange(f10, s10)) || (this.view.observer.ignore(function() { + AH.android && AH.chrome && e21.dom.contains(f10.focusNode) && function(e23, t13) { + for (var n11 = e23; n11 && n11 != t13; n11 = n11.assignedSlot || n11.parentNode) + if (1 == n11.nodeType && "false" == n11.contentEditable) + return true; + return false; + }(f10.focusNode, e21.dom) && (e21.dom.blur(), e21.dom.focus({ preventScroll: true })); + var t12 = KV(e21.view.root); + if (t12) + if (s10.empty) { + if (AH.gecko) { + var r11 = function(e23, t13) { + return 1 != e23.nodeType ? 0 : (t13 && "false" == e23.childNodes[t13 - 1].contentEditable ? 1 : 0) | (t13 < e23.childNodes.length && "false" == e23.childNodes[t13].contentEditable ? 2 : 0); + }(c10.node, c10.offset); + if (r11 && 3 != r11) { + var i11 = iU(c10.node, c10.offset, 1 == r11 ? 1 : -1); + i11 && (c10 = new hH(i11.node, i11.offset)); + } + } + t12.collapse(c10.node, c10.offset), null != s10.bidiLevel && void 0 !== t12.caretBidiLevel && (t12.caretBidiLevel = s10.bidiLevel); + } else if (t12.extend) { + t12.collapse(c10.node, c10.offset); + try { + t12.extend(l10.node, l10.offset); + } catch (e23) { + } + } else { + var a11 = document.createRange(); + if (s10.anchor > s10.head) { + var u11 = [l10, c10]; + c10 = u11[0], l10 = u11[1]; + } + a11.setEnd(l10.node, l10.offset), a11.setStart(c10.node, c10.offset), t12.removeAllRanges(), t12.addRange(a11); + } + else + ; + o10 && e21.view.root.activeElement == e21.dom && (e21.dom.blur(), n10 && n10.focus()); + }), this.view.observer.setSelectionRange(c10, l10)), this.impreciseAnchor = c10.precise ? null : new hH(f10.anchorNode, f10.anchorOffset), this.impreciseHead = l10.precise ? null : new hH(f10.focusNode, f10.focusOffset); + } + } }, { key: "suppressWidgetCursorChange", value: function(e21, t11) { + return this.hasComposition && t11.empty && XV(e21.focusNode, e21.focusOffset, e21.anchorNode, e21.anchorOffset) && this.posFromDOM(e21.focusNode, e21.focusOffset) == t11.head; + } }, { key: "enforceCursorAssoc", value: function() { + if (!this.hasComposition) { + var e21 = this.view, t11 = e21.state.selection.main, n10 = KV(e21.root), r10 = e21.observer.selectionRange, o10 = r10.anchorNode, i10 = r10.anchorOffset; + if (n10 && t11.empty && t11.assoc && n10.modify) { + var a10 = HH.find(this, t11.head); + if (a10) { + var s10 = a10.posAtStart; + if (t11.head != s10 && t11.head != s10 + a10.length) { + var c10 = this.coordsAt(t11.head, -1), l10 = this.coordsAt(t11.head, 1); + if (c10 && l10 && !(c10.bottom > l10.top)) { + var u10 = this.domAtPos(t11.head + t11.assoc); + n10.collapse(u10.node, u10.offset), n10.modify("move", t11.assoc < 0 ? "forward" : "backward", "lineboundary"), e21.observer.readSelectionRange(); + var f10 = e21.observer.selectionRange; + e21.docView.posFromDOM(f10.anchorNode, f10.anchorOffset) != t11.from && n10.collapse(o10, i10); + } + } + } + } + } + } }, { key: "moveToLine", value: function(e21) { + var t11, n10 = this.dom; + if (e21.node != n10) + return e21; + for (var r10 = e21.offset; !t11 && r10 < n10.childNodes.length; r10++) { + var o10 = pH.get(n10.childNodes[r10]); + o10 instanceof HH && (t11 = o10.domAtPos(0)); + } + for (var i10 = e21.offset - 1; !t11 && i10 >= 0; i10--) { + var a10 = pH.get(n10.childNodes[i10]); + a10 instanceof HH && (t11 = a10.domAtPos(a10.length)); + } + return t11 ? new hH(t11.node, t11.offset, true) : e21; + } }, { key: "nearest", value: function(e21) { + for (var t11 = e21; t11; ) { + var n10 = pH.get(t11); + if (n10 && n10.rootView == this) + return n10; + t11 = t11.parentNode; + } + return null; + } }, { key: "posFromDOM", value: function(e21, t11) { + var n10 = this.nearest(e21); + if (!n10) + throw new RangeError("Trying to find position for a DOM position outside of the document"); + return n10.localPosFromDOM(e21, t11) + n10.posAtStart; + } }, { key: "domAtPos", value: function(e21) { + for (var t11 = this.childCursor().findPos(e21, -1), n10 = t11.i, r10 = t11.off; n10 < this.children.length - 1; ) { + var o10 = this.children[n10]; + if (r10 < o10.length || o10 instanceof HH) + break; + n10++, r10 = 0; + } + return this.children[n10].domAtPos(r10); + } }, { key: "coordsAt", value: function(e21, t11) { + for (var n10 = null, r10 = 0, o10 = this.length, i10 = this.children.length - 1; i10 >= 0; i10--) { + var a10 = this.children[i10], s10 = o10 - a10.breakAfter, c10 = s10 - a10.length; + if (s10 < e21) + break; + c10 <= e21 && (c10 < e21 || a10.covers(-1)) && (s10 > e21 || a10.covers(1)) && (!n10 || a10 instanceof HH && !(n10 instanceof HH && t11 >= 0)) && (n10 = a10, r10 = c10), o10 = c10; + } + return n10 ? n10.coordsAt(e21 - r10, t11) : null; + } }, { key: "coordsForChar", value: function(e21) { + var t11 = this.childPos(e21, 1), n10 = t11.i, r10 = t11.off, o10 = this.children[n10]; + if (!(o10 instanceof HH)) + return null; + for (; o10.children.length; ) { + for (var i10 = o10.childPos(r10, 1), a10 = i10.i, s10 = i10.off; ; a10++) { + if (a10 == o10.children.length) + return null; + if ((o10 = o10.children[a10]).length) + break; + } + r10 = s10; + } + if (!(o10 instanceof PH)) + return null; + var c10 = sF(o10.text, r10); + if (c10 == r10) + return null; + for (var l10 = lH(o10.dom, r10, c10).getClientRects(), u10 = 0; u10 < l10.length; u10++) { + var f10 = l10[u10]; + if (u10 == l10.length - 1 || f10.top < f10.bottom && f10.left < f10.right) + return f10; + } + return null; + } }, { key: "measureVisibleLineHeights", value: function(e21) { + for (var t11 = [], n10 = e21.from, r10 = e21.to, o10 = this.view.contentDOM.clientWidth, i10 = o10 > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1, a10 = -1, s10 = this.view.textDirection == rW.LTR, c10 = 0, l10 = 0; l10 < this.children.length; l10++) { + var u10 = this.children[l10], f10 = c10 + u10.length; + if (f10 > r10) + break; + if (c10 >= n10) { + var d10 = u10.dom.getBoundingClientRect(); + if (t11.push(d10.height), i10) { + var h10 = u10.dom.lastChild, v10 = h10 ? YV(h10) : []; + if (v10.length) { + var p10 = v10[v10.length - 1], m10 = s10 ? p10.right - d10.left : d10.right - p10.left; + m10 > a10 && (a10 = m10, this.minWidth = o10, this.minWidthFrom = c10, this.minWidthTo = f10); + } + } + } + c10 = f10 + u10.breakAfter; + } + return t11; + } }, { key: "textDirectionAt", value: function(e21) { + var t11 = this.childPos(e21, 1).i; + return "rtl" == getComputedStyle(this.children[t11].dom).direction ? rW.RTL : rW.LTR; + } }, { key: "measureTextSize", value: function() { + var e21, t11 = this, n10 = bo(this.children); + try { + for (n10.s(); !(e21 = n10.n()).done; ) { + var r10 = e21.value; + if (r10 instanceof HH) { + var o10 = r10.measureTextSize(); + if (o10) + return o10; + } + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + var i10, a10, s10, c10 = document.createElement("div"); + return c10.className = "cm-line", c10.style.width = "99999px", c10.style.position = "absolute", c10.textContent = "abc def ghi jkl mno pqr stu", this.view.observer.ignore(function() { + t11.dom.appendChild(c10); + var e23 = YV(c10.firstChild)[0]; + i10 = c10.getBoundingClientRect().height, a10 = e23 ? e23.width / 27 : 7, s10 = e23 ? e23.height : i10, c10.remove(); + }), { lineHeight: i10, charWidth: a10, textHeight: s10 }; + } }, { key: "childCursor", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.length, t11 = this.children.length; + return t11 && (e21 -= this.children[--t11].length), new gH(this.children, e21, t11); + } }, { key: "computeBlockGapDeco", value: function() { + for (var e21 = [], t11 = this.view.viewState, n10 = 0, r10 = 0; ; r10++) { + var o10 = r10 == t11.viewports.length ? null : t11.viewports[r10], i10 = o10 ? o10.from - 1 : this.length; + if (i10 > n10) { + var a10 = (t11.lineBlockAt(i10).bottom - t11.lineBlockAt(n10).top) / this.view.scaleY; + e21.push(KH.replace({ widget: new rU(a10), block: true, inclusive: true, isBlockGap: true }).range(n10, i10)); + } + if (!o10) + break; + n10 = o10.to + 1; + } + return KH.set(e21); + } }, { key: "updateDeco", value: function() { + var e21 = this, t11 = this.view.state.facet(UW).map(function(t12, n11) { + return (e21.dynamicDecorationMap[n11] = "function" == typeof t12) ? t12(e21.view) : t12; + }), n10 = false, r10 = this.view.state.facet(JW).map(function(t12, r11) { + var o11 = "function" == typeof t12; + return o11 && (n10 = true), o11 ? t12(e21.view) : t12; + }); + r10.length && (this.dynamicDecorationMap[t11.length] = n10, t11.push(xV.join(r10))); + for (var o10 = t11.length; o10 < t11.length + 3; o10++) + this.dynamicDecorationMap[o10] = false; + return this.decorations = [].concat(Bo(t11), [this.computeBlockGapDeco(), this.view.viewState.lineGapDeco]); + } }, { key: "scrollIntoView", value: function(e21) { + if (e21.isSnapshot) { + var t11 = this.view.viewState.lineBlockAt(e21.range.head); + return this.view.scrollDOM.scrollTop = t11.top - e21.yMargin, void (this.view.scrollDOM.scrollLeft = e21.xMargin); + } + var n10, r10 = e21.range, o10 = this.coordsAt(r10.head, r10.empty ? r10.assoc : r10.head > r10.anchor ? -1 : 1); + if (o10) { + !r10.empty && (n10 = this.coordsAt(r10.anchor, r10.anchor > r10.head ? -1 : 1)) && (o10 = { left: Math.min(o10.left, n10.left), top: Math.min(o10.top, n10.top), right: Math.max(o10.right, n10.right), bottom: Math.max(o10.bottom, n10.bottom) }); + var i10 = XW(this.view), a10 = { left: o10.left - i10.left, top: o10.top - i10.top, right: o10.right + i10.right, bottom: o10.bottom + i10.bottom }, s10 = this.view.scrollDOM, c10 = s10.offsetWidth, l10 = s10.offsetHeight; + !function(e23, t12, n11, r11, o11, i11, a11, s11) { + for (var c11 = e23.ownerDocument, l11 = c11.defaultView || window, u10 = e23, f10 = false; u10 && !f10; ) + if (1 == u10.nodeType) { + var d10 = void 0, h10 = u10 == c11.body, v10 = 1, p10 = 1; + if (h10) + d10 = rH(l11); + else { + if (/^(fixed|sticky)$/.test(getComputedStyle(u10).position) && (f10 = true), u10.scrollHeight <= u10.clientHeight && u10.scrollWidth <= u10.clientWidth) { + u10 = u10.assignedSlot || u10.parentNode; + continue; + } + var m10 = u10.getBoundingClientRect(), g10 = oH(u10, m10); + v10 = g10.scaleX, p10 = g10.scaleY, d10 = { left: m10.left, right: m10.left + u10.clientWidth * v10, top: m10.top, bottom: m10.top + u10.clientHeight * p10 }; + } + var y10 = 0, b10 = 0; + if ("nearest" == o11) + t12.top < d10.top ? (b10 = -(d10.top - t12.top + a11), n11 > 0 && t12.bottom > d10.bottom + b10 && (b10 = t12.bottom - d10.bottom + b10 + a11)) : t12.bottom > d10.bottom && (b10 = t12.bottom - d10.bottom + a11, n11 < 0 && t12.top - b10 < d10.top && (b10 = -(d10.top + b10 - t12.top + a11))); + else { + var k10 = t12.bottom - t12.top, w10 = d10.bottom - d10.top; + b10 = ("center" == o11 && k10 <= w10 ? t12.top + k10 / 2 - w10 / 2 : "start" == o11 || "center" == o11 && n11 < 0 ? t12.top - a11 : t12.bottom - w10 + a11) - d10.top; + } + if ("nearest" == r11 ? t12.left < d10.left ? (y10 = -(d10.left - t12.left + i11), n11 > 0 && t12.right > d10.right + y10 && (y10 = t12.right - d10.right + y10 + i11)) : t12.right > d10.right && (y10 = t12.right - d10.right + i11, n11 < 0 && t12.left < d10.left + y10 && (y10 = -(d10.left + y10 - t12.left + i11))) : y10 = ("center" == r11 ? t12.left + (t12.right - t12.left) / 2 - (d10.right - d10.left) / 2 : "start" == r11 == s11 ? t12.left - i11 : t12.right - (d10.right - d10.left) + i11) - d10.left, y10 || b10) + if (h10) + l11.scrollBy(y10, b10); + else { + var x10 = 0, j10 = 0; + if (b10) { + var S10 = u10.scrollTop; + u10.scrollTop += b10 / p10, j10 = (u10.scrollTop - S10) * p10; + } + if (y10) { + var C10 = u10.scrollLeft; + u10.scrollLeft += y10 / v10, x10 = (u10.scrollLeft - C10) * v10; + } + t12 = { left: t12.left - x10, top: t12.top - j10, right: t12.right - x10, bottom: t12.bottom - j10 }, x10 && Math.abs(x10 - y10) < 1 && (r11 = "nearest"), j10 && Math.abs(j10 - b10) < 1 && (o11 = "nearest"); + } + if (h10) + break; + u10 = u10.assignedSlot || u10.parentNode; + } else { + if (11 != u10.nodeType) + break; + u10 = u10.host; + } + }(this.view.scrollDOM, a10, r10.head < r10.anchor ? -1 : 1, e21.x, e21.y, Math.max(Math.min(e21.xMargin, c10), -c10), Math.max(Math.min(e21.yMargin, l10), -l10), this.view.textDirection == rW.LTR); + } + } }]), t10; + }(); + var rU = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).height = e21, n10; + } + return Ao(t10, UH), Do(t10, [{ key: "toDOM", value: function() { + var e21 = document.createElement("div"); + return e21.className = "cm-gap", this.updateDOM(e21), e21; + } }, { key: "eq", value: function(e21) { + return e21.height == this.height; + } }, { key: "updateDOM", value: function(e21) { + return e21.style.height = this.height + "px", true; + } }, { key: "editable", get: function() { + return true; + } }, { key: "estimatedHeight", get: function() { + return this.height; + } }]), t10; + }(); + function oU(e20, t10) { + var n10 = e20.observer.selectionRange, r10 = n10.focusNode && iU(n10.focusNode, n10.focusOffset, 0); + if (!r10) + return null; + var o10 = t10 - r10.offset; + return { from: o10, to: o10 + r10.node.nodeValue.length, node: r10.node }; + } + function iU(e20, t10, n10) { + if (n10 <= 0) + for (var r10 = e20, o10 = t10; ; ) { + if (3 == r10.nodeType) + return { node: r10, offset: o10 }; + if (!(1 == r10.nodeType && o10 > 0)) + break; + o10 = tH(r10 = r10.childNodes[o10 - 1]); + } + if (n10 >= 0) + for (var i10 = e20, a10 = t10; ; ) { + if (3 == i10.nodeType) + return { node: i10, offset: a10 }; + if (!(1 == i10.nodeType && a10 < i10.childNodes.length && n10 >= 0)) + break; + i10 = i10.childNodes[a10], a10 = 0; + } + return null; + } + var aU = function() { + function e20() { + No(this, e20), this.changes = []; + } + return Do(e20, [{ key: "compareRange", value: function(e21, t10) { + ZH(e21, t10, this.changes); + } }, { key: "comparePoint", value: function(e21, t10) { + ZH(e21, t10, this.changes); + } }]), e20; + }(); + function sU(e20, t10) { + return t10.left > e20 ? t10.left - e20 : Math.max(0, e20 - t10.right); + } + function cU(e20, t10) { + return t10.top > e20 ? t10.top - e20 : Math.max(0, e20 - t10.bottom); + } + function lU(e20, t10) { + return e20.top < t10.bottom - 1 && e20.bottom > t10.top + 1; + } + function uU(e20, t10) { + return t10 < e20.top ? { top: t10, left: e20.left, right: e20.right, bottom: e20.bottom } : e20; + } + function fU(e20, t10) { + return t10 > e20.bottom ? { top: e20.top, left: e20.left, right: e20.right, bottom: t10 } : e20; + } + function dU(e20, t10, n10) { + for (var r10, o10, i10, a10, s10, c10, l10, u10, f10 = false, d10 = e20.firstChild; d10; d10 = d10.nextSibling) + for (var h10 = YV(d10), v10 = 0; v10 < h10.length; v10++) { + var p10 = h10[v10]; + o10 && lU(o10, p10) && (p10 = uU(fU(p10, o10.bottom), o10.top)); + var m10 = sU(t10, p10), g10 = cU(n10, p10); + if (0 == m10 && 0 == g10) + return 3 == d10.nodeType ? hU(d10, t10, n10) : dU(d10, t10, n10); + if (!r10 || a10 > g10 || a10 == g10 && i10 > m10) { + r10 = d10, o10 = p10, i10 = m10, a10 = g10; + var y10 = g10 ? n10 < p10.top ? -1 : 1 : m10 ? t10 < p10.left ? -1 : 1 : 0; + f10 = !y10 || (y10 > 0 ? v10 < h10.length - 1 : v10 > 0); + } + 0 == m10 ? n10 > p10.bottom && (!l10 || l10.bottom < p10.bottom) ? (s10 = d10, l10 = p10) : n10 < p10.top && (!u10 || u10.top > p10.top) && (c10 = d10, u10 = p10) : l10 && lU(l10, p10) ? l10 = fU(l10, p10.bottom) : u10 && lU(u10, p10) && (u10 = uU(u10, p10.top)); + } + if (l10 && l10.bottom >= n10 ? (r10 = s10, o10 = l10) : u10 && u10.top <= n10 && (r10 = c10, o10 = u10), !r10) + return { node: e20, offset: 0 }; + var b10 = Math.max(o10.left, Math.min(o10.right, t10)); + return 3 == r10.nodeType ? hU(r10, b10, n10) : f10 && "false" != r10.contentEditable ? dU(r10, b10, n10) : { node: e20, offset: Array.prototype.indexOf.call(e20.childNodes, r10) + (t10 >= (o10.left + o10.right) / 2 ? 1 : 0) }; + } + function hU(e20, t10, n10) { + for (var r10 = e20.nodeValue.length, o10 = -1, i10 = 1e9, a10 = 0, s10 = 0; s10 < r10; s10++) + for (var c10 = lH(e20, s10, s10 + 1).getClientRects(), l10 = 0; l10 < c10.length; l10++) { + var u10 = c10[l10]; + if (u10.top != u10.bottom) { + a10 || (a10 = t10 - u10.left); + var f10 = (u10.top > n10 ? u10.top - n10 : n10 - u10.bottom) - 1; + if (u10.left - 1 <= t10 && u10.right + 1 >= t10 && f10 < i10) { + var d10 = t10 >= (u10.left + u10.right) / 2, h10 = d10; + if (AH.chrome || AH.gecko) + lH(e20, s10).getBoundingClientRect().left == u10.right && (h10 = !d10); + if (f10 <= 0) + return { node: e20, offset: s10 + (h10 ? 1 : 0) }; + o10 = s10 + (h10 ? 1 : 0), i10 = f10; + } + } + } + return { node: e20, offset: o10 > -1 ? o10 : a10 > 0 ? e20.nodeValue.length : 0 }; + } + function vU(e20, t10, n10) { + var r10, o10, i10, a10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : -1, s10 = e20.contentDOM.getBoundingClientRect(), c10 = s10.top + e20.viewState.paddingTop, l10 = e20.viewState.docHeight, u10 = t10.x, f10 = t10.y, d10 = f10 - c10; + if (d10 < 0) + return 0; + if (d10 > l10) + return e20.state.doc.length; + for (var h10 = e20.viewState.heightOracle.textHeight / 2, v10 = false; (i10 = e20.elementAtHeight(d10)).type != JH.Text; ) + for (; !((d10 = a10 > 0 ? i10.bottom + h10 : i10.top - h10) >= 0 && d10 <= l10); ) { + if (v10) + return n10 ? null : 0; + v10 = true, a10 = -a10; + } + f10 = c10 + d10; + var p10 = i10.from; + if (p10 < e20.viewport.from) + return 0 == e20.viewport.from ? 0 : n10 ? null : pU(e20, s10, i10, u10, f10); + if (p10 > e20.viewport.to) + return e20.viewport.to == e20.state.doc.length ? e20.state.doc.length : n10 ? null : pU(e20, s10, i10, u10, f10); + var m10 = e20.dom.ownerDocument, g10 = e20.root.elementFromPoint ? e20.root : m10, y10 = g10.elementFromPoint(u10, f10); + y10 && !e20.contentDOM.contains(y10) && (y10 = null), y10 || (u10 = Math.max(s10.left + 1, Math.min(s10.right - 1, u10)), (y10 = g10.elementFromPoint(u10, f10)) && !e20.contentDOM.contains(y10) && (y10 = null)); + var b10, k10 = -1; + if (y10 && 0 != (null === (r10 = e20.docView.nearest(y10)) || void 0 === r10 ? void 0 : r10.isEditable)) { + if (m10.caretPositionFromPoint) { + var w10 = m10.caretPositionFromPoint(u10, f10); + w10 && (b10 = w10.offsetNode, k10 = w10.offset); + } else if (m10.caretRangeFromPoint) { + var x10 = m10.caretRangeFromPoint(u10, f10); + x10 && (b10 = x10.startContainer, k10 = x10.startOffset, (!e20.contentDOM.contains(b10) || AH.safari && function(e21, t11, n11) { + var r11; + if (3 != e21.nodeType || t11 != (r11 = e21.nodeValue.length)) + return false; + for (var o11 = e21.nextSibling; o11; o11 = o11.nextSibling) + if (1 != o11.nodeType || "BR" != o11.nodeName) + return false; + return lH(e21, r11 - 1, r11).getBoundingClientRect().left > n11; + }(b10, k10, u10) || AH.chrome && function(e21, t11, n11) { + if (0 != t11) + return false; + for (var r11 = e21; ; ) { + var o11 = r11.parentNode; + if (!o11 || 1 != o11.nodeType || o11.firstChild != r11) + return false; + if (o11.classList.contains("cm-line")) + break; + r11 = o11; + } + var i11 = 1 == e21.nodeType ? e21.getBoundingClientRect() : lH(e21, 0, Math.max(e21.nodeValue.length, 1)).getBoundingClientRect(); + return n11 - i11.left > 5; + }(b10, k10, u10)) && (b10 = void 0)); + } + } + if (!b10 || !e20.docView.dom.contains(b10)) { + var j10 = HH.find(e20.docView, p10); + if (!j10) + return d10 > i10.top + i10.height / 2 ? i10.to : i10.from; + var S10 = dU(j10.dom, u10, f10); + b10 = S10.node, k10 = S10.offset; + } + var C10 = e20.docView.nearest(b10); + if (!C10) + return null; + if (C10.isWidget && 1 == (null === (o10 = C10.dom) || void 0 === o10 ? void 0 : o10.nodeType)) { + var $10 = C10.dom.getBoundingClientRect(); + return t10.y < $10.top || t10.y <= $10.bottom && t10.x <= ($10.left + $10.right) / 2 ? C10.posAtStart : C10.posAtEnd; + } + return C10.localPosFromDOM(b10, k10) + C10.posAtStart; + } + function pU(e20, t10, n10, r10, o10) { + var i10 = Math.round((r10 - t10.left) * e20.defaultCharacterWidth); + if (e20.lineWrapping && n10.height > 1.5 * e20.defaultLineHeight) { + var a10 = e20.viewState.heightOracle.textHeight; + i10 += Math.floor((o10 - n10.top - 0.5 * (e20.defaultLineHeight - a10)) / a10) * e20.viewState.heightOracle.lineLength; + } + var s10 = e20.state.sliceDoc(n10.from, n10.to); + return n10.from + NV(s10, i10, e20.state.tabSize); + } + function mU(e20, t10) { + var n10 = e20.lineBlockAt(t10); + if (Array.isArray(n10.type)) { + var r10, o10 = bo(n10.type); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + if (i10.to > t10 || i10.to == t10 && (i10.to == n10.to || i10.type == JH.Text)) + return i10; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + } + return n10; + } + function gU(e20, t10, n10, r10) { + for (var o10 = e20.state.doc.lineAt(t10.head), i10 = e20.bidiSpans(o10), a10 = e20.textDirectionAt(o10.from), s10 = t10, c10 = null; ; ) { + var l10 = CW(o10, i10, a10, s10, n10), u10 = SW; + if (!l10) { + if (o10.number == (n10 ? e20.state.doc.lines : 1)) + return s10; + u10 = "\n", o10 = e20.state.doc.line(o10.number + (n10 ? 1 : -1)), i10 = e20.bidiSpans(o10), l10 = e20.visualLineSide(o10, !n10); + } + if (c10) { + if (!c10(u10)) + return s10; + } else { + if (!r10) + return l10; + c10 = r10(u10); + } + s10 = l10; + } + } + function yU(e20, t10, n10) { + for (var r10, o10 = function() { + var r11, o11 = 0, i10 = bo(e20); + try { + for (i10.s(); !(r11 = i10.n()).done; ) { + r11.value.between(t10 - 1, t10 + 1, function(e21, r12, i11) { + if (t10 > e21 && t10 < r12) { + var a10 = o11 || n10 || (t10 - e21 < r12 - t10 ? -1 : 1); + t10 = a10 < 0 ? e21 : r12, o11 = a10; + } + }); + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + if (!o11) + return { v: t10 }; + }; ; ) + if (r10 = o10()) + return r10.v; + } + function bU(e20, t10, n10) { + var r10 = yU(e20.state.facet(KW).map(function(t11) { + return t11(e20); + }), n10.from, t10.head > n10.from ? -1 : 1); + return r10 == n10.from ? n10 : $F.cursor(r10, r10 < n10.from ? 1 : -1); + } + var kU = function() { + function e20(t10) { + No(this, e20), this.view = t10, this.lastKeyCode = 0, this.lastKeyTime = 0, this.lastTouchTime = 0, this.lastFocusTime = 0, this.lastScrollTop = 0, this.lastScrollLeft = 0, this.pendingIOSKey = void 0, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastEscPress = 0, this.lastContextMenu = 0, this.scrollHandlers = [], this.handlers = /* @__PURE__ */ Object.create(null), this.composing = -1, this.compositionFirstChange = null, this.compositionEndedAt = 0, this.compositionPendingKey = false, this.compositionPendingChange = false, this.mouseSelection = null, this.draggedContent = null, this.handleEvent = this.handleEvent.bind(this), this.notifiedFocused = t10.hasFocus, AH.safari && t10.contentDOM.addEventListener("input", function() { + return null; + }), AH.gecko && function(e21) { + JU.has(e21) || (JU.add(e21), e21.addEventListener("copy", function() { + }), e21.addEventListener("cut", function() { + })); + }(t10.contentDOM.ownerDocument); + } + return Do(e20, [{ key: "setSelectionOrigin", value: function(e21) { + this.lastSelectionOrigin = e21, this.lastSelectionTime = Date.now(); + } }, { key: "handleEvent", value: function(e21) { + (function(e23, t10) { + if (!t10.bubbles) + return true; + if (t10.defaultPrevented) + return false; + for (var n10, r10 = t10.target; r10 != e23.contentDOM; r10 = r10.parentNode) + if (!r10 || 11 == r10.nodeType || (n10 = pH.get(r10)) && n10.ignoreEvent(t10)) + return false; + return true; + })(this.view, e21) && !this.ignoreDuringComposition(e21) && ("keydown" == e21.type && this.keydown(e21) || this.runHandlers(e21.type, e21)); + } }, { key: "runHandlers", value: function(e21, t10) { + var n10 = this.handlers[e21]; + if (n10) { + var r10, o10 = bo(n10.observers); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + (0, r10.value)(this.view, t10); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + var i10, a10 = bo(n10.handlers); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + if (t10.defaultPrevented) + break; + if (s10(this.view, t10)) { + t10.preventDefault(); + break; + } + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + } + } }, { key: "ensureHandlers", value: function(e21) { + var t10 = xU(e21), n10 = this.handlers, r10 = this.view.contentDOM; + for (var o10 in t10) + if ("scroll" != o10) { + var i10 = !t10[o10].handlers.length, a10 = n10[o10]; + a10 && i10 != !a10.handlers.length && (r10.removeEventListener(o10, this.handleEvent), a10 = null), a10 || r10.addEventListener(o10, this.handleEvent, { passive: i10 }); + } + for (var s10 in n10) + "scroll" == s10 || t10[s10] || r10.removeEventListener(s10, this.handleEvent); + this.handlers = t10; + } }, { key: "keydown", value: function(e21) { + var t10, n10 = this; + return this.lastKeyCode = e21.keyCode, this.lastKeyTime = Date.now(), 9 == e21.keyCode && Date.now() < this.lastEscPress + 2e3 || (27 != e21.keyCode && CU.indexOf(e21.keyCode) < 0 && (this.view.inputState.lastEscPress = 0), !AH.android || !AH.chrome || e21.synthetic || 13 != e21.keyCode && 8 != e21.keyCode ? !AH.ios || e21.synthetic || e21.altKey || e21.metaKey || !((t10 = jU.find(function(t11) { + return t11.keyCode == e21.keyCode; + })) && !e21.ctrlKey || SU.indexOf(e21.key) > -1 && e21.ctrlKey && !e21.shiftKey) ? (229 != e21.keyCode && this.view.observer.forceFlush(), false) : (this.pendingIOSKey = t10 || e21, setTimeout(function() { + return n10.flushIOSKey(); + }, 250), true) : (this.view.observer.delayAndroidKey(e21.key, e21.keyCode), true)); + } }, { key: "flushIOSKey", value: function() { + var e21 = this.pendingIOSKey; + return !!e21 && (this.pendingIOSKey = void 0, uH(this.view.contentDOM, e21.key, e21.keyCode)); + } }, { key: "ignoreDuringComposition", value: function(e21) { + return !!/^key/.test(e21.type) && (this.composing > 0 || !!(AH.safari && !AH.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) && (this.compositionPendingKey = false, true)); + } }, { key: "startMouseSelection", value: function(e21) { + this.mouseSelection && this.mouseSelection.destroy(), this.mouseSelection = e21; + } }, { key: "update", value: function(e21) { + this.mouseSelection && this.mouseSelection.update(e21), this.draggedContent && e21.docChanged && (this.draggedContent = this.draggedContent.map(e21.changes)), e21.transactions.length && (this.lastKeyCode = this.lastSelectionTime = 0); + } }, { key: "destroy", value: function() { + this.mouseSelection && this.mouseSelection.destroy(); + } }]), e20; + }(); + function wU(e20, t10) { + return function(n10, r10) { + try { + return t10.call(e20, r10, n10); + } catch (e21) { + qW(n10.state, e21); + } + }; + } + function xU(e20) { + var t10 = /* @__PURE__ */ Object.create(null); + function n10(e21) { + return t10[e21] || (t10[e21] = { observers: [], handlers: [] }); + } + var r10, o10 = bo(e20); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value, a10 = i10.spec; + if (a10 && a10.domEventHandlers) + for (var s10 in a10.domEventHandlers) { + var c10 = a10.domEventHandlers[s10]; + c10 && n10(s10).handlers.push(wU(i10.value, c10)); + } + if (a10 && a10.domEventObservers) + for (var l10 in a10.domEventObservers) { + var u10 = a10.domEventObservers[l10]; + u10 && n10(l10).observers.push(wU(i10.value, u10)); + } + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + for (var f10 in OU) + n10(f10).handlers.push(OU[f10]); + for (var d10 in MU) + n10(d10).observers.push(MU[d10]); + return t10; + } + var jU = [{ key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" }, { key: "Enter", keyCode: 13, inputType: "insertParagraph" }, { key: "Enter", keyCode: 13, inputType: "insertLineBreak" }, { key: "Delete", keyCode: 46, inputType: "deleteContentForward" }]; + var SU = "dthko"; + var CU = [16, 17, 18, 20, 91, 92, 224, 225]; + function $U(e20) { + return 0.7 * Math.max(0, e20) + 8; + } + var _U = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.view = t10, this.startEvent = n10, this.style = r10, this.mustSelect = o10, this.scrollSpeed = { x: 0, y: 0 }, this.scrolling = -1, this.lastEvent = n10, this.scrollParent = function(e21) { + for (var t11 = e21.ownerDocument, n11 = e21.parentNode; n11 && n11 != t11.body; ) + if (1 == n11.nodeType) { + if (n11.scrollHeight > n11.clientHeight || n11.scrollWidth > n11.clientWidth) + return n11; + n11 = n11.assignedSlot || n11.parentNode; + } else { + if (11 != n11.nodeType) + break; + n11 = n11.host; + } + return null; + }(t10.contentDOM), this.atoms = t10.state.facet(KW).map(function(e21) { + return e21(t10); + }); + var i10 = t10.contentDOM.ownerDocument; + i10.addEventListener("mousemove", this.move = this.move.bind(this)), i10.addEventListener("mouseup", this.up = this.up.bind(this)), this.extend = n10.shiftKey, this.multiple = t10.state.facet(mV.allowMultipleSelections) && function(e21, t11) { + var n11 = e21.state.facet(_W); + return n11.length ? n11[0](t11) : AH.mac ? t11.metaKey : t11.ctrlKey; + }(t10, n10), this.dragging = !(!function(e21, t11) { + var n11 = e21.state.selection.main; + if (n11.empty) + return false; + var r11 = KV(e21.root); + if (!r11 || 0 == r11.rangeCount) + return true; + for (var o11 = r11.getRangeAt(0).getClientRects(), i11 = 0; i11 < o11.length; i11++) { + var a10 = o11[i11]; + if (a10.left <= t11.clientX && a10.right >= t11.clientX && a10.top <= t11.clientY && a10.bottom >= t11.clientY) + return true; + } + return false; + }(t10, n10) || 1 != LU(n10)) && null; + } + return Do(e20, [{ key: "start", value: function(e21) { + false === this.dragging && this.select(e21); + } }, { key: "move", value: function(e21) { + var t10; + if (0 == e21.buttons) + return this.destroy(); + if (!(this.dragging || null == this.dragging && (n10 = this.startEvent, r10 = e21, Math.max(Math.abs(n10.clientX - r10.clientX), Math.abs(n10.clientY - r10.clientY)) < 10))) { + var n10, r10; + this.select(this.lastEvent = e21); + var o10 = 0, i10 = 0, a10 = (null === (t10 = this.scrollParent) || void 0 === t10 ? void 0 : t10.getBoundingClientRect()) || { left: 0, top: 0, right: this.view.win.innerWidth, bottom: this.view.win.innerHeight }, s10 = XW(this.view); + e21.clientX - s10.left <= a10.left + 6 ? o10 = -$U(a10.left - e21.clientX) : e21.clientX + s10.right >= a10.right - 6 && (o10 = $U(e21.clientX - a10.right)), e21.clientY - s10.top <= a10.top + 6 ? i10 = -$U(a10.top - e21.clientY) : e21.clientY + s10.bottom >= a10.bottom - 6 && (i10 = $U(e21.clientY - a10.bottom)), this.setScrollSpeed(o10, i10); + } + } }, { key: "up", value: function(e21) { + null == this.dragging && this.select(this.lastEvent), this.dragging || e21.preventDefault(), this.destroy(); + } }, { key: "destroy", value: function() { + this.setScrollSpeed(0, 0); + var e21 = this.view.contentDOM.ownerDocument; + e21.removeEventListener("mousemove", this.move), e21.removeEventListener("mouseup", this.up), this.view.inputState.mouseSelection = this.view.inputState.draggedContent = null; + } }, { key: "setScrollSpeed", value: function(e21, t10) { + var n10 = this; + this.scrollSpeed = { x: e21, y: t10 }, e21 || t10 ? this.scrolling < 0 && (this.scrolling = setInterval(function() { + return n10.scroll(); + }, 50)) : this.scrolling > -1 && (clearInterval(this.scrolling), this.scrolling = -1); + } }, { key: "scroll", value: function() { + this.scrollParent ? (this.scrollParent.scrollLeft += this.scrollSpeed.x, this.scrollParent.scrollTop += this.scrollSpeed.y) : this.view.win.scrollBy(this.scrollSpeed.x, this.scrollSpeed.y), false === this.dragging && this.select(this.lastEvent); + } }, { key: "skipAtoms", value: function(e21) { + for (var t10 = null, n10 = 0; n10 < e21.ranges.length; n10++) { + var r10 = e21.ranges[n10], o10 = null; + if (r10.empty) { + var i10 = yU(this.atoms, r10.from, 0); + i10 != r10.from && (o10 = $F.cursor(i10, -1)); + } else { + var a10 = yU(this.atoms, r10.from, -1), s10 = yU(this.atoms, r10.to, 1); + a10 == r10.from && s10 == r10.to || (o10 = $F.range(r10.from == r10.anchor ? a10 : s10, r10.from == r10.head ? a10 : s10)); + } + o10 && (t10 || (t10 = e21.ranges.slice()), t10[n10] = o10); + } + return t10 ? $F.create(t10, e21.mainIndex) : e21; + } }, { key: "select", value: function(e21) { + var t10 = this.view, n10 = this.skipAtoms(this.style.get(e21, this.extend, this.multiple)); + !this.mustSelect && n10.eq(t10.state.selection, false === this.dragging) || this.view.dispatch({ selection: n10, userEvent: "select.pointer" }), this.mustSelect = false; + } }, { key: "update", value: function(e21) { + var t10 = this; + this.style.update(e21) && setTimeout(function() { + return t10.select(t10.lastEvent); + }, 20); + } }]), e20; + }(); + var OU = /* @__PURE__ */ Object.create(null); + var MU = /* @__PURE__ */ Object.create(null); + var EU = AH.ie && AH.ie_version < 15 || AH.ios && AH.webkit_version < 604; + function AU(e20, t10) { + var n10, r10 = e20.state, o10 = 1, i10 = r10.toText(t10), a10 = i10.lines == r10.selection.ranges.length, s10 = null != VU && r10.selection.ranges.every(function(e21) { + return e21.empty; + }) && VU == i10.toString(); + if (s10) { + var c10 = -1; + n10 = r10.changeByRange(function(e21) { + var n11 = r10.doc.lineAt(e21.from); + if (n11.from == c10) + return { range: e21 }; + c10 = n11.from; + var s11 = r10.toText((a10 ? i10.line(o10++).text : t10) + r10.lineBreak); + return { changes: { from: n11.from, insert: s11 }, range: $F.cursor(e21.from + s11.length) }; + }); + } else + n10 = a10 ? r10.changeByRange(function(e21) { + var t11 = i10.line(o10++); + return { changes: { from: e21.from, to: e21.to, insert: t11.text }, range: $F.cursor(e21.from + t11.length) }; + }) : r10.replaceSelection(i10); + e20.dispatch(n10, { userEvent: "input.paste", scrollIntoView: true }); + } + function PU(e20, t10, n10, r10) { + if (1 == r10) + return $F.cursor(t10, n10); + if (2 == r10) + return function(e21, t11) { + var n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, r11 = e21.charCategorizer(t11), o11 = e21.doc.lineAt(t11), i11 = t11 - o11.from; + if (0 == o11.length) + return $F.cursor(t11); + 0 == i11 ? n11 = 1 : i11 == o11.length && (n11 = -1); + var a11 = i11, s11 = i11; + n11 < 0 ? a11 = sF(o11.text, i11, false) : s11 = sF(o11.text, i11); + for (var c10 = r11(o11.text.slice(a11, s11)); a11 > 0; ) { + var l10 = sF(o11.text, a11, false); + if (r11(o11.text.slice(l10, a11)) != c10) + break; + a11 = l10; + } + for (; s11 < o11.length; ) { + var u10 = sF(o11.text, s11); + if (r11(o11.text.slice(s11, u10)) != c10) + break; + s11 = u10; + } + return $F.range(a11 + o11.from, s11 + o11.from); + }(e20.state, t10, n10); + var o10 = HH.find(e20.docView, t10), i10 = e20.state.doc.lineAt(o10 ? o10.posAtEnd : t10), a10 = o10 ? o10.posAtStart : i10.from, s10 = o10 ? o10.posAtEnd : i10.to; + return s10 < e20.state.doc.length && s10 == i10.to && s10++, $F.range(a10, s10); + } + MU.scroll = function(e20) { + e20.inputState.lastScrollTop = e20.scrollDOM.scrollTop, e20.inputState.lastScrollLeft = e20.scrollDOM.scrollLeft; + }, OU.keydown = function(e20, t10) { + return e20.inputState.setSelectionOrigin("select"), 27 == t10.keyCode && (e20.inputState.lastEscPress = Date.now()), false; + }, MU.touchstart = function(e20, t10) { + e20.inputState.lastTouchTime = Date.now(), e20.inputState.setSelectionOrigin("select.pointer"); + }, MU.touchmove = function(e20) { + e20.inputState.setSelectionOrigin("select.pointer"); + }, OU.mousedown = function(e20, t10) { + if (e20.observer.flush(), e20.inputState.lastTouchTime > Date.now() - 2e3) + return false; + var n10, r10 = null, o10 = bo(e20.state.facet(MW)); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + if (r10 = (0, n10.value)(e20, t10)) + break; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + if (r10 || 0 != t10.button || (r10 = function(e21, t11) { + var n11 = IU(e21, t11), r11 = LU(t11), o11 = e21.state.selection; + return { update: function(e23) { + e23.docChanged && (n11.pos = e23.changes.mapPos(n11.pos), o11 = o11.map(e23.changes)); + }, get: function(t12, i11, a11) { + var s10, c10 = IU(e21, t12), l10 = PU(e21, c10.pos, c10.bias, r11); + if (n11.pos != c10.pos && !i11) { + var u10 = PU(e21, n11.pos, n11.bias, r11), f10 = Math.min(u10.from, l10.from), d10 = Math.max(u10.to, l10.to); + l10 = f10 < l10.from ? $F.range(f10, d10) : $F.range(d10, f10); + } + return i11 ? o11.replaceRange(o11.main.extend(l10.from, l10.to)) : a11 && 1 == r11 && o11.ranges.length > 1 && (s10 = function(e23, t13) { + for (var n12 = 0; n12 < e23.ranges.length; n12++) { + var r12 = e23.ranges[n12], o12 = r12.from, i12 = r12.to; + if (o12 <= t13 && i12 >= t13) + return $F.create(e23.ranges.slice(0, n12).concat(e23.ranges.slice(n12 + 1)), e23.mainIndex == n12 ? 0 : e23.mainIndex - (e23.mainIndex > n12 ? 1 : 0)); + } + return null; + }(o11, c10.pos)) ? s10 : a11 ? o11.addRange(l10) : $F.create([l10]); + } }; + }(e20, t10)), r10) { + var i10 = !e20.hasFocus; + e20.inputState.startMouseSelection(new _U(e20, t10, r10, i10)), i10 && e20.observer.ignore(function() { + return cH(e20.contentDOM); + }); + var a10 = e20.inputState.mouseSelection; + if (a10) + return a10.start(t10), false === a10.dragging; + } + return false; + }; + var TU = function(e20, t10) { + return e20 >= t10.top && e20 <= t10.bottom; + }; + var RU = function(e20, t10, n10) { + return TU(t10, n10) && e20 >= n10.left && e20 <= n10.right; + }; + function NU(e20, t10, n10, r10) { + var o10 = HH.find(e20.docView, t10); + if (!o10) + return 1; + var i10 = t10 - o10.posAtStart; + if (0 == i10) + return 1; + if (i10 == o10.length) + return -1; + var a10 = o10.coordsAt(i10, -1); + if (a10 && RU(n10, r10, a10)) + return -1; + var s10 = o10.coordsAt(i10, 1); + return s10 && RU(n10, r10, s10) ? 1 : a10 && TU(r10, a10) ? -1 : 1; + } + function IU(e20, t10) { + var n10 = e20.posAtCoords({ x: t10.clientX, y: t10.clientY }, false); + return { pos: n10, bias: NU(e20, n10, t10.clientX, t10.clientY) }; + } + var DU = AH.ie && AH.ie_version <= 11; + var qU = null; + var zU = 0; + var BU = 0; + function LU(e20) { + if (!DU) + return e20.detail; + var t10 = qU, n10 = BU; + return qU = e20, BU = Date.now(), zU = !t10 || n10 > Date.now() - 400 && Math.abs(t10.clientX - e20.clientX) < 2 && Math.abs(t10.clientY - e20.clientY) < 2 ? (zU + 1) % 3 : 1; + } + function FU(e20, t10, n10, r10) { + if (n10) { + var o10 = e20.posAtCoords({ x: t10.clientX, y: t10.clientY }, false), i10 = e20.inputState.draggedContent, a10 = r10 && i10 && function(e21, t11) { + var n11 = e21.state.facet(OW); + return n11.length ? n11[0](t11) : AH.mac ? !t11.altKey : !t11.ctrlKey; + }(e20, t10) ? { from: i10.from, to: i10.to } : null, s10 = { from: o10, insert: n10 }, c10 = e20.state.changes(a10 ? [a10, s10] : s10); + e20.focus(), e20.dispatch({ changes: c10, selection: { anchor: c10.mapPos(o10, -1), head: c10.mapPos(o10, 1) }, userEvent: a10 ? "move.drop" : "input.drop" }), e20.inputState.draggedContent = null; + } + } + OU.dragstart = function(e20, t10) { + var n10 = e20.state.selection.main; + if (t10.target.draggable) { + var r10 = e20.docView.nearest(t10.target); + if (r10 && r10.isWidget) { + var o10 = r10.posAtStart, i10 = o10 + r10.length; + (o10 >= n10.to || i10 <= n10.from) && (n10 = $F.range(o10, i10)); + } + } + var a10 = e20.inputState; + return a10.mouseSelection && (a10.mouseSelection.dragging = true), a10.draggedContent = n10, t10.dataTransfer && (t10.dataTransfer.setData("Text", e20.state.sliceDoc(n10.from, n10.to)), t10.dataTransfer.effectAllowed = "copyMove"), false; + }, OU.dragend = function(e20) { + return e20.inputState.draggedContent = null, false; + }, OU.drop = function(e20, t10) { + if (!t10.dataTransfer) + return false; + if (e20.state.readOnly) + return true; + var n10 = t10.dataTransfer.files; + if (n10 && n10.length) { + for (var r10 = Array(n10.length), o10 = 0, i10 = function() { + ++o10 == n10.length && FU(e20, t10, r10.filter(function(e21) { + return null != e21; + }).join(e20.state.lineBreak), false); + }, a10 = function(e21) { + var t11 = new FileReader(); + t11.onerror = i10, t11.onload = function() { + /[\x00-\x08\x0e-\x1f]{2}/.test(t11.result) || (r10[e21] = t11.result), i10(); + }, t11.readAsText(n10[e21]); + }, s10 = 0; s10 < n10.length; s10++) + a10(s10); + return true; + } + var c10 = t10.dataTransfer.getData("Text"); + return !!c10 && (FU(e20, t10, c10, true), true); + }, OU.paste = function(e20, t10) { + if (e20.state.readOnly) + return true; + e20.observer.flush(); + var n10 = EU ? null : t10.clipboardData; + return n10 ? (AU(e20, n10.getData("text/plain") || n10.getData("text/uri-text")), true) : (function(e21) { + var t11 = e21.dom.parentNode; + if (t11) { + var n11 = t11.appendChild(document.createElement("textarea")); + n11.style.cssText = "position: fixed; left: -10000px; top: 10px", n11.focus(), setTimeout(function() { + e21.focus(), n11.remove(), AU(e21, n11.value); + }, 50); + } + }(e20), false); + }; + var VU = null; + OU.copy = OU.cut = function(e20, t10) { + var n10 = function(e21) { + var t11, n11 = [], r11 = [], o11 = false, i11 = bo(e21.selection.ranges); + try { + for (i11.s(); !(t11 = i11.n()).done; ) { + var a11 = t11.value; + a11.empty || (n11.push(e21.sliceDoc(a11.from, a11.to)), r11.push(a11)); + } + } catch (e23) { + i11.e(e23); + } finally { + i11.f(); + } + if (!n11.length) { + var s10, c10 = -1, l10 = bo(e21.selection.ranges); + try { + for (l10.s(); !(s10 = l10.n()).done; ) { + var u10 = s10.value.from, f10 = e21.doc.lineAt(u10); + f10.number > c10 && (n11.push(f10.text), r11.push({ from: f10.from, to: Math.min(e21.doc.length, f10.to + 1) })), c10 = f10.number; + } + } catch (e23) { + l10.e(e23); + } finally { + l10.f(); + } + o11 = true; + } + return { text: n11.join(e21.lineBreak), ranges: r11, linewise: o11 }; + }(e20.state), r10 = n10.text, o10 = n10.ranges, i10 = n10.linewise; + if (!r10 && !i10) + return false; + VU = i10 ? r10 : null, "cut" != t10.type || e20.state.readOnly || e20.dispatch({ changes: o10, scrollIntoView: true, userEvent: "delete.cut" }); + var a10 = EU ? null : t10.clipboardData; + return a10 ? (a10.clearData(), a10.setData("text/plain", r10), true) : (function(e21, t11) { + var n11 = e21.dom.parentNode; + if (n11) { + var r11 = n11.appendChild(document.createElement("textarea")); + r11.style.cssText = "position: fixed; left: -10000px; top: 10px", r11.value = t11, r11.focus(), r11.selectionEnd = t11.length, r11.selectionStart = 0, setTimeout(function() { + r11.remove(), e21.focus(); + }, 50); + } + }(e20, r10), false); + }; + var HU = tV.define(); + function WU(e20, t10) { + var n10, r10 = [], o10 = bo(e20.facet(TW)); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = (0, n10.value)(e20, t10); + i10 && r10.push(i10); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return r10 ? e20.update({ effects: r10, annotations: HU.of(true) }) : null; + } + function UU(e20) { + setTimeout(function() { + var t10 = e20.hasFocus; + if (t10 != e20.inputState.notifiedFocused) { + var n10 = WU(e20.state, t10); + n10 ? e20.dispatch(n10) : e20.update([]); + } + }, 10); + } + MU.focus = function(e20) { + e20.inputState.lastFocusTime = Date.now(), e20.scrollDOM.scrollTop || !e20.inputState.lastScrollTop && !e20.inputState.lastScrollLeft || (e20.scrollDOM.scrollTop = e20.inputState.lastScrollTop, e20.scrollDOM.scrollLeft = e20.inputState.lastScrollLeft), UU(e20); + }, MU.blur = function(e20) { + e20.observer.clearSelectionRange(), UU(e20); + }, MU.compositionstart = MU.compositionupdate = function(e20) { + null == e20.inputState.compositionFirstChange && (e20.inputState.compositionFirstChange = true), e20.inputState.composing < 0 && (e20.inputState.composing = 0); + }, MU.compositionend = function(e20) { + e20.inputState.composing = -1, e20.inputState.compositionEndedAt = Date.now(), e20.inputState.compositionPendingKey = true, e20.inputState.compositionPendingChange = e20.observer.pendingRecords().length > 0, e20.inputState.compositionFirstChange = null, AH.chrome && AH.android ? e20.observer.flushSoon() : e20.inputState.compositionPendingChange ? Promise.resolve().then(function() { + return e20.observer.flush(); + }) : setTimeout(function() { + e20.inputState.composing < 0 && e20.docView.hasComposition && e20.update([]); + }, 50); + }, MU.contextmenu = function(e20) { + e20.inputState.lastContextMenu = Date.now(); + }, OU.beforeinput = function(e20, t10) { + var n10, r10; + if (AH.chrome && AH.android && (r10 = jU.find(function(e21) { + return e21.inputType == t10.inputType; + })) && (e20.observer.delayAndroidKey(r10.key, r10.keyCode), "Backspace" == r10.key || "Delete" == r10.key)) { + var o10 = (null === (n10 = window.visualViewport) || void 0 === n10 ? void 0 : n10.height) || 0; + setTimeout(function() { + var t11; + ((null === (t11 = window.visualViewport) || void 0 === t11 ? void 0 : t11.height) || 0) > o10 + 10 && e20.hasFocus && (e20.contentDOM.blur(), e20.focus()); + }, 100); + } + return false; + }; + var JU = /* @__PURE__ */ new Set(); + var KU = ["pre-wrap", "normal", "pre-line", "break-spaces"]; + var GU = function() { + function e20(t10) { + No(this, e20), this.lineWrapping = t10, this.doc = UL.empty, this.heightSamples = {}, this.lineHeight = 14, this.charWidth = 7, this.textHeight = 14, this.lineLength = 30, this.heightChanged = false; + } + return Do(e20, [{ key: "heightForGap", value: function(e21, t10) { + var n10 = this.doc.lineAt(t10).number - this.doc.lineAt(e21).number + 1; + return this.lineWrapping && (n10 += Math.max(0, Math.ceil((t10 - e21 - n10 * this.lineLength * 0.5) / this.lineLength))), this.lineHeight * n10; + } }, { key: "heightForLine", value: function(e21) { + return this.lineWrapping ? (1 + Math.max(0, Math.ceil((e21 - this.lineLength) / (this.lineLength - 5)))) * this.lineHeight : this.lineHeight; + } }, { key: "setDoc", value: function(e21) { + return this.doc = e21, this; + } }, { key: "mustRefreshForWrapping", value: function(e21) { + return KU.indexOf(e21) > -1 != this.lineWrapping; + } }, { key: "mustRefreshForHeights", value: function(e21) { + for (var t10 = false, n10 = 0; n10 < e21.length; n10++) { + var r10 = e21[n10]; + r10 < 0 ? n10++ : this.heightSamples[Math.floor(10 * r10)] || (t10 = true, this.heightSamples[Math.floor(10 * r10)] = true); + } + return t10; + } }, { key: "refresh", value: function(e21, t10, n10, r10, o10, i10) { + var a10 = KU.indexOf(e21) > -1, s10 = Math.round(t10) != Math.round(this.lineHeight) || this.lineWrapping != a10; + if (this.lineWrapping = a10, this.lineHeight = t10, this.charWidth = n10, this.textHeight = r10, this.lineLength = o10, s10) { + this.heightSamples = {}; + for (var c10 = 0; c10 < i10.length; c10++) { + var l10 = i10[c10]; + l10 < 0 ? c10++ : this.heightSamples[Math.floor(10 * l10)] = true; + } + } + return s10; + } }]), e20; + }(); + var QU = function() { + function e20(t10, n10) { + No(this, e20), this.from = t10, this.heights = n10, this.index = 0; + } + return Do(e20, [{ key: "more", get: function() { + return this.index < this.heights.length; + } }]), e20; + }(); + var YU = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.from = t10, this.length = n10, this.top = r10, this.height = o10, this._content = i10; + } + return Do(e20, [{ key: "type", get: function() { + return "number" == typeof this._content ? JH.Text : Array.isArray(this._content) ? this._content : this._content.type; + } }, { key: "to", get: function() { + return this.from + this.length; + } }, { key: "bottom", get: function() { + return this.top + this.height; + } }, { key: "widget", get: function() { + return this._content instanceof YH ? this._content.widget : null; + } }, { key: "widgetLineBreaks", get: function() { + return "number" == typeof this._content ? this._content : 0; + } }, { key: "join", value: function(t10) { + var n10 = (Array.isArray(this._content) ? this._content : [this]).concat(Array.isArray(t10._content) ? t10._content : [t10]); + return new e20(this.from, this.length + t10.length, this.top, this.height + t10.height, n10); + } }]), e20; + }(); + var XU = function(e20) { + return e20[e20.ByPos = 0] = "ByPos", e20[e20.ByHeight = 1] = "ByHeight", e20[e20.ByPosNoHeight = 2] = "ByPosNoHeight", e20; + }(XU || (XU = {})); + var ZU = 1e-3; + var eJ = function() { + function e20(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2; + No(this, e20), this.length = t10, this.height = n10, this.flags = r10; + } + return Do(e20, [{ key: "outdated", get: function() { + return (2 & this.flags) > 0; + }, set: function(e21) { + this.flags = (e21 ? 2 : 0) | -3 & this.flags; + } }, { key: "setHeight", value: function(e21, t10) { + this.height != t10 && (Math.abs(this.height - t10) > ZU && (e21.heightChanged = true), this.height = t10); + } }, { key: "replace", value: function(t10, n10, r10) { + return e20.of(r10); + } }, { key: "decomposeLeft", value: function(e21, t10) { + t10.push(this); + } }, { key: "decomposeRight", value: function(e21, t10) { + t10.push(this); + } }, { key: "applyChanges", value: function(e21, t10, n10, r10) { + for (var o10 = this, i10 = n10.doc, a10 = r10.length - 1; a10 >= 0; a10--) { + var s10 = r10[a10], c10 = s10.fromA, l10 = s10.toA, u10 = s10.fromB, f10 = s10.toB, d10 = o10.lineAt(c10, XU.ByPosNoHeight, n10.setDoc(t10), 0, 0), h10 = d10.to >= l10 ? d10 : o10.lineAt(l10, XU.ByPosNoHeight, n10, 0, 0); + for (f10 += h10.to - l10, l10 = h10.to; a10 > 0 && d10.from <= r10[a10 - 1].toA; ) + c10 = r10[a10 - 1].fromA, u10 = r10[a10 - 1].fromB, a10--, c10 < d10.from && (d10 = o10.lineAt(c10, XU.ByPosNoHeight, n10, 0, 0)); + u10 += d10.from - c10, c10 = d10.from; + var v10 = aJ.build(n10.setDoc(i10), e21, u10, f10); + o10 = o10.replace(c10, l10, v10); + } + return o10.updateHeight(n10, 0); + } }], [{ key: "empty", value: function() { + return new nJ(0, 0); + } }, { key: "of", value: function(t10) { + if (1 == t10.length) + return t10[0]; + for (var n10 = 0, r10 = t10.length, o10 = 0, i10 = 0; ; ) + if (n10 == r10) + if (o10 > 2 * i10) { + var a10 = t10[n10 - 1]; + a10.break ? t10.splice(--n10, 1, a10.left, null, a10.right) : t10.splice(--n10, 1, a10.left, a10.right), r10 += 1 + a10.break, o10 -= a10.size; + } else { + if (!(i10 > 2 * o10)) + break; + var s10 = t10[r10]; + s10.break ? t10.splice(r10, 1, s10.left, null, s10.right) : t10.splice(r10, 1, s10.left, s10.right), r10 += 2 + s10.break, i10 -= s10.size; + } + else if (o10 < i10) { + var c10 = t10[n10++]; + c10 && (o10 += c10.size); + } else { + var l10 = t10[--r10]; + l10 && (i10 += l10.size); + } + var u10 = 0; + return null == t10[n10 - 1] ? (u10 = 1, n10--) : null == t10[n10] && (u10 = 1, r10++), new oJ(e20.of(t10.slice(0, n10)), u10, e20.of(t10.slice(r10))); + } }]), e20; + }(); + eJ.prototype.size = 1; + var tJ = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10, [e21, n10])).deco = r10, o10; + } + return Ao(t10, eJ), Do(t10, [{ key: "blockAt", value: function(e21, t11, n10, r10) { + return new YU(r10, this.length, n10, this.height, this.deco || 0); + } }, { key: "lineAt", value: function(e21, t11, n10, r10, o10) { + return this.blockAt(0, n10, r10, o10); + } }, { key: "forEachLine", value: function(e21, t11, n10, r10, o10, i10) { + e21 <= o10 + this.length && t11 >= o10 && i10(this.blockAt(0, n10, r10, o10)); + } }, { key: "updateHeight", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = arguments.length > 3 ? arguments[3] : void 0; + return n10 && n10.from <= t11 && n10.more && this.setHeight(e21, n10.heights[n10.index++]), this.outdated = false, this; + } }, { key: "toString", value: function() { + return "block(".concat(this.length, ")"); + } }]), t10; + }(); + var nJ = function(e20) { + function t10(e21, n10) { + var r10; + return No(this, t10), (r10 = _o(this, t10, [e21, n10, null])).collapsed = 0, r10.widgetHeight = 0, r10.breaks = 0, r10; + } + return Ao(t10, tJ), Do(t10, [{ key: "blockAt", value: function(e21, t11, n10, r10) { + return new YU(r10, this.length, n10, this.height, this.breaks); + } }, { key: "replace", value: function(e21, n10, r10) { + var o10 = r10[0]; + return 1 == r10.length && (o10 instanceof t10 || o10 instanceof rJ && 4 & o10.flags) && Math.abs(this.length - o10.length) < 10 ? (o10 instanceof rJ ? o10 = new t10(o10.length, this.height) : o10.height = this.height, this.outdated || (o10.outdated = false), o10) : eJ.of(r10); + } }, { key: "updateHeight", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r10 = arguments.length > 3 ? arguments[3] : void 0; + return r10 && r10.from <= t11 && r10.more ? this.setHeight(e21, r10.heights[r10.index++]) : (n10 || this.outdated) && this.setHeight(e21, Math.max(this.widgetHeight, e21.heightForLine(this.length - this.collapsed)) + this.breaks * e21.lineHeight), this.outdated = false, this; + } }, { key: "toString", value: function() { + return "line(".concat(this.length).concat(this.collapsed ? -this.collapsed : "").concat(this.widgetHeight ? ":" + this.widgetHeight : "", ")"); + } }]), t10; + }(); + var rJ = function(e20) { + function t10(e21) { + return No(this, t10), _o(this, t10, [e21, 0]); + } + return Ao(t10, eJ), Do(t10, [{ key: "heightMetrics", value: function(e21, t11) { + var n10, r10 = e21.doc.lineAt(t11).number, o10 = e21.doc.lineAt(t11 + this.length).number, i10 = o10 - r10 + 1, a10 = 0; + if (e21.lineWrapping) { + var s10 = Math.min(this.height, e21.lineHeight * i10); + n10 = s10 / i10, this.length > i10 + 1 && (a10 = (this.height - s10) / (this.length - i10 - 1)); + } else + n10 = this.height / i10; + return { firstLine: r10, lastLine: o10, perLine: n10, perChar: a10 }; + } }, { key: "blockAt", value: function(e21, t11, n10, r10) { + var o10 = this.heightMetrics(t11, r10), i10 = o10.firstLine, a10 = o10.lastLine, s10 = o10.perLine, c10 = o10.perChar; + if (t11.lineWrapping) { + var l10 = r10 + Math.round(Math.max(0, Math.min(1, (e21 - n10) / this.height)) * this.length), u10 = t11.doc.lineAt(l10), f10 = s10 + u10.length * c10, d10 = Math.max(n10, e21 - f10 / 2); + return new YU(u10.from, u10.length, d10, f10, 0); + } + var h10 = Math.max(0, Math.min(a10 - i10, Math.floor((e21 - n10) / s10))), v10 = t11.doc.line(i10 + h10), p10 = v10.from, m10 = v10.length; + return new YU(p10, m10, n10 + s10 * h10, s10, 0); + } }, { key: "lineAt", value: function(e21, t11, n10, r10, o10) { + if (t11 == XU.ByHeight) + return this.blockAt(e21, n10, r10, o10); + if (t11 == XU.ByPosNoHeight) { + var i10 = n10.doc.lineAt(e21), a10 = i10.from, s10 = i10.to; + return new YU(a10, s10 - a10, 0, 0, 0); + } + var c10 = this.heightMetrics(n10, o10), l10 = c10.firstLine, u10 = c10.perLine, f10 = c10.perChar, d10 = n10.doc.lineAt(e21), h10 = u10 + d10.length * f10, v10 = d10.number - l10, p10 = r10 + u10 * v10 + f10 * (d10.from - o10 - v10); + return new YU(d10.from, d10.length, Math.max(r10, Math.min(p10, r10 + this.height - h10)), h10, 0); + } }, { key: "forEachLine", value: function(e21, t11, n10, r10, o10, i10) { + e21 = Math.max(e21, o10), t11 = Math.min(t11, o10 + this.length); + for (var a10 = this.heightMetrics(n10, o10), s10 = a10.firstLine, c10 = a10.perLine, l10 = a10.perChar, u10 = e21, f10 = r10; u10 <= t11; ) { + var d10 = n10.doc.lineAt(u10); + if (u10 == e21) { + var h10 = d10.number - s10; + f10 += c10 * h10 + l10 * (e21 - o10 - h10); + } + var v10 = c10 + l10 * d10.length; + i10(new YU(d10.from, d10.length, f10, v10, 0)), f10 += v10, u10 = d10.to + 1; + } + } }, { key: "replace", value: function(e21, n10, r10) { + var o10 = this.length - n10; + if (o10 > 0) { + var i10 = r10[r10.length - 1]; + i10 instanceof t10 ? r10[r10.length - 1] = new t10(i10.length + o10) : r10.push(null, new t10(o10 - 1)); + } + if (e21 > 0) { + var a10 = r10[0]; + a10 instanceof t10 ? r10[0] = new t10(e21 + a10.length) : r10.unshift(new t10(e21 - 1), null); + } + return eJ.of(r10); + } }, { key: "decomposeLeft", value: function(e21, n10) { + n10.push(new t10(e21 - 1), null); + } }, { key: "decomposeRight", value: function(e21, n10) { + n10.push(null, new t10(this.length - e21 - 1)); + } }, { key: "updateHeight", value: function(e21) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], o10 = arguments.length > 3 ? arguments[3] : void 0, i10 = n10 + this.length; + if (o10 && o10.from <= n10 + this.length && o10.more) { + var a10 = [], s10 = Math.max(n10, o10.from), c10 = -1; + for (o10.from > n10 && a10.push(new t10(o10.from - n10 - 1).updateHeight(e21, n10)); s10 <= i10 && o10.more; ) { + var l10 = e21.doc.lineAt(s10).length; + a10.length && a10.push(null); + var u10 = o10.heights[o10.index++]; + -1 == c10 ? c10 = u10 : Math.abs(u10 - c10) >= ZU && (c10 = -2); + var f10 = new nJ(l10, u10); + f10.outdated = false, a10.push(f10), s10 += l10 + 1; + } + s10 <= i10 && a10.push(null, new t10(i10 - s10).updateHeight(e21, s10)); + var d10 = eJ.of(a10); + return (c10 < 0 || Math.abs(d10.height - this.height) >= ZU || Math.abs(c10 - this.heightMetrics(e21, n10).perLine) >= ZU) && (e21.heightChanged = true), d10; + } + return (r10 || this.outdated) && (this.setHeight(e21, e21.heightForGap(n10, n10 + this.length)), this.outdated = false), this; + } }, { key: "toString", value: function() { + return "gap(".concat(this.length, ")"); + } }]), t10; + }(); + var oJ = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10, [e21.length + n10 + r10.length, e21.height + r10.height, n10 | (e21.outdated || r10.outdated ? 2 : 0)])).left = e21, o10.right = r10, o10.size = e21.size + r10.size, o10; + } + return Ao(t10, eJ), Do(t10, [{ key: "break", get: function() { + return 1 & this.flags; + } }, { key: "blockAt", value: function(e21, t11, n10, r10) { + var o10 = n10 + this.left.height; + return e21 < o10 ? this.left.blockAt(e21, t11, n10, r10) : this.right.blockAt(e21, t11, o10, r10 + this.left.length + this.break); + } }, { key: "lineAt", value: function(e21, t11, n10, r10, o10) { + var i10 = r10 + this.left.height, a10 = o10 + this.left.length + this.break, s10 = t11 == XU.ByHeight ? e21 < i10 : e21 < a10, c10 = s10 ? this.left.lineAt(e21, t11, n10, r10, o10) : this.right.lineAt(e21, t11, n10, i10, a10); + if (this.break || (s10 ? c10.to < a10 : c10.from > a10)) + return c10; + var l10 = t11 == XU.ByPosNoHeight ? XU.ByPosNoHeight : XU.ByPos; + return s10 ? c10.join(this.right.lineAt(a10, l10, n10, i10, a10)) : this.left.lineAt(a10, l10, n10, r10, o10).join(c10); + } }, { key: "forEachLine", value: function(e21, t11, n10, r10, o10, i10) { + var a10 = r10 + this.left.height, s10 = o10 + this.left.length + this.break; + if (this.break) + e21 < s10 && this.left.forEachLine(e21, t11, n10, r10, o10, i10), t11 >= s10 && this.right.forEachLine(e21, t11, n10, a10, s10, i10); + else { + var c10 = this.lineAt(s10, XU.ByPos, n10, r10, o10); + e21 < c10.from && this.left.forEachLine(e21, c10.from - 1, n10, r10, o10, i10), c10.to >= e21 && c10.from <= t11 && i10(c10), t11 > c10.to && this.right.forEachLine(c10.to + 1, t11, n10, a10, s10, i10); + } + } }, { key: "replace", value: function(e21, t11, n10) { + var r10 = this.left.length + this.break; + if (t11 < r10) + return this.balanced(this.left.replace(e21, t11, n10), this.right); + if (e21 > this.left.length) + return this.balanced(this.left, this.right.replace(e21 - r10, t11 - r10, n10)); + var o10 = []; + e21 > 0 && this.decomposeLeft(e21, o10); + var i10, a10 = o10.length, s10 = bo(n10); + try { + for (s10.s(); !(i10 = s10.n()).done; ) { + var c10 = i10.value; + o10.push(c10); + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + if (e21 > 0 && iJ(o10, a10 - 1), t11 < this.length) { + var l10 = o10.length; + this.decomposeRight(t11, o10), iJ(o10, l10); + } + return eJ.of(o10); + } }, { key: "decomposeLeft", value: function(e21, t11) { + var n10 = this.left.length; + if (e21 <= n10) + return this.left.decomposeLeft(e21, t11); + t11.push(this.left), this.break && e21 >= ++n10 && t11.push(null), e21 > n10 && this.right.decomposeLeft(e21 - n10, t11); + } }, { key: "decomposeRight", value: function(e21, t11) { + var n10 = this.left.length, r10 = n10 + this.break; + if (e21 >= r10) + return this.right.decomposeRight(e21 - r10, t11); + e21 < n10 && this.left.decomposeRight(e21, t11), this.break && e21 < r10 && t11.push(null), t11.push(this.right); + } }, { key: "balanced", value: function(e21, t11) { + return e21.size > 2 * t11.size || t11.size > 2 * e21.size ? eJ.of(this.break ? [e21, null, t11] : [e21, t11]) : (this.left = e21, this.right = t11, this.height = e21.height + t11.height, this.outdated = e21.outdated || t11.outdated, this.size = e21.size + t11.size, this.length = e21.length + this.break + t11.length, this); + } }, { key: "updateHeight", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r10 = arguments.length > 3 ? arguments[3] : void 0, o10 = this.left, i10 = this.right, a10 = t11 + o10.length + this.break, s10 = null; + return r10 && r10.from <= t11 + o10.length && r10.more ? s10 = o10 = o10.updateHeight(e21, t11, n10, r10) : o10.updateHeight(e21, t11, n10), r10 && r10.from <= a10 + i10.length && r10.more ? s10 = i10 = i10.updateHeight(e21, a10, n10, r10) : i10.updateHeight(e21, a10, n10), s10 ? this.balanced(o10, i10) : (this.height = this.left.height + this.right.height, this.outdated = false, this); + } }, { key: "toString", value: function() { + return this.left + (this.break ? " " : "-") + this.right; + } }]), t10; + }(); + function iJ(e20, t10) { + var n10, r10; + null == e20[t10] && (n10 = e20[t10 - 1]) instanceof rJ && (r10 = e20[t10 + 1]) instanceof rJ && e20.splice(t10 - 1, 3, new rJ(n10.length + 1 + r10.length)); + } + var aJ = function() { + function e20(t10, n10) { + No(this, e20), this.pos = t10, this.oracle = n10, this.nodes = [], this.lineStart = -1, this.lineEnd = -1, this.covering = null, this.writtenTo = t10; + } + return Do(e20, [{ key: "isCovered", get: function() { + return this.covering && this.nodes[this.nodes.length - 1] == this.covering; + } }, { key: "span", value: function(e21, t10) { + if (this.lineStart > -1) { + var n10 = Math.min(t10, this.lineEnd), r10 = this.nodes[this.nodes.length - 1]; + r10 instanceof nJ ? r10.length += n10 - this.pos : (n10 > this.pos || !this.isCovered) && this.nodes.push(new nJ(n10 - this.pos, -1)), this.writtenTo = n10, t10 > n10 && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1); + } + this.pos = t10; + } }, { key: "point", value: function(e21, t10, n10) { + if (e21 < t10 || n10.heightRelevant) { + var r10 = n10.widget ? n10.widget.estimatedHeight : 0, o10 = n10.widget ? n10.widget.lineBreaks : 0; + r10 < 0 && (r10 = this.oracle.lineHeight); + var i10 = t10 - e21; + n10.block ? this.addBlock(new tJ(i10, r10, n10)) : (i10 || o10 || r10 >= 5) && this.addLineDeco(r10, o10, i10); + } else + t10 > e21 && this.span(e21, t10); + this.lineEnd > -1 && this.lineEnd < this.pos && (this.lineEnd = this.oracle.doc.lineAt(this.pos).to); + } }, { key: "enterLine", value: function() { + if (!(this.lineStart > -1)) { + var e21 = this.oracle.doc.lineAt(this.pos), t10 = e21.from, n10 = e21.to; + this.lineStart = t10, this.lineEnd = n10, this.writtenTo < t10 && ((this.writtenTo < t10 - 1 || null == this.nodes[this.nodes.length - 1]) && this.nodes.push(this.blankContent(this.writtenTo, t10 - 1)), this.nodes.push(null)), this.pos > t10 && this.nodes.push(new nJ(this.pos - t10, -1)), this.writtenTo = this.pos; + } + } }, { key: "blankContent", value: function(e21, t10) { + var n10 = new rJ(t10 - e21); + return this.oracle.doc.lineAt(e21).to == t10 && (n10.flags |= 4), n10; + } }, { key: "ensureLine", value: function() { + this.enterLine(); + var e21 = this.nodes.length ? this.nodes[this.nodes.length - 1] : null; + if (e21 instanceof nJ) + return e21; + var t10 = new nJ(0, -1); + return this.nodes.push(t10), t10; + } }, { key: "addBlock", value: function(e21) { + this.enterLine(); + var t10 = e21.deco; + t10 && t10.startSide > 0 && !this.isCovered && this.ensureLine(), this.nodes.push(e21), this.writtenTo = this.pos = this.pos + e21.length, t10 && t10.endSide > 0 && (this.covering = e21); + } }, { key: "addLineDeco", value: function(e21, t10, n10) { + var r10 = this.ensureLine(); + r10.length += n10, r10.collapsed += n10, r10.widgetHeight = Math.max(r10.widgetHeight, e21), r10.breaks += t10, this.writtenTo = this.pos = this.pos + n10; + } }, { key: "finish", value: function(e21) { + var t10 = 0 == this.nodes.length ? null : this.nodes[this.nodes.length - 1]; + !(this.lineStart > -1) || t10 instanceof nJ || this.isCovered ? (this.writtenTo < this.pos || null == t10) && this.nodes.push(this.blankContent(this.writtenTo, this.pos)) : this.nodes.push(new nJ(0, -1)); + var n10, r10 = e21, o10 = bo(this.nodes); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value; + i10 instanceof nJ && i10.updateHeight(this.oracle, r10), r10 += i10 ? i10.length : 1; + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return this.nodes; + } }], [{ key: "build", value: function(t10, n10, r10, o10) { + var i10 = new e20(r10, t10); + return xV.spans(n10, r10, o10, i10, 0), i10.finish(r10); + } }]), e20; + }(); + var sJ = function() { + function e20() { + No(this, e20), this.changes = []; + } + return Do(e20, [{ key: "compareRange", value: function() { + } }, { key: "comparePoint", value: function(e21, t10, n10, r10) { + (e21 < t10 || n10 && n10.heightRelevant || r10 && r10.heightRelevant) && ZH(e21, t10, this.changes, 5); + } }]), e20; + }(); + function cJ(e20, t10) { + for (var n10 = e20.getBoundingClientRect(), r10 = e20.ownerDocument, o10 = r10.defaultView || window, i10 = Math.max(0, n10.left), a10 = Math.min(o10.innerWidth, n10.right), s10 = Math.max(0, n10.top), c10 = Math.min(o10.innerHeight, n10.bottom), l10 = e20.parentNode; l10 && l10 != r10.body; ) + if (1 == l10.nodeType) { + var u10 = l10, f10 = window.getComputedStyle(u10); + if ((u10.scrollHeight > u10.clientHeight || u10.scrollWidth > u10.clientWidth) && "visible" != f10.overflow) { + var d10 = u10.getBoundingClientRect(); + i10 = Math.max(i10, d10.left), a10 = Math.min(a10, d10.right), s10 = Math.max(s10, d10.top), c10 = l10 == e20.parentNode ? d10.bottom : Math.min(c10, d10.bottom); + } + l10 = "absolute" == f10.position || "fixed" == f10.position ? u10.offsetParent : u10.parentNode; + } else { + if (11 != l10.nodeType) + break; + l10 = l10.host; + } + return { left: i10 - n10.left, right: Math.max(i10, a10) - n10.left, top: s10 - (n10.top + t10), bottom: Math.max(s10, c10) - (n10.top + t10) }; + } + function lJ(e20, t10) { + var n10 = e20.getBoundingClientRect(); + return { left: 0, right: n10.right - n10.left, top: t10, bottom: n10.bottom - (n10.top + t10) }; + } + var uJ = function() { + function e20(t10, n10, r10) { + No(this, e20), this.from = t10, this.to = n10, this.size = r10; + } + return Do(e20, [{ key: "draw", value: function(e21, t10) { + return KH.replace({ widget: new fJ(this.size * (t10 ? e21.scaleY : e21.scaleX), t10) }).range(this.from, this.to); + } }], [{ key: "same", value: function(e21, t10) { + if (e21.length != t10.length) + return false; + for (var n10 = 0; n10 < e21.length; n10++) { + var r10 = e21[n10], o10 = t10[n10]; + if (r10.from != o10.from || r10.to != o10.to || r10.size != o10.size) + return false; + } + return true; + } }]), e20; + }(); + var fJ = function(e20) { + function t10(e21, n10) { + var r10; + return No(this, t10), (r10 = _o(this, t10)).size = e21, r10.vertical = n10, r10; + } + return Ao(t10, UH), Do(t10, [{ key: "eq", value: function(e21) { + return e21.size == this.size && e21.vertical == this.vertical; + } }, { key: "toDOM", value: function() { + var e21 = document.createElement("div"); + return this.vertical ? e21.style.height = this.size + "px" : (e21.style.width = this.size + "px", e21.style.height = "2px", e21.style.display = "inline-block"), e21; + } }, { key: "estimatedHeight", get: function() { + return this.vertical ? this.size : -1; + } }]), t10; + }(); + var dJ = function() { + function e20(t10) { + var n10 = this; + No(this, e20), this.state = t10, this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }, this.inView = true, this.paddingTop = 0, this.paddingBottom = 0, this.contentDOMWidth = 0, this.contentDOMHeight = 0, this.editorHeight = 0, this.editorWidth = 0, this.scrollTop = 0, this.scrolledToBottom = true, this.scaleX = 1, this.scaleY = 1, this.scrollAnchorPos = 0, this.scrollAnchorHeight = -1, this.scaler = gJ, this.scrollTarget = null, this.printing = false, this.mustMeasureContent = true, this.defaultTextDirection = rW.LTR, this.visibleRanges = [], this.mustEnforceCursorAssoc = false; + var r10 = t10.facet(WW).some(function(e21) { + return "function" != typeof e21 && "cm-lineWrapping" == e21.class; + }); + this.heightOracle = new GU(r10), this.stateDeco = t10.facet(UW).filter(function(e21) { + return "function" != typeof e21; + }), this.heightMap = eJ.empty().applyChanges(this.stateDeco, UL.empty, this.heightOracle.setDoc(t10.doc), [new eU(0, 0, 0, t10.doc.length)]), this.viewport = this.getViewport(0, null), this.updateViewportLines(), this.updateForViewport(), this.lineGaps = this.ensureLineGaps([]), this.lineGapDeco = KH.set(this.lineGaps.map(function(e21) { + return e21.draw(n10, false); + })), this.computeVisibleRanges(); + } + return Do(e20, [{ key: "updateForViewport", value: function() { + for (var e21 = this, t10 = [this.viewport], n10 = this.state.selection.main, r10 = function() { + var r11 = o10 ? n10.head : n10.anchor; + if (!t10.some(function(e23) { + var t11 = e23.from, n11 = e23.to; + return r11 >= t11 && r11 <= n11; + })) { + var i10 = e21.lineBlockAt(r11), a10 = i10.from, s10 = i10.to; + t10.push(new hJ(a10, s10)); + } + }, o10 = 0; o10 <= 1; o10++) + r10(); + this.viewports = t10.sort(function(e23, t11) { + return e23.from - t11.from; + }), this.scaler = this.heightMap.height <= 7e6 ? gJ : new yJ(this.heightOracle, this.heightMap, this.viewports); + } }, { key: "updateViewportLines", value: function() { + var e21 = this; + this.viewportLines = [], this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, function(t10) { + e21.viewportLines.push(1 == e21.scaler.scale ? t10 : bJ(t10, e21.scaler)); + }); + } }, { key: "update", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; + this.state = e21.state; + var n10 = this.stateDeco; + this.stateDeco = this.state.facet(UW).filter(function(e23) { + return "function" != typeof e23; + }); + var r10, o10, i10, a10, s10 = e21.changedRanges, c10 = eU.extendWithRanges(s10, (r10 = n10, o10 = this.stateDeco, i10 = e21 ? e21.changes : yF.empty(this.state.doc.length), a10 = new sJ(), xV.compare(r10, o10, i10, a10, 0), a10.changes)), l10 = this.heightMap.height, u10 = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop); + this.heightMap = this.heightMap.applyChanges(this.stateDeco, e21.startState.doc, this.heightOracle.setDoc(this.state.doc), c10), this.heightMap.height != l10 && (e21.flags |= 2), u10 ? (this.scrollAnchorPos = e21.changes.mapPos(u10.from, -1), this.scrollAnchorHeight = u10.top) : (this.scrollAnchorPos = -1, this.scrollAnchorHeight = this.heightMap.height); + var f10 = c10.length ? this.mapViewport(this.viewport, e21.changes) : this.viewport; + (t10 && (t10.range.head < f10.from || t10.range.head > f10.to) || !this.viewportIsAppropriate(f10)) && (f10 = this.getViewport(0, t10)); + var d10 = !e21.changes.empty || 2 & e21.flags || f10.from != this.viewport.from || f10.to != this.viewport.to; + this.viewport = f10, this.updateForViewport(), d10 && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) && this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, e21.changes))), e21.flags |= this.computeVisibleRanges(), t10 && (this.scrollTarget = t10), !this.mustEnforceCursorAssoc && e21.selectionSet && e21.view.lineWrapping && e21.state.selection.main.empty && e21.state.selection.main.assoc && !e21.state.facet(NW) && (this.mustEnforceCursorAssoc = true); + } }, { key: "measure", value: function(e21) { + var t10 = e21.contentDOM, n10 = window.getComputedStyle(t10), r10 = this.heightOracle, o10 = n10.whiteSpace; + this.defaultTextDirection = "rtl" == n10.direction ? rW.RTL : rW.LTR; + var i10 = this.heightOracle.mustRefreshForWrapping(o10), a10 = t10.getBoundingClientRect(), s10 = i10 || this.mustMeasureContent || this.contentDOMHeight != a10.height; + this.contentDOMHeight = a10.height, this.mustMeasureContent = false; + var c10 = 0, l10 = 0; + if (a10.width && a10.height) { + var u10 = oH(t10, a10), f10 = u10.scaleX, d10 = u10.scaleY; + this.scaleX == f10 && this.scaleY == d10 || (this.scaleX = f10, this.scaleY = d10, c10 |= 8, i10 = s10 = true); + } + var h10 = (parseInt(n10.paddingTop) || 0) * this.scaleY, v10 = (parseInt(n10.paddingBottom) || 0) * this.scaleY; + this.paddingTop == h10 && this.paddingBottom == v10 || (this.paddingTop = h10, this.paddingBottom = v10, c10 |= 10), this.editorWidth != e21.scrollDOM.clientWidth && (r10.lineWrapping && (s10 = true), this.editorWidth = e21.scrollDOM.clientWidth, c10 |= 8); + var p10 = e21.scrollDOM.scrollTop * this.scaleY; + this.scrollTop != p10 && (this.scrollAnchorHeight = -1, this.scrollTop = p10), this.scrolledToBottom = dH(e21.scrollDOM); + var m10 = (this.printing ? lJ : cJ)(t10, this.paddingTop), g10 = m10.top - this.pixelViewport.top, y10 = m10.bottom - this.pixelViewport.bottom; + this.pixelViewport = m10; + var b10 = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left; + if (b10 != this.inView && (this.inView = b10, b10 && (s10 = true)), !this.inView && !this.scrollTarget) + return 0; + var k10 = a10.width; + if (this.contentDOMWidth == k10 && this.editorHeight == e21.scrollDOM.clientHeight || (this.contentDOMWidth = a10.width, this.editorHeight = e21.scrollDOM.clientHeight, c10 |= 8), s10) { + var w10 = e21.docView.measureVisibleLineHeights(this.viewport); + if (r10.mustRefreshForHeights(w10) && (i10 = true), i10 || r10.lineWrapping && Math.abs(k10 - this.contentDOMWidth) > r10.charWidth) { + var x10 = e21.docView.measureTextSize(), j10 = x10.lineHeight, S10 = x10.charWidth, C10 = x10.textHeight; + (i10 = j10 > 0 && r10.refresh(o10, j10, S10, C10, k10 / S10, w10)) && (e21.docView.minWidth = 0, c10 |= 8); + } + g10 > 0 && y10 > 0 ? l10 = Math.max(g10, y10) : g10 < 0 && y10 < 0 && (l10 = Math.min(g10, y10)), r10.heightChanged = false; + var $10, _10 = bo(this.viewports); + try { + for (_10.s(); !($10 = _10.n()).done; ) { + var O10 = $10.value, M10 = O10.from == this.viewport.from ? w10 : e21.docView.measureVisibleLineHeights(O10); + this.heightMap = (i10 ? eJ.empty().applyChanges(this.stateDeco, UL.empty, this.heightOracle, [new eU(0, 0, 0, e21.state.doc.length)]) : this.heightMap).updateHeight(r10, 0, i10, new QU(O10.from, M10)); + } + } catch (e23) { + _10.e(e23); + } finally { + _10.f(); + } + r10.heightChanged && (c10 |= 2); + } + var E10 = !this.viewportIsAppropriate(this.viewport, l10) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to); + return E10 && (this.viewport = this.getViewport(l10, this.scrollTarget)), this.updateForViewport(), (2 & c10 || E10) && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) && this.updateLineGaps(this.ensureLineGaps(i10 ? [] : this.lineGaps, e21)), c10 |= this.computeVisibleRanges(), this.mustEnforceCursorAssoc && (this.mustEnforceCursorAssoc = false, e21.docView.enforceCursorAssoc()), c10; + } }, { key: "visibleTop", get: function() { + return this.scaler.fromDOM(this.pixelViewport.top); + } }, { key: "visibleBottom", get: function() { + return this.scaler.fromDOM(this.pixelViewport.bottom); + } }, { key: "getViewport", value: function(e21, t10) { + var n10 = 0.5 - Math.max(-0.5, Math.min(0.5, e21 / 1e3 / 2)), r10 = this.heightMap, o10 = this.heightOracle, i10 = this.visibleTop, a10 = this.visibleBottom, s10 = new hJ(r10.lineAt(i10 - 1e3 * n10, XU.ByHeight, o10, 0, 0).from, r10.lineAt(a10 + 1e3 * (1 - n10), XU.ByHeight, o10, 0, 0).to); + if (t10) { + var c10 = t10.range.head; + if (c10 < s10.from || c10 > s10.to) { + var l10, u10 = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top), f10 = r10.lineAt(c10, XU.ByPos, o10, 0, 0); + l10 = "center" == t10.y ? (f10.top + f10.bottom) / 2 - u10 / 2 : "start" == t10.y || "nearest" == t10.y && c10 < s10.from ? f10.top : f10.bottom - u10, s10 = new hJ(r10.lineAt(l10 - 500, XU.ByHeight, o10, 0, 0).from, r10.lineAt(l10 + u10 + 500, XU.ByHeight, o10, 0, 0).to); + } + } + return s10; + } }, { key: "mapViewport", value: function(e21, t10) { + var n10 = t10.mapPos(e21.from, -1), r10 = t10.mapPos(e21.to, 1); + return new hJ(this.heightMap.lineAt(n10, XU.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(r10, XU.ByPos, this.heightOracle, 0, 0).to); + } }, { key: "viewportIsAppropriate", value: function(e21) { + var t10 = e21.from, n10 = e21.to, r10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + if (!this.inView) + return true; + var o10 = this.heightMap.lineAt(t10, XU.ByPos, this.heightOracle, 0, 0).top, i10 = this.heightMap.lineAt(n10, XU.ByPos, this.heightOracle, 0, 0).bottom, a10 = this.visibleTop, s10 = this.visibleBottom; + return (0 == t10 || o10 <= a10 - Math.max(10, Math.min(-r10, 250))) && (n10 == this.state.doc.length || i10 >= s10 + Math.max(10, Math.min(r10, 250))) && o10 > a10 - 2e3 && i10 < s10 + 2e3; + } }, { key: "mapLineGaps", value: function(e21, t10) { + if (!e21.length || t10.empty) + return e21; + var n10, r10 = [], o10 = bo(e21); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value; + t10.touchesRange(i10.from, i10.to) || r10.push(new uJ(t10.mapPos(i10.from), t10.mapPos(i10.to), i10.size)); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return r10; + } }, { key: "ensureLineGaps", value: function(e21, t10) { + var n10 = this, r10 = this.heightOracle.lineWrapping, o10 = r10 ? 1e4 : 2e3, i10 = o10 >> 1, a10 = o10 << 1; + if (this.defaultTextDirection != rW.LTR && !r10) + return []; + var s10, c10 = [], l10 = function o11(a11, s11, l11, u11) { + if (!(s11 - a11 < i10)) { + var f11 = n10.state.selection.main, d11 = [f11.from]; + f11.empty || d11.push(f11.to); + for (var h11 = 0, v11 = d11; h11 < v11.length; h11++) { + var p11 = v11[h11]; + if (p11 > a11 && p11 < s11) + return o11(a11, p11 - 10, l11, u11), void o11(p11 + 10, s11, l11, u11); + } + var m11 = function(e23, t11) { + var n11, r11 = bo(e23); + try { + for (r11.s(); !(n11 = r11.n()).done; ) { + var o12 = n11.value; + if (t11(o12)) + return o12; + } + } catch (e24) { + r11.e(e24); + } finally { + r11.f(); + } + return; + }(e21, function(e23) { + return e23.from >= l11.from && e23.to <= l11.to && Math.abs(e23.from - a11) < i10 && Math.abs(e23.to - s11) < i10 && !d11.some(function(t11) { + return e23.from < t11 && e23.to > t11; + }); + }); + if (!m11) { + if (s11 < l11.to && t10 && r10 && t10.visibleRanges.some(function(e23) { + return e23.from <= s11 && e23.to >= s11; + })) { + var g11 = t10.moveToLineBoundary($F.cursor(s11), false, true).head; + g11 > a11 && (s11 = g11); + } + m11 = new uJ(a11, s11, n10.gapSize(l11, a11, s11, u11)); + } + c10.push(m11); + } + }, u10 = bo(this.viewportLines); + try { + for (u10.s(); !(s10 = u10.n()).done; ) { + var f10 = s10.value; + if (!(f10.length < a10)) { + var d10 = vJ(f10.from, f10.to, this.stateDeco); + if (!(d10.total < a10)) { + var h10 = this.scrollTarget ? this.scrollTarget.range.head : null, v10 = void 0, p10 = void 0; + if (r10) { + var m10 = o10 / this.heightOracle.lineLength * this.heightOracle.lineHeight, g10 = void 0, y10 = void 0; + if (null != h10) { + var b10 = mJ(d10, h10), k10 = ((this.visibleBottom - this.visibleTop) / 2 + m10) / f10.height; + g10 = b10 - k10, y10 = b10 + k10; + } else + g10 = (this.visibleTop - f10.top - m10) / f10.height, y10 = (this.visibleBottom - f10.top + m10) / f10.height; + v10 = pJ(d10, g10), p10 = pJ(d10, y10); + } else { + var w10 = d10.total * this.heightOracle.charWidth, x10 = o10 * this.heightOracle.charWidth, j10 = void 0, S10 = void 0; + if (null != h10) { + var C10 = mJ(d10, h10), $10 = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + x10) / w10; + j10 = C10 - $10, S10 = C10 + $10; + } else + j10 = (this.pixelViewport.left - x10) / w10, S10 = (this.pixelViewport.right + x10) / w10; + v10 = pJ(d10, j10), p10 = pJ(d10, S10); + } + v10 > f10.from && l10(f10.from, v10, f10, d10), p10 < f10.to && l10(p10, f10.to, f10, d10); + } + } + } + } catch (e23) { + u10.e(e23); + } finally { + u10.f(); + } + return c10; + } }, { key: "gapSize", value: function(e21, t10, n10, r10) { + var o10 = mJ(r10, n10) - mJ(r10, t10); + return this.heightOracle.lineWrapping ? e21.height * o10 : r10.total * this.heightOracle.charWidth * o10; + } }, { key: "updateLineGaps", value: function(e21) { + var t10 = this; + uJ.same(e21, this.lineGaps) || (this.lineGaps = e21, this.lineGapDeco = KH.set(e21.map(function(e23) { + return e23.draw(t10, t10.heightOracle.lineWrapping); + }))); + } }, { key: "computeVisibleRanges", value: function() { + var e21 = this.stateDeco; + this.lineGaps.length && (e21 = e21.concat(this.lineGapDeco)); + var t10 = []; + xV.spans(e21, this.viewport.from, this.viewport.to, { span: function(e23, n11) { + t10.push({ from: e23, to: n11 }); + }, point: function() { + } }, 20); + var n10 = t10.length != this.visibleRanges.length || this.visibleRanges.some(function(e23, n11) { + return e23.from != t10[n11].from || e23.to != t10[n11].to; + }); + return this.visibleRanges = t10, n10 ? 4 : 0; + } }, { key: "lineBlockAt", value: function(e21) { + return e21 >= this.viewport.from && e21 <= this.viewport.to && this.viewportLines.find(function(t10) { + return t10.from <= e21 && t10.to >= e21; + }) || bJ(this.heightMap.lineAt(e21, XU.ByPos, this.heightOracle, 0, 0), this.scaler); + } }, { key: "lineBlockAtHeight", value: function(e21) { + return bJ(this.heightMap.lineAt(this.scaler.fromDOM(e21), XU.ByHeight, this.heightOracle, 0, 0), this.scaler); + } }, { key: "scrollAnchorAt", value: function(e21) { + var t10 = this.lineBlockAtHeight(e21 + 8); + return t10.from >= this.viewport.from || this.viewportLines[0].top - e21 > 200 ? t10 : this.viewportLines[0]; + } }, { key: "elementAtHeight", value: function(e21) { + return bJ(this.heightMap.blockAt(this.scaler.fromDOM(e21), this.heightOracle, 0, 0), this.scaler); + } }, { key: "docHeight", get: function() { + return this.scaler.toDOM(this.heightMap.height); + } }, { key: "contentHeight", get: function() { + return this.docHeight + this.paddingTop + this.paddingBottom; + } }]), e20; + }(); + var hJ = Do(function e4(t10, n10) { + No(this, e4), this.from = t10, this.to = n10; + }); + function vJ(e20, t10, n10) { + var r10 = [], o10 = e20, i10 = 0; + return xV.spans(n10, e20, t10, { span: function() { + }, point: function(e21, t11) { + e21 > o10 && (r10.push({ from: o10, to: e21 }), i10 += e21 - o10), o10 = t11; + } }, 20), o10 < t10 && (r10.push({ from: o10, to: t10 }), i10 += t10 - o10), { total: i10, ranges: r10 }; + } + function pJ(e20, t10) { + var n10 = e20.total, r10 = e20.ranges; + if (t10 <= 0) + return r10[0].from; + if (t10 >= 1) + return r10[r10.length - 1].to; + for (var o10 = Math.floor(n10 * t10), i10 = 0; ; i10++) { + var a10 = r10[i10], s10 = a10.from, c10 = a10.to - s10; + if (o10 <= c10) + return s10 + o10; + o10 -= c10; + } + } + function mJ(e20, t10) { + var n10, r10 = 0, o10 = bo(e20.ranges); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value, a10 = i10.from, s10 = i10.to; + if (t10 <= s10) { + r10 += t10 - a10; + break; + } + r10 += s10 - a10; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return r10 / e20.total; + } + var gJ = { toDOM: function(e20) { + return e20; + }, fromDOM: function(e20) { + return e20; + }, scale: 1 }; + var yJ = function() { + function e20(t10, n10, r10) { + No(this, e20); + var o10 = 0, i10 = 0, a10 = 0; + this.viewports = r10.map(function(e21) { + var r11 = e21.from, i11 = e21.to, a11 = n10.lineAt(r11, XU.ByPos, t10, 0, 0).top, s11 = n10.lineAt(i11, XU.ByPos, t10, 0, 0).bottom; + return o10 += s11 - a11, { from: r11, to: i11, top: a11, bottom: s11, domTop: 0, domBottom: 0 }; + }), this.scale = (7e6 - o10) / (n10.height - o10); + var s10, c10 = bo(this.viewports); + try { + for (c10.s(); !(s10 = c10.n()).done; ) { + var l10 = s10.value; + l10.domTop = a10 + (l10.top - i10) * this.scale, a10 = l10.domBottom = l10.domTop + (l10.bottom - l10.top), i10 = l10.bottom; + } + } catch (e21) { + c10.e(e21); + } finally { + c10.f(); + } + } + return Do(e20, [{ key: "toDOM", value: function(e21) { + for (var t10 = 0, n10 = 0, r10 = 0; ; t10++) { + var o10 = t10 < this.viewports.length ? this.viewports[t10] : null; + if (!o10 || e21 < o10.top) + return r10 + (e21 - n10) * this.scale; + if (e21 <= o10.bottom) + return o10.domTop + (e21 - o10.top); + n10 = o10.bottom, r10 = o10.domBottom; + } + } }, { key: "fromDOM", value: function(e21) { + for (var t10 = 0, n10 = 0, r10 = 0; ; t10++) { + var o10 = t10 < this.viewports.length ? this.viewports[t10] : null; + if (!o10 || e21 < o10.domTop) + return n10 + (e21 - r10) / this.scale; + if (e21 <= o10.domBottom) + return o10.top + (e21 - o10.domTop); + n10 = o10.bottom, r10 = o10.domBottom; + } + } }]), e20; + }(); + function bJ(e20, t10) { + if (1 == t10.scale) + return e20; + var n10 = t10.toDOM(e20.top), r10 = t10.toDOM(e20.bottom); + return new YU(e20.from, e20.length, n10, r10 - n10, Array.isArray(e20._content) ? e20._content.map(function(e21) { + return bJ(e21, t10); + }) : e20._content); + } + var kJ = MF.define({ combine: function(e20) { + return e20.join(" "); + } }); + var wJ = MF.define({ combine: function(e20) { + return e20.indexOf(true) > -1; + } }); + var xJ = zV.newName(); + var jJ = zV.newName(); + var SJ = zV.newName(); + var CJ = { "&light": "." + jJ, "&dark": "." + SJ }; + function $J(e20, t10, n10) { + return new zV(t10, { finish: function(t11) { + return /&/.test(t11) ? t11.replace(/&\w*/, function(t12) { + if ("&" == t12) + return e20; + if (!n10 || !n10[t12]) + throw new RangeError("Unsupported selector: ".concat(t12)); + return n10[t12]; + }) : e20 + " " + t11; + } }); + } + var _J = $J("." + xJ, { "&": { position: "relative !important", boxSizing: "border-box", "&.cm-focused": { outline: "1px dotted #212121" }, display: "flex !important", flexDirection: "column" }, ".cm-scroller": { display: "flex !important", alignItems: "flex-start !important", fontFamily: "monospace", lineHeight: 1.4, height: "100%", overflowX: "auto", position: "relative", zIndex: 0 }, ".cm-content": { margin: 0, flexGrow: 2, flexShrink: 0, display: "block", whiteSpace: "pre", wordWrap: "normal", boxSizing: "border-box", minHeight: "100%", padding: "4px 0", outline: "none", "&[contenteditable=true]": { WebkitUserModify: "read-write-plaintext-only" } }, ".cm-lineWrapping": { whiteSpace_fallback: "pre-wrap", whiteSpace: "break-spaces", wordBreak: "break-word", overflowWrap: "anywhere", flexShrink: 1 }, "&light .cm-content": { caretColor: "black" }, "&dark .cm-content": { caretColor: "white" }, ".cm-line": { display: "block", padding: "0 2px 0 6px" }, ".cm-layer": { position: "absolute", left: 0, top: 0, contain: "size style", "& > *": { position: "absolute" } }, "&light .cm-selectionBackground": { background: "#d9d9d9" }, "&dark .cm-selectionBackground": { background: "#222" }, "&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": { background: "#d7d4f0" }, "&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": { background: "#233" }, ".cm-cursorLayer": { pointerEvents: "none" }, "&.cm-focused > .cm-scroller > .cm-cursorLayer": { animation: "steps(1) cm-blink 1.2s infinite" }, "@keyframes cm-blink": { "0%": {}, "50%": { opacity: 0 }, "100%": {} }, "@keyframes cm-blink2": { "0%": {}, "50%": { opacity: 0 }, "100%": {} }, ".cm-cursor, .cm-dropCursor": { borderLeft: "1.2px solid black", marginLeft: "-0.6px", pointerEvents: "none" }, ".cm-cursor": { display: "none" }, "&dark .cm-cursor": { borderLeftColor: "#444" }, ".cm-dropCursor": { position: "absolute" }, "&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": { display: "block" }, ".cm-iso": { unicodeBidi: "isolate" }, ".cm-announced": { position: "fixed", top: "-10000px" }, "@media print": { ".cm-announced": { display: "none" } }, "&light .cm-activeLine": { backgroundColor: "#cceeff44" }, "&dark .cm-activeLine": { backgroundColor: "#99eeff33" }, "&light .cm-specialChar": { color: "red" }, "&dark .cm-specialChar": { color: "#f78" }, ".cm-gutters": { flexShrink: 0, display: "flex", height: "100%", boxSizing: "border-box", insetInlineStart: 0, zIndex: 200 }, "&light .cm-gutters": { backgroundColor: "#f5f5f5", color: "#6c6c6c", borderRight: "1px solid #ddd" }, "&dark .cm-gutters": { backgroundColor: "#333338", color: "#ccc" }, ".cm-gutter": { display: "flex !important", flexDirection: "column", flexShrink: 0, boxSizing: "border-box", minHeight: "100%", overflow: "hidden" }, ".cm-gutterElement": { boxSizing: "border-box" }, ".cm-lineNumbers .cm-gutterElement": { padding: "0 3px 0 5px", minWidth: "20px", textAlign: "right", whiteSpace: "nowrap" }, "&light .cm-activeLineGutter": { backgroundColor: "#e2f2ff" }, "&dark .cm-activeLineGutter": { backgroundColor: "#222227" }, ".cm-panels": { boxSizing: "border-box", position: "sticky", left: 0, right: 0 }, "&light .cm-panels": { backgroundColor: "#f5f5f5", color: "black" }, "&light .cm-panels-top": { borderBottom: "1px solid #ddd" }, "&light .cm-panels-bottom": { borderTop: "1px solid #ddd" }, "&dark .cm-panels": { backgroundColor: "#333338", color: "white" }, ".cm-tab": { display: "inline-block", overflow: "hidden", verticalAlign: "bottom" }, ".cm-widgetBuffer": { verticalAlign: "text-top", height: "1em", width: 0, display: "inline" }, ".cm-placeholder": { color: "#888", display: "inline-block", verticalAlign: "top" }, ".cm-highlightSpace:before": { content: "attr(data-display)", position: "absolute", pointerEvents: "none", color: "#888" }, ".cm-highlightTab": { backgroundImage: `url('data:image/svg+xml,')`, backgroundSize: "auto 100%", backgroundPosition: "right 90%", backgroundRepeat: "no-repeat" }, ".cm-trailingSpace": { backgroundColor: "#ff332255" }, ".cm-button": { verticalAlign: "middle", color: "inherit", fontSize: "70%", padding: ".2em 1em", borderRadius: "1px" }, "&light .cm-button": { backgroundImage: "linear-gradient(#eff1f5, #d9d9df)", border: "1px solid #888", "&:active": { backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)" } }, "&dark .cm-button": { backgroundImage: "linear-gradient(#393939, #111)", border: "1px solid #888", "&:active": { backgroundImage: "linear-gradient(#111, #333)" } }, ".cm-textfield": { verticalAlign: "middle", color: "inherit", fontSize: "70%", border: "1px solid silver", padding: ".2em .5em" }, "&light .cm-textfield": { backgroundColor: "white" }, "&dark .cm-textfield": { border: "1px solid #555", backgroundColor: "inherit" } }, CJ); + var OJ = "\uFFFF"; + var MJ = function() { + function e20(t10, n10) { + No(this, e20), this.points = t10, this.text = "", this.lineSeparator = n10.facet(mV.lineSeparator); + } + return Do(e20, [{ key: "append", value: function(e21) { + this.text += e21; + } }, { key: "lineBreak", value: function() { + this.text += OJ; + } }, { key: "readRange", value: function(e21, t10) { + if (!e21) + return this; + for (var n10 = e21.parentNode, r10 = e21; ; ) { + this.findPointBefore(n10, r10); + var o10 = this.text.length; + this.readNode(r10); + var i10 = r10.nextSibling; + if (i10 == t10) + break; + var a10 = pH.get(r10), s10 = pH.get(i10); + (a10 && s10 ? a10.breakAfter : (a10 ? a10.breakAfter : AJ(r10)) || AJ(i10) && ("BR" != r10.nodeName || r10.cmIgnore) && this.text.length > o10) && this.lineBreak(), r10 = i10; + } + return this.findPointBefore(n10, t10), this; + } }, { key: "readTextNode", value: function(e21) { + var t10, n10 = e21.nodeValue, r10 = bo(this.points); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + var o10 = t10.value; + o10.node == e21 && (o10.pos = this.text.length + Math.min(o10.offset, n10.length)); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + for (var i10 = 0, a10 = this.lineSeparator ? null : /\r\n?|\n/g; ; ) { + var s10 = -1, c10 = 1, l10 = void 0; + if (this.lineSeparator ? (s10 = n10.indexOf(this.lineSeparator, i10), c10 = this.lineSeparator.length) : (l10 = a10.exec(n10)) && (s10 = l10.index, c10 = l10[0].length), this.append(n10.slice(i10, s10 < 0 ? n10.length : s10)), s10 < 0) + break; + if (this.lineBreak(), c10 > 1) { + var u10, f10 = bo(this.points); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value; + d10.node == e21 && d10.pos > this.text.length && (d10.pos -= c10 - 1); + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + } + i10 = s10 + c10; + } + } }, { key: "readNode", value: function(e21) { + if (!e21.cmIgnore) { + var t10 = pH.get(e21), n10 = t10 && t10.overrideDOMText; + if (null != n10) { + this.findPointInside(e21, n10.length); + for (var r10 = n10.iter(); !r10.next().done; ) + r10.lineBreak ? this.lineBreak() : this.append(r10.value); + } else + 3 == e21.nodeType ? this.readTextNode(e21) : "BR" == e21.nodeName ? e21.nextSibling && this.lineBreak() : 1 == e21.nodeType && this.readRange(e21.firstChild, null); + } + } }, { key: "findPointBefore", value: function(e21, t10) { + var n10, r10 = bo(this.points); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + o10.node == e21 && e21.childNodes[o10.offset] == t10 && (o10.pos = this.text.length); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + } }, { key: "findPointInside", value: function(e21, t10) { + var n10, r10 = bo(this.points); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + (3 == e21.nodeType ? o10.node == e21 : e21.contains(o10.node)) && (o10.pos = this.text.length + (EJ(e21, o10.node, o10.offset) ? t10 : 0)); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + } }]), e20; + }(); + function EJ(e20, t10, n10) { + for (; ; ) { + if (!t10 || n10 < tH(t10)) + return false; + if (t10 == e20) + return true; + n10 = ZV(t10) + 1, t10 = t10.parentNode; + } + } + function AJ(e20) { + return 1 == e20.nodeType && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e20.nodeName); + } + var PJ = Do(function e5(t10, n10) { + No(this, e5), this.node = t10, this.offset = n10, this.pos = -1; + }); + var TJ = Do(function e6(t10, n10, r10, o10) { + No(this, e6), this.typeOver = o10, this.bounds = null, this.text = ""; + var i10 = t10.docView, a10 = i10.impreciseHead, s10 = i10.impreciseAnchor; + if (t10.state.readOnly && n10 > -1) + this.newSel = null; + else if (n10 > -1 && (this.bounds = t10.docView.domBoundsAround(n10, r10, 0))) { + var c10 = a10 || s10 ? [] : function(e20) { + var t11 = []; + if (e20.root.activeElement != e20.contentDOM) + return t11; + var n11 = e20.observer.selectionRange, r11 = n11.anchorNode, o11 = n11.anchorOffset, i11 = n11.focusNode, a11 = n11.focusOffset; + r11 && (t11.push(new PJ(r11, o11)), i11 == r11 && a11 == o11 || t11.push(new PJ(i11, a11))); + return t11; + }(t10), l10 = new MJ(c10, t10.state); + l10.readRange(this.bounds.startDOM, this.bounds.endDOM), this.text = l10.text, this.newSel = function(e20, t11) { + if (0 == e20.length) + return null; + var n11 = e20[0].pos, r11 = 2 == e20.length ? e20[1].pos : n11; + return n11 > -1 && r11 > -1 ? $F.single(n11 + t11, r11 + t11) : null; + }(c10, this.bounds.from); + } else { + var u10 = t10.observer.selectionRange, f10 = a10 && a10.node == u10.focusNode && a10.offset == u10.focusOffset || !GV(t10.contentDOM, u10.focusNode) ? t10.state.selection.main.head : t10.docView.posFromDOM(u10.focusNode, u10.focusOffset), d10 = s10 && s10.node == u10.anchorNode && s10.offset == u10.anchorOffset || !GV(t10.contentDOM, u10.anchorNode) ? t10.state.selection.main.anchor : t10.docView.posFromDOM(u10.anchorNode, u10.anchorOffset), h10 = t10.viewport; + if (AH.ios && t10.state.selection.main.empty && f10 != d10 && (h10.from > 0 || h10.to < t10.state.doc.length)) { + var v10 = h10.from - Math.min(f10, d10), p10 = h10.to - Math.max(f10, d10); + 0 != v10 && 1 != v10 || 0 != p10 && -1 != p10 || (f10 = 0, d10 = t10.state.doc.length); + } + this.newSel = $F.single(d10, f10); + } + }); + function RJ(e20, t10) { + var n10, r10 = t10.newSel, o10 = e20.state.selection.main, i10 = e20.inputState.lastKeyTime > Date.now() - 100 ? e20.inputState.lastKeyCode : -1; + if (t10.bounds) { + var a10 = t10.bounds, s10 = a10.from, c10 = a10.to, l10 = o10.from, u10 = null; + (8 === i10 || AH.android && t10.text.length < c10 - s10) && (l10 = o10.to, u10 = "end"); + var f10 = function(e21, t11, n11, r11) { + var o11 = Math.min(e21.length, t11.length), i11 = 0; + for (; i11 < o11 && e21.charCodeAt(i11) == t11.charCodeAt(i11); ) + i11++; + if (i11 == o11 && e21.length == t11.length) + return null; + var a11 = e21.length, s11 = t11.length; + for (; a11 > 0 && s11 > 0 && e21.charCodeAt(a11 - 1) == t11.charCodeAt(s11 - 1); ) + a11--, s11--; + if ("end" == r11) { + n11 -= a11 + Math.max(0, i11 - Math.min(a11, s11)) - i11; + } + if (a11 < i11 && e21.length < t11.length) { + s11 = (i11 -= n11 <= i11 && n11 >= a11 ? i11 - n11 : 0) + (s11 - a11), a11 = i11; + } else if (s11 < i11) { + a11 = (i11 -= n11 <= i11 && n11 >= s11 ? i11 - n11 : 0) + (a11 - s11), s11 = i11; + } + return { from: i11, toA: a11, toB: s11 }; + }(e20.state.doc.sliceString(s10, c10, OJ), t10.text, l10 - s10, u10); + f10 && (AH.chrome && 13 == i10 && f10.toB == f10.from + 2 && t10.text.slice(f10.from, f10.toB) == OJ + OJ && f10.toB--, n10 = { from: s10 + f10.from, to: s10 + f10.toA, insert: UL.of(t10.text.slice(f10.from, f10.toB).split(OJ)) }); + } else + r10 && (!e20.hasFocus && e20.state.facet(zW) || r10.main.eq(o10)) && (r10 = null); + if (!n10 && !r10) + return false; + if (!n10 && t10.typeOver && !o10.empty && r10 && r10.main.empty ? n10 = { from: o10.from, to: o10.to, insert: e20.state.doc.slice(o10.from, o10.to) } : n10 && n10.from >= o10.from && n10.to <= o10.to && (n10.from != o10.from || n10.to != o10.to) && o10.to - o10.from - (n10.to - n10.from) <= 4 ? n10 = { from: o10.from, to: o10.to, insert: e20.state.doc.slice(o10.from, n10.from).append(n10.insert).append(e20.state.doc.slice(n10.to, o10.to)) } : (AH.mac || AH.android) && n10 && n10.from == n10.to && n10.from == o10.head - 1 && /^\. ?$/.test(n10.insert.toString()) && "off" == e20.contentDOM.getAttribute("autocorrect") ? (r10 && 2 == n10.insert.length && (r10 = $F.single(r10.main.anchor - 1, r10.main.head - 1)), n10 = { from: o10.from, to: o10.to, insert: UL.of([" "]) }) : AH.chrome && n10 && n10.from == n10.to && n10.from == o10.head && "\n " == n10.insert.toString() && e20.lineWrapping && (r10 && (r10 = $F.single(r10.main.anchor - 1, r10.main.head - 1)), n10 = { from: o10.from, to: o10.to, insert: UL.of([" "]) }), n10) { + if (AH.ios && e20.inputState.flushIOSKey()) + return true; + if (AH.android && (n10.from == o10.from && n10.to == o10.to && 1 == n10.insert.length && 2 == n10.insert.lines && uH(e20.contentDOM, "Enter", 13) || (n10.from == o10.from - 1 && n10.to == o10.to && 0 == n10.insert.length || 8 == i10 && n10.insert.length < n10.to - n10.from && n10.to > o10.head) && uH(e20.contentDOM, "Backspace", 8) || n10.from == o10.from && n10.to == o10.to + 1 && 0 == n10.insert.length && uH(e20.contentDOM, "Delete", 46))) + return true; + var d10, h10 = n10.insert.toString(); + e20.inputState.composing >= 0 && e20.inputState.composing++; + var v10 = function() { + return d10 || (d10 = function(e21, t11, n11) { + var r11, o11 = e21.state, i11 = o11.selection.main; + if (t11.from >= i11.from && t11.to <= i11.to && t11.to - t11.from >= (i11.to - i11.from) / 3 && (!n11 || n11.main.empty && n11.main.from == t11.from + t11.insert.length) && e21.inputState.composing < 0) { + var a11 = i11.from < t11.from ? o11.sliceDoc(i11.from, t11.from) : "", s11 = i11.to > t11.to ? o11.sliceDoc(t11.to, i11.to) : ""; + r11 = o11.replaceSelection(e21.state.toText(a11 + t11.insert.sliceString(0, void 0, e21.state.lineBreak) + s11)); + } else { + var c11 = o11.changes(t11), l11 = n11 && n11.main.to <= c11.newLength ? n11.main : void 0; + if (o11.selection.ranges.length > 1 && e21.inputState.composing >= 0 && t11.to <= i11.to && t11.to >= i11.to - 10) { + var u11, f11 = e21.state.sliceDoc(t11.from, t11.to), d11 = n11 && oU(e21, n11.main.head); + if (d11) { + var h11 = t11.insert.length - (t11.to - t11.from); + u11 = { from: d11.from, to: d11.to - h11 }; + } else + u11 = e21.state.doc.lineAt(i11.head); + var v11 = i11.to - t11.to, p11 = i11.to - i11.from; + r11 = o11.changeByRange(function(n12) { + if (n12.from == i11.from && n12.to == i11.to) + return { changes: c11, range: l11 || n12.map(c11) }; + var r12 = n12.to - v11, a12 = r12 - f11.length; + if (n12.to - n12.from != p11 || e21.state.sliceDoc(a12, r12) != f11 || n12.to >= u11.from && n12.from <= u11.to) + return { range: n12 }; + var s12 = o11.changes({ from: a12, to: r12, insert: t11.insert }), d12 = n12.to - i11.to; + return { changes: s12, range: l11 ? $F.range(Math.max(0, l11.anchor + d12), Math.max(0, l11.head + d12)) : n12.map(s12) }; + }); + } else + r11 = { changes: c11, selection: l11 && o11.selection.replaceRange(l11) }; + } + var m11 = "input.type"; + (e21.composing || e21.inputState.compositionPendingChange && e21.inputState.compositionEndedAt > Date.now() - 50) && (e21.inputState.compositionPendingChange = false, m11 += ".compose", e21.inputState.compositionFirstChange && (m11 += ".start", e21.inputState.compositionFirstChange = false)); + return o11.update(r11, { userEvent: m11, scrollIntoView: true }); + }(e20, n10, r10)); + }; + return e20.state.facet(PW).some(function(t11) { + return t11(e20, n10.from, n10.to, h10, v10); + }) || e20.dispatch(v10()), true; + } + if (r10 && !r10.main.eq(o10)) { + var p10 = false, m10 = "select"; + return e20.inputState.lastSelectionTime > Date.now() - 50 && ("select" == e20.inputState.lastSelectionOrigin && (p10 = true), m10 = e20.inputState.lastSelectionOrigin), e20.dispatch({ selection: r10, scrollIntoView: p10, userEvent: m10 }), true; + } + return false; + } + var NJ = { childList: true, characterData: true, subtree: true, attributes: true, characterDataOldValue: true }; + var IJ = AH.ie && AH.ie_version <= 11; + var DJ = function() { + function e20(t10) { + var n10 = this; + No(this, e20), this.view = t10, this.active = false, this.selectionRange = new aH(), this.selectionChanged = false, this.delayedFlush = -1, this.resizeTimeout = -1, this.queue = [], this.delayedAndroidKey = null, this.flushingAndroidKey = -1, this.lastChange = 0, this.scrollTargets = [], this.intersection = null, this.resizeScroll = null, this.intersecting = false, this.gapIntersection = null, this.gaps = [], this.parentCheck = -1, this.dom = t10.contentDOM, this.observer = new MutationObserver(function(e21) { + var r10, o10 = bo(e21); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + n10.queue.push(i10); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + (AH.ie && AH.ie_version <= 11 || AH.ios && t10.composing) && e21.some(function(e23) { + return "childList" == e23.type && e23.removedNodes.length || "characterData" == e23.type && e23.oldValue.length > e23.target.nodeValue.length; + }) ? n10.flushSoon() : n10.flush(); + }), IJ && (this.onCharData = function(e21) { + n10.queue.push({ target: e21.target, type: "characterData", oldValue: e21.prevValue }), n10.flushSoon(); + }), this.onSelectionChange = this.onSelectionChange.bind(this), this.onResize = this.onResize.bind(this), this.onPrint = this.onPrint.bind(this), this.onScroll = this.onScroll.bind(this), "function" == typeof ResizeObserver && (this.resizeScroll = new ResizeObserver(function() { + var e21; + (null === (e21 = n10.view.docView) || void 0 === e21 ? void 0 : e21.lastUpdate) < Date.now() - 75 && n10.onResize(); + }), this.resizeScroll.observe(t10.scrollDOM)), this.addWindowListeners(this.win = t10.win), this.start(), "function" == typeof IntersectionObserver && (this.intersection = new IntersectionObserver(function(e21) { + n10.parentCheck < 0 && (n10.parentCheck = setTimeout(n10.listenForScroll.bind(n10), 1e3)), e21.length > 0 && e21[e21.length - 1].intersectionRatio > 0 != n10.intersecting && (n10.intersecting = !n10.intersecting, n10.intersecting != n10.view.inView && n10.onScrollChanged(document.createEvent("Event"))); + }, { threshold: [0, 1e-3] }), this.intersection.observe(this.dom), this.gapIntersection = new IntersectionObserver(function(e21) { + e21.length > 0 && e21[e21.length - 1].intersectionRatio > 0 && n10.onScrollChanged(document.createEvent("Event")); + }, {})), this.listenForScroll(), this.readSelectionRange(); + } + return Do(e20, [{ key: "onScrollChanged", value: function(e21) { + this.view.inputState.runHandlers("scroll", e21), this.intersecting && this.view.measure(); + } }, { key: "onScroll", value: function(e21) { + this.intersecting && this.flush(false), this.onScrollChanged(e21); + } }, { key: "onResize", value: function() { + var e21 = this; + this.resizeTimeout < 0 && (this.resizeTimeout = setTimeout(function() { + e21.resizeTimeout = -1, e21.view.requestMeasure(); + }, 50)); + } }, { key: "onPrint", value: function() { + var e21 = this; + this.view.viewState.printing = true, this.view.measure(), setTimeout(function() { + e21.view.viewState.printing = false, e21.view.requestMeasure(); + }, 500); + } }, { key: "updateGaps", value: function(e21) { + if (this.gapIntersection && (e21.length != this.gaps.length || this.gaps.some(function(t11, n11) { + return t11 != e21[n11]; + }))) { + this.gapIntersection.disconnect(); + var t10, n10 = bo(e21); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + this.gapIntersection.observe(r10); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + this.gaps = e21; + } + } }, { key: "onSelectionChange", value: function(e21) { + var t10 = this.selectionChanged; + if (this.readSelectionRange() && !this.delayedAndroidKey) { + var n10 = this.view, r10 = this.selectionRange; + if (n10.state.facet(zW) ? n10.root.activeElement == this.dom : QV(n10.dom, r10)) { + var o10 = r10.anchorNode && n10.docView.nearest(r10.anchorNode); + o10 && o10.ignoreEvent(e21) ? t10 || (this.selectionChanged = false) : (AH.ie && AH.ie_version <= 11 || AH.android && AH.chrome) && !n10.state.selection.main.empty && r10.focusNode && XV(r10.focusNode, r10.focusOffset, r10.anchorNode, r10.anchorOffset) ? this.flushSoon() : this.flush(false); + } + } + } }, { key: "readSelectionRange", value: function() { + var e21 = this.view, t10 = AH.safari && 11 == e21.root.nodeType && function(e23) { + for (var t11 = e23.activeElement; t11 && t11.shadowRoot; ) + t11 = t11.shadowRoot.activeElement; + return t11; + }(this.dom.ownerDocument) == this.dom && function(e23) { + var t11 = null; + function n11(e24) { + e24.preventDefault(), e24.stopImmediatePropagation(), t11 = e24.getTargetRanges()[0]; + } + if (e23.contentDOM.addEventListener("beforeinput", n11, true), e23.dom.ownerDocument.execCommand("indent"), e23.contentDOM.removeEventListener("beforeinput", n11, true), !t11) + return null; + var r10 = t11.startContainer, o10 = t11.startOffset, i10 = t11.endContainer, a10 = t11.endOffset, s10 = e23.docView.domAtPos(e23.state.selection.main.anchor); + if (XV(s10.node, s10.offset, i10, a10)) { + var c10 = [i10, a10, r10, o10]; + r10 = c10[0], o10 = c10[1], i10 = c10[2], a10 = c10[3]; + } + return { anchorNode: r10, anchorOffset: o10, focusNode: i10, focusOffset: a10 }; + }(this.view) || KV(e21.root); + if (!t10 || this.selectionRange.eq(t10)) + return false; + var n10 = QV(this.dom, t10); + return n10 && !this.selectionChanged && e21.inputState.lastFocusTime > Date.now() - 200 && e21.inputState.lastTouchTime < Date.now() - 300 && function(e23, t11) { + var n11 = t11.focusNode, r10 = t11.focusOffset; + if (!n11 || t11.anchorNode != n11 || t11.anchorOffset != r10) + return false; + for (r10 = Math.min(r10, tH(n11)); ; ) + if (r10) { + if (1 != n11.nodeType) + return false; + var o10 = n11.childNodes[r10 - 1]; + "false" == o10.contentEditable ? r10-- : r10 = tH(n11 = o10); + } else { + if (n11 == e23) + return true; + r10 = ZV(n11), n11 = n11.parentNode; + } + }(this.dom, t10) ? (this.view.inputState.lastFocusTime = 0, e21.docView.updateSelection(), false) : (this.selectionRange.setRange(t10), n10 && (this.selectionChanged = true), true); + } }, { key: "setSelectionRange", value: function(e21, t10) { + this.selectionRange.set(e21.node, e21.offset, t10.node, t10.offset), this.selectionChanged = false; + } }, { key: "clearSelectionRange", value: function() { + this.selectionRange.set(null, 0, null, 0); + } }, { key: "listenForScroll", value: function() { + this.parentCheck = -1; + for (var e21 = 0, t10 = null, n10 = this.dom; n10; ) + if (1 == n10.nodeType) + !t10 && e21 < this.scrollTargets.length && this.scrollTargets[e21] == n10 ? e21++ : t10 || (t10 = this.scrollTargets.slice(0, e21)), t10 && t10.push(n10), n10 = n10.assignedSlot || n10.parentNode; + else { + if (11 != n10.nodeType) + break; + n10 = n10.host; + } + if (e21 < this.scrollTargets.length && !t10 && (t10 = this.scrollTargets.slice(0, e21)), t10) { + var r10, o10 = bo(this.scrollTargets); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + r10.value.removeEventListener("scroll", this.onScroll); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + var i10, a10 = bo(this.scrollTargets = t10); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + i10.value.addEventListener("scroll", this.onScroll); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + } + } }, { key: "ignore", value: function(e21) { + if (!this.active) + return e21(); + try { + return this.stop(), e21(); + } finally { + this.start(), this.clear(); + } + } }, { key: "start", value: function() { + this.active || (this.observer.observe(this.dom, NJ), IJ && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = true); + } }, { key: "stop", value: function() { + this.active && (this.active = false, this.observer.disconnect(), IJ && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData)); + } }, { key: "clear", value: function() { + this.processRecords(), this.queue.length = 0, this.selectionChanged = false; + } }, { key: "delayAndroidKey", value: function(e21, t10) { + var n10, r10 = this; + if (!this.delayedAndroidKey) { + this.flushingAndroidKey = this.view.win.requestAnimationFrame(function() { + var e23 = r10.delayedAndroidKey; + e23 && (r10.clearDelayedAndroidKey(), r10.view.inputState.lastKeyCode = e23.keyCode, r10.view.inputState.lastKeyTime = Date.now(), !r10.flush() && e23.force && uH(r10.dom, e23.key, e23.keyCode)); + }); + } + this.delayedAndroidKey && "Enter" != e21 || (this.delayedAndroidKey = { key: e21, keyCode: t10, force: this.lastChange < Date.now() - 50 || !!(null === (n10 = this.delayedAndroidKey) || void 0 === n10 ? void 0 : n10.force) }); + } }, { key: "clearDelayedAndroidKey", value: function() { + this.win.cancelAnimationFrame(this.flushingAndroidKey), this.delayedAndroidKey = null, this.flushingAndroidKey = -1; + } }, { key: "flushSoon", value: function() { + var e21 = this; + this.delayedFlush < 0 && (this.delayedFlush = this.view.win.requestAnimationFrame(function() { + e21.delayedFlush = -1, e21.flush(); + })); + } }, { key: "forceFlush", value: function() { + this.delayedFlush >= 0 && (this.view.win.cancelAnimationFrame(this.delayedFlush), this.delayedFlush = -1), this.flush(); + } }, { key: "pendingRecords", value: function() { + var e21, t10 = bo(this.observer.takeRecords()); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + var n10 = e21.value; + this.queue.push(n10); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + return this.queue; + } }, { key: "processRecords", value: function() { + var e21 = this.pendingRecords(); + e21.length && (this.queue = []); + var t10, n10 = -1, r10 = -1, o10 = false, i10 = bo(e21); + try { + for (i10.s(); !(t10 = i10.n()).done; ) { + var a10 = t10.value, s10 = this.readMutation(a10); + s10 && (s10.typeOver && (o10 = true), -1 == n10 ? (n10 = s10.from, r10 = s10.to) : (n10 = Math.min(s10.from, n10), r10 = Math.max(s10.to, r10))); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + return { from: n10, to: r10, typeOver: o10 }; + } }, { key: "readChange", value: function() { + var e21 = this.processRecords(), t10 = e21.from, n10 = e21.to, r10 = e21.typeOver, o10 = this.selectionChanged && QV(this.dom, this.selectionRange); + if (t10 < 0 && !o10) + return null; + t10 > -1 && (this.lastChange = Date.now()), this.view.inputState.lastFocusTime = 0, this.selectionChanged = false; + var i10 = new TJ(this.view, t10, n10, r10); + return this.view.docView.domChanged = { newSel: i10.newSel ? i10.newSel.main : null }, i10; + } }, { key: "flush", value: function() { + var e21 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; + if (this.delayedFlush >= 0 || this.delayedAndroidKey) + return false; + e21 && this.readSelectionRange(); + var t10 = this.readChange(); + if (!t10) + return this.view.requestMeasure(), false; + var n10 = this.view.state, r10 = RJ(this.view, t10); + return this.view.state == n10 && this.view.update([]), r10; + } }, { key: "readMutation", value: function(e21) { + var t10 = this.view.docView.nearest(e21.target); + if (!t10 || t10.ignoreMutation(e21)) + return null; + if (t10.markDirty("attributes" == e21.type), "attributes" == e21.type && (t10.flags |= 4), "childList" == e21.type) { + var n10 = qJ(t10, e21.previousSibling || e21.target.previousSibling, -1), r10 = qJ(t10, e21.nextSibling || e21.target.nextSibling, 1); + return { from: n10 ? t10.posAfter(n10) : t10.posAtStart, to: r10 ? t10.posBefore(r10) : t10.posAtEnd, typeOver: false }; + } + return "characterData" == e21.type ? { from: t10.posAtStart, to: t10.posAtEnd, typeOver: e21.target.nodeValue == e21.oldValue } : null; + } }, { key: "setWindow", value: function(e21) { + e21 != this.win && (this.removeWindowListeners(this.win), this.win = e21, this.addWindowListeners(this.win)); + } }, { key: "addWindowListeners", value: function(e21) { + e21.addEventListener("resize", this.onResize), e21.addEventListener("beforeprint", this.onPrint), e21.addEventListener("scroll", this.onScroll), e21.document.addEventListener("selectionchange", this.onSelectionChange); + } }, { key: "removeWindowListeners", value: function(e21) { + e21.removeEventListener("scroll", this.onScroll), e21.removeEventListener("resize", this.onResize), e21.removeEventListener("beforeprint", this.onPrint), e21.document.removeEventListener("selectionchange", this.onSelectionChange); + } }, { key: "destroy", value: function() { + var e21, t10, n10; + this.stop(), null === (e21 = this.intersection) || void 0 === e21 || e21.disconnect(), null === (t10 = this.gapIntersection) || void 0 === t10 || t10.disconnect(), null === (n10 = this.resizeScroll) || void 0 === n10 || n10.disconnect(); + var r10, o10 = bo(this.scrollTargets); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + r10.value.removeEventListener("scroll", this.onScroll); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + this.removeWindowListeners(this.win), clearTimeout(this.parentCheck), clearTimeout(this.resizeTimeout), this.win.cancelAnimationFrame(this.delayedFlush), this.win.cancelAnimationFrame(this.flushingAndroidKey); + } }]), e20; + }(); + function qJ(e20, t10, n10) { + for (; t10; ) { + var r10 = pH.get(t10); + if (r10 && r10.parent == e20) + return r10; + var o10 = t10.parentNode; + t10 = o10 != e20.dom ? o10 : n10 > 0 ? t10.nextSibling : t10.previousSibling; + } + return null; + } + var zJ = function() { + function e20() { + var t10 = this, n10 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + No(this, e20), this.plugins = [], this.pluginMap = /* @__PURE__ */ new Map(), this.editorAttrs = {}, this.contentAttrs = {}, this.bidiCache = [], this.destroyed = false, this.updateState = 2, this.measureScheduled = -1, this.measureRequests = [], this.contentDOM = document.createElement("div"), this.scrollDOM = document.createElement("div"), this.scrollDOM.tabIndex = -1, this.scrollDOM.className = "cm-scroller", this.scrollDOM.appendChild(this.contentDOM), this.announceDOM = document.createElement("div"), this.announceDOM.className = "cm-announced", this.announceDOM.setAttribute("aria-live", "polite"), this.dom = document.createElement("div"), this.dom.appendChild(this.announceDOM), this.dom.appendChild(this.scrollDOM), n10.parent && n10.parent.appendChild(this.dom); + var r10 = n10.dispatch; + this.dispatchTransactions = n10.dispatchTransactions || r10 && function(e21) { + return e21.forEach(function(e23) { + return r10(e23, t10); + }); + } || function(e21) { + return t10.update(e21); + }, this.dispatch = this.dispatch.bind(this), this._root = n10.root || function(e21) { + for (; e21; ) { + if (e21 && (9 == e21.nodeType || 11 == e21.nodeType && e21.host)) + return e21; + e21 = e21.assignedSlot || e21.parentNode; + } + return null; + }(n10.parent) || document, this.viewState = new dJ(n10.state || mV.create(n10)), n10.scrollTo && n10.scrollTo.is(DW) && (this.viewState.scrollTarget = n10.scrollTo.value.clip(this.viewState.state)), this.plugins = this.state.facet(LW).map(function(e21) { + return new VW(e21); + }); + var o10, i10 = bo(this.plugins); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + o10.value.update(this); + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + this.observer = new DJ(this), this.inputState = new kU(this), this.inputState.ensureHandlers(this.plugins), this.docView = new nU(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(); + } + return Do(e20, [{ key: "state", get: function() { + return this.viewState.state; + } }, { key: "viewport", get: function() { + return this.viewState.viewport; + } }, { key: "visibleRanges", get: function() { + return this.viewState.visibleRanges; + } }, { key: "inView", get: function() { + return this.viewState.inView; + } }, { key: "composing", get: function() { + return this.inputState.composing > 0; + } }, { key: "compositionStarted", get: function() { + return this.inputState.composing >= 0; + } }, { key: "root", get: function() { + return this._root; + } }, { key: "win", get: function() { + return this.dom.ownerDocument.defaultView || window; + } }, { key: "dispatch", value: function() { + for (var e21, t10 = arguments.length, n10 = new Array(t10), r10 = 0; r10 < t10; r10++) + n10[r10] = arguments[r10]; + var o10 = 1 == n10.length && n10[0] instanceof iV ? n10 : 1 == n10.length && Array.isArray(n10[0]) ? n10[0] : [(e21 = this.state).update.apply(e21, n10)]; + this.dispatchTransactions(o10, this); + } }, { key: "update", value: function(e21) { + var t10 = this; + if (0 != this.updateState) + throw new Error("Calls to EditorView.update are not allowed while an update is in progress"); + var n10, r10, o10 = false, i10 = false, a10 = this.state, s10 = bo(e21); + try { + for (s10.s(); !(r10 = s10.n()).done; ) { + var c10 = r10.value; + if (c10.startState != a10) + throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state."); + a10 = c10.state; + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + if (this.destroyed) + this.viewState.state = a10; + else { + var l10 = this.hasFocus, u10 = 0, f10 = null; + e21.some(function(e23) { + return e23.annotation(HU); + }) ? (this.inputState.notifiedFocused = l10, u10 = 1) : l10 != this.inputState.notifiedFocused && (this.inputState.notifiedFocused = l10, (f10 = WU(a10, l10)) || (u10 = 1)); + var d10 = this.observer.delayedAndroidKey, h10 = null; + if (d10 ? (this.observer.clearDelayedAndroidKey(), ((h10 = this.observer.readChange()) && !this.state.doc.eq(a10.doc) || !this.state.selection.eq(a10.selection)) && (h10 = null)) : this.observer.clear(), a10.facet(mV.phrases) != this.state.facet(mV.phrases)) + return this.setState(a10); + n10 = tU.create(this, a10, e21), n10.flags |= u10; + var v10 = this.viewState.scrollTarget; + try { + this.updateState = 2; + var p10, m10 = bo(e21); + try { + for (m10.s(); !(p10 = m10.n()).done; ) { + var g10 = p10.value; + if (v10 && (v10 = v10.map(g10.changes)), g10.scrollIntoView) { + var y10 = g10.state.selection.main; + v10 = new IW(y10.empty ? y10 : $F.cursor(y10.head, y10.head > y10.anchor ? -1 : 1)); + } + var b10, k10 = bo(g10.effects); + try { + for (k10.s(); !(b10 = k10.n()).done; ) { + var w10 = b10.value; + w10.is(DW) && (v10 = w10.value.clip(this.state)); + } + } catch (e23) { + k10.e(e23); + } finally { + k10.f(); + } + } + } catch (e23) { + m10.e(e23); + } finally { + m10.f(); + } + this.viewState.update(n10, v10), this.bidiCache = FJ.update(this.bidiCache, n10.changes), n10.empty || (this.updatePlugins(n10), this.inputState.update(n10)), o10 = this.docView.update(n10), this.state.facet(ZW) != this.styleModules && this.mountStyles(), i10 = this.updateAttrs(), this.showAnnouncements(e21), this.docView.updateSelection(o10, e21.some(function(e23) { + return e23.isUserEvent("select.pointer"); + })); + } finally { + this.updateState = 0; + } + if (n10.startState.facet(kJ) != n10.state.facet(kJ) && (this.viewState.mustMeasureContent = true), (o10 || i10 || v10 || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), !n10.empty) { + var x10, j10 = bo(this.state.facet(AW)); + try { + for (j10.s(); !(x10 = j10.n()).done; ) { + var S10 = x10.value; + try { + S10(n10); + } catch (w11) { + qW(this.state, w11, "update listener"); + } + } + } catch (e23) { + j10.e(e23); + } finally { + j10.f(); + } + } + (f10 || h10) && Promise.resolve().then(function() { + f10 && t10.state == f10.startState && t10.dispatch(f10), h10 && !RJ(t10, h10) && d10.force && uH(t10.contentDOM, d10.key, d10.keyCode); + }); + } + } }, { key: "setState", value: function(e21) { + if (0 != this.updateState) + throw new Error("Calls to EditorView.setState are not allowed while an update is in progress"); + if (this.destroyed) + this.viewState.state = e21; + else { + this.updateState = 2; + var t10 = this.hasFocus; + try { + var n10, r10 = bo(this.plugins); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + n10.value.destroy(this); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + this.viewState = new dJ(e21), this.plugins = e21.facet(LW).map(function(e23) { + return new VW(e23); + }), this.pluginMap.clear(); + var o10, i10 = bo(this.plugins); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + o10.value.update(this); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + this.docView.destroy(), this.docView = new nU(this), this.inputState.ensureHandlers(this.plugins), this.mountStyles(), this.updateAttrs(), this.bidiCache = []; + } finally { + this.updateState = 0; + } + t10 && this.focus(), this.requestMeasure(); + } + } }, { key: "updatePlugins", value: function(e21) { + var t10 = e21.startState.facet(LW), n10 = e21.state.facet(LW); + if (t10 != n10) { + var r10, o10 = [], i10 = bo(n10); + try { + for (i10.s(); !(r10 = i10.n()).done; ) { + var a10 = r10.value, s10 = t10.indexOf(a10); + if (s10 < 0) + o10.push(new VW(a10)); + else { + var c10 = this.plugins[s10]; + c10.mustUpdate = e21, o10.push(c10); + } + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + var l10, u10 = bo(this.plugins); + try { + for (u10.s(); !(l10 = u10.n()).done; ) { + var f10 = l10.value; + f10.mustUpdate != e21 && f10.destroy(this); + } + } catch (e23) { + u10.e(e23); + } finally { + u10.f(); + } + this.plugins = o10, this.pluginMap.clear(); + } else { + var d10, h10 = bo(this.plugins); + try { + for (h10.s(); !(d10 = h10.n()).done; ) { + d10.value.mustUpdate = e21; + } + } catch (e23) { + h10.e(e23); + } finally { + h10.f(); + } + } + for (var v10 = 0; v10 < this.plugins.length; v10++) + this.plugins[v10].update(this); + t10 != n10 && this.inputState.ensureHandlers(this.plugins); + } }, { key: "measure", value: function() { + var e21 = this, t10 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; + if (!this.destroyed) { + if (this.measureScheduled > -1 && this.win.cancelAnimationFrame(this.measureScheduled), this.observer.delayedAndroidKey) + return this.measureScheduled = -1, void this.requestMeasure(); + this.measureScheduled = 0, t10 && this.observer.forceFlush(); + var n10 = null, r10 = this.scrollDOM, o10 = r10.scrollTop * this.scaleY, i10 = this.viewState, a10 = i10.scrollAnchorPos, s10 = i10.scrollAnchorHeight; + Math.abs(o10 - this.viewState.scrollTop) > 1 && (s10 = -1), this.viewState.scrollAnchorHeight = -1; + try { + for (var c10 = 0; ; c10++) { + if (s10 < 0) + if (dH(r10)) + a10 = -1, s10 = this.viewState.heightMap.height; + else { + var l10 = this.viewState.scrollAnchorAt(o10); + a10 = l10.from, s10 = l10.top; + } + this.updateState = 1; + var u10 = this.viewState.measure(this); + if (!u10 && !this.measureRequests.length && null == this.viewState.scrollTarget) + break; + if (c10 > 5) { + console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize"); + break; + } + var f10 = []; + if (!(4 & u10)) { + var d10 = [f10, this.measureRequests]; + this.measureRequests = d10[0], f10 = d10[1]; + } + var h10 = f10.map(function(t11) { + try { + return t11.read(e21); + } catch (t12) { + return qW(e21.state, t12), LJ; + } + }), v10 = tU.create(this, this.state, []), p10 = false; + v10.flags |= u10, n10 ? n10.flags |= u10 : n10 = v10, this.updateState = 2, v10.empty || (this.updatePlugins(v10), this.inputState.update(v10), this.updateAttrs(), p10 = this.docView.update(v10)); + for (var m10 = 0; m10 < f10.length; m10++) + if (h10[m10] != LJ) + try { + var g10 = f10[m10]; + g10.write && g10.write(h10[m10], this); + } catch (e23) { + qW(this.state, e23); + } + if (p10 && this.docView.updateSelection(true), !v10.viewportChanged && 0 == this.measureRequests.length) { + if (this.viewState.editorHeight) { + if (this.viewState.scrollTarget) { + this.docView.scrollIntoView(this.viewState.scrollTarget), this.viewState.scrollTarget = null, s10 = -1; + continue; + } + var y10 = (a10 < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(a10).top) - s10; + if (y10 > 1 || y10 < -1) { + o10 += y10, r10.scrollTop = o10 / this.scaleY, s10 = -1; + continue; + } + } + break; + } + } + } finally { + this.updateState = 0, this.measureScheduled = -1; + } + if (n10 && !n10.empty) { + var b10, k10 = bo(this.state.facet(AW)); + try { + for (k10.s(); !(b10 = k10.n()).done; ) { + (0, b10.value)(n10); + } + } catch (e23) { + k10.e(e23); + } finally { + k10.f(); + } + } + } + } }, { key: "themeClasses", get: function() { + return xJ + " " + (this.state.facet(wJ) ? SJ : jJ) + " " + this.state.facet(kJ); + } }, { key: "updateAttrs", value: function() { + var e21 = this, t10 = VJ(this, HW, { class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses }), n10 = { spellcheck: "false", autocorrect: "off", autocapitalize: "off", translate: "no", contenteditable: this.state.facet(zW) ? "true" : "false", class: "cm-content", style: "".concat(AH.tabSize, ": ").concat(this.state.tabSize), role: "textbox", "aria-multiline": "true" }; + this.state.readOnly && (n10["aria-readonly"] = "true"), VJ(this, WW, n10); + var r10 = this.observer.ignore(function() { + var r11 = FH(e21.contentDOM, e21.contentAttrs, n10), o10 = FH(e21.dom, e21.editorAttrs, t10); + return r11 || o10; + }); + return this.editorAttrs = t10, this.contentAttrs = n10, r10; + } }, { key: "showAnnouncements", value: function(t10) { + var n10, r10 = true, o10 = bo(t10); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10, a10 = bo(n10.value.effects); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + if (s10.is(e20.announce)) + r10 && (this.announceDOM.textContent = ""), r10 = false, this.announceDOM.appendChild(document.createElement("div")).textContent = s10.value; + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + } }, { key: "mountStyles", value: function() { + this.styleModules = this.state.facet(ZW); + var t10 = this.state.facet(e20.cspNonce); + zV.mount(this.root, this.styleModules.concat(_J).reverse(), t10 ? { nonce: t10 } : void 0); + } }, { key: "readMeasured", value: function() { + if (2 == this.updateState) + throw new Error("Reading the editor layout isn't allowed during an update"); + 0 == this.updateState && this.measureScheduled > -1 && this.measure(false); + } }, { key: "requestMeasure", value: function(e21) { + var t10 = this; + if (this.measureScheduled < 0 && (this.measureScheduled = this.win.requestAnimationFrame(function() { + return t10.measure(); + })), e21) { + if (this.measureRequests.indexOf(e21) > -1) + return; + if (null != e21.key) { + for (var n10 = 0; n10 < this.measureRequests.length; n10++) + if (this.measureRequests[n10].key === e21.key) + return void (this.measureRequests[n10] = e21); + } + this.measureRequests.push(e21); + } + } }, { key: "plugin", value: function(e21) { + var t10 = this.pluginMap.get(e21); + return (void 0 === t10 || t10 && t10.spec != e21) && this.pluginMap.set(e21, t10 = this.plugins.find(function(t11) { + return t11.spec == e21; + }) || null), t10 && t10.update(this).value; + } }, { key: "documentTop", get: function() { + return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop; + } }, { key: "documentPadding", get: function() { + return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom }; + } }, { key: "scaleX", get: function() { + return this.viewState.scaleX; + } }, { key: "scaleY", get: function() { + return this.viewState.scaleY; + } }, { key: "elementAtHeight", value: function(e21) { + return this.readMeasured(), this.viewState.elementAtHeight(e21); + } }, { key: "lineBlockAtHeight", value: function(e21) { + return this.readMeasured(), this.viewState.lineBlockAtHeight(e21); + } }, { key: "viewportLineBlocks", get: function() { + return this.viewState.viewportLines; + } }, { key: "lineBlockAt", value: function(e21) { + return this.viewState.lineBlockAt(e21); + } }, { key: "contentHeight", get: function() { + return this.viewState.contentHeight; + } }, { key: "moveByChar", value: function(e21, t10, n10) { + return bU(this, e21, gU(this, e21, t10, n10)); + } }, { key: "moveByGroup", value: function(e21, t10) { + var n10 = this; + return bU(this, e21, gU(this, e21, t10, function(t11) { + return function(e23, t12, n11) { + var r10 = e23.state.charCategorizer(t12), o10 = r10(n11); + return function(e24) { + var t13 = r10(e24); + return o10 == hV.Space && (o10 = t13), o10 == t13; + }; + }(n10, e21.head, t11); + })); + } }, { key: "visualLineSide", value: function(e21, t10) { + var n10 = this.bidiSpans(e21), r10 = this.textDirectionAt(e21.from), o10 = n10[t10 ? n10.length - 1 : 0]; + return $F.cursor(o10.side(t10, r10) + e21.from, o10.forward(!t10, r10) ? 1 : -1); + } }, { key: "moveToLineBoundary", value: function(e21, t10) { + return function(e23, t11, n10, r10) { + var o10 = mU(e23, t11.head), i10 = r10 && o10.type == JH.Text && (e23.lineWrapping || o10.widgetLineBreaks) ? e23.coordsAtPos(t11.assoc < 0 && t11.head > o10.from ? t11.head - 1 : t11.head) : null; + if (i10) { + var a10 = e23.dom.getBoundingClientRect(), s10 = e23.textDirectionAt(o10.from), c10 = e23.posAtCoords({ x: n10 == (s10 == rW.LTR) ? a10.right - 1 : a10.left + 1, y: (i10.top + i10.bottom) / 2 }); + if (null != c10) + return $F.cursor(c10, n10 ? -1 : 1); + } + return $F.cursor(n10 ? o10.to : o10.from, n10 ? -1 : 1); + }(this, e21, t10, !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]); + } }, { key: "moveVertically", value: function(e21, t10, n10) { + return bU(this, e21, function(e23, t11, n11, r10) { + var o10 = t11.head, i10 = n11 ? 1 : -1; + if (o10 == (n11 ? e23.state.doc.length : 0)) + return $F.cursor(o10, t11.assoc); + var a10, s10 = t11.goalColumn, c10 = e23.contentDOM.getBoundingClientRect(), l10 = e23.coordsAtPos(o10, t11.assoc || -1), u10 = e23.documentTop; + if (l10) + null == s10 && (s10 = l10.left - c10.left), a10 = i10 < 0 ? l10.top : l10.bottom; + else { + var f10 = e23.viewState.lineBlockAt(o10); + null == s10 && (s10 = Math.min(c10.right - c10.left, e23.defaultCharacterWidth * (o10 - f10.from))), a10 = (i10 < 0 ? f10.top : f10.bottom) + u10; + } + for (var d10 = c10.left + s10, h10 = null != r10 ? r10 : e23.viewState.heightOracle.textHeight >> 1, v10 = 0; ; v10 += 10) { + var p10 = a10 + (h10 + v10) * i10, m10 = vU(e23, { x: d10, y: p10 }, false, i10); + if (p10 < c10.top || p10 > c10.bottom || (i10 < 0 ? m10 < o10 : m10 > o10)) { + var g10 = e23.docView.coordsForChar(m10), y10 = !g10 || p10 < g10.top ? -1 : 1; + return $F.cursor(m10, y10, void 0, s10); + } + } + }(this, e21, t10, n10)); + } }, { key: "domAtPos", value: function(e21) { + return this.docView.domAtPos(e21); + } }, { key: "posAtDOM", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + return this.docView.posFromDOM(e21, t10); + } }, { key: "posAtCoords", value: function(e21) { + var t10 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + return this.readMeasured(), vU(this, e21, t10); + } }, { key: "coordsAtPos", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; + this.readMeasured(); + var n10 = this.docView.coordsAt(e21, t10); + if (!n10 || n10.left == n10.right) + return n10; + var r10 = this.state.doc.lineAt(e21), o10 = this.bidiSpans(r10); + return nH(n10, o10[yW.find(o10, e21 - r10.from, -1, t10)].dir == rW.LTR == t10 > 0); + } }, { key: "coordsForChar", value: function(e21) { + return this.readMeasured(), this.docView.coordsForChar(e21); + } }, { key: "defaultCharacterWidth", get: function() { + return this.viewState.heightOracle.charWidth; + } }, { key: "defaultLineHeight", get: function() { + return this.viewState.heightOracle.lineHeight; + } }, { key: "textDirection", get: function() { + return this.viewState.defaultTextDirection; + } }, { key: "textDirectionAt", value: function(e21) { + return !this.state.facet(RW) || e21 < this.viewport.from || e21 > this.viewport.to ? this.textDirection : (this.readMeasured(), this.docView.textDirectionAt(e21)); + } }, { key: "lineWrapping", get: function() { + return this.viewState.heightOracle.lineWrapping; + } }, { key: "bidiSpans", value: function(e21) { + if (e21.length > BJ) + return jW(e21.length); + var t10, n10, r10 = this.textDirectionAt(e21.from), o10 = bo(this.bidiCache); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value; + if (i10.from == e21.from && i10.dir == r10 && (i10.fresh || bW(i10.isolates, t10 = QW(this, e21)))) + return i10.order; + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + t10 || (t10 = QW(this, e21)); + var a10 = function(e23, t11, n11) { + if (!e23) + return [new yW(0, 0, t11 == iW ? 1 : 0)]; + if (t11 == oW && !n11.length && !gW.test(e23)) + return jW(e23.length); + if (n11.length) + for (; e23.length > kW.length; ) + kW[kW.length] = 256; + var r11 = [], o11 = t11 == oW ? 0 : 1; + return xW(e23, o11, o11, n11, 0, e23.length, r11), r11; + }(e21.text, r10, t10); + return this.bidiCache.push(new FJ(e21.from, e21.to, r10, t10, true, a10)), a10; + } }, { key: "hasFocus", get: function() { + var e21; + return (this.dom.ownerDocument.hasFocus() || AH.safari && (null === (e21 = this.inputState) || void 0 === e21 ? void 0 : e21.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM; + } }, { key: "focus", value: function() { + var e21 = this; + this.observer.ignore(function() { + cH(e21.contentDOM), e21.docView.updateSelection(); + }); + } }, { key: "setRoot", value: function(e21) { + this._root != e21 && (this._root = e21, this.observer.setWindow((9 == e21.nodeType ? e21 : e21.ownerDocument).defaultView || window), this.mountStyles()); + } }, { key: "destroy", value: function() { + var e21, t10 = bo(this.plugins); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + e21.value.destroy(this); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + this.plugins = [], this.inputState.destroy(), this.docView.destroy(), this.dom.remove(), this.observer.destroy(), this.measureScheduled > -1 && this.win.cancelAnimationFrame(this.measureScheduled), this.destroyed = true; + } }, { key: "scrollSnapshot", value: function() { + var e21 = this.scrollDOM, t10 = e21.scrollTop, n10 = e21.scrollLeft, r10 = this.viewState.scrollAnchorAt(t10); + return DW.of(new IW($F.cursor(r10.from), "start", "start", r10.top - t10, n10, true)); + } }], [{ key: "scrollIntoView", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return DW.of(new IW("number" == typeof e21 ? $F.cursor(e21) : e21, t10.y, t10.x, t10.yMargin, t10.xMargin)); + } }, { key: "domEventHandlers", value: function(e21) { + return FW.define(function() { + return {}; + }, { eventHandlers: e21 }); + } }, { key: "domEventObservers", value: function(e21) { + return FW.define(function() { + return {}; + }, { eventObservers: e21 }); + } }, { key: "theme", value: function(e21, t10) { + var n10 = zV.newName(), r10 = [kJ.of(n10), ZW.of($J(".".concat(n10), e21))]; + return t10 && t10.dark && r10.push(wJ.of(true)), r10; + } }, { key: "baseTheme", value: function(e21) { + return LF.lowest(ZW.of($J("." + xJ, e21, CJ))); + } }, { key: "findFromDOM", value: function(e21) { + var t10, n10 = e21.querySelector(".cm-content"), r10 = n10 && pH.get(n10) || pH.get(e21); + return (null === (t10 = null == r10 ? void 0 : r10.rootView) || void 0 === t10 ? void 0 : t10.view) || null; + } }]), e20; + }(); + zJ.styleModule = ZW, zJ.inputHandler = PW, zJ.focusChangeEffect = TW, zJ.perLineTextDirection = RW, zJ.exceptionSink = EW, zJ.updateListener = AW, zJ.editable = zW, zJ.mouseSelectionStyle = MW, zJ.dragMovesSelection = OW, zJ.clickAddsSelectionRange = _W, zJ.decorations = UW, zJ.outerDecorations = JW, zJ.atomicRanges = KW, zJ.bidiIsolatedRanges = GW, zJ.scrollMargins = YW, zJ.darkTheme = wJ, zJ.cspNonce = MF.define({ combine: function(e20) { + return e20.length ? e20[0] : ""; + } }), zJ.contentAttributes = WW, zJ.editorAttributes = HW, zJ.lineWrapping = zJ.contentAttributes.of({ class: "cm-lineWrapping" }), zJ.announce = oV.define(); + var BJ = 4096; + var LJ = {}; + var FJ = function() { + function e20(t10, n10, r10, o10, i10, a10) { + No(this, e20), this.from = t10, this.to = n10, this.dir = r10, this.isolates = o10, this.fresh = i10, this.order = a10; + } + return Do(e20, null, [{ key: "update", value: function(t10, n10) { + if (n10.empty && !t10.some(function(e21) { + return e21.fresh; + })) + return t10; + for (var r10 = [], o10 = t10.length ? t10[t10.length - 1].dir : rW.LTR, i10 = Math.max(0, t10.length - 10); i10 < t10.length; i10++) { + var a10 = t10[i10]; + a10.dir != o10 || n10.touchesRange(a10.from, a10.to) || r10.push(new e20(n10.mapPos(a10.from, 1), n10.mapPos(a10.to, -1), a10.dir, a10.isolates, false, a10.order)); + } + return r10; + } }]), e20; + }(); + function VJ(e20, t10, n10) { + for (var r10 = e20.state.facet(t10), o10 = r10.length - 1; o10 >= 0; o10--) { + var i10 = r10[o10], a10 = "function" == typeof i10 ? i10(e20) : i10; + a10 && zH(a10, n10); + } + return n10; + } + var HJ = AH.mac ? "mac" : AH.windows ? "win" : AH.linux ? "linux" : "key"; + function WJ(e20, t10, n10) { + return t10.altKey && (e20 = "Alt-" + e20), t10.ctrlKey && (e20 = "Ctrl-" + e20), t10.metaKey && (e20 = "Meta-" + e20), false !== n10 && t10.shiftKey && (e20 = "Shift-" + e20), e20; + } + var UJ = LF.default(zJ.domEventHandlers({ keydown: function(e20, t10) { + return XJ(GJ(t10.state), e20, t10, "editor"); + } })); + var JJ = MF.define({ enables: UJ }); + var KJ = /* @__PURE__ */ new WeakMap(); + function GJ(e20) { + var t10 = e20.facet(JJ), n10 = KJ.get(t10); + return n10 || KJ.set(t10, n10 = function(e21) { + var t11, n11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : HJ, r10 = /* @__PURE__ */ Object.create(null), o10 = /* @__PURE__ */ Object.create(null), i10 = function(e23, t12) { + var n12 = o10[e23]; + if (null == n12) + o10[e23] = t12; + else if (n12 != t12) + throw new Error("Key binding " + e23 + " is used both as a regular binding and as a multi-stroke prefix"); + }, a10 = function(e23, t12, o11, a11, s11) { + for (var c11, l11, u11 = r10[e23] || (r10[e23] = /* @__PURE__ */ Object.create(null)), f11 = t12.split(/ (?!$)/).map(function(e24) { + return function(e25, t13) { + var n12, r11, o12, i11, a12 = e25.split(/-(?!$)/), s12 = a12[a12.length - 1]; + "Space" == s12 && (s12 = " "); + for (var c12 = 0; c12 < a12.length - 1; ++c12) { + var l12 = a12[c12]; + if (/^(cmd|meta|m)$/i.test(l12)) + i11 = true; + else if (/^a(lt)?$/i.test(l12)) + n12 = true; + else if (/^(c|ctrl|control)$/i.test(l12)) + r11 = true; + else if (/^s(hift)?$/i.test(l12)) + o12 = true; + else { + if (!/^mod$/i.test(l12)) + throw new Error("Unrecognized modifier name: " + l12); + "mac" == t13 ? i11 = true : r11 = true; + } + } + return n12 && (s12 = "Alt-" + s12), r11 && (s12 = "Ctrl-" + s12), i11 && (s12 = "Meta-" + s12), o12 && (s12 = "Shift-" + s12), s12; + }(e24, n11); + }), d11 = function() { + var t13 = f11.slice(0, h11).join(" "); + i10(t13, true), u11[t13] || (u11[t13] = { preventDefault: true, stopPropagation: false, run: [function(n12) { + var r11 = QJ = { view: n12, prefix: t13, scope: e23 }; + return setTimeout(function() { + QJ == r11 && (QJ = null); + }, YJ), true; + }] }); + }, h11 = 1; h11 < f11.length; h11++) + d11(); + var v11 = f11.join(" "); + i10(v11, false); + var p11 = u11[v11] || (u11[v11] = { preventDefault: false, stopPropagation: false, run: (null === (l11 = null === (c11 = u11._any) || void 0 === c11 ? void 0 : c11.run) || void 0 === l11 ? void 0 : l11.slice()) || [] }); + o11 && p11.run.push(o11), a11 && (p11.preventDefault = true), s11 && (p11.stopPropagation = true); + }, s10 = bo(e21); + try { + for (s10.s(); !(t11 = s10.n()).done; ) { + var c10 = t11.value, l10 = c10.scope ? c10.scope.split(" ") : ["editor"]; + if (c10.any) { + var u10, f10 = bo(l10); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value, h10 = r10[d10] || (r10[d10] = /* @__PURE__ */ Object.create(null)); + for (var v10 in h10._any || (h10._any = { preventDefault: false, stopPropagation: false, run: [] }), h10) + h10[v10].run.push(c10.any); + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + } + var p10 = c10[n11] || c10.key; + if (p10) { + var m10, g10 = bo(l10); + try { + for (g10.s(); !(m10 = g10.n()).done; ) { + var y10 = m10.value; + a10(y10, p10, c10.run, c10.preventDefault, c10.stopPropagation), c10.shift && a10(y10, "Shift-" + p10, c10.shift, c10.preventDefault, c10.stopPropagation); + } + } catch (e23) { + g10.e(e23); + } finally { + g10.f(); + } + } + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + return r10; + }(t10.reduce(function(e21, t11) { + return e21.concat(t11); + }, []))), n10; + } + var QJ = null; + var YJ = 4e3; + function XJ(e20, t10, n10, r10) { + var o10 = function(e21) { + var t11 = !(HV && e21.metaKey && e21.shiftKey && !e21.ctrlKey && !e21.altKey || WV && e21.shiftKey && e21.key && 1 == e21.key.length || "Unidentified" == e21.key) && e21.key || (e21.shiftKey ? VV : FV)[e21.keyCode] || e21.key || "Unidentified"; + return "Esc" == t11 && (t11 = "Escape"), "Del" == t11 && (t11 = "Delete"), "Left" == t11 && (t11 = "ArrowLeft"), "Up" == t11 && (t11 = "ArrowUp"), "Right" == t11 && (t11 = "ArrowRight"), "Down" == t11 && (t11 = "ArrowDown"), t11; + }(t10), i10 = vF(dF(o10, 0)) == o10.length && " " != o10, a10 = "", s10 = false, c10 = false, l10 = false; + QJ && QJ.view == n10 && QJ.scope == r10 && (a10 = QJ.prefix + " ", CU.indexOf(t10.keyCode) < 0 && (c10 = true, QJ = null)); + var u10, f10, d10 = /* @__PURE__ */ new Set(), h10 = function(e21) { + if (e21) { + var r11, o11 = bo(e21.run); + try { + for (o11.s(); !(r11 = o11.n()).done; ) { + var i11 = r11.value; + if (!d10.has(i11) && (d10.add(i11), i11(n10, t10))) + return e21.stopPropagation && (l10 = true), true; + } + } catch (e23) { + o11.e(e23); + } finally { + o11.f(); + } + e21.preventDefault && (e21.stopPropagation && (l10 = true), c10 = true); + } + return false; + }, v10 = e20[r10]; + return v10 && (h10(v10[a10 + WJ(o10, t10, !i10)]) ? s10 = true : i10 && (t10.altKey || t10.metaKey || t10.ctrlKey) && !(AH.windows && t10.ctrlKey && t10.altKey) && (u10 = FV[t10.keyCode]) && u10 != o10 ? (h10(v10[a10 + WJ(u10, t10, true)]) || t10.shiftKey && (f10 = VV[t10.keyCode]) != o10 && f10 != u10 && h10(v10[a10 + WJ(f10, t10, false)])) && (s10 = true) : i10 && t10.shiftKey && h10(v10[a10 + WJ(o10, t10, true)]) && (s10 = true), !s10 && h10(v10._any) && (s10 = true)), c10 && (s10 = true), s10 && l10 && t10.stopPropagation(), s10; + } + var ZJ = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.className = t10, this.left = n10, this.top = r10, this.width = o10, this.height = i10; + } + return Do(e20, [{ key: "draw", value: function() { + var e21 = document.createElement("div"); + return e21.className = this.className, this.adjust(e21), e21; + } }, { key: "update", value: function(e21, t10) { + return t10.className == this.className && (this.adjust(e21), true); + } }, { key: "adjust", value: function(e21) { + e21.style.left = this.left + "px", e21.style.top = this.top + "px", null != this.width && (e21.style.width = this.width + "px"), e21.style.height = this.height + "px"; + } }, { key: "eq", value: function(e21) { + return this.left == e21.left && this.top == e21.top && this.width == e21.width && this.height == e21.height && this.className == e21.className; + } }], [{ key: "forRange", value: function(t10, n10, r10) { + if (r10.empty) { + var o10 = t10.coordsAtPos(r10.head, r10.assoc || 1); + if (!o10) + return []; + var i10 = eK(t10); + return [new e20(n10, o10.left - i10.left, o10.top - i10.top, null, o10.bottom - o10.top)]; + } + return nK(t10, n10, r10); + } }]), e20; + }(); + function eK(e20) { + var t10 = e20.scrollDOM.getBoundingClientRect(); + return { left: (e20.textDirection == rW.LTR ? t10.left : t10.right - e20.scrollDOM.clientWidth * e20.scaleX) - e20.scrollDOM.scrollLeft * e20.scaleX, top: t10.top - e20.scrollDOM.scrollTop * e20.scaleY }; + } + function tK(e20, t10, n10) { + var r10 = $F.cursor(t10); + return { from: Math.max(n10.from, e20.moveToLineBoundary(r10, false, true).from), to: Math.min(n10.to, e20.moveToLineBoundary(r10, true, true).from), type: JH.Text }; + } + function nK(e20, t10, n10) { + if (n10.to <= e20.viewport.from || n10.from >= e20.viewport.to) + return []; + var r10 = Math.max(n10.from, e20.viewport.from), o10 = Math.min(n10.to, e20.viewport.to), i10 = e20.textDirection == rW.LTR, a10 = e20.contentDOM, s10 = a10.getBoundingClientRect(), c10 = eK(e20), l10 = a10.querySelector(".cm-line"), u10 = l10 && window.getComputedStyle(l10), f10 = s10.left + (u10 ? parseInt(u10.paddingLeft) + Math.min(0, parseInt(u10.textIndent)) : 0), d10 = s10.right - (u10 ? parseInt(u10.paddingRight) : 0), h10 = mU(e20, r10), v10 = mU(e20, o10), p10 = h10.type == JH.Text ? h10 : null, m10 = v10.type == JH.Text ? v10 : null; + if (p10 && (e20.lineWrapping || h10.widgetLineBreaks) && (p10 = tK(e20, r10, p10)), m10 && (e20.lineWrapping || v10.widgetLineBreaks) && (m10 = tK(e20, o10, m10)), p10 && m10 && p10.from == m10.from) + return w10(x10(n10.from, n10.to, p10)); + var g10 = p10 ? x10(n10.from, null, p10) : j10(h10, false), y10 = m10 ? x10(null, n10.to, m10) : j10(v10, true), b10 = []; + return (p10 || h10).to < (m10 || v10).from - (p10 && m10 ? 1 : 0) || h10.widgetLineBreaks > 1 && g10.bottom + e20.defaultLineHeight / 2 < y10.top ? b10.push(k10(f10, g10.bottom, d10, y10.top)) : g10.bottom < y10.top && e20.elementAtHeight((g10.bottom + y10.top) / 2).type == JH.Text && (g10.bottom = y10.top = (g10.bottom + y10.top) / 2), w10(g10).concat(b10).concat(w10(y10)); + function k10(e21, n11, r11, o11) { + return new ZJ(t10, e21 - c10.left, n11 - c10.top - 0.01, r11 - e21, o11 - n11 + 0.01); + } + function w10(e21) { + for (var t11 = e21.top, n11 = e21.bottom, r11 = e21.horizontal, o11 = [], i11 = 0; i11 < r11.length; i11 += 2) + o11.push(k10(r11[i11], t11, r11[i11 + 1], n11)); + return o11; + } + function x10(t11, n11, r11) { + var o11 = 1e9, a11 = -1e9, s11 = []; + function c11(t12, n12, c12, l12, u12) { + var h12 = e20.coordsAtPos(t12, t12 == r11.to ? -2 : 2), v12 = e20.coordsAtPos(c12, c12 == r11.from ? 2 : -2); + h12 && v12 && (o11 = Math.min(h12.top, v12.top, o11), a11 = Math.max(h12.bottom, v12.bottom, a11), u12 == rW.LTR ? s11.push(i10 && n12 ? f10 : h12.left, i10 && l12 ? d10 : v12.right) : s11.push(!i10 && l12 ? f10 : v12.left, !i10 && n12 ? d10 : h12.right)); + } + var l11, u11 = null != t11 ? t11 : r11.from, h11 = null != n11 ? n11 : r11.to, v11 = bo(e20.visibleRanges); + try { + for (v11.s(); !(l11 = v11.n()).done; ) { + var p11 = l11.value; + if (p11.to > u11 && p11.from < h11) + for (var m11 = Math.max(p11.from, u11), g11 = Math.min(p11.to, h11); ; ) { + var y11, b11 = e20.state.doc.lineAt(m11), k11 = bo(e20.bidiSpans(b11)); + try { + for (k11.s(); !(y11 = k11.n()).done; ) { + var w11 = y11.value, x11 = w11.from + b11.from, j11 = w11.to + b11.from; + if (x11 >= g11) + break; + j11 > m11 && c11(Math.max(x11, m11), null == t11 && x11 <= u11, Math.min(j11, g11), null == n11 && j11 >= h11, w11.dir); + } + } catch (e21) { + k11.e(e21); + } finally { + k11.f(); + } + if ((m11 = b11.to + 1) >= g11) + break; + } + } + } catch (e21) { + v11.e(e21); + } finally { + v11.f(); + } + return 0 == s11.length && c11(u11, null == t11, h11, null == n11, e20.textDirection), { top: o11, bottom: a11, horizontal: s11 }; + } + function j10(e21, t11) { + var n11 = s10.top + (t11 ? e21.top : e21.bottom); + return { top: n11, bottom: n11, horizontal: [] }; + } + } + var rK = function() { + function e20(t10, n10) { + No(this, e20), this.view = t10, this.layer = n10, this.drawn = [], this.scaleX = 1, this.scaleY = 1, this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) }, this.dom = t10.scrollDOM.appendChild(document.createElement("div")), this.dom.classList.add("cm-layer"), n10.above && this.dom.classList.add("cm-layer-above"), n10.class && this.dom.classList.add(n10.class), this.scale(), this.dom.setAttribute("aria-hidden", "true"), this.setOrder(t10.state), t10.requestMeasure(this.measureReq), n10.mount && n10.mount(this.dom, t10); + } + return Do(e20, [{ key: "update", value: function(e21) { + e21.startState.facet(oK) != e21.state.facet(oK) && this.setOrder(e21.state), (this.layer.update(e21, this.dom) || e21.geometryChanged) && (this.scale(), e21.view.requestMeasure(this.measureReq)); + } }, { key: "setOrder", value: function(e21) { + for (var t10 = 0, n10 = e21.facet(oK); t10 < n10.length && n10[t10] != this.layer; ) + t10++; + this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - t10); + } }, { key: "measure", value: function() { + return this.layer.markers(this.view); + } }, { key: "scale", value: function() { + var e21 = this.view, t10 = e21.scaleX, n10 = e21.scaleY; + t10 == this.scaleX && n10 == this.scaleY || (this.scaleX = t10, this.scaleY = n10, this.dom.style.transform = "scale(".concat(1 / t10, ", ").concat(1 / n10, ")")); + } }, { key: "draw", value: function(e21) { + var t10 = this; + if (e21.length != this.drawn.length || e21.some(function(e23, n11) { + return r11 = e23, o11 = t10.drawn[n11], !(r11.constructor == o11.constructor && r11.eq(o11)); + var r11, o11; + })) { + var n10, r10 = this.dom.firstChild, o10 = 0, i10 = bo(e21); + try { + for (i10.s(); !(n10 = i10.n()).done; ) { + var a10 = n10.value; + a10.update && r10 && a10.constructor && this.drawn[o10].constructor && a10.update(r10, this.drawn[o10]) ? (r10 = r10.nextSibling, o10++) : this.dom.insertBefore(a10.draw(), r10); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + for (; r10; ) { + var s10 = r10.nextSibling; + r10.remove(), r10 = s10; + } + this.drawn = e21; + } + } }, { key: "destroy", value: function() { + this.layer.destroy && this.layer.destroy(this.dom, this.view), this.dom.remove(); + } }]), e20; + }(); + var oK = MF.define(); + function iK(e20) { + return [FW.define(function(t10) { + return new rK(t10, e20); + }), oK.of(e20)]; + } + var aK = !AH.ios; + var sK = MF.define({ combine: function(e20) { + return gV(e20, { cursorBlinkRate: 1200, drawRangeCursor: true }, { cursorBlinkRate: function(e21, t10) { + return Math.min(e21, t10); + }, drawRangeCursor: function(e21, t10) { + return e21 || t10; + } }); + } }); + function cK() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [sK.of(e20), uK, dK, vK, NW.of(true)]; + } + function lK(e20) { + return e20.startState.facet(sK) != e20.state.facet(sK); + } + var uK = iK({ above: true, markers: function(e20) { + var t10, n10 = e20.state, r10 = n10.facet(sK), o10 = [], i10 = bo(n10.selection.ranges); + try { + for (i10.s(); !(t10 = i10.n()).done; ) { + var a10 = t10.value, s10 = a10 == n10.selection.main; + if (a10.empty ? !s10 || aK : r10.drawRangeCursor) { + var c10, l10 = s10 ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", u10 = a10.empty ? a10 : $F.cursor(a10.head, a10.head > a10.anchor ? -1 : 1), f10 = bo(ZJ.forRange(e20, l10, u10)); + try { + for (f10.s(); !(c10 = f10.n()).done; ) { + var d10 = c10.value; + o10.push(d10); + } + } catch (e21) { + f10.e(e21); + } finally { + f10.f(); + } + } + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + return o10; + }, update: function(e20, t10) { + e20.transactions.some(function(e21) { + return e21.selection; + }) && (t10.style.animationName = "cm-blink" == t10.style.animationName ? "cm-blink2" : "cm-blink"); + var n10 = lK(e20); + return n10 && fK(e20.state, t10), e20.docChanged || e20.selectionSet || n10; + }, mount: function(e20, t10) { + fK(t10.state, e20); + }, class: "cm-cursorLayer" }); + function fK(e20, t10) { + t10.style.animationDuration = e20.facet(sK).cursorBlinkRate + "ms"; + } + var dK = iK({ above: false, markers: function(e20) { + return e20.state.selection.ranges.map(function(t10) { + return t10.empty ? [] : ZJ.forRange(e20, "cm-selectionBackground", t10); + }).reduce(function(e21, t10) { + return e21.concat(t10); + }); + }, update: function(e20, t10) { + return e20.docChanged || e20.selectionSet || e20.viewportChanged || lK(e20); + }, class: "cm-selectionLayer" }); + var hK = { ".cm-line": { "& ::selection": { backgroundColor: "transparent !important" }, "&::selection": { backgroundColor: "transparent !important" } } }; + aK && (hK[".cm-line"].caretColor = "transparent !important", hK[".cm-content"] = { caretColor: "transparent !important" }); + var vK = LF.highest(zJ.theme(hK)); + var pK = oV.define({ map: function(e20, t10) { + return null == e20 ? null : t10.mapPos(e20); + } }); + var mK = NF.define({ create: function() { + return null; + }, update: function(e20, t10) { + return null != e20 && (e20 = t10.changes.mapPos(e20)), t10.effects.reduce(function(e21, t11) { + return t11.is(pK) ? t11.value : e21; + }, e20); + } }); + var gK = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.view = t10, this.cursor = null, this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) }; + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10, n10 = e21.state.field(mK); + null == n10 ? null != this.cursor && (null === (t10 = this.cursor) || void 0 === t10 || t10.remove(), this.cursor = null) : (this.cursor || (this.cursor = this.view.scrollDOM.appendChild(document.createElement("div")), this.cursor.className = "cm-dropCursor"), (e21.startState.field(mK) != n10 || e21.docChanged || e21.geometryChanged) && this.view.requestMeasure(this.measureReq)); + } }, { key: "readPos", value: function() { + var e21 = this.view, t10 = e21.state.field(mK), n10 = null != t10 && e21.coordsAtPos(t10); + if (!n10) + return null; + var r10 = e21.scrollDOM.getBoundingClientRect(); + return { left: n10.left - r10.left + e21.scrollDOM.scrollLeft * e21.scaleX, top: n10.top - r10.top + e21.scrollDOM.scrollTop * e21.scaleY, height: n10.bottom - n10.top }; + } }, { key: "drawCursor", value: function(e21) { + if (this.cursor) { + var t10 = this.view, n10 = t10.scaleX, r10 = t10.scaleY; + e21 ? (this.cursor.style.left = e21.left / n10 + "px", this.cursor.style.top = e21.top / r10 + "px", this.cursor.style.height = e21.height / r10 + "px") : this.cursor.style.left = "-100000px"; + } + } }, { key: "destroy", value: function() { + this.cursor && this.cursor.remove(); + } }, { key: "setDropPos", value: function(e21) { + this.view.state.field(mK) != e21 && this.view.dispatch({ effects: pK.of(e21) }); + } }]), e20; + }(), { eventObservers: { dragover: function(e20) { + this.setDropPos(this.view.posAtCoords({ x: e20.clientX, y: e20.clientY })); + }, dragleave: function(e20) { + e20.target != this.view.contentDOM && this.view.contentDOM.contains(e20.relatedTarget) || this.setDropPos(null); + }, dragend: function() { + this.setDropPos(null); + }, drop: function() { + this.setDropPos(null); + } } }); + function yK(e20, t10, n10, r10, o10) { + t10.lastIndex = 0; + for (var i10, a10 = e20.iterRange(n10, r10), s10 = n10; !a10.next().done; s10 += a10.value.length) + if (!a10.lineBreak) + for (; i10 = t10.exec(a10.value); ) + o10(s10 + i10.index, i10); + } + var bK = function() { + function e20(t10) { + No(this, e20); + var n10 = t10.regexp, r10 = t10.decoration, o10 = t10.decorate, i10 = t10.boundary, a10 = t10.maxLength, s10 = void 0 === a10 ? 1e3 : a10; + if (!n10.global) + throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set"); + if (this.regexp = n10, o10) + this.addMatch = function(e21, t11, n11, r11) { + return o10(r11, n11, n11 + e21[0].length, e21, t11); + }; + else if ("function" == typeof r10) + this.addMatch = function(e21, t11, n11, o11) { + var i11 = r10(e21, t11, n11); + i11 && o11(n11, n11 + e21[0].length, i11); + }; + else { + if (!r10) + throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator"); + this.addMatch = function(e21, t11, n11, o11) { + return o11(n11, n11 + e21[0].length, r10); + }; + } + this.boundary = i10, this.maxLength = s10; + } + return Do(e20, [{ key: "createDeco", value: function(e21) { + var t10, n10 = this, r10 = new jV(), o10 = r10.add.bind(r10), i10 = bo(function(e23, t11) { + var n11 = e23.visibleRanges; + if (1 == n11.length && n11[0].from == e23.viewport.from && n11[0].to == e23.viewport.to) + return n11; + var r11, o11 = [], i11 = bo(n11); + try { + for (i11.s(); !(r11 = i11.n()).done; ) { + var a11 = r11.value, s11 = a11.from, c11 = a11.to; + s11 = Math.max(e23.state.doc.lineAt(s11).from, s11 - t11), c11 = Math.min(e23.state.doc.lineAt(c11).to, c11 + t11), o11.length && o11[o11.length - 1].to >= s11 ? o11[o11.length - 1].to = c11 : o11.push({ from: s11, to: c11 }); + } + } catch (e24) { + i11.e(e24); + } finally { + i11.f(); + } + return o11; + }(e21, this.maxLength)); + try { + for (i10.s(); !(t10 = i10.n()).done; ) { + var a10 = t10.value, s10 = a10.from, c10 = a10.to; + yK(e21.state.doc, this.regexp, s10, c10, function(t11, r11) { + return n10.addMatch(r11, e21, t11, o10); + }); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + return r10.finish(); + } }, { key: "updateDeco", value: function(e21, t10) { + var n10 = 1e9, r10 = -1; + return e21.docChanged && e21.changes.iterChanges(function(t11, o10, i10, a10) { + a10 > e21.view.viewport.from && i10 < e21.view.viewport.to && (n10 = Math.min(i10, n10), r10 = Math.max(a10, r10)); + }), e21.viewportChanged || r10 - n10 > 1e3 ? this.createDeco(e21.view) : r10 > -1 ? this.updateRange(e21.view, t10.map(e21.changes), n10, r10) : t10; + } }, { key: "updateRange", value: function(e21, t10, n10, r10) { + var o10, i10 = this, a10 = bo(e21.visibleRanges); + try { + var s10 = function() { + var a11 = o10.value, s11 = Math.max(a11.from, n10), c10 = Math.min(a11.to, r10); + if (c10 > s11) { + var l10 = e21.state.doc.lineAt(s11), u10 = l10.to < c10 ? e21.state.doc.lineAt(c10) : l10, f10 = Math.max(a11.from, l10.from), d10 = Math.min(a11.to, u10.to); + if (i10.boundary) { + for (; s11 > l10.from; s11--) + if (i10.boundary.test(l10.text[s11 - 1 - l10.from])) { + f10 = s11; + break; + } + for (; c10 < u10.to; c10++) + if (i10.boundary.test(u10.text[c10 - u10.from])) { + d10 = c10; + break; + } + } + var h10, v10 = [], p10 = function(e23, t11, n11) { + return v10.push(n11.range(e23, t11)); + }; + if (l10 == u10) + for (i10.regexp.lastIndex = f10 - l10.from; (h10 = i10.regexp.exec(l10.text)) && h10.index < d10 - l10.from; ) + i10.addMatch(h10, e21, h10.index + l10.from, p10); + else + yK(e21.state.doc, i10.regexp, f10, d10, function(t11, n11) { + return i10.addMatch(n11, e21, t11, p10); + }); + t10 = t10.update({ filterFrom: f10, filterTo: d10, filter: function(e23, t11) { + return e23 < f10 || t11 > d10; + }, add: v10 }); + } + }; + for (a10.s(); !(o10 = a10.n()).done; ) + s10(); + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + return t10; + } }]), e20; + }(); + var kK = null != /x/.unicode ? "gu" : "g"; + var wK = new RegExp("[\0-\b\n-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]", kK); + var xK = { 0: "null", 7: "bell", 8: "backspace", 10: "newline", 11: "vertical tab", 13: "carriage return", 27: "escape", 8203: "zero width space", 8204: "zero width non-joiner", 8205: "zero width joiner", 8206: "left-to-right mark", 8207: "right-to-left mark", 8232: "line separator", 8237: "left-to-right override", 8238: "right-to-left override", 8294: "left-to-right isolate", 8295: "right-to-left isolate", 8297: "pop directional isolate", 8233: "paragraph separator", 65279: "zero width no-break space", 65532: "object replacement" }; + var jK = null; + var SK = MF.define({ combine: function(e20) { + var t10 = gV(e20, { render: null, specialChars: wK, addSpecialChars: null }); + return (t10.replaceTabs = !function() { + var e21; + if (null == jK && "undefined" != typeof document && document.body) { + var t11 = document.body.style; + jK = null != (null !== (e21 = t11.tabSize) && void 0 !== e21 ? e21 : t11.MozTabSize); + } + return jK || false; + }()) && (t10.specialChars = new RegExp(" |" + t10.specialChars.source, kK)), t10.addSpecialChars && (t10.specialChars = new RegExp(t10.specialChars.source + "|" + t10.addSpecialChars.source, kK)), t10; + } }); + function CK() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [SK.of(e20), $K || ($K = FW.fromClass(function() { + function e21(t10) { + No(this, e21), this.view = t10, this.decorations = KH.none, this.decorationCache = /* @__PURE__ */ Object.create(null), this.decorator = this.makeDecorator(t10.state.facet(SK)), this.decorations = this.decorator.createDeco(t10); + } + return Do(e21, [{ key: "makeDecorator", value: function(e23) { + var t10 = this; + return new bK({ regexp: e23.specialChars, decoration: function(n10, r10, o10) { + var i10 = r10.state.doc, a10 = dF(n10[0], 0); + if (9 == a10) { + var s10 = i10.lineAt(o10), c10 = r10.state.tabSize, l10 = RV(s10.text, c10, o10 - s10.from); + return KH.replace({ widget: new OK((c10 - l10 % c10) * t10.view.defaultCharacterWidth / t10.view.scaleX) }); + } + return t10.decorationCache[a10] || (t10.decorationCache[a10] = KH.replace({ widget: new _K(e23, a10) })); + }, boundary: e23.replaceTabs ? void 0 : /[^]/ }); + } }, { key: "update", value: function(e23) { + var t10 = e23.state.facet(SK); + e23.startState.facet(SK) != t10 ? (this.decorator = this.makeDecorator(t10), this.decorations = this.decorator.createDeco(e23.view)) : this.decorations = this.decorator.updateDeco(e23, this.decorations); + } }]), e21; + }(), { decorations: function(e21) { + return e21.decorations; + } }))]; + } + var $K = null; + var _K = function(e20) { + function t10(e21, n10) { + var r10; + return No(this, t10), (r10 = _o(this, t10)).options = e21, r10.code = n10, r10; + } + return Ao(t10, UH), Do(t10, [{ key: "eq", value: function(e21) { + return e21.code == this.code; + } }, { key: "toDOM", value: function(e21) { + var t11 = function(e23) { + return e23 >= 32 ? "\u2022" : 10 == e23 ? "\u2424" : String.fromCharCode(9216 + e23); + }(this.code), n10 = e21.state.phrase("Control character") + " " + (xK[this.code] || "0x" + this.code.toString(16)), r10 = this.options.render && this.options.render(this.code, n10, t11); + if (r10) + return r10; + var o10 = document.createElement("span"); + return o10.textContent = t11, o10.title = n10, o10.setAttribute("aria-label", n10), o10.className = "cm-specialChar", o10; + } }, { key: "ignoreEvent", value: function() { + return false; + } }]), t10; + }(); + var OK = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).width = e21, n10; + } + return Ao(t10, UH), Do(t10, [{ key: "eq", value: function(e21) { + return e21.width == this.width; + } }, { key: "toDOM", value: function() { + var e21 = document.createElement("span"); + return e21.textContent = " ", e21.className = "cm-tab", e21.style.width = this.width + "px", e21; + } }, { key: "ignoreEvent", value: function() { + return false; + } }]), t10; + }(); + var MK = KH.line({ class: "cm-activeLine" }); + var EK = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.decorations = this.getDeco(t10); + } + return Do(e20, [{ key: "update", value: function(e21) { + (e21.docChanged || e21.selectionSet) && (this.decorations = this.getDeco(e21.view)); + } }, { key: "getDeco", value: function(e21) { + var t10, n10 = -1, r10 = [], o10 = bo(e21.state.selection.ranges); + try { + for (o10.s(); !(t10 = o10.n()).done; ) { + var i10 = t10.value, a10 = e21.lineBlockAt(i10.head); + a10.from > n10 && (r10.push(MK.range(a10.from)), n10 = a10.from); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return KH.set(r10); + } }]), e20; + }(), { decorations: function(e20) { + return e20.decorations; + } }); + var AK = 2e3; + function PK(e20, t10) { + var n10 = e20.posAtCoords({ x: t10.clientX, y: t10.clientY }, false), r10 = e20.state.doc.lineAt(n10), o10 = n10 - r10.from, i10 = o10 > AK ? -1 : o10 == r10.length ? function(e21, t11) { + var n11 = e21.coordsAtPos(e21.viewport.from); + return n11 ? Math.round(Math.abs((n11.left - t11) / e21.defaultCharacterWidth)) : -1; + }(e20, t10.clientX) : RV(r10.text, e20.state.tabSize, n10 - r10.from); + return { line: r10.number, col: i10, off: o10 }; + } + function TK(e20, t10) { + var n10 = PK(e20, t10), r10 = e20.state.selection; + return n10 ? { update: function(e21) { + if (e21.docChanged) { + var t11 = e21.changes.mapPos(e21.startState.doc.line(n10.line).from), o10 = e21.state.doc.lineAt(t11); + n10 = { line: o10.number, col: n10.col, off: Math.min(n10.off, o10.length) }, r10 = r10.map(e21.changes); + } + }, get: function(t11, o10, i10) { + var a10 = PK(e20, t11); + if (!a10) + return r10; + var s10 = function(e21, t12, n11) { + var r11 = Math.min(t12.line, n11.line), o11 = Math.max(t12.line, n11.line), i11 = []; + if (t12.off > AK || n11.off > AK || t12.col < 0 || n11.col < 0) + for (var a11 = Math.min(t12.off, n11.off), s11 = Math.max(t12.off, n11.off), c10 = r11; c10 <= o11; c10++) { + var l10 = e21.doc.line(c10); + l10.length <= s11 && i11.push($F.range(l10.from + a11, l10.to + s11)); + } + else + for (var u10 = Math.min(t12.col, n11.col), f10 = Math.max(t12.col, n11.col), d10 = r11; d10 <= o11; d10++) { + var h10 = e21.doc.line(d10), v10 = NV(h10.text, u10, e21.tabSize, true); + if (v10 < 0) + i11.push($F.cursor(h10.to)); + else { + var p10 = NV(h10.text, f10, e21.tabSize); + i11.push($F.range(h10.from + v10, h10.from + p10)); + } + } + return i11; + }(e20.state, n10, a10); + return s10.length ? i10 ? $F.create(s10.concat(r10.ranges)) : $F.create(s10) : r10; + } } : null; + } + function RK(e20) { + var t10 = (null == e20 ? void 0 : e20.eventFilter) || function(e21) { + return e21.altKey && 0 == e21.button; + }; + return zJ.mouseSelectionStyle.of(function(e21, n10) { + return t10(n10) ? TK(e21, n10) : null; + }); + } + var NK = { Alt: [18, function(e20) { + return !!e20.altKey; + }], Control: [17, function(e20) { + return !!e20.ctrlKey; + }], Shift: [16, function(e20) { + return !!e20.shiftKey; + }], Meta: [91, function(e20) { + return !!e20.metaKey; + }] }; + var IK = { style: "cursor: crosshair" }; + function DK() { + var e20 = jo(NK[(arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).key || "Alt"], 2), t10 = e20[0], n10 = e20[1], r10 = FW.fromClass(function() { + function e21(t11) { + No(this, e21), this.view = t11, this.isDown = false; + } + return Do(e21, [{ key: "set", value: function(e23) { + this.isDown != e23 && (this.isDown = e23, this.view.update([])); + } }]), e21; + }(), { eventObservers: { keydown: function(e21) { + this.set(e21.keyCode == t10 || n10(e21)); + }, keyup: function(e21) { + e21.keyCode != t10 && n10(e21) || this.set(false); + }, mousemove: function(e21) { + this.set(n10(e21)); + } } }); + return [r10, zJ.contentAttributes.of(function(e21) { + var t11; + return (null === (t11 = e21.plugin(r10)) || void 0 === t11 ? void 0 : t11.isDown) ? IK : null; + })]; + } + var qK = "-10000px"; + var zK = function() { + function e20(t10, n10, r10) { + No(this, e20), this.facet = n10, this.createTooltipView = r10, this.input = t10.state.facet(n10), this.tooltips = this.input.filter(function(e21) { + return e21; + }), this.tooltipViews = this.tooltips.map(r10); + } + return Do(e20, [{ key: "update", value: function(e21, t10) { + var n10, r10 = e21.state.facet(this.facet), o10 = r10.filter(function(e23) { + return e23; + }); + if (r10 === this.input) { + var i10, a10 = bo(this.tooltipViews); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + s10.update && s10.update(e21); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + return false; + } + for (var c10 = [], l10 = t10 ? [] : null, u10 = 0; u10 < o10.length; u10++) { + var f10 = o10[u10], d10 = -1; + if (f10) { + for (var h10 = 0; h10 < this.tooltips.length; h10++) { + var v10 = this.tooltips[h10]; + v10 && v10.create == f10.create && (d10 = h10); + } + if (d10 < 0) + c10[u10] = this.createTooltipView(f10), l10 && (l10[u10] = !!f10.above); + else { + var p10 = c10[u10] = this.tooltipViews[d10]; + l10 && (l10[u10] = t10[d10]), p10.update && p10.update(e21); + } + } + } + var m10, g10 = bo(this.tooltipViews); + try { + for (g10.s(); !(m10 = g10.n()).done; ) { + var y10 = m10.value; + c10.indexOf(y10) < 0 && (y10.dom.remove(), null === (n10 = y10.destroy) || void 0 === n10 || n10.call(y10)); + } + } catch (e23) { + g10.e(e23); + } finally { + g10.f(); + } + return t10 && (l10.forEach(function(e23, n11) { + return t10[n11] = e23; + }), t10.length = l10.length), this.input = r10, this.tooltips = o10, this.tooltipViews = c10, true; + } }]), e20; + }(); + function BK(e20) { + var t10 = e20.win; + return { top: 0, left: 0, bottom: t10.innerHeight, right: t10.innerWidth }; + } + var LK = MF.define({ combine: function(e20) { + var t10, n10, r10; + return { position: AH.ios ? "absolute" : (null === (t10 = e20.find(function(e21) { + return e21.position; + })) || void 0 === t10 ? void 0 : t10.position) || "fixed", parent: (null === (n10 = e20.find(function(e21) { + return e21.parent; + })) || void 0 === n10 ? void 0 : n10.parent) || null, tooltipSpace: (null === (r10 = e20.find(function(e21) { + return e21.tooltipSpace; + })) || void 0 === r10 ? void 0 : r10.tooltipSpace) || BK }; + } }); + var FK = /* @__PURE__ */ new WeakMap(); + var VK = FW.fromClass(function() { + function e20(t10) { + var n10 = this; + No(this, e20), this.view = t10, this.above = [], this.inView = true, this.madeAbsolute = false, this.lastTransaction = 0, this.measureTimeout = -1; + var r10 = t10.state.facet(LK); + this.position = r10.position, this.parent = r10.parent, this.classes = t10.themeClasses, this.createContainer(), this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this }, this.manager = new zK(t10, UK, function(e21) { + return n10.createTooltip(e21); + }), this.intersectionObserver = "function" == typeof IntersectionObserver ? new IntersectionObserver(function(e21) { + Date.now() > n10.lastTransaction - 50 && e21.length > 0 && e21[e21.length - 1].intersectionRatio < 1 && n10.measureSoon(); + }, { threshold: [1] }) : null, this.observeIntersection(), t10.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this)), this.maybeMeasure(); + } + return Do(e20, [{ key: "createContainer", value: function() { + this.parent ? (this.container = document.createElement("div"), this.container.style.position = "relative", this.container.className = this.view.themeClasses, this.parent.appendChild(this.container)) : this.container = this.view.dom; + } }, { key: "observeIntersection", value: function() { + if (this.intersectionObserver) { + this.intersectionObserver.disconnect(); + var e21, t10 = bo(this.manager.tooltipViews); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + var n10 = e21.value; + this.intersectionObserver.observe(n10.dom); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + } + } }, { key: "measureSoon", value: function() { + var e21 = this; + this.measureTimeout < 0 && (this.measureTimeout = setTimeout(function() { + e21.measureTimeout = -1, e21.maybeMeasure(); + }, 50)); + } }, { key: "update", value: function(e21) { + e21.transactions.length && (this.lastTransaction = Date.now()); + var t10 = this.manager.update(e21, this.above); + t10 && this.observeIntersection(); + var n10 = t10 || e21.geometryChanged, r10 = e21.state.facet(LK); + if (r10.position != this.position && !this.madeAbsolute) { + this.position = r10.position; + var o10, i10 = bo(this.manager.tooltipViews); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + o10.value.dom.style.position = this.position; + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + n10 = true; + } + if (r10.parent != this.parent) { + this.parent && this.container.remove(), this.parent = r10.parent, this.createContainer(); + var a10, s10 = bo(this.manager.tooltipViews); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + this.container.appendChild(c10.dom); + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + n10 = true; + } else + this.parent && this.view.themeClasses != this.classes && (this.classes = this.container.className = this.view.themeClasses); + n10 && this.maybeMeasure(); + } }, { key: "createTooltip", value: function(e21) { + var t10 = e21.create(this.view); + if (t10.dom.classList.add("cm-tooltip"), e21.arrow && !t10.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) { + var n10 = document.createElement("div"); + n10.className = "cm-tooltip-arrow", t10.dom.appendChild(n10); + } + return t10.dom.style.position = this.position, t10.dom.style.top = qK, t10.dom.style.left = "0px", this.container.appendChild(t10.dom), t10.mount && t10.mount(this.view), t10; + } }, { key: "destroy", value: function() { + var e21, t10; + this.view.win.removeEventListener("resize", this.measureSoon); + var n10, r10 = bo(this.manager.tooltipViews); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + o10.dom.remove(), null === (e21 = o10.destroy) || void 0 === e21 || e21.call(o10); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + this.parent && this.container.remove(), null === (t10 = this.intersectionObserver) || void 0 === t10 || t10.disconnect(), clearTimeout(this.measureTimeout); + } }, { key: "readMeasure", value: function() { + var e21 = this, t10 = this.view.dom.getBoundingClientRect(), n10 = 1, r10 = 1, o10 = false; + if ("fixed" == this.position && this.manager.tooltipViews.length) { + var i10 = this.manager.tooltipViews[0].dom; + if (AH.gecko) + o10 = i10.offsetParent != this.container.ownerDocument.body; + else if (i10.style.top == qK && "0px" == i10.style.left) { + var a10 = i10.getBoundingClientRect(); + o10 = Math.abs(a10.top + 1e4) > 1 || Math.abs(a10.left) > 1; + } + } + if (o10 || "absolute" == this.position) + if (this.parent) { + var s10 = this.parent.getBoundingClientRect(); + s10.width && s10.height && (n10 = s10.width / this.parent.offsetWidth, r10 = s10.height / this.parent.offsetHeight); + } else { + var c10 = this.view.viewState; + n10 = c10.scaleX, r10 = c10.scaleY; + } + return { editor: t10, parent: this.parent ? this.container.getBoundingClientRect() : t10, pos: this.manager.tooltips.map(function(t11, n11) { + var r11 = e21.manager.tooltipViews[n11]; + return r11.getCoords ? r11.getCoords(t11.pos) : e21.view.coordsAtPos(t11.pos); + }), size: this.manager.tooltipViews.map(function(e23) { + return e23.dom.getBoundingClientRect(); + }), space: this.view.state.facet(LK).tooltipSpace(this.view), scaleX: n10, scaleY: r10, makeAbsolute: o10 }; + } }, { key: "writeMeasure", value: function(e21) { + var t10; + if (e21.makeAbsolute) { + this.madeAbsolute = true, this.position = "absolute"; + var n10, r10 = bo(this.manager.tooltipViews); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + n10.value.dom.style.position = "absolute"; + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + } + for (var o10 = e21.editor, i10 = e21.space, a10 = e21.scaleX, s10 = e21.scaleY, c10 = [], l10 = 0; l10 < this.manager.tooltips.length; l10++) { + var u10 = this.manager.tooltips[l10], f10 = this.manager.tooltipViews[l10], d10 = f10.dom, h10 = e21.pos[l10], v10 = e21.size[l10]; + if (!h10 || h10.bottom <= Math.max(o10.top, i10.top) || h10.top >= Math.min(o10.bottom, i10.bottom) || h10.right < Math.max(o10.left, i10.left) - 0.1 || h10.left > Math.min(o10.right, i10.right) + 0.1) + d10.style.top = qK; + else { + var p10 = u10.arrow ? f10.dom.querySelector(".cm-tooltip-arrow") : null, m10 = p10 ? 7 : 0, g10 = v10.right - v10.left, y10 = null !== (t10 = FK.get(f10)) && void 0 !== t10 ? t10 : v10.bottom - v10.top, b10 = f10.offset || WK, k10 = this.view.textDirection == rW.LTR, w10 = v10.width > i10.right - i10.left ? k10 ? i10.left : i10.right - v10.width : k10 ? Math.min(h10.left - (p10 ? 14 : 0) + b10.x, i10.right - g10) : Math.max(i10.left, h10.left - g10 + (p10 ? 14 : 0) - b10.x), x10 = this.above[l10]; + !u10.strictSide && (x10 ? h10.top - (v10.bottom - v10.top) - b10.y < i10.top : h10.bottom + (v10.bottom - v10.top) + b10.y > i10.bottom) && x10 == i10.bottom - h10.bottom > h10.top - i10.top && (x10 = this.above[l10] = !x10); + var j10 = (x10 ? h10.top - i10.top : i10.bottom - h10.bottom) - m10; + if (j10 < y10 && false !== f10.resize) { + if (j10 < this.view.defaultLineHeight) { + d10.style.top = qK; + continue; + } + FK.set(f10, y10), d10.style.height = (y10 = j10) / s10 + "px"; + } else + d10.style.height && (d10.style.height = ""); + var S10 = x10 ? h10.top - y10 - m10 - b10.y : h10.bottom + m10 + b10.y, C10 = w10 + g10; + if (true !== f10.overlap) { + var $10, _10 = bo(c10); + try { + for (_10.s(); !($10 = _10.n()).done; ) { + var O10 = $10.value; + O10.left < C10 && O10.right > w10 && O10.top < S10 + y10 && O10.bottom > S10 && (S10 = x10 ? O10.top - y10 - 2 - m10 : O10.bottom + m10 + 2); + } + } catch (e23) { + _10.e(e23); + } finally { + _10.f(); + } + } + if ("absolute" == this.position ? (d10.style.top = (S10 - e21.parent.top) / s10 + "px", d10.style.left = (w10 - e21.parent.left) / a10 + "px") : (d10.style.top = S10 / s10 + "px", d10.style.left = w10 / a10 + "px"), p10) { + var M10 = h10.left + (k10 ? b10.x : -b10.x) - (w10 + 14 - 7); + p10.style.left = M10 / a10 + "px"; + } + true !== f10.overlap && c10.push({ left: w10, top: S10, right: C10, bottom: S10 + y10 }), d10.classList.toggle("cm-tooltip-above", x10), d10.classList.toggle("cm-tooltip-below", !x10), f10.positioned && f10.positioned(e21.space); + } + } + } }, { key: "maybeMeasure", value: function() { + if (this.manager.tooltips.length && (this.view.inView && this.view.requestMeasure(this.measureReq), this.inView != this.view.inView && (this.inView = this.view.inView, !this.inView))) { + var e21, t10 = bo(this.manager.tooltipViews); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + e21.value.dom.style.top = qK; + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + } + } }]), e20; + }(), { eventObservers: { scroll: function() { + this.maybeMeasure(); + } } }); + var HK = zJ.baseTheme({ ".cm-tooltip": { zIndex: 100, boxSizing: "border-box" }, "&light .cm-tooltip": { border: "1px solid #bbb", backgroundColor: "#f5f5f5" }, "&light .cm-tooltip-section:not(:first-child)": { borderTop: "1px solid #bbb" }, "&dark .cm-tooltip": { backgroundColor: "#333338", color: "white" }, ".cm-tooltip-arrow": { height: "".concat(7, "px"), width: "".concat(14, "px"), position: "absolute", zIndex: -1, overflow: "hidden", "&:before, &:after": { content: "''", position: "absolute", width: 0, height: 0, borderLeft: "".concat(7, "px solid transparent"), borderRight: "".concat(7, "px solid transparent") }, ".cm-tooltip-above &": { bottom: "-".concat(7, "px"), "&:before": { borderTop: "".concat(7, "px solid #bbb") }, "&:after": { borderTop: "".concat(7, "px solid #f5f5f5"), bottom: "1px" } }, ".cm-tooltip-below &": { top: "-".concat(7, "px"), "&:before": { borderBottom: "".concat(7, "px solid #bbb") }, "&:after": { borderBottom: "".concat(7, "px solid #f5f5f5"), top: "1px" } } }, "&dark .cm-tooltip .cm-tooltip-arrow": { "&:before": { borderTopColor: "#333338", borderBottomColor: "#333338" }, "&:after": { borderTopColor: "transparent", borderBottomColor: "transparent" } } }); + var WK = { x: 0, y: 0 }; + var UK = MF.define({ enables: [VK, HK] }); + var JK = MF.define(); + var KK = function() { + function e20(t10) { + var n10 = this; + No(this, e20), this.view = t10, this.mounted = false, this.dom = document.createElement("div"), this.dom.classList.add("cm-tooltip-hover"), this.manager = new zK(t10, JK, function(e21) { + return n10.createHostedView(e21); + }); + } + return Do(e20, [{ key: "createHostedView", value: function(e21) { + var t10 = e21.create(this.view); + return t10.dom.classList.add("cm-tooltip-section"), this.dom.appendChild(t10.dom), this.mounted && t10.mount && t10.mount(this.view), t10; + } }, { key: "mount", value: function(e21) { + var t10, n10 = bo(this.manager.tooltipViews); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + r10.mount && r10.mount(e21); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + this.mounted = true; + } }, { key: "positioned", value: function(e21) { + var t10, n10 = bo(this.manager.tooltipViews); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + r10.positioned && r10.positioned(e21); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "update", value: function(e21) { + this.manager.update(e21); + } }, { key: "destroy", value: function() { + var e21, t10, n10 = bo(this.manager.tooltipViews); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + null === (e21 = r10.destroy) || void 0 === e21 || e21.call(r10); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "passProp", value: function(e21) { + var t10, n10 = void 0, r10 = bo(this.manager.tooltipViews); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + var o10 = t10.value[e21]; + if (void 0 !== o10) { + if (void 0 === n10) + n10 = o10; + else if (n10 !== o10) + return; + } + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + return n10; + } }, { key: "offset", get: function() { + return this.passProp("offset"); + } }, { key: "getCoords", get: function() { + return this.passProp("getCoords"); + } }, { key: "overlap", get: function() { + return this.passProp("overlap"); + } }, { key: "resize", get: function() { + return this.passProp("resize"); + } }], [{ key: "create", value: function(t10) { + return new e20(t10); + } }]), e20; + }(); + var GK = UK.compute([JK], function(e20) { + var t10 = e20.facet(JK).filter(function(e21) { + return e21; + }); + return 0 === t10.length ? null : { pos: Math.min.apply(Math, Bo(t10.map(function(e21) { + return e21.pos; + }))), end: Math.max.apply(Math, Bo(t10.map(function(e21) { + var t11; + return null !== (t11 = e21.end) && void 0 !== t11 ? t11 : e21.pos; + }))), create: KK.create, above: t10[0].above, arrow: t10.some(function(e21) { + return e21.arrow; + }) }; + }); + var QK = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.view = t10, this.source = n10, this.field = r10, this.setHover = o10, this.hoverTime = i10, this.hoverTimeout = -1, this.restartTimeout = -1, this.pending = null, this.lastMove = { x: 0, y: 0, target: t10.dom, time: 0 }, this.checkHover = this.checkHover.bind(this), t10.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this)), t10.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this)); + } + return Do(e20, [{ key: "update", value: function() { + var e21 = this; + this.pending && (this.pending = null, clearTimeout(this.restartTimeout), this.restartTimeout = setTimeout(function() { + return e21.startHover(); + }, 20)); + } }, { key: "active", get: function() { + return this.view.state.field(this.field); + } }, { key: "checkHover", value: function() { + if (this.hoverTimeout = -1, !this.active) { + var e21 = Date.now() - this.lastMove.time; + e21 < this.hoverTime ? this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - e21) : this.startHover(); + } + } }, { key: "startHover", value: function() { + var e21 = this; + clearTimeout(this.restartTimeout); + var t10 = this.view, n10 = this.lastMove, r10 = t10.docView.nearest(n10.target); + if (r10) { + var o10, i10 = 1; + if (r10 instanceof RH) + o10 = r10.posAtStart; + else { + if (null == (o10 = t10.posAtCoords(n10))) + return; + var a10 = t10.coordsAtPos(o10); + if (!a10 || n10.y < a10.top || n10.y > a10.bottom || n10.x < a10.left - t10.defaultCharacterWidth || n10.x > a10.right + t10.defaultCharacterWidth) + return; + var s10 = t10.bidiSpans(t10.state.doc.lineAt(o10)).find(function(e23) { + return e23.from <= o10 && e23.to >= o10; + }), c10 = s10 && s10.dir == rW.RTL ? -1 : 1; + i10 = n10.x < a10.left ? -c10 : c10; + } + var l10 = this.source(t10, o10, i10); + if (null == l10 ? void 0 : l10.then) { + var u10 = this.pending = { pos: o10 }; + l10.then(function(n11) { + e21.pending == u10 && (e21.pending = null, n11 && t10.dispatch({ effects: e21.setHover.of(n11) })); + }, function(e23) { + return qW(t10.state, e23, "hover tooltip"); + }); + } else + l10 && t10.dispatch({ effects: this.setHover.of(l10) }); + } + } }, { key: "tooltip", get: function() { + var e21 = this.view.plugin(VK), t10 = e21 ? e21.manager.tooltips.findIndex(function(e23) { + return e23.create == KK.create; + }) : -1; + return t10 > -1 ? e21.manager.tooltipViews[t10] : null; + } }, { key: "mousemove", value: function(e21) { + var t10; + this.lastMove = { x: e21.clientX, y: e21.clientY, target: e21.target, time: Date.now() }, this.hoverTimeout < 0 && (this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime)); + var n10 = this.active, r10 = this.tooltip; + if (n10 && r10 && !function(e23, t11) { + var n11 = e23.getBoundingClientRect(); + return t11.clientX >= n11.left - YK && t11.clientX <= n11.right + YK && t11.clientY >= n11.top - YK && t11.clientY <= n11.bottom + YK; + }(r10.dom, e21) || this.pending) { + var o10 = (n10 || this.pending).pos, i10 = null !== (t10 = null == n10 ? void 0 : n10.end) && void 0 !== t10 ? t10 : o10; + (o10 == i10 ? this.view.posAtCoords(this.lastMove) == o10 : function(e23, t11, n11, r11, o11, i11) { + var a10 = e23.scrollDOM.getBoundingClientRect(), s10 = e23.documentTop + e23.documentPadding.top + e23.contentHeight; + if (a10.left > r11 || a10.right < r11 || a10.top > o11 || Math.min(a10.bottom, s10) < o11) + return false; + var c10 = e23.posAtCoords({ x: r11, y: o11 }, false); + return c10 >= t11 && c10 <= n11; + }(this.view, o10, i10, e21.clientX, e21.clientY)) || (this.view.dispatch({ effects: this.setHover.of(null) }), this.pending = null); + } + } }, { key: "mouseleave", value: function(e21) { + if (clearTimeout(this.hoverTimeout), this.hoverTimeout = -1, this.active) { + var t10 = this.tooltip; + t10 && t10.dom.contains(e21.relatedTarget) ? this.watchTooltipLeave(t10.dom) : this.view.dispatch({ effects: this.setHover.of(null) }); + } + } }, { key: "watchTooltipLeave", value: function(e21) { + var t10 = this; + e21.addEventListener("mouseleave", function n10(r10) { + e21.removeEventListener("mouseleave", n10), t10.active && !t10.view.dom.contains(r10.relatedTarget) && t10.view.dispatch({ effects: t10.setHover.of(null) }); + }); + } }, { key: "destroy", value: function() { + clearTimeout(this.hoverTimeout), this.view.dom.removeEventListener("mouseleave", this.mouseleave), this.view.dom.removeEventListener("mousemove", this.mousemove); + } }]), e20; + }(); + var YK = 4; + function XK(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n10 = oV.define(), r10 = NF.define({ create: function() { + return null; + }, update: function(e21, r11) { + if (e21 && (t10.hideOnChange && (r11.docChanged || r11.selection) || t10.hideOn && t10.hideOn(r11, e21))) + return null; + if (e21 && r11.docChanged) { + var o10 = r11.changes.mapPos(e21.pos, -1, mF.TrackDel); + if (null == o10) + return null; + var i10 = Object.assign(/* @__PURE__ */ Object.create(null), e21); + i10.pos = o10, null != e21.end && (i10.end = r11.changes.mapPos(e21.end)), e21 = i10; + } + var a10, s10 = bo(r11.effects); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + c10.is(n10) && (e21 = c10.value), c10.is(eG) && (e21 = null); + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + return e21; + }, provide: function(e21) { + return JK.from(e21); + } }); + return [r10, FW.define(function(o10) { + return new QK(o10, e20, r10, n10, t10.hoverTime || 300); + }), GK]; + } + function ZK(e20, t10) { + var n10 = e20.plugin(VK); + if (!n10) + return null; + var r10 = n10.manager.tooltips.indexOf(t10); + return r10 < 0 ? null : n10.manager.tooltipViews[r10]; + } + var eG = oV.define(); + var tG = MF.define({ combine: function(e20) { + var t10, n10, r10, o10 = bo(e20); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + t10 = t10 || i10.topContainer, n10 = n10 || i10.bottomContainer; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return { topContainer: t10, bottomContainer: n10 }; + } }); + function nG(e20, t10) { + var n10 = e20.plugin(rG), r10 = n10 ? n10.specs.indexOf(t10) : -1; + return r10 > -1 ? n10.panels[r10] : null; + } + var rG = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.input = t10.state.facet(aG), this.specs = this.input.filter(function(e21) { + return e21; + }), this.panels = this.specs.map(function(e21) { + return e21(t10); + }); + var n10 = t10.state.facet(tG); + this.top = new oG(t10, true, n10.topContainer), this.bottom = new oG(t10, false, n10.bottomContainer), this.top.sync(this.panels.filter(function(e21) { + return e21.top; + })), this.bottom.sync(this.panels.filter(function(e21) { + return !e21.top; + })); + var r10, o10 = bo(this.panels); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + i10.dom.classList.add("cm-panel"), i10.mount && i10.mount(); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = e21.state.facet(tG); + this.top.container != t10.topContainer && (this.top.sync([]), this.top = new oG(e21.view, true, t10.topContainer)), this.bottom.container != t10.bottomContainer && (this.bottom.sync([]), this.bottom = new oG(e21.view, false, t10.bottomContainer)), this.top.syncClasses(), this.bottom.syncClasses(); + var n10 = e21.state.facet(aG); + if (n10 != this.input) { + var r10, o10 = n10.filter(function(e23) { + return e23; + }), i10 = [], a10 = [], s10 = [], c10 = [], l10 = bo(o10); + try { + for (l10.s(); !(r10 = l10.n()).done; ) { + var u10 = r10.value, f10 = this.specs.indexOf(u10), d10 = void 0; + f10 < 0 ? (d10 = u10(e21.view), c10.push(d10)) : (d10 = this.panels[f10]).update && d10.update(e21), i10.push(d10), (d10.top ? a10 : s10).push(d10); + } + } catch (e23) { + l10.e(e23); + } finally { + l10.f(); + } + this.specs = o10, this.panels = i10, this.top.sync(a10), this.bottom.sync(s10); + for (var h10 = 0, v10 = c10; h10 < v10.length; h10++) { + var p10 = v10[h10]; + p10.dom.classList.add("cm-panel"), p10.mount && p10.mount(); + } + } else { + var m10, g10 = bo(this.panels); + try { + for (g10.s(); !(m10 = g10.n()).done; ) { + var y10 = m10.value; + y10.update && y10.update(e21); + } + } catch (e23) { + g10.e(e23); + } finally { + g10.f(); + } + } + } }, { key: "destroy", value: function() { + this.top.sync([]), this.bottom.sync([]); + } }]), e20; + }(), { provide: function(e20) { + return zJ.scrollMargins.of(function(t10) { + var n10 = t10.plugin(e20); + return n10 && { top: n10.top.scrollMargin(), bottom: n10.bottom.scrollMargin() }; + }); + } }); + var oG = function() { + function e20(t10, n10, r10) { + No(this, e20), this.view = t10, this.top = n10, this.container = r10, this.dom = void 0, this.classes = "", this.panels = [], this.syncClasses(); + } + return Do(e20, [{ key: "sync", value: function(e21) { + var t10, n10 = bo(this.panels); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + r10.destroy && e21.indexOf(r10) < 0 && r10.destroy(); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + this.panels = e21, this.syncDOM(); + } }, { key: "syncDOM", value: function() { + if (0 != this.panels.length) { + if (!this.dom) { + this.dom = document.createElement("div"), this.dom.className = this.top ? "cm-panels cm-panels-top" : "cm-panels cm-panels-bottom", this.dom.style[this.top ? "top" : "bottom"] = "0"; + var e21 = this.container || this.view.dom; + e21.insertBefore(this.dom, this.top ? e21.firstChild : null); + } + var t10, n10 = this.dom.firstChild, r10 = bo(this.panels); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + var o10 = t10.value; + if (o10.dom.parentNode == this.dom) { + for (; n10 != o10.dom; ) + n10 = iG(n10); + n10 = n10.nextSibling; + } else + this.dom.insertBefore(o10.dom, n10); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + for (; n10; ) + n10 = iG(n10); + } else + this.dom && (this.dom.remove(), this.dom = void 0); + } }, { key: "scrollMargin", value: function() { + return !this.dom || this.container ? 0 : Math.max(0, this.top ? this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) : Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top); + } }, { key: "syncClasses", value: function() { + if (this.container && this.classes != this.view.themeClasses) { + var e21, t10 = bo(this.classes.split(" ")); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + var n10 = e21.value; + n10 && this.container.classList.remove(n10); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + var r10, o10 = bo((this.classes = this.view.themeClasses).split(" ")); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + i10 && this.container.classList.add(i10); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + } + } }]), e20; + }(); + function iG(e20) { + var t10 = e20.nextSibling; + return e20.remove(), t10; + } + var aG = MF.define({ enables: rG }); + var sG = function(e20) { + function t10() { + return No(this, t10), _o(this, t10, arguments); + } + return Ao(t10, yV), Do(t10, [{ key: "compare", value: function(e21) { + return this == e21 || this.constructor == e21.constructor && this.eq(e21); + } }, { key: "eq", value: function(e21) { + return false; + } }, { key: "destroy", value: function(e21) { + } }]), t10; + }(); + sG.prototype.elementClass = "", sG.prototype.toDOM = void 0, sG.prototype.mapMode = mF.TrackBefore, sG.prototype.startSide = sG.prototype.endSide = -1, sG.prototype.point = true; + var cG = MF.define(); + var lG = { class: "", renderEmptyElements: false, elementStyle: "", markers: function() { + return xV.empty; + }, lineMarker: function() { + return null; + }, widgetMarker: function() { + return null; + }, lineMarkerChange: null, initialSpacer: null, updateSpacer: null, domEventHandlers: {} }; + var uG = MF.define(); + function fG(e20) { + return [hG(), uG.of(Object.assign(Object.assign({}, lG), e20))]; + } + var dG = MF.define({ combine: function(e20) { + return e20.some(function(e21) { + return e21; + }); + } }); + function hG(e20) { + var t10 = [vG]; + return e20 && false === e20.fixed && t10.push(dG.of(true)), t10; + } + var vG = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.view = t10, this.prevViewport = t10.viewport, this.dom = document.createElement("div"), this.dom.className = "cm-gutters", this.dom.setAttribute("aria-hidden", "true"), this.dom.style.minHeight = this.view.contentHeight / this.view.scaleY + "px", this.gutters = t10.state.facet(uG).map(function(e21) { + return new yG(t10, e21); + }); + var n10, r10 = bo(this.gutters); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + this.dom.appendChild(o10.dom); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + this.fixed = !t10.state.facet(dG), this.fixed && (this.dom.style.position = "sticky"), this.syncGutters(false), t10.scrollDOM.insertBefore(this.dom, t10.contentDOM); + } + return Do(e20, [{ key: "update", value: function(e21) { + if (this.updateGutters(e21)) { + var t10 = this.prevViewport, n10 = e21.view.viewport, r10 = Math.min(t10.to, n10.to) - Math.max(t10.from, n10.from); + this.syncGutters(r10 < 0.8 * (n10.to - n10.from)); + } + e21.geometryChanged && (this.dom.style.minHeight = this.view.contentHeight + "px"), this.view.state.facet(dG) != !this.fixed && (this.fixed = !this.fixed, this.dom.style.position = this.fixed ? "sticky" : ""), this.prevViewport = e21.view.viewport; + } }, { key: "syncGutters", value: function(e21) { + var t10 = this, n10 = this.dom.nextSibling; + e21 && this.dom.remove(); + var r10, o10 = xV.iter(this.view.state.facet(cG), this.view.viewport.from), i10 = [], a10 = this.gutters.map(function(e23) { + return new gG(e23, t10.view.viewport, -t10.view.documentPadding.top); + }), s10 = bo(this.view.viewportLineBlocks); + try { + for (s10.s(); !(r10 = s10.n()).done; ) { + var c10 = r10.value; + if (i10.length && (i10 = []), Array.isArray(c10.type)) { + var l10, u10 = true, f10 = bo(c10.type); + try { + for (f10.s(); !(l10 = f10.n()).done; ) { + var d10 = l10.value; + if (d10.type == JH.Text && u10) { + mG(o10, i10, d10.from); + var h10, v10 = bo(a10); + try { + for (v10.s(); !(h10 = v10.n()).done; ) { + h10.value.line(this.view, d10, i10); + } + } catch (e23) { + v10.e(e23); + } finally { + v10.f(); + } + u10 = false; + } else if (d10.widget) { + var p10, m10 = bo(a10); + try { + for (m10.s(); !(p10 = m10.n()).done; ) { + p10.value.widget(this.view, d10); + } + } catch (e23) { + m10.e(e23); + } finally { + m10.f(); + } + } + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + } else if (c10.type == JH.Text) { + mG(o10, i10, c10.from); + var g10, y10 = bo(a10); + try { + for (y10.s(); !(g10 = y10.n()).done; ) { + g10.value.line(this.view, c10, i10); + } + } catch (e23) { + y10.e(e23); + } finally { + y10.f(); + } + } else if (c10.widget) { + var b10, k10 = bo(a10); + try { + for (k10.s(); !(b10 = k10.n()).done; ) { + b10.value.widget(this.view, c10); + } + } catch (e23) { + k10.e(e23); + } finally { + k10.f(); + } + } + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + var w10, x10 = bo(a10); + try { + for (x10.s(); !(w10 = x10.n()).done; ) { + w10.value.finish(); + } + } catch (e23) { + x10.e(e23); + } finally { + x10.f(); + } + e21 && this.view.scrollDOM.insertBefore(this.dom, n10); + } }, { key: "updateGutters", value: function(e21) { + var t10 = e21.startState.facet(uG), n10 = e21.state.facet(uG), r10 = e21.docChanged || e21.heightChanged || e21.viewportChanged || !xV.eq(e21.startState.facet(cG), e21.state.facet(cG), e21.view.viewport.from, e21.view.viewport.to); + if (t10 == n10) { + var o10, i10 = bo(this.gutters); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + o10.value.update(e21) && (r10 = true); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + } else { + r10 = true; + var a10, s10 = [], c10 = bo(n10); + try { + for (c10.s(); !(a10 = c10.n()).done; ) { + var l10 = a10.value, u10 = t10.indexOf(l10); + u10 < 0 ? s10.push(new yG(this.view, l10)) : (this.gutters[u10].update(e21), s10.push(this.gutters[u10])); + } + } catch (e23) { + c10.e(e23); + } finally { + c10.f(); + } + var f10, d10 = bo(this.gutters); + try { + for (d10.s(); !(f10 = d10.n()).done; ) { + var h10 = f10.value; + h10.dom.remove(), s10.indexOf(h10) < 0 && h10.destroy(); + } + } catch (e23) { + d10.e(e23); + } finally { + d10.f(); + } + for (var v10 = 0, p10 = s10; v10 < p10.length; v10++) { + var m10 = p10[v10]; + this.dom.appendChild(m10.dom); + } + this.gutters = s10; + } + return r10; + } }, { key: "destroy", value: function() { + var e21, t10 = bo(this.gutters); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + e21.value.destroy(); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + this.dom.remove(); + } }]), e20; + }(), { provide: function(e20) { + return zJ.scrollMargins.of(function(t10) { + var n10 = t10.plugin(e20); + return n10 && 0 != n10.gutters.length && n10.fixed ? t10.textDirection == rW.LTR ? { left: n10.dom.offsetWidth * t10.scaleX } : { right: n10.dom.offsetWidth * t10.scaleX } : null; + }); + } }); + function pG(e20) { + return Array.isArray(e20) ? e20 : [e20]; + } + function mG(e20, t10, n10) { + for (; e20.value && e20.from <= n10; ) + e20.from == n10 && t10.push(e20.value), e20.next(); + } + var gG = function() { + function e20(t10, n10, r10) { + No(this, e20), this.gutter = t10, this.height = r10, this.i = 0, this.cursor = xV.iter(t10.markers, n10.from); + } + return Do(e20, [{ key: "addElement", value: function(e21, t10, n10) { + var r10 = this.gutter, o10 = (t10.top - this.height) / e21.scaleY, i10 = t10.height / e21.scaleY; + if (this.i == r10.elements.length) { + var a10 = new bG(e21, i10, o10, n10); + r10.elements.push(a10), r10.dom.appendChild(a10.dom); + } else + r10.elements[this.i].update(e21, i10, o10, n10); + this.height = t10.bottom, this.i++; + } }, { key: "line", value: function(e21, t10, n10) { + var r10 = []; + mG(this.cursor, r10, t10.from), n10.length && (r10 = r10.concat(n10)); + var o10 = this.gutter.config.lineMarker(e21, t10, r10); + o10 && r10.unshift(o10); + var i10 = this.gutter; + (0 != r10.length || i10.config.renderEmptyElements) && this.addElement(e21, t10, r10); + } }, { key: "widget", value: function(e21, t10) { + var n10 = this.gutter.config.widgetMarker(e21, t10.widget, t10); + n10 && this.addElement(e21, t10, [n10]); + } }, { key: "finish", value: function() { + for (var e21 = this.gutter; e21.elements.length > this.i; ) { + var t10 = e21.elements.pop(); + e21.dom.removeChild(t10.dom), t10.destroy(); + } + } }]), e20; + }(); + var yG = function() { + function e20(t10, n10) { + var r10 = this; + No(this, e20), this.view = t10, this.config = n10, this.elements = [], this.spacer = null, this.dom = document.createElement("div"), this.dom.className = "cm-gutter" + (this.config.class ? " " + this.config.class : ""); + var o10 = function(e21) { + r10.dom.addEventListener(e21, function(o11) { + var i11, a10 = o11.target; + if (a10 != r10.dom && r10.dom.contains(a10)) { + for (; a10.parentNode != r10.dom; ) + a10 = a10.parentNode; + var s10 = a10.getBoundingClientRect(); + i11 = (s10.top + s10.bottom) / 2; + } else + i11 = o11.clientY; + var c10 = t10.lineBlockAtHeight(i11 - t10.documentTop); + n10.domEventHandlers[e21](t10, c10, o11) && o11.preventDefault(); + }); + }; + for (var i10 in n10.domEventHandlers) + o10(i10); + this.markers = pG(n10.markers(t10)), n10.initialSpacer && (this.spacer = new bG(t10, 0, 0, [n10.initialSpacer(t10)]), this.dom.appendChild(this.spacer.dom), this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none"); + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = this.markers; + if (this.markers = pG(this.config.markers(e21.view)), this.spacer && this.config.updateSpacer) { + var n10 = this.config.updateSpacer(this.spacer.markers[0], e21); + n10 != this.spacer.markers[0] && this.spacer.update(e21.view, 0, 0, [n10]); + } + var r10 = e21.view.viewport; + return !xV.eq(this.markers, t10, r10.from, r10.to) || !!this.config.lineMarkerChange && this.config.lineMarkerChange(e21); + } }, { key: "destroy", value: function() { + var e21, t10 = bo(this.elements); + try { + for (t10.s(); !(e21 = t10.n()).done; ) { + e21.value.destroy(); + } + } catch (e23) { + t10.e(e23); + } finally { + t10.f(); + } + } }]), e20; + }(); + var bG = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.height = -1, this.above = 0, this.markers = [], this.dom = document.createElement("div"), this.dom.className = "cm-gutterElement", this.update(t10, n10, r10, o10); + } + return Do(e20, [{ key: "update", value: function(e21, t10, n10, r10) { + this.height != t10 && (this.height = t10, this.dom.style.height = t10 + "px"), this.above != n10 && (this.dom.style.marginTop = (this.above = n10) ? n10 + "px" : ""), function(e23, t11) { + if (e23.length != t11.length) + return false; + for (var n11 = 0; n11 < e23.length; n11++) + if (!e23[n11].compare(t11[n11])) + return false; + return true; + }(this.markers, r10) || this.setMarkers(e21, r10); + } }, { key: "setMarkers", value: function(e21, t10) { + for (var n10 = "cm-gutterElement", r10 = this.dom.firstChild, o10 = 0, i10 = 0; ; ) { + var a10 = i10, s10 = o10 < t10.length ? t10[o10++] : null, c10 = false; + if (s10) { + var l10 = s10.elementClass; + l10 && (n10 += " " + l10); + for (var u10 = i10; u10 < this.markers.length; u10++) + if (this.markers[u10].compare(s10)) { + a10 = u10, c10 = true; + break; + } + } else + a10 = this.markers.length; + for (; i10 < a10; ) { + var f10 = this.markers[i10++]; + if (f10.toDOM) { + f10.destroy(r10); + var d10 = r10.nextSibling; + r10.remove(), r10 = d10; + } + } + if (!s10) + break; + s10.toDOM && (c10 ? r10 = r10.nextSibling : this.dom.insertBefore(s10.toDOM(e21), r10)), c10 && i10++; + } + this.dom.className = n10, this.markers = t10; + } }, { key: "destroy", value: function() { + this.setMarkers(null, []); + } }]), e20; + }(); + var kG = MF.define(); + var wG = MF.define({ combine: function(e20) { + return gV(e20, { formatNumber: String, domEventHandlers: {} }, { domEventHandlers: function(e21, t10) { + var n10 = Object.assign({}, e21), r10 = function() { + var e23 = n10[o10], r11 = t10[o10]; + n10[o10] = e23 ? function(t11, n11, o11) { + return e23(t11, n11, o11) || r11(t11, n11, o11); + } : r11; + }; + for (var o10 in t10) + r10(); + return n10; + } }); + } }); + var xG = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).number = e21, n10; + } + return Ao(t10, sG), Do(t10, [{ key: "eq", value: function(e21) { + return this.number == e21.number; + } }, { key: "toDOM", value: function() { + return document.createTextNode(this.number); + } }]), t10; + }(); + function jG(e20, t10) { + return e20.state.facet(wG).formatNumber(t10, e20.state); + } + var SG = uG.compute([wG], function(e20) { + return { class: "cm-lineNumbers", renderEmptyElements: false, markers: function(e21) { + return e21.state.facet(kG); + }, lineMarker: function(e21, t10, n10) { + return n10.some(function(e23) { + return e23.toDOM; + }) ? null : new xG(jG(e21, e21.state.doc.lineAt(t10.from).number)); + }, widgetMarker: function() { + return null; + }, lineMarkerChange: function(e21) { + return e21.startState.facet(wG) != e21.state.facet(wG); + }, initialSpacer: function(e21) { + return new xG(jG(e21, $G(e21.state.doc.lines))); + }, updateSpacer: function(e21, t10) { + var n10 = jG(t10.view, $G(t10.view.state.doc.lines)); + return n10 == e21.number ? e21 : new xG(n10); + }, domEventHandlers: e20.facet(wG).domEventHandlers }; + }); + function CG() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [wG.of(e20), hG(), SG]; + } + function $G(e20) { + for (var t10 = 9; t10 < e20; ) + t10 = 10 * t10 + 9; + return t10; + } + var _G = new (function(e20) { + function t10() { + var e21; + return No(this, t10), (e21 = _o(this, t10, arguments)).elementClass = "cm-activeLineGutter", e21; + } + return Ao(t10, sG), Do(t10); + }())(); + var OG = cG.compute(["selection"], function(e20) { + var t10, n10 = [], r10 = -1, o10 = bo(e20.selection.ranges); + try { + for (o10.s(); !(t10 = o10.n()).done; ) { + var i10 = t10.value, a10 = e20.doc.lineAt(i10.head).from; + a10 > r10 && (r10 = a10, n10.push(_G.range(a10))); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return xV.of(n10); + }); + var MG = 0; + var EG = Do(function e7(t10, n10) { + No(this, e7), this.from = t10, this.to = n10; + }); + var AG = function() { + function e20() { + var t10 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + No(this, e20), this.id = MG++, this.perNode = !!t10.perNode, this.deserialize = t10.deserialize || function() { + throw new Error("This node type doesn't define a deserialize function"); + }; + } + return Do(e20, [{ key: "add", value: function(e21) { + var t10 = this; + if (this.perNode) + throw new RangeError("Can't add per-node props to node types"); + return "function" != typeof e21 && (e21 = RG.match(e21)), function(n10) { + var r10 = e21(n10); + return void 0 === r10 ? null : [t10, r10]; + }; + } }]), e20; + }(); + AG.closedBy = new AG({ deserialize: function(e20) { + return e20.split(" "); + } }), AG.openedBy = new AG({ deserialize: function(e20) { + return e20.split(" "); + } }), AG.group = new AG({ deserialize: function(e20) { + return e20.split(" "); + } }), AG.contextHash = new AG({ perNode: true }), AG.lookAhead = new AG({ perNode: true }), AG.mounted = new AG({ perNode: true }); + var PG = function() { + function e20(t10, n10, r10) { + No(this, e20), this.tree = t10, this.overlay = n10, this.parser = r10; + } + return Do(e20, null, [{ key: "get", value: function(e21) { + return e21 && e21.props && e21.props[AG.mounted.id]; + } }]), e20; + }(); + var TG = /* @__PURE__ */ Object.create(null); + var RG = function() { + function e20(t10, n10, r10) { + var o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0; + No(this, e20), this.name = t10, this.props = n10, this.id = r10, this.flags = o10; + } + return Do(e20, [{ key: "prop", value: function(e21) { + return this.props[e21.id]; + } }, { key: "isTop", get: function() { + return (1 & this.flags) > 0; + } }, { key: "isSkipped", get: function() { + return (2 & this.flags) > 0; + } }, { key: "isError", get: function() { + return (4 & this.flags) > 0; + } }, { key: "isAnonymous", get: function() { + return (8 & this.flags) > 0; + } }, { key: "is", value: function(e21) { + if ("string" == typeof e21) { + if (this.name == e21) + return true; + var t10 = this.prop(AG.group); + return !!t10 && t10.indexOf(e21) > -1; + } + return this.id == e21; + } }], [{ key: "define", value: function(t10) { + var n10 = t10.props && t10.props.length ? /* @__PURE__ */ Object.create(null) : TG, r10 = (t10.top ? 1 : 0) | (t10.skipped ? 2 : 0) | (t10.error ? 4 : 0) | (null == t10.name ? 8 : 0), o10 = new e20(t10.name || "", n10, t10.id, r10); + if (t10.props) { + var i10, a10 = bo(t10.props); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + if (Array.isArray(s10) || (s10 = s10(o10)), s10) { + if (s10[0].perNode) + throw new RangeError("Can't store a per-node prop on a node type"); + n10[s10[0].id] = s10[1]; + } + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + } + return o10; + } }, { key: "match", value: function(e21) { + var t10 = /* @__PURE__ */ Object.create(null); + for (var n10 in e21) { + var r10, o10 = bo(n10.split(" ")); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + t10[i10] = e21[n10]; + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + } + return function(e23) { + for (var n11 = e23.prop(AG.group), r11 = -1; r11 < (n11 ? n11.length : 0); r11++) { + var o11 = t10[r11 < 0 ? e23.name : n11[r11]]; + if (o11) + return o11; + } + }; + } }]), e20; + }(); + RG.none = new RG("", /* @__PURE__ */ Object.create(null), 0, 8); + var NG; + var IG = function() { + function e20(t10) { + No(this, e20), this.types = t10; + for (var n10 = 0; n10 < t10.length; n10++) + if (t10[n10].id != n10) + throw new RangeError("Node type ids should correspond to array positions when creating a node set"); + } + return Do(e20, [{ key: "extend", value: function() { + for (var t10 = [], n10 = arguments.length, r10 = new Array(n10), o10 = 0; o10 < n10; o10++) + r10[o10] = arguments[o10]; + var i10, a10 = bo(this.types); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10, c10 = i10.value, l10 = null, u10 = bo(r10); + try { + for (u10.s(); !(s10 = u10.n()).done; ) { + var f10 = (0, s10.value)(c10); + f10 && (l10 || (l10 = Object.assign({}, c10.props)), l10[f10[0].id] = f10[1]); + } + } catch (e21) { + u10.e(e21); + } finally { + u10.f(); + } + t10.push(l10 ? new RG(c10.name, l10, c10.id, c10.flags) : c10); + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return new e20(t10); + } }]), e20; + }(); + var DG = /* @__PURE__ */ new WeakMap(); + var qG = /* @__PURE__ */ new WeakMap(); + !function(e20) { + e20[e20.ExcludeBuffers = 1] = "ExcludeBuffers", e20[e20.IncludeAnonymous = 2] = "IncludeAnonymous", e20[e20.IgnoreMounts = 4] = "IgnoreMounts", e20[e20.IgnoreOverlays = 8] = "IgnoreOverlays"; + }(NG || (NG = {})); + var zG = function() { + function e20(t10, n10, r10, o10, i10) { + if (No(this, e20), this.type = t10, this.children = n10, this.positions = r10, this.length = o10, this.props = null, i10 && i10.length) { + this.props = /* @__PURE__ */ Object.create(null); + var a10, s10 = bo(i10); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = jo(a10.value, 2), l10 = c10[0], u10 = c10[1]; + this.props["number" == typeof l10 ? l10 : l10.id] = u10; + } + } catch (e21) { + s10.e(e21); + } finally { + s10.f(); + } + } + } + return Do(e20, [{ key: "toString", value: function() { + var e21 = PG.get(this); + if (e21 && !e21.overlay) + return e21.tree.toString(); + var t10, n10 = "", r10 = bo(this.children); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + var o10 = t10.value.toString(); + o10 && (n10 && (n10 += ","), n10 += o10); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (n10.length ? "(" + n10 + ")" : "") : n10; + } }, { key: "cursor", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0; + return new XG(this.topNode, e21); + } }, { key: "cursorAt", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = DG.get(this) || this.topNode, r10 = new XG(n10); + return r10.moveTo(e21, t10), DG.set(this, r10._tree), r10; + } }, { key: "topNode", get: function() { + return new WG(this, 0, 0, null); + } }, { key: "resolve", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = VG(DG.get(this) || this.topNode, e21, t10, false); + return DG.set(this, n10), n10; + } }, { key: "resolveInner", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = VG(qG.get(this) || this.topNode, e21, t10, true); + return qG.set(this, n10), n10; + } }, { key: "resolveStack", value: function(e21) { + return function(e23, t10, n10) { + for (var r10 = e23.resolveInner(t10, n10), o10 = null, i10 = r10 instanceof WG ? r10 : r10.context.parent; i10; i10 = i10.parent) + if (i10.index < 0) { + var a10 = i10.parent; + (o10 || (o10 = [r10])).push(a10.resolve(t10, n10)), i10 = a10; + } else { + var s10 = PG.get(i10.tree); + if (s10 && s10.overlay && s10.overlay[0].from <= t10 && s10.overlay[s10.overlay.length - 1].to >= t10) { + var c10 = new WG(s10.tree, s10.overlay[0].from + i10.from, -1, i10); + (o10 || (o10 = [r10])).push(VG(c10, t10, n10, false)); + } + } + return o10 ? QG(o10) : r10; + }(this, e21, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0); + } }, { key: "iterate", value: function(e21) { + for (var t10 = e21.enter, n10 = e21.leave, r10 = e21.from, o10 = void 0 === r10 ? 0 : r10, i10 = e21.to, a10 = void 0 === i10 ? this.length : i10, s10 = e21.mode || 0, c10 = (s10 & NG.IncludeAnonymous) > 0, l10 = this.cursor(s10 | NG.IncludeAnonymous); ; ) { + var u10 = false; + if (l10.from <= a10 && l10.to >= o10 && (!c10 && l10.type.isAnonymous || false !== t10(l10))) { + if (l10.firstChild()) + continue; + u10 = true; + } + for (; u10 && n10 && (c10 || !l10.type.isAnonymous) && n10(l10), !l10.nextSibling(); ) { + if (!l10.parent()) + return; + u10 = true; + } + } + } }, { key: "prop", value: function(e21) { + return e21.perNode ? this.props ? this.props[e21.id] : void 0 : this.type.prop(e21); + } }, { key: "propValues", get: function() { + var e21 = []; + if (this.props) + for (var t10 in this.props) + e21.push([+t10, this.props[t10]]); + return e21; + } }, { key: "balance", value: function() { + var t10 = this, n10 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return this.children.length <= 8 ? this : rQ(RG.none, this.children, this.positions, 0, this.children.length, 0, this.length, function(n11, r10, o10) { + return new e20(t10.type, n11, r10, o10, t10.propValues); + }, n10.makeTree || function(t11, n11, r10) { + return new e20(RG.none, t11, n11, r10); + }); + } }], [{ key: "build", value: function(e21) { + return eQ(e21); + } }]), e20; + }(); + zG.empty = new zG(RG.none, [], [], 0); + var BG = function() { + function e20(t10, n10) { + No(this, e20), this.buffer = t10, this.index = n10; + } + return Do(e20, [{ key: "id", get: function() { + return this.buffer[this.index - 4]; + } }, { key: "start", get: function() { + return this.buffer[this.index - 3]; + } }, { key: "end", get: function() { + return this.buffer[this.index - 2]; + } }, { key: "size", get: function() { + return this.buffer[this.index - 1]; + } }, { key: "pos", get: function() { + return this.index; + } }, { key: "next", value: function() { + this.index -= 4; + } }, { key: "fork", value: function() { + return new e20(this.buffer, this.index); + } }]), e20; + }(); + var LG = function() { + function e20(t10, n10, r10) { + No(this, e20), this.buffer = t10, this.length = n10, this.set = r10; + } + return Do(e20, [{ key: "type", get: function() { + return RG.none; + } }, { key: "toString", value: function() { + for (var e21 = [], t10 = 0; t10 < this.buffer.length; ) + e21.push(this.childString(t10)), t10 = this.buffer[t10 + 3]; + return e21.join(","); + } }, { key: "childString", value: function(e21) { + var t10 = this.buffer[e21], n10 = this.buffer[e21 + 3], r10 = this.set.types[t10], o10 = r10.name; + if (/\W/.test(o10) && !r10.isError && (o10 = JSON.stringify(o10)), n10 == (e21 += 4)) + return o10; + for (var i10 = []; e21 < n10; ) + i10.push(this.childString(e21)), e21 = this.buffer[e21 + 3]; + return o10 + "(" + i10.join(",") + ")"; + } }, { key: "findChild", value: function(e21, t10, n10, r10, o10) { + for (var i10 = this.buffer, a10 = -1, s10 = e21; s10 != t10 && !(FG(o10, r10, i10[s10 + 1], i10[s10 + 2]) && (a10 = s10, n10 > 0)); s10 = i10[s10 + 3]) + ; + return a10; + } }, { key: "slice", value: function(t10, n10, r10) { + for (var o10 = this.buffer, i10 = new Uint16Array(n10 - t10), a10 = 0, s10 = t10, c10 = 0; s10 < n10; ) { + i10[c10++] = o10[s10++], i10[c10++] = o10[s10++] - r10; + var l10 = i10[c10++] = o10[s10++] - r10; + i10[c10++] = o10[s10++] - t10, a10 = Math.max(a10, l10); + } + return new e20(i10, a10, this.set); + } }]), e20; + }(); + function FG(e20, t10, n10, r10) { + switch (e20) { + case -2: + return n10 < t10; + case -1: + return r10 >= t10 && n10 < t10; + case 0: + return n10 < t10 && r10 > t10; + case 1: + return n10 <= t10 && r10 > t10; + case 2: + return r10 > t10; + case 4: + return true; + } + } + function VG(e20, t10, n10, r10) { + for (var o10; e20.from == e20.to || (n10 < 1 ? e20.from >= t10 : e20.from > t10) || (n10 > -1 ? e20.to <= t10 : e20.to < t10); ) { + var i10 = !r10 && e20 instanceof WG && e20.index < 0 ? null : e20.parent; + if (!i10) + return e20; + e20 = i10; + } + var a10 = r10 ? 0 : NG.IgnoreOverlays; + if (r10) + for (var s10 = e20, c10 = s10.parent; c10; c10 = (s10 = c10).parent) + s10 instanceof WG && s10.index < 0 && (null === (o10 = c10.enter(t10, n10, a10)) || void 0 === o10 ? void 0 : o10.from) != s10.from && (e20 = c10); + for (; ; ) { + var l10 = e20.enter(t10, n10, a10); + if (!l10) + return e20; + e20 = l10; + } + } + var HG = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "cursor", value: function() { + return new XG(this, arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0); + } }, { key: "getChild", value: function(e21) { + var t10 = UG(this, e21, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null); + return t10.length ? t10[0] : null; + } }, { key: "getChildren", value: function(e21) { + return UG(this, e21, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null); + } }, { key: "resolve", value: function(e21) { + return VG(this, e21, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, false); + } }, { key: "resolveInner", value: function(e21) { + return VG(this, e21, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, true); + } }, { key: "matchContext", value: function(e21) { + return JG(this, e21); + } }, { key: "enterUnfinishedNodesBefore", value: function(e21) { + for (var t10 = this.childBefore(e21), n10 = this; t10; ) { + var r10 = t10.lastChild; + if (!r10 || r10.to != t10.to) + break; + r10.type.isError && r10.from == r10.to ? (n10 = t10, t10 = r10.prevSibling) : t10 = r10; + } + return n10; + } }, { key: "node", get: function() { + return this; + } }, { key: "next", get: function() { + return this.parent; + } }]), e20; + }(); + var WG = function(e20) { + function t10(e21, n10, r10, o10) { + var i10; + return No(this, t10), (i10 = _o(this, t10))._tree = e21, i10.from = n10, i10.index = r10, i10._parent = o10, i10; + } + return Ao(t10, HG), Do(t10, [{ key: "type", get: function() { + return this._tree.type; + } }, { key: "name", get: function() { + return this._tree.type.name; + } }, { key: "to", get: function() { + return this.from + this._tree.length; + } }, { key: "nextChild", value: function(e21, n10, r10, o10) { + for (var i10 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, a10 = this; ; ) { + for (var s10 = a10._tree, c10 = s10.children, l10 = s10.positions, u10 = n10 > 0 ? c10.length : -1; e21 != u10; e21 += n10) { + var f10 = c10[e21], d10 = l10[e21] + a10.from; + if (FG(o10, r10, d10, d10 + f10.length)) { + if (f10 instanceof LG) { + if (i10 & NG.ExcludeBuffers) + continue; + var h10 = f10.findChild(0, f10.buffer.length, n10, r10 - d10, o10); + if (h10 > -1) + return new GG(new KG(a10, f10, e21, d10), null, h10); + } else if (i10 & NG.IncludeAnonymous || !f10.type.isAnonymous || ZG(f10)) { + var v10 = void 0; + if (!(i10 & NG.IgnoreMounts) && (v10 = PG.get(f10)) && !v10.overlay) + return new t10(v10.tree, d10, e21, a10); + var p10 = new t10(f10, d10, e21, a10); + return i10 & NG.IncludeAnonymous || !p10.type.isAnonymous ? p10 : p10.nextChild(n10 < 0 ? f10.children.length - 1 : 0, n10, r10, o10); + } + } + } + if (i10 & NG.IncludeAnonymous || !a10.type.isAnonymous) + return null; + if (e21 = a10.index >= 0 ? a10.index + n10 : n10 < 0 ? -1 : a10._parent._tree.children.length, !(a10 = a10._parent)) + return null; + } + } }, { key: "firstChild", get: function() { + return this.nextChild(0, 1, 0, 4); + } }, { key: "lastChild", get: function() { + return this.nextChild(this._tree.children.length - 1, -1, 0, 4); + } }, { key: "childAfter", value: function(e21) { + return this.nextChild(0, 1, e21, 2); + } }, { key: "childBefore", value: function(e21) { + return this.nextChild(this._tree.children.length - 1, -1, e21, -2); + } }, { key: "enter", value: function(e21, n10) { + var r10, o10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0; + if (!(o10 & NG.IgnoreOverlays) && (r10 = PG.get(this._tree)) && r10.overlay) { + var i10, a10 = e21 - this.from, s10 = bo(r10.overlay); + try { + for (s10.s(); !(i10 = s10.n()).done; ) { + var c10 = i10.value, l10 = c10.from, u10 = c10.to; + if ((n10 > 0 ? l10 <= a10 : l10 < a10) && (n10 < 0 ? u10 >= a10 : u10 > a10)) + return new t10(r10.tree, r10.overlay[0].from + this.from, -1, this); + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + } + return this.nextChild(0, 1, e21, n10, o10); + } }, { key: "nextSignificantParent", value: function() { + for (var e21 = this; e21.type.isAnonymous && e21._parent; ) + e21 = e21._parent; + return e21; + } }, { key: "parent", get: function() { + return this._parent ? this._parent.nextSignificantParent() : null; + } }, { key: "nextSibling", get: function() { + return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null; + } }, { key: "prevSibling", get: function() { + return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null; + } }, { key: "tree", get: function() { + return this._tree; + } }, { key: "toTree", value: function() { + return this._tree; + } }, { key: "toString", value: function() { + return this._tree.toString(); + } }]), t10; + }(); + function UG(e20, t10, n10, r10) { + var o10 = e20.cursor(), i10 = []; + if (!o10.firstChild()) + return i10; + if (null != n10) { + for (; !o10.type.is(n10); ) + if (!o10.nextSibling()) + return i10; + } + for (; ; ) { + if (null != r10 && o10.type.is(r10)) + return i10; + if (o10.type.is(t10) && i10.push(o10.node), !o10.nextSibling()) + return null == r10 ? i10 : []; + } + } + function JG(e20, t10) { + for (var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t10.length - 1, r10 = e20.parent; n10 >= 0; r10 = r10.parent) { + if (!r10) + return false; + if (!r10.type.isAnonymous) { + if (t10[n10] && t10[n10] != r10.name) + return false; + n10--; + } + } + return true; + } + var KG = Do(function e8(t10, n10, r10, o10) { + No(this, e8), this.parent = t10, this.buffer = n10, this.index = r10, this.start = o10; + }); + var GG = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10)).context = e21, o10._parent = n10, o10.index = r10, o10.type = e21.buffer.set.types[e21.buffer.buffer[r10]], o10; + } + return Ao(t10, HG), Do(t10, [{ key: "name", get: function() { + return this.type.name; + } }, { key: "from", get: function() { + return this.context.start + this.context.buffer.buffer[this.index + 1]; + } }, { key: "to", get: function() { + return this.context.start + this.context.buffer.buffer[this.index + 2]; + } }, { key: "child", value: function(e21, n10, r10) { + var o10 = this.context.buffer, i10 = o10.findChild(this.index + 4, o10.buffer[this.index + 3], e21, n10 - this.context.start, r10); + return i10 < 0 ? null : new t10(this.context, this, i10); + } }, { key: "firstChild", get: function() { + return this.child(1, 0, 4); + } }, { key: "lastChild", get: function() { + return this.child(-1, 0, 4); + } }, { key: "childAfter", value: function(e21) { + return this.child(1, e21, 2); + } }, { key: "childBefore", value: function(e21) { + return this.child(-1, e21, -2); + } }, { key: "enter", value: function(e21, n10) { + if ((arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0) & NG.ExcludeBuffers) + return null; + var r10 = this.context.buffer, o10 = r10.findChild(this.index + 4, r10.buffer[this.index + 3], n10 > 0 ? 1 : -1, e21 - this.context.start, n10); + return o10 < 0 ? null : new t10(this.context, this, o10); + } }, { key: "parent", get: function() { + return this._parent || this.context.parent.nextSignificantParent(); + } }, { key: "externalSibling", value: function(e21) { + return this._parent ? null : this.context.parent.nextChild(this.context.index + e21, e21, 0, 4); + } }, { key: "nextSibling", get: function() { + var e21 = this.context.buffer, n10 = e21.buffer[this.index + 3]; + return n10 < (this._parent ? e21.buffer[this._parent.index + 3] : e21.buffer.length) ? new t10(this.context, this._parent, n10) : this.externalSibling(1); + } }, { key: "prevSibling", get: function() { + var e21 = this.context.buffer, n10 = this._parent ? this._parent.index + 4 : 0; + return this.index == n10 ? this.externalSibling(-1) : new t10(this.context, this._parent, e21.findChild(n10, this.index, -1, 0, 4)); + } }, { key: "tree", get: function() { + return null; + } }, { key: "toTree", value: function() { + var e21 = [], t11 = [], n10 = this.context.buffer, r10 = this.index + 4, o10 = n10.buffer[this.index + 3]; + if (o10 > r10) { + var i10 = n10.buffer[this.index + 1]; + e21.push(n10.slice(r10, o10, i10)), t11.push(0); + } + return new zG(this.type, e21, t11, this.to - this.from); + } }, { key: "toString", value: function() { + return this.context.buffer.childString(this.index); + } }]), t10; + }(); + function QG(e20) { + if (!e20.length) + return null; + for (var t10 = 0, n10 = e20[0], r10 = 1; r10 < e20.length; r10++) { + var o10 = e20[r10]; + (o10.from > n10.from || o10.to < n10.to) && (n10 = o10, t10 = r10); + } + var i10 = n10 instanceof WG && n10.index < 0 ? null : n10.parent, a10 = e20.slice(); + return i10 ? a10[t10] = i10 : a10.splice(t10, 1), new YG(a10, n10); + } + var YG = function() { + function e20(t10, n10) { + No(this, e20), this.heads = t10, this.node = n10; + } + return Do(e20, [{ key: "next", get: function() { + return QG(this.heads); + } }]), e20; + }(); + var XG = function() { + function e20(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + if (No(this, e20), this.mode = n10, this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, t10 instanceof WG) + this.yieldNode(t10); + else { + this._tree = t10.context.parent, this.buffer = t10.context; + for (var r10 = t10._parent; r10; r10 = r10._parent) + this.stack.unshift(r10.index); + this.bufferNode = t10, this.yieldBuf(t10.index); + } + } + return Do(e20, [{ key: "name", get: function() { + return this.type.name; + } }, { key: "yieldNode", value: function(e21) { + return !!e21 && (this._tree = e21, this.type = e21.type, this.from = e21.from, this.to = e21.to, true); + } }, { key: "yieldBuf", value: function(e21, t10) { + this.index = e21; + var n10 = this.buffer, r10 = n10.start, o10 = n10.buffer; + return this.type = t10 || o10.set.types[o10.buffer[e21]], this.from = r10 + o10.buffer[e21 + 1], this.to = r10 + o10.buffer[e21 + 2], true; + } }, { key: "yield", value: function(e21) { + return !!e21 && (e21 instanceof WG ? (this.buffer = null, this.yieldNode(e21)) : (this.buffer = e21.context, this.yieldBuf(e21.index, e21.type))); + } }, { key: "toString", value: function() { + return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString(); + } }, { key: "enterChild", value: function(e21, t10, n10) { + if (!this.buffer) + return this.yield(this._tree.nextChild(e21 < 0 ? this._tree._tree.children.length - 1 : 0, e21, t10, n10, this.mode)); + var r10 = this.buffer.buffer, o10 = r10.findChild(this.index + 4, r10.buffer[this.index + 3], e21, t10 - this.buffer.start, n10); + return !(o10 < 0) && (this.stack.push(this.index), this.yieldBuf(o10)); + } }, { key: "firstChild", value: function() { + return this.enterChild(1, 0, 4); + } }, { key: "lastChild", value: function() { + return this.enterChild(-1, 0, 4); + } }, { key: "childAfter", value: function(e21) { + return this.enterChild(1, e21, 2); + } }, { key: "childBefore", value: function(e21) { + return this.enterChild(-1, e21, -2); + } }, { key: "enter", value: function(e21, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.mode; + return this.buffer ? !(n10 & NG.ExcludeBuffers) && this.enterChild(1, e21, t10) : this.yield(this._tree.enter(e21, t10, n10)); + } }, { key: "parent", value: function() { + if (!this.buffer) + return this.yieldNode(this.mode & NG.IncludeAnonymous ? this._tree._parent : this._tree.parent); + if (this.stack.length) + return this.yieldBuf(this.stack.pop()); + var e21 = this.mode & NG.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent(); + return this.buffer = null, this.yieldNode(e21); + } }, { key: "sibling", value: function(e21) { + if (!this.buffer) + return !!this._tree._parent && this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e21, e21, 0, 4, this.mode)); + var t10 = this.buffer.buffer, n10 = this.stack.length - 1; + if (e21 < 0) { + var r10 = n10 < 0 ? 0 : this.stack[n10] + 4; + if (this.index != r10) + return this.yieldBuf(t10.findChild(r10, this.index, -1, 0, 4)); + } else { + var o10 = t10.buffer[this.index + 3]; + if (o10 < (n10 < 0 ? t10.buffer.length : t10.buffer[this.stack[n10] + 3])) + return this.yieldBuf(o10); + } + return n10 < 0 && this.yield(this.buffer.parent.nextChild(this.buffer.index + e21, e21, 0, 4, this.mode)); + } }, { key: "nextSibling", value: function() { + return this.sibling(1); + } }, { key: "prevSibling", value: function() { + return this.sibling(-1); + } }, { key: "atLastNode", value: function(e21) { + var t10, n10, r10 = this.buffer; + if (r10) { + if (e21 > 0) { + if (this.index < r10.buffer.buffer.length) + return false; + } else + for (var o10 = 0; o10 < this.index; o10++) + if (r10.buffer.buffer[o10 + 3] < this.index) + return false; + t10 = r10.index, n10 = r10.parent; + } else { + var i10 = this._tree; + t10 = i10.index, n10 = i10._parent; + } + for (; n10; t10 = (a10 = n10).index, n10 = a10._parent, a10) { + var a10; + if (t10 > -1) + for (var s10 = t10 + e21, c10 = e21 < 0 ? -1 : n10._tree.children.length; s10 != c10; s10 += e21) { + var l10 = n10._tree.children[s10]; + if (this.mode & NG.IncludeAnonymous || l10 instanceof LG || !l10.type.isAnonymous || ZG(l10)) + return false; + } + } + return true; + } }, { key: "move", value: function(e21, t10) { + if (t10 && this.enterChild(e21, 0, 4)) + return true; + for (; ; ) { + if (this.sibling(e21)) + return true; + if (this.atLastNode(e21) || !this.parent()) + return false; + } + } }, { key: "next", value: function() { + var e21 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; + return this.move(1, e21); + } }, { key: "prev", value: function() { + var e21 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; + return this.move(-1, e21); + } }, { key: "moveTo", value: function(e21) { + for (var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; (this.from == this.to || (t10 < 1 ? this.from >= e21 : this.from > e21) || (t10 > -1 ? this.to <= e21 : this.to < e21)) && this.parent(); ) + ; + for (; this.enterChild(1, e21, t10); ) + ; + return this; + } }, { key: "node", get: function() { + if (!this.buffer) + return this._tree; + var e21 = this.bufferNode, t10 = null, n10 = 0; + if (e21 && e21.context == this.buffer) + e: + for (var r10 = this.index, o10 = this.stack.length; o10 >= 0; ) { + for (var i10 = e21; i10; i10 = i10._parent) + if (i10.index == r10) { + if (r10 == this.index) + return i10; + t10 = i10, n10 = o10 + 1; + break e; + } + r10 = this.stack[--o10]; + } + for (var a10 = n10; a10 < this.stack.length; a10++) + t10 = new GG(this.buffer, t10, this.stack[a10]); + return this.bufferNode = new GG(this.buffer, t10, this.index); + } }, { key: "tree", get: function() { + return this.buffer ? null : this._tree._tree; + } }, { key: "iterate", value: function(e21, t10) { + for (var n10 = 0; ; ) { + var r10 = false; + if (this.type.isAnonymous || false !== e21(this)) { + if (this.firstChild()) { + n10++; + continue; + } + this.type.isAnonymous || (r10 = true); + } + for (; r10 && t10 && t10(this), r10 = this.type.isAnonymous, !this.nextSibling(); ) { + if (!n10) + return; + this.parent(), n10--, r10 = true; + } + } + } }, { key: "matchContext", value: function(e21) { + if (!this.buffer) + return JG(this.node, e21); + for (var t10 = this.buffer.buffer, n10 = t10.set.types, r10 = e21.length - 1, o10 = this.stack.length - 1; r10 >= 0; o10--) { + if (o10 < 0) + return JG(this.node, e21, r10); + var i10 = n10[t10.buffer[this.stack[o10]]]; + if (!i10.isAnonymous) { + if (e21[r10] && e21[r10] != i10.name) + return false; + r10--; + } + } + return true; + } }]), e20; + }(); + function ZG(e20) { + return e20.children.some(function(e21) { + return e21 instanceof LG || !e21.type.isAnonymous || ZG(e21); + }); + } + function eQ(e20) { + var t10, n10 = e20.buffer, r10 = e20.nodeSet, o10 = e20.maxBufferLength, i10 = void 0 === o10 ? 1024 : o10, a10 = e20.reused, s10 = void 0 === a10 ? [] : a10, c10 = e20.minRepeatType, l10 = void 0 === c10 ? r10.types.length : c10, u10 = Array.isArray(n10) ? new BG(n10, n10.length) : n10, f10 = r10.types, d10 = 0, h10 = 0; + function v10(e21, t11, n11, o11, a11, c11) { + for (var b11 = u10.id, k11 = u10.start, w11 = u10.end, x10 = u10.size, j10 = h10; x10 < 0; ) { + if (u10.next(), -1 == x10) { + var S10 = s10[b11]; + return n11.push(S10), void o11.push(k11 - e21); + } + if (-3 == x10) + return void (d10 = b11); + if (-4 == x10) + return void (h10 = b11); + throw new RangeError("Unrecognized record size: ".concat(x10)); + } + var C10, $10, _10 = f10[b11], O10 = k11 - e21; + if (w11 - k11 <= i10 && ($10 = function(e23, t12) { + var n12 = u10.fork(), r11 = 0, o12 = 0, a12 = 0, s11 = n12.end - i10, c12 = { size: 0, start: 0, skip: 0 }; + e: + for (var f11 = n12.pos - e23; n12.pos > f11; ) { + var d11 = n12.size; + if (n12.id == t12 && d11 >= 0) + c12.size = r11, c12.start = o12, c12.skip = a12, a12 += 4, r11 += 4, n12.next(); + else { + var h11 = n12.pos - d11; + if (d11 < 0 || h11 < f11 || n12.start < s11) + break; + var v11 = n12.id >= l10 ? 4 : 0, p11 = n12.start; + for (n12.next(); n12.pos > h11; ) { + if (n12.size < 0) { + if (-3 != n12.size) + break e; + v11 += 4; + } else + n12.id >= l10 && (v11 += 4); + n12.next(); + } + o12 = p11, r11 += d11, a12 += v11; + } + } + (t12 < 0 || r11 == e23) && (c12.size = r11, c12.start = o12, c12.skip = a12); + return c12.size > 4 ? c12 : void 0; + }(u10.pos - t11, a11))) { + for (var M10 = new Uint16Array($10.size - $10.skip), E10 = u10.pos - $10.size, A10 = M10.length; u10.pos > E10; ) + A10 = y10($10.start, M10, A10); + C10 = new LG(M10, w11 - $10.start, r10), O10 = $10.start - e21; + } else { + var P10 = u10.pos - x10; + u10.next(); + for (var T8 = [], R8 = [], N8 = b11 >= l10 ? b11 : -1, I10 = 0, D10 = w11; u10.pos > P10; ) + N8 >= 0 && u10.id == N8 && u10.size >= 0 ? (u10.end <= D10 - i10 && (m10(T8, R8, k11, I10, u10.end, D10, N8, j10), I10 = T8.length, D10 = u10.end), u10.next()) : c11 > 2500 ? p10(k11, P10, T8, R8) : v10(k11, P10, T8, R8, N8, c11 + 1); + if (N8 >= 0 && I10 > 0 && I10 < T8.length && m10(T8, R8, k11, I10, k11, D10, N8, j10), T8.reverse(), R8.reverse(), N8 > -1 && I10 > 0) { + var q10 = /* @__PURE__ */ function(e23) { + return function(t12, n12, r11) { + var o12, i11, a12 = 0, s11 = t12.length - 1; + if (s11 >= 0 && (o12 = t12[s11]) instanceof zG) { + if (!s11 && o12.type == e23 && o12.length == r11) + return o12; + (i11 = o12.prop(AG.lookAhead)) && (a12 = n12[s11] + o12.length + i11); + } + return g10(e23, t12, n12, r11, a12); + }; + }(_10); + C10 = rQ(_10, T8, R8, 0, T8.length, 0, w11 - k11, q10, q10); + } else + C10 = g10(_10, T8, R8, w11 - k11, j10 - w11); + } + n11.push(C10), o11.push(O10); + } + function p10(e21, t11, n11, o11) { + for (var a11 = [], s11 = 0, c11 = -1; u10.pos > t11; ) { + var l11 = u10.id, f11 = u10.start, d11 = u10.end; + if (u10.size > 4) + u10.next(); + else { + if (c11 > -1 && f11 < c11) + break; + c11 < 0 && (c11 = d11 - i10), a11.push(l11, f11, d11), s11++, u10.next(); + } + } + if (s11) { + for (var h11 = new Uint16Array(4 * s11), v11 = a11[a11.length - 2], p11 = a11.length - 3, m11 = 0; p11 >= 0; p11 -= 3) + h11[m11++] = a11[p11], h11[m11++] = a11[p11 + 1] - v11, h11[m11++] = a11[p11 + 2] - v11, h11[m11++] = m11; + n11.push(new LG(h11, a11[2] - v11, r10)), o11.push(v11 - e21); + } + } + function m10(e21, t11, n11, o11, i11, a11, s11, c11) { + for (var l11 = [], u11 = []; e21.length > o11; ) + l11.push(e21.pop()), u11.push(t11.pop() + n11 - i11); + e21.push(g10(r10.types[s11], l11, u11, a11 - i11, c11 - a11)), t11.push(i11 - n11); + } + function g10(e21, t11, n11, r11) { + var o11 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, i11 = arguments.length > 5 ? arguments[5] : void 0; + if (d10) { + var a11 = [AG.contextHash, d10]; + i11 = i11 ? [a11].concat(i11) : [a11]; + } + if (o11 > 25) { + var s11 = [AG.lookAhead, o11]; + i11 = i11 ? [s11].concat(i11) : [s11]; + } + return new zG(e21, t11, n11, r11, i11); + } + function y10(e21, t11, n11) { + var r11 = u10.id, o11 = u10.start, i11 = u10.end, a11 = u10.size; + if (u10.next(), a11 >= 0 && r11 < l10) { + var s11 = n11; + if (a11 > 4) + for (var c11 = u10.pos - (a11 - 4); u10.pos > c11; ) + n11 = y10(e21, t11, n11); + t11[--n11] = s11, t11[--n11] = i11 - e21, t11[--n11] = o11 - e21, t11[--n11] = r11; + } else + -3 == a11 ? d10 = r11 : -4 == a11 && (h10 = r11); + return n11; + } + for (var b10 = [], k10 = []; u10.pos > 0; ) + v10(e20.start || 0, e20.bufferStart || 0, b10, k10, -1, 0); + var w10 = null !== (t10 = e20.length) && void 0 !== t10 ? t10 : b10.length ? k10[0] + b10[0].length : 0; + return new zG(f10[e20.topID], b10.reverse(), k10.reverse(), w10); + } + var tQ = /* @__PURE__ */ new WeakMap(); + function nQ(e20, t10) { + if (!e20.isAnonymous || t10 instanceof LG || t10.type != e20) + return 1; + var n10 = tQ.get(t10); + if (null == n10) { + n10 = 1; + var r10, o10 = bo(t10.children); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + if (i10.type != e20 || !(i10 instanceof zG)) { + n10 = 1; + break; + } + n10 += nQ(e20, i10); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + tQ.set(t10, n10); + } + return n10; + } + function rQ(e20, t10, n10, r10, o10, i10, a10, s10, c10) { + for (var l10 = 0, u10 = r10; u10 < o10; u10++) + l10 += nQ(e20, t10[u10]); + var f10 = Math.ceil(1.5 * l10 / 8), d10 = [], h10 = []; + return function t11(n11, r11, o11, a11, s11) { + for (var l11 = o11; l11 < a11; ) { + var u11 = l11, v10 = r11[l11], p10 = nQ(e20, n11[l11]); + for (l11++; l11 < a11; l11++) { + var m10 = nQ(e20, n11[l11]); + if (p10 + m10 >= f10) + break; + p10 += m10; + } + if (l11 == u11 + 1) { + if (p10 > f10) { + var g10 = n11[u11]; + t11(g10.children, g10.positions, 0, g10.children.length, r11[u11] + s11); + continue; + } + d10.push(n11[u11]); + } else { + var y10 = r11[l11 - 1] + n11[l11 - 1].length - v10; + d10.push(rQ(e20, n11, r11, u11, l11, v10, y10, null, c10)); + } + h10.push(v10 + s11 - i10); + } + }(t10, n10, r10, o10, 0), (s10 || c10)(d10, h10, a10); + } + var oQ = function() { + function e20(t10, n10, r10, o10) { + var i10 = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a10 = arguments.length > 5 && void 0 !== arguments[5] && arguments[5]; + No(this, e20), this.from = t10, this.to = n10, this.tree = r10, this.offset = o10, this.open = (i10 ? 1 : 0) | (a10 ? 2 : 0); + } + return Do(e20, [{ key: "openStart", get: function() { + return (1 & this.open) > 0; + } }, { key: "openEnd", get: function() { + return (2 & this.open) > 0; + } }], [{ key: "addTree", value: function(t10) { + var n10, r10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], o10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], i10 = [new e20(0, t10.length, t10, 0, false, o10)], a10 = bo(r10); + try { + for (a10.s(); !(n10 = a10.n()).done; ) { + var s10 = n10.value; + s10.to > t10.length && i10.push(s10); + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return i10; + } }, { key: "applyChanges", value: function(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 128; + if (!n10.length) + return t10; + for (var o10 = [], i10 = 1, a10 = t10.length ? t10[0] : null, s10 = 0, c10 = 0, l10 = 0; ; s10++) { + var u10 = s10 < n10.length ? n10[s10] : null, f10 = u10 ? u10.fromA : 1e9; + if (f10 - c10 >= r10) + for (; a10 && a10.from < f10; ) { + var d10 = a10; + if (c10 >= d10.from || f10 <= d10.to || l10) { + var h10 = Math.max(d10.from, c10) - l10, v10 = Math.min(d10.to, f10) - l10; + d10 = h10 >= v10 ? null : new e20(h10, v10, d10.tree, d10.offset + l10, s10 > 0, !!u10); + } + if (d10 && o10.push(d10), a10.to > f10) + break; + a10 = i10 < t10.length ? t10[i10++] : null; + } + if (!u10) + break; + c10 = u10.toA, l10 = u10.toA - u10.toB; + } + return o10; + } }]), e20; + }(); + var iQ = function() { + function e20() { + No(this, e20); + } + return Do(e20, [{ key: "startParse", value: function(e21, t10, n10) { + return "string" == typeof e21 && (e21 = new aQ(e21)), n10 = n10 ? n10.length ? n10.map(function(e23) { + return new EG(e23.from, e23.to); + }) : [new EG(0, 0)] : [new EG(0, e21.length)], this.createParse(e21, t10 || [], n10); + } }, { key: "parse", value: function(e21, t10, n10) { + for (var r10 = this.startParse(e21, t10, n10); ; ) { + var o10 = r10.advance(); + if (o10) + return o10; + } + } }]), e20; + }(); + var aQ = function() { + function e20(t10) { + No(this, e20), this.string = t10; + } + return Do(e20, [{ key: "length", get: function() { + return this.string.length; + } }, { key: "chunk", value: function(e21) { + return this.string.slice(e21); + } }, { key: "lineChunks", get: function() { + return false; + } }, { key: "read", value: function(e21, t10) { + return this.string.slice(e21, t10); + } }]), e20; + }(); + new AG({ perNode: true }); + var sQ = 0; + var cQ = function() { + function e20(t10, n10, r10) { + No(this, e20), this.set = t10, this.base = n10, this.modified = r10, this.id = sQ++; + } + return Do(e20, null, [{ key: "define", value: function(t10) { + if (null == t10 ? void 0 : t10.base) + throw new Error("Can not derive from a modified tag"); + var n10 = new e20([], null, []); + if (n10.set.push(n10), t10) { + var r10, o10 = bo(t10.set); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + n10.set.push(i10); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + } + return n10; + } }, { key: "defineModifier", value: function() { + var e21 = new uQ(); + return function(t10) { + return t10.modified.indexOf(e21) > -1 ? t10 : uQ.get(t10.base || t10, t10.modified.concat(e21).sort(function(e23, t11) { + return e23.id - t11.id; + })); + }; + } }]), e20; + }(); + var lQ = 0; + var uQ = function() { + function e20() { + No(this, e20), this.instances = [], this.id = lQ++; + } + return Do(e20, null, [{ key: "get", value: function(t10, n10) { + if (!n10.length) + return t10; + var r10 = n10[0].instances.find(function(e21) { + return e21.base == t10 && (r11 = n10, o11 = e21.modified, r11.length == o11.length && r11.every(function(e23, t11) { + return e23 == o11[t11]; + })); + var r11, o11; + }); + if (r10) + return r10; + var o10, i10 = [], a10 = new cQ(i10, t10, n10), s10 = bo(n10); + try { + for (s10.s(); !(o10 = s10.n()).done; ) { + o10.value.instances.push(a10); + } + } catch (e21) { + s10.e(e21); + } finally { + s10.f(); + } + var c10, l10 = function(e21) { + for (var t11 = [[]], n11 = 0; n11 < e21.length; n11++) + for (var r11 = 0, o11 = t11.length; r11 < o11; r11++) + t11.push(t11[r11].concat(e21[n11])); + return t11.sort(function(e23, t12) { + return t12.length - e23.length; + }); + }(n10), u10 = bo(t10.set); + try { + for (u10.s(); !(c10 = u10.n()).done; ) { + var f10 = c10.value; + if (!f10.modified.length) { + var d10, h10 = bo(l10); + try { + for (h10.s(); !(d10 = h10.n()).done; ) { + var v10 = d10.value; + i10.push(e20.get(f10, v10)); + } + } catch (e21) { + h10.e(e21); + } finally { + h10.f(); + } + } + } + } catch (e21) { + u10.e(e21); + } finally { + u10.f(); + } + return a10; + } }]), e20; + }(); + function fQ(e20) { + var t10 = /* @__PURE__ */ Object.create(null); + for (var n10 in e20) { + var r10 = e20[n10]; + Array.isArray(r10) || (r10 = [r10]); + var o10, i10 = bo(n10.split(" ")); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + var a10 = o10.value; + if (a10) { + for (var s10 = [], c10 = 2, l10 = a10, u10 = 0; ; ) { + if ("..." == l10 && u10 > 0 && u10 + 3 == a10.length) { + c10 = 1; + break; + } + var f10 = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l10); + if (!f10) + throw new RangeError("Invalid path: " + a10); + if (s10.push("*" == f10[0] ? "" : '"' == f10[0][0] ? JSON.parse(f10[0]) : f10[0]), (u10 += f10[0].length) == a10.length) + break; + var d10 = a10[u10++]; + if (u10 == a10.length && "!" == d10) { + c10 = 0; + break; + } + if ("/" != d10) + throw new RangeError("Invalid path: " + a10); + l10 = a10.slice(u10); + } + var h10 = s10.length - 1, v10 = s10[h10]; + if (!v10) + throw new RangeError("Invalid path: " + a10); + var p10 = new hQ(r10, c10, h10 > 0 ? s10.slice(0, h10) : null); + t10[v10] = p10.sort(t10[v10]); + } + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + } + return dQ.add(t10); + } + var dQ = new AG(); + var hQ = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.tags = t10, this.mode = n10, this.context = r10, this.next = o10; + } + return Do(e20, [{ key: "opaque", get: function() { + return 0 == this.mode; + } }, { key: "inherit", get: function() { + return 1 == this.mode; + } }, { key: "sort", value: function(e21) { + return !e21 || e21.depth < this.depth ? (this.next = e21, this) : (e21.next = this.sort(e21.next), e21); + } }, { key: "depth", get: function() { + return this.context ? this.context.length : 0; + } }]), e20; + }(); + function vQ(e20, t10) { + var n10, r10 = /* @__PURE__ */ Object.create(null), o10 = bo(e20); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value; + if (Array.isArray(i10.tag)) { + var a10, s10 = bo(i10.tag); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + r10[c10.id] = i10.class; + } + } catch (e21) { + s10.e(e21); + } finally { + s10.f(); + } + } else + r10[i10.tag.id] = i10.class; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + var l10 = t10 || {}, u10 = l10.scope, f10 = l10.all, d10 = void 0 === f10 ? null : f10; + return { style: function(e21) { + var t11, n11 = d10, o11 = bo(e21); + try { + for (o11.s(); !(t11 = o11.n()).done; ) { + var i11, a11 = bo(t11.value.set); + try { + for (a11.s(); !(i11 = a11.n()).done; ) { + var s11 = i11.value, c11 = r10[s11.id]; + if (c11) { + n11 = n11 ? n11 + " " + c11 : c11; + break; + } + } + } catch (e23) { + a11.e(e23); + } finally { + a11.f(); + } + } + } catch (e23) { + o11.e(e23); + } finally { + o11.f(); + } + return n11; + }, scope: u10 }; + } + function pQ(e20, t10, n10) { + var r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o10 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : e20.length, i10 = new mQ(r10, Array.isArray(t10) ? t10 : [t10], n10); + i10.highlightRange(e20.cursor(), r10, o10, "", i10.highlighters), i10.flush(o10); + } + hQ.empty = new hQ([], 2, null); + var mQ = function() { + function e20(t10, n10, r10) { + No(this, e20), this.at = t10, this.highlighters = n10, this.span = r10, this.class = ""; + } + return Do(e20, [{ key: "startSpan", value: function(e21, t10) { + t10 != this.class && (this.flush(e21), e21 > this.at && (this.at = e21), this.class = t10); + } }, { key: "flush", value: function(e21) { + e21 > this.at && this.class && this.span(this.at, e21, this.class); + } }, { key: "highlightRange", value: function(e21, t10, n10, r10, o10) { + var i10 = e21.type, a10 = e21.from, s10 = e21.to; + if (!(a10 >= n10 || s10 <= t10)) { + i10.isTop && (o10 = this.highlighters.filter(function(e23) { + return !e23.scope || e23.scope(i10); + })); + var c10 = r10, l10 = function(e23) { + var t11 = e23.type.prop(dQ); + for (; t11 && t11.context && !e23.matchContext(t11.context); ) + t11 = t11.next; + return t11 || null; + }(e21) || hQ.empty, u10 = function(e23, t11) { + var n11, r11 = null, o11 = bo(e23); + try { + for (o11.s(); !(n11 = o11.n()).done; ) { + var i11 = n11.value.style(t11); + i11 && (r11 = r11 ? r11 + " " + i11 : i11); + } + } catch (e24) { + o11.e(e24); + } finally { + o11.f(); + } + return r11; + }(o10, l10.tags); + if (u10 && (c10 && (c10 += " "), c10 += u10, 1 == l10.mode && (r10 += (r10 ? " " : "") + u10)), this.startSpan(Math.max(t10, a10), c10), !l10.opaque) { + var f10 = e21.tree && e21.tree.prop(AG.mounted); + if (f10 && f10.overlay) { + for (var d10 = e21.node.enter(f10.overlay[0].from + a10, 1), h10 = this.highlighters.filter(function(e23) { + return !e23.scope || e23.scope(f10.tree.type); + }), v10 = e21.firstChild(), p10 = 0, m10 = a10; ; p10++) { + var g10 = p10 < f10.overlay.length ? f10.overlay[p10] : null, y10 = g10 ? g10.from + a10 : s10, b10 = Math.max(t10, m10), k10 = Math.min(n10, y10); + if (b10 < k10 && v10) + for (; e21.from < k10 && (this.highlightRange(e21, b10, k10, r10, o10), this.startSpan(Math.min(k10, e21.to), c10), !(e21.to >= y10) && e21.nextSibling()); ) + ; + if (!g10 || y10 > n10) + break; + (m10 = g10.to + a10) > t10 && (this.highlightRange(d10.cursor(), Math.max(t10, g10.from + a10), Math.min(n10, m10), "", h10), this.startSpan(Math.min(n10, m10), c10)); + } + v10 && e21.parent(); + } else if (e21.firstChild()) { + f10 && (r10 = ""); + do { + if (!(e21.to <= t10)) { + if (e21.from >= n10) + break; + this.highlightRange(e21, t10, n10, r10, o10), this.startSpan(Math.min(n10, e21.to), c10); + } + } while (e21.nextSibling()); + e21.parent(); + } + } + } + } }]), e20; + }(); + var gQ; + var yQ = cQ.define; + var bQ = yQ(); + var kQ = yQ(); + var wQ = yQ(kQ); + var xQ = yQ(kQ); + var jQ = yQ(); + var SQ = yQ(jQ); + var CQ = yQ(jQ); + var $Q = yQ(); + var _Q = yQ($Q); + var OQ = yQ(); + var MQ = yQ(); + var EQ = yQ(); + var AQ = yQ(EQ); + var PQ = yQ(); + var TQ = { comment: bQ, lineComment: yQ(bQ), blockComment: yQ(bQ), docComment: yQ(bQ), name: kQ, variableName: yQ(kQ), typeName: wQ, tagName: yQ(wQ), propertyName: xQ, attributeName: yQ(xQ), className: yQ(kQ), labelName: yQ(kQ), namespace: yQ(kQ), macroName: yQ(kQ), literal: jQ, string: SQ, docString: yQ(SQ), character: yQ(SQ), attributeValue: yQ(SQ), number: CQ, integer: yQ(CQ), float: yQ(CQ), bool: yQ(jQ), regexp: yQ(jQ), escape: yQ(jQ), color: yQ(jQ), url: yQ(jQ), keyword: OQ, self: yQ(OQ), null: yQ(OQ), atom: yQ(OQ), unit: yQ(OQ), modifier: yQ(OQ), operatorKeyword: yQ(OQ), controlKeyword: yQ(OQ), definitionKeyword: yQ(OQ), moduleKeyword: yQ(OQ), operator: MQ, derefOperator: yQ(MQ), arithmeticOperator: yQ(MQ), logicOperator: yQ(MQ), bitwiseOperator: yQ(MQ), compareOperator: yQ(MQ), updateOperator: yQ(MQ), definitionOperator: yQ(MQ), typeOperator: yQ(MQ), controlOperator: yQ(MQ), punctuation: EQ, separator: yQ(EQ), bracket: AQ, angleBracket: yQ(AQ), squareBracket: yQ(AQ), paren: yQ(AQ), brace: yQ(AQ), content: $Q, heading: _Q, heading1: yQ(_Q), heading2: yQ(_Q), heading3: yQ(_Q), heading4: yQ(_Q), heading5: yQ(_Q), heading6: yQ(_Q), contentSeparator: yQ($Q), list: yQ($Q), quote: yQ($Q), emphasis: yQ($Q), strong: yQ($Q), link: yQ($Q), monospace: yQ($Q), strikethrough: yQ($Q), inserted: yQ(), deleted: yQ(), changed: yQ(), invalid: yQ(), meta: PQ, documentMeta: yQ(PQ), annotation: yQ(PQ), processingInstruction: yQ(PQ), definition: cQ.defineModifier(), constant: cQ.defineModifier(), function: cQ.defineModifier(), standard: cQ.defineModifier(), local: cQ.defineModifier(), special: cQ.defineModifier() }; + vQ([{ tag: TQ.link, class: "tok-link" }, { tag: TQ.heading, class: "tok-heading" }, { tag: TQ.emphasis, class: "tok-emphasis" }, { tag: TQ.strong, class: "tok-strong" }, { tag: TQ.keyword, class: "tok-keyword" }, { tag: TQ.atom, class: "tok-atom" }, { tag: TQ.bool, class: "tok-bool" }, { tag: TQ.url, class: "tok-url" }, { tag: TQ.labelName, class: "tok-labelName" }, { tag: TQ.inserted, class: "tok-inserted" }, { tag: TQ.deleted, class: "tok-deleted" }, { tag: TQ.literal, class: "tok-literal" }, { tag: TQ.string, class: "tok-string" }, { tag: TQ.number, class: "tok-number" }, { tag: [TQ.regexp, TQ.escape, TQ.special(TQ.string)], class: "tok-string2" }, { tag: TQ.variableName, class: "tok-variableName" }, { tag: TQ.local(TQ.variableName), class: "tok-variableName tok-local" }, { tag: TQ.definition(TQ.variableName), class: "tok-variableName tok-definition" }, { tag: TQ.special(TQ.variableName), class: "tok-variableName2" }, { tag: TQ.definition(TQ.propertyName), class: "tok-propertyName tok-definition" }, { tag: TQ.typeName, class: "tok-typeName" }, { tag: TQ.namespace, class: "tok-namespace" }, { tag: TQ.className, class: "tok-className" }, { tag: TQ.macroName, class: "tok-macroName" }, { tag: TQ.propertyName, class: "tok-propertyName" }, { tag: TQ.operator, class: "tok-operator" }, { tag: TQ.comment, class: "tok-comment" }, { tag: TQ.meta, class: "tok-meta" }, { tag: TQ.invalid, class: "tok-invalid" }, { tag: TQ.punctuation, class: "tok-punctuation" }]); + var RQ = new AG(); + var NQ = new AG(); + var IQ = function() { + function e20(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ""; + No(this, e20), this.data = t10, this.name = o10, mV.prototype.hasOwnProperty("tree") || Object.defineProperty(mV.prototype, "tree", { get: function() { + return zQ(this); + } }), this.parser = n10, this.extension = [KQ.of(this), mV.languageData.of(function(e21, t11, n11) { + var r11 = DQ(e21, t11, n11), o11 = r11.type.prop(RQ); + if (!o11) + return []; + var i10 = e21.facet(o11), a10 = r11.type.prop(NQ); + if (a10) { + var s10, c10 = r11.resolve(t11 - r11.from, n11), l10 = bo(a10); + try { + for (l10.s(); !(s10 = l10.n()).done; ) { + var u10 = s10.value; + if (u10.test(c10, e21)) { + var f10 = e21.facet(u10.facet); + return "replace" == u10.type ? f10 : f10.concat(i10); + } + } + } catch (e23) { + l10.e(e23); + } finally { + l10.f(); + } + } + return i10; + })].concat(r10); + } + return Do(e20, [{ key: "isActiveAt", value: function(e21, t10) { + return DQ(e21, t10, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1).type.prop(RQ) == this.data; + } }, { key: "findRegions", value: function(e21) { + var t10 = this, n10 = e21.facet(KQ); + if ((null == n10 ? void 0 : n10.data) == this.data) + return [{ from: 0, to: e21.doc.length }]; + if (!n10 || !n10.allowsNesting) + return []; + var r10 = []; + return function e23(n11, o10) { + if (n11.prop(RQ) != t10.data) { + var i10 = n11.prop(AG.mounted); + if (i10) { + if (i10.tree.prop(RQ) == t10.data) { + if (i10.overlay) { + var a10, s10 = bo(i10.overlay); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + r10.push({ from: c10.from + o10, to: c10.to + o10 }); + } + } catch (e24) { + s10.e(e24); + } finally { + s10.f(); + } + } else + r10.push({ from: o10, to: o10 + n11.length }); + return; + } + if (i10.overlay) { + var l10 = r10.length; + if (e23(i10.tree, i10.overlay[0].from + o10), r10.length > l10) + return; + } + } + for (var u10 = 0; u10 < n11.children.length; u10++) { + var f10 = n11.children[u10]; + f10 instanceof zG && e23(f10, n11.positions[u10] + o10); + } + } else + r10.push({ from: o10, to: o10 + n11.length }); + }(zQ(e21), 0), r10; + } }, { key: "allowsNesting", get: function() { + return true; + } }]), e20; + }(); + function DQ(e20, t10, n10) { + var r10 = e20.facet(KQ), o10 = zQ(e20).topNode; + if (!r10 || r10.allowsNesting) + for (var i10 = o10; i10; i10 = i10.enter(t10, n10, NG.ExcludeBuffers)) + i10.type.isTop && (o10 = i10); + return o10; + } + IQ.setState = oV.define(); + var qQ = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10, [e21, n10, [], r10])).parser = n10, o10; + } + return Ao(t10, IQ), Do(t10, [{ key: "configure", value: function(e21, n10) { + return new t10(this.data, this.parser.configure(e21), n10 || this.name); + } }, { key: "allowsNesting", get: function() { + return this.parser.hasWrappers(); + } }], [{ key: "define", value: function(e21) { + var n10, r10 = (n10 = e21.languageData, MF.define({ combine: n10 ? function(e23) { + return e23.concat(n10); + } : void 0 })); + return new t10(r10, e21.parser.configure({ props: [RQ.add(function(e23) { + return e23.isTop ? r10 : void 0; + })] }), e21.name); + } }]), t10; + }(); + function zQ(e20) { + var t10 = e20.field(IQ.state, false); + return t10 ? t10.tree : zG.empty; + } + var BQ = function() { + function e20(t10) { + No(this, e20), this.doc = t10, this.cursorPos = 0, this.string = "", this.cursor = t10.iter(); + } + return Do(e20, [{ key: "length", get: function() { + return this.doc.length; + } }, { key: "syncTo", value: function(e21) { + return this.string = this.cursor.next(e21 - this.cursorPos).value, this.cursorPos = e21 + this.string.length, this.cursorPos - this.string.length; + } }, { key: "chunk", value: function(e21) { + return this.syncTo(e21), this.string; + } }, { key: "lineChunks", get: function() { + return true; + } }, { key: "read", value: function(e21, t10) { + var n10 = this.cursorPos - this.string.length; + return e21 < n10 || t10 >= this.cursorPos ? this.doc.sliceString(e21, t10) : this.string.slice(e21 - n10, t10 - n10); + } }]), e20; + }(); + var LQ = null; + var FQ = function() { + function e20(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], o10 = arguments.length > 3 ? arguments[3] : void 0, i10 = arguments.length > 4 ? arguments[4] : void 0, a10 = arguments.length > 5 ? arguments[5] : void 0, s10 = arguments.length > 6 ? arguments[6] : void 0, c10 = arguments.length > 7 ? arguments[7] : void 0; + No(this, e20), this.parser = t10, this.state = n10, this.fragments = r10, this.tree = o10, this.treeLen = i10, this.viewport = a10, this.skipped = s10, this.scheduleOn = c10, this.parse = null, this.tempSkipped = []; + } + return Do(e20, [{ key: "startParse", value: function() { + return this.parser.startParse(new BQ(this.state.doc), this.fragments); + } }, { key: "work", value: function(e21, t10) { + var n10 = this; + return null != t10 && t10 >= this.state.doc.length && (t10 = void 0), this.tree != zG.empty && this.isDone(null != t10 ? t10 : this.state.doc.length) ? (this.takeTree(), true) : this.withContext(function() { + var r10; + if ("number" == typeof e21) { + var o10 = Date.now() + e21; + e21 = function() { + return Date.now() > o10; + }; + } + for (n10.parse || (n10.parse = n10.startParse()), null != t10 && (null == n10.parse.stoppedAt || n10.parse.stoppedAt > t10) && t10 < n10.state.doc.length && n10.parse.stopAt(t10); ; ) { + var i10 = n10.parse.advance(); + if (i10) { + if (n10.fragments = n10.withoutTempSkipped(oQ.addTree(i10, n10.fragments, null != n10.parse.stoppedAt)), n10.treeLen = null !== (r10 = n10.parse.stoppedAt) && void 0 !== r10 ? r10 : n10.state.doc.length, n10.tree = i10, n10.parse = null, !(n10.treeLen < (null != t10 ? t10 : n10.state.doc.length))) + return true; + n10.parse = n10.startParse(); + } + if (e21()) + return false; + } + }); + } }, { key: "takeTree", value: function() { + var e21, t10, n10 = this; + this.parse && (e21 = this.parse.parsedPos) >= this.treeLen && ((null == this.parse.stoppedAt || this.parse.stoppedAt > e21) && this.parse.stopAt(e21), this.withContext(function() { + for (; !(t10 = n10.parse.advance()); ) + ; + }), this.treeLen = e21, this.tree = t10, this.fragments = this.withoutTempSkipped(oQ.addTree(this.tree, this.fragments, true)), this.parse = null); + } }, { key: "withContext", value: function(e21) { + var t10 = LQ; + LQ = this; + try { + return e21(); + } finally { + LQ = t10; + } + } }, { key: "withoutTempSkipped", value: function(e21) { + for (var t10; t10 = this.tempSkipped.pop(); ) + e21 = VQ(e21, t10.from, t10.to); + return e21; + } }, { key: "changes", value: function(t10, n10) { + var r10 = this.fragments, o10 = this.tree, i10 = this.treeLen, a10 = this.viewport, s10 = this.skipped; + if (this.takeTree(), !t10.empty) { + var c10 = []; + if (t10.iterChangedRanges(function(e21, t11, n11, r11) { + return c10.push({ fromA: e21, toA: t11, fromB: n11, toB: r11 }); + }), r10 = oQ.applyChanges(r10, c10), o10 = zG.empty, i10 = 0, a10 = { from: t10.mapPos(a10.from, -1), to: t10.mapPos(a10.to, 1) }, this.skipped.length) { + s10 = []; + var l10, u10 = bo(this.skipped); + try { + for (u10.s(); !(l10 = u10.n()).done; ) { + var f10 = l10.value, d10 = t10.mapPos(f10.from, 1), h10 = t10.mapPos(f10.to, -1); + d10 < h10 && s10.push({ from: d10, to: h10 }); + } + } catch (e21) { + u10.e(e21); + } finally { + u10.f(); + } + } + } + return new e20(this.parser, n10, r10, o10, i10, a10, s10, this.scheduleOn); + } }, { key: "updateViewport", value: function(e21) { + if (this.viewport.from == e21.from && this.viewport.to == e21.to) + return false; + this.viewport = e21; + for (var t10 = this.skipped.length, n10 = 0; n10 < this.skipped.length; n10++) { + var r10 = this.skipped[n10], o10 = r10.from, i10 = r10.to; + o10 < e21.to && i10 > e21.from && (this.fragments = VQ(this.fragments, o10, i10), this.skipped.splice(n10--, 1)); + } + return !(this.skipped.length >= t10) && (this.reset(), true); + } }, { key: "reset", value: function() { + this.parse && (this.takeTree(), this.parse = null); + } }, { key: "skipUntilInView", value: function(e21, t10) { + this.skipped.push({ from: e21, to: t10 }); + } }, { key: "isDone", value: function(e21) { + e21 = Math.min(e21, this.state.doc.length); + var t10 = this.fragments; + return this.treeLen >= e21 && t10.length && 0 == t10[0].from && t10[0].to >= e21; + } }], [{ key: "create", value: function(t10, n10, r10) { + return new e20(t10, n10, [], zG.empty, 0, r10, [], null); + } }, { key: "getSkippingParser", value: function(e21) { + return new (function(t10) { + function n10() { + return No(this, n10), _o(this, n10, arguments); + } + return Ao(n10, iQ), Do(n10, [{ key: "createParse", value: function(t11, n11, r10) { + var o10 = r10[0].from, i10 = r10[r10.length - 1].to; + return { parsedPos: o10, advance: function() { + var t12 = LQ; + if (t12) { + var n12, a10 = bo(r10); + try { + for (a10.s(); !(n12 = a10.n()).done; ) { + var s10 = n12.value; + t12.tempSkipped.push(s10); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + e21 && (t12.scheduleOn = t12.scheduleOn ? Promise.all([t12.scheduleOn, e21]) : e21); + } + return this.parsedPos = i10, new zG(RG.none, [], [], i10 - o10); + }, stoppedAt: null, stopAt: function() { + } }; + } }]), n10; + }())(); + } }, { key: "get", value: function() { + return LQ; + } }]), e20; + }(); + function VQ(e20, t10, n10) { + return oQ.applyChanges(e20, [{ fromA: t10, toA: n10, fromB: t10, toB: n10 }]); + } + var HQ = function() { + function e20(t10) { + No(this, e20), this.context = t10, this.tree = t10.tree; + } + return Do(e20, [{ key: "apply", value: function(t10) { + if (!t10.docChanged && this.tree == this.context.tree) + return this; + var n10 = this.context.changes(t10.changes, t10.state), r10 = this.context.treeLen == t10.startState.doc.length ? void 0 : Math.max(t10.changes.mapPos(this.context.treeLen), n10.viewport.to); + return n10.work(20, r10) || n10.takeTree(), new e20(n10); + } }], [{ key: "init", value: function(t10) { + var n10 = Math.min(3e3, t10.doc.length), r10 = FQ.create(t10.facet(KQ).parser, t10, { from: 0, to: n10 }); + return r10.work(20, n10) || r10.takeTree(), new e20(r10); + } }]), e20; + }(); + IQ.state = NF.define({ create: HQ.init, update: function(e20, t10) { + var n10, r10 = bo(t10.effects); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + if (o10.is(IQ.setState)) + return o10.value; + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + return t10.startState.facet(KQ) != t10.state.facet(KQ) ? HQ.init(t10.state) : e20.apply(t10); + } }); + var WQ = function(e20) { + var t10 = setTimeout(function() { + return e20(); + }, 500); + return function() { + return clearTimeout(t10); + }; + }; + "undefined" != typeof requestIdleCallback && (WQ = function(e20) { + var t10 = -1, n10 = setTimeout(function() { + t10 = requestIdleCallback(e20, { timeout: 400 }); + }, 100); + return function() { + return t10 < 0 ? clearTimeout(n10) : cancelIdleCallback(t10); + }; + }); + var UQ = "undefined" != typeof navigator && (null === (gQ = navigator.scheduling) || void 0 === gQ ? void 0 : gQ.isInputPending) ? function() { + return navigator.scheduling.isInputPending(); + } : null; + var JQ = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.view = t10, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork(); + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = this.view.state.field(IQ.state).context; + (t10.updateViewport(e21.view.viewport) || this.view.viewport.to > t10.treeLen) && this.scheduleWork(), (e21.docChanged || e21.selectionSet) && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(t10); + } }, { key: "scheduleWork", value: function() { + if (!this.working) { + var e21 = this.view.state, t10 = e21.field(IQ.state); + t10.tree == t10.context.tree && t10.context.isDone(e21.doc.length) || (this.working = WQ(this.work)); + } + } }, { key: "work", value: function(e21) { + this.working = null; + var t10 = Date.now(); + if (this.chunkEnd < t10 && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = t10 + 3e4, this.chunkBudget = 3e3), !(this.chunkBudget <= 0)) { + var n10 = this.view, r10 = n10.state, o10 = n10.viewport.to, i10 = r10.field(IQ.state); + if (i10.tree != i10.context.tree || !i10.context.isDone(o10 + 1e5)) { + var a10 = Date.now() + Math.min(this.chunkBudget, 100, e21 && !UQ ? Math.max(25, e21.timeRemaining() - 5) : 1e9), s10 = i10.context.treeLen < o10 && r10.doc.length > o10 + 1e3, c10 = i10.context.work(function() { + return UQ && UQ() || Date.now() > a10; + }, o10 + (s10 ? 0 : 1e5)); + this.chunkBudget -= Date.now() - t10, (c10 || this.chunkBudget <= 0) && (i10.context.takeTree(), this.view.dispatch({ effects: IQ.setState.of(new HQ(i10.context)) })), this.chunkBudget > 0 && (!c10 || s10) && this.scheduleWork(), this.checkAsyncSchedule(i10.context); + } + } + } }, { key: "checkAsyncSchedule", value: function(e21) { + var t10 = this; + e21.scheduleOn && (this.workScheduled++, e21.scheduleOn.then(function() { + return t10.scheduleWork(); + }).catch(function(e23) { + return qW(t10.view.state, e23); + }).then(function() { + return t10.workScheduled--; + }), e21.scheduleOn = null); + } }, { key: "destroy", value: function() { + this.working && this.working(); + } }, { key: "isWorking", value: function() { + return !!(this.working || this.workScheduled > 0); + } }]), e20; + }(), { eventHandlers: { focus: function() { + this.scheduleWork(); + } } }); + var KQ = MF.define({ combine: function(e20) { + return e20.length ? e20[0] : null; + }, enables: function(e20) { + return [IQ.state, JQ, zJ.contentAttributes.compute([e20], function(t10) { + var n10 = t10.facet(e20); + return n10 && n10.name ? { "data-language": n10.name } : {}; + })]; + } }); + var GQ = Do(function e9(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; + No(this, e9), this.language = t10, this.support = n10, this.extension = [t10, n10]; + }); + var QQ = MF.define(); + var YQ = MF.define({ combine: function(e20) { + if (!e20.length) + return " "; + var t10 = e20[0]; + if (!t10 || /\S/.test(t10) || Array.from(t10).some(function(e21) { + return e21 != t10[0]; + })) + throw new Error("Invalid indent unit: " + JSON.stringify(e20[0])); + return t10; + } }); + function XQ(e20) { + var t10 = e20.facet(YQ); + return 9 == t10.charCodeAt(0) ? e20.tabSize * t10.length : t10.length; + } + function ZQ(e20, t10) { + var n10 = "", r10 = e20.tabSize, o10 = e20.facet(YQ)[0]; + if (" " == o10) { + for (; t10 >= r10; ) + n10 += " ", t10 -= r10; + o10 = " "; + } + for (var i10 = 0; i10 < t10; i10++) + n10 += o10; + return n10; + } + function eY(e20, t10) { + e20 instanceof mV && (e20 = new tY(e20)); + var n10, r10 = bo(e20.state.facet(QQ)); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = (0, n10.value)(e20, t10); + if (void 0 !== o10) + return o10; + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + var i10 = zQ(e20.state); + return i10.length >= t10 ? function(e21, t11, n11) { + var r11 = t11.resolveStack(n11), o11 = r11.node.enterUnfinishedNodesBefore(n11); + if (o11 != r11.node) { + for (var i11 = [], a10 = o11; a10 != r11.node; a10 = a10.parent) + i11.push(a10); + for (var s10 = i11.length - 1; s10 >= 0; s10--) + r11 = { node: i11[s10], next: r11 }; + } + return rY(r11, e21, n11); + }(e20, i10, t10) : null; + } + var tY = function() { + function e20(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + No(this, e20), this.state = t10, this.options = n10, this.unit = XQ(t10); + } + return Do(e20, [{ key: "lineAt", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n10 = this.state.doc.lineAt(e21), r10 = this.options, o10 = r10.simulateBreak, i10 = r10.simulateDoubleBreak; + return null != o10 && o10 >= n10.from && o10 <= n10.to ? i10 && o10 == e21 ? { text: "", from: e21 } : (t10 < 0 ? o10 < e21 : o10 <= e21) ? { text: n10.text.slice(o10 - n10.from), from: o10 } : { text: n10.text.slice(0, o10 - n10.from), from: n10.from } : n10; + } }, { key: "textAfterPos", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; + if (this.options.simulateDoubleBreak && e21 == this.options.simulateBreak) + return ""; + var n10 = this.lineAt(e21, t10), r10 = n10.text, o10 = n10.from; + return r10.slice(e21 - o10, Math.min(r10.length, e21 + 100 - o10)); + } }, { key: "column", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n10 = this.lineAt(e21, t10), r10 = n10.text, o10 = n10.from, i10 = this.countColumn(r10, e21 - o10), a10 = this.options.overrideIndentation ? this.options.overrideIndentation(o10) : -1; + return a10 > -1 && (i10 += a10 - this.countColumn(r10, r10.search(/\S|$/))), i10; + } }, { key: "countColumn", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21.length; + return RV(e21, this.state.tabSize, t10); + } }, { key: "lineIndent", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n10 = this.lineAt(e21, t10), r10 = n10.text, o10 = n10.from, i10 = this.options.overrideIndentation; + if (i10) { + var a10 = i10(o10); + if (a10 > -1) + return a10; + } + return this.countColumn(r10, r10.search(/\S|$/)); + } }, { key: "simulatedBreak", get: function() { + return this.options.simulateBreak || null; + } }]), e20; + }(); + var nY = new AG(); + function rY(e20, t10, n10) { + for (var r10 = e20; r10; r10 = r10.next) { + var o10 = oY(r10.node); + if (o10) + return o10(aY.create(t10, n10, r10)); + } + return 0; + } + function oY(e20) { + var t10 = e20.type.prop(nY); + if (t10) + return t10; + var n10, r10 = e20.firstChild; + if (r10 && (n10 = r10.type.prop(AG.closedBy))) { + var o10 = e20.lastChild, i10 = o10 && n10.indexOf(o10.name) > -1; + return function(e21) { + return function(e23, t11, n11, r11, o11) { + var i11 = e23.textAfter, a10 = i11.match(/^\s*/)[0].length, s10 = r11 && i11.slice(a10, a10 + r11.length) == r11 || o11 == e23.pos + a10, c10 = t11 ? function(e24) { + var t12 = e24.node, n12 = t12.childAfter(t12.from), r12 = t12.lastChild; + if (!n12) + return null; + for (var o12 = e24.options.simulateBreak, i12 = e24.state.doc.lineAt(n12.from), a11 = null == o12 || o12 <= i12.from ? i12.to : Math.min(i12.to, o12), s11 = n12.to; ; ) { + var c11 = t12.childAfter(s11); + if (!c11 || c11 == r12) + return null; + if (!c11.type.isSkipped) + return c11.from < a11 ? n12 : null; + s11 = c11.to; + } + }(e23) : null; + return c10 ? s10 ? e23.column(c10.from) : e23.column(c10.to) : e23.baseIndent + (s10 ? 0 : e23.unit * n11); + }(e21, true, 1, void 0, i10 && !function(e23) { + return e23.pos == e23.options.simulateBreak && e23.options.simulateDoubleBreak; + }(e21) ? o10.from : void 0); + }; + } + return null == e20.parent ? iY : null; + } + function iY() { + return 0; + } + var aY = function(e20) { + function t10(e21, n10, r10) { + var o10; + return No(this, t10), (o10 = _o(this, t10, [e21.state, e21.options])).base = e21, o10.pos = n10, o10.context = r10, o10; + } + return Ao(t10, tY), Do(t10, [{ key: "node", get: function() { + return this.context.node; + } }, { key: "textAfter", get: function() { + return this.textAfterPos(this.pos); + } }, { key: "baseIndent", get: function() { + return this.baseIndentFor(this.node); + } }, { key: "baseIndentFor", value: function(e21) { + for (var t11 = this.state.doc.lineAt(e21.from); ; ) { + for (var n10 = e21.resolve(t11.from); n10.parent && n10.parent.from == n10.from; ) + n10 = n10.parent; + if (sY(n10, e21)) + break; + t11 = this.state.doc.lineAt(n10.from); + } + return this.lineIndent(t11.from); + } }, { key: "continue", value: function() { + return rY(this.context.next, this.base, this.pos); + } }], [{ key: "create", value: function(e21, n10, r10) { + return new t10(e21, n10, r10); + } }]), t10; + }(); + function sY(e20, t10) { + for (var n10 = t10; n10; n10 = n10.parent) + if (e20 == n10) + return true; + return false; + } + function cY() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t10 = e20.except, n10 = e20.units, r10 = void 0 === n10 ? 1 : n10; + return function(e21) { + var n11 = t10 && t10.test(e21.textAfter); + return e21.baseIndent + (n11 ? 0 : r10 * e21.unit); + }; + } + var lY = 200; + var uY = MF.define(); + var fY = new AG(); + function dY(e20, t10, n10) { + var r10, o10 = bo(e20.facet(uY)); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = (0, r10.value)(e20, t10, n10); + if (i10) + return i10; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return function(e21, t11, n11) { + var r11 = zQ(e21); + if (r11.length < n11) + return null; + for (var o11, i11, a10 = null, s10 = r11.resolveStack(n11, 1); s10; s10 = s10.next) { + var c10 = s10.node; + if (!(c10.to <= n11 || c10.from > n11)) { + if (a10 && c10.from < t11) + break; + var l10 = c10.type.prop(fY); + if (l10 && (c10.to < r11.length - 50 || r11.length == e21.doc.length || (i11 = void 0, !(i11 = (o11 = c10).lastChild) || i11.to != o11.to || !i11.type.isError))) { + var u10 = l10(c10, e21); + u10 && u10.from <= n11 && u10.from >= t11 && u10.to > n11 && (a10 = u10); + } + } + } + return a10; + }(e20, t10, n10); + } + function hY(e20, t10) { + var n10 = t10.mapPos(e20.from, 1), r10 = t10.mapPos(e20.to, -1); + return n10 >= r10 ? void 0 : { from: n10, to: r10 }; + } + var vY = oV.define({ map: hY }); + var pY = oV.define({ map: hY }); + function mY(e20) { + var t10, n10 = [], r10 = bo(e20.state.selection.ranges); + try { + var o10 = function() { + var r11 = t10.value.head; + if (n10.some(function(e21) { + return e21.from <= r11 && e21.to >= r11; + })) + return 1; + n10.push(e20.lineBlockAt(r11)); + }; + for (r10.s(); !(t10 = r10.n()).done; ) + o10(); + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + return n10; + } + var gY = NF.define({ create: function() { + return KH.none; + }, update: function(e20, t10) { + e20 = e20.map(t10.changes); + var n10, r10 = bo(t10.effects); + try { + var o10 = function() { + var r11 = n10.value; + if (r11.is(vY) && !function(e21, t11, n11) { + var r12 = false; + return e21.between(t11, t11, function(e23, o12) { + e23 == t11 && o12 == n11 && (r12 = true); + }), r12; + }(e20, r11.value.from, r11.value.to)) { + var o11 = t10.state.facet(jY).preparePlaceholder, i11 = o11 ? KH.replace({ widget: new _Y(o11(t10.state, r11.value)) }) : $Y; + e20 = e20.update({ add: [i11.range(r11.value.from, r11.value.to)] }); + } else + r11.is(pY) && (e20 = e20.update({ filter: function(e21, t11) { + return r11.value.from != e21 || r11.value.to != t11; + }, filterFrom: r11.value.from, filterTo: r11.value.to })); + }; + for (r10.s(); !(n10 = r10.n()).done; ) + o10(); + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + if (t10.selection) { + var i10 = false, a10 = t10.selection.main.head; + e20.between(a10, a10, function(e21, t11) { + e21 < a10 && t11 > a10 && (i10 = true); + }), i10 && (e20 = e20.update({ filterFrom: a10, filterTo: a10, filter: function(e21, t11) { + return t11 <= a10 || e21 >= a10; + } })); + } + return e20; + }, provide: function(e20) { + return zJ.decorations.from(e20); + }, toJSON: function(e20, t10) { + var n10 = []; + return e20.between(0, t10.doc.length, function(e21, t11) { + n10.push(e21, t11); + }), n10; + }, fromJSON: function(e20) { + if (!Array.isArray(e20) || e20.length % 2) + throw new RangeError("Invalid JSON for fold state"); + for (var t10 = [], n10 = 0; n10 < e20.length; ) { + var r10 = e20[n10++], o10 = e20[n10++]; + if ("number" != typeof r10 || "number" != typeof o10) + throw new RangeError("Invalid JSON for fold state"); + t10.push($Y.range(r10, o10)); + } + return KH.set(t10, true); + } }); + function yY(e20, t10, n10) { + var r10, o10 = null; + return null === (r10 = e20.field(gY, false)) || void 0 === r10 || r10.between(t10, n10, function(e21, t11) { + (!o10 || o10.from > e21) && (o10 = { from: e21, to: t11 }); + }), o10; + } + function bY(e20, t10) { + return e20.field(gY, false) ? t10 : t10.concat(oV.appendConfig.of(SY())); + } + function kY(e20, t10) { + var n10 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r10 = e20.state.doc.lineAt(t10.from).number, o10 = e20.state.doc.lineAt(t10.to).number; + return zJ.announce.of("".concat(e20.state.phrase(n10 ? "Folded lines" : "Unfolded lines"), " ").concat(r10, " ").concat(e20.state.phrase("to"), " ").concat(o10, ".")); + } + var wY = [{ key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: function(e20) { + var t10, n10 = bo(mY(e20)); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value, o10 = dY(e20.state, r10.from, r10.to); + if (o10) + return e20.dispatch({ effects: bY(e20.state, [vY.of(o10), kY(e20, o10)]) }), true; + } + } catch (e21) { + n10.e(e21); + } finally { + n10.f(); + } + return false; + } }, { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: function(e20) { + if (!e20.state.field(gY, false)) + return false; + var t10, n10 = [], r10 = bo(mY(e20)); + try { + for (r10.s(); !(t10 = r10.n()).done; ) { + var o10 = t10.value, i10 = yY(e20.state, o10.from, o10.to); + i10 && n10.push(pY.of(i10), kY(e20, i10, false)); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + return n10.length && e20.dispatch({ effects: n10 }), n10.length > 0; + } }, { key: "Ctrl-Alt-[", run: function(e20) { + for (var t10 = e20.state, n10 = [], r10 = 0; r10 < t10.doc.length; ) { + var o10 = e20.lineBlockAt(r10), i10 = dY(t10, o10.from, o10.to); + i10 && n10.push(vY.of(i10)), r10 = (i10 ? e20.lineBlockAt(i10.to) : o10).to + 1; + } + return n10.length && e20.dispatch({ effects: bY(e20.state, n10) }), !!n10.length; + } }, { key: "Ctrl-Alt-]", run: function(e20) { + var t10 = e20.state.field(gY, false); + if (!t10 || !t10.size) + return false; + var n10 = []; + return t10.between(0, e20.state.doc.length, function(e21, t11) { + n10.push(pY.of({ from: e21, to: t11 })); + }), e20.dispatch({ effects: n10 }), true; + } }]; + var xY = { placeholderDOM: null, preparePlaceholder: null, placeholderText: "\u2026" }; + var jY = MF.define({ combine: function(e20) { + return gV(e20, xY); + } }); + function SY(e20) { + var t10 = [gY, AY]; + return e20 && t10.push(jY.of(e20)), t10; + } + function CY(e20, t10) { + var n10 = e20.state, r10 = n10.facet(jY), o10 = function(t11) { + var n11 = e20.lineBlockAt(e20.posAtDOM(t11.target)), r11 = yY(e20.state, n11.from, n11.to); + r11 && e20.dispatch({ effects: pY.of(r11) }), t11.preventDefault(); + }; + if (r10.placeholderDOM) + return r10.placeholderDOM(e20, o10, t10); + var i10 = document.createElement("span"); + return i10.textContent = r10.placeholderText, i10.setAttribute("aria-label", n10.phrase("folded code")), i10.title = n10.phrase("unfold"), i10.className = "cm-foldPlaceholder", i10.onclick = o10, i10; + } + var $Y = KH.replace({ widget: new (function(e20) { + function t10() { + return No(this, t10), _o(this, t10, arguments); + } + return Ao(t10, UH), Do(t10, [{ key: "toDOM", value: function(e21) { + return CY(e21, null); + } }]), t10; + }())() }); + var _Y = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).value = e21, n10; + } + return Ao(t10, UH), Do(t10, [{ key: "eq", value: function(e21) { + return this.value == e21.value; + } }, { key: "toDOM", value: function(e21) { + return CY(e21, this.value); + } }]), t10; + }(); + var OY = { openText: "\u2304", closedText: "\u203A", markerDOM: null, domEventHandlers: {}, foldingChanged: function() { + return false; + } }; + var MY = function(e20) { + function t10(e21, n10) { + var r10; + return No(this, t10), (r10 = _o(this, t10)).config = e21, r10.open = n10, r10; + } + return Ao(t10, sG), Do(t10, [{ key: "eq", value: function(e21) { + return this.config == e21.config && this.open == e21.open; + } }, { key: "toDOM", value: function(e21) { + if (this.config.markerDOM) + return this.config.markerDOM(this.open); + var t11 = document.createElement("span"); + return t11.textContent = this.open ? this.config.openText : this.config.closedText, t11.title = e21.state.phrase(this.open ? "Fold line" : "Unfold line"), t11; + } }]), t10; + }(); + function EY() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t10 = Object.assign(Object.assign({}, OY), e20), n10 = new MY(t10, true), r10 = new MY(t10, false), o10 = FW.fromClass(function() { + function e21(t11) { + No(this, e21), this.from = t11.viewport.from, this.markers = this.buildMarkers(t11); + } + return Do(e21, [{ key: "update", value: function(e23) { + (e23.docChanged || e23.viewportChanged || e23.startState.facet(KQ) != e23.state.facet(KQ) || e23.startState.field(gY, false) != e23.state.field(gY, false) || zQ(e23.startState) != zQ(e23.state) || t10.foldingChanged(e23)) && (this.markers = this.buildMarkers(e23.view)); + } }, { key: "buildMarkers", value: function(e23) { + var t11, o11 = new jV(), i11 = bo(e23.viewportLineBlocks); + try { + for (i11.s(); !(t11 = i11.n()).done; ) { + var a10 = t11.value, s10 = yY(e23.state, a10.from, a10.to) ? r10 : dY(e23.state, a10.from, a10.to) ? n10 : null; + s10 && o11.add(a10.from, a10.from, s10); + } + } catch (e24) { + i11.e(e24); + } finally { + i11.f(); + } + return o11.finish(); + } }]), e21; + }()), i10 = t10.domEventHandlers; + return [o10, fG({ class: "cm-foldGutter", markers: function(e21) { + var t11; + return (null === (t11 = e21.plugin(o10)) || void 0 === t11 ? void 0 : t11.markers) || xV.empty; + }, initialSpacer: function() { + return new MY(t10, false); + }, domEventHandlers: Object.assign(Object.assign({}, i10), { click: function(e21, t11, n11) { + if (i10.click && i10.click(e21, t11, n11)) + return true; + var r11 = yY(e21.state, t11.from, t11.to); + if (r11) + return e21.dispatch({ effects: pY.of(r11) }), true; + var o11 = dY(e21.state, t11.from, t11.to); + return !!o11 && (e21.dispatch({ effects: vY.of(o11) }), true); + } }) }), SY()]; + } + var AY = zJ.baseTheme({ ".cm-foldPlaceholder": { backgroundColor: "#eee", border: "1px solid #ddd", color: "#888", borderRadius: ".2em", margin: "0 1px", padding: "0 1px", cursor: "pointer" }, ".cm-foldGutter span": { padding: "0 1px", cursor: "pointer" } }); + var PY = function() { + function e20(t10, n10) { + var r10; + function o10(e21) { + var t11 = zV.newName(); + return (r10 || (r10 = /* @__PURE__ */ Object.create(null)))["." + t11] = e21, t11; + } + No(this, e20), this.specs = t10; + var i10 = "string" == typeof n10.all ? n10.all : n10.all ? o10(n10.all) : void 0, a10 = n10.scope; + this.scope = a10 instanceof IQ ? function(e21) { + return e21.prop(RQ) == a10.data; + } : a10 ? function(e21) { + return e21 == a10; + } : void 0, this.style = vQ(t10.map(function(e21) { + return { tag: e21.tag, class: e21.class || o10(Object.assign({}, e21, { tag: null })) }; + }), { all: i10 }).style, this.module = r10 ? new zV(r10) : null, this.themeType = n10.themeType; + } + return Do(e20, null, [{ key: "define", value: function(t10, n10) { + return new e20(t10, n10 || {}); + } }]), e20; + }(); + var TY = MF.define(); + var RY = MF.define({ combine: function(e20) { + return e20.length ? [e20[0]] : null; + } }); + function NY(e20) { + var t10 = e20.facet(TY); + return t10.length ? t10 : e20.facet(RY); + } + function IY(e20, t10) { + var n10, r10 = [qY]; + return e20 instanceof PY && (e20.module && r10.push(zJ.styleModule.of(e20.module)), n10 = e20.themeType), (null == t10 ? void 0 : t10.fallback) ? r10.push(RY.of(e20)) : n10 ? r10.push(TY.computeN([zJ.darkTheme], function(t11) { + return t11.facet(zJ.darkTheme) == ("dark" == n10) ? [e20] : []; + })) : r10.push(TY.of(e20)), r10; + } + var DY = function() { + function e20(t10) { + No(this, e20), this.markCache = /* @__PURE__ */ Object.create(null), this.tree = zQ(t10.state), this.decorations = this.buildDeco(t10, NY(t10.state)); + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = zQ(e21.state), n10 = NY(e21.state), r10 = n10 != NY(e21.startState); + t10.length < e21.view.viewport.to && !r10 && t10.type == this.tree.type ? this.decorations = this.decorations.map(e21.changes) : (t10 != this.tree || e21.viewportChanged || r10) && (this.tree = t10, this.decorations = this.buildDeco(e21.view, n10)); + } }, { key: "buildDeco", value: function(e21, t10) { + var n10 = this; + if (!t10 || !this.tree.length) + return KH.none; + var r10, o10 = new jV(), i10 = bo(e21.visibleRanges); + try { + for (i10.s(); !(r10 = i10.n()).done; ) { + var a10 = r10.value, s10 = a10.from, c10 = a10.to; + pQ(this.tree, t10, function(e23, t11, r11) { + o10.add(e23, t11, n10.markCache[r11] || (n10.markCache[r11] = KH.mark({ class: r11 }))); + }, s10, c10); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + return o10.finish(); + } }]), e20; + }(); + var qY = LF.high(FW.fromClass(DY, { decorations: function(e20) { + return e20.decorations; + } })); + var zY = PY.define([{ tag: TQ.meta, color: "#404740" }, { tag: TQ.link, textDecoration: "underline" }, { tag: TQ.heading, textDecoration: "underline", fontWeight: "bold" }, { tag: TQ.emphasis, fontStyle: "italic" }, { tag: TQ.strong, fontWeight: "bold" }, { tag: TQ.strikethrough, textDecoration: "line-through" }, { tag: TQ.keyword, color: "#708" }, { tag: [TQ.atom, TQ.bool, TQ.url, TQ.contentSeparator, TQ.labelName], color: "#219" }, { tag: [TQ.literal, TQ.inserted], color: "#164" }, { tag: [TQ.string, TQ.deleted], color: "#a11" }, { tag: [TQ.regexp, TQ.escape, TQ.special(TQ.string)], color: "#e40" }, { tag: TQ.definition(TQ.variableName), color: "#00f" }, { tag: TQ.local(TQ.variableName), color: "#30a" }, { tag: [TQ.typeName, TQ.namespace], color: "#085" }, { tag: TQ.className, color: "#167" }, { tag: [TQ.special(TQ.variableName), TQ.macroName], color: "#256" }, { tag: TQ.definition(TQ.propertyName), color: "#00c" }, { tag: TQ.comment, color: "#940" }, { tag: TQ.invalid, color: "#f00" }]); + var BY = zJ.baseTheme({ "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" }, "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" } }); + var LY = 1e4; + var FY = "()[]{}"; + var VY = MF.define({ combine: function(e20) { + return gV(e20, { afterCursor: true, brackets: FY, maxScanDistance: LY, renderMatch: UY }); + } }); + var HY = KH.mark({ class: "cm-matchingBracket" }); + var WY = KH.mark({ class: "cm-nonmatchingBracket" }); + function UY(e20) { + var t10 = [], n10 = e20.matched ? HY : WY; + return t10.push(n10.range(e20.start.from, e20.start.to)), e20.end && t10.push(n10.range(e20.end.from, e20.end.to)), t10; + } + var JY = NF.define({ create: function() { + return KH.none; + }, update: function(e20, t10) { + if (!t10.docChanged && !t10.selection) + return e20; + var n10, r10 = [], o10 = t10.state.facet(VY), i10 = bo(t10.state.selection.ranges); + try { + for (i10.s(); !(n10 = i10.n()).done; ) { + var a10 = n10.value; + if (a10.empty) { + var s10 = ZY(t10.state, a10.head, -1, o10) || a10.head > 0 && ZY(t10.state, a10.head - 1, 1, o10) || o10.afterCursor && (ZY(t10.state, a10.head, 1, o10) || a10.head < t10.state.doc.length && ZY(t10.state, a10.head + 1, -1, o10)); + s10 && (r10 = r10.concat(o10.renderMatch(s10, t10.state))); + } + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + return KH.set(r10, true); + }, provide: function(e20) { + return zJ.decorations.from(e20); + } }); + var KY = [JY, BY]; + function GY() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [VY.of(e20), KY]; + } + var QY = new AG(); + function YY(e20, t10, n10) { + var r10 = e20.prop(t10 < 0 ? AG.openedBy : AG.closedBy); + if (r10) + return r10; + if (1 == e20.name.length) { + var o10 = n10.indexOf(e20.name); + if (o10 > -1 && o10 % 2 == (t10 < 0 ? 1 : 0)) + return [n10[o10 + t10]]; + } + return null; + } + function XY(e20) { + var t10 = e20.type.prop(QY); + return t10 ? t10(e20.node) : e20; + } + function ZY(e20, t10, n10) { + for (var r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, o10 = r10.maxScanDistance || LY, i10 = r10.brackets || FY, a10 = zQ(e20), s10 = a10.resolveInner(t10, n10), c10 = s10; c10; c10 = c10.parent) { + var l10 = YY(c10.type, n10, i10); + if (l10 && c10.from < c10.to) { + var u10 = XY(c10); + if (u10 && (n10 > 0 ? t10 >= u10.from && t10 < u10.to : t10 > u10.from && t10 <= u10.to)) + return eX(e20, t10, n10, c10, u10, l10, i10); + } + } + return function(e21, t11, n11, r11, o11, i11, a11) { + var s11 = n11 < 0 ? e21.sliceDoc(t11 - 1, t11) : e21.sliceDoc(t11, t11 + 1), c11 = a11.indexOf(s11); + if (c11 < 0 || c11 % 2 == 0 != n11 > 0) + return null; + for (var l11 = { from: n11 < 0 ? t11 - 1 : t11, to: n11 > 0 ? t11 + 1 : t11 }, u11 = e21.doc.iterRange(t11, n11 > 0 ? e21.doc.length : 0), f10 = 0, d10 = 0; !u11.next().done && d10 <= i11; ) { + var h10 = u11.value; + n11 < 0 && (d10 += h10.length); + for (var v10 = t11 + d10 * n11, p10 = n11 > 0 ? 0 : h10.length - 1, m10 = n11 > 0 ? h10.length : -1; p10 != m10; p10 += n11) { + var g10 = a11.indexOf(h10[p10]); + if (!(g10 < 0 || r11.resolveInner(v10 + p10, 1).type != o11)) + if (g10 % 2 == 0 == n11 > 0) + f10++; + else { + if (1 == f10) + return { start: l11, end: { from: v10 + p10, to: v10 + p10 + 1 }, matched: g10 >> 1 == c11 >> 1 }; + f10--; + } + } + n11 > 0 && (d10 += h10.length); + } + return u11.done ? { start: l11, matched: false } : null; + }(e20, t10, n10, a10, s10.type, o10, i10); + } + function eX(e20, t10, n10, r10, o10, i10, a10) { + var s10 = r10.parent, c10 = { from: o10.from, to: o10.to }, l10 = 0, u10 = null == s10 ? void 0 : s10.cursor(); + if (u10 && (n10 < 0 ? u10.childBefore(r10.from) : u10.childAfter(r10.to))) + do { + if (n10 < 0 ? u10.to <= r10.from : u10.from >= r10.to) { + if (0 == l10 && i10.indexOf(u10.type.name) > -1 && u10.from < u10.to) { + var f10 = XY(u10); + return { start: c10, end: f10 ? { from: f10.from, to: f10.to } : void 0, matched: true }; + } + if (YY(u10.type, n10, a10)) + l10++; + else if (YY(u10.type, -n10, a10)) { + if (0 == l10) { + var d10 = XY(u10); + return { start: c10, end: d10 && d10.from < d10.to ? { from: d10.from, to: d10.to } : void 0, matched: false }; + } + l10--; + } + } + } while (n10 < 0 ? u10.prevSibling() : u10.nextSibling()); + return { start: c10, matched: false }; + } + for (tX = /* @__PURE__ */ Object.create(null), nX = [RG.none], rX = [], oX = /* @__PURE__ */ Object.create(null), iX = /* @__PURE__ */ Object.create(null), aX = 0, sX = [["variable", "variableName"], ["variable-2", "variableName.special"], ["string-2", "string.special"], ["def", "variableName.definition"], ["tag", "tagName"], ["attribute", "attributeName"], ["type", "typeName"], ["builtin", "variableName.standard"], ["qualifier", "modifier"], ["error", "invalid"], ["header", "heading"], ["property", "propertyName"]]; aX < sX.length; aX++) { + cX = jo(sX[aX], 2), lX = cX[0], uX = cX[1]; + iX[lX] = dX(tX, uX); + } + var cX; + var lX; + var uX; + var tX; + var nX; + var rX; + var oX; + var iX; + var aX; + var sX; + function fX(e20, t10) { + rX.indexOf(e20) > -1 || (rX.push(e20), console.warn(t10)); + } + function dX(e20, t10) { + var n10, r10 = [], o10 = bo(t10.split(" ")); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10, a10 = n10.value, s10 = [], c10 = bo(a10.split(".")); + try { + for (c10.s(); !(i10 = c10.n()).done; ) { + var l10 = i10.value, u10 = e20[l10] || TQ[l10]; + u10 ? "function" == typeof u10 ? s10.length ? s10 = s10.map(u10) : fX(l10, "Modifier ".concat(l10, " used at start of tag")) : s10.length ? fX(l10, "Tag ".concat(l10, " used as modifier")) : s10 = Array.isArray(u10) ? u10 : [u10] : fX(l10, "Unknown highlighting tag ".concat(l10)); + } + } catch (e21) { + c10.e(e21); + } finally { + c10.f(); + } + var f10, d10 = bo(s10); + try { + for (d10.s(); !(f10 = d10.n()).done; ) { + var h10 = f10.value; + r10.push(h10); + } + } catch (e21) { + d10.e(e21); + } finally { + d10.f(); + } + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + if (!r10.length) + return 0; + var v10 = t10.replace(/ /g, "_"), p10 = v10 + " " + r10.map(function(e21) { + return e21.id; + }), m10 = oX[p10]; + if (m10) + return m10.id; + var g10 = oX[p10] = RG.define({ id: nX.length, name: v10, props: [fQ(qo({}, v10, r10))] }); + return nX.push(g10), g10.id; + } + rW.RTL, rW.LTR; + function hX(e20, t10) { + return function(n10) { + var r10 = n10.state, o10 = n10.dispatch; + if (r10.readOnly) + return false; + var i10 = e20(t10, r10); + return !!i10 && (o10(r10.update(i10)), true); + }; + } + var vX = hX(kX, 0); + var pX = hX(bX, 0); + var mX = hX(function(e20, t10) { + return bX(e20, t10, function(e21) { + var t11, n10 = [], r10 = bo(e21.selection.ranges); + try { + for (r10.s(); !(t11 = r10.n()).done; ) { + var o10 = t11.value, i10 = e21.doc.lineAt(o10.from), a10 = o10.to <= i10.to ? i10 : e21.doc.lineAt(o10.to), s10 = n10.length - 1; + s10 >= 0 && n10[s10].to > i10.from ? n10[s10].to = a10.to : n10.push({ from: i10.from + /^\s*/.exec(i10.text)[0].length, to: a10.to }); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + return n10; + }(t10)); + }, 0); + function gX(e20, t10) { + var n10 = e20.languageDataAt("commentTokens", t10); + return n10.length ? n10[0] : {}; + } + var yX = 50; + function bX(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t10.selection.ranges, r10 = n10.map(function(e21) { + return gX(t10, e21.from).block; + }); + if (!r10.every(function(e21) { + return e21; + })) + return null; + var o10 = n10.map(function(e21, n11) { + return function(e23, t11, n12, r11) { + var o11, i11, a11 = t11.open, s11 = t11.close, c11 = e23.sliceDoc(n12 - yX, n12), l11 = e23.sliceDoc(r11, r11 + yX), u11 = /\s*$/.exec(c11)[0].length, f11 = /^\s*/.exec(l11)[0].length, d10 = c11.length - u11; + if (c11.slice(d10 - a11.length, d10) == a11 && l11.slice(f11, f11 + s11.length) == s11) + return { open: { pos: n12 - u11, margin: u11 && 1 }, close: { pos: r11 + f11, margin: f11 && 1 } }; + r11 - n12 <= 2 * yX ? o11 = i11 = e23.sliceDoc(n12, r11) : (o11 = e23.sliceDoc(n12, n12 + yX), i11 = e23.sliceDoc(r11 - yX, r11)); + var h10 = /^\s*/.exec(o11)[0].length, v10 = /\s*$/.exec(i11)[0].length, p10 = i11.length - v10 - s11.length; + return o11.slice(h10, h10 + a11.length) == a11 && i11.slice(p10, p10 + s11.length) == s11 ? { open: { pos: n12 + h10 + a11.length, margin: /\s/.test(o11.charAt(h10 + a11.length)) ? 1 : 0 }, close: { pos: r11 - v10 - s11.length, margin: /\s/.test(i11.charAt(p10 - 1)) ? 1 : 0 } } : null; + }(t10, r10[n11], e21.from, e21.to); + }); + if (2 != e20 && !o10.every(function(e21) { + return e21; + })) + return { changes: t10.changes(n10.map(function(e21, t11) { + return o10[t11] ? [] : [{ from: e21.from, insert: r10[t11].open + " " }, { from: e21.to, insert: " " + r10[t11].close }]; + })) }; + if (1 != e20 && o10.some(function(e21) { + return e21; + })) { + for (var i10, a10 = [], s10 = 0; s10 < o10.length; s10++) + if (i10 = o10[s10]) { + var c10 = r10[s10], l10 = i10, u10 = l10.open, f10 = l10.close; + a10.push({ from: u10.pos - c10.open.length, to: u10.pos + u10.margin }, { from: f10.pos - f10.margin, to: f10.pos + c10.close.length }); + } + return { changes: a10 }; + } + return null; + } + function kX(e20, t10) { + var n10, r10 = [], o10 = -1, i10 = bo(arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t10.selection.ranges); + try { + for (i10.s(); !(n10 = i10.n()).done; ) { + var a10 = n10.value, s10 = a10.from, c10 = a10.to, l10 = r10.length, u10 = 1e9, f10 = gX(t10, s10).line; + if (f10) { + for (var d10 = s10; d10 <= c10; ) { + var h10 = t10.doc.lineAt(d10); + if (h10.from > o10 && (s10 == c10 || c10 > h10.from)) { + o10 = h10.from; + var v10 = /^\s*/.exec(h10.text)[0].length, p10 = v10 == h10.length, m10 = h10.text.slice(v10, v10 + f10.length) == f10 ? v10 : -1; + v10 < h10.text.length && v10 < u10 && (u10 = v10), r10.push({ line: h10, comment: m10, token: f10, indent: v10, empty: p10, single: false }); + } + d10 = h10.to + 1; + } + if (u10 < 1e9) + for (var g10 = l10; g10 < r10.length; g10++) + r10[g10].indent < r10[g10].line.text.length && (r10[g10].indent = u10); + r10.length == l10 + 1 && (r10[l10].single = true); + } + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + if (2 != e20 && r10.some(function(e21) { + return e21.comment < 0 && (!e21.empty || e21.single); + })) { + var y10, b10 = [], k10 = bo(r10); + try { + for (k10.s(); !(y10 = k10.n()).done; ) { + var w10 = y10.value, x10 = w10.line, j10 = w10.token, S10 = w10.indent, C10 = w10.empty; + !w10.single && C10 || b10.push({ from: x10.from + S10, insert: j10 + " " }); + } + } catch (e21) { + k10.e(e21); + } finally { + k10.f(); + } + var $10 = t10.changes(b10); + return { changes: $10, selection: t10.selection.map($10, 1) }; + } + if (1 != e20 && r10.some(function(e21) { + return e21.comment >= 0; + })) { + var _10, O10 = [], M10 = bo(r10); + try { + for (M10.s(); !(_10 = M10.n()).done; ) { + var E10 = _10.value, A10 = E10.line, P10 = E10.comment, T8 = E10.token; + if (P10 >= 0) { + var R8 = A10.from + P10, N8 = R8 + T8.length; + " " == A10.text[N8 - A10.from] && N8++, O10.push({ from: R8, to: N8 }); + } + } + } catch (e21) { + M10.e(e21); + } finally { + M10.f(); + } + return { changes: O10 }; + } + return null; + } + var wX = tV.define(); + var xX = tV.define(); + var jX = MF.define(); + var SX = MF.define({ combine: function(e20) { + return gV(e20, { minDepth: 100, newGroupDelay: 500, joinToEvent: function(e21, t10) { + return t10; + } }, { minDepth: Math.max, newGroupDelay: Math.min, joinToEvent: function(e21, t10) { + return function(n10, r10) { + return e21(n10, r10) || t10(n10, r10); + }; + } }); + } }); + var CX = NF.define({ create: function() { + return WX.empty; + }, update: function(e20, t10) { + var n10 = t10.state.facet(SX), r10 = t10.annotation(wX); + if (r10) { + var o10 = NX.fromTransaction(t10, r10.selection), i10 = r10.side, a10 = 0 == i10 ? e20.undone : e20.done; + return a10 = o10 ? IX(a10, a10.length, n10.minDepth, o10) : BX(a10, t10.startState.selection), new WX(0 == i10 ? r10.rest : a10, 0 == i10 ? a10 : r10.rest); + } + var s10 = t10.annotation(xX); + if ("full" != s10 && "before" != s10 || (e20 = e20.isolate()), false === t10.annotation(iV.addToHistory)) + return t10.changes.empty ? e20 : e20.addMapping(t10.changes.desc); + var c10 = NX.fromTransaction(t10), l10 = t10.annotation(iV.time), u10 = t10.annotation(iV.userEvent); + return c10 ? e20 = e20.addChanges(c10, l10, u10, n10, t10) : t10.selection && (e20 = e20.addSelection(t10.startState.selection, l10, u10, n10.newGroupDelay)), "full" != s10 && "after" != s10 || (e20 = e20.isolate()), e20; + }, toJSON: function(e20) { + return { done: e20.done.map(function(e21) { + return e21.toJSON(); + }), undone: e20.undone.map(function(e21) { + return e21.toJSON(); + }) }; + }, fromJSON: function(e20) { + return new WX(e20.done.map(NX.fromJSON), e20.undone.map(NX.fromJSON)); + } }); + function $X() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [CX, SX.of(e20), zJ.domEventHandlers({ beforeinput: function(e21, t10) { + var n10 = "historyUndo" == e21.inputType ? OX : "historyRedo" == e21.inputType ? MX : null; + return !!n10 && (e21.preventDefault(), n10(t10)); + } })]; + } + function _X(e20, t10) { + return function(n10) { + var r10 = n10.state, o10 = n10.dispatch; + if (!t10 && r10.readOnly) + return false; + var i10 = r10.field(CX, false); + if (!i10) + return false; + var a10 = i10.pop(e20, r10, t10); + return !!a10 && (o10(a10), true); + }; + } + var OX = _X(0, false); + var MX = _X(1, false); + var EX = _X(0, true); + var AX = _X(1, true); + function PX(e20) { + return function(t10) { + var n10 = t10.field(CX, false); + if (!n10) + return 0; + var r10 = 0 == e20 ? n10.done : n10.undone; + return r10.length - (r10.length && !r10[0].changes ? 1 : 0); + }; + } + var TX = PX(0); + var RX = PX(1); + var NX = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.changes = t10, this.effects = n10, this.mapped = r10, this.startSelection = o10, this.selectionsAfter = i10; + } + return Do(e20, [{ key: "setSelAfter", value: function(t10) { + return new e20(this.changes, this.effects, this.mapped, this.startSelection, t10); + } }, { key: "toJSON", value: function() { + var e21, t10, n10; + return { changes: null === (e21 = this.changes) || void 0 === e21 ? void 0 : e21.toJSON(), mapped: null === (t10 = this.mapped) || void 0 === t10 ? void 0 : t10.toJSON(), startSelection: null === (n10 = this.startSelection) || void 0 === n10 ? void 0 : n10.toJSON(), selectionsAfter: this.selectionsAfter.map(function(e23) { + return e23.toJSON(); + }) }; + } }], [{ key: "fromJSON", value: function(t10) { + return new e20(t10.changes && yF.fromJSON(t10.changes), [], t10.mapped && gF.fromJSON(t10.mapped), t10.startSelection && $F.fromJSON(t10.startSelection), t10.selectionsAfter.map($F.fromJSON)); + } }, { key: "fromTransaction", value: function(t10, n10) { + var r10, o10 = qX, i10 = bo(t10.startState.facet(jX)); + try { + for (i10.s(); !(r10 = i10.n()).done; ) { + var a10 = (0, r10.value)(t10); + a10.length && (o10 = o10.concat(a10)); + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + return !o10.length && t10.changes.empty ? null : new e20(t10.changes.invert(t10.startState.doc), o10, void 0, n10 || t10.startState.selection, qX); + } }, { key: "selection", value: function(t10) { + return new e20(void 0, qX, void 0, void 0, t10); + } }]), e20; + }(); + function IX(e20, t10, n10, r10) { + var o10 = t10 + 1 > n10 + 20 ? t10 - n10 - 1 : 0, i10 = e20.slice(o10, t10); + return i10.push(r10), i10; + } + function DX(e20, t10) { + return e20.length ? t10.length ? e20.concat(t10) : e20 : t10; + } + var qX = []; + var zX = 200; + function BX(e20, t10) { + if (e20.length) { + var n10 = e20[e20.length - 1], r10 = n10.selectionsAfter.slice(Math.max(0, n10.selectionsAfter.length - zX)); + return r10.length && r10[r10.length - 1].eq(t10) ? e20 : (r10.push(t10), IX(e20, e20.length - 1, 1e9, n10.setSelAfter(r10))); + } + return [NX.selection([t10])]; + } + function LX(e20) { + var t10 = e20[e20.length - 1], n10 = e20.slice(); + return n10[e20.length - 1] = t10.setSelAfter(t10.selectionsAfter.slice(0, t10.selectionsAfter.length - 1)), n10; + } + function FX(e20, t10) { + if (!e20.length) + return e20; + for (var n10 = e20.length, r10 = qX; n10; ) { + var o10 = VX(e20[n10 - 1], t10, r10); + if (o10.changes && !o10.changes.empty || o10.effects.length) { + var i10 = e20.slice(0, n10); + return i10[n10 - 1] = o10, i10; + } + t10 = o10.mapped, n10--, r10 = o10.selectionsAfter; + } + return r10.length ? [NX.selection(r10)] : qX; + } + function VX(e20, t10, n10) { + var r10 = DX(e20.selectionsAfter.length ? e20.selectionsAfter.map(function(e21) { + return e21.map(t10); + }) : qX, n10); + if (!e20.changes) + return NX.selection(r10); + var o10 = e20.changes.map(t10), i10 = t10.mapDesc(e20.changes, true), a10 = e20.mapped ? e20.mapped.composeDesc(i10) : i10; + return new NX(o10, oV.mapEffects(e20.effects, t10), a10, e20.startSelection.map(i10), r10); + } + var HX = /^(input\.type|delete)($|\.)/; + var WX = function() { + function e20(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : void 0; + No(this, e20), this.done = t10, this.undone = n10, this.prevTime = r10, this.prevUserEvent = o10; + } + return Do(e20, [{ key: "isolate", value: function() { + return this.prevTime ? new e20(this.done, this.undone) : this; + } }, { key: "addChanges", value: function(t10, n10, r10, o10, i10) { + var a10 = this.done, s10 = a10[a10.length - 1]; + return a10 = s10 && s10.changes && !s10.changes.empty && t10.changes && (!r10 || HX.test(r10)) && (!s10.selectionsAfter.length && n10 - this.prevTime < o10.newGroupDelay && o10.joinToEvent(i10, function(e21, t11) { + var n11 = [], r11 = false; + return e21.iterChangedRanges(function(e23, t12) { + return n11.push(e23, t12); + }), t11.iterChangedRanges(function(e23, t12, o11, i11) { + for (var a11 = 0; a11 < n11.length; ) { + var s11 = n11[a11++], c10 = n11[a11++]; + i11 >= s11 && o11 <= c10 && (r11 = true); + } + }), r11; + }(s10.changes, t10.changes)) || "input.type.compose" == r10) ? IX(a10, a10.length - 1, o10.minDepth, new NX(t10.changes.compose(s10.changes), DX(t10.effects, s10.effects), s10.mapped, s10.startSelection, qX)) : IX(a10, a10.length, o10.minDepth, t10), new e20(a10, qX, n10, r10); + } }, { key: "addSelection", value: function(t10, n10, r10, o10) { + var i10, a10, s10 = this.done.length ? this.done[this.done.length - 1].selectionsAfter : qX; + return s10.length > 0 && n10 - this.prevTime < o10 && r10 == this.prevUserEvent && r10 && /^select($|\.)/.test(r10) && (i10 = s10[s10.length - 1], a10 = t10, i10.ranges.length == a10.ranges.length && 0 === i10.ranges.filter(function(e21, t11) { + return e21.empty != a10.ranges[t11].empty; + }).length) ? this : new e20(BX(this.done, t10), this.undone, n10, r10); + } }, { key: "addMapping", value: function(t10) { + return new e20(FX(this.done, t10), FX(this.undone, t10), this.prevTime, this.prevUserEvent); + } }, { key: "pop", value: function(e21, t10, n10) { + var r10 = 0 == e21 ? this.done : this.undone; + if (0 == r10.length) + return null; + var o10 = r10[r10.length - 1], i10 = o10.selectionsAfter[0] || t10.selection; + if (n10 && o10.selectionsAfter.length) + return t10.update({ selection: o10.selectionsAfter[o10.selectionsAfter.length - 1], annotations: wX.of({ side: e21, rest: LX(r10), selection: i10 }), userEvent: 0 == e21 ? "select.undo" : "select.redo", scrollIntoView: true }); + if (o10.changes) { + var a10 = 1 == r10.length ? qX : r10.slice(0, r10.length - 1); + return o10.mapped && (a10 = FX(a10, o10.mapped)), t10.update({ changes: o10.changes, selection: o10.startSelection, effects: o10.effects, annotations: wX.of({ side: e21, rest: a10, selection: i10 }), filter: false, userEvent: 0 == e21 ? "undo" : "redo", scrollIntoView: true }); + } + return null; + } }]), e20; + }(); + WX.empty = new WX(qX, qX); + var UX = [{ key: "Mod-z", run: OX, preventDefault: true }, { key: "Mod-y", mac: "Mod-Shift-z", run: MX, preventDefault: true }, { linux: "Ctrl-Shift-z", run: MX, preventDefault: true }, { key: "Mod-u", run: EX, preventDefault: true }, { key: "Alt-u", mac: "Mod-Shift-u", run: AX, preventDefault: true }]; + function JX(e20, t10) { + return $F.create(e20.ranges.map(t10), e20.mainIndex); + } + function KX(e20, t10) { + return e20.update({ selection: t10, scrollIntoView: true, userEvent: "select" }); + } + function GX(e20, t10) { + var n10 = e20.state, r10 = e20.dispatch, o10 = JX(n10.selection, t10); + return !o10.eq(n10.selection, true) && (r10(KX(n10, o10)), true); + } + function QX(e20, t10) { + return $F.cursor(t10 ? e20.to : e20.from); + } + function YX(e20, t10) { + return GX(e20, function(n10) { + return n10.empty ? e20.moveByChar(n10, t10) : QX(n10, t10); + }); + } + function XX(e20) { + return e20.textDirectionAt(e20.state.selection.main.head) == rW.LTR; + } + var ZX = function(e20) { + return YX(e20, !XX(e20)); + }; + var eZ = function(e20) { + return YX(e20, XX(e20)); + }; + function tZ(e20, t10) { + return GX(e20, function(n10) { + return n10.empty ? e20.moveByGroup(n10, t10) : QX(n10, t10); + }); + } + function nZ(e20, t10, n10) { + if (t10.type.prop(n10)) + return true; + var r10 = t10.to - t10.from; + return r10 && (r10 > 2 || /[^\s,.;:]/.test(e20.sliceDoc(t10.from, t10.to))) || t10.firstChild; + } + function rZ(e20, t10, n10) { + for (var r10 = zQ(e20).resolveInner(t10.head), o10 = n10 ? AG.closedBy : AG.openedBy, i10 = t10.head; ; ) { + var a10 = n10 ? r10.childAfter(i10) : r10.childBefore(i10); + if (!a10) + break; + nZ(e20, a10, o10) ? r10 = a10 : i10 = n10 ? a10.to : a10.from; + } + var s10, c10; + return c10 = r10.type.prop(o10) && (s10 = n10 ? ZY(e20, r10.from, 1) : ZY(e20, r10.to, -1)) && s10.matched ? n10 ? s10.end.to : s10.end.from : n10 ? r10.to : r10.from, $F.cursor(c10, n10 ? -1 : 1); + } + function oZ(e20, t10) { + return GX(e20, function(n10) { + if (!n10.empty) + return QX(n10, t10); + var r10 = e20.moveVertically(n10, t10); + return r10.head != n10.head ? r10 : e20.moveToLineBoundary(n10, t10); + }); + } + var iZ = function(e20) { + return oZ(e20, false); + }; + var aZ = function(e20) { + return oZ(e20, true); + }; + function sZ(e20) { + var t10, n10 = e20.scrollDOM.clientHeight < e20.scrollDOM.scrollHeight - 2, r10 = 0, o10 = 0; + if (n10) { + var i10, a10 = bo(e20.state.facet(zJ.scrollMargins)); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = (0, i10.value)(e20); + (null == s10 ? void 0 : s10.top) && (r10 = Math.max(null == s10 ? void 0 : s10.top, r10)), (null == s10 ? void 0 : s10.bottom) && (o10 = Math.max(null == s10 ? void 0 : s10.bottom, o10)); + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + t10 = e20.scrollDOM.clientHeight - r10 - o10; + } else + t10 = (e20.dom.ownerDocument.defaultView || window).innerHeight; + return { marginTop: r10, marginBottom: o10, selfScroll: n10, height: Math.max(e20.defaultLineHeight, t10 - 5) }; + } + function cZ(e20, t10) { + var n10, r10 = sZ(e20), o10 = e20.state, i10 = JX(o10.selection, function(n11) { + return n11.empty ? e20.moveVertically(n11, t10, r10.height) : QX(n11, t10); + }); + if (i10.eq(o10.selection)) + return false; + if (r10.selfScroll) { + var a10 = e20.coordsAtPos(o10.selection.main.head), s10 = e20.scrollDOM.getBoundingClientRect(), c10 = s10.top + r10.marginTop, l10 = s10.bottom - r10.marginBottom; + a10 && a10.top > c10 && a10.bottom < l10 && (n10 = zJ.scrollIntoView(i10.main.head, { y: "start", yMargin: a10.top - c10 })); + } + return e20.dispatch(KX(o10, i10), { effects: n10 }), true; + } + var lZ = function(e20) { + return cZ(e20, false); + }; + var uZ = function(e20) { + return cZ(e20, true); + }; + function fZ(e20, t10, n10) { + var r10 = e20.lineBlockAt(t10.head), o10 = e20.moveToLineBoundary(t10, n10); + if (o10.head == t10.head && o10.head != (n10 ? r10.to : r10.from) && (o10 = e20.moveToLineBoundary(t10, n10, false)), !n10 && o10.head == r10.from && r10.length) { + var i10 = /^\s*/.exec(e20.state.sliceDoc(r10.from, Math.min(r10.from + 100, r10.to)))[0].length; + i10 && t10.head != r10.from + i10 && (o10 = $F.cursor(r10.from + i10)); + } + return o10; + } + function dZ(e20, t10) { + var n10 = JX(e20.state.selection, function(e21) { + var n11 = t10(e21); + return $F.range(e21.anchor, n11.head, n11.goalColumn, n11.bidiLevel || void 0); + }); + return !n10.eq(e20.state.selection) && (e20.dispatch(KX(e20.state, n10)), true); + } + function hZ(e20, t10) { + return dZ(e20, function(n10) { + return e20.moveByChar(n10, t10); + }); + } + var vZ = function(e20) { + return hZ(e20, !XX(e20)); + }; + var pZ = function(e20) { + return hZ(e20, XX(e20)); + }; + function mZ(e20, t10) { + return dZ(e20, function(n10) { + return e20.moveByGroup(n10, t10); + }); + } + function gZ(e20, t10) { + return dZ(e20, function(n10) { + return e20.moveVertically(n10, t10); + }); + } + var yZ = function(e20) { + return gZ(e20, false); + }; + var bZ = function(e20) { + return gZ(e20, true); + }; + function kZ(e20, t10) { + return dZ(e20, function(n10) { + return e20.moveVertically(n10, t10, sZ(e20).height); + }); + } + var wZ = function(e20) { + return kZ(e20, false); + }; + var xZ = function(e20) { + return kZ(e20, true); + }; + var jZ = function(e20) { + var t10 = e20.state; + return (0, e20.dispatch)(KX(t10, { anchor: 0 })), true; + }; + var SZ = function(e20) { + var t10 = e20.state; + return (0, e20.dispatch)(KX(t10, { anchor: t10.doc.length })), true; + }; + var CZ = function(e20) { + var t10 = e20.state; + return (0, e20.dispatch)(KX(t10, { anchor: t10.selection.main.anchor, head: 0 })), true; + }; + var $Z = function(e20) { + var t10 = e20.state; + return (0, e20.dispatch)(KX(t10, { anchor: t10.selection.main.anchor, head: t10.doc.length })), true; + }; + function _Z(e20, t10) { + if (e20.state.readOnly) + return false; + var n10 = "delete.selection", r10 = e20.state, o10 = r10.changeByRange(function(r11) { + var o11 = r11.from, i10 = r11.to; + if (o11 == i10) { + var a10 = t10(r11); + a10 < o11 ? (n10 = "delete.backward", a10 = OZ(e20, a10, false)) : a10 > o11 && (n10 = "delete.forward", a10 = OZ(e20, a10, true)), o11 = Math.min(o11, a10), i10 = Math.max(i10, a10); + } else + o11 = OZ(e20, o11, false), i10 = OZ(e20, i10, true); + return o11 == i10 ? { range: r11 } : { changes: { from: o11, to: i10 }, range: $F.cursor(o11, o11 < r11.head ? -1 : 1) }; + }); + return !o10.changes.empty && (e20.dispatch(r10.update(o10, { scrollIntoView: true, userEvent: n10, effects: "delete.selection" == n10 ? zJ.announce.of(r10.phrase("Selection deleted")) : void 0 })), true); + } + function OZ(e20, t10, n10) { + if (e20 instanceof zJ) { + var r10, o10 = bo(e20.state.facet(zJ.atomicRanges).map(function(t11) { + return t11(e20); + })); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + r10.value.between(t10, t10, function(e21, r11) { + e21 < t10 && r11 > t10 && (t10 = n10 ? r11 : e21); + }); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + } + return t10; + } + var MZ = function(e20, t10) { + return _Z(e20, function(n10) { + var r10, o10, i10 = n10.from, a10 = e20.state, s10 = a10.doc.lineAt(i10); + if (!t10 && i10 > s10.from && i10 < s10.from + 200 && !/[^ \t]/.test(r10 = s10.text.slice(0, i10 - s10.from))) { + if (" " == r10[r10.length - 1]) + return i10 - 1; + for (var c10 = RV(r10, a10.tabSize) % XQ(a10) || XQ(a10), l10 = 0; l10 < c10 && " " == r10[r10.length - 1 - l10]; l10++) + i10--; + o10 = i10; + } else + (o10 = sF(s10.text, i10 - s10.from, t10, t10) + s10.from) == i10 && s10.number != (t10 ? a10.doc.lines : 1) ? o10 += t10 ? 1 : -1 : !t10 && /[\ufe00-\ufe0f]/.test(s10.text.slice(o10 - s10.from, i10 - s10.from)) && (o10 = sF(s10.text, o10 - s10.from, false, false) + s10.from); + return o10; + }); + }; + var EZ = function(e20) { + return MZ(e20, false); + }; + var AZ = function(e20) { + return MZ(e20, true); + }; + var PZ = function(e20, t10) { + return _Z(e20, function(n10) { + for (var r10 = n10.head, o10 = e20.state, i10 = o10.doc.lineAt(r10), a10 = o10.charCategorizer(r10), s10 = null; ; ) { + if (r10 == (t10 ? i10.to : i10.from)) { + r10 == n10.head && i10.number != (t10 ? o10.doc.lines : 1) && (r10 += t10 ? 1 : -1); + break; + } + var c10 = sF(i10.text, r10 - i10.from, t10) + i10.from, l10 = i10.text.slice(Math.min(r10, c10) - i10.from, Math.max(r10, c10) - i10.from), u10 = a10(l10); + if (null != s10 && u10 != s10) + break; + " " == l10 && r10 == n10.head || (s10 = u10), r10 = c10; + } + return r10; + }); + }; + var TZ = function(e20) { + return PZ(e20, false); + }; + function RZ(e20) { + var t10, n10 = [], r10 = -1, o10 = bo(e20.selection.ranges); + try { + for (o10.s(); !(t10 = o10.n()).done; ) { + var i10 = t10.value, a10 = e20.doc.lineAt(i10.from), s10 = e20.doc.lineAt(i10.to); + if (i10.empty || i10.to != s10.from || (s10 = e20.doc.lineAt(i10.to - 1)), r10 >= a10.number) { + var c10 = n10[n10.length - 1]; + c10.to = s10.to, c10.ranges.push(i10); + } else + n10.push({ from: a10.from, to: s10.to, ranges: [i10] }); + r10 = s10.number + 1; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return n10; + } + function NZ(e20, t10, n10) { + if (e20.readOnly) + return false; + var r10, o10 = [], i10 = [], a10 = bo(RZ(e20)); + try { + for (a10.s(); !(r10 = a10.n()).done; ) { + var s10 = r10.value; + if (n10 ? s10.to != e20.doc.length : 0 != s10.from) { + var c10 = e20.doc.lineAt(n10 ? s10.to + 1 : s10.from - 1), l10 = c10.length + 1; + if (n10) { + o10.push({ from: s10.to, to: c10.to }, { from: s10.from, insert: c10.text + e20.lineBreak }); + var u10, f10 = bo(s10.ranges); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value; + i10.push($F.range(Math.min(e20.doc.length, d10.anchor + l10), Math.min(e20.doc.length, d10.head + l10))); + } + } catch (e21) { + f10.e(e21); + } finally { + f10.f(); + } + } else { + o10.push({ from: c10.from, to: s10.from }, { from: s10.to, insert: e20.lineBreak + c10.text }); + var h10, v10 = bo(s10.ranges); + try { + for (v10.s(); !(h10 = v10.n()).done; ) { + var p10 = h10.value; + i10.push($F.range(p10.anchor - l10, p10.head - l10)); + } + } catch (e21) { + v10.e(e21); + } finally { + v10.f(); + } + } + } + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return !!o10.length && (t10(e20.update({ changes: o10, scrollIntoView: true, selection: $F.create(i10, e20.selection.mainIndex), userEvent: "move.line" })), true); + } + function IZ(e20, t10, n10) { + if (e20.readOnly) + return false; + var r10, o10 = [], i10 = bo(RZ(e20)); + try { + for (i10.s(); !(r10 = i10.n()).done; ) { + var a10 = r10.value; + n10 ? o10.push({ from: a10.from, insert: e20.doc.slice(a10.from, a10.to) + e20.lineBreak }) : o10.push({ from: a10.to, insert: e20.lineBreak + e20.doc.slice(a10.from, a10.to) }); + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + return t10(e20.update({ changes: o10, scrollIntoView: true, userEvent: "input.copyline" })), true; + } + var DZ = zZ(false); + var qZ = zZ(true); + function zZ(e20) { + return function(t10) { + var n10 = t10.state, r10 = t10.dispatch; + if (n10.readOnly) + return false; + var o10 = n10.changeByRange(function(t11) { + var r11 = t11.from, o11 = t11.to, i10 = n10.doc.lineAt(r11), a10 = !e20 && r11 == o11 && function(e21, t12) { + if (/\(\)|\[\]|\{\}/.test(e21.sliceDoc(t12 - 1, t12 + 1))) + return { from: t12, to: t12 }; + var n11, r12 = zQ(e21).resolveInner(t12), o12 = r12.childBefore(t12), i11 = r12.childAfter(t12); + return o12 && i11 && o12.to <= t12 && i11.from >= t12 && (n11 = o12.type.prop(AG.closedBy)) && n11.indexOf(i11.name) > -1 && e21.doc.lineAt(o12.to).from == e21.doc.lineAt(i11.from).from && !/\S/.test(e21.sliceDoc(o12.to, i11.from)) ? { from: o12.to, to: i11.from } : null; + }(n10, r11); + e20 && (r11 = o11 = (o11 <= i10.to ? i10 : n10.doc.lineAt(o11)).to); + var s10 = new tY(n10, { simulateBreak: r11, simulateDoubleBreak: !!a10 }), c10 = eY(s10, r11); + for (null == c10 && (c10 = RV(/^\s*/.exec(n10.doc.lineAt(r11).text)[0], n10.tabSize)); o11 < i10.to && /\s/.test(i10.text[o11 - i10.from]); ) + o11++; + a10 ? (r11 = a10.from, o11 = a10.to) : r11 > i10.from && r11 < i10.from + 100 && !/\S/.test(i10.text.slice(0, r11)) && (r11 = i10.from); + var l10 = ["", ZQ(n10, c10)]; + return a10 && l10.push(ZQ(n10, s10.lineIndent(i10.from, -1))), { changes: { from: r11, to: o11, insert: UL.of(l10) }, range: $F.cursor(r11 + 1 + l10[1].length) }; + }); + return r10(n10.update(o10, { scrollIntoView: true, userEvent: "input" })), true; + }; + } + function BZ(e20, t10) { + var n10 = -1; + return e20.changeByRange(function(r10) { + for (var o10 = [], i10 = r10.from; i10 <= r10.to; ) { + var a10 = e20.doc.lineAt(i10); + a10.number > n10 && (r10.empty || r10.to > a10.from) && (t10(a10, o10, r10), n10 = a10.number), i10 = a10.to + 1; + } + var s10 = e20.changes(o10); + return { changes: o10, range: $F.range(s10.mapPos(r10.anchor, 1), s10.mapPos(r10.head, 1)) }; + }); + } + var LZ = function(e20) { + var t10 = e20.state, n10 = e20.dispatch; + return !t10.readOnly && (n10(t10.update(BZ(t10, function(e21, n11) { + n11.push({ from: e21.from, insert: t10.facet(YQ) }); + }), { userEvent: "input.indent" })), true); + }; + var FZ = function(e20) { + var t10 = e20.state, n10 = e20.dispatch; + return !t10.readOnly && (n10(t10.update(BZ(t10, function(e21, n11) { + var r10 = /^\s*/.exec(e21.text)[0]; + if (r10) { + for (var o10 = RV(r10, t10.tabSize), i10 = 0, a10 = ZQ(t10, Math.max(0, o10 - XQ(t10))); i10 < r10.length && i10 < a10.length && r10.charCodeAt(i10) == a10.charCodeAt(i10); ) + i10++; + n11.push({ from: e21.from + i10, to: e21.from + r10.length, insert: a10.slice(i10) }); + } + }), { userEvent: "delete.dedent" })), true); + }; + var VZ = [{ key: "Ctrl-b", run: ZX, shift: vZ, preventDefault: true }, { key: "Ctrl-f", run: eZ, shift: pZ }, { key: "Ctrl-p", run: iZ, shift: yZ }, { key: "Ctrl-n", run: aZ, shift: bZ }, { key: "Ctrl-a", run: function(e20) { + return GX(e20, function(t10) { + return $F.cursor(e20.lineBlockAt(t10.head).from, 1); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return $F.cursor(e20.lineBlockAt(t10.head).from); + }); + } }, { key: "Ctrl-e", run: function(e20) { + return GX(e20, function(t10) { + return $F.cursor(e20.lineBlockAt(t10.head).to, -1); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return $F.cursor(e20.lineBlockAt(t10.head).to); + }); + } }, { key: "Ctrl-d", run: AZ }, { key: "Ctrl-h", run: EZ }, { key: "Ctrl-k", run: function(e20) { + return _Z(e20, function(t10) { + var n10 = e20.lineBlockAt(t10.head).to; + return t10.head < n10 ? n10 : Math.min(e20.state.doc.length, t10.head + 1); + }); + } }, { key: "Ctrl-Alt-h", run: TZ }, { key: "Ctrl-o", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch; + if (t10.readOnly) + return false; + var r10 = t10.changeByRange(function(e21) { + return { changes: { from: e21.from, to: e21.to, insert: UL.of(["", ""]) }, range: $F.cursor(e21.from) }; + }); + return n10(t10.update(r10, { scrollIntoView: true, userEvent: "input" })), true; + } }, { key: "Ctrl-t", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch; + if (t10.readOnly) + return false; + var r10 = t10.changeByRange(function(e21) { + if (!e21.empty || 0 == e21.from || e21.from == t10.doc.length) + return { range: e21 }; + var n11 = e21.from, r11 = t10.doc.lineAt(n11), o10 = n11 == r11.from ? n11 - 1 : sF(r11.text, n11 - r11.from, false) + r11.from, i10 = n11 == r11.to ? n11 + 1 : sF(r11.text, n11 - r11.from, true) + r11.from; + return { changes: { from: o10, to: i10, insert: t10.doc.slice(n11, i10).append(t10.doc.slice(o10, n11)) }, range: $F.cursor(i10) }; + }); + return !r10.changes.empty && (n10(t10.update(r10, { scrollIntoView: true, userEvent: "move.character" })), true); + } }, { key: "Ctrl-v", run: uZ }]; + var HZ = [{ key: "ArrowLeft", run: ZX, shift: vZ, preventDefault: true }, { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: function(e20) { + return tZ(e20, !XX(e20)); + }, shift: function(e20) { + return mZ(e20, !XX(e20)); + }, preventDefault: true }, { mac: "Cmd-ArrowLeft", run: function(e20) { + return GX(e20, function(t10) { + return fZ(e20, t10, !XX(e20)); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return fZ(e20, t10, !XX(e20)); + }); + }, preventDefault: true }, { key: "ArrowRight", run: eZ, shift: pZ, preventDefault: true }, { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: function(e20) { + return tZ(e20, XX(e20)); + }, shift: function(e20) { + return mZ(e20, XX(e20)); + }, preventDefault: true }, { mac: "Cmd-ArrowRight", run: function(e20) { + return GX(e20, function(t10) { + return fZ(e20, t10, XX(e20)); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return fZ(e20, t10, XX(e20)); + }); + }, preventDefault: true }, { key: "ArrowUp", run: iZ, shift: yZ, preventDefault: true }, { mac: "Cmd-ArrowUp", run: jZ, shift: CZ }, { mac: "Ctrl-ArrowUp", run: lZ, shift: wZ }, { key: "ArrowDown", run: aZ, shift: bZ, preventDefault: true }, { mac: "Cmd-ArrowDown", run: SZ, shift: $Z }, { mac: "Ctrl-ArrowDown", run: uZ, shift: xZ }, { key: "PageUp", run: lZ, shift: wZ }, { key: "PageDown", run: uZ, shift: xZ }, { key: "Home", run: function(e20) { + return GX(e20, function(t10) { + return fZ(e20, t10, false); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return fZ(e20, t10, false); + }); + }, preventDefault: true }, { key: "Mod-Home", run: jZ, shift: CZ }, { key: "End", run: function(e20) { + return GX(e20, function(t10) { + return fZ(e20, t10, true); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return fZ(e20, t10, true); + }); + }, preventDefault: true }, { key: "Mod-End", run: SZ, shift: $Z }, { key: "Enter", run: DZ }, { key: "Mod-a", run: function(e20) { + var t10 = e20.state; + return (0, e20.dispatch)(t10.update({ selection: { anchor: 0, head: t10.doc.length }, userEvent: "select" })), true; + } }, { key: "Backspace", run: EZ, shift: EZ }, { key: "Delete", run: AZ }, { key: "Mod-Backspace", mac: "Alt-Backspace", run: TZ }, { key: "Mod-Delete", mac: "Alt-Delete", run: function(e20) { + return PZ(e20, true); + } }, { mac: "Mod-Backspace", run: function(e20) { + return _Z(e20, function(t10) { + var n10 = e20.moveToLineBoundary(t10, false).head; + return t10.head > n10 ? n10 : Math.max(0, t10.head - 1); + }); + } }, { mac: "Mod-Delete", run: function(e20) { + return _Z(e20, function(t10) { + var n10 = e20.moveToLineBoundary(t10, true).head; + return t10.head < n10 ? n10 : Math.min(e20.state.doc.length, t10.head + 1); + }); + } }].concat(VZ.map(function(e20) { + return { mac: e20.key, run: e20.run, shift: e20.shift }; + })); + var WZ = [{ key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: function(e20) { + return GX(e20, function(t10) { + return rZ(e20.state, t10, !XX(e20)); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return rZ(e20.state, t10, !XX(e20)); + }); + } }, { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: function(e20) { + return GX(e20, function(t10) { + return rZ(e20.state, t10, XX(e20)); + }); + }, shift: function(e20) { + return dZ(e20, function(t10) { + return rZ(e20.state, t10, XX(e20)); + }); + } }, { key: "Alt-ArrowUp", run: function(e20) { + return NZ(e20.state, e20.dispatch, false); + } }, { key: "Shift-Alt-ArrowUp", run: function(e20) { + return IZ(e20.state, e20.dispatch, false); + } }, { key: "Alt-ArrowDown", run: function(e20) { + return NZ(e20.state, e20.dispatch, true); + } }, { key: "Shift-Alt-ArrowDown", run: function(e20) { + return IZ(e20.state, e20.dispatch, true); + } }, { key: "Escape", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch, r10 = t10.selection, o10 = null; + return r10.ranges.length > 1 ? o10 = $F.create([r10.main]) : r10.main.empty || (o10 = $F.create([$F.cursor(r10.main.head)])), !!o10 && (n10(KX(t10, o10)), true); + } }, { key: "Mod-Enter", run: qZ }, { key: "Alt-l", mac: "Ctrl-l", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch, r10 = RZ(t10).map(function(e21) { + var n11 = e21.from, r11 = e21.to; + return $F.range(n11, Math.min(r11 + 1, t10.doc.length)); + }); + return n10(t10.update({ selection: $F.create(r10), userEvent: "select" })), true; + } }, { key: "Mod-i", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch, r10 = JX(t10.selection, function(e21) { + for (var n11, r11 = zQ(t10).resolveStack(e21.from, 1); r11; r11 = r11.next) { + var o10 = r11.node; + if ((o10.from < e21.from && o10.to >= e21.to || o10.to > e21.to && o10.from <= e21.from) && (null === (n11 = o10.parent) || void 0 === n11 ? void 0 : n11.parent)) + return $F.range(o10.to, o10.from); + } + return e21; + }); + return n10(KX(t10, r10)), true; + }, preventDefault: true }, { key: "Mod-[", run: FZ }, { key: "Mod-]", run: LZ }, { key: "Mod-Alt-\\", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch; + if (t10.readOnly) + return false; + var r10 = /* @__PURE__ */ Object.create(null), o10 = new tY(t10, { overrideIndentation: function(e21) { + var t11 = r10[e21]; + return null == t11 ? -1 : t11; + } }), i10 = BZ(t10, function(e21, n11, i11) { + var a10 = eY(o10, e21.from); + if (null != a10) { + /\S/.test(e21.text) || (a10 = 0); + var s10 = /^\s*/.exec(e21.text)[0], c10 = ZQ(t10, a10); + (s10 != c10 || i11.from < e21.from + s10.length) && (r10[e21.from] = a10, n11.push({ from: e21.from, to: e21.from + s10.length, insert: c10 })); + } + }); + return i10.changes.empty || n10(t10.update(i10, { userEvent: "indent" })), true; + } }, { key: "Shift-Mod-k", run: function(e20) { + if (e20.state.readOnly) + return false; + var t10 = e20.state, n10 = t10.changes(RZ(t10).map(function(e21) { + var n11 = e21.from, r11 = e21.to; + return n11 > 0 ? n11-- : r11 < t10.doc.length && r11++, { from: n11, to: r11 }; + })), r10 = JX(t10.selection, function(t11) { + return e20.moveVertically(t11, true); + }).map(n10); + return e20.dispatch({ changes: n10, selection: r10, scrollIntoView: true, userEvent: "delete.line" }), true; + } }, { key: "Shift-Mod-\\", run: function(e20) { + return function(e21, t10, n10) { + var r10 = false, o10 = JX(e21.selection, function(t11) { + var o11 = ZY(e21, t11.head, -1) || ZY(e21, t11.head, 1) || t11.head > 0 && ZY(e21, t11.head - 1, 1) || t11.head < e21.doc.length && ZY(e21, t11.head + 1, -1); + if (!o11 || !o11.end) + return t11; + r10 = true; + var i10 = o11.start.from == t11.head ? o11.end.to : o11.end.from; + return n10 ? $F.range(t11.anchor, i10) : $F.cursor(i10); + }); + return !!r10 && (t10(KX(e21, o10)), true); + }(e20.state, e20.dispatch, false); + } }, { key: "Mod-/", run: function(e20) { + var t10 = e20.state, n10 = t10.doc.lineAt(t10.selection.main.from), r10 = gX(e20.state, n10.from); + return r10.line ? vX(e20) : !!r10.block && mX(e20); + } }, { key: "Alt-A", run: pX }].concat(HZ); + var UZ = { key: "Tab", run: LZ, shift: FZ }; + function JZ() { + var e20 = arguments[0]; + "string" == typeof e20 && (e20 = document.createElement(e20)); + var t10 = 1, n10 = arguments[1]; + if (n10 && "object" == Ho(n10) && null == n10.nodeType && !Array.isArray(n10)) { + for (var r10 in n10) + if (Object.prototype.hasOwnProperty.call(n10, r10)) { + var o10 = n10[r10]; + "string" == typeof o10 ? e20.setAttribute(r10, o10) : null != o10 && (e20[r10] = o10); + } + t10++; + } + for (; t10 < arguments.length; t10++) + KZ(e20, arguments[t10]); + return e20; + } + function KZ(e20, t10) { + if ("string" == typeof t10) + e20.appendChild(document.createTextNode(t10)); + else if (null == t10) + ; + else if (null != t10.nodeType) + e20.appendChild(t10); + else { + if (!Array.isArray(t10)) + throw new RangeError("Unsupported child node: " + t10); + for (var n10 = 0; n10 < t10.length; n10++) + KZ(e20, t10[n10]); + } + } + var GZ = Do(function e10(t10, n10, r10) { + No(this, e10), this.from = t10, this.to = n10, this.diagnostic = r10; + }); + var QZ = function() { + function e20(t10, n10, r10) { + No(this, e20), this.diagnostics = t10, this.panel = n10, this.selected = r10; + } + return Do(e20, null, [{ key: "init", value: function(t10, n10, r10) { + var o10 = t10, i10 = r10.facet(u0).markerFilter; + i10 && (o10 = i10(o10)); + var a10 = KH.set(o10.map(function(e21) { + return e21.from == e21.to || e21.from == e21.to - 1 && r10.doc.lineAt(e21.from).to == e21.from ? KH.widget({ widget: new h0(e21), diagnostic: e21 }).range(e21.from) : KH.mark({ attributes: { class: "cm-lintRange cm-lintRange-" + e21.severity + (e21.markClass ? " " + e21.markClass : "") }, diagnostic: e21 }).range(e21.from, e21.to); + }), true); + return new e20(a10, n10, YZ(a10)); + } }]), e20; + }(); + function YZ(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r10 = null; + return e20.between(n10, 1e9, function(e21, n11, o10) { + var i10 = o10.spec; + if (!t10 || i10.diagnostic == t10) + return r10 = new GZ(e21, n11, i10.diagnostic), false; + }), r10; + } + function XZ(e20, t10) { + var n10 = e20.startState.doc.lineAt(t10.pos); + return !(!e20.effects.some(function(e21) { + return e21.is(e0); + }) && !e20.changes.touchesRange(n10.from, n10.to)); + } + function ZZ(e20, t10) { + return e20.field(r0, false) ? t10 : t10.concat(oV.appendConfig.of(_0)); + } + var e0 = oV.define(); + var t0 = oV.define(); + var n0 = oV.define(); + var r0 = NF.define({ create: function() { + return new QZ(KH.none, null, null); + }, update: function(e20, t10) { + if (t10.docChanged) { + var n10 = e20.diagnostics.map(t10.changes), r10 = null; + if (e20.selected) { + var o10 = t10.changes.mapPos(e20.selected.from, 1); + r10 = YZ(n10, e20.selected.diagnostic, o10) || YZ(n10, null, o10); + } + e20 = new QZ(n10, e20.panel, r10); + } + var i10, a10 = bo(t10.effects); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + s10.is(e0) ? e20 = QZ.init(s10.value, e20.panel, t10.state) : s10.is(t0) ? e20 = new QZ(e20.diagnostics, s10.value ? p0.open : null, e20.selected) : s10.is(n0) && (e20 = new QZ(e20.diagnostics, e20.panel, s10.value)); + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return e20; + }, provide: function(e20) { + return [aG.from(e20, function(e21) { + return e21.panel; + }), zJ.decorations.from(e20, function(e21) { + return e21.diagnostics; + })]; + } }); + var o0 = KH.mark({ class: "cm-lintRange cm-lintRange-active" }); + function i0(e20, t10, n10) { + var r10 = e20.state.field(r0).diagnostics, o10 = [], i10 = 2e8, a10 = 0; + r10.between(t10 - (n10 < 0 ? 1 : 0), t10 + (n10 > 0 ? 1 : 0), function(e21, r11, s11) { + var c10 = s11.spec; + t10 >= e21 && t10 <= r11 && (e21 == r11 || (t10 > e21 || n10 > 0) && (t10 < r11 || n10 < 0)) && (o10.push(c10.diagnostic), i10 = Math.min(e21, i10), a10 = Math.max(r11, a10)); + }); + var s10 = e20.state.facet(u0).tooltipFilter; + return s10 && (o10 = s10(o10)), o10.length ? { pos: i10, end: a10, above: e20.state.doc.lineAt(i10).to < a10, create: function() { + return { dom: a0(e20, o10) }; + } } : null; + } + function a0(e20, t10) { + return JZ("ul", { class: "cm-tooltip-lint" }, t10.map(function(t11) { + return d0(e20, t11, false); + })); + } + var s0 = function(e20) { + var t10 = e20.state.field(r0, false); + return !(!t10 || !t10.panel) && (e20.dispatch({ effects: t0.of(false) }), true); + }; + var c0 = [{ key: "Mod-Shift-m", run: function(e20) { + var t10 = e20.state.field(r0, false); + t10 && t10.panel || e20.dispatch({ effects: ZZ(e20.state, [t0.of(true)]) }); + var n10 = nG(e20, p0.open); + return n10 && n10.dom.querySelector(".cm-panel-lint ul").focus(), true; + }, preventDefault: true }, { key: "F8", run: function(e20) { + var t10 = e20.state.field(r0, false); + if (!t10) + return false; + var n10 = e20.state.selection.main, r10 = t10.diagnostics.iter(n10.to + 1); + return !(!r10.value && (!(r10 = t10.diagnostics.iter(0)).value || r10.from == n10.from && r10.to == n10.to)) && (e20.dispatch({ selection: { anchor: r10.from, head: r10.to }, scrollIntoView: true }), true); + } }]; + var l0 = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.view = t10, this.timeout = -1, this.set = true; + var n10 = t10.state.facet(u0).delay; + this.lintTime = Date.now() + n10, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, n10); + } + return Do(e20, [{ key: "run", value: function() { + var e21 = this, t10 = Date.now(); + if (t10 < this.lintTime - 10) + this.timeout = setTimeout(this.run, this.lintTime - t10); + else { + this.set = false; + var n10 = this.view.state, r10 = n10.facet(u0).sources; + Promise.all(r10.map(function(t11) { + return Promise.resolve(t11(e21.view)); + })).then(function(t11) { + var r11 = t11.reduce(function(e23, t12) { + return e23.concat(t12); + }); + e21.view.state.doc == n10.doc && e21.view.dispatch(function(e23, t12) { + return { effects: ZZ(e23, [e0.of(t12)]) }; + }(e21.view.state, r11)); + }, function(t11) { + qW(e21.view.state, t11); + }); + } + } }, { key: "update", value: function(e21) { + var t10 = e21.state.facet(u0); + (e21.docChanged || t10 != e21.startState.facet(u0) || t10.needsRefresh && t10.needsRefresh(e21)) && (this.lintTime = Date.now() + t10.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, t10.delay))); + } }, { key: "force", value: function() { + this.set && (this.lintTime = Date.now(), this.run()); + } }, { key: "destroy", value: function() { + clearTimeout(this.timeout); + } }]), e20; + }()); + var u0 = MF.define({ combine: function(e20) { + return Object.assign({ sources: e20.map(function(e21) { + return e21.source; + }) }, gV(e20.map(function(e21) { + return e21.config; + }), { delay: 750, markerFilter: null, tooltipFilter: null, needsRefresh: null }, { needsRefresh: function(e21, t10) { + return e21 ? t10 ? function(n10) { + return e21(n10) || t10(n10); + } : e21 : t10; + } })); + } }); + function f0(e20) { + var t10 = []; + if (e20) { + var n10, r10 = bo(e20); + try { + e: + for (r10.s(); !(n10 = r10.n()).done; ) { + for (var o10 = n10.value.name, i10 = function() { + var e21 = o10[a10]; + if (/[a-zA-Z]/.test(e21) && !t10.some(function(t11) { + return t11.toLowerCase() == e21.toLowerCase(); + })) + return t10.push(e21), 1; + }, a10 = 0; a10 < o10.length; a10++) + if (i10()) + continue e; + t10.push(""); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + } + return t10; + } + function d0(e20, t10, n10) { + var r10, o10 = n10 ? f0(t10.actions) : []; + return JZ("li", { class: "cm-diagnostic cm-diagnostic-" + t10.severity }, JZ("span", { class: "cm-diagnosticText" }, t10.renderMessage ? t10.renderMessage() : t10.message), null === (r10 = t10.actions) || void 0 === r10 ? void 0 : r10.map(function(n11, r11) { + var i10 = false, a10 = function(r12) { + if (r12.preventDefault(), !i10) { + i10 = true; + var o11 = YZ(e20.state.field(r0).diagnostics, t10); + o11 && n11.apply(e20, o11.from, o11.to); + } + }, s10 = n11.name, c10 = o10[r11] ? s10.indexOf(o10[r11]) : -1, l10 = c10 < 0 ? s10 : [s10.slice(0, c10), JZ("u", s10.slice(c10, c10 + 1)), s10.slice(c10 + 1)]; + return JZ("button", { type: "button", class: "cm-diagnosticAction", onclick: a10, onmousedown: a10, "aria-label": " Action: ".concat(s10).concat(c10 < 0 ? "" : ' (access key "'.concat(o10[r11], ')"'), ".") }, l10); + }), t10.source && JZ("div", { class: "cm-diagnosticSource" }, t10.source)); + } + var h0 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).diagnostic = e21, n10; + } + return Ao(t10, UH), Do(t10, [{ key: "eq", value: function(e21) { + return e21.diagnostic == this.diagnostic; + } }, { key: "toDOM", value: function() { + return JZ("span", { class: "cm-lintPoint cm-lintPoint-" + this.diagnostic.severity }); + } }]), t10; + }(); + var v0 = Do(function e11(t10, n10) { + No(this, e11), this.diagnostic = n10, this.id = "item_" + Math.floor(4294967295 * Math.random()).toString(16), this.dom = d0(t10, n10, true), this.dom.id = this.id, this.dom.setAttribute("role", "option"); + }); + var p0 = function() { + function e20(t10) { + var n10 = this; + No(this, e20), this.view = t10, this.items = []; + this.list = JZ("ul", { tabIndex: 0, role: "listbox", "aria-label": this.view.state.phrase("Diagnostics"), onkeydown: function(e21) { + if (27 == e21.keyCode) + s0(n10.view), n10.view.focus(); + else if (38 == e21.keyCode || 33 == e21.keyCode) + n10.moveSelection((n10.selectedIndex - 1 + n10.items.length) % n10.items.length); + else if (40 == e21.keyCode || 34 == e21.keyCode) + n10.moveSelection((n10.selectedIndex + 1) % n10.items.length); + else if (36 == e21.keyCode) + n10.moveSelection(0); + else if (35 == e21.keyCode) + n10.moveSelection(n10.items.length - 1); + else if (13 == e21.keyCode) + n10.view.focus(); + else { + if (!(e21.keyCode >= 65 && e21.keyCode <= 90 && n10.selectedIndex >= 0)) + return; + for (var r10 = n10.items[n10.selectedIndex].diagnostic, o10 = f0(r10.actions), i10 = 0; i10 < o10.length; i10++) + if (o10[i10].toUpperCase().charCodeAt(0) == e21.keyCode) { + var a10 = YZ(n10.view.state.field(r0).diagnostics, r10); + a10 && r10.actions[i10].apply(t10, a10.from, a10.to); + } + } + e21.preventDefault(); + }, onclick: function(e21) { + for (var t11 = 0; t11 < n10.items.length; t11++) + n10.items[t11].dom.contains(e21.target) && n10.moveSelection(t11); + } }), this.dom = JZ("div", { class: "cm-panel-lint" }, this.list, JZ("button", { type: "button", name: "close", "aria-label": this.view.state.phrase("close"), onclick: function() { + return s0(n10.view); + } }, "\xD7")), this.update(); + } + return Do(e20, [{ key: "selectedIndex", get: function() { + var e21 = this.view.state.field(r0).selected; + if (!e21) + return -1; + for (var t10 = 0; t10 < this.items.length; t10++) + if (this.items[t10].diagnostic == e21.diagnostic) + return t10; + return -1; + } }, { key: "update", value: function() { + var e21 = this, t10 = this.view.state.field(r0), n10 = t10.diagnostics, r10 = t10.selected, o10 = 0, i10 = false, a10 = null; + for (n10.between(0, this.view.state.doc.length, function(t11, n11, s10) { + for (var c10, l10 = s10.spec, u10 = -1, f10 = o10; f10 < e21.items.length; f10++) + if (e21.items[f10].diagnostic == l10.diagnostic) { + u10 = f10; + break; + } + u10 < 0 ? (c10 = new v0(e21.view, l10.diagnostic), e21.items.splice(o10, 0, c10), i10 = true) : (c10 = e21.items[u10], u10 > o10 && (e21.items.splice(o10, u10 - o10), i10 = true)), r10 && c10.diagnostic == r10.diagnostic ? c10.dom.hasAttribute("aria-selected") || (c10.dom.setAttribute("aria-selected", "true"), a10 = c10) : c10.dom.hasAttribute("aria-selected") && c10.dom.removeAttribute("aria-selected"), o10++; + }); o10 < this.items.length && !(1 == this.items.length && this.items[0].diagnostic.from < 0); ) + i10 = true, this.items.pop(); + 0 == this.items.length && (this.items.push(new v0(this.view, { from: -1, to: -1, severity: "info", message: this.view.state.phrase("No diagnostics") })), i10 = true), a10 ? (this.list.setAttribute("aria-activedescendant", a10.id), this.view.requestMeasure({ key: this, read: function() { + return { sel: a10.dom.getBoundingClientRect(), panel: e21.list.getBoundingClientRect() }; + }, write: function(t11) { + var n11 = t11.sel, r11 = t11.panel, o11 = r11.height / e21.list.offsetHeight; + n11.top < r11.top ? e21.list.scrollTop -= (r11.top - n11.top) / o11 : n11.bottom > r11.bottom && (e21.list.scrollTop += (n11.bottom - r11.bottom) / o11); + } })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), i10 && this.sync(); + } }, { key: "sync", value: function() { + var e21 = this.list.firstChild; + function t10() { + var t11 = e21; + e21 = t11.nextSibling, t11.remove(); + } + var n10, r10 = bo(this.items); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + if (o10.dom.parentNode == this.list) { + for (; e21 != o10.dom; ) + t10(); + e21 = o10.dom.nextSibling; + } else + this.list.insertBefore(o10.dom, e21); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + for (; e21; ) + t10(); + } }, { key: "moveSelection", value: function(e21) { + if (!(this.selectedIndex < 0)) { + var t10 = YZ(this.view.state.field(r0).diagnostics, this.items[e21].diagnostic); + t10 && this.view.dispatch({ selection: { anchor: t10.from, head: t10.to }, scrollIntoView: true, effects: n0.of(t10) }); + } + } }], [{ key: "open", value: function(t10) { + return new e20(t10); + } }]), e20; + }(); + function m0(e20) { + return `url('data:image/svg+xml, 1 && void 0 !== arguments[1] ? arguments[1] : 'viewBox="0 0 40 40"', ">").concat(encodeURIComponent(e20), "')"); + } + function g0(e20) { + return m0(''), 'width="6" height="3"'); + } + var y0 = zJ.baseTheme({ ".cm-diagnostic": { padding: "3px 6px 3px 8px", marginLeft: "-1px", display: "block", whiteSpace: "pre-wrap" }, ".cm-diagnostic-error": { borderLeft: "5px solid #d11" }, ".cm-diagnostic-warning": { borderLeft: "5px solid orange" }, ".cm-diagnostic-info": { borderLeft: "5px solid #999" }, ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" }, ".cm-diagnosticAction": { font: "inherit", border: "none", padding: "2px 4px", backgroundColor: "#444", color: "white", borderRadius: "3px", marginLeft: "8px", cursor: "pointer" }, ".cm-diagnosticSource": { fontSize: "70%", opacity: 0.7 }, ".cm-lintRange": { backgroundPosition: "left bottom", backgroundRepeat: "repeat-x", paddingBottom: "0.7px" }, ".cm-lintRange-error": { backgroundImage: g0("#d11") }, ".cm-lintRange-warning": { backgroundImage: g0("orange") }, ".cm-lintRange-info": { backgroundImage: g0("#999") }, ".cm-lintRange-hint": { backgroundImage: g0("#66d") }, ".cm-lintRange-active": { backgroundColor: "#ffdd9980" }, ".cm-tooltip-lint": { padding: 0, margin: 0 }, ".cm-lintPoint": { position: "relative", "&:after": { content: '""', position: "absolute", bottom: 0, left: "-2px", borderLeft: "3px solid transparent", borderRight: "3px solid transparent", borderBottom: "4px solid #d11" } }, ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } }, ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } }, ".cm-lintPoint-hint": { "&:after": { borderBottomColor: "#66d" } }, ".cm-panel.cm-panel-lint": { position: "relative", "& ul": { maxHeight: "100px", overflowY: "auto", "& [aria-selected]": { backgroundColor: "#ddd", "& u": { textDecoration: "underline" } }, "&:focus [aria-selected]": { background_fallback: "#bdf", backgroundColor: "Highlight", color_fallback: "white", color: "HighlightText" }, "& u": { textDecoration: "none" }, padding: 0, margin: 0 }, "& [name=close]": { position: "absolute", top: "0", right: "2px", background: "inherit", border: "none", font: "inherit", padding: 0, margin: 0 } } }); + function b0(e20) { + return "error" == e20 ? 4 : "warning" == e20 ? 3 : "info" == e20 ? 2 : 1; + } + var k0 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), (n10 = _o(this, t10)).diagnostics = e21, n10.severity = e21.reduce(function(e23, t11) { + return b0(e23) < b0(t11.severity) ? t11.severity : e23; + }, "hint"), n10; + } + return Ao(t10, sG), Do(t10, [{ key: "toDOM", value: function(e21) { + var t11 = document.createElement("div"); + t11.className = "cm-lint-marker cm-lint-marker-" + this.severity; + var n10 = this.diagnostics, r10 = e21.state.facet(O0).tooltipFilter; + return r10 && (n10 = r10(n10)), n10.length && (t11.onmouseover = function() { + return function(e23, t12, n11) { + function r11() { + var r12 = e23.elementAtHeight(t12.getBoundingClientRect().top + 5 - e23.documentTop); + e23.coordsAtPos(r12.from) && e23.dispatch({ effects: S0.of({ pos: r12.from, above: false, create: function() { + return { dom: a0(e23, n11), getCoords: function() { + return t12.getBoundingClientRect(); + } }; + } }) }), t12.onmouseout = t12.onmousemove = null, function(e24, t13) { + var n12 = function n13(r13) { + var o11 = t13.getBoundingClientRect(); + if (!(r13.clientX > o11.left - 10 && r13.clientX < o11.right + 10 && r13.clientY > o11.top - 10 && r13.clientY < o11.bottom + 10)) { + for (var i11 = r13.target; i11; i11 = i11.parentNode) + if (1 == i11.nodeType && i11.classList.contains("cm-tooltip-lint")) + return; + window.removeEventListener("mousemove", n13), e24.state.field(C0) && e24.dispatch({ effects: S0.of(null) }); + } + }; + window.addEventListener("mousemove", n12); + }(e23, t12); + } + var o10 = e23.state.facet(O0), i10 = o10.hoverTime, a10 = setTimeout(r11, i10); + t12.onmouseout = function() { + clearTimeout(a10), t12.onmouseout = t12.onmousemove = null; + }, t12.onmousemove = function() { + clearTimeout(a10), a10 = setTimeout(r11, i10); + }; + }(e21, t11, n10); + }), t11; + } }]), t10; + }(); + function w0(e20, t10) { + var n10, r10 = /* @__PURE__ */ Object.create(null), o10 = bo(t10); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value, a10 = e20.lineAt(i10.from); + (r10[a10.from] || (r10[a10.from] = [])).push(i10); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + var s10 = []; + for (var c10 in r10) + s10.push(new k0(r10[c10]).range(+c10)); + return xV.of(s10, true); + } + var x0 = fG({ class: "cm-gutter-lint", markers: function(e20) { + return e20.state.field(j0); + } }); + var j0 = NF.define({ create: function() { + return xV.empty; + }, update: function(e20, t10) { + e20 = e20.map(t10.changes); + var n10, r10 = t10.state.facet(O0).markerFilter, o10 = bo(t10.effects); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value; + if (i10.is(e0)) { + var a10 = i10.value; + r10 && (a10 = r10(a10 || [])), e20 = w0(t10.state.doc, a10.slice(0)); + } + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return e20; + } }); + var S0 = oV.define(); + var C0 = NF.define({ create: function() { + return null; + }, update: function(e20, t10) { + return e20 && t10.docChanged && (e20 = XZ(t10, e20) ? null : Object.assign(Object.assign({}, e20), { pos: t10.changes.mapPos(e20.pos) })), t10.effects.reduce(function(e21, t11) { + return t11.is(S0) ? t11.value : e21; + }, e20); + }, provide: function(e20) { + return UK.from(e20); + } }); + var $0 = zJ.baseTheme({ ".cm-gutter-lint": { width: "1.4em", "& .cm-gutterElement": { padding: ".2em" } }, ".cm-lint-marker": { width: "1em", height: "1em" }, ".cm-lint-marker-info": { content: m0('') }, ".cm-lint-marker-warning": { content: m0('') }, ".cm-lint-marker-error": { content: m0('') } }); + var _0 = [r0, zJ.decorations.compute([r0], function(e20) { + var t10 = e20.field(r0), n10 = t10.selected, r10 = t10.panel; + return n10 && r10 && n10.from != n10.to ? KH.set([o0.range(n10.from, n10.to)]) : KH.none; + }), XK(i0, { hideOn: XZ }), y0]; + var O0 = MF.define({ combine: function(e20) { + return gV(e20, { hoverTime: 300, markerFilter: null, tooltipFilter: null }); + } }); + function M0() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [O0.of(e20), j0, x0, $0, C0]; + } + var E0 = function() { + function e20(t10, n10, r10, o10, i10, a10, s10, c10, l10) { + var u10 = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : 0, f10 = arguments.length > 10 ? arguments[10] : void 0; + No(this, e20), this.p = t10, this.stack = n10, this.state = r10, this.reducePos = o10, this.pos = i10, this.score = a10, this.buffer = s10, this.bufferBase = c10, this.curContext = l10, this.lookAhead = u10, this.parent = f10; + } + return Do(e20, [{ key: "toString", value: function() { + return "[".concat(this.stack.filter(function(e21, t10) { + return t10 % 3 == 0; + }).concat(this.state), "]@").concat(this.pos).concat(this.score ? "!" + this.score : ""); + } }, { key: "context", get: function() { + return this.curContext ? this.curContext.context : null; + } }, { key: "pushState", value: function(e21, t10) { + this.stack.push(this.state, t10, this.bufferBase + this.buffer.length), this.state = e21; + } }, { key: "reduce", value: function(e21) { + var t10, n10 = e21 >> 19, r10 = 65535 & e21, o10 = this.p.parser, i10 = o10.dynamicPrecedence(r10); + if (i10 && (this.score += i10), 0 == n10) + return this.pushState(o10.getGoto(this.state, r10, true), this.reducePos), r10 < o10.minRepeatTerm && this.storeNode(r10, this.reducePos, this.reducePos, 4, true), void this.reduceContext(r10, this.reducePos); + var a10 = this.stack.length - 3 * (n10 - 1) - (262144 & e21 ? 6 : 0), s10 = a10 ? this.stack[a10 - 2] : this.p.ranges[0].from, c10 = this.reducePos - s10; + c10 >= 2e3 && !(null === (t10 = this.p.parser.nodeSet.types[r10]) || void 0 === t10 ? void 0 : t10.isAnonymous) && (s10 == this.p.lastBigReductionStart ? (this.p.bigReductionCount++, this.p.lastBigReductionSize = c10) : this.p.lastBigReductionSize < c10 && (this.p.bigReductionCount = 1, this.p.lastBigReductionStart = s10, this.p.lastBigReductionSize = c10)); + var l10 = a10 ? this.stack[a10 - 1] : 0, u10 = this.bufferBase + this.buffer.length - l10; + if (r10 < o10.minRepeatTerm || 131072 & e21) { + var f10 = o10.stateFlag(this.state, 1) ? this.pos : this.reducePos; + this.storeNode(r10, s10, f10, u10 + 4, true); + } + if (262144 & e21) + this.state = this.stack[a10]; + else { + var d10 = this.stack[a10 - 3]; + this.state = o10.getGoto(d10, r10, true); + } + for (; this.stack.length > a10; ) + this.stack.pop(); + this.reduceContext(r10, s10); + } }, { key: "storeNode", value: function(e21, t10, n10) { + var r10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 4, o10 = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]; + if (0 == e21 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) { + var i10 = this, a10 = this.buffer.length; + if (0 == a10 && i10.parent && (a10 = i10.bufferBase - i10.parent.bufferBase, i10 = i10.parent), a10 > 0 && 0 == i10.buffer[a10 - 4] && i10.buffer[a10 - 1] > -1) { + if (t10 == n10) + return; + if (i10.buffer[a10 - 2] >= t10) + return void (i10.buffer[a10 - 2] = n10); + } + } + if (o10 && this.pos != n10) { + var s10 = this.buffer.length; + if (s10 > 0 && 0 != this.buffer[s10 - 4]) + for (; s10 > 0 && this.buffer[s10 - 2] > n10; ) + this.buffer[s10] = this.buffer[s10 - 4], this.buffer[s10 + 1] = this.buffer[s10 - 3], this.buffer[s10 + 2] = this.buffer[s10 - 2], this.buffer[s10 + 3] = this.buffer[s10 - 1], s10 -= 4, r10 > 4 && (r10 -= 4); + this.buffer[s10] = e21, this.buffer[s10 + 1] = t10, this.buffer[s10 + 2] = n10, this.buffer[s10 + 3] = r10; + } else + this.buffer.push(e21, t10, n10, r10); + } }, { key: "shift", value: function(e21, t10, n10, r10) { + if (131072 & e21) + this.pushState(65535 & e21, this.pos); + else if (0 == (262144 & e21)) { + var o10 = e21, i10 = this.p.parser; + (r10 > this.pos || t10 <= i10.maxNode) && (this.pos = r10, i10.stateFlag(o10, 1) || (this.reducePos = r10)), this.pushState(o10, n10), this.shiftContext(t10, n10), t10 <= i10.maxNode && this.buffer.push(t10, n10, r10, 4); + } else + this.pos = r10, this.shiftContext(t10, n10), t10 <= this.p.parser.maxNode && this.buffer.push(t10, n10, r10, 4); + } }, { key: "apply", value: function(e21, t10, n10, r10) { + 65536 & e21 ? this.reduce(e21) : this.shift(e21, t10, n10, r10); + } }, { key: "useNode", value: function(e21, t10) { + var n10 = this.p.reused.length - 1; + (n10 < 0 || this.p.reused[n10] != e21) && (this.p.reused.push(e21), n10++); + var r10 = this.pos; + this.reducePos = this.pos = r10 + e21.length, this.pushState(t10, r10), this.buffer.push(n10, r10, this.reducePos, -1), this.curContext && this.updateContext(this.curContext.tracker.reuse(this.curContext.context, e21, this, this.p.stream.reset(this.pos - e21.length))); + } }, { key: "split", value: function() { + for (var t10 = this, n10 = t10.buffer.length; n10 > 0 && t10.buffer[n10 - 2] > t10.reducePos; ) + n10 -= 4; + for (var r10 = t10.buffer.slice(n10), o10 = t10.bufferBase + n10; t10 && o10 == t10.bufferBase; ) + t10 = t10.parent; + return new e20(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, r10, o10, this.curContext, this.lookAhead, t10); + } }, { key: "recoverByDelete", value: function(e21, t10) { + var n10 = e21 <= this.p.parser.maxNode; + n10 && this.storeNode(e21, this.pos, t10, 4), this.storeNode(0, this.pos, t10, n10 ? 8 : 4), this.pos = this.reducePos = t10, this.score -= 190; + } }, { key: "canShift", value: function(e21) { + for (var t10 = new P0(this); ; ) { + var n10 = this.p.parser.stateSlot(t10.state, 4) || this.p.parser.hasAction(t10.state, e21); + if (0 == n10) + return false; + if (0 == (65536 & n10)) + return true; + t10.reduce(n10); + } + } }, { key: "recoverByInsert", value: function(e21) { + if (this.stack.length >= 300) + return []; + var t10 = this.p.parser.nextStates(this.state); + if (t10.length > 8 || this.stack.length >= 120) { + for (var n10, r10 = [], o10 = 0; o10 < t10.length; o10 += 2) + (n10 = t10[o10 + 1]) != this.state && this.p.parser.hasAction(n10, e21) && r10.push(t10[o10], n10); + if (this.stack.length < 120) + for (var i10 = function() { + var e23 = t10[a10 + 1]; + r10.some(function(t11, n11) { + return 1 & n11 && t11 == e23; + }) || r10.push(t10[a10], e23); + }, a10 = 0; r10.length < 8 && a10 < t10.length; a10 += 2) + i10(); + t10 = r10; + } + for (var s10 = [], c10 = 0; c10 < t10.length && s10.length < 4; c10 += 2) { + var l10 = t10[c10 + 1]; + if (l10 != this.state) { + var u10 = this.split(); + u10.pushState(l10, this.pos), u10.storeNode(0, u10.pos, u10.pos, 4, true), u10.shiftContext(t10[c10], this.pos), u10.reducePos = this.pos, u10.score -= 200, s10.push(u10); + } + } + return s10; + } }, { key: "forceReduce", value: function() { + var e21 = this.p.parser, t10 = e21.stateSlot(this.state, 5); + if (0 == (65536 & t10)) + return false; + if (!e21.validAction(this.state, t10)) { + var n10 = t10 >> 19, r10 = 65535 & t10, o10 = this.stack.length - 3 * n10; + if (o10 < 0 || e21.getGoto(this.stack[o10], r10, false) < 0) { + var i10 = this.findForcedReduction(); + if (null == i10) + return false; + t10 = i10; + } + this.storeNode(0, this.pos, this.pos, 4, true), this.score -= 100; + } + return this.reducePos = this.pos, this.reduce(t10), true; + } }, { key: "findForcedReduction", value: function() { + var e21 = this, t10 = this.p.parser, n10 = []; + return function r10(o10, i10) { + if (!n10.includes(o10)) + return n10.push(o10), t10.allActions(o10, function(n11) { + if (393216 & n11) + ; + else if (65536 & n11) { + var o11 = (n11 >> 19) - i10; + if (o11 > 1) { + var a10 = 65535 & n11, s10 = e21.stack.length - 3 * o11; + if (s10 >= 0 && t10.getGoto(e21.stack[s10], a10, false) >= 0) + return o11 << 19 | 65536 | a10; + } + } else { + var c10 = r10(n11, i10 + 1); + if (null != c10) + return c10; + } + }); + }(this.state, 0); + } }, { key: "forceAll", value: function() { + for (; !this.p.parser.stateFlag(this.state, 2); ) + if (!this.forceReduce()) { + this.storeNode(0, this.pos, this.pos, 4, true); + break; + } + return this; + } }, { key: "deadEnd", get: function() { + if (3 != this.stack.length) + return false; + var e21 = this.p.parser; + return 65535 == e21.data[e21.stateSlot(this.state, 1)] && !e21.stateSlot(this.state, 4); + } }, { key: "restart", value: function() { + this.storeNode(0, this.pos, this.pos, 4, true), this.state = this.stack[0], this.stack.length = 0; + } }, { key: "sameState", value: function(e21) { + if (this.state != e21.state || this.stack.length != e21.stack.length) + return false; + for (var t10 = 0; t10 < this.stack.length; t10 += 3) + if (this.stack[t10] != e21.stack[t10]) + return false; + return true; + } }, { key: "parser", get: function() { + return this.p.parser; + } }, { key: "dialectEnabled", value: function(e21) { + return this.p.parser.dialect.flags[e21]; + } }, { key: "shiftContext", value: function(e21, t10) { + this.curContext && this.updateContext(this.curContext.tracker.shift(this.curContext.context, e21, this, this.p.stream.reset(t10))); + } }, { key: "reduceContext", value: function(e21, t10) { + this.curContext && this.updateContext(this.curContext.tracker.reduce(this.curContext.context, e21, this, this.p.stream.reset(t10))); + } }, { key: "emitContext", value: function() { + var e21 = this.buffer.length - 1; + (e21 < 0 || -3 != this.buffer[e21]) && this.buffer.push(this.curContext.hash, this.pos, this.pos, -3); + } }, { key: "emitLookAhead", value: function() { + var e21 = this.buffer.length - 1; + (e21 < 0 || -4 != this.buffer[e21]) && this.buffer.push(this.lookAhead, this.pos, this.pos, -4); + } }, { key: "updateContext", value: function(e21) { + if (e21 != this.curContext.context) { + var t10 = new A0(this.curContext.tracker, e21); + t10.hash != this.curContext.hash && this.emitContext(), this.curContext = t10; + } + } }, { key: "setLookAhead", value: function(e21) { + e21 > this.lookAhead && (this.emitLookAhead(), this.lookAhead = e21); + } }, { key: "close", value: function() { + this.curContext && this.curContext.tracker.strict && this.emitContext(), this.lookAhead > 0 && this.emitLookAhead(); + } }], [{ key: "start", value: function(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, o10 = t10.parser.context; + return new e20(t10, [], n10, r10, r10, 0, [], 0, o10 ? new A0(o10, o10.start) : null, 0, null); + } }]), e20; + }(); + var A0 = Do(function e12(t10, n10) { + No(this, e12), this.tracker = t10, this.context = n10, this.hash = t10.strict ? t10.hash(n10) : 0; + }); + var P0 = function() { + function e20(t10) { + No(this, e20), this.start = t10, this.state = t10.state, this.stack = t10.stack, this.base = this.stack.length; + } + return Do(e20, [{ key: "reduce", value: function(e21) { + var t10 = 65535 & e21, n10 = e21 >> 19; + 0 == n10 ? (this.stack == this.start.stack && (this.stack = this.stack.slice()), this.stack.push(this.state, 0, 0), this.base += 3) : this.base -= 3 * (n10 - 1); + var r10 = this.start.p.parser.getGoto(this.stack[this.base - 3], t10, true); + this.state = r10; + } }]), e20; + }(); + var T0 = function() { + function e20(t10, n10, r10) { + No(this, e20), this.stack = t10, this.pos = n10, this.index = r10, this.buffer = t10.buffer, 0 == this.index && this.maybeNext(); + } + return Do(e20, [{ key: "maybeNext", value: function() { + var e21 = this.stack.parent; + null != e21 && (this.index = this.stack.bufferBase - e21.bufferBase, this.stack = e21, this.buffer = e21.buffer); + } }, { key: "id", get: function() { + return this.buffer[this.index - 4]; + } }, { key: "start", get: function() { + return this.buffer[this.index - 3]; + } }, { key: "end", get: function() { + return this.buffer[this.index - 2]; + } }, { key: "size", get: function() { + return this.buffer[this.index - 1]; + } }, { key: "next", value: function() { + this.index -= 4, this.pos -= 4, 0 == this.index && this.maybeNext(); + } }, { key: "fork", value: function() { + return new e20(this.stack, this.pos, this.index); + } }], [{ key: "create", value: function(t10) { + var n10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t10.bufferBase + t10.buffer.length; + return new e20(t10, n10, n10 - t10.bufferBase); + } }]), e20; + }(); + function R0(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Uint16Array; + if ("string" != typeof e20) + return e20; + for (var n10 = null, r10 = 0, o10 = 0; r10 < e20.length; ) { + for (var i10 = 0; ; ) { + var a10 = e20.charCodeAt(r10++), s10 = false; + if (126 == a10) { + i10 = 65535; + break; + } + a10 >= 92 && a10--, a10 >= 34 && a10--; + var c10 = a10 - 32; + if (c10 >= 46 && (c10 -= 46, s10 = true), i10 += c10, s10) + break; + i10 *= 46; + } + n10 ? n10[o10++] = i10 : n10 = new t10(i10); + } + return n10; + } + var N0 = Do(function e13() { + No(this, e13), this.start = -1, this.value = -1, this.end = -1, this.extended = -1, this.lookAhead = 0, this.mask = 0, this.context = 0; + }); + var I0 = new N0(); + var D0 = function() { + function e20(t10, n10) { + No(this, e20), this.input = t10, this.ranges = n10, this.chunk = "", this.chunkOff = 0, this.chunk2 = "", this.chunk2Pos = 0, this.next = -1, this.token = I0, this.rangeIndex = 0, this.pos = this.chunkPos = n10[0].from, this.range = n10[0], this.end = n10[n10.length - 1].to, this.readNext(); + } + return Do(e20, [{ key: "resolveOffset", value: function(e21, t10) { + for (var n10 = this.range, r10 = this.rangeIndex, o10 = this.pos + e21; o10 < n10.from; ) { + if (!r10) + return null; + var i10 = this.ranges[--r10]; + o10 -= n10.from - i10.to, n10 = i10; + } + for (; t10 < 0 ? o10 > n10.to : o10 >= n10.to; ) { + if (r10 == this.ranges.length - 1) + return null; + var a10 = this.ranges[++r10]; + o10 += a10.from - n10.to, n10 = a10; + } + return o10; + } }, { key: "clipPos", value: function(e21) { + if (e21 >= this.range.from && e21 < this.range.to) + return e21; + var t10, n10 = bo(this.ranges); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10 = t10.value; + if (r10.to > e21) + return Math.max(e21, r10.from); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + return this.end; + } }, { key: "peek", value: function(e21) { + var t10, n10, r10 = this.chunkOff + e21; + if (r10 >= 0 && r10 < this.chunk.length) + t10 = this.pos + e21, n10 = this.chunk.charCodeAt(r10); + else { + var o10 = this.resolveOffset(e21, 1); + if (null == o10) + return -1; + if ((t10 = o10) >= this.chunk2Pos && t10 < this.chunk2Pos + this.chunk2.length) + n10 = this.chunk2.charCodeAt(t10 - this.chunk2Pos); + else { + for (var i10 = this.rangeIndex, a10 = this.range; a10.to <= t10; ) + a10 = this.ranges[++i10]; + this.chunk2 = this.input.chunk(this.chunk2Pos = t10), t10 + this.chunk2.length > a10.to && (this.chunk2 = this.chunk2.slice(0, a10.to - t10)), n10 = this.chunk2.charCodeAt(0); + } + } + return t10 >= this.token.lookAhead && (this.token.lookAhead = t10 + 1), n10; + } }, { key: "acceptToken", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = t10 ? this.resolveOffset(t10, -1) : this.pos; + if (null == n10 || n10 < this.token.start) + throw new RangeError("Token end out of bounds"); + this.token.value = e21, this.token.end = n10; + } }, { key: "getChunk", value: function() { + if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) { + var e21 = this.chunk, t10 = this.chunkPos; + this.chunk = this.chunk2, this.chunkPos = this.chunk2Pos, this.chunk2 = e21, this.chunk2Pos = t10, this.chunkOff = this.pos - this.chunkPos; + } else { + this.chunk2 = this.chunk, this.chunk2Pos = this.chunkPos; + var n10 = this.input.chunk(this.pos), r10 = this.pos + n10.length; + this.chunk = r10 > this.range.to ? n10.slice(0, this.range.to - this.pos) : n10, this.chunkPos = this.pos, this.chunkOff = 0; + } + } }, { key: "readNext", value: function() { + return this.chunkOff >= this.chunk.length && (this.getChunk(), this.chunkOff == this.chunk.length) ? this.next = -1 : this.next = this.chunk.charCodeAt(this.chunkOff); + } }, { key: "advance", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1; + for (this.chunkOff += e21; this.pos + e21 >= this.range.to; ) { + if (this.rangeIndex == this.ranges.length - 1) + return this.setDone(); + e21 -= this.range.to - this.pos, this.range = this.ranges[++this.rangeIndex], this.pos = this.range.from; + } + return this.pos += e21, this.pos >= this.token.lookAhead && (this.token.lookAhead = this.pos + 1), this.readNext(); + } }, { key: "setDone", value: function() { + return this.pos = this.chunkPos = this.end, this.range = this.ranges[this.rangeIndex = this.ranges.length - 1], this.chunk = "", this.next = -1; + } }, { key: "reset", value: function(e21, t10) { + if (t10 ? (this.token = t10, t10.start = e21, t10.lookAhead = e21 + 1, t10.value = t10.extended = -1) : this.token = I0, this.pos != e21) { + if (this.pos = e21, e21 == this.end) + return this.setDone(), this; + for (; e21 < this.range.from; ) + this.range = this.ranges[--this.rangeIndex]; + for (; e21 >= this.range.to; ) + this.range = this.ranges[++this.rangeIndex]; + e21 >= this.chunkPos && e21 < this.chunkPos + this.chunk.length ? this.chunkOff = e21 - this.chunkPos : (this.chunk = "", this.chunkOff = 0), this.readNext(); + } + return this; + } }, { key: "read", value: function(e21, t10) { + if (e21 >= this.chunkPos && t10 <= this.chunkPos + this.chunk.length) + return this.chunk.slice(e21 - this.chunkPos, t10 - this.chunkPos); + if (e21 >= this.chunk2Pos && t10 <= this.chunk2Pos + this.chunk2.length) + return this.chunk2.slice(e21 - this.chunk2Pos, t10 - this.chunk2Pos); + if (e21 >= this.range.from && t10 <= this.range.to) + return this.input.read(e21, t10); + var n10, r10 = "", o10 = bo(this.ranges); + try { + for (o10.s(); !(n10 = o10.n()).done; ) { + var i10 = n10.value; + if (i10.from >= t10) + break; + i10.to > e21 && (r10 += this.input.read(Math.max(i10.from, e21), Math.min(i10.to, t10))); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return r10; + } }]), e20; + }(); + var q0 = function() { + function e20(t10, n10) { + No(this, e20), this.data = t10, this.id = n10; + } + return Do(e20, [{ key: "token", value: function(e21, t10) { + var n10 = t10.p.parser; + !function(e23, t11, n11, r10, o10, i10) { + var a10 = 0, s10 = 1 << r10, c10 = n11.p.parser.dialect; + e: + for (; 0 != (s10 & e23[a10]); ) { + for (var l10 = e23[a10 + 1], u10 = a10 + 3; u10 < l10; u10 += 2) + if ((e23[u10 + 1] & s10) > 0) { + var f10 = e23[u10]; + if (c10.allows(f10) && (-1 == t11.token.value || t11.token.value == f10 || B0(f10, t11.token.value, o10, i10))) { + t11.acceptToken(f10); + break; + } + } + var d10 = t11.next, h10 = 0, v10 = e23[a10 + 2]; + if (!(t11.next < 0 && v10 > h10 && 65535 == e23[l10 + 3 * v10 - 3])) { + for (; h10 < v10; ) { + var p10 = h10 + v10 >> 1, m10 = l10 + p10 + (p10 << 1), g10 = e23[m10], y10 = e23[m10 + 1] || 65536; + if (d10 < g10) + v10 = p10; + else { + if (!(d10 >= y10)) { + a10 = e23[m10 + 2], t11.advance(); + continue e; + } + h10 = p10 + 1; + } + } + break; + } + a10 = e23[l10 + 3 * v10 - 1]; + } + }(this.data, e21, t10, this.id, n10.data, n10.tokenPrecTable); + } }]), e20; + }(); + function z0(e20, t10, n10) { + for (var r10, o10 = t10; 65535 != (r10 = e20[o10]); o10++) + if (r10 == n10) + return o10 - t10; + return -1; + } + function B0(e20, t10, n10, r10) { + var o10 = z0(n10, r10, t10); + return o10 < 0 || z0(n10, r10, e20) < o10; + } + q0.prototype.contextual = q0.prototype.fallback = q0.prototype.extend = false, q0.prototype.fallback = q0.prototype.extend = false; + var L0 = "undefined" != typeof process && process.env && /\bparse\b/.test(process.env.LOG); + var F0 = null; + function V0(e20, t10, n10) { + var r10 = e20.cursor(NG.IncludeAnonymous); + for (r10.moveTo(t10); ; ) + if (!(n10 < 0 ? r10.childBefore(t10) : r10.childAfter(t10))) + for (; ; ) { + if ((n10 < 0 ? r10.to < t10 : r10.from > t10) && !r10.type.isError) + return n10 < 0 ? Math.max(0, Math.min(r10.to - 1, t10 - 25)) : Math.min(e20.length, Math.max(r10.from + 1, t10 + 25)); + if (n10 < 0 ? r10.prevSibling() : r10.nextSibling()) + break; + if (!r10.parent()) + return n10 < 0 ? 0 : e20.length; + } + } + var H0 = function() { + function e20(t10, n10) { + No(this, e20), this.fragments = t10, this.nodeSet = n10, this.i = 0, this.fragment = null, this.safeFrom = -1, this.safeTo = -1, this.trees = [], this.start = [], this.index = [], this.nextFragment(); + } + return Do(e20, [{ key: "nextFragment", value: function() { + var e21 = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++]; + if (e21) { + for (this.safeFrom = e21.openStart ? V0(e21.tree, e21.from + e21.offset, 1) - e21.offset : e21.from, this.safeTo = e21.openEnd ? V0(e21.tree, e21.to + e21.offset, -1) - e21.offset : e21.to; this.trees.length; ) + this.trees.pop(), this.start.pop(), this.index.pop(); + this.trees.push(e21.tree), this.start.push(-e21.offset), this.index.push(0), this.nextStart = this.safeFrom; + } else + this.nextStart = 1e9; + } }, { key: "nodeAt", value: function(e21) { + if (e21 < this.nextStart) + return null; + for (; this.fragment && this.safeTo <= e21; ) + this.nextFragment(); + if (!this.fragment) + return null; + for (; ; ) { + var t10 = this.trees.length - 1; + if (t10 < 0) + return this.nextFragment(), null; + var n10 = this.trees[t10], r10 = this.index[t10]; + if (r10 != n10.children.length) { + var o10 = n10.children[r10], i10 = this.start[t10] + n10.positions[r10]; + if (i10 > e21) + return this.nextStart = i10, null; + if (o10 instanceof zG) { + if (i10 == e21) { + if (i10 < this.safeFrom) + return null; + var a10 = i10 + o10.length; + if (a10 <= this.safeTo) { + var s10 = o10.prop(AG.lookAhead); + if (!s10 || a10 + s10 < this.fragment.to) + return o10; + } + } + this.index[t10]++, i10 + o10.length >= Math.max(this.safeFrom, e21) && (this.trees.push(o10), this.start.push(i10), this.index.push(0)); + } else + this.index[t10]++, this.nextStart = i10 + o10.length; + } else + this.trees.pop(), this.start.pop(), this.index.pop(); + } + } }]), e20; + }(); + var W0 = function() { + function e20(t10, n10) { + No(this, e20), this.stream = n10, this.tokens = [], this.mainToken = null, this.actions = [], this.tokens = t10.tokenizers.map(function(e21) { + return new N0(); + }); + } + return Do(e20, [{ key: "getActions", value: function(e21) { + for (var t10 = 0, n10 = null, r10 = e21.p.parser, o10 = r10.tokenizers, i10 = r10.stateSlot(e21.state, 3), a10 = e21.curContext ? e21.curContext.hash : 0, s10 = 0, c10 = 0; c10 < o10.length; c10++) + if (0 != (1 << c10 & i10)) { + var l10 = o10[c10], u10 = this.tokens[c10]; + if ((!n10 || l10.fallback) && ((l10.contextual || u10.start != e21.pos || u10.mask != i10 || u10.context != a10) && (this.updateCachedToken(u10, l10, e21), u10.mask = i10, u10.context = a10), u10.lookAhead > u10.end + 25 && (s10 = Math.max(u10.lookAhead, s10)), 0 != u10.value)) { + var f10 = t10; + if (u10.extended > -1 && (t10 = this.addActions(e21, u10.extended, u10.end, t10)), t10 = this.addActions(e21, u10.value, u10.end, t10), !l10.extend && (n10 = u10, t10 > f10)) + break; + } + } + for (; this.actions.length > t10; ) + this.actions.pop(); + return s10 && e21.setLookAhead(s10), n10 || e21.pos != this.stream.end || ((n10 = new N0()).value = e21.p.parser.eofTerm, n10.start = n10.end = e21.pos, t10 = this.addActions(e21, n10.value, n10.end, t10)), this.mainToken = n10, this.actions; + } }, { key: "getMainToken", value: function(e21) { + if (this.mainToken) + return this.mainToken; + var t10 = new N0(), n10 = e21.pos, r10 = e21.p; + return t10.start = n10, t10.end = Math.min(n10 + 1, r10.stream.end), t10.value = n10 == r10.stream.end ? r10.parser.eofTerm : 0, t10; + } }, { key: "updateCachedToken", value: function(e21, t10, n10) { + var r10 = this.stream.clipPos(n10.pos); + if (t10.token(this.stream.reset(r10, e21), n10), e21.value > -1) { + for (var o10 = n10.p.parser, i10 = 0; i10 < o10.specialized.length; i10++) + if (o10.specialized[i10] == e21.value) { + var a10 = o10.specializers[i10](this.stream.read(e21.start, e21.end), n10); + if (a10 >= 0 && n10.p.parser.dialect.allows(a10 >> 1)) { + 0 == (1 & a10) ? e21.value = a10 >> 1 : e21.extended = a10 >> 1; + break; + } + } + } else + e21.value = 0, e21.end = this.stream.clipPos(r10 + 1); + } }, { key: "putAction", value: function(e21, t10, n10, r10) { + for (var o10 = 0; o10 < r10; o10 += 3) + if (this.actions[o10] == e21) + return r10; + return this.actions[r10++] = e21, this.actions[r10++] = t10, this.actions[r10++] = n10, r10; + } }, { key: "addActions", value: function(e21, t10, n10, r10) { + for (var o10 = e21.state, i10 = e21.p.parser, a10 = i10.data, s10 = 0; s10 < 2; s10++) + for (var c10 = i10.stateSlot(o10, s10 ? 2 : 1); ; c10 += 3) { + if (65535 == a10[c10]) { + if (1 != a10[c10 + 1]) { + 0 == r10 && 2 == a10[c10 + 1] && (r10 = this.putAction(Q0(a10, c10 + 2), t10, n10, r10)); + break; + } + c10 = Q0(a10, c10 + 2); + } + a10[c10] == t10 && (r10 = this.putAction(Q0(a10, c10 + 1), t10, n10, r10)); + } + return r10; + } }]), e20; + }(); + var U0 = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.parser = t10, this.input = n10, this.ranges = o10, this.recovering = 0, this.nextStackID = 9812, this.minStackPos = 0, this.reused = [], this.stoppedAt = null, this.lastBigReductionStart = -1, this.lastBigReductionSize = 0, this.bigReductionCount = 0, this.stream = new D0(n10, o10), this.tokens = new W0(t10, this.stream), this.topTerm = t10.top[1]; + var i10 = o10[0].from; + this.stacks = [E0.start(this, t10.top[0], i10)], this.fragments = r10.length && this.stream.end - i10 > 4 * t10.bufferLength ? new H0(r10, t10.nodeSet) : null; + } + return Do(e20, [{ key: "parsedPos", get: function() { + return this.minStackPos; + } }, { key: "advance", value: function() { + var e21, t10, n10 = this.stacks, r10 = this.minStackPos, o10 = this.stacks = []; + if (this.bigReductionCount > 300 && 1 == n10.length) { + for (var i10 = jo(n10, 1)[0]; i10.forceReduce() && i10.stack.length && i10.stack[i10.stack.length - 2] >= this.lastBigReductionStart; ) + ; + this.bigReductionCount = this.lastBigReductionSize = 0; + } + for (var a10 = 0; a10 < n10.length; a10++) + for (var s10 = n10[a10]; ; ) { + if (this.tokens.mainToken = null, s10.pos > r10) + o10.push(s10); + else { + if (this.advanceStack(s10, o10, n10)) + continue; + e21 || (e21 = [], t10 = []), e21.push(s10); + var c10 = this.tokens.getMainToken(s10); + t10.push(c10.value, c10.end); + } + break; + } + if (!o10.length) { + var l10 = e21 && function(e23) { + var t11, n11 = null, r11 = bo(e23); + try { + for (r11.s(); !(t11 = r11.n()).done; ) { + var o11 = t11.value, i11 = o11.p.stoppedAt; + (o11.pos == o11.p.stream.end || null != i11 && o11.pos > i11) && o11.p.parser.stateFlag(o11.state, 2) && (!n11 || n11.score < o11.score) && (n11 = o11); + } + } catch (e24) { + r11.e(e24); + } finally { + r11.f(); + } + return n11; + }(e21); + if (l10) + return L0 && console.log("Finish with " + this.stackID(l10)), this.stackToTree(l10); + if (this.parser.strict) + throw L0 && e21 && console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")), new SyntaxError("No parse at " + r10); + this.recovering || (this.recovering = 5); + } + if (this.recovering && e21) { + var u10 = null != this.stoppedAt && e21[0].pos > this.stoppedAt ? e21[0] : this.runRecovery(e21, t10, o10); + if (u10) + return L0 && console.log("Force-finish " + this.stackID(u10)), this.stackToTree(u10.forceAll()); + } + if (this.recovering) { + var f10 = 1 == this.recovering ? 1 : 3 * this.recovering; + if (o10.length > f10) + for (o10.sort(function(e23, t11) { + return t11.score - e23.score; + }); o10.length > f10; ) + o10.pop(); + o10.some(function(e23) { + return e23.reducePos > r10; + }) && this.recovering--; + } else if (o10.length > 1) { + e: + for (var d10 = 0; d10 < o10.length - 1; d10++) + for (var h10 = o10[d10], v10 = d10 + 1; v10 < o10.length; v10++) { + var p10 = o10[v10]; + if (h10.sameState(p10) || h10.buffer.length > 500 && p10.buffer.length > 500) { + if (!((h10.score - p10.score || h10.buffer.length - p10.buffer.length) > 0)) { + o10.splice(d10--, 1); + continue e; + } + o10.splice(v10--, 1); + } + } + o10.length > 12 && o10.splice(12, o10.length - 12); + } + this.minStackPos = o10[0].pos; + for (var m10 = 1; m10 < o10.length; m10++) + o10[m10].pos < this.minStackPos && (this.minStackPos = o10[m10].pos); + return null; + } }, { key: "stopAt", value: function(e21) { + if (null != this.stoppedAt && this.stoppedAt < e21) + throw new RangeError("Can't move stoppedAt forward"); + this.stoppedAt = e21; + } }, { key: "advanceStack", value: function(e21, t10, n10) { + var r10 = e21.pos, o10 = this.parser, i10 = L0 ? this.stackID(e21) + " -> " : ""; + if (null != this.stoppedAt && r10 > this.stoppedAt) + return e21.forceReduce() ? e21 : null; + if (this.fragments) + for (var a10 = e21.curContext && e21.curContext.tracker.strict, s10 = a10 ? e21.curContext.hash : 0, c10 = this.fragments.nodeAt(r10); c10; ) { + var l10 = this.parser.nodeSet.types[c10.type.id] == c10.type ? o10.getGoto(e21.state, c10.type.id) : -1; + if (l10 > -1 && c10.length && (!a10 || (c10.prop(AG.contextHash) || 0) == s10)) + return e21.useNode(c10, l10), L0 && console.log(i10 + this.stackID(e21) + " (via reuse of ".concat(o10.getName(c10.type.id), ")")), true; + if (!(c10 instanceof zG) || 0 == c10.children.length || c10.positions[0] > 0) + break; + var u10 = c10.children[0]; + if (!(u10 instanceof zG && 0 == c10.positions[0])) + break; + c10 = u10; + } + var f10 = o10.stateSlot(e21.state, 4); + if (f10 > 0) + return e21.reduce(f10), L0 && console.log(i10 + this.stackID(e21) + " (via always-reduce ".concat(o10.getName(65535 & f10), ")")), true; + if (e21.stack.length >= 8400) + for (; e21.stack.length > 6e3 && e21.forceReduce(); ) + ; + for (var d10 = this.tokens.getActions(e21), h10 = 0; h10 < d10.length; ) { + var v10 = d10[h10++], p10 = d10[h10++], m10 = d10[h10++], g10 = h10 == d10.length || !n10, y10 = g10 ? e21 : e21.split(), b10 = this.tokens.mainToken; + if (y10.apply(v10, p10, b10 ? b10.start : y10.pos, m10), L0 && console.log(i10 + this.stackID(y10) + " (via ".concat(0 == (65536 & v10) ? "shift" : "reduce of ".concat(o10.getName(65535 & v10)), " for ").concat(o10.getName(p10), " @ ").concat(r10).concat(y10 == e21 ? "" : ", split", ")")), g10) + return true; + y10.pos > r10 ? t10.push(y10) : n10.push(y10); + } + return false; + } }, { key: "advanceFully", value: function(e21, t10) { + for (var n10 = e21.pos; ; ) { + if (!this.advanceStack(e21, null, null)) + return false; + if (e21.pos > n10) + return J0(e21, t10), true; + } + } }, { key: "runRecovery", value: function(e21, t10, n10) { + for (var r10 = null, o10 = false, i10 = 0; i10 < e21.length; i10++) { + var a10 = e21[i10], s10 = t10[i10 << 1], c10 = t10[1 + (i10 << 1)], l10 = L0 ? this.stackID(a10) + " -> " : ""; + if (a10.deadEnd) { + if (o10) + continue; + if (o10 = true, a10.restart(), L0 && console.log(l10 + this.stackID(a10) + " (restarted)"), this.advanceFully(a10, n10)) + continue; + } + for (var u10 = a10.split(), f10 = l10, d10 = 0; u10.forceReduce() && d10 < 10; d10++) { + if (L0 && console.log(f10 + this.stackID(u10) + " (via force-reduce)"), this.advanceFully(u10, n10)) + break; + L0 && (f10 = this.stackID(u10) + " -> "); + } + var h10, v10 = bo(a10.recoverByInsert(s10)); + try { + for (v10.s(); !(h10 = v10.n()).done; ) { + var p10 = h10.value; + L0 && console.log(l10 + this.stackID(p10) + " (via recover-insert)"), this.advanceFully(p10, n10); + } + } catch (e23) { + v10.e(e23); + } finally { + v10.f(); + } + this.stream.end > a10.pos ? (c10 == a10.pos && (c10++, s10 = 0), a10.recoverByDelete(s10, c10), L0 && console.log(l10 + this.stackID(a10) + " (via recover-delete ".concat(this.parser.getName(s10), ")")), J0(a10, n10)) : (!r10 || r10.score < a10.score) && (r10 = a10); + } + return r10; + } }, { key: "stackToTree", value: function(e21) { + return e21.close(), zG.build({ buffer: T0.create(e21), nodeSet: this.parser.nodeSet, topID: this.topTerm, maxBufferLength: this.parser.bufferLength, reused: this.reused, start: this.ranges[0].from, length: e21.pos - this.ranges[0].from, minRepeatType: this.parser.minRepeatTerm }); + } }, { key: "stackID", value: function(e21) { + var t10 = (F0 || (F0 = /* @__PURE__ */ new WeakMap())).get(e21); + return t10 || F0.set(e21, t10 = String.fromCodePoint(this.nextStackID++)), t10 + e21; + } }]), e20; + }(); + function J0(e20, t10) { + for (var n10 = 0; n10 < t10.length; n10++) { + var r10 = t10[n10]; + if (r10.pos == e20.pos && r10.sameState(e20)) + return void (t10[n10].score < e20.score && (t10[n10] = e20)); + } + t10.push(e20); + } + var K0 = function() { + function e20(t10, n10, r10) { + No(this, e20), this.source = t10, this.flags = n10, this.disabled = r10; + } + return Do(e20, [{ key: "allows", value: function(e21) { + return !this.disabled || 0 == this.disabled[e21]; + } }]), e20; + }(); + var G0 = function(e20) { + function t10(e21) { + var n10, r10; + if (No(this, t10), (r10 = _o(this, t10)).wrappers = [], 14 != e21.version) + throw new RangeError("Parser version (".concat(e21.version, ") doesn't match runtime version (", 14, ")")); + var o10 = e21.nodeNames.split(" "); + r10.minRepeatTerm = o10.length; + for (var i10 = 0; i10 < e21.repeatNodeCount; i10++) + o10.push(""); + for (var a10 = Object.keys(e21.topRules).map(function(t11) { + return e21.topRules[t11][1]; + }), s10 = [], c10 = 0; c10 < o10.length; c10++) + s10.push([]); + function l10(e23, t11, n11) { + s10[e23].push([t11, t11.deserialize(String(n11))]); + } + if (e21.nodeProps) { + var u10, f10 = bo(e21.nodeProps); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value, h10 = d10[0]; + "string" == typeof h10 && (h10 = AG[h10]); + for (var v10 = 1; v10 < d10.length; ) { + var p10 = d10[v10++]; + if (p10 >= 0) + l10(p10, h10, d10[v10++]); + else { + for (var m10 = d10[v10 + -p10], g10 = -p10; g10 > 0; g10--) + l10(d10[v10++], h10, m10); + v10++; + } + } + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + } + r10.nodeSet = new IG(o10.map(function(t11, n11) { + return RG.define({ name: n11 >= r10.minRepeatTerm ? void 0 : t11, id: n11, props: s10[n11], top: a10.indexOf(n11) > -1, error: 0 == n11, skipped: e21.skippedNodes && e21.skippedNodes.indexOf(n11) > -1 }); + })), e21.propSources && (r10.nodeSet = (n10 = r10.nodeSet).extend.apply(n10, Bo(e21.propSources))), r10.strict = false, r10.bufferLength = 1024; + var y10 = R0(e21.tokenData); + r10.context = e21.context, r10.specializerSpecs = e21.specialized || [], r10.specialized = new Uint16Array(r10.specializerSpecs.length); + for (var b10 = 0; b10 < r10.specializerSpecs.length; b10++) + r10.specialized[b10] = r10.specializerSpecs[b10].term; + return r10.specializers = r10.specializerSpecs.map(Y0), r10.states = R0(e21.states, Uint32Array), r10.data = R0(e21.stateData), r10.goto = R0(e21.goto), r10.maxTerm = e21.maxTerm, r10.tokenizers = e21.tokenizers.map(function(e23) { + return "number" == typeof e23 ? new q0(y10, e23) : e23; + }), r10.topRules = e21.topRules, r10.dialects = e21.dialects || {}, r10.dynamicPrecedences = e21.dynamicPrecedences || null, r10.tokenPrecTable = e21.tokenPrec, r10.termNames = e21.termNames || null, r10.maxNode = r10.nodeSet.types.length - 1, r10.dialect = r10.parseDialect(), r10.top = r10.topRules[Object.keys(r10.topRules)[0]], r10; + } + return Ao(t10, iQ), Do(t10, [{ key: "createParse", value: function(e21, t11, n10) { + var r10, o10 = new U0(this, e21, t11, n10), i10 = bo(this.wrappers); + try { + for (i10.s(); !(r10 = i10.n()).done; ) { + o10 = (0, r10.value)(o10, e21, t11, n10); + } + } catch (e23) { + i10.e(e23); + } finally { + i10.f(); + } + return o10; + } }, { key: "getGoto", value: function(e21, t11) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r10 = this.goto; + if (t11 >= r10[0]) + return -1; + for (var o10 = r10[t11 + 1]; ; ) { + var i10 = r10[o10++], a10 = 1 & i10, s10 = r10[o10++]; + if (a10 && n10) + return s10; + for (var c10 = o10 + (i10 >> 1); o10 < c10; o10++) + if (r10[o10] == e21) + return s10; + if (a10) + return -1; + } + } }, { key: "hasAction", value: function(e21, t11) { + for (var n10 = this.data, r10 = 0; r10 < 2; r10++) + for (var o10, i10 = this.stateSlot(e21, r10 ? 2 : 1); ; i10 += 3) { + if (65535 == (o10 = n10[i10])) { + if (1 != n10[i10 + 1]) { + if (2 == n10[i10 + 1]) + return Q0(n10, i10 + 2); + break; + } + o10 = n10[i10 = Q0(n10, i10 + 2)]; + } + if (o10 == t11 || 0 == o10) + return Q0(n10, i10 + 1); + } + return 0; + } }, { key: "stateSlot", value: function(e21, t11) { + return this.states[6 * e21 + t11]; + } }, { key: "stateFlag", value: function(e21, t11) { + return (this.stateSlot(e21, 0) & t11) > 0; + } }, { key: "validAction", value: function(e21, t11) { + return !!this.allActions(e21, function(e23) { + return e23 == t11 || null; + }); + } }, { key: "allActions", value: function(e21, t11) { + for (var n10 = this.stateSlot(e21, 4), r10 = n10 ? t11(n10) : void 0, o10 = this.stateSlot(e21, 1); null == r10; o10 += 3) { + if (65535 == this.data[o10]) { + if (1 != this.data[o10 + 1]) + break; + o10 = Q0(this.data, o10 + 2); + } + r10 = t11(Q0(this.data, o10 + 1)); + } + return r10; + } }, { key: "nextStates", value: function(e21) { + for (var t11 = this, n10 = [], r10 = function(e23) { + if (65535 == t11.data[e23]) { + if (1 != t11.data[e23 + 1]) + return o10 = e23, 1; + e23 = Q0(t11.data, e23 + 2); + } + if (0 == (1 & t11.data[e23 + 2])) { + var r11 = t11.data[e23 + 1]; + n10.some(function(e24, t12) { + return 1 & t12 && e24 == r11; + }) || n10.push(t11.data[e23], r11); + } + o10 = e23; + }, o10 = this.stateSlot(e21, 1); !r10(o10); o10 += 3) + ; + return n10; + } }, { key: "configure", value: function(e21) { + var n10, r10 = Object.assign(Object.create(t10.prototype), this); + if (e21.props && (r10.nodeSet = (n10 = this.nodeSet).extend.apply(n10, Bo(e21.props))), e21.top) { + var o10 = this.topRules[e21.top]; + if (!o10) + throw new RangeError("Invalid top rule name ".concat(e21.top)); + r10.top = o10; + } + return e21.tokenizers && (r10.tokenizers = this.tokenizers.map(function(t11) { + var n11 = e21.tokenizers.find(function(e23) { + return e23.from == t11; + }); + return n11 ? n11.to : t11; + })), e21.specializers && (r10.specializers = this.specializers.slice(), r10.specializerSpecs = this.specializerSpecs.map(function(t11, n11) { + var o11 = e21.specializers.find(function(e23) { + return e23.from == t11.external; + }); + if (!o11) + return t11; + var i10 = Object.assign(Object.assign({}, t11), { external: o11.to }); + return r10.specializers[n11] = Y0(i10), i10; + })), e21.contextTracker && (r10.context = e21.contextTracker), e21.dialect && (r10.dialect = this.parseDialect(e21.dialect)), null != e21.strict && (r10.strict = e21.strict), e21.wrap && (r10.wrappers = r10.wrappers.concat(e21.wrap)), null != e21.bufferLength && (r10.bufferLength = e21.bufferLength), r10; + } }, { key: "hasWrappers", value: function() { + return this.wrappers.length > 0; + } }, { key: "getName", value: function(e21) { + return this.termNames ? this.termNames[e21] : String(e21 <= this.maxNode && this.nodeSet.types[e21].name || e21); + } }, { key: "eofTerm", get: function() { + return this.maxNode + 1; + } }, { key: "topNode", get: function() { + return this.nodeSet.types[this.top[1]]; + } }, { key: "dynamicPrecedence", value: function(e21) { + var t11 = this.dynamicPrecedences; + return null == t11 ? 0 : t11[e21] || 0; + } }, { key: "parseDialect", value: function(e21) { + var t11 = Object.keys(this.dialects), n10 = t11.map(function() { + return false; + }); + if (e21) { + var r10, o10 = bo(e21.split(" ")); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value, a10 = t11.indexOf(i10); + a10 >= 0 && (n10[a10] = true); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + } + for (var s10 = null, c10 = 0; c10 < t11.length; c10++) + if (!n10[c10]) + for (var l10, u10 = this.dialects[t11[c10]]; 65535 != (l10 = this.data[u10++]); ) + (s10 || (s10 = new Uint8Array(this.maxTerm + 1)))[l10] = 1; + return new K0(e21, n10, s10); + } }], [{ key: "deserialize", value: function(e21) { + return new t10(e21); + } }]), t10; + }(); + function Q0(e20, t10) { + return e20[t10] | e20[t10 + 1] << 16; + } + function Y0(e20) { + if (e20.external) { + var t10 = e20.extend ? 1 : 0; + return function(n10, r10) { + return e20.external(n10, r10) << 1 | t10; + }; + } + return e20.get; + } + var X0 = fQ({ String: TQ.string, Number: TQ.number, "True False": TQ.bool, PropertyName: TQ.propertyName, Null: TQ.null, ",": TQ.separator, "[ ]": TQ.squareBracket, "{ }": TQ.brace }); + var Z0 = G0.deserialize({ version: 14, states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j", stateData: "#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O", goto: "!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R", nodeNames: "\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array", maxTerm: 25, nodeProps: [["openedBy", 7, "{", 12, "["], ["closedBy", 8, "}", 13, "]"]], propSources: [X0], skippedNodes: [0], repeatNodeCount: 2, tokenData: "(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~", tokenizers: [0], topRules: { JsonText: [0, 1] }, tokenPrec: 0 }); + var e1 = qQ.define({ name: "json", parser: Z0.configure({ props: [nY.add({ Object: cY({ except: /^\s*\}/ }), Array: cY({ except: /^\s*\]/ }) }), fY.add({ "Object Array": function(e20) { + var t10 = e20.firstChild, n10 = e20.lastChild; + return t10 && t10.to < n10.from ? { from: t10.to, to: n10.type.isError ? e20.to : n10.from } : null; + } })] }), languageData: { closeBrackets: { brackets: ["[", "{", '"'] }, indentOnInput: /^\s*[\}\]]$/ } }); + var t1 = "function" == typeof String.prototype.normalize ? function(e20) { + return e20.normalize("NFKD"); + } : function(e20) { + return e20; + }; + var n1 = function() { + function e20(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : t10.length, i10 = arguments.length > 4 ? arguments[4] : void 0, a10 = arguments.length > 5 ? arguments[5] : void 0; + No(this, e20), this.test = a10, this.value = { from: 0, to: 0 }, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = t10.iterRange(r10, o10), this.bufferStart = r10, this.normalize = i10 ? function(e21) { + return i10(t1(e21)); + } : t1, this.query = this.normalize(n10); + } + return Do(e20, [{ key: "peek", value: function() { + if (this.bufferPos == this.buffer.length) { + if (this.bufferStart += this.buffer.length, this.iter.next(), this.iter.done) + return -1; + this.bufferPos = 0, this.buffer = this.iter.value; + } + return dF(this.buffer, this.bufferPos); + } }, { key: "next", value: function() { + for (; this.matches.length; ) + this.matches.pop(); + return this.nextOverlapping(); + } }, { key: "nextOverlapping", value: function() { + for (; ; ) { + var e21 = this.peek(); + if (e21 < 0) + return this.done = true, this; + var t10 = hF(e21), n10 = this.bufferStart + this.bufferPos; + this.bufferPos += vF(e21); + for (var r10 = this.normalize(t10), o10 = 0, i10 = n10; ; o10++) { + var a10 = r10.charCodeAt(o10), s10 = this.match(a10, i10); + if (o10 == r10.length - 1) { + if (s10) + return this.value = s10, this; + break; + } + i10 == n10 && o10 < t10.length && t10.charCodeAt(o10) == a10 && i10++; + } + } + } }, { key: "match", value: function(e21, t10) { + for (var n10 = null, r10 = 0; r10 < this.matches.length; r10 += 2) { + var o10 = this.matches[r10], i10 = false; + this.query.charCodeAt(o10) == e21 && (o10 == this.query.length - 1 ? n10 = { from: this.matches[r10 + 1], to: t10 + 1 } : (this.matches[r10]++, i10 = true)), i10 || (this.matches.splice(r10, 2), r10 -= 2); + } + return this.query.charCodeAt(0) == e21 && (1 == this.query.length ? n10 = { from: t10, to: t10 + 1 } : this.matches.push(1, t10)), n10 && this.test && !this.test(n10.from, n10.to, this.buffer, this.bufferStart) && (n10 = null), n10; + } }]), e20; + }(); + "undefined" != typeof Symbol && (n1.prototype[Symbol.iterator] = function() { + return this; + }); + var r1 = { from: -1, to: -1, match: /.*/.exec("") }; + var o1 = "gm" + (null == /x/.unicode ? "" : "u"); + var i1 = function() { + function e20(t10, n10, r10) { + var o10 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i10 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : t10.length; + if (No(this, e20), this.text = t10, this.to = i10, this.curLine = "", this.done = false, this.value = r1, /\\[sWDnr]|\n|\r|\[\^/.test(n10)) + return new c1(t10, n10, r10, o10, i10); + this.re = new RegExp(n10, o1 + ((null == r10 ? void 0 : r10.ignoreCase) ? "i" : "")), this.test = null == r10 ? void 0 : r10.test, this.iter = t10.iter(); + var a10 = t10.lineAt(o10); + this.curLineStart = a10.from, this.matchPos = l1(t10, o10), this.getLine(this.curLineStart); + } + return Do(e20, [{ key: "getLine", value: function(e21) { + this.iter.next(e21), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next()); + } }, { key: "nextLine", value: function() { + this.curLineStart = this.curLineStart + this.curLine.length + 1, this.curLineStart > this.to ? this.curLine = "" : this.getLine(0); + } }, { key: "next", value: function() { + for (var e21 = this.matchPos - this.curLineStart; ; ) { + this.re.lastIndex = e21; + var t10 = this.matchPos <= this.to && this.re.exec(this.curLine); + if (t10) { + var n10 = this.curLineStart + t10.index, r10 = n10 + t10[0].length; + if (this.matchPos = l1(this.text, r10 + (n10 == r10 ? 1 : 0)), n10 == this.curLineStart + this.curLine.length && this.nextLine(), (n10 < r10 || n10 > this.value.to) && (!this.test || this.test(n10, r10, t10))) + return this.value = { from: n10, to: r10, match: t10 }, this; + e21 = this.matchPos - this.curLineStart; + } else { + if (!(this.curLineStart + this.curLine.length < this.to)) + return this.done = true, this; + this.nextLine(), e21 = 0; + } + } + } }]), e20; + }(); + var a1 = /* @__PURE__ */ new WeakMap(); + var s1 = function() { + function e20(t10, n10) { + No(this, e20), this.from = t10, this.text = n10; + } + return Do(e20, [{ key: "to", get: function() { + return this.from + this.text.length; + } }], [{ key: "get", value: function(t10, n10, r10) { + var o10 = a1.get(t10); + if (!o10 || o10.from >= r10 || o10.to <= n10) { + var i10 = new e20(n10, t10.sliceString(n10, r10)); + return a1.set(t10, i10), i10; + } + if (o10.from == n10 && o10.to == r10) + return o10; + var a10 = o10.text, s10 = o10.from; + return s10 > n10 && (a10 = t10.sliceString(n10, s10) + a10, s10 = n10), o10.to < r10 && (a10 += t10.sliceString(o10.to, r10)), a1.set(t10, new e20(s10, a10)), new e20(n10, a10.slice(n10 - s10, r10 - s10)); + } }]), e20; + }(); + var c1 = function() { + function e20(t10, n10, r10, o10, i10) { + No(this, e20), this.text = t10, this.to = i10, this.done = false, this.value = r1, this.matchPos = l1(t10, o10), this.re = new RegExp(n10, o1 + ((null == r10 ? void 0 : r10.ignoreCase) ? "i" : "")), this.test = null == r10 ? void 0 : r10.test, this.flat = s1.get(t10, o10, this.chunkEnd(o10 + 5e3)); + } + return Do(e20, [{ key: "chunkEnd", value: function(e21) { + return e21 >= this.to ? this.to : this.text.lineAt(e21).to; + } }, { key: "next", value: function() { + for (; ; ) { + var e21 = this.re.lastIndex = this.matchPos - this.flat.from, t10 = this.re.exec(this.flat.text); + if (t10 && !t10[0] && t10.index == e21 && (this.re.lastIndex = e21 + 1, t10 = this.re.exec(this.flat.text)), t10) { + var n10 = this.flat.from + t10.index, r10 = n10 + t10[0].length; + if ((this.flat.to >= this.to || t10.index + t10[0].length <= this.flat.text.length - 10) && (!this.test || this.test(n10, r10, t10))) + return this.value = { from: n10, to: r10, match: t10 }, this.matchPos = l1(this.text, r10 + (n10 == r10 ? 1 : 0)), this; + } + if (this.flat.to == this.to) + return this.done = true, this; + this.flat = s1.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + 2 * this.flat.text.length)); + } + } }]), e20; + }(); + function l1(e20, t10) { + if (t10 >= e20.length) + return t10; + for (var n10, r10 = e20.lineAt(t10); t10 < r10.to && (n10 = r10.text.charCodeAt(t10 - r10.from)) >= 56320 && n10 < 57344; ) + t10++; + return t10; + } + function u1(e20) { + var t10 = JZ("input", { class: "cm-textfield", name: "line", value: String(e20.state.doc.lineAt(e20.state.selection.main.head).number) }); + function n10() { + var n11 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t10.value); + if (n11) { + var r10 = e20.state, o10 = r10.doc.lineAt(r10.selection.main.head), i10 = jo(n11, 5), a10 = i10[1], s10 = i10[2], c10 = i10[3], l10 = i10[4], u10 = c10 ? +c10.slice(1) : 0, f10 = s10 ? +s10 : o10.number; + if (s10 && l10) { + var d10 = f10 / 100; + a10 && (d10 = d10 * ("-" == a10 ? -1 : 1) + o10.number / r10.doc.lines), f10 = Math.round(r10.doc.lines * d10); + } else + s10 && a10 && (f10 = f10 * ("-" == a10 ? -1 : 1) + o10.number); + var h10 = r10.doc.line(Math.max(1, Math.min(r10.doc.lines, f10))), v10 = $F.cursor(h10.from + Math.max(0, Math.min(u10, h10.length))); + e20.dispatch({ effects: [f1.of(false), zJ.scrollIntoView(v10.from, { y: "center" })], selection: v10 }), e20.focus(); + } + } + return { dom: JZ("form", { class: "cm-gotoLine", onkeydown: function(t11) { + 27 == t11.keyCode ? (t11.preventDefault(), e20.dispatch({ effects: f1.of(false) }), e20.focus()) : 13 == t11.keyCode && (t11.preventDefault(), n10()); + }, onsubmit: function(e21) { + e21.preventDefault(), n10(); + } }, JZ("label", e20.state.phrase("Go to line"), ": ", t10), " ", JZ("button", { class: "cm-button", type: "submit" }, e20.state.phrase("go"))) }; + } + "undefined" != typeof Symbol && (i1.prototype[Symbol.iterator] = c1.prototype[Symbol.iterator] = function() { + return this; + }); + var f1 = oV.define(); + var d1 = NF.define({ create: function() { + return true; + }, update: function(e20, t10) { + var n10, r10 = bo(t10.effects); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + o10.is(f1) && (e20 = o10.value); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + return e20; + }, provide: function(e20) { + return aG.from(e20, function(e21) { + return e21 ? u1 : null; + }); + } }); + var h1 = zJ.baseTheme({ ".cm-panel.cm-gotoLine": { padding: "2px 6px 4px", "& label": { fontSize: "80%" } } }); + var v1 = { highlightWordAroundCursor: false, minSelectionLength: 1, maxMatches: 100, wholeWords: false }; + var p1 = MF.define({ combine: function(e20) { + return gV(e20, v1, { highlightWordAroundCursor: function(e21, t10) { + return e21 || t10; + }, minSelectionLength: Math.min, maxMatches: Math.min }); + } }); + var m1 = KH.mark({ class: "cm-selectionMatch" }); + var g1 = KH.mark({ class: "cm-selectionMatch cm-selectionMatch-main" }); + function y1(e20, t10, n10, r10) { + return !(0 != n10 && e20(t10.sliceDoc(n10 - 1, n10)) == hV.Word || r10 != t10.doc.length && e20(t10.sliceDoc(r10, r10 + 1)) == hV.Word); + } + var b1 = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.decorations = this.getDeco(t10); + } + return Do(e20, [{ key: "update", value: function(e21) { + (e21.selectionSet || e21.docChanged || e21.viewportChanged) && (this.decorations = this.getDeco(e21.view)); + } }, { key: "getDeco", value: function(e21) { + var t10 = e21.state.facet(p1), n10 = e21.state, r10 = n10.selection; + if (r10.ranges.length > 1) + return KH.none; + var o10, i10 = r10.main, a10 = null; + if (i10.empty) { + if (!t10.highlightWordAroundCursor) + return KH.none; + var s10 = n10.wordAt(i10.head); + if (!s10) + return KH.none; + a10 = n10.charCategorizer(i10.head), o10 = n10.sliceDoc(s10.from, s10.to); + } else { + var c10 = i10.to - i10.from; + if (c10 < t10.minSelectionLength || c10 > 200) + return KH.none; + if (t10.wholeWords) { + if (o10 = n10.sliceDoc(i10.from, i10.to), !y1(a10 = n10.charCategorizer(i10.head), n10, i10.from, i10.to) || !function(e23, t11, n11, r11) { + return e23(t11.sliceDoc(n11, n11 + 1)) == hV.Word && e23(t11.sliceDoc(r11 - 1, r11)) == hV.Word; + }(a10, n10, i10.from, i10.to)) + return KH.none; + } else if (!(o10 = n10.sliceDoc(i10.from, i10.to).trim())) + return KH.none; + } + var l10, u10 = [], f10 = bo(e21.visibleRanges); + try { + for (f10.s(); !(l10 = f10.n()).done; ) + for (var d10 = l10.value, h10 = new n1(n10.doc, o10, d10.from, d10.to); !h10.next().done; ) { + var v10 = h10.value, p10 = v10.from, m10 = v10.to; + if ((!a10 || y1(a10, n10, p10, m10)) && (i10.empty && p10 <= i10.from && m10 >= i10.to ? u10.push(g1.range(p10, m10)) : (p10 >= i10.to || m10 <= i10.from) && u10.push(m1.range(p10, m10)), u10.length > t10.maxMatches)) + return KH.none; + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + return KH.set(u10); + } }]), e20; + }(), { decorations: function(e20) { + return e20.decorations; + } }); + var k1 = zJ.baseTheme({ ".cm-selectionMatch": { backgroundColor: "#99ff7780" }, ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" } }); + var w1 = MF.define({ combine: function(e20) { + return gV(e20, { top: false, caseSensitive: false, literal: false, regexp: false, wholeWord: false, createPanel: function(e21) { + return new Y1(e21); + }, scrollToMatch: function(e21) { + return zJ.scrollIntoView(e21); + } }); + } }); + function x1(e20) { + return e20 ? [w1.of(e20), r2] : r2; + } + var j1 = function() { + function e20(t10) { + No(this, e20), this.search = t10.search, this.caseSensitive = !!t10.caseSensitive, this.literal = !!t10.literal, this.regexp = !!t10.regexp, this.replace = t10.replace || "", this.valid = !!this.search && (!this.regexp || function(e21) { + try { + return new RegExp(e21, o1), true; + } catch (e23) { + return false; + } + }(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!t10.wholeWord; + } + return Do(e20, [{ key: "unquote", value: function(e21) { + return this.literal ? e21 : e21.replace(/\\([nrt\\])/g, function(e23, t10) { + return "n" == t10 ? "\n" : "r" == t10 ? "\r" : "t" == t10 ? " " : "\\"; + }); + } }, { key: "eq", value: function(e21) { + return this.search == e21.search && this.replace == e21.replace && this.caseSensitive == e21.caseSensitive && this.regexp == e21.regexp && this.wholeWord == e21.wholeWord; + } }, { key: "create", value: function() { + return this.regexp ? new E1(this) : new $1(this); + } }, { key: "getCursor", value: function(e21) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n10 = arguments.length > 2 ? arguments[2] : void 0, r10 = e21.doc ? e21 : mV.create({ doc: e21 }); + return null == n10 && (n10 = r10.doc.length), this.regexp ? _1(this, r10, t10, n10) : C1(this, r10, t10, n10); + } }]), e20; + }(); + var S1 = Do(function e14(t10) { + No(this, e14), this.spec = t10; + }); + function C1(e20, t10, n10, r10) { + return new n1(t10.doc, e20.unquoted, n10, r10, e20.caseSensitive ? void 0 : function(e21) { + return e21.toLowerCase(); + }, e20.wholeWord ? /* @__PURE__ */ function(e21, t11) { + return function(n11, r11, o10, i10) { + return (i10 > n11 || i10 + o10.length < r11) && (i10 = Math.max(0, n11 - 2), o10 = e21.sliceString(i10, Math.min(e21.length, r11 + 2))), !(t11(O1(o10, n11 - i10)) == hV.Word && t11(M1(o10, n11 - i10)) == hV.Word || t11(M1(o10, r11 - i10)) == hV.Word && t11(O1(o10, r11 - i10)) == hV.Word); + }; + }(t10.doc, t10.charCategorizer(t10.selection.main.head)) : void 0); + } + var $1 = function(e20) { + function t10(e21) { + return No(this, t10), _o(this, t10, [e21]); + } + return Ao(t10, S1), Do(t10, [{ key: "nextMatch", value: function(e21, t11, n10) { + var r10 = C1(this.spec, e21, n10, e21.doc.length).nextOverlapping(); + return r10.done && (r10 = C1(this.spec, e21, 0, t11).nextOverlapping()), r10.done ? null : r10.value; + } }, { key: "prevMatchInRange", value: function(e21, t11, n10) { + for (var r10 = n10; ; ) { + for (var o10 = Math.max(t11, r10 - 1e4 - this.spec.unquoted.length), i10 = C1(this.spec, e21, o10, r10), a10 = null; !i10.nextOverlapping().done; ) + a10 = i10.value; + if (a10) + return a10; + if (o10 == t11) + return null; + r10 -= 1e4; + } + } }, { key: "prevMatch", value: function(e21, t11, n10) { + return this.prevMatchInRange(e21, 0, t11) || this.prevMatchInRange(e21, n10, e21.doc.length); + } }, { key: "getReplacement", value: function(e21) { + return this.spec.unquote(this.spec.replace); + } }, { key: "matchAll", value: function(e21, t11) { + for (var n10 = C1(this.spec, e21, 0, e21.doc.length), r10 = []; !n10.next().done; ) { + if (r10.length >= t11) + return null; + r10.push(n10.value); + } + return r10; + } }, { key: "highlight", value: function(e21, t11, n10, r10) { + for (var o10 = C1(this.spec, e21, Math.max(0, t11 - this.spec.unquoted.length), Math.min(n10 + this.spec.unquoted.length, e21.doc.length)); !o10.next().done; ) + r10(o10.value.from, o10.value.to); + } }]), t10; + }(); + function _1(e20, t10, n10, r10) { + return new i1(t10.doc, e20.search, { ignoreCase: !e20.caseSensitive, test: e20.wholeWord ? (o10 = t10.charCategorizer(t10.selection.main.head), function(e21, t11, n11) { + return !n11[0].length || (o10(O1(n11.input, n11.index)) != hV.Word || o10(M1(n11.input, n11.index)) != hV.Word) && (o10(M1(n11.input, n11.index + n11[0].length)) != hV.Word || o10(O1(n11.input, n11.index + n11[0].length)) != hV.Word); + }) : void 0 }, n10, r10); + var o10; + } + function O1(e20, t10) { + return e20.slice(sF(e20, t10, false), t10); + } + function M1(e20, t10) { + return e20.slice(t10, sF(e20, t10)); + } + var E1 = function(e20) { + function t10() { + return No(this, t10), _o(this, t10, arguments); + } + return Ao(t10, S1), Do(t10, [{ key: "nextMatch", value: function(e21, t11, n10) { + var r10 = _1(this.spec, e21, n10, e21.doc.length).next(); + return r10.done && (r10 = _1(this.spec, e21, 0, t11).next()), r10.done ? null : r10.value; + } }, { key: "prevMatchInRange", value: function(e21, t11, n10) { + for (var r10 = 1; ; r10++) { + for (var o10 = Math.max(t11, n10 - 1e4 * r10), i10 = _1(this.spec, e21, o10, n10), a10 = null; !i10.next().done; ) + a10 = i10.value; + if (a10 && (o10 == t11 || a10.from > o10 + 10)) + return a10; + if (o10 == t11) + return null; + } + } }, { key: "prevMatch", value: function(e21, t11, n10) { + return this.prevMatchInRange(e21, 0, t11) || this.prevMatchInRange(e21, n10, e21.doc.length); + } }, { key: "getReplacement", value: function(e21) { + return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g, function(t11, n10) { + return "$" == n10 ? "$" : "&" == n10 ? e21.match[0] : "0" != n10 && +n10 < e21.match.length ? e21.match[n10] : t11; + }); + } }, { key: "matchAll", value: function(e21, t11) { + for (var n10 = _1(this.spec, e21, 0, e21.doc.length), r10 = []; !n10.next().done; ) { + if (r10.length >= t11) + return null; + r10.push(n10.value); + } + return r10; + } }, { key: "highlight", value: function(e21, t11, n10, r10) { + for (var o10 = _1(this.spec, e21, Math.max(0, t11 - 250), Math.min(n10 + 250, e21.doc.length)); !o10.next().done; ) + r10(o10.value.from, o10.value.to); + } }]), t10; + }(); + var A1 = oV.define(); + var P1 = oV.define(); + var T1 = NF.define({ create: function(e20) { + return new R1(W1(e20).create(), null); + }, update: function(e20, t10) { + var n10, r10 = bo(t10.effects); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + o10.is(A1) ? e20 = new R1(o10.value.create(), e20.panel) : o10.is(P1) && (e20 = new R1(e20.query, o10.value ? H1 : null)); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + return e20; + }, provide: function(e20) { + return aG.from(e20, function(e21) { + return e21.panel; + }); + } }); + var R1 = Do(function e15(t10, n10) { + No(this, e15), this.query = t10, this.panel = n10; + }); + var N1 = KH.mark({ class: "cm-searchMatch" }); + var I1 = KH.mark({ class: "cm-searchMatch cm-searchMatch-selected" }); + var D1 = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.view = t10, this.decorations = this.highlight(t10.state.field(T1)); + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = e21.state.field(T1); + (t10 != e21.startState.field(T1) || e21.docChanged || e21.selectionSet || e21.viewportChanged) && (this.decorations = this.highlight(t10)); + } }, { key: "highlight", value: function(e21) { + var t10 = e21.query; + if (!e21.panel || !t10.spec.valid) + return KH.none; + for (var n10 = this.view, r10 = new jV(), o10 = 0, i10 = n10.visibleRanges, a10 = i10.length; o10 < a10; o10++) { + for (var s10 = i10[o10], c10 = s10.from, l10 = s10.to; o10 < a10 - 1 && l10 > i10[o10 + 1].from - 500; ) + l10 = i10[++o10].to; + t10.highlight(n10.state, c10, l10, function(e23, t11) { + var o11 = n10.state.selection.ranges.some(function(n11) { + return n11.from == e23 && n11.to == t11; + }); + r10.add(e23, t11, o11 ? I1 : N1); + }); + } + return r10.finish(); + } }]), e20; + }(), { decorations: function(e20) { + return e20.decorations; + } }); + function q1(e20) { + return function(t10) { + var n10 = t10.state.field(T1, false); + return n10 && n10.query.spec.valid ? e20(t10, n10) : K1(t10); + }; + } + var z1 = q1(function(e20, t10) { + var n10 = t10.query, r10 = e20.state.selection.main.to, o10 = n10.nextMatch(e20.state, r10, r10); + if (!o10) + return false; + var i10 = $F.single(o10.from, o10.to), a10 = e20.state.facet(w1); + return e20.dispatch({ selection: i10, effects: [t2(e20, o10), a10.scrollToMatch(i10.main, e20)], userEvent: "select.search" }), J1(e20), true; + }); + var B1 = q1(function(e20, t10) { + var n10 = t10.query, r10 = e20.state, o10 = r10.selection.main.from, i10 = n10.prevMatch(r10, o10, o10); + if (!i10) + return false; + var a10 = $F.single(i10.from, i10.to), s10 = e20.state.facet(w1); + return e20.dispatch({ selection: a10, effects: [t2(e20, i10), s10.scrollToMatch(a10.main, e20)], userEvent: "select.search" }), J1(e20), true; + }); + var L1 = q1(function(e20, t10) { + var n10 = t10.query.matchAll(e20.state, 1e3); + return !(!n10 || !n10.length) && (e20.dispatch({ selection: $F.create(n10.map(function(e21) { + return $F.range(e21.from, e21.to); + })), userEvent: "select.search.matches" }), true); + }); + var F1 = q1(function(e20, t10) { + var n10 = t10.query, r10 = e20.state, o10 = r10.selection.main, i10 = o10.from, a10 = o10.to; + if (r10.readOnly) + return false; + var s10 = n10.nextMatch(r10, i10, i10); + if (!s10) + return false; + var c10, l10, u10 = [], f10 = []; + if (s10.from == i10 && s10.to == a10 && (l10 = r10.toText(n10.getReplacement(s10)), u10.push({ from: s10.from, to: s10.to, insert: l10 }), s10 = n10.nextMatch(r10, s10.from, s10.to), f10.push(zJ.announce.of(r10.phrase("replaced match on line $", r10.doc.lineAt(i10).number) + "."))), s10) { + var d10 = 0 == u10.length || u10[0].from >= s10.to ? 0 : s10.to - s10.from - l10.length; + c10 = $F.single(s10.from - d10, s10.to - d10), f10.push(t2(e20, s10)), f10.push(r10.facet(w1).scrollToMatch(c10.main, e20)); + } + return e20.dispatch({ changes: u10, selection: c10, effects: f10, userEvent: "input.replace" }), true; + }); + var V1 = q1(function(e20, t10) { + var n10 = t10.query; + if (e20.state.readOnly) + return false; + var r10 = n10.matchAll(e20.state, 1e9).map(function(e21) { + return { from: e21.from, to: e21.to, insert: n10.getReplacement(e21) }; + }); + if (!r10.length) + return false; + var o10 = e20.state.phrase("replaced $ matches", r10.length) + "."; + return e20.dispatch({ changes: r10, effects: zJ.announce.of(o10), userEvent: "input.replace.all" }), true; + }); + function H1(e20) { + return e20.state.facet(w1).createPanel(e20); + } + function W1(e20, t10) { + var n10, r10, o10, i10, a10, s10 = e20.selection.main, c10 = s10.empty || s10.to > s10.from + 100 ? "" : e20.sliceDoc(s10.from, s10.to); + if (t10 && !c10) + return t10; + var l10 = e20.facet(w1); + return new j1({ search: (null !== (n10 = null == t10 ? void 0 : t10.literal) && void 0 !== n10 ? n10 : l10.literal) ? c10 : c10.replace(/\n/g, "\\n"), caseSensitive: null !== (r10 = null == t10 ? void 0 : t10.caseSensitive) && void 0 !== r10 ? r10 : l10.caseSensitive, literal: null !== (o10 = null == t10 ? void 0 : t10.literal) && void 0 !== o10 ? o10 : l10.literal, regexp: null !== (i10 = null == t10 ? void 0 : t10.regexp) && void 0 !== i10 ? i10 : l10.regexp, wholeWord: null !== (a10 = null == t10 ? void 0 : t10.wholeWord) && void 0 !== a10 ? a10 : l10.wholeWord }); + } + function U1(e20) { + var t10 = nG(e20, H1); + return t10 && t10.dom.querySelector("[main-field]"); + } + function J1(e20) { + var t10 = U1(e20); + t10 && t10 == e20.root.activeElement && t10.select(); + } + var K1 = function(e20) { + var t10 = e20.state.field(T1, false); + if (t10 && t10.panel) { + var n10 = U1(e20); + if (n10 && n10 != e20.root.activeElement) { + var r10 = W1(e20.state, t10.query.spec); + r10.valid && e20.dispatch({ effects: A1.of(r10) }), n10.focus(), n10.select(); + } + } else + e20.dispatch({ effects: [P1.of(true), t10 ? A1.of(W1(e20.state, t10.query.spec)) : oV.appendConfig.of(r2)] }); + return true; + }; + var G1 = function(e20) { + var t10 = e20.state.field(T1, false); + if (!t10 || !t10.panel) + return false; + var n10 = nG(e20, H1); + return n10 && n10.dom.contains(e20.root.activeElement) && e20.focus(), e20.dispatch({ effects: P1.of(false) }), true; + }; + var Q1 = [{ key: "Mod-f", run: K1, scope: "editor search-panel" }, { key: "F3", run: z1, shift: B1, scope: "editor search-panel", preventDefault: true }, { key: "Mod-g", run: z1, shift: B1, scope: "editor search-panel", preventDefault: true }, { key: "Escape", run: G1, scope: "editor search-panel" }, { key: "Mod-Shift-l", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch, r10 = t10.selection; + if (r10.ranges.length > 1 || r10.main.empty) + return false; + for (var o10 = r10.main, i10 = o10.from, a10 = o10.to, s10 = [], c10 = 0, l10 = new n1(t10.doc, t10.sliceDoc(i10, a10)); !l10.next().done; ) { + if (s10.length > 1e3) + return false; + l10.value.from == i10 && (c10 = s10.length), s10.push($F.range(l10.value.from, l10.value.to)); + } + return n10(t10.update({ selection: $F.create(s10, c10), userEvent: "select.search.matches" })), true; + } }, { key: "Mod-Alt-g", run: function(e20) { + var t10 = nG(e20, u1); + if (!t10) { + var n10 = [f1.of(true)]; + null == e20.state.field(d1, false) && n10.push(oV.appendConfig.of([d1, h1])), e20.dispatch({ effects: n10 }), t10 = nG(e20, u1); + } + return t10 && t10.dom.querySelector("input").select(), true; + } }, { key: "Mod-d", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch, r10 = t10.selection.ranges; + if (r10.some(function(e21) { + return e21.from === e21.to; + })) + return function(e21) { + var t11 = e21.state, n11 = e21.dispatch, r11 = t11.selection, o11 = $F.create(r11.ranges.map(function(e23) { + return t11.wordAt(e23.head) || $F.cursor(e23.head); + }), r11.mainIndex); + return !o11.eq(r11) && (n11(t11.update({ selection: o11 })), true); + }({ state: t10, dispatch: n10 }); + var o10 = t10.sliceDoc(r10[0].from, r10[0].to); + if (t10.selection.ranges.some(function(e21) { + return t10.sliceDoc(e21.from, e21.to) != o10; + })) + return false; + var i10 = function(e21, t11) { + for (var n11, r11 = e21.selection, o11 = r11.main, i11 = r11.ranges, a10 = e21.wordAt(o11.head), s10 = a10 && a10.from == o11.from && a10.to == o11.to, c10 = function(n12, r12) { + if (r12.next(), !r12.done) { + if (n12 && i11.some(function(e23) { + return e23.from == r12.value.from; + })) + return l10 = n12, u10 = r12, 0; + if (s10) { + var o12 = e21.wordAt(r12.value.from); + if (!o12 || o12.from != r12.value.from || o12.to != r12.value.to) + return l10 = n12, u10 = r12, 0; + } + return { v: r12.value }; + } + if (n12) + return { v: null }; + r12 = new n1(e21.doc, t11, 0, Math.max(0, i11[i11.length - 1].from - 1)), l10 = n12 = true, u10 = r12; + }, l10 = false, u10 = new n1(e21.doc, t11, i11[i11.length - 1].to); ; ) + if (0 !== (n11 = c10(l10, u10)) && n11) + return n11.v; + }(t10, o10); + return !!i10 && (n10(t10.update({ selection: t10.selection.addRange($F.range(i10.from, i10.to), false), effects: zJ.scrollIntoView(i10.to) })), true); + }, preventDefault: true }]; + var Y1 = function() { + function e20(t10) { + var n10 = this; + No(this, e20), this.view = t10; + var r10 = this.query = t10.state.field(T1).query.spec; + function o10(e21, t11, n11) { + return JZ("button", { class: "cm-button", name: e21, onclick: t11, type: "button" }, n11); + } + this.commit = this.commit.bind(this), this.searchField = JZ("input", { value: r10.search, placeholder: X1(t10, "Find"), "aria-label": X1(t10, "Find"), class: "cm-textfield", name: "search", form: "", "main-field": "true", onchange: this.commit, onkeyup: this.commit }), this.replaceField = JZ("input", { value: r10.replace, placeholder: X1(t10, "Replace"), "aria-label": X1(t10, "Replace"), class: "cm-textfield", name: "replace", form: "", onchange: this.commit, onkeyup: this.commit }), this.caseField = JZ("input", { type: "checkbox", name: "case", form: "", checked: r10.caseSensitive, onchange: this.commit }), this.reField = JZ("input", { type: "checkbox", name: "re", form: "", checked: r10.regexp, onchange: this.commit }), this.wordField = JZ("input", { type: "checkbox", name: "word", form: "", checked: r10.wholeWord, onchange: this.commit }), this.dom = JZ("div", { onkeydown: function(e21) { + return n10.keydown(e21); + }, class: "cm-search" }, [this.searchField, o10("next", function() { + return z1(t10); + }, [X1(t10, "next")]), o10("prev", function() { + return B1(t10); + }, [X1(t10, "previous")]), o10("select", function() { + return L1(t10); + }, [X1(t10, "all")]), JZ("label", null, [this.caseField, X1(t10, "match case")]), JZ("label", null, [this.reField, X1(t10, "regexp")]), JZ("label", null, [this.wordField, X1(t10, "by word")])].concat(Bo(t10.state.readOnly ? [] : [JZ("br"), this.replaceField, o10("replace", function() { + return F1(t10); + }, [X1(t10, "replace")]), o10("replaceAll", function() { + return V1(t10); + }, [X1(t10, "replace all")])]), [JZ("button", { name: "close", onclick: function() { + return G1(t10); + }, "aria-label": X1(t10, "close"), type: "button" }, ["\xD7"])])); + } + return Do(e20, [{ key: "commit", value: function() { + var e21 = new j1({ search: this.searchField.value, caseSensitive: this.caseField.checked, regexp: this.reField.checked, wholeWord: this.wordField.checked, replace: this.replaceField.value }); + e21.eq(this.query) || (this.query = e21, this.view.dispatch({ effects: A1.of(e21) })); + } }, { key: "keydown", value: function(e21) { + !function(e23, t10, n10) { + return XJ(GJ(e23.state), t10, e23, n10); + }(this.view, e21, "search-panel") ? 13 == e21.keyCode && e21.target == this.searchField ? (e21.preventDefault(), (e21.shiftKey ? B1 : z1)(this.view)) : 13 == e21.keyCode && e21.target == this.replaceField && (e21.preventDefault(), F1(this.view)) : e21.preventDefault(); + } }, { key: "update", value: function(e21) { + var t10, n10 = bo(e21.transactions); + try { + for (n10.s(); !(t10 = n10.n()).done; ) { + var r10, o10 = bo(t10.value.effects); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + i10.is(A1) && !i10.value.eq(this.query) && this.setQuery(i10.value); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "setQuery", value: function(e21) { + this.query = e21, this.searchField.value = e21.search, this.replaceField.value = e21.replace, this.caseField.checked = e21.caseSensitive, this.reField.checked = e21.regexp, this.wordField.checked = e21.wholeWord; + } }, { key: "mount", value: function() { + this.searchField.select(); + } }, { key: "pos", get: function() { + return 80; + } }, { key: "top", get: function() { + return this.view.state.facet(w1).top; + } }]), e20; + }(); + function X1(e20, t10) { + return e20.state.phrase(t10); + } + var Z1 = 30; + var e22 = /[\s\.,:;?!]/; + function t2(e20, t10) { + var n10 = t10.from, r10 = t10.to, o10 = e20.state.doc.lineAt(n10), i10 = e20.state.doc.lineAt(r10).to, a10 = Math.max(o10.from, n10 - Z1), s10 = Math.min(i10, r10 + Z1), c10 = e20.state.sliceDoc(a10, s10); + if (a10 != o10.from) { + for (var l10 = 0; l10 < Z1; l10++) + if (!e22.test(c10[l10 + 1]) && e22.test(c10[l10])) { + c10 = c10.slice(l10); + break; + } + } + if (s10 != i10) { + for (var u10 = c10.length - 1; u10 > c10.length - Z1; u10--) + if (!e22.test(c10[u10 - 1]) && e22.test(c10[u10])) { + c10 = c10.slice(0, u10); + break; + } + } + return zJ.announce.of("".concat(e20.state.phrase("current match"), ". ").concat(c10, " ").concat(e20.state.phrase("on line"), " ").concat(o10.number, ".")); + } + var n2 = zJ.baseTheme({ ".cm-panel.cm-search": { padding: "2px 6px 4px", position: "relative", "& [name=close]": { position: "absolute", top: "0", right: "4px", backgroundColor: "inherit", border: "none", font: "inherit", padding: 0, margin: 0 }, "& input, & button, & label": { margin: ".2em .6em .2em 0" }, "& input[type=checkbox]": { marginRight: ".2em" }, "& label": { fontSize: "80%", whiteSpace: "pre" } }, "&light .cm-searchMatch": { backgroundColor: "#ffff0054" }, "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" }, "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" }, "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" } }); + var r2 = [T1, LF.low(D1), n2]; + var o2 = function() { + function e20(t10, n10, r10) { + No(this, e20), this.state = t10, this.pos = n10, this.explicit = r10, this.abortListeners = []; + } + return Do(e20, [{ key: "tokenBefore", value: function(e21) { + for (var t10 = zQ(this.state).resolveInner(this.pos, -1); t10 && e21.indexOf(t10.name) < 0; ) + t10 = t10.parent; + return t10 ? { from: t10.from, to: this.pos, text: this.state.sliceDoc(t10.from, this.pos), type: t10.type } : null; + } }, { key: "matchBefore", value: function(e21) { + var t10 = this.state.doc.lineAt(this.pos), n10 = Math.max(t10.from, this.pos - 250), r10 = t10.text.slice(n10 - t10.from, this.pos - t10.from), o10 = r10.search(l2(e21, false)); + return o10 < 0 ? null : { from: n10 + o10, to: this.pos, text: r10.slice(o10) }; + } }, { key: "aborted", get: function() { + return null == this.abortListeners; + } }, { key: "addEventListener", value: function(e21, t10) { + "abort" == e21 && this.abortListeners && this.abortListeners.push(t10); + } }]), e20; + }(); + function i2(e20) { + var t10 = Object.keys(e20).join(""), n10 = /\w/.test(t10); + return n10 && (t10 = t10.replace(/\w/g, "")), "[".concat(n10 ? "\\w" : "").concat(t10.replace(/[^\w\s]/g, "\\$&"), "]"); + } + function a2(e20) { + var t10 = e20.map(function(e21) { + return "string" == typeof e21 ? { label: e21 } : e21; + }), n10 = t10.every(function(e21) { + return /^\w+$/.test(e21.label); + }) ? [/\w*$/, /\w+$/] : function(e21) { + var t11, n11 = /* @__PURE__ */ Object.create(null), r11 = /* @__PURE__ */ Object.create(null), o11 = bo(e21); + try { + for (o11.s(); !(t11 = o11.n()).done; ) { + var i11 = t11.value.label; + n11[i11[0]] = true; + for (var a10 = 1; a10 < i11.length; a10++) + r11[i11[a10]] = true; + } + } catch (e23) { + o11.e(e23); + } finally { + o11.f(); + } + var s10 = i2(n11) + i2(r11) + "*$"; + return [new RegExp("^" + s10), new RegExp(s10)]; + }(t10), r10 = jo(n10, 2), o10 = r10[0], i10 = r10[1]; + return function(e21) { + var n11 = e21.matchBefore(i10); + return n11 || e21.explicit ? { from: n11 ? n11.from : e21.pos, options: t10, validFor: o10 } : null; + }; + } + var s2 = Do(function e16(t10, n10, r10, o10) { + No(this, e16), this.completion = t10, this.source = n10, this.match = r10, this.score = o10; + }); + function c2(e20) { + return e20.selection.main.from; + } + function l2(e20, t10) { + var n10, r10 = e20.source, o10 = t10 && "^" != r10[0], i10 = "$" != r10[r10.length - 1]; + return o10 || i10 ? new RegExp("".concat(o10 ? "^" : "", "(?:").concat(r10, ")").concat(i10 ? "$" : ""), null !== (n10 = e20.flags) && void 0 !== n10 ? n10 : e20.ignoreCase ? "i" : "") : e20; + } + var u2 = tV.define(); + var f2 = /* @__PURE__ */ new WeakMap(); + function d2(e20) { + if (!Array.isArray(e20)) + return e20; + var t10 = f2.get(e20); + return t10 || f2.set(e20, t10 = a2(e20)), t10; + } + var h2 = oV.define(); + var v2 = oV.define(); + var p2 = function() { + function e20(t10) { + No(this, e20), this.pattern = t10, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = []; + for (var n10 = 0; n10 < t10.length; ) { + var r10 = dF(t10, n10), o10 = vF(r10); + this.chars.push(r10); + var i10 = t10.slice(n10, n10 + o10), a10 = i10.toUpperCase(); + this.folded.push(dF(a10 == i10 ? i10.toLowerCase() : a10, 0)), n10 += o10; + } + this.astral = t10.length != this.chars.length; + } + return Do(e20, [{ key: "ret", value: function(e21, t10) { + return this.score = e21, this.matched = t10, true; + } }, { key: "match", value: function(e21) { + if (0 == this.pattern.length) + return this.ret(-100, []); + if (e21.length < this.pattern.length) + return false; + var t10 = this.chars, n10 = this.folded, r10 = this.any, o10 = this.precise, i10 = this.byWord; + if (1 == t10.length) { + var a10 = dF(e21, 0), s10 = vF(a10), c10 = s10 == e21.length ? 0 : -100; + if (a10 == t10[0]) + ; + else { + if (a10 != n10[0]) + return false; + c10 += -200; + } + return this.ret(c10, [0, s10]); + } + var l10 = e21.indexOf(this.pattern); + if (0 == l10) + return this.ret(e21.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]); + var u10 = t10.length, f10 = 0; + if (l10 < 0) { + for (var d10 = 0, h10 = Math.min(e21.length, 200); d10 < h10 && f10 < u10; ) { + var v10 = dF(e21, d10); + v10 != t10[f10] && v10 != n10[f10] || (r10[f10++] = d10), d10 += vF(v10); + } + if (f10 < u10) + return false; + } + for (var p10 = 0, m10 = 0, g10 = false, y10 = 0, b10 = -1, k10 = -1, w10 = /[a-z]/.test(e21), x10 = true, j10 = 0, S10 = Math.min(e21.length, 200), C10 = 0; j10 < S10 && m10 < u10; ) { + var $10 = dF(e21, j10); + l10 < 0 && (p10 < u10 && $10 == t10[p10] && (o10[p10++] = j10), y10 < u10 && ($10 == t10[y10] || $10 == n10[y10] ? (0 == y10 && (b10 = j10), k10 = j10 + 1, y10++) : y10 = 0)); + var _10 = void 0, O10 = $10 < 255 ? $10 >= 48 && $10 <= 57 || $10 >= 97 && $10 <= 122 ? 2 : $10 >= 65 && $10 <= 90 ? 1 : 0 : (_10 = hF($10)) != _10.toLowerCase() ? 1 : _10 != _10.toUpperCase() ? 2 : 0; + (!j10 || 1 == O10 && w10 || 0 == C10 && 0 != O10) && (t10[m10] == $10 || n10[m10] == $10 && (g10 = true) ? i10[m10++] = j10 : i10.length && (x10 = false)), C10 = O10, j10 += vF($10); + } + return m10 == u10 && 0 == i10[0] && x10 ? this.result((g10 ? -200 : 0) - 100, i10, e21) : y10 == u10 && 0 == b10 ? this.ret(-200 - e21.length + (k10 == e21.length ? 0 : -100), [0, k10]) : l10 > -1 ? this.ret(-700 - e21.length, [l10, l10 + this.pattern.length]) : y10 == u10 ? this.ret(-900 - e21.length, [b10, k10]) : m10 == u10 ? this.result((g10 ? -200 : 0) - 100 - 700 + (x10 ? 0 : -1100), i10, e21) : 2 != t10.length && this.result((r10[0] ? -700 : 0) - 200 - 1100, r10, e21); + } }, { key: "result", value: function(e21, t10, n10) { + var r10, o10 = [], i10 = 0, a10 = bo(t10); + try { + for (a10.s(); !(r10 = a10.n()).done; ) { + var s10 = r10.value, c10 = s10 + (this.astral ? vF(dF(n10, s10)) : 1); + i10 && o10[i10 - 1] == s10 ? o10[i10 - 1] = c10 : (o10[i10++] = s10, o10[i10++] = c10); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + return this.ret(e21 - n10.length, o10); + } }]), e20; + }(); + var m2 = MF.define({ combine: function(e20) { + return gV(e20, { activateOnTyping: true, selectOnOpen: true, override: null, closeOnBlur: true, maxRenderedOptions: 100, defaultKeymap: true, tooltipClass: function() { + return ""; + }, optionClass: function() { + return ""; + }, aboveCursor: false, icons: true, addToOptions: [], positionInfo: y2, compareCompletions: function(e21, t10) { + return e21.label.localeCompare(t10.label); + }, interactionDelay: 75, updateSyncTime: 100 }, { defaultKeymap: function(e21, t10) { + return e21 && t10; + }, closeOnBlur: function(e21, t10) { + return e21 && t10; + }, icons: function(e21, t10) { + return e21 && t10; + }, tooltipClass: function(e21, t10) { + return function(n10) { + return g2(e21(n10), t10(n10)); + }; + }, optionClass: function(e21, t10) { + return function(n10) { + return g2(e21(n10), t10(n10)); + }; + }, addToOptions: function(e21, t10) { + return e21.concat(t10); + } }); + } }); + function g2(e20, t10) { + return e20 ? t10 ? e20 + " " + t10 : e20 : t10; + } + function y2(e20, t10, n10, r10, o10, i10) { + var a10, s10, c10 = e20.textDirection == rW.RTL, l10 = c10, u10 = false, f10 = "top", d10 = t10.left - o10.left, h10 = o10.right - t10.right, v10 = r10.right - r10.left, p10 = r10.bottom - r10.top; + if (l10 && d10 < Math.min(v10, h10) ? l10 = false : !l10 && h10 < Math.min(v10, d10) && (l10 = true), v10 <= (l10 ? d10 : h10)) + a10 = Math.max(o10.top, Math.min(n10.top, o10.bottom - p10)) - t10.top, s10 = Math.min(400, l10 ? d10 : h10); + else { + u10 = true, s10 = Math.min(400, (c10 ? t10.right : o10.right - t10.left) - 30); + var m10 = o10.bottom - t10.bottom; + m10 >= p10 || m10 > t10.top ? a10 = n10.bottom - t10.top : (f10 = "bottom", a10 = t10.bottom - n10.top); + } + var g10 = (t10.bottom - t10.top) / i10.offsetHeight, y10 = (t10.right - t10.left) / i10.offsetWidth; + return { style: "".concat(f10, ": ").concat(a10 / g10, "px; max-width: ").concat(s10 / y10, "px"), class: "cm-completionInfo-" + (u10 ? c10 ? "left-narrow" : "right-narrow" : l10 ? "left" : "right") }; + } + function b2(e20, t10, n10) { + if (e20 <= n10) + return { from: 0, to: e20 }; + if (t10 < 0 && (t10 = 0), t10 <= e20 >> 1) { + var r10 = Math.floor(t10 / n10); + return { from: r10 * n10, to: (r10 + 1) * n10 }; + } + var o10 = Math.floor((e20 - t10) / n10); + return { from: e20 - (o10 + 1) * n10, to: e20 - o10 * n10 }; + } + var k2 = function() { + function e20(t10, n10, r10) { + var o10 = this; + No(this, e20), this.view = t10, this.stateField = n10, this.applyCompletion = r10, this.info = null, this.infoDestroy = null, this.placeInfoReq = { read: function() { + return o10.measureInfo(); + }, write: function(e21) { + return o10.placeInfo(e21); + }, key: this }, this.space = null, this.currentClass = ""; + var i10 = t10.state.field(n10), a10 = i10.open, s10 = a10.options, c10 = a10.selected, l10 = t10.state.facet(m2); + this.optionContent = function(e21) { + var t11 = e21.addToOptions.slice(); + return e21.icons && t11.push({ render: function(e23) { + var t12, n11 = document.createElement("div"); + return n11.classList.add("cm-completionIcon"), e23.type && (t12 = n11.classList).add.apply(t12, Bo(e23.type.split(/\s+/g).map(function(e24) { + return "cm-completionIcon-" + e24; + }))), n11.setAttribute("aria-hidden", "true"), n11; + }, position: 20 }), t11.push({ render: function(e23, t12, n11, r11) { + var o11 = document.createElement("span"); + o11.className = "cm-completionLabel"; + for (var i11 = e23.displayLabel || e23.label, a11 = 0, s11 = 0; s11 < r11.length; ) { + var c11 = r11[s11++], l11 = r11[s11++]; + c11 > a11 && o11.appendChild(document.createTextNode(i11.slice(a11, c11))); + var u10 = o11.appendChild(document.createElement("span")); + u10.appendChild(document.createTextNode(i11.slice(c11, l11))), u10.className = "cm-completionMatchedText", a11 = l11; + } + return a11 < i11.length && o11.appendChild(document.createTextNode(i11.slice(a11))), o11; + }, position: 50 }, { render: function(e23) { + if (!e23.detail) + return null; + var t12 = document.createElement("span"); + return t12.className = "cm-completionDetail", t12.textContent = e23.detail, t12; + }, position: 80 }), t11.sort(function(e23, t12) { + return e23.position - t12.position; + }).map(function(e23) { + return e23.render; + }); + }(l10), this.optionClass = l10.optionClass, this.tooltipClass = l10.tooltipClass, this.range = b2(s10.length, c10, l10.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(t10.state), this.dom.addEventListener("mousedown", function(e21) { + for (var r11, i11 = t10.state.field(n10).open.options, a11 = e21.target; a11 && a11 != o10.dom; a11 = a11.parentNode) + if ("LI" == a11.nodeName && (r11 = /-(\d+)$/.exec(a11.id)) && +r11[1] < i11.length) + return o10.applyCompletion(t10, i11[+r11[1]]), void e21.preventDefault(); + }), this.dom.addEventListener("focusout", function(e21) { + var n11 = t10.state.field(o10.stateField, false); + n11 && n11.tooltip && t10.state.facet(m2).closeOnBlur && e21.relatedTarget != t10.contentDOM && t10.dispatch({ effects: v2.of(null) }); + }), this.showOptions(s10, i10.id); + } + return Do(e20, [{ key: "mount", value: function() { + this.updateSel(); + } }, { key: "showOptions", value: function(e21, t10) { + var n10 = this; + this.list && this.list.remove(), this.list = this.dom.appendChild(this.createListBox(e21, t10, this.range)), this.list.addEventListener("scroll", function() { + n10.info && n10.view.requestMeasure(n10.placeInfoReq); + }); + } }, { key: "update", value: function(e21) { + var t10, n10 = e21.state.field(this.stateField), r10 = e21.startState.field(this.stateField); + if (this.updateTooltipClass(e21.state), n10 != r10) { + var o10 = n10.open, i10 = o10.options, a10 = o10.selected, s10 = o10.disabled; + r10.open && r10.open.options == i10 || (this.range = b2(i10.length, a10, e21.state.facet(m2).maxRenderedOptions), this.showOptions(i10, n10.id)), this.updateSel(), s10 != (null === (t10 = r10.open) || void 0 === t10 ? void 0 : t10.disabled) && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!s10); + } + } }, { key: "updateTooltipClass", value: function(e21) { + var t10 = this.tooltipClass(e21); + if (t10 != this.currentClass) { + var n10, r10 = bo(this.currentClass.split(" ")); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + o10 && this.dom.classList.remove(o10); + } + } catch (e23) { + r10.e(e23); + } finally { + r10.f(); + } + var i10, a10 = bo(t10.split(" ")); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + s10 && this.dom.classList.add(s10); + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + this.currentClass = t10; + } + } }, { key: "positioned", value: function(e21) { + this.space = e21, this.info && this.view.requestMeasure(this.placeInfoReq); + } }, { key: "updateSel", value: function() { + var e21 = this, t10 = this.view.state.field(this.stateField), n10 = t10.open; + if ((n10.selected > -1 && n10.selected < this.range.from || n10.selected >= this.range.to) && (this.range = b2(n10.options.length, n10.selected, this.view.state.facet(m2).maxRenderedOptions), this.showOptions(n10.options, t10.id)), this.updateSelectedOption(n10.selected)) { + this.destroyInfo(); + var r10 = n10.options[n10.selected].completion, o10 = r10.info; + if (!o10) + return; + var i10 = "string" == typeof o10 ? document.createTextNode(o10) : o10(r10); + if (!i10) + return; + "then" in i10 ? i10.then(function(n11) { + n11 && e21.view.state.field(e21.stateField, false) == t10 && e21.addInfoPane(n11, r10); + }).catch(function(t11) { + return qW(e21.view.state, t11, "completion info"); + }) : this.addInfoPane(i10, r10); + } + } }, { key: "addInfoPane", value: function(e21, t10) { + this.destroyInfo(); + var n10 = this.info = document.createElement("div"); + if (n10.className = "cm-tooltip cm-completionInfo", null != e21.nodeType) + n10.appendChild(e21), this.infoDestroy = null; + else { + var r10 = e21.dom, o10 = e21.destroy; + n10.appendChild(r10), this.infoDestroy = o10 || null; + } + this.dom.appendChild(n10), this.view.requestMeasure(this.placeInfoReq); + } }, { key: "updateSelectedOption", value: function(e21) { + for (var t10 = null, n10 = this.list.firstChild, r10 = this.range.from; n10; n10 = n10.nextSibling, r10++) + "LI" == n10.nodeName && n10.id ? r10 == e21 ? n10.hasAttribute("aria-selected") || (n10.setAttribute("aria-selected", "true"), t10 = n10) : n10.hasAttribute("aria-selected") && n10.removeAttribute("aria-selected") : r10--; + return t10 && function(e23, t11) { + var n11 = e23.getBoundingClientRect(), r11 = t11.getBoundingClientRect(), o10 = n11.height / e23.offsetHeight; + r11.top < n11.top ? e23.scrollTop -= (n11.top - r11.top) / o10 : r11.bottom > n11.bottom && (e23.scrollTop += (r11.bottom - n11.bottom) / o10); + }(this.list, t10), t10; + } }, { key: "measureInfo", value: function() { + var e21 = this.dom.querySelector("[aria-selected]"); + if (!e21 || !this.info) + return null; + var t10 = this.dom.getBoundingClientRect(), n10 = this.info.getBoundingClientRect(), r10 = e21.getBoundingClientRect(), o10 = this.space; + if (!o10) { + var i10 = this.dom.ownerDocument.defaultView || window; + o10 = { left: 0, top: 0, right: i10.innerWidth, bottom: i10.innerHeight }; + } + return r10.top > Math.min(o10.bottom, t10.bottom) - 10 || r10.bottom < Math.max(o10.top, t10.top) + 10 ? null : this.view.state.facet(m2).positionInfo(this.view, t10, r10, n10, o10, this.dom); + } }, { key: "placeInfo", value: function(e21) { + this.info && (e21 ? (e21.style && (this.info.style.cssText = e21.style), this.info.className = "cm-tooltip cm-completionInfo " + (e21.class || "")) : this.info.style.cssText = "top: -1e6px"); + } }, { key: "createListBox", value: function(e21, t10, n10) { + var r10 = document.createElement("ul"); + r10.id = t10, r10.setAttribute("role", "listbox"), r10.setAttribute("aria-expanded", "true"), r10.setAttribute("aria-label", this.view.state.phrase("Completions")); + for (var o10 = null, i10 = n10.from; i10 < n10.to; i10++) { + var a10 = e21[i10], s10 = a10.completion, c10 = a10.match, l10 = s10.section; + if (l10) { + var u10 = "string" == typeof l10 ? l10 : l10.name; + if (u10 != o10 && (i10 > n10.from || 0 == n10.from)) + if (o10 = u10, "string" != typeof l10 && l10.header) + r10.appendChild(l10.header(l10)); + else + r10.appendChild(document.createElement("completion-section")).textContent = u10; + } + var f10 = r10.appendChild(document.createElement("li")); + f10.id = t10 + "-" + i10, f10.setAttribute("role", "option"); + var d10 = this.optionClass(s10); + d10 && (f10.className = d10); + var h10, v10 = bo(this.optionContent); + try { + for (v10.s(); !(h10 = v10.n()).done; ) { + var p10 = (0, h10.value)(s10, this.view.state, this.view, c10); + p10 && f10.appendChild(p10); + } + } catch (e23) { + v10.e(e23); + } finally { + v10.f(); + } + } + return n10.from && r10.classList.add("cm-completionListIncompleteTop"), n10.to < e21.length && r10.classList.add("cm-completionListIncompleteBottom"), r10; + } }, { key: "destroyInfo", value: function() { + this.info && (this.infoDestroy && this.infoDestroy(), this.info.remove(), this.info = null); + } }, { key: "destroy", value: function() { + this.destroyInfo(); + } }]), e20; + }(); + function w2(e20, t10) { + return function(n10) { + return new k2(n10, e20, t10); + }; + } + function x2(e20) { + return 100 * (e20.boost || 0) + (e20.apply ? 10 : 0) + (e20.info ? 5 : 0) + (e20.type ? 1 : 0); + } + var j2 = function() { + function e20(t10, n10, r10, o10, i10, a10) { + No(this, e20), this.options = t10, this.attrs = n10, this.tooltip = r10, this.timestamp = o10, this.selected = i10, this.disabled = a10; + } + return Do(e20, [{ key: "setSelected", value: function(t10, n10) { + return t10 == this.selected || t10 >= this.options.length ? this : new e20(this.options, $2(n10, t10), this.tooltip, this.timestamp, t10, this.disabled); + } }, { key: "map", value: function(t10) { + return new e20(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: t10.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled); + } }], [{ key: "build", value: function(t10, n10, r10, o10, i10) { + var a10 = function(e21, t11) { + var n11, r11 = [], o11 = null, i11 = function(e23) { + r11.push(e23); + var t12 = e23.completion.section; + if (t12) { + o11 || (o11 = []); + var n12 = "string" == typeof t12 ? t12 : t12.name; + o11.some(function(e24) { + return e24.name == n12; + }) || o11.push("string" == typeof t12 ? { name: n12 } : t12); + } + }, a11 = bo(e21); + try { + for (a11.s(); !(n11 = a11.n()).done; ) { + var s11 = n11.value; + if (s11.hasResult()) { + var c11 = s11.result.getMatch; + if (false === s11.result.filter) { + var l11, u10 = bo(s11.result.options); + try { + for (u10.s(); !(l11 = u10.n()).done; ) { + var f10 = l11.value; + i11(new s2(f10, s11.source, c11 ? c11(f10) : [], 1e9 - r11.length)); + } + } catch (e23) { + u10.e(e23); + } finally { + u10.f(); + } + } else { + var d10, h10 = new p2(t11.sliceDoc(s11.from, s11.to)), v10 = bo(s11.result.options); + try { + for (v10.s(); !(d10 = v10.n()).done; ) { + var p10 = d10.value; + if (h10.match(p10.label)) { + var m10 = p10.displayLabel ? c11 ? c11(p10, h10.matched) : [] : h10.matched; + i11(new s2(p10, s11.source, m10, h10.score + (p10.boost || 0))); + } + } + } catch (e23) { + v10.e(e23); + } finally { + v10.f(); + } + } + } + } + } catch (e23) { + a11.e(e23); + } finally { + a11.f(); + } + if (o11) { + var g10, y10 = /* @__PURE__ */ Object.create(null), b10 = 0, k10 = bo(o11.sort(function(e23, t12) { + var n12, r12; + return (null !== (n12 = e23.rank) && void 0 !== n12 ? n12 : 1e9) - (null !== (r12 = t12.rank) && void 0 !== r12 ? r12 : 1e9) || (e23.name < t12.name ? -1 : 1); + })); + try { + for (k10.s(); !(g10 = k10.n()).done; ) { + var w10 = g10.value; + b10 -= 1e5, y10[w10.name] = b10; + } + } catch (e23) { + k10.e(e23); + } finally { + k10.f(); + } + var x10, j10 = bo(r11); + try { + for (j10.s(); !(x10 = j10.n()).done; ) { + var S10 = x10.value, C10 = S10.completion.section; + C10 && (S10.score += y10["string" == typeof C10 ? C10 : C10.name]); + } + } catch (e23) { + j10.e(e23); + } finally { + j10.f(); + } + } + var $10, _10 = [], O10 = null, M10 = t11.facet(m2).compareCompletions, E10 = bo(r11.sort(function(e23, t12) { + return t12.score - e23.score || M10(e23.completion, t12.completion); + })); + try { + for (E10.s(); !($10 = E10.n()).done; ) { + var A10 = $10.value, P10 = A10.completion; + !O10 || O10.label != P10.label || O10.detail != P10.detail || null != O10.type && null != P10.type && O10.type != P10.type || O10.apply != P10.apply || O10.boost != P10.boost ? _10.push(A10) : x2(A10.completion) > x2(O10) && (_10[_10.length - 1] = A10), O10 = A10.completion; + } + } catch (e23) { + E10.e(e23); + } finally { + E10.f(); + } + return _10; + }(t10, n10); + if (!a10.length) + return o10 && t10.some(function(e21) { + return 1 == e21.state; + }) ? new e20(o10.options, o10.attrs, o10.tooltip, o10.timestamp, o10.selected, true) : null; + var s10 = n10.facet(m2).selectOnOpen ? 0 : -1; + if (o10 && o10.selected != s10 && -1 != o10.selected) { + for (var c10 = o10.options[o10.selected].completion, l10 = 0; l10 < a10.length; l10++) + if (a10[l10].completion == c10) { + s10 = l10; + break; + } + } + return new e20(a10, $2(r10, s10), { pos: t10.reduce(function(e21, t11) { + return t11.hasResult() ? Math.min(e21, t11.from) : e21; + }, 1e8), create: N2, above: i10.aboveCursor }, o10 ? o10.timestamp : Date.now(), s10, false); + } }]), e20; + }(); + var S2 = function() { + function e20(t10, n10, r10) { + No(this, e20), this.active = t10, this.id = n10, this.open = r10; + } + return Do(e20, [{ key: "update", value: function(t10) { + var n10 = this, r10 = t10.state, o10 = r10.facet(m2), i10 = (o10.override || r10.languageDataAt("autocomplete", c2(r10)).map(d2)).map(function(e21) { + return (n10.active.find(function(t11) { + return t11.source == e21; + }) || new M2(e21, n10.active.some(function(e23) { + return 0 != e23.state; + }) ? 1 : 0)).update(t10, o10); + }); + i10.length == this.active.length && i10.every(function(e21, t11) { + return e21 == n10.active[t11]; + }) && (i10 = this.active); + var a10 = this.open; + a10 && t10.docChanged && (a10 = a10.map(t10.changes)), t10.selection || i10.some(function(e21) { + return e21.hasResult() && t10.changes.touchesRange(e21.from, e21.to); + }) || !function(e21, t11) { + if (e21 == t11) + return true; + for (var n11 = 0, r11 = 0; ; ) { + for (; n11 < e21.length && !e21[n11].hasResult; ) + n11++; + for (; r11 < t11.length && !t11[r11].hasResult; ) + r11++; + var o11 = n11 == e21.length, i11 = r11 == t11.length; + if (o11 || i11) + return o11 == i11; + if (e21[n11++].result != t11[r11++].result) + return false; + } + }(i10, this.active) ? a10 = j2.build(i10, r10, this.id, a10, o10) : a10 && a10.disabled && !i10.some(function(e21) { + return 1 == e21.state; + }) && (a10 = null), !a10 && i10.every(function(e21) { + return 1 != e21.state; + }) && i10.some(function(e21) { + return e21.hasResult(); + }) && (i10 = i10.map(function(e21) { + return e21.hasResult() ? new M2(e21.source, 0) : e21; + })); + var s10, c10 = bo(t10.effects); + try { + for (c10.s(); !(s10 = c10.n()).done; ) { + var l10 = s10.value; + l10.is(P2) && (a10 = a10 && a10.setSelected(l10.value, this.id)); + } + } catch (e21) { + c10.e(e21); + } finally { + c10.f(); + } + return i10 == this.active && a10 == this.open ? this : new e20(i10, this.id, a10); + } }, { key: "tooltip", get: function() { + return this.open ? this.open.tooltip : null; + } }, { key: "attrs", get: function() { + return this.open ? this.open.attrs : C2; + } }], [{ key: "start", value: function() { + return new e20(_2, "cm-ac-" + Math.floor(2e6 * Math.random()).toString(36), null); + } }]), e20; + }(); + var C2 = { "aria-autocomplete": "list" }; + function $2(e20, t10) { + var n10 = { "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-controls": e20 }; + return t10 > -1 && (n10["aria-activedescendant"] = e20 + "-" + t10), n10; + } + var _2 = []; + function O2(e20) { + return e20.isUserEvent("input.type") ? "input" : e20.isUserEvent("delete.backward") ? "delete" : null; + } + var M2 = function() { + function e20(t10, n10) { + var r10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1; + No(this, e20), this.source = t10, this.state = n10, this.explicitPos = r10; + } + return Do(e20, [{ key: "hasResult", value: function() { + return false; + } }, { key: "update", value: function(t10, n10) { + var r10 = O2(t10), o10 = this; + r10 ? o10 = o10.handleUserEvent(t10, r10, n10) : t10.docChanged ? o10 = o10.handleChange(t10) : t10.selection && 0 != o10.state && (o10 = new e20(o10.source, 0)); + var i10, a10 = bo(t10.effects); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + if (s10.is(h2)) + o10 = new e20(o10.source, 1, s10.value ? c2(t10.state) : -1); + else if (s10.is(v2)) + o10 = new e20(o10.source, 0); + else if (s10.is(A2)) { + var c10, l10 = bo(s10.value); + try { + for (l10.s(); !(c10 = l10.n()).done; ) { + var u10 = c10.value; + u10.source == o10.source && (o10 = u10); + } + } catch (e21) { + l10.e(e21); + } finally { + l10.f(); + } + } + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + return o10; + } }, { key: "handleUserEvent", value: function(t10, n10, r10) { + return "delete" != n10 && r10.activateOnTyping ? new e20(this.source, 1) : this.map(t10.changes); + } }, { key: "handleChange", value: function(t10) { + return t10.changes.touchesRange(c2(t10.startState)) ? new e20(this.source, 0) : this.map(t10.changes); + } }, { key: "map", value: function(t10) { + return t10.empty || this.explicitPos < 0 ? this : new e20(this.source, this.state, t10.mapPos(this.explicitPos)); + } }]), e20; + }(); + var E2 = function(e20) { + function t10(e21, n10, r10, o10, i10) { + var a10; + return No(this, t10), (a10 = _o(this, t10, [e21, 2, n10])).result = r10, a10.from = o10, a10.to = i10, a10; + } + return Ao(t10, M2), Do(t10, [{ key: "hasResult", value: function() { + return true; + } }, { key: "handleUserEvent", value: function(e21, n10, r10) { + var o10, i10 = e21.changes.mapPos(this.from), a10 = e21.changes.mapPos(this.to, 1), s10 = c2(e21.state); + if ((this.explicitPos < 0 ? s10 <= i10 : s10 < this.from) || s10 > a10 || "delete" == n10 && c2(e21.startState) == this.from) + return new M2(this.source, "input" == n10 && r10.activateOnTyping ? 1 : 0); + var c10, l10 = this.explicitPos < 0 ? -1 : e21.changes.mapPos(this.explicitPos); + return function(e23, t11, n11, r11) { + if (!e23) + return false; + var o11 = t11.sliceDoc(n11, r11); + return "function" == typeof e23 ? e23(o11, n11, r11, t11) : l2(e23, true).test(o11); + }(this.result.validFor, e21.state, i10, a10) ? new t10(this.source, l10, this.result, i10, a10) : this.result.update && (c10 = this.result.update(this.result, i10, a10, new o2(e21.state, s10, l10 >= 0))) ? new t10(this.source, l10, c10, c10.from, null !== (o10 = c10.to) && void 0 !== o10 ? o10 : c2(e21.state)) : new M2(this.source, 1, l10); + } }, { key: "handleChange", value: function(e21) { + return e21.changes.touchesRange(this.from, this.to) ? new M2(this.source, 0) : this.map(e21.changes); + } }, { key: "map", value: function(e21) { + return e21.empty ? this : new t10(this.source, this.explicitPos < 0 ? -1 : e21.mapPos(this.explicitPos), this.result, e21.mapPos(this.from), e21.mapPos(this.to, 1)); + } }]), t10; + }(); + var A2 = oV.define({ map: function(e20, t10) { + return e20.map(function(e21) { + return e21.map(t10); + }); + } }); + var P2 = oV.define(); + var T2 = NF.define({ create: function() { + return S2.start(); + }, update: function(e20, t10) { + return e20.update(t10); + }, provide: function(e20) { + return [UK.from(e20, function(e21) { + return e21.tooltip; + }), zJ.contentAttributes.from(e20, function(e21) { + return e21.attrs; + })]; + } }); + function R2(e20, t10) { + var n10 = t10.completion.apply || t10.completion.label, r10 = e20.state.field(T2).active.find(function(e21) { + return e21.source == t10.source; + }); + return r10 instanceof E2 && ("string" == typeof n10 ? e20.dispatch(Object.assign(Object.assign({}, function(e21, t11, n11, r11) { + var o10 = e21.selection.main, i10 = n11 - o10.from, a10 = r11 - o10.from; + return Object.assign(Object.assign({}, e21.changeByRange(function(s10) { + return s10 != o10 && n11 != r11 && e21.sliceDoc(s10.from + i10, s10.from + a10) != e21.sliceDoc(n11, r11) ? { range: s10 } : { changes: { from: s10.from + i10, to: r11 == o10.from ? s10.to : s10.from + a10, insert: t11 }, range: $F.cursor(s10.from + i10 + t11.length) }; + })), { scrollIntoView: true, userEvent: "input.complete" }); + }(e20.state, n10, r10.from, r10.to)), { annotations: u2.of(t10.completion) })) : n10(e20, t10.completion, r10.from, r10.to), true); + } + var N2 = w2(T2, R2); + function I2(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "option"; + return function(n10) { + var r10 = n10.state.field(T2, false); + if (!r10 || !r10.open || r10.open.disabled || Date.now() - r10.open.timestamp < n10.state.facet(m2).interactionDelay) + return false; + var o10, i10 = 1; + "page" == t10 && (o10 = ZK(n10, r10.open.tooltip)) && (i10 = Math.max(2, Math.floor(o10.dom.offsetHeight / o10.dom.querySelector("li").offsetHeight) - 1)); + var a10 = r10.open.options.length, s10 = r10.open.selected > -1 ? r10.open.selected + i10 * (e20 ? 1 : -1) : e20 ? 0 : a10 - 1; + return s10 < 0 ? s10 = "page" == t10 ? 0 : a10 - 1 : s10 >= a10 && (s10 = "page" == t10 ? a10 - 1 : 0), n10.dispatch({ effects: P2.of(s10) }), true; + }; + } + var D2 = Do(function e17(t10, n10) { + No(this, e17), this.active = t10, this.context = n10, this.time = Date.now(), this.updates = [], this.done = void 0; + }); + var q2 = FW.fromClass(function() { + function e20(t10) { + No(this, e20), this.view = t10, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.composing = 0; + var n10, r10 = bo(t10.state.field(T2).active); + try { + for (r10.s(); !(n10 = r10.n()).done; ) { + var o10 = n10.value; + 1 == o10.state && this.startQuery(o10); + } + } catch (e21) { + r10.e(e21); + } finally { + r10.f(); + } + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = this, n10 = e21.state.field(T2); + if (e21.selectionSet || e21.docChanged || e21.startState.field(T2) != n10) { + for (var r10 = e21.transactions.some(function(e23) { + return (e23.selection || e23.docChanged) && !O2(e23); + }), o10 = 0; o10 < this.running.length; o10++) { + var i10 = this.running[o10]; + if (r10 || i10.updates.length + e21.transactions.length > 50 && Date.now() - i10.time > 1e3) { + var a10, s10 = bo(i10.context.abortListeners); + try { + for (s10.s(); !(a10 = s10.n()).done; ) { + var c10 = a10.value; + try { + c10(); + } catch (e23) { + qW(this.view.state, e23); + } + } + } catch (e23) { + s10.e(e23); + } finally { + s10.f(); + } + i10.context.abortListeners = null, this.running.splice(o10--, 1); + } else { + var l10; + (l10 = i10.updates).push.apply(l10, Bo(e21.transactions)); + } + } + if (this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), this.debounceUpdate = n10.active.some(function(e23) { + return 1 == e23.state && !t10.running.some(function(t11) { + return t11.active.source == e23.source; + }); + }) ? setTimeout(function() { + return t10.startUpdate(); + }, 50) : -1, 0 != this.composing) { + var u10, f10 = bo(e21.transactions); + try { + for (f10.s(); !(u10 = f10.n()).done; ) { + var d10 = u10.value; + "input" == O2(d10) ? this.composing = 2 : 2 == this.composing && d10.selection && (this.composing = 3); + } + } catch (e23) { + f10.e(e23); + } finally { + f10.f(); + } + } + } + } }, { key: "startUpdate", value: function() { + var e21 = this; + this.debounceUpdate = -1; + var t10, n10 = bo(this.view.state.field(T2).active); + try { + var r10 = function() { + var n11 = t10.value; + 1 != n11.state || e21.running.some(function(e23) { + return e23.active.source == n11.source; + }) || e21.startQuery(n11); + }; + for (n10.s(); !(t10 = n10.n()).done; ) + r10(); + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + } }, { key: "startQuery", value: function(e21) { + var t10 = this, n10 = this.view.state, r10 = c2(n10), o10 = new o2(n10, r10, e21.explicitPos == r10), i10 = new D2(e21, o10); + this.running.push(i10), Promise.resolve(e21.source(o10)).then(function(e23) { + i10.context.aborted || (i10.done = e23 || null, t10.scheduleAccept()); + }, function(e23) { + t10.view.dispatch({ effects: v2.of(null) }), qW(t10.view.state, e23); + }); + } }, { key: "scheduleAccept", value: function() { + var e21 = this; + this.running.every(function(e23) { + return void 0 !== e23.done; + }) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(function() { + return e21.accept(); + }, this.view.state.facet(m2).updateSyncTime)); + } }, { key: "accept", value: function() { + var e21, t10 = this; + this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1; + for (var n10 = [], r10 = this.view.state.facet(m2), o10 = function(o11) { + var a10 = t10.running[o11]; + if (void 0 === a10.done) + return i10 = o11, 0; + if (t10.running.splice(o11--, 1), a10.done) { + var s10, c10 = new E2(a10.active.source, a10.active.explicitPos, a10.done, a10.done.from, null !== (e21 = a10.done.to) && void 0 !== e21 ? e21 : c2(a10.updates.length ? a10.updates[0].startState : t10.view.state)), l10 = bo(a10.updates); + try { + for (l10.s(); !(s10 = l10.n()).done; ) { + var u10 = s10.value; + c10 = c10.update(u10, r10); + } + } catch (e23) { + l10.e(e23); + } finally { + l10.f(); + } + if (c10.hasResult()) + return n10.push(c10), i10 = o11, 0; + } + var f10 = t10.view.state.field(T2).active.find(function(e23) { + return e23.source == a10.active.source; + }); + if (f10 && 1 == f10.state) + if (null == a10.done) { + var d10, h10 = new M2(a10.active.source, 0), v10 = bo(a10.updates); + try { + for (v10.s(); !(d10 = v10.n()).done; ) { + var p10 = d10.value; + h10 = h10.update(p10, r10); + } + } catch (e23) { + v10.e(e23); + } finally { + v10.f(); + } + 1 != h10.state && n10.push(h10); + } else + t10.startQuery(f10); + i10 = o11; + }, i10 = 0; i10 < this.running.length; i10++) + o10(i10); + n10.length && this.view.dispatch({ effects: A2.of(n10) }); + } }]), e20; + }(), { eventHandlers: { blur: function(e20) { + var t10 = this.view.state.field(T2, false); + if (t10 && t10.tooltip && this.view.state.facet(m2).closeOnBlur) { + var n10 = t10.open && ZK(this.view, t10.open.tooltip); + n10 && n10.dom.contains(e20.relatedTarget) || this.view.dispatch({ effects: v2.of(null) }); + } + }, compositionstart: function() { + this.composing = 1; + }, compositionend: function() { + var e20 = this; + 3 == this.composing && setTimeout(function() { + return e20.view.dispatch({ effects: h2.of(false) }); + }, 20), this.composing = 0; + } } }); + var z2 = zJ.baseTheme({ ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": { fontFamily: "monospace", whiteSpace: "nowrap", overflow: "hidden auto", maxWidth_fallback: "700px", maxWidth: "min(700px, 95vw)", minWidth: "250px", maxHeight: "10em", height: "100%", listStyle: "none", margin: 0, padding: 0, "& > li, & > completion-section": { padding: "1px 3px", lineHeight: 1.2 }, "& > li": { overflowX: "hidden", textOverflow: "ellipsis", cursor: "pointer" }, "& > completion-section": { display: "list-item", borderBottom: "1px solid silver", paddingLeft: "0.5em", opacity: 0.7 } } }, "&light .cm-tooltip-autocomplete ul li[aria-selected]": { background: "#17c", color: "white" }, "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": { background: "#777" }, "&dark .cm-tooltip-autocomplete ul li[aria-selected]": { background: "#347", color: "white" }, "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": { background: "#444" }, ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": { content: '"\xB7\xB7\xB7"', opacity: 0.5, display: "block", textAlign: "center" }, ".cm-tooltip.cm-completionInfo": { position: "absolute", padding: "3px 9px", width: "max-content", maxWidth: "".concat(400, "px"), boxSizing: "border-box" }, ".cm-completionInfo.cm-completionInfo-left": { right: "100%" }, ".cm-completionInfo.cm-completionInfo-right": { left: "100%" }, ".cm-completionInfo.cm-completionInfo-left-narrow": { right: "".concat(30, "px") }, ".cm-completionInfo.cm-completionInfo-right-narrow": { left: "".concat(30, "px") }, "&light .cm-snippetField": { backgroundColor: "#00000022" }, "&dark .cm-snippetField": { backgroundColor: "#ffffff22" }, ".cm-snippetFieldPosition": { verticalAlign: "text-top", width: 0, height: "1.15em", display: "inline-block", margin: "0 -0.7px -.7em", borderLeft: "1.4px dotted #888" }, ".cm-completionMatchedText": { textDecoration: "underline" }, ".cm-completionDetail": { marginLeft: "0.5em", fontStyle: "italic" }, ".cm-completionIcon": { fontSize: "90%", width: ".8em", display: "inline-block", textAlign: "center", paddingRight: ".6em", opacity: "0.6", boxSizing: "content-box" }, ".cm-completionIcon-function, .cm-completionIcon-method": { "&:after": { content: "'\u0192'" } }, ".cm-completionIcon-class": { "&:after": { content: "'\u25CB'" } }, ".cm-completionIcon-interface": { "&:after": { content: "'\u25CC'" } }, ".cm-completionIcon-variable": { "&:after": { content: "'\u{1D465}'" } }, ".cm-completionIcon-constant": { "&:after": { content: "'\u{1D436}'" } }, ".cm-completionIcon-type": { "&:after": { content: "'\u{1D461}'" } }, ".cm-completionIcon-enum": { "&:after": { content: "'\u222A'" } }, ".cm-completionIcon-property": { "&:after": { content: "'\u25A1'" } }, ".cm-completionIcon-keyword": { "&:after": { content: "'\u{1F511}\uFE0E'" } }, ".cm-completionIcon-namespace": { "&:after": { content: "'\u25A2'" } }, ".cm-completionIcon-text": { "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" } } }); + var B2 = { brackets: ["(", "[", "{", "'", '"'], before: ")]}:;>", stringPrefixes: [] }; + var L2 = oV.define({ map: function(e20, t10) { + var n10 = t10.mapPos(e20, -1, mF.TrackAfter); + return null == n10 ? void 0 : n10; + } }); + var F2 = new (function(e20) { + function t10() { + return No(this, t10), _o(this, t10, arguments); + } + return Ao(t10, yV), Do(t10); + }())(); + F2.startSide = 1, F2.endSide = -1; + var V2 = NF.define({ create: function() { + return xV.empty; + }, update: function(e20, t10) { + if (e20 = e20.map(t10.changes), t10.selection) { + var n10 = t10.state.doc.lineAt(t10.selection.main.head); + e20 = e20.update({ filter: function(e21) { + return e21 >= n10.from && e21 <= n10.to; + } }); + } + var r10, o10 = bo(t10.effects); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value; + i10.is(L2) && (e20 = e20.update({ add: [F2.range(i10.value, i10.value + 1)] })); + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + return e20; + } }); + var H2 = "()[]{}<>"; + function W2(e20) { + for (var t10 = 0; t10 < H2.length; t10 += 2) + if (H2.charCodeAt(t10) == e20) + return H2.charAt(t10 + 1); + return hF(e20 < 128 ? e20 : e20 + 1); + } + function U2(e20, t10) { + return e20.languageDataAt("closeBrackets", t10)[0] || B2; + } + var J2 = "object" == ("undefined" == typeof navigator ? "undefined" : Ho(navigator)) && /Android\b/.test(navigator.userAgent); + var K2 = zJ.inputHandler.of(function(e20, t10, n10, r10) { + if ((J2 ? e20.composing : e20.compositionStarted) || e20.state.readOnly) + return false; + var o10 = e20.state.selection.main; + if (r10.length > 2 || 2 == r10.length && 1 == vF(dF(r10, 0)) || t10 != o10.from || n10 != o10.to) + return false; + var i10 = function(e21, t11) { + var n11, r11 = U2(e21, e21.selection.main.head), o11 = r11.brackets || B2.brackets, i11 = bo(o11); + try { + for (i11.s(); !(n11 = i11.n()).done; ) { + var a10 = n11.value, s10 = W2(dF(a10, 0)); + if (t11 == a10) + return s10 == a10 ? e42(e21, a10, o11.indexOf(a10 + a10 + a10) > -1, r11) : X2(e21, a10, s10, r11.before || B2.before); + if (t11 == s10 && Q2(e21, e21.selection.main.from)) + return Z2(e21, a10, s10); + } + } catch (e23) { + i11.e(e23); + } finally { + i11.f(); + } + return null; + }(e20.state, r10); + return !!i10 && (e20.dispatch(i10), true); + }); + var G2 = [{ key: "Backspace", run: function(e20) { + var t10 = e20.state, n10 = e20.dispatch; + if (t10.readOnly) + return false; + var r10 = U2(t10, t10.selection.main.head).brackets || B2.brackets, o10 = null, i10 = t10.changeByRange(function(e21) { + if (e21.empty) { + var n11, i11 = function(e23, t11) { + var n12 = e23.sliceString(t11 - 2, t11); + return vF(dF(n12, 0)) == n12.length ? n12 : n12.slice(1); + }(t10.doc, e21.head), a10 = bo(r10); + try { + for (a10.s(); !(n11 = a10.n()).done; ) { + var s10 = n11.value; + if (s10 == i11 && Y2(t10.doc, e21.head) == W2(dF(s10, 0))) + return { changes: { from: e21.head - s10.length, to: e21.head + s10.length }, range: $F.cursor(e21.head - s10.length) }; + } + } catch (e23) { + a10.e(e23); + } finally { + a10.f(); + } + } + return { range: o10 = e21 }; + }); + return o10 || n10(t10.update(i10, { scrollIntoView: true, userEvent: "delete.backward" })), !o10; + } }]; + function Q2(e20, t10) { + var n10 = false; + return e20.field(V2).between(0, e20.doc.length, function(e21) { + e21 == t10 && (n10 = true); + }), n10; + } + function Y2(e20, t10) { + var n10 = e20.sliceString(t10, t10 + 2); + return n10.slice(0, vF(dF(n10, 0))); + } + function X2(e20, t10, n10, r10) { + var o10 = null, i10 = e20.changeByRange(function(i11) { + if (!i11.empty) + return { changes: [{ insert: t10, from: i11.from }, { insert: n10, from: i11.to }], effects: L2.of(i11.to + t10.length), range: $F.range(i11.anchor + t10.length, i11.head + t10.length) }; + var a10 = Y2(e20.doc, i11.head); + return !a10 || /\s/.test(a10) || r10.indexOf(a10) > -1 ? { changes: { insert: t10 + n10, from: i11.head }, effects: L2.of(i11.head + t10.length), range: $F.cursor(i11.head + t10.length) } : { range: o10 = i11 }; + }); + return o10 ? null : e20.update(i10, { scrollIntoView: true, userEvent: "input.type" }); + } + function Z2(e20, t10, n10) { + var r10 = null, o10 = e20.changeByRange(function(t11) { + return t11.empty && Y2(e20.doc, t11.head) == n10 ? { changes: { from: t11.head, to: t11.head + n10.length, insert: n10 }, range: $F.cursor(t11.head + n10.length) } : r10 = { range: t11 }; + }); + return r10 ? null : e20.update(o10, { scrollIntoView: true, userEvent: "input.type" }); + } + function e42(e20, t10, n10, r10) { + var o10 = r10.stringPrefixes || B2.stringPrefixes, i10 = null, a10 = e20.changeByRange(function(r11) { + if (!r11.empty) + return { changes: [{ insert: t10, from: r11.from }, { insert: t10, from: r11.to }], effects: L2.of(r11.to + t10.length), range: $F.range(r11.anchor + t10.length, r11.head + t10.length) }; + var a11, s10 = r11.head, c10 = Y2(e20.doc, s10); + if (c10 == t10) { + if (t4(e20, s10)) + return { changes: { insert: t10 + t10, from: s10 }, effects: L2.of(s10 + t10.length), range: $F.cursor(s10 + t10.length) }; + if (Q2(e20, s10)) { + var l10 = n10 && e20.sliceDoc(s10, s10 + 3 * t10.length) == t10 + t10 + t10 ? t10 + t10 + t10 : t10; + return { changes: { from: s10, to: s10 + l10.length, insert: l10 }, range: $F.cursor(s10 + l10.length) }; + } + } else { + if (n10 && e20.sliceDoc(s10 - 2 * t10.length, s10) == t10 + t10 && (a11 = n4(e20, s10 - 2 * t10.length, o10)) > -1 && t4(e20, a11)) + return { changes: { insert: t10 + t10 + t10 + t10, from: s10 }, effects: L2.of(s10 + t10.length), range: $F.cursor(s10 + t10.length) }; + if (e20.charCategorizer(s10)(c10) != hV.Word && n4(e20, s10, o10) > -1 && !function(e21, t11, n11, r12) { + for (var o11 = zQ(e21).resolveInner(t11, -1), i11 = r12.reduce(function(e23, t12) { + return Math.max(e23, t12.length); + }, 0), a12 = 0; a12 < 5; a12++) { + var s11 = e21.sliceDoc(o11.from, Math.min(o11.to, o11.from + n11.length + i11)), c11 = s11.indexOf(n11); + if (!c11 || c11 > -1 && r12.indexOf(s11.slice(0, c11)) > -1) { + for (var l11 = o11.firstChild; l11 && l11.from == o11.from && l11.to - l11.from > n11.length + c11; ) { + if (e21.sliceDoc(l11.to - n11.length, l11.to) == n11) + return false; + l11 = l11.firstChild; + } + return true; + } + var u10 = o11.to == t11 && o11.parent; + if (!u10) + break; + o11 = u10; + } + return false; + }(e20, s10, t10, o10)) + return { changes: { insert: t10 + t10, from: s10 }, effects: L2.of(s10 + t10.length), range: $F.cursor(s10 + t10.length) }; + } + return { range: i10 = r11 }; + }); + return i10 ? null : e20.update(a10, { scrollIntoView: true, userEvent: "input.type" }); + } + function t4(e20, t10) { + var n10 = zQ(e20).resolveInner(t10 + 1); + return n10.parent && n10.from == t10; + } + function n4(e20, t10, n10) { + var r10 = e20.charCategorizer(t10); + if (r10(e20.sliceDoc(t10 - 1, t10)) != hV.Word) + return t10; + var o10, i10 = bo(n10); + try { + for (i10.s(); !(o10 = i10.n()).done; ) { + var a10 = o10.value, s10 = t10 - a10.length; + if (e20.sliceDoc(s10, t10) == a10 && r10(e20.sliceDoc(s10 - 1, s10)) != hV.Word) + return s10; + } + } catch (e21) { + i10.e(e21); + } finally { + i10.f(); + } + return -1; + } + function r4() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [T2, m2.of(e20), q2, i4, z2]; + } + var o4 = [{ key: "Ctrl-Space", run: function(e20) { + return !!e20.state.field(T2, false) && (e20.dispatch({ effects: h2.of(true) }), true); + } }, { key: "Escape", run: function(e20) { + var t10 = e20.state.field(T2, false); + return !(!t10 || !t10.active.some(function(e21) { + return 0 != e21.state; + })) && (e20.dispatch({ effects: v2.of(null) }), true); + } }, { key: "ArrowDown", run: I2(true) }, { key: "ArrowUp", run: I2(false) }, { key: "PageDown", run: I2(true, "page") }, { key: "PageUp", run: I2(false, "page") }, { key: "Enter", run: function(e20) { + var t10 = e20.state.field(T2, false); + return !(e20.state.readOnly || !t10 || !t10.open || t10.open.selected < 0 || t10.open.disabled || Date.now() - t10.open.timestamp < e20.state.facet(m2).interactionDelay) && R2(e20, t10.open.options[t10.open.selected]); + } }]; + var i4 = LF.highest(JJ.computeN([m2], function(e20) { + return e20.facet(m2).defaultKeymap ? [o4] : []; + })); + function a4(e20) { + mi(e20, "svelte-hhcn0f", '.jse-status-bar.svelte-hhcn0f.svelte-hhcn0f{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);margin:0;border-top:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7));border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);display:flex;gap:var(--jse-padding, 10px)}.jse-status-bar.svelte-hhcn0f.svelte-hhcn0f:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-status-bar.svelte-hhcn0f .jse-status-bar-info.svelte-hhcn0f{padding:2px}'); + } + function s4(e20) { + var t10, n10, r10; + return { c: function() { + t10 = ji("div"), n10 = Ci("Line: "), r10 = Ci(e20[0]), Ai(t10, "class", "jse-status-bar-info svelte-hhcn0f"); + }, m: function(e21, o10) { + ki(e21, t10, o10), pi(t10, n10), pi(t10, r10); + }, p: function(e21, t11) { + 1 & t11 && Ni(r10, e21[0]); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function c4(e20) { + var t10, n10, r10; + return { c: function() { + t10 = ji("div"), n10 = Ci("Column: "), r10 = Ci(e20[1]), Ai(t10, "class", "jse-status-bar-info svelte-hhcn0f"); + }, m: function(e21, o10) { + ki(e21, t10, o10), pi(t10, n10), pi(t10, r10); + }, p: function(e21, t11) { + 2 & t11 && Ni(r10, e21[1]); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function l4(e20) { + var t10, n10, r10, o10; + return { c: function() { + t10 = ji("div"), n10 = Ci("Selection: "), r10 = Ci(e20[2]), o10 = Ci(" characters"), Ai(t10, "class", "jse-status-bar-info svelte-hhcn0f"); + }, m: function(e21, i10) { + ki(e21, t10, i10), pi(t10, n10), pi(t10, r10), pi(t10, o10); + }, p: function(e21, t11) { + 4 & t11 && Ni(r10, e21[2]); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function u4(e20) { + var t10, n10, r10, o10 = void 0 !== e20[0] && s4(e20), i10 = void 0 !== e20[1] && c4(e20), a10 = void 0 !== e20[2] && e20[2] > 0 && l4(e20); + return { c: function() { + t10 = ji("div"), o10 && o10.c(), n10 = $i(), i10 && i10.c(), r10 = $i(), a10 && a10.c(), Ai(t10, "class", "jse-status-bar svelte-hhcn0f"); + }, m: function(e21, s10) { + ki(e21, t10, s10), o10 && o10.m(t10, null), pi(t10, n10), i10 && i10.m(t10, null), pi(t10, r10), a10 && a10.m(t10, null); + }, p: function(e21, s10) { + var c10 = jo(s10, 1)[0]; + void 0 !== e21[0] ? o10 ? o10.p(e21, c10) : ((o10 = s4(e21)).c(), o10.m(t10, n10)) : o10 && (o10.d(1), o10 = null), void 0 !== e21[1] ? i10 ? i10.p(e21, c10) : ((i10 = c4(e21)).c(), i10.m(t10, r10)) : i10 && (i10.d(1), i10 = null), void 0 !== e21[2] && e21[2] > 0 ? a10 ? a10.p(e21, c10) : ((a10 = l4(e21)).c(), a10.m(t10, null)) : a10 && (a10.d(1), a10 = null); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), o10 && o10.d(), i10 && i10.d(), a10 && a10.d(); + } }; + } + function f4(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10 = t10.editorState; + return e20.$$set = function(e21) { + "editorState" in e21 && n10(3, c10 = e21.editorState); + }, e20.$$.update = function() { + var t11, l10, u10; + 8 & e20.$$.dirty && n10(4, r10 = null === (t11 = c10) || void 0 === t11 || null === (t11 = t11.selection) || void 0 === t11 || null === (t11 = t11.main) || void 0 === t11 ? void 0 : t11.head); + 24 & e20.$$.dirty && n10(5, o10 = r10 ? null === (l10 = c10) || void 0 === l10 || null === (l10 = l10.doc) || void 0 === l10 ? void 0 : l10.lineAt(r10) : void 0); + (32 & e20.$$.dirty && n10(0, i10 = o10 ? o10.number : void 0), 48 & e20.$$.dirty && n10(1, a10 = void 0 !== o10 && void 0 !== r10 ? r10 - o10.from + 1 : void 0), 8 & e20.$$.dirty) && n10(2, s10 = null === (u10 = c10) || void 0 === u10 || null === (u10 = u10.selection) || void 0 === u10 || null === (u10 = u10.ranges) || void 0 === u10 ? void 0 : u10.reduce(function(e21, t12) { + return e21 + t12.to - t12.from; + }, 0)); + }, [i10, a10, s10, c10, r10, o10]; + } + var d4 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, f4, u4, Xo, { editorState: 3 }, a4), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var h4 = PY.define([{ tag: TQ.propertyName, color: "var(--internal-key-color)" }, { tag: TQ.number, color: "var(--internal-value-color-number)" }, { tag: TQ.bool, color: "var(--internal-value-color-boolean)" }, { tag: TQ.string, color: "var(--internal-value-color-string)" }, { tag: TQ.keyword, color: "var(--internal-value-color-null)" }]); + var v4 = IY(h4); + var p4 = h4.style; + function m4(e20) { + var t10 = e20.selection.main.head; + return e20.doc.lineAt(t10); + } + function g4(e20, t10) { + var n10 = 0; + e: + for (var r10 = 0; r10 < e20.length; r10++) + switch (e20[r10]) { + case " ": + n10 += 1; + continue e; + case " ": + n10 += t10 - n10 % t10; + continue e; + case "\r": + continue e; + default: + break e; + } + return n10; + } + h4.style = function(e20) { + return p4(e20 || []); + }; + var y4 = MF.define({ combine: function(e20) { + return gV(e20, { highlightActiveBlock: true, hideFirstIndent: false, markerType: "fullScope", thickness: 1 }); + } }); + var b4 = function() { + function e20(t10, n10, r10, o10) { + No(this, e20), this.lines = t10, this.state = n10, this.map = /* @__PURE__ */ new Map(), this.unitWidth = r10, this.markerType = o10; + var i10, a10 = bo(this.lines); + try { + for (a10.s(); !(i10 = a10.n()).done; ) { + var s10 = i10.value; + this.add(s10); + } + } catch (e21) { + a10.e(e21); + } finally { + a10.f(); + } + this.state.facet(y4).highlightActiveBlock && this.findAndSetActiveLines(); + } + return Do(e20, [{ key: "has", value: function(e21) { + return this.map.has("number" == typeof e21 ? e21 : e21.number); + } }, { key: "get", value: function(e21) { + var t10 = this.map.get("number" == typeof e21 ? e21 : e21.number); + if (!t10) + throw new Error("Line not found in indentation map"); + return t10; + } }, { key: "set", value: function(e21, t10, n10) { + var r10 = !e21.text.trim().length, o10 = { line: e21, col: t10, level: n10, empty: r10 }; + return this.map.set(o10.line.number, o10), o10; + } }, { key: "add", value: function(e21) { + if (this.has(e21)) + return this.get(e21); + if (!e21.length || !e21.text.trim().length) { + if (1 === e21.number) + return this.set(e21, 0, 0); + if (e21.number === this.state.doc.lines) { + var t10 = this.closestNonEmpty(e21, -1); + return this.set(e21, 0, t10.level); + } + var n10 = this.closestNonEmpty(e21, -1), r10 = this.closestNonEmpty(e21, 1); + return n10.level >= r10.level && "codeOnly" !== this.markerType ? this.set(e21, 0, n10.level) : n10.empty && 0 === n10.level && 0 !== r10.level ? this.set(e21, 0, 0) : r10.level > n10.level ? this.set(e21, 0, n10.level + 1) : this.set(e21, 0, r10.level); + } + var o10 = g4(e21.text, this.state.tabSize), i10 = Math.floor(o10 / this.unitWidth); + return this.set(e21, o10, i10); + } }, { key: "closestNonEmpty", value: function(e21, t10) { + for (var n10 = e21.number + t10; -1 === t10 ? n10 >= 1 : n10 <= this.state.doc.lines; ) { + if (this.has(n10)) { + var r10 = this.get(n10); + if (!r10.empty) + return r10; + } + var o10 = this.state.doc.line(n10); + if (o10.text.trim().length) { + var i10 = g4(o10.text, this.state.tabSize), a10 = Math.floor(i10 / this.unitWidth); + return this.set(o10, i10, a10); + } + n10 += t10; + } + var s10 = this.state.doc.line(-1 === t10 ? 1 : this.state.doc.lines); + return this.set(s10, 0, 0); + } }, { key: "findAndSetActiveLines", value: function() { + var e21 = m4(this.state); + if (this.has(e21)) { + var t10 = this.get(e21); + if (this.has(t10.line.number + 1)) { + var n10 = this.get(t10.line.number + 1); + n10.level > t10.level && (t10 = n10); + } + if (this.has(t10.line.number - 1)) { + var r10 = this.get(t10.line.number - 1); + r10.level > t10.level && (t10 = r10); + } + if (0 !== t10.level) { + var o10, i10; + for (t10.active = t10.level, o10 = t10.line.number; o10 > 1; o10--) + if (this.has(o10 - 1)) { + var a10 = this.get(o10 - 1); + if (a10.level < t10.level) + break; + a10.active = t10.level; + } + for (i10 = t10.line.number; i10 < this.state.doc.lines; i10++) + if (this.has(i10 + 1)) { + var s10 = this.get(i10 + 1); + if (s10.level < t10.level) + break; + s10.active = t10.level; + } + } + } + } }]), e20; + }(); + function k4(e20) { + var t10 = { light: "#F0F1F2", dark: "#2B3245", activeLight: "#E4E5E6", activeDark: "#3C445C" }, n10 = t10; + return e20 && (n10 = Object.assign(Object.assign({}, t10), e20)), zJ.baseTheme({ "&light": { "--indent-marker-bg-color": n10.light, "--indent-marker-active-bg-color": n10.activeLight }, "&dark": { "--indent-marker-bg-color": n10.dark, "--indent-marker-active-bg-color": n10.activeDark }, ".cm-line": { position: "relative" }, ".cm-indent-markers::before": { content: '""', position: "absolute", top: 0, left: 0, right: 0, bottom: 0, background: "var(--indent-markers)", pointerEvents: "none", zIndex: "-1" } }); + } + function w4(e20, t10, n10, r10, o10) { + var i10 = "repeating-linear-gradient(to right, var(".concat(e20, ") 0 ").concat(t10, "px, transparent ").concat(t10, "px ").concat(n10, "ch)"); + return "".concat(i10, " ").concat(r10 * n10, ".5ch/calc(").concat(n10 * o10, "ch - 1px) no-repeat"); + } + function x4(e20, t10, n10, r10) { + var o10 = e20.level, i10 = e20.active; + if (n10 && 0 === o10) + return []; + var a10 = n10 ? 1 : 0, s10 = []; + if (void 0 !== i10) { + var c10 = i10 - a10 - 1; + c10 > 0 && s10.push(w4("--indent-marker-bg-color", r10, t10, a10, c10)), s10.push(w4("--indent-marker-active-bg-color", r10, t10, i10 - 1, 1)), i10 !== o10 && s10.push(w4("--indent-marker-bg-color", r10, t10, i10, o10 - i10)); + } else + s10.push(w4("--indent-marker-bg-color", r10, t10, a10, o10 - a10)); + return s10.join(","); + } + var j4 = function() { + function e20(t10) { + No(this, e20), this.view = t10, this.unitWidth = XQ(t10.state), this.currentLineNumber = m4(t10.state).number, this.generate(t10.state); + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = XQ(e21.state), n10 = t10 !== this.unitWidth; + n10 && (this.unitWidth = t10); + var r10 = m4(e21.state).number, o10 = r10 !== this.currentLineNumber; + this.currentLineNumber = r10; + var i10 = e21.state.facet(y4).highlightActiveBlock && o10; + (e21.docChanged || e21.viewportChanged || n10 || i10) && this.generate(e21.state); + } }, { key: "generate", value: function(e21) { + var t10, n10 = new jV(), r10 = function(e23) { + var t11, n11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e23.state, r11 = /* @__PURE__ */ new Set(), o11 = bo(e23.visibleRanges); + try { + for (o11.s(); !(t11 = o11.n()).done; ) + for (var i11 = t11.value, a11 = i11.from, s11 = i11.to, c11 = a11; c11 <= s11; ) { + var l11 = n11.doc.lineAt(c11); + r11.has(l11) || r11.add(l11), c11 = l11.to + 1; + } + } catch (e24) { + o11.e(e24); + } finally { + o11.f(); + } + return r11; + }(this.view, e21), o10 = e21.facet(y4), i10 = o10.hideFirstIndent, a10 = o10.markerType, s10 = o10.thickness, c10 = new b4(r10, e21, this.unitWidth, a10), l10 = bo(r10); + try { + for (l10.s(); !(t10 = l10.n()).done; ) { + var u10 = t10.value, f10 = c10.get(u10.number); + if (null == f10 ? void 0 : f10.level) { + var d10 = x4(f10, this.unitWidth, i10, s10); + n10.add(u10.from, u10.from, KH.line({ class: "cm-indent-markers", attributes: { style: "--indent-markers: ".concat(d10) } })); + } + } + } catch (e23) { + l10.e(e23); + } finally { + l10.f(); + } + this.decorations = n10.finish(); + } }]), e20; + }(); + function S4() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return [y4.of(e20), k4(e20.colors), FW.fromClass(j4, { decorations: function(e21) { + return e21.decorations; + } })]; + } + var C4 = function() { + function e20(t10) { + No(this, e20), this.view = t10, this.indentUnit = XQ(t10.state), this.initialPaddingLeft = null, this.generate(t10.state); + } + return Do(e20, [{ key: "update", value: function(e21) { + var t10 = XQ(e21.state); + (t10 !== this.indentUnit || e21.docChanged || e21.viewportChanged) && (this.indentUnit = t10, this.generate(e21.state)); + } }, { key: "generate", value: function(e21) { + var t10 = this, n10 = new jV(); + this.initialPaddingLeft ? this.addStyleToBuilder(n10, e21, this.initialPaddingLeft) : this.view.requestMeasure({ read: function(r10) { + var o10 = r10.contentDOM.querySelector(".cm-line"); + o10 && (t10.initialPaddingLeft = window.getComputedStyle(o10).getPropertyValue("padding-left"), t10.addStyleToBuilder(n10, e21, t10.initialPaddingLeft)), t10.decorations = n10.finish(); + } }), this.decorations = n10.finish(); + } }, { key: "addStyleToBuilder", value: function(e21, t10, n10) { + var r10, o10 = bo(this.getVisibleLines(t10)); + try { + for (o10.s(); !(r10 = o10.n()).done; ) { + var i10 = r10.value, a10 = this.getIndentSize(i10), s10 = "calc(".concat(a10 + this.indentUnit, "ch + ").concat(n10, ")"); + e21.add(i10.from, i10.from, KH.line({ attributes: { style: "padding-left: ".concat(s10, "; text-indent: -").concat(a10 + this.indentUnit, "ch;") } })); + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + } }, { key: "getVisibleLines", value: function(e21) { + var t10, n10 = /* @__PURE__ */ new Set(), r10 = null, o10 = bo(this.view.visibleRanges); + try { + for (o10.s(); !(t10 = o10.n()).done; ) + for (var i10 = t10.value, a10 = i10.from, s10 = i10.to, c10 = a10; c10 <= s10; ) { + var l10 = e21.doc.lineAt(c10); + r10 !== l10 && (n10.add(l10), r10 = l10), c10 = l10.to + 1; + } + } catch (e23) { + o10.e(e23); + } finally { + o10.f(); + } + return n10; + } }, { key: "getIndentSize", value: function(e21) { + return e21.text.length - e21.text.trimStart().length; + } }]), e20; + }(); + var $4 = [FW.fromClass(C4, { decorations: function(e20) { + return e20.decorations; + } })]; + function _4(e20) { + mi(e20, "svelte-a0poeb", '.jse-text-mode.svelte-a0poeb.svelte-a0poeb{--internal-key-color:var(--jse-key-color, #1a1a1a);--internal-value-color-number:var(--jse-value-color-number, #ee422e);--internal-value-color-boolean:var(--jse-value-color-boolean, #ff8c00);--internal-value-color-string:var(--jse-value-color-string, #008000);--internal-value-color-null:var(--jse-value-color-null, #004ed0);flex:1;box-sizing:border-box;display:flex;flex-direction:column;background:var(--jse-background-color, #fff)}.jse-text-mode.no-main-menu.svelte-a0poeb.svelte-a0poeb{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb{flex:1;display:flex;position:relative;flex-direction:column;overflow:hidden;min-width:0;min-height:0;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.jse-hidden.svelte-a0poeb{visibility:hidden;position:absolute;top:0;left:0}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor{flex:1;overflow:hidden}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-scroller{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);line-height:var(--jse-line-height, calc(1em + 4px));color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-gutters{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);border-right:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-activeLine,.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-activeLineGutter{background:var(--jse-active-line-background-color, rgba(0, 0, 0, 0.06))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-selectionBackground{background:var(--jse-selection-background-color, #d3d3d3)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-searchMatch{background-color:var(--jse-search-match-color, #ffe665);outline:var(--jse-search-match-outline, 1px solid #ffd700)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-searchMatch.cm-searchMatch-selected{background-color:var(--jse-search-match-active-color, #ffd700);outline:var(--jse-search-match-active-outline, 1px solid #e1be00)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-selectionMatch{background-color:var(--jse-search-match-background-color, rgba(153, 255, 119, 0.5019607843))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-foldPlaceholder{background:var(--jse-tag-background, rgba(0, 0, 0, 0.2));color:var(--jse-tag-color, var(--jse-text-color-inverse, #fff));border:none;padding:0 var(--jse-padding, 10px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-tooltip{font-size:var(--jse-font-size, 16px);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);color:var(--jse-tooltip-color, var(--jse-text-color, #4d4d4d));background:var(--jse-tooltip-background, var(--jse-modal-background, #f5f5f5));border:var(--jse-tooltip-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-diagnosticAction{background:var(--jse-tooltip-action-button-color, var(--jse-text-color-inverse, #fff));background:var(--jse-tooltip-action-button-background, #4d4d4d)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-panels{border-bottom:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color, var(--jse-text-color, #4d4d4d));font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search input{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);color:var(--jse-input-color, var(--jse-text-color, #4d4d4d));border:var(--jse-input-border, 1px solid #d8dbdf);background:var(--jse-input-background, var(--jse-background-color, #fff));margin-right:2px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);color:var(--jse-panel-button-color, inherit);background:var(--jse-panel-button-background, transparent);border:none;cursor:pointer;text-transform:capitalize;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px);margin:0}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button:hover{color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search label{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);padding-left:var(--jse-padding, 10px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search label input{margin-right:2px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button[name="close"]{width:32px;height:32px;font-size:24px;line-height:24px;padding:0;right:0;top:-4px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-cursor-primary{border-color:var(--jse-text-color, #4d4d4d)}.jse-text-mode.svelte-a0poeb .jse-contents .jse-loading-space.svelte-a0poeb{flex:1}.jse-text-mode.svelte-a0poeb .jse-contents .jse-loading.svelte-a0poeb{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-text-mode.svelte-a0poeb .jse-contents.jse-preview.svelte-a0poeb{flex:1;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-panel-color-readonly, #b2b2b2);overflow:auto;white-space:pre-wrap;word-break:break-word;padding:2px}'); + } + function O4(e20) { + var t10 = e20.slice(), n10 = 0 === t10[11].length; + return t10[98] = n10, t10; + } + function M4(e20) { + var t10, n10; + return t10 = new WL({ props: { readOnly: e20[1], onFormat: e20[17], onCompact: e20[18], onSort: e20[19], onTransform: e20[20], onToggleSearch: e20[21], onUndo: e20[22], onRedo: e20[23], canFormat: !e20[98], canCompact: !e20[98], canSort: !e20[98], canTransform: !e20[98], canUndo: e20[12], canRedo: e20[13], onRenderMenu: e20[4] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 2 & n11[0] && (r10.readOnly = e21[1]), 2048 & n11[0] && (r10.canFormat = !e21[98]), 2048 & n11[0] && (r10.canCompact = !e21[98]), 2048 & n11[0] && (r10.canSort = !e21[98]), 2048 & n11[0] && (r10.canTransform = !e21[98]), 4096 & n11[0] && (r10.canUndo = e21[12]), 8192 & n11[0] && (r10.canRedo = e21[13]), 16 & n11[0] && (r10.onRenderMenu = e21[4]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function E4(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).innerHTML = '
loading...
', Ai(t10, "class", "jse-contents svelte-a0poeb"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function A4(e20) { + var t10, n10, r10, o10, i10, a10 = e20[97] && P4(e20), s10 = !e20[97] && T4(e20); + return { c: function() { + t10 = ji("div"), n10 = $i(), a10 && a10.c(), r10 = $i(), s10 && s10.c(), o10 = _i(), Ai(t10, "class", "jse-contents svelte-a0poeb"), zi(t10, "jse-hidden", e20[97]); + }, m: function(c10, l10) { + ki(c10, t10, l10), e20[52](t10), ki(c10, n10, l10), a10 && a10.m(c10, l10), ki(c10, r10, l10), s10 && s10.m(c10, l10), ki(c10, o10, l10), i10 = true; + }, p: function(e21, n11) { + (!i10 || 268438016 & n11[0]) && zi(t10, "jse-hidden", e21[97]), e21[97] ? a10 ? (a10.p(e21, n11), 2560 & n11[0] && wa(a10, 1)) : ((a10 = P4(e21)).c(), wa(a10, 1), a10.m(r10.parentNode, r10)) : a10 && (ba(), xa(a10, 1, 1, function() { + a10 = null; + }), ka()), e21[97] ? s10 && (ba(), xa(s10, 1, 1, function() { + s10 = null; + }), ka()) : s10 ? (s10.p(e21, n11), 2560 & n11[0] && wa(s10, 1)) : ((s10 = T4(e21)).c(), wa(s10, 1), s10.m(o10.parentNode, o10)); + }, i: function(e21) { + i10 || (wa(a10), wa(s10), i10 = true); + }, o: function(e21) { + xa(a10), xa(s10), i10 = false; + }, d: function(i11) { + i11 && (wi(t10), wi(n10), wi(r10), wi(o10)), e20[52](null), a10 && a10.d(i11), s10 && s10.d(i11); + } }; + } + function P4(e20) { + var t10, n10, r10, o10, i10, a10 = tM(e20[11] || "", fs) + ""; + return t10 = new IN({ props: { icon: TP, type: "error", message: "The JSON document is larger than ".concat(FL(ps, 1024), ", ") + "and may crash your browser when loading it in text mode. Actual size: ".concat(FL(e20[11].length, 1024), "."), actions: [{ text: "Open anyway", title: "Open the document in text mode. This may freeze or crash your browser.", onClick: e20[24] }, { text: "Open in tree mode", title: "Open the document in tree mode. Tree mode can handle large documents.", onClick: e20[25] }, { text: "Cancel", title: "Cancel opening this large document.", onClick: e20[26] }], onClose: e20[5] } }), { c: function() { + Pa(t10.$$.fragment), n10 = $i(), r10 = ji("div"), o10 = Ci(a10), Ai(r10, "class", "jse-contents jse-preview svelte-a0poeb"); + }, m: function(e21, a11) { + Ta(t10, e21, a11), ki(e21, n10, a11), ki(e21, r10, a11), pi(r10, o10), i10 = true; + }, p: function(e21, n11) { + var r11 = {}; + 2048 & n11[0] && (r11.message = "The JSON document is larger than ".concat(FL(ps, 1024), ", ") + "and may crash your browser when loading it in text mode. Actual size: ".concat(FL(e21[11].length, 1024), ".")), t10.$set(r11), (!i10 || 2048 & n11[0]) && a10 !== (a10 = tM(e21[11] || "", fs) + "") && Ni(o10, a10); + }, i: function(e21) { + i10 || (wa(t10.$$.fragment, e21), i10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), i10 = false; + }, d: function(e21) { + e21 && (wi(n10), wi(r10)), Ra(t10, e21); + } }; + } + function T4(e20) { + var t10, n10, r10, o10, i10, a10 = !e20[14] && e20[0] && oO(e20[11]), s10 = e20[3] && R4(e20), c10 = e20[14] && N4(e20), l10 = a10 && I4(e20); + return o10 = new JN({ props: { validationErrors: e20[10], selectError: e20[27] } }), { c: function() { + s10 && s10.c(), t10 = $i(), c10 && c10.c(), n10 = $i(), l10 && l10.c(), r10 = $i(), Pa(o10.$$.fragment); + }, m: function(e21, a11) { + s10 && s10.m(e21, a11), ki(e21, t10, a11), c10 && c10.m(e21, a11), ki(e21, n10, a11), l10 && l10.m(e21, a11), ki(e21, r10, a11), Ta(o10, e21, a11), i10 = true; + }, p: function(e21, i11) { + e21[3] ? s10 ? (s10.p(e21, i11), 8 & i11[0] && wa(s10, 1)) : ((s10 = R4(e21)).c(), wa(s10, 1), s10.m(t10.parentNode, t10)) : s10 && (ba(), xa(s10, 1, 1, function() { + s10 = null; + }), ka()), e21[14] ? c10 ? (c10.p(e21, i11), 16384 & i11[0] && wa(c10, 1)) : ((c10 = N4(e21)).c(), wa(c10, 1), c10.m(n10.parentNode, n10)) : c10 && (ba(), xa(c10, 1, 1, function() { + c10 = null; + }), ka()), 18433 & i11[0] && (a10 = !e21[14] && e21[0] && oO(e21[11])), a10 ? l10 ? (l10.p(e21, i11), 18433 & i11[0] && wa(l10, 1)) : ((l10 = I4(e21)).c(), wa(l10, 1), l10.m(r10.parentNode, r10)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()); + var u10 = {}; + 1024 & i11[0] && (u10.validationErrors = e21[10]), o10.$set(u10); + }, i: function(e21) { + i10 || (wa(s10), wa(c10), wa(l10), wa(o10.$$.fragment, e21), i10 = true); + }, o: function(e21) { + xa(s10), xa(c10), xa(l10), xa(o10.$$.fragment, e21), i10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(n10), wi(r10)), s10 && s10.d(e21), c10 && c10.d(e21), l10 && l10.d(e21), Ra(o10, e21); + } }; + } + function R4(e20) { + var t10, n10; + return t10 = new d4({ props: { editorState: e20[8] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 256 & n11[0] && (r10.editorState = e21[8]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function N4(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "error", icon: TP, message: e20[14].message, actions: e20[15], onClick: e20[29], onClose: e20[5] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 16384 & n11[0] && (r10.message = e21[14].message), 32768 & n11[0] && (r10.actions = e21[15]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function I4(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "success", message: "Do you want to format the JSON?", actions: [{ icon: xz, text: "Format", title: "Format JSON: add proper indentation and new lines (Ctrl+I)", onClick: e20[17] }, { icon: MP, text: "No thanks", title: "Close this message", onClick: e20[53] }], onClose: e20[5] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11[0] && (r10.actions = [{ icon: xz, text: "Format", title: "Format JSON: add proper indentation and new lines (Ctrl+I)", onClick: e21[17] }, { icon: MP, text: "No thanks", title: "Close this message", onClick: e21[53] }]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function D4(e20) { + var t10, n10, r10, o10, i10, a10 = e20[2] && M4(O4(e20)), s10 = [A4, E4], c10 = []; + function l10(e21, t11) { + return 0 === t11 ? function(e23) { + var t12 = e23.slice(), n11 = t12[28](t12[11], t12[9]); + return t12[97] = n11, t12; + }(e21) : e21; + } + return r10 = function(e21, t11) { + return e21[16] ? 1 : 0; + }(e20), o10 = c10[r10] = s10[r10](l10(e20, r10)), { c: function() { + t10 = ji("div"), a10 && a10.c(), n10 = $i(), o10.c(), Ai(t10, "class", "jse-text-mode svelte-a0poeb"), zi(t10, "no-main-menu", !e20[2]); + }, m: function(o11, s11) { + ki(o11, t10, s11), a10 && a10.m(t10, null), pi(t10, n10), c10[r10].m(t10, null), e20[54](t10), i10 = true; + }, p: function(e21, s11) { + e21[2] ? a10 ? (a10.p(O4(e21), s11), 4 & s11[0] && wa(a10, 1)) : ((a10 = M4(O4(e21))).c(), wa(a10, 1), a10.m(t10, n10)) : a10 && (ba(), xa(a10, 1, 1, function() { + a10 = null; + }), ka()), o10.p(l10(e21, r10), s11), (!i10 || 4 & s11[0]) && zi(t10, "no-main-menu", !e21[2]); + }, i: function(e21) { + i10 || (wa(a10), wa(o10), i10 = true); + }, o: function(e21) { + xa(a10), xa(o10), i10 = false; + }, d: function(n11) { + n11 && wi(t10), a10 && a10.d(), c10[r10].d(), e20[54](null); + } }; + } + function q4(e20) { + return { from: e20.from || 0, to: e20.to || 0, message: e20.message || "", actions: e20.actions, severity: e20.severity }; + } + function z4(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10 = t10.readOnly, u10 = t10.mainMenuBar, f10 = t10.statusBar, d10 = t10.askToFormat, h10 = t10.externalContent, v10 = t10.externalSelection, p10 = t10.indentation, m10 = t10.tabSize, g10 = t10.escapeUnicodeCharacters, y10 = t10.parser, b10 = t10.validator, k10 = t10.validationParser, w10 = t10.onChange, x10 = t10.onChangeMode, j10 = t10.onSelect, S10 = t10.onError, C10 = t10.onFocus, $10 = t10.onBlur, _10 = t10.onRenderMenu, O10 = t10.onSortModal, M10 = t10.onTransformModal, E10 = Da("jsoneditor:TextMode"), A10 = { key: "Mod-i", run: Q10, shift: Y10, preventDefault: true }, P10 = "undefined" == typeof window; + E10("isSSR:", P10); + var T8 = false, R8 = [], N8 = new VF(), I10 = new VF(), D10 = new VF(), q10 = new VF(), z10 = new VF(), B10 = h10, L10 = Y_(B10, p10, y10), F10 = g10; + Gi(xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (!P10) { + e23.next = 2; + break; + } + return e23.abrupt("return"); + case 2: + try { + s10 = re2({ target: i10, initialText: be2(L10, T8) ? "" : r10.escapeValue(L10), readOnly: l10, indentation: p10 }); + } catch (e24) { + console.error(e24); + } + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))), Qi(function() { + s10 && (E10("Destroy CodeMirror editor"), s10.destroy()); + }); + var V10 = false, H10 = false, W10 = A$(), U10 = A$(); + function J10() { + s10 && (E10("focus"), s10.focus()); + } + var K10 = false; + function G10(e21) { + E10("patch", e21); + var t11 = y10.parse(L10), n11 = rc(t11, e21), r11 = vc(t11, e21); + return se2({ text: y10.stringify(n11, null, p10) }), { json: n11, previousJson: t11, undo: r11, redo: e21 }; + } + function Q10() { + if (E10("format"), l10) + return false; + try { + var e21 = y10.parse(L10); + return se2({ text: y10.stringify(e21, null, p10) }), n10(0, d10 = true), true; + } catch (e23) { + S10(e23); + } + return false; + } + function Y10() { + if (E10("compact"), l10) + return false; + try { + var e21 = y10.parse(L10); + return se2({ text: y10.stringify(e21) }), n10(0, d10 = false), true; + } catch (e23) { + S10(e23); + } + return false; + } + function X10() { + if (E10("repair"), !l10) + try { + se2({ text: Hl(L10) }), n10(51, ke2 = $s), n10(14, we2 = null); + } catch (e21) { + S10(e21); + } + } + function Z10(e21) { + var t11 = e21.id, n11 = e21.rootPath, r11 = e21.onTransform, o11 = e21.onClose; + try { + var i11 = y10.parse(L10); + K10 = true, M10({ id: t11 || U10, json: i11, rootPath: n11 || [], onTransform: function(e23) { + r11 ? r11({ operations: e23, json: i11, transformedJson: rc(i11, e23) }) : (E10("onTransform", e23), G10(e23)); + }, onClose: function() { + K10 = false, J10(), o11 && o11(); + } }); + } catch (e23) { + S10(e23); + } + } + function ee2(e21, t11) { + E10("setSelection", { anchor: e21, head: t11 }), s10 && s10.dispatch(s10.state.update({ selection: { anchor: e21, head: t11 }, scrollIntoView: true })); + } + function te2(e21, t11) { + if (1 === t11.state.selection.ranges.length) { + var n11 = t11.state.selection.ranges[0], r11 = L10.slice(n11.from, n11.to); + if ("{" === r11 || "[" === r11) { + var o11 = bc.parse(L10), i11 = Object.keys(o11.pointers).find(function(e23) { + var t12; + return (null === (t12 = o11.pointers[e23].value) || void 0 === t12 ? void 0 : t12.pos) === n11.from; + }), a11 = o11.pointers[i11]; + if (i11 && a11 && a11.value && a11.valueEnd) + E10("pointer found, selecting inner contents of path:", i11, a11), ee2(a11.value.pos + 1, a11.valueEnd.pos - 1); + } + } + } + function ne2() { + return function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + return [u0.of({ source: e21, config: t11 }), l0, _0]; + }(xe2, { delay: 300 }); + } + function re2(e21) { + var t11 = e21.target, r11 = e21.initialText, o11 = e21.readOnly, i11 = e21.indentation; + E10("Create CodeMirror editor", { readOnly: o11, indentation: i11 }); + var a11, l11, u11 = mV.create({ doc: r11, selection: ce2(v10), extensions: [JJ.of([UZ, A10]), N8.of(ne2()), M0(), CG(), OG, CK(), $X(), EY(), cK(), [mK, gK], mV.allowMultipleSelections.of(true), mV.transactionFilter.of(function(e23) { + if (!e23.docChanged || !e23.isUserEvent("input.type") && !e23.isUserEvent("input.complete")) + return e23; + var t12 = e23.startState.languageDataAt("indentOnInput", e23.startState.selection.main.head); + if (!t12.length) + return e23; + var n11 = e23.newDoc, r12 = e23.newSelection.main.head, o12 = n11.lineAt(r12); + if (r12 > o12.from + lY) + return e23; + var i12 = n11.sliceString(o12.from, r12); + if (!t12.some(function(e24) { + return e24.test(i12); + })) + return e23; + var a12, s11 = e23.state, c11 = -1, l12 = [], u12 = bo(s11.selection.ranges); + try { + for (u12.s(); !(a12 = u12.n()).done; ) { + var f11 = a12.value.head, d11 = s11.doc.lineAt(f11); + if (d11.from != c11) { + c11 = d11.from; + var h11 = eY(s11, d11.from); + if (null != h11) { + var v11 = /^\s*/.exec(d11.text)[0], p11 = ZQ(s11, h11); + v11 != p11 && l12.push({ from: d11.from, to: d11.from + v11.length, insert: p11 }); + } + } + } + } catch (e24) { + u12.e(e24); + } finally { + u12.f(); + } + return l12.length ? [e23, { changes: l12, sequential: true }] : e23; + }), IY(zY, { fallback: true }), GY(), [K2, V2], r4(), RK(), DK(), EK, (l11 = [k1, b1], a11 && l11.push(p1.of(a11)), l11), JJ.of([].concat(G2, Bo(WZ), Q1, UX, wY, o4, c0)), v4, S4({ hideFirstIndent: true }), zJ.domEventHandlers({ dblclick: te2 }), zJ.updateListener.of(function(e23) { + n10(8, c10 = e23.state), e23.docChanged ? pe2() : e23.selectionSet && ye2(); + }), new GQ(e1), x1({ top: true }), I10.of(mV.readOnly.of(o11)), q10.of(mV.tabSize.of(m10)), D10.of(he2(i11)), z10.of(zJ.theme({}, { dark: oe2() })), zJ.lineWrapping, $4] }); + return s10 = new zJ({ state: u11, parent: t11 }); + } + function oe2() { + return !!i10 && getComputedStyle(i10).getPropertyValue("--jse-theme").includes("dark"); + } + function ie2(e21) { + var t11 = e21.path, n11 = e21.message, o11 = function(e23, t12) { + try { + var n12 = bc.parse(e23), r11 = Zs(t12), o12 = n12.pointers[r11]; + if (o12) + return { path: t12, line: o12.key ? o12.key.line : o12.value ? o12.value.line : 0, column: o12.key ? o12.key.column : o12.value ? o12.value.column : 0, from: o12.key ? o12.key.pos : o12.value ? o12.value.pos : 0, to: o12.keyEnd ? o12.keyEnd.pos : o12.valueEnd ? o12.valueEnd.pos : 0 }; + } catch (e24) { + console.error(e24); + } + return { path: t12, line: 0, column: 0, from: 0, to: 0 }; + }(r10.escapeValue(L10), t11); + return { path: t11, line: o11.line, column: o11.column, from: o11.from, to: o11.to, message: n11, severity: Za.warning, actions: [] }; + } + function ae2(e21, t11) { + var n11 = e21.line, r11 = e21.column, o11 = e21.position, i11 = e21.message; + return { path: [], line: n11, column: r11, from: o11, to: o11, severity: Za.error, message: i11, actions: t11 && !l10 ? [{ name: "Auto repair", apply: function() { + return X10(); + } }] : null }; + } + function se2(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], o11 = Y_(e21, p10, y10), i11 = !Ow(e21, B10), a11 = B10; + B10 = e21, n10(11, L10 = o11), E10("setCodeMirrorContent", { isChanged: i11, forceUpdate: t11 }), s10 && (i11 || t11) && (be2(L10, T8) || s10.dispatch({ changes: { from: 0, to: s10.state.doc.length, insert: r10.escapeValue(L10) } }), ve2(), i11 && ge2(B10, a11)); + } + function ce2(e21) { + return bE(e21) ? $F.fromJSON(e21) : void 0; + } + function le2() { + return (le2 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return E10("refresh"), e23.next = 3, fe2(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function ue2() { + if (s10) { + var e21 = s10 ? r10.unescapeValue(s10.state.doc.toString()) : "", t11 = e21 !== L10; + if (E10("onChangeCodeMirrorValue", { isChanged: t11 }), t11) { + var o11 = B10; + n10(11, L10 = e21), B10 = { text: L10 }, ve2(), ge2(B10, o11), ca().then(ye2); + } + } + } + function fe2() { + return de2.apply(this, arguments); + } + function de2() { + return (de2 = xo(ko().mark(function e21() { + var t11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, ca(); + case 2: + s10 && (t11 = oe2(), E10("updateTheme", { dark: t11 }), s10.dispatch({ effects: [z10.reconfigure(zJ.theme({}, { dark: t11 }))] })); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function he2(e21) { + return YQ.of("number" == typeof e21 ? " ".repeat(e21) : e21); + } + function ve2() { + n10(12, V10 = TX(s10.state) > 0), n10(13, H10 = RX(s10.state) > 0), E10({ canUndo: V10, canRedo: H10 }); + } + Qi(function() { + me2(); + }), ON({ onMount: Gi, onDestroy: Qi, getWindow: function() { + return SO(a10); + }, hasFocus: function() { + return K10 && document.hasFocus() || CO(a10); + }, onFocus: C10, onBlur: function() { + me2(), $10(); + } }); + var pe2 = Vy(ue2, 300); + function me2() { + pe2.flush(); + } + function ge2(e21, t11) { + w10 && w10(e21, t11, { contentErrors: je2(), patchResult: null }); + } + function ye2() { + j10(Ro({ type: Ya.text }, c10.selection.toJSON())); + } + function be2(e21, t11) { + return !!e21 && e21.length > ps && !t11; + } + var ke2 = $s, we2 = null; + function xe2() { + if (be2(L10, T8)) + return []; + var e21 = je2(); + return uI(e21) ? [q4(ae2(e21.parseError, e21.isRepairable))] : fI(e21) ? e21.validationErrors.map(ie2).map(q4) : []; + } + function je2() { + E10("validate:start"), me2(); + var e21 = Se2(r10.escapeValue(L10), b10, y10, k10); + return uI(e21) ? (n10(51, ke2 = e21.isRepairable ? _s : "invalid"), n10(14, we2 = e21.parseError), n10(10, R8 = [])) : (n10(51, ke2 = $s), n10(14, we2 = null), n10(10, R8 = (null == e21 ? void 0 : e21.validationErrors) || [])), E10("validate:end"), e21; + } + var Se2 = CB($N); + function Ce2() { + we2 && function(e21) { + E10("select parse error", e21); + var t11 = ae2(e21, false); + ee2(null != t11.from ? t11.from : 0, null != t11.to ? t11.to : 0), J10(); + }(we2); + } + var $e2 = { icon: fP, text: "Show me", title: "Move to the parse error location", onClick: Ce2 }; + return e20.$$set = function(e21) { + "readOnly" in e21 && n10(1, l10 = e21.readOnly), "mainMenuBar" in e21 && n10(2, u10 = e21.mainMenuBar), "statusBar" in e21 && n10(3, f10 = e21.statusBar), "askToFormat" in e21 && n10(0, d10 = e21.askToFormat), "externalContent" in e21 && n10(30, h10 = e21.externalContent), "externalSelection" in e21 && n10(31, v10 = e21.externalSelection), "indentation" in e21 && n10(32, p10 = e21.indentation), "tabSize" in e21 && n10(33, m10 = e21.tabSize), "escapeUnicodeCharacters" in e21 && n10(34, g10 = e21.escapeUnicodeCharacters), "parser" in e21 && n10(35, y10 = e21.parser), "validator" in e21 && n10(36, b10 = e21.validator), "validationParser" in e21 && n10(37, k10 = e21.validationParser), "onChange" in e21 && n10(38, w10 = e21.onChange), "onChangeMode" in e21 && n10(39, x10 = e21.onChangeMode), "onSelect" in e21 && n10(40, j10 = e21.onSelect), "onError" in e21 && n10(41, S10 = e21.onError), "onFocus" in e21 && n10(42, C10 = e21.onFocus), "onBlur" in e21 && n10(43, $10 = e21.onBlur), "onRenderMenu" in e21 && n10(4, _10 = e21.onRenderMenu), "onSortModal" in e21 && n10(44, O10 = e21.onSortModal), "onTransformModal" in e21 && n10(45, M10 = e21.onTransformModal); + }, e20.$$.update = function() { + 8 & e20.$$.dirty[1] && (r10 = aO({ escapeControlCharacters: false, escapeUnicodeCharacters: g10 })), 1073741824 & e20.$$.dirty[0] && se2(h10), 1 & e20.$$.dirty[1] && function(e21) { + if (bE(e21)) { + var t11 = ce2(e21); + !s10 || !t11 || c10 && c10.selection.eq(t11) || (E10("applyExternalSelection", t11), s10.dispatch({ selection: t11 })); + } + }(v10), 32 & e20.$$.dirty[1] && function(e21) { + E10("updateLinter", e21), s10 && s10.dispatch({ effects: N8.reconfigure(ne2()) }); + }(b10), 2 & e20.$$.dirty[1] && function(e21) { + s10 && (E10("updateIndentation", e21), s10.dispatch({ effects: D10.reconfigure(he2(e21)) })); + }(p10), 4 & e20.$$.dirty[1] && function(e21) { + s10 && (E10("updateTabSize", e21), s10.dispatch({ effects: q10.reconfigure(mV.tabSize.of(e21)) })); + }(m10), 2 & e20.$$.dirty[0] && function(e21) { + s10 && (E10("updateReadOnly", e21), s10.dispatch({ effects: [I10.reconfigure(mV.readOnly.of(e21))] })); + }(l10), 524296 & e20.$$.dirty[1] && F10 !== g10 && (n10(50, F10 = g10), E10("forceUpdateText", { escapeUnicodeCharacters: g10 }), s10 && s10.dispatch({ changes: { from: 0, to: s10.state.doc.length, insert: r10.escapeValue(L10) } })), 2 & e20.$$.dirty[0] | 1048576 & e20.$$.dirty[1] && n10(15, o10 = ke2 !== _s || l10 ? [$e2] : [{ icon: uP, text: "Auto repair", title: "Automatically repair JSON", onClick: X10 }, $e2]); + }, [d10, l10, u10, f10, _10, J10, i10, a10, c10, T8, R8, L10, V10, H10, we2, o10, P10, Q10, Y10, function() { + var e21; + if (!l10) + try { + var t11 = y10.parse(L10); + K10 = true, O10({ id: W10, json: t11, rootPath: [], onSort: (e21 = xo(ko().mark(function e23(t12) { + var n11; + return ko().wrap(function(e24) { + for (; ; ) + switch (e24.prev = e24.next) { + case 0: + n11 = t12.operations, E10("onSort", n11), G10(n11); + case 3: + case "end": + return e24.stop(); + } + }, e23); + })), function(t12) { + return e21.apply(this, arguments); + }), onClose: function() { + K10 = false, J10(); + } }); + } catch (e23) { + S10(e23); + } + }, function() { + l10 || Z10({ rootPath: [] }); + }, function() { + s10 && (i10 && i10.querySelector(".cm-search") ? G1(s10) : K1(s10)); + }, function() { + l10 || s10 && (OX(s10), J10()); + }, function() { + l10 || s10 && (MX(s10), J10()); + }, function() { + n10(9, T8 = true), se2(h10, true); + }, function() { + x10(Qa.tree); + }, function() { + ue2(); + }, function(e21) { + E10("select validation error", e21); + var t11 = ie2(e21), n11 = t11.from, r11 = t11.to; + null !== n11 && null !== r11 && (ee2(n11, r11), J10()); + }, be2, Ce2, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, O10, M10, G10, Z10, function() { + return le2.apply(this, arguments); + }, je2, F10, ke2, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(6, i10 = e21); + }); + }, function() { + return n10(0, d10 = false); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(7, a10 = e21); + }); + }]; + } + var B4 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, z4, D4, Zo, { readOnly: 1, mainMenuBar: 2, statusBar: 3, askToFormat: 0, externalContent: 30, externalSelection: 31, indentation: 32, tabSize: 33, escapeUnicodeCharacters: 34, parser: 35, validator: 36, validationParser: 37, onChange: 38, onChangeMode: 39, onSelect: 40, onError: 41, onFocus: 42, onBlur: 43, onRenderMenu: 4, onSortModal: 44, onTransformModal: 45, focus: 5, patch: 46, openTransformModal: 47, refresh: 48, validate: 49 }, _4, [-1, -1, -1, -1]), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "focus", get: function() { + return this.$$.ctx[5]; + } }, { key: "patch", get: function() { + return this.$$.ctx[46]; + } }, { key: "openTransformModal", get: function() { + return this.$$.ctx[47]; + } }, { key: "refresh", get: function() { + return this.$$.ctx[48]; + } }, { key: "validate", get: function() { + return this.$$.ctx[49]; + } }]), t10; + }(); + function L4(e20) { + var t10, n10; + return t10 = new EI({ props: { items: e20[0] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & jo(n11, 1)[0] && (r10.items = e21[0]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function F4(e20, t10, n10) { + var r10, o10, i10 = t10.json, a10 = t10.readOnly, s10 = t10.historyState, c10 = t10.onSort, l10 = t10.onTransform, u10 = t10.onContextMenu, f10 = t10.onUndo, d10 = t10.onRedo, h10 = t10.onRenderMenu; + return e20.$$set = function(e21) { + "json" in e21 && n10(1, i10 = e21.json), "readOnly" in e21 && n10(2, a10 = e21.readOnly), "historyState" in e21 && n10(3, s10 = e21.historyState), "onSort" in e21 && n10(4, c10 = e21.onSort), "onTransform" in e21 && n10(5, l10 = e21.onTransform), "onContextMenu" in e21 && n10(6, u10 = e21.onContextMenu), "onUndo" in e21 && n10(7, f10 = e21.onUndo), "onRedo" in e21 && n10(8, d10 = e21.onRedo), "onRenderMenu" in e21 && n10(9, h10 = e21.onRenderMenu); + }, e20.$$.update = function() { + 510 & e20.$$.dirty && n10(10, r10 = a10 ? [{ type: "space" }] : [{ type: "button", icon: kP, title: "Sort", className: "jse-sort", onClick: c10, disabled: a10 || void 0 === i10 }, { type: "button", icon: cP, title: "Transform contents (filter, sort, project)", className: "jse-transform", onClick: l10, disabled: a10 || void 0 === i10 }, { type: "button", icon: yP, title: xs, className: "jse-contextmenu", onClick: u10 }, { type: "separator" }, { type: "button", icon: vP, title: "Undo (Ctrl+Z)", className: "jse-undo", onClick: f10, disabled: !s10.canUndo }, { type: "button", icon: hP, title: "Redo (Ctrl+Shift+Z)", className: "jse-redo", onClick: d10, disabled: !s10.canRedo }, { type: "space" }]), 1536 & e20.$$.dirty && n10(0, o10 = h10(r10)); + }, [o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, r10]; + } + var V4 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, F4, L4, Zo, { json: 1, readOnly: 2, historyState: 3, onSort: 4, onTransform: 5, onContextMenu: 6, onUndo: 7, onRedo: 8, onRenderMenu: 9 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function H4(e20, t10, n10) { + var r10 = e20.slice(); + return r10[9] = t10[n10], r10; + } + function W4(e20) { + var t10, n10, r10, o10 = [e20[9].props], i10 = e20[9].component; + function a10(e21, t11) { + var n11 = {}; + if (void 0 !== t11 && 1 & t11) + n11 = Ma(o10, [Ea(e21[9].props)]); + else + for (var r11 = 0; r11 < o10.length; r11 += 1) + n11 = Jo(n11, o10[r11]); + return { props: n11 }; + } + return i10 && (t10 = Li(i10, a10(e20))), { c: function() { + t10 && Pa(t10.$$.fragment), n10 = _i(); + }, m: function(e21, o11) { + t10 && Ta(t10, e21, o11), ki(e21, n10, o11), r10 = true; + }, p: function(e21, r11) { + if (1 & r11 && i10 !== (i10 = e21[9].component)) { + if (t10) { + ba(); + var s10 = t10; + xa(s10.$$.fragment, 1, 0, function() { + Ra(s10, 1); + }), ka(); + } + i10 ? (Pa((t10 = Li(i10, a10(e21, r11))).$$.fragment), wa(t10.$$.fragment, 1), Ta(t10, n10.parentNode, n10)) : t10 = null; + } else if (i10) { + var c10 = 1 & r11 ? Ma(o10, [Ea(e21[9].props)]) : {}; + t10.$set(c10); + } + }, i: function(e21) { + r10 || (t10 && wa(t10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + t10 && xa(t10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(n10), t10 && Ra(t10, e21); + } }; + } + function U4(e20) { + var t10, n10, r10 = e20[9].component, o10 = W4(e20); + return { c: function() { + o10.c(), t10 = _i(); + }, m: function(e21, r11) { + o10.m(e21, r11), ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + 1 & n11 && Zo(r10, r10 = e21[9].component) ? (ba(), xa(o10, 1, 1, Wo), ka(), (o10 = W4(e21)).c(), wa(o10, 1), o10.m(t10.parentNode, t10)) : o10.p(e21, n11); + }, i: function(e21) { + n10 || (wa(o10), n10 = true); + }, o: function(e21) { + xa(o10), n10 = false; + }, d: function(e21) { + e21 && wi(t10), o10.d(e21); + } }; + } + function J4(e20) { + for (var t10, n10, r10 = Ca(e20[0]), o10 = [], i10 = 0; i10 < r10.length; i10 += 1) + o10[i10] = U4(H4(e20, r10, i10)); + var a10 = function(e21) { + return xa(o10[e21], 1, 1, function() { + o10[e21] = null; + }); + }; + return { c: function() { + for (var e21 = 0; e21 < o10.length; e21 += 1) + o10[e21].c(); + t10 = _i(); + }, m: function(e21, r11) { + for (var i11 = 0; i11 < o10.length; i11 += 1) + o10[i11] && o10[i11].m(e21, r11); + ki(e21, t10, r11), n10 = true; + }, p: function(e21, n11) { + var i11 = jo(n11, 1)[0]; + if (1 & i11) { + var s10; + for (r10 = Ca(e21[0]), s10 = 0; s10 < r10.length; s10 += 1) { + var c10 = H4(e21, r10, s10); + o10[s10] ? (o10[s10].p(c10, i11), wa(o10[s10], 1)) : (o10[s10] = U4(c10), o10[s10].c(), wa(o10[s10], 1), o10[s10].m(t10.parentNode, t10)); + } + for (ba(), s10 = r10.length; s10 < o10.length; s10 += 1) + a10(s10); + ka(); + } + }, i: function(e21) { + if (!n10) { + for (var t11 = 0; t11 < r10.length; t11 += 1) + wa(o10[t11]); + n10 = true; + } + }, o: function(e21) { + o10 = o10.filter(Boolean); + for (var t11 = 0; t11 < o10.length; t11 += 1) + xa(o10[t11]); + n10 = false; + }, d: function(e21) { + e21 && wi(t10), xi(o10, e21); + } }; + } + function K4(e20, t10, n10) { + var r10, o10, i10 = t10.path, a10 = t10.value, s10 = t10.context, c10 = t10.enforceString, l10 = t10.selection, u10 = t10.searchResultItems; + function f10(e21, t11) { + return s10.onPatch(function(e23, t12) { + return e23.flatMap(function(e24) { + if (Ds(e24)) { + var n11 = Xs(e24.path); + if (n11.length > 0) { + for (var r11 = [e24], o11 = Qk(n11); o11.length > 0 && !Ys(t12, o11); ) + r11.unshift({ op: "add", path: Zs(o11), value: {} }), o11 = Qk(o11); + return r11; + } + } + return e24; + }); + }(e21, s10.getJson()), t11); + } + return e20.$$set = function(e21) { + "path" in e21 && n10(1, i10 = e21.path), "value" in e21 && n10(2, a10 = e21.value), "context" in e21 && n10(3, s10 = e21.context), "enforceString" in e21 && n10(4, c10 = e21.enforceString), "selection" in e21 && n10(5, l10 = e21.selection), "searchResultItems" in e21 && n10(6, u10 = e21.searchResultItems); + }, e20.$$.update = function() { + 40 & e20.$$.dirty && n10(7, r10 = !s10.readOnly && pE(l10) && zE(l10)), 254 & e20.$$.dirty && n10(0, o10 = s10.onRenderValue({ path: i10, value: a10, readOnly: s10.readOnly, enforceString: c10, isEditing: r10, parser: s10.parser, normalization: s10.normalization, selection: l10, searchResultItems: u10, onPatch: f10, onPasteJson: s10.onPasteJson, onSelect: s10.onSelect, onFind: s10.onFind, findNextInside: s10.findNextInside, focus: s10.focus })); + }, [o10, i10, a10, s10, c10, l10, u10, r10]; + } + var G4 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, K4, J4, Zo, { path: 1, value: 2, context: 3, enforceString: 4, selection: 5, searchResultItems: 6 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function Q4(e20) { + mi(e20, "svelte-1o4m3u7", '.jse-inline-value.svelte-1o4m3u7{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);line-height:var(--jse-line-height, calc(1em + 4px));border:none;padding:0 calc(0.5 * var(--jse-padding, 10px));background:transparent;color:inherit;cursor:pointer}.jse-inline-value.svelte-1o4m3u7:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-inline-value.jse-selected.svelte-1o4m3u7{background:var(--jse-selection-background-color, #d3d3d3)}'); + } + function Y4(e20) { + var t10, n10, r10, o10, i10, a10 = tM(null !== (t10 = e20[2].stringify(e20[1])) && void 0 !== t10 ? t10 : "", 50) + ""; + return { c: function() { + n10 = ji("button"), r10 = Ci(a10), Ai(n10, "type", "button"), Ai(n10, "class", "jse-inline-value svelte-1o4m3u7"), zi(n10, "jse-selected", e20[3]); + }, m: function(t11, a11) { + ki(t11, n10, a11), pi(n10, r10), o10 || (i10 = Oi(n10, "dblclick", e20[5]), o10 = true); + }, p: function(e21, t11) { + var o11, i11 = jo(t11, 1)[0]; + 6 & i11 && a10 !== (a10 = tM(null !== (o11 = e21[2].stringify(e21[1])) && void 0 !== o11 ? o11 : "", 50) + "") && Ni(r10, a10), 8 & i11 && zi(n10, "jse-selected", e21[3]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(n10), o10 = false, i10(); + } }; + } + function X4(e20, t10, n10) { + var r10 = t10.path, o10 = t10.value, i10 = t10.parser, a10 = t10.isSelected, s10 = t10.onEdit; + return e20.$$set = function(e21) { + "path" in e21 && n10(0, r10 = e21.path), "value" in e21 && n10(1, o10 = e21.value), "parser" in e21 && n10(2, i10 = e21.parser), "isSelected" in e21 && n10(3, a10 = e21.isSelected), "onEdit" in e21 && n10(4, s10 = e21.onEdit); + }, [r10, o10, i10, a10, s10, function() { + return s10(r10); + }]; + } + var Z4 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, X4, Y4, Zo, { path: 0, value: 1, parser: 2, isSelected: 3, onEdit: 4 }, Q4), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function e32(e20) { + mi(e20, "svelte-2v0aqj", ".jse-column-header.svelte-2v0aqj.svelte-2v0aqj{background:none;border:none;font-family:inherit;font-size:inherit;color:inherit;display:flex;gap:var(--jse-padding, 10px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px));width:100%}.jse-column-header.svelte-2v0aqj.svelte-2v0aqj:hover{background:var(--jse-table-header-background-highlight, #e8e8e8)}.jse-column-header.svelte-2v0aqj.svelte-2v0aqj:not(.jse-column-header.jse-readonly){cursor:pointer}.jse-column-header.svelte-2v0aqj span.jse-column-sort-icon.svelte-2v0aqj{height:1em}"); + } + function t3(e20) { + var t10, n10, r10, o10; + return n10 = new jM({ props: { data: e20[1] === ts.asc ? gP : sP } }), { c: function() { + t10 = ji("span"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-column-sort-icon svelte-2v0aqj"), Ai(t10, "title", r10 = "Currently sorted in ".concat(e20[2], " order")); + }, m: function(e21, r11) { + ki(e21, t10, r11), Ta(n10, t10, null), o10 = true; + }, p: function(e21, i10) { + var a10 = {}; + 2 & i10 && (a10.data = e21[1] === ts.asc ? gP : sP), n10.$set(a10), (!o10 || 4 & i10 && r10 !== (r10 = "Currently sorted in ".concat(e21[2], " order"))) && Ai(t10, "title", r10); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function n3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = tM(e20[3], 50) + "", u10 = void 0 !== e20[1] && t3(e20); + return { c: function() { + t10 = ji("button"), n10 = ji("span"), r10 = Ci(l10), o10 = $i(), u10 && u10.c(), Ai(n10, "class", "jse-column-name"), Ai(t10, "type", "button"), Ai(t10, "class", "jse-column-header svelte-2v0aqj"), Ai(t10, "title", i10 = e20[0] ? e20[3] : e20[3] + " (Click to sort the data by this column)"), zi(t10, "jse-readonly", e20[0]); + }, m: function(i11, l11) { + ki(i11, t10, l11), pi(t10, n10), pi(n10, r10), pi(t10, o10), u10 && u10.m(t10, null), a10 = true, s10 || (c10 = Oi(t10, "click", e20[4]), s10 = true); + }, p: function(e21, n11) { + var o11 = jo(n11, 1)[0]; + (!a10 || 8 & o11) && l10 !== (l10 = tM(e21[3], 50) + "") && Ni(r10, l10), void 0 !== e21[1] ? u10 ? (u10.p(e21, o11), 2 & o11 && wa(u10, 1)) : ((u10 = t3(e21)).c(), wa(u10, 1), u10.m(t10, null)) : u10 && (ba(), xa(u10, 1, 1, function() { + u10 = null; + }), ka()), (!a10 || 9 & o11 && i10 !== (i10 = e21[0] ? e21[3] : e21[3] + " (Click to sort the data by this column)")) && Ai(t10, "title", i10), (!a10 || 1 & o11) && zi(t10, "jse-readonly", e21[0]); + }, i: function(e21) { + a10 || (wa(u10), a10 = true); + }, o: function(e21) { + xa(u10), a10 = false; + }, d: function(e21) { + e21 && wi(t10), u10 && u10.d(), s10 = false, c10(); + } }; + } + function r3(e20, t10, n10) { + var r10, o10, i10, a10 = t10.path, s10 = t10.sortedColumn, c10 = t10.readOnly, l10 = t10.onSort; + return e20.$$set = function(e21) { + "path" in e21 && n10(5, a10 = e21.path), "sortedColumn" in e21 && n10(6, s10 = e21.sortedColumn), "readOnly" in e21 && n10(0, c10 = e21.readOnly), "onSort" in e21 && n10(7, l10 = e21.onSort); + }, e20.$$.update = function() { + var t11; + (32 & e20.$$.dirty && n10(3, r10 = _w(a10) ? "values" : JO(a10)), 96 & e20.$$.dirty) && n10(1, o10 = s10 && Ow(a10, null === (t11 = s10) || void 0 === t11 ? void 0 : t11.path) ? s10.sortDirection : void 0); + 2 & e20.$$.dirty && n10(2, i10 = o10 ? Es[o10] : void 0); + }, [c10, o10, i10, r10, function() { + c10 || l10({ path: a10, sortDirection: o10 === ts.asc ? ts.desc : ts.asc }); + }, a10, s10, l10]; + } + var o3; + var i3; + var a3 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, r3, n3, Zo, { path: 5, sortedColumn: 6, readOnly: 0, onSort: 7 }, e32), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function s3(e20, t10) { + return o3 || (i3 = /* @__PURE__ */ new WeakMap(), o3 = new ResizeObserver(function(e21) { + var t11, n10 = bo(e21); + try { + for (n10.s(); !(t11 = n10.n()).done; ) { + var r10 = t11.value, o10 = i3.get(r10.target); + o10 && o10(r10.target); + } + } catch (e23) { + n10.e(e23); + } finally { + n10.f(); + } + })), i3.set(e20, t10), o3.observe(e20), { destroy: function() { + i3.delete(e20), o3.unobserve(e20); + } }; + } + function c3(e20) { + var t10, n10; + return t10 = new qD({ props: { items: e20[2], onCloseContextMenu: e20[1], tip: e20[0] ? "Tip: you can open this context menu via right-click or with Ctrl+Q" : void 0 } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = jo(n11, 1)[0], o10 = {}; + 4 & r10 && (o10.items = e21[2]), 2 & r10 && (o10.onCloseContextMenu = e21[1]), 1 & r10 && (o10.tip = e21[0] ? "Tip: you can open this context menu via right-click or with Ctrl+Q" : void 0), t10.$set(o10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function l3(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10 = t10.json, v10 = t10.documentState, p10 = t10.parser, m10 = t10.showTip, g10 = t10.onCloseContextMenu, y10 = t10.onRenderContextMenu, b10 = t10.onEditValue, k10 = t10.onEditRow, w10 = t10.onToggleEnforceString, x10 = t10.onCut, j10 = t10.onCopy, S10 = t10.onPaste, C10 = t10.onRemove, $10 = t10.onDuplicateRow, _10 = t10.onInsertBeforeRow, O10 = t10.onInsertAfterRow, M10 = t10.onRemoveRow; + return e20.$$set = function(e21) { + "json" in e21 && n10(3, h10 = e21.json), "documentState" in e21 && n10(4, v10 = e21.documentState), "parser" in e21 && n10(5, p10 = e21.parser), "showTip" in e21 && n10(0, m10 = e21.showTip), "onCloseContextMenu" in e21 && n10(1, g10 = e21.onCloseContextMenu), "onRenderContextMenu" in e21 && n10(6, y10 = e21.onRenderContextMenu), "onEditValue" in e21 && n10(7, b10 = e21.onEditValue), "onEditRow" in e21 && n10(8, k10 = e21.onEditRow), "onToggleEnforceString" in e21 && n10(9, w10 = e21.onToggleEnforceString), "onCut" in e21 && n10(10, x10 = e21.onCut), "onCopy" in e21 && n10(11, j10 = e21.onCopy), "onPaste" in e21 && n10(12, S10 = e21.onPaste), "onRemove" in e21 && n10(13, C10 = e21.onRemove), "onDuplicateRow" in e21 && n10(14, $10 = e21.onDuplicateRow), "onInsertBeforeRow" in e21 && n10(15, _10 = e21.onInsertBeforeRow), "onInsertAfterRow" in e21 && n10(16, O10 = e21.onInsertAfterRow), "onRemoveRow" in e21 && n10(17, M10 = e21.onRemoveRow); + }, e20.$$.update = function() { + 16 & e20.$$.dirty && n10(24, r10 = v10.selection), 8 & e20.$$.dirty && n10(26, o10 = void 0 !== h10), 16777216 & e20.$$.dirty && n10(19, i10 = !!r10), 16777224 & e20.$$.dirty && n10(25, a10 = void 0 !== h10 && r10 ? Ws(h10, JE(r10)) : void 0), 83886080 & e20.$$.dirty && n10(20, s10 = o10 && (mE(r10) || vE(r10) || pE(r10))), 83886080 & e20.$$.dirty && n10(23, c10 = o10 && null != r10 && ME(r10)), 41943040 & e20.$$.dirty && n10(21, l10 = c10 && !Ql(a10)), 50331696 & e20.$$.dirty && n10(22, u10 = null != r10 && void 0 !== a10 && oE(a10, v10.enforceStringMap, Zs(JE(r10)), p10)), 16514944 & e20.$$.dirty && n10(18, d10 = [{ type: "separator" }, { type: "row", items: [{ type: "column", items: [{ type: "label", text: "Table cell:" }, { type: "dropdown-button", main: { type: "button", onClick: function() { + return b10(); + }, icon: dP, text: "Edit", title: "Edit the value (Double-click on the value)", disabled: !c10 }, width: "11em", items: [{ type: "button", icon: dP, text: "Edit", title: "Edit the value (Double-click on the value)", onClick: function() { + return b10(); + }, disabled: !c10 }, { type: "button", icon: u10 ? iM : aM, text: "Enforce string", title: "Enforce keeping the value as string when it contains a numeric value", onClick: function() { + return w10(); + }, disabled: !l10 }] }, { type: "dropdown-button", main: { type: "button", onClick: function() { + return x10(true); + }, icon: eP, text: "Cut", title: "Cut selected contents, formatted with indentation (Ctrl+X)", disabled: !s10 }, width: "10em", items: [{ type: "button", icon: eP, text: "Cut formatted", title: "Cut selected contents, formatted with indentation (Ctrl+X)", onClick: function() { + return x10(true); + }, disabled: !s10 }, { type: "button", icon: eP, text: "Cut compacted", title: "Cut selected contents, without indentation (Ctrl+Shift+X)", onClick: function() { + return x10(false); + }, disabled: !s10 }] }, { type: "dropdown-button", main: { type: "button", onClick: function() { + return j10(true); + }, icon: CP, text: "Copy", title: "Copy selected contents, formatted with indentation (Ctrl+C)", disabled: !s10 }, width: "12em", items: [{ type: "button", icon: CP, text: "Copy formatted", title: "Copy selected contents, formatted with indentation (Ctrl+C)", onClick: function() { + return j10(false); + }, disabled: !s10 }, { type: "button", icon: CP, text: "Copy compacted", title: "Copy selected contents, without indentation (Ctrl+Shift+C)", onClick: function() { + return j10(false); + }, disabled: !s10 }] }, { type: "button", onClick: function() { + return S10(); + }, icon: XA, text: "Paste", title: "Paste clipboard contents (Ctrl+V)", disabled: !i10 }, { type: "button", onClick: function() { + return C10(); + }, icon: QA, text: "Remove", title: "Remove selected contents (Delete)", disabled: !s10 }] }, { type: "column", items: [{ type: "label", text: "Table row:" }, { type: "button", onClick: function() { + return k10(); + }, icon: dP, text: "Edit row", title: "Edit the current row", disabled: !s10 }, { type: "button", onClick: function() { + return $10(); + }, icon: AP, text: "Duplicate row", title: "Duplicate the current row", disabled: !i10 }, { type: "button", onClick: function() { + return _10(); + }, icon: $P, text: "Insert before", title: "Insert a row before the current row", disabled: !i10 }, { type: "button", onClick: function() { + return O10(); + }, icon: $P, text: "Insert after", title: "Insert a row after the current row", disabled: !i10 }, { type: "button", onClick: function() { + return M10(); + }, icon: QA, text: "Remove row", title: "Remove current row", disabled: !i10 }] }] }]), 262208 & e20.$$.dirty && n10(2, f10 = y10(d10)); + }, [m10, g10, f10, h10, v10, p10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10, d10, i10, s10, l10, u10, c10, r10, a10, o10]; + } + var u3 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, l3, c3, Zo, { json: 3, documentState: 4, parser: 5, showTip: 0, onCloseContextMenu: 1, onRenderContextMenu: 6, onEditValue: 7, onEditRow: 8, onToggleEnforceString: 9, onCut: 10, onCopy: 11, onPaste: 12, onRemove: 13, onDuplicateRow: 14, onInsertBeforeRow: 15, onInsertAfterRow: 16, onRemoveRow: 17 }), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function f3(e20) { + mi(e20, "svelte-fxr3ye", '.jse-table-mode-welcome.svelte-fxr3ye.svelte-fxr3ye{flex:1;display:flex;flex-direction:column;overflow:auto;align-items:center;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode-welcome.svelte-fxr3ye.svelte-fxr3ye:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode-welcome.svelte-fxr3ye .jse-space.jse-before.svelte-fxr3ye{flex:1}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays.svelte-fxr3ye{display:flex;flex-direction:column;gap:var(--jse-padding, 10px);max-width:300px;margin:2em var(--jse-padding, 10px);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays .jse-nested-arrays-info.svelte-fxr3ye{color:var(--jse-panel-color-readonly, #b2b2b2)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px;text-align:left}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action .jse-nested-array-count.svelte-fxr3ye{opacity:0.5;white-space:nowrap}.jse-table-mode-welcome.svelte-fxr3ye .jse-space.jse-after.svelte-fxr3ye{flex:2}'); + } + function d3(e20, t10, n10) { + var r10 = e20.slice(); + r10[14] = t10[n10]; + var o10 = r10[8](r10[14]); + return r10[15] = o10, r10; + } + function h3(e20) { + var t10, n10; + return { c: function() { + t10 = Ci(e20[6]), n10 = Ci(" cannot be opened in table mode."); + }, m: function(e21, r10) { + ki(e21, t10, r10), ki(e21, n10, r10); + }, p: function(e21, n11) { + 64 & n11 && Ni(t10, e21[6]); + }, d: function(e21) { + e21 && (wi(t10), wi(n10)); + } }; + } + function v3(e20) { + var t10; + return { c: function() { + t10 = Ci("An object cannot be opened in table mode. You can open a nested array instead, or open the\n document in tree mode."); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function p3(e20) { + var t10; + return { c: function() { + t10 = Ci("You can open the document in tree mode instead."); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function m3(e20) { + var t10, n10, r10; + return { c: function() { + t10 = Ci("You can open the document in tree mode instead, or paste a JSON Array using "), (n10 = ji("b")).textContent = "Ctrl+V", r10 = Ci("."); + }, m: function(e21, o10) { + ki(e21, t10, o10), ki(e21, n10, o10), ki(e21, r10, o10); + }, d: function(e21) { + e21 && (wi(t10), wi(n10), wi(r10)); + } }; + } + function g3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10 = JO(e20[14]) + "", p10 = e20[15] + "", m10 = 1 !== e20[15] ? "items" : "item"; + function g10() { + return e20[12](e20[14]); + } + return { c: function() { + t10 = ji("button"), n10 = Ci(e20[7]), r10 = Ci(' "'), o10 = Ci(v10), i10 = Ci('"\n '), a10 = ji("span"), s10 = Ci("("), c10 = Ci(p10), l10 = $i(), u10 = Ci(m10), f10 = Ci(")"), Ai(a10, "class", "jse-nested-array-count svelte-fxr3ye"), Ai(t10, "type", "button"), Ai(t10, "class", "jse-nested-array-action svelte-fxr3ye"); + }, m: function(e21, v11) { + ki(e21, t10, v11), pi(t10, n10), pi(t10, r10), pi(t10, o10), pi(t10, i10), pi(t10, a10), pi(a10, s10), pi(a10, c10), pi(a10, l10), pi(a10, u10), pi(a10, f10), d10 || (h10 = Oi(t10, "click", g10), d10 = true); + }, p: function(t11, r11) { + e20 = t11, 128 & r11 && Ni(n10, e20[7]), 8 & r11 && v10 !== (v10 = JO(e20[14]) + "") && Ni(o10, v10), 8 & r11 && p10 !== (p10 = e20[15] + "") && Ni(c10, p10), 8 & r11 && m10 !== (m10 = 1 !== e20[15] ? "items" : "item") && Ni(u10, m10); + }, d: function(e21) { + e21 && wi(t10), d10 = false, h10(); + } }; + } + function y3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10; + function b10(e21, t11) { + return e21[5] ? v3 : h3; + } + var k10 = b10(e20), w10 = k10(e20); + function x10(e21, t11) { + return e21[4] && !e21[0] ? m3 : p3; + } + for (var j10 = x10(e20), S10 = j10(e20), C10 = Ca(e20[3]), $10 = [], _10 = 0; _10 < C10.length; _10 += 1) + $10[_10] = g3(d3(e20, C10, _10)); + return { c: function() { + t10 = ji("div"), n10 = ji("div"), r10 = $i(), o10 = ji("div"), i10 = ji("div"), a10 = Ci(e20[6]), s10 = $i(), c10 = ji("div"), w10.c(), l10 = $i(), S10.c(), u10 = $i(); + for (var g11 = 0; g11 < $10.length; g11 += 1) + $10[g11].c(); + f10 = $i(), d10 = ji("button"), h10 = Ci(e20[7]), v10 = Ci(" in tree mode"), p10 = $i(), m10 = ji("div"), Ai(n10, "class", "jse-space jse-before svelte-fxr3ye"), Ai(i10, "class", "jse-nested-arrays-title"), Ai(c10, "class", "jse-nested-arrays-info svelte-fxr3ye"), Ai(d10, "type", "button"), Ai(d10, "class", "jse-nested-array-action svelte-fxr3ye"), Ai(o10, "class", "jse-nested-arrays svelte-fxr3ye"), Ai(m10, "class", "jse-space jse-after svelte-fxr3ye"), Ai(t10, "class", "jse-table-mode-welcome svelte-fxr3ye"); + }, m: function(b11, k11) { + ki(b11, t10, k11), pi(t10, n10), pi(t10, r10), pi(t10, o10), pi(o10, i10), pi(i10, a10), pi(o10, s10), pi(o10, c10), w10.m(c10, null), pi(c10, l10), S10.m(c10, null), pi(o10, u10); + for (var x11 = 0; x11 < $10.length; x11 += 1) + $10[x11] && $10[x11].m(o10, null); + pi(o10, f10), pi(o10, d10), pi(d10, h10), pi(d10, v10), pi(t10, p10), pi(t10, m10), g10 || (y10 = Oi(d10, "click", e20[13]), g10 = true); + }, p: function(e21, t11) { + var n11 = jo(t11, 1)[0]; + if (64 & n11 && Ni(a10, e21[6]), k10 === (k10 = b10(e21)) && w10 ? w10.p(e21, n11) : (w10.d(1), (w10 = k10(e21)) && (w10.c(), w10.m(c10, l10))), j10 !== (j10 = x10(e21)) && (S10.d(1), (S10 = j10(e21)) && (S10.c(), S10.m(c10, null))), 394 & n11) { + var r11; + for (C10 = Ca(e21[3]), r11 = 0; r11 < C10.length; r11 += 1) { + var i11 = d3(e21, C10, r11); + $10[r11] ? $10[r11].p(i11, n11) : ($10[r11] = g3(i11), $10[r11].c(), $10[r11].m(o10, f10)); + } + for (; r11 < $10.length; r11 += 1) + $10[r11].d(1); + $10.length = C10.length; + } + 128 & n11 && Ni(h10, e21[7]); + }, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10), w10.d(), S10.d(), xi($10, e21), g10 = false, y10(); + } }; + } + function b3(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10 = t10.text, l10 = t10.json, u10 = t10.readOnly, f10 = t10.parser, d10 = t10.openJSONEditorModal, h10 = t10.onChangeMode; + return e20.$$set = function(e21) { + "text" in e21 && n10(9, c10 = e21.text), "json" in e21 && n10(10, l10 = e21.json), "readOnly" in e21 && n10(0, u10 = e21.readOnly), "parser" in e21 && n10(11, f10 = e21.parser), "openJSONEditorModal" in e21 && n10(1, d10 = e21.openJSONEditorModal), "onChangeMode" in e21 && n10(2, h10 = e21.onChangeMode); + }, e20.$$.update = function() { + 1 & e20.$$.dirty && n10(7, r10 = u10 ? "View" : "Edit"), 1024 & e20.$$.dirty && n10(3, s10 = l10 ? function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, n11 = []; + return function e23(r11, o11) { + Rs(r11) && o11.length < t11 && Object.keys(r11).forEach(function(t12) { + e23(r11[t12], o11.concat(t12)); + }), Ts(r11) && n11.push(o11); + }(e21, []), n11; + }(l10).slice(0, 99).filter(function(e21) { + return e21.length > 0; + }) : []), 8 & e20.$$.dirty && n10(5, o10 = !_w(s10)), 1536 & e20.$$.dirty && n10(4, i10 = void 0 === l10 && ("" === c10 || void 0 === c10)), 3120 & e20.$$.dirty && n10(6, a10 = o10 ? "Object with nested arrays" : i10 ? "An empty document" : Rs(l10) ? "An object" : Ts(l10) ? "An empty array" : "A ".concat(eu(l10, f10))); + }, [u10, d10, h10, s10, i10, o10, a10, r10, function(e21) { + return Ws(l10, e21).length; + }, c10, l10, f10, function(e21) { + return d10(e21); + }, function() { + return h10(Qa.tree); + }]; + } + var k3 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, b3, y3, Zo, { text: 9, json: 10, readOnly: 0, parser: 11, openJSONEditorModal: 1, onChangeMode: 2 }, f3), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function w3(e20) { + mi(e20, "svelte-1nml1r3", ".jse-column-header.svelte-1nml1r3{background:none;border:none;font-family:inherit;font-size:inherit;color:inherit;display:flex;gap:var(--jse-padding, 10px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px));width:100%}.jse-column-header.svelte-1nml1r3:hover{background:var(--jse-table-header-background-highlight, #e8e8e8)}.jse-column-header.svelte-1nml1r3:not(.jse-column-header.jse-readonly){cursor:pointer}"); + } + function x3(e20) { + var t10, n10, r10, o10, i10, a10; + return n10 = new jM({ props: { data: EP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), Ai(t10, "type", "button"), Ai(t10, "class", "jse-column-header svelte-1nml1r3"), Ai(t10, "title", r10 = "The Columns are created by sampling ".concat(e20[1], " items out of ").concat(e20[0], ". ") + "If you're missing a column, click here to sample all of the items instead of a subset. This is slower."); + }, m: function(r11, s10) { + ki(r11, t10, s10), Ta(n10, t10, null), o10 = true, i10 || (a10 = Oi(t10, "click", e20[3]), i10 = true); + }, p: function(e21, n11) { + var i11 = jo(n11, 1)[0]; + (!o10 || 3 & i11 && r10 !== (r10 = "The Columns are created by sampling ".concat(e21[1], " items out of ").concat(e21[0], ". ") + "If you're missing a column, click here to sample all of the items instead of a subset. This is slower.")) && Ai(t10, "title", r10); + }, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), i10 = false, a10(); + } }; + } + function j3(e20, t10, n10) { + var r10 = t10.count, o10 = t10.maxSampleCount, i10 = t10.onRefresh; + return e20.$$set = function(e21) { + "count" in e21 && n10(0, r10 = e21.count), "maxSampleCount" in e21 && n10(1, o10 = e21.maxSampleCount), "onRefresh" in e21 && n10(2, i10 = e21.onRefresh); + }, [r10, o10, i10, function() { + return i10(); + }]; + } + var S3 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, j3, x3, Zo, { count: 0, maxSampleCount: 1, onRefresh: 2 }, w3), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function C3(e20) { + mi(e20, "svelte-1bunebm", '.jse-table-mode.svelte-1bunebm.svelte-1bunebm{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color, #fff);min-width:0;min-height:0;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-text-color, #4d4d4d);line-height:var(--jse-line-height, calc(1em + 4px))}.jse-table-mode.no-main-menu.svelte-1bunebm.svelte-1bunebm{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-1bunebm .jse-hidden-input-label.svelte-1bunebm{position:fixed;right:0;top:0;width:0;height:0}.jse-table-mode.svelte-1bunebm .jse-hidden-input-label .jse-hidden-input.svelte-1bunebm{width:0;height:0;padding:0;border:0;outline:none}.jse-table-mode.svelte-1bunebm .jse-contents.svelte-1bunebm{flex:1;align-items:start;flex-direction:column;display:flex;overflow:auto;overflow-anchor:none;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-1bunebm .jse-contents.svelte-1bunebm:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main.svelte-1bunebm{border-collapse:collapse;border-spacing:0}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-invisible-start-section td.svelte-1bunebm,.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-invisible-end-section td.svelte-1bunebm{margin:0;padding:0}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-invisible-end-section td.svelte-1bunebm{padding-bottom:var(--jse-padding, 10px)}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row.svelte-1bunebm:hover{background-color:var(--jse-table-row-odd-background, rgba(0, 0, 0, 0.05))}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-1bunebm{padding:0 var(--jse-padding, 10px) 0 0;vertical-align:top;white-space:nowrap;height:var(--jse-line-height, calc(1em + 4px))}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header.svelte-1bunebm,.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-gutter.svelte-1bunebm{font-weight:normal;text-align:left;color:var(--jse-text-readonly, #8d8d8d);background:var(--jse-table-header-background, #f5f5f5)}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header.svelte-1bunebm{padding:0;position:sticky;top:0}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header .jse-table-root-error.svelte-1bunebm{padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px))}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-gutter.svelte-1bunebm{padding:0 var(--jse-padding, 10px) 0 calc(0.5 * var(--jse-padding, 10px))}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-selected-value.svelte-1bunebm>.jse-value{background:var(--jse-selection-background-color, #d3d3d3)}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-1bunebm div{display:inline-flex}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-1bunebm div.jse-value{overflow-wrap:normal;white-space:nowrap;vertical-align:top;display:inline-block}.jse-table-mode.svelte-1bunebm .jse-contents table.jse-table-main .jse-table-row .jse-table-cell .jse-context-menu-anchor.svelte-1bunebm{position:relative;vertical-align:top}.jse-table-mode.svelte-1bunebm .jse-contents.jse-contents-loading.svelte-1bunebm{align-items:unset}.jse-table-mode.svelte-1bunebm .jse-contents.jse-contents-loading .jse-loading-space.svelte-1bunebm{flex:1}.jse-table-mode.svelte-1bunebm .jse-contents.jse-contents-loading .jse-loading.svelte-1bunebm{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}'); + } + function $3(e20, t10, n10) { + var r10, o10 = e20.slice(); + o10[123] = t10[n10], o10[128] = n10; + var i10 = o10[23].startIndex + o10[128]; + o10[124] = i10; + var a10 = o10[22].rows[o10[124]]; + o10[125] = a10; + var s10 = NB([String(o10[124])], null === (r10 = o10[125]) || void 0 === r10 ? void 0 : r10.row); + return o10[126] = s10, o10; + } + function _3(e20, t10, n10) { + var r10, o10 = e20.slice(); + o10[129] = t10[n10], o10[135] = n10; + var i10 = [String(o10[124])].concat(o10[129]); + o10[130] = i10; + var a10 = Ws(o10[123], o10[129]); + o10[131] = a10; + var s10 = pE(o10[11].selection) && AE(o10[11].selection.path, o10[130]); + o10[132] = s10; + var c10 = null === (r10 = o10[125]) || void 0 === r10 ? void 0 : r10.columns[o10[135]]; + o10[133] = c10; + var l10 = NB(o10[130], o10[133]); + return o10[126] = l10, o10; + } + function O3(e20, t10, n10) { + var r10 = e20.slice(); + return r10[129] = t10[n10], r10; + } + function M3(e20) { + var t10, n10 = e20.slice(), r10 = NB([], null === (t10 = n10[22]) || void 0 === t10 ? void 0 : t10.root); + return n10[126] = r10, n10; + } + function E3(e20) { + var t10, n10; + return t10 = new V4({ props: { json: e20[8], readOnly: e20[0], historyState: e20[20], onSort: e20[41], onTransform: e20[42], onUndo: e20[43], onRedo: e20[44], onContextMenu: e20[33], onRenderMenu: e20[5] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 256 & n11[0] && (r10.json = e21[8]), 1 & n11[0] && (r10.readOnly = e21[0]), 1048576 & n11[0] && (r10.historyState = e21[20]), 32 & n11[0] && (r10.onRenderMenu = e21[5]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function A3(e20) { + var t10; + return { c: function() { + (t10 = ji("div")).innerHTML = '
loading...
', Ai(t10, "class", "jse-contents jse-contents-loading svelte-1bunebm"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, p: Wo, i: Wo, o: Wo, d: function(e21) { + e21 && wi(t10); + } }; + } + function P3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10 = [N3, R3, T3], f10 = []; + function d10(e21, t11) { + return e21[25] ? 0 : e21[17] && void 0 !== e21[16] && "" !== e21[16] ? 1 : 2; + } + return o10 = d10(e20), i10 = f10[o10] = u10[o10](e20), { c: function() { + t10 = ji("label"), n10 = ji("input"), r10 = $i(), i10.c(), a10 = _i(), Ai(n10, "type", "text"), n10.readOnly = true, Ai(n10, "tabindex", "-1"), Ai(n10, "class", "jse-hidden-input svelte-1bunebm"), Ai(t10, "class", "jse-hidden-input-label svelte-1bunebm"); + }, m: function(i11, u11) { + ki(i11, t10, u11), pi(t10, n10), e20[73](n10), ki(i11, r10, u11), f10[o10].m(i11, u11), ki(i11, a10, u11), s10 = true, c10 || (l10 = Oi(n10, "paste", e20[38]), c10 = true); + }, p: function(e21, t11) { + var n11 = o10; + (o10 = d10(e21)) === n11 ? f10[o10].p(e21, t11) : (ba(), xa(f10[n11], 1, 1, function() { + f10[n11] = null; + }), ka(), (i10 = f10[o10]) ? i10.p(e21, t11) : (i10 = f10[o10] = u10[o10](e21)).c(), wa(i10, 1), i10.m(a10.parentNode, a10)); + }, i: function(e21) { + s10 || (wa(i10), s10 = true); + }, o: function(e21) { + xa(i10), s10 = false; + }, d: function(n11) { + n11 && (wi(t10), wi(r10), wi(a10)), e20[73](null), f10[o10].d(n11), c10 = false, l10(); + } }; + } + function T3(e20) { + var t10, n10; + return t10 = new k3({ props: { text: e20[16], json: e20[8], readOnly: e20[0], parser: e20[2], openJSONEditorModal: e20[40], onChangeMode: e20[4] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 65536 & n11[0] && (r10.text = e21[16]), 256 & n11[0] && (r10.json = e21[8]), 1 & n11[0] && (r10.readOnly = e21[0]), 4 & n11[0] && (r10.parser = e21[2]), 16 & n11[0] && (r10.onChangeMode = e21[4]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function R3(e20) { + var t10, n10, r10, o10; + return t10 = new IN({ props: { type: "error", message: "The loaded JSON document is invalid and could not be repaired automatically.", actions: e20[0] ? [] : [{ icon: lP, text: "Repair manually", title: 'Open the document in "code" mode and repair it manually', onClick: e20[36] }] } }), r10 = new iL({ props: { text: e20[16], json: e20[8], indentation: e20[3], parser: e20[2] } }), { c: function() { + Pa(t10.$$.fragment), n10 = $i(), Pa(r10.$$.fragment); + }, m: function(e21, i10) { + Ta(t10, e21, i10), ki(e21, n10, i10), Ta(r10, e21, i10), o10 = true; + }, p: function(e21, n11) { + var o11 = {}; + 1 & n11[0] && (o11.actions = e21[0] ? [] : [{ icon: lP, text: "Repair manually", title: 'Open the document in "code" mode and repair it manually', onClick: e21[36] }]), t10.$set(o11); + var i10 = {}; + 65536 & n11[0] && (i10.text = e21[16]), 256 & n11[0] && (i10.json = e21[8]), 8 & n11[0] && (i10.indentation = e21[3]), 4 & n11[0] && (i10.parser = e21[2]), r10.$set(i10); + }, i: function(e21) { + o10 || (wa(t10.$$.fragment, e21), wa(r10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), xa(r10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(n10), Ra(t10, e21), Ra(r10, e21); + } }; + } + function N3(e20) { + for (var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10 = !_w(null === (t10 = e20[22]) || void 0 === t10 ? void 0 : t10.root), $10 = C10 && I3(M3(e20)), _10 = Ca(e20[10]), O10 = [], M10 = 0; M10 < _10.length; M10 += 1) + O10[M10] = q3(O3(e20, _10, M10)); + for (var E10 = function(e21) { + return xa(O10[e21], 1, 1, function() { + O10[e21] = null; + }); + }, A10 = e20[24] && z3(e20), P10 = Ca(e20[23].visibleItems), T8 = [], R8 = 0; R8 < P10.length; R8 += 1) + T8[R8] = K3($3(e20, P10, R8)); + var N8 = function(e21) { + return xa(T8[e21], 1, 1, function() { + T8[e21] = null; + }); + }, I10 = e20[18] && G3(e20), D10 = e20[19] && Q3(e20); + return w10 = new JN({ props: { validationErrors: e20[12], selectError: e20[39] } }), { c: function() { + n10 = ji("div"), r10 = ji("table"), o10 = ji("tbody"), i10 = ji("tr"), a10 = ji("th"), $10 && $10.c(), s10 = $i(); + for (var t11 = 0; t11 < O10.length; t11 += 1) + O10[t11].c(); + c10 = $i(), A10 && A10.c(), l10 = $i(), u10 = ji("tr"), f10 = ji("td"), h10 = $i(); + for (var x11 = 0; x11 < T8.length; x11 += 1) + T8[x11].c(); + v10 = $i(), p10 = ji("tr"), m10 = ji("td"), y10 = $i(), I10 && I10.c(), b10 = $i(), D10 && D10.c(), k10 = $i(), Pa(w10.$$.fragment), Ai(a10, "class", "jse-table-cell jse-table-cell-header svelte-1bunebm"), Ai(i10, "class", "jse-table-row jse-table-row-header svelte-1bunebm"), Ai(f10, "colspan", d10 = e20[10].length), Ai(f10, "class", "svelte-1bunebm"), Di(f10, "height", e20[23].startHeight + "px"), Ai(u10, "class", "jse-table-invisible-start-section"), Ai(m10, "colspan", g10 = e20[10].length), Ai(m10, "class", "svelte-1bunebm"), Di(m10, "height", e20[23].endHeight + "px"), Ai(p10, "class", "jse-table-invisible-end-section"), Ai(r10, "class", "jse-table-main svelte-1bunebm"), Ai(n10, "class", "jse-contents svelte-1bunebm"); + }, m: function(t11, d11) { + ki(t11, n10, d11), pi(n10, r10), pi(r10, o10), pi(o10, i10), pi(i10, a10), $10 && $10.m(a10, null), pi(i10, s10); + for (var g11 = 0; g11 < O10.length; g11 += 1) + O10[g11] && O10[g11].m(i10, null); + pi(i10, c10), A10 && A10.m(i10, null), pi(o10, l10), pi(o10, u10), pi(u10, f10), pi(o10, h10); + for (var C11 = 0; C11 < T8.length; C11 += 1) + T8[C11] && T8[C11].m(o10, null); + pi(o10, v10), pi(o10, p10), pi(p10, m10), e20[76](n10), ki(t11, y10, d11), I10 && I10.m(t11, d11), ki(t11, b10, d11), D10 && D10.m(t11, d11), ki(t11, k10, d11), Ta(w10, t11, d11), x10 = true, j10 || (S10 = [ci(s3.call(null, n10, e20[45])), Oi(n10, "scroll", e20[29])], j10 = true); + }, p: function(e21, t11) { + var n11; + if (4194304 & t11[0] && (C10 = !_w(null === (n11 = e21[22]) || void 0 === n11 ? void 0 : n11.root)), C10 ? $10 ? ($10.p(M3(e21), t11), 4194304 & t11[0] && wa($10, 1)) : (($10 = I3(M3(e21))).c(), wa($10, 1), $10.m(a10, null)) : $10 && (ba(), xa($10, 1, 1, function() { + $10 = null; + }), ka()), 268438529 & t11[0]) { + var r11; + for (_10 = Ca(e21[10]), r11 = 0; r11 < _10.length; r11 += 1) { + var s11 = O3(e21, _10, r11); + O10[r11] ? (O10[r11].p(s11, t11), wa(O10[r11], 1)) : (O10[r11] = q3(s11), O10[r11].c(), wa(O10[r11], 1), O10[r11].m(i10, c10)); + } + for (ba(), r11 = _10.length; r11 < O10.length; r11 += 1) + E10(r11); + ka(); + } + if (e21[24] ? A10 ? (A10.p(e21, t11), 16777216 & t11[0] && wa(A10, 1)) : ((A10 = z3(e21)).c(), wa(A10, 1), A10.m(i10, null)) : A10 && (ba(), xa(A10, 1, 1, function() { + A10 = null; + }), ka()), (!x10 || 1024 & t11[0] && d10 !== (d10 = e21[10].length)) && Ai(f10, "colspan", d10), 8388608 & t11[0] && Di(f10, "height", e21[23].startHeight + "px"), 165678085 & t11[0] | 33281 & t11[1]) { + var l11; + for (P10 = Ca(e21[23].visibleItems), l11 = 0; l11 < P10.length; l11 += 1) { + var u11 = $3(e21, P10, l11); + T8[l11] ? (T8[l11].p(u11, t11), wa(T8[l11], 1)) : (T8[l11] = K3(u11), T8[l11].c(), wa(T8[l11], 1), T8[l11].m(o10, v10)); + } + for (ba(), l11 = P10.length; l11 < T8.length; l11 += 1) + N8(l11); + ka(); + } + (!x10 || 1024 & t11[0] && g10 !== (g10 = e21[10].length)) && Ai(m10, "colspan", g10), 8388608 & t11[0] && Di(m10, "height", e21[23].endHeight + "px"), e21[18] ? I10 ? (I10.p(e21, t11), 262144 & t11[0] && wa(I10, 1)) : ((I10 = G3(e21)).c(), wa(I10, 1), I10.m(b10.parentNode, b10)) : I10 && (ba(), xa(I10, 1, 1, function() { + I10 = null; + }), ka()), e21[19] ? D10 ? (D10.p(e21, t11), 524288 & t11[0] && wa(D10, 1)) : ((D10 = Q3(e21)).c(), wa(D10, 1), D10.m(k10.parentNode, k10)) : D10 && (ba(), xa(D10, 1, 1, function() { + D10 = null; + }), ka()); + var h11 = {}; + 4096 & t11[0] && (h11.validationErrors = e21[12]), w10.$set(h11); + }, i: function(e21) { + if (!x10) { + wa($10); + for (var t11 = 0; t11 < _10.length; t11 += 1) + wa(O10[t11]); + wa(A10); + for (var n11 = 0; n11 < P10.length; n11 += 1) + wa(T8[n11]); + wa(I10), wa(D10), wa(w10.$$.fragment, e21), x10 = true; + } + }, o: function(e21) { + xa($10), O10 = O10.filter(Boolean); + for (var t11 = 0; t11 < O10.length; t11 += 1) + xa(O10[t11]); + xa(A10), T8 = T8.filter(Boolean); + for (var n11 = 0; n11 < T8.length; n11 += 1) + xa(T8[n11]); + xa(I10), xa(D10), xa(w10.$$.fragment, e21), x10 = false; + }, d: function(t11) { + t11 && (wi(n10), wi(y10), wi(b10), wi(k10)), $10 && $10.d(), xi(O10, t11), A10 && A10.d(), xi(T8, t11), e20[76](null), I10 && I10.d(t11), D10 && D10.d(t11), Ra(w10, t11), j10 = false, Qo(S10); + } }; + } + function I3(e20) { + var t10, n10, r10 = e20[126] && D3(e20); + return { c: function() { + r10 && r10.c(), t10 = _i(); + }, m: function(e21, o10) { + r10 && r10.m(e21, o10), ki(e21, t10, o10), n10 = true; + }, p: function(e21, n11) { + e21[126] ? r10 ? (r10.p(e21, n11), 4194304 & n11[0] && wa(r10, 1)) : ((r10 = D3(e21)).c(), wa(r10, 1), r10.m(t10.parentNode, t10)) : r10 && (ba(), xa(r10, 1, 1, function() { + r10 = null; + }), ka()); + }, i: function(e21) { + n10 || (wa(r10), n10 = true); + }, o: function(e21) { + xa(r10), n10 = false; + }, d: function(e21) { + e21 && wi(t10), r10 && r10.d(e21); + } }; + } + function D3(e20) { + var t10, n10, r10; + return n10 = new wq({ props: { validationError: e20[126], onExpand: LL } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-table-root-error svelte-1bunebm"); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 4194304 & t11[0] && (r11.validationError = e21[126]), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function q3(e20) { + var t10, n10, r10; + return n10 = new a3({ props: { path: e20[129], sortedColumn: e20[11].sortedColumn, readOnly: e20[0], onSort: e20[28] } }), { c: function() { + t10 = ji("th"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-table-cell jse-table-cell-header svelte-1bunebm"); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 1024 & t11[0] && (r11.path = e21[129]), 2048 & t11[0] && (r11.sortedColumn = e21[11].sortedColumn), 1 & t11[0] && (r11.readOnly = e21[0]), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function z3(e20) { + var t10, n10, r10; + return n10 = new S3({ props: { count: Array.isArray(e20[8]) ? e20[8].length : 0, maxSampleCount: e20[9], onRefresh: e20[74] } }), { c: function() { + t10 = ji("th"), Pa(n10.$$.fragment), Ai(t10, "class", "jse-table-cell jse-table-cell-header svelte-1bunebm"); + }, m: function(e21, o10) { + ki(e21, t10, o10), Ta(n10, t10, null), r10 = true; + }, p: function(e21, t11) { + var r11 = {}; + 256 & t11[0] && (r11.count = Array.isArray(e21[8]) ? e21[8].length : 0), 512 & t11[0] && (r11.maxSampleCount = e21[9]), 512 & t11[0] && (r11.onRefresh = e21[74]), n10.$set(r11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10); + } }; + } + function B3(e20) { + var t10, n10; + return t10 = new wq({ props: { validationError: e20[126], onExpand: LL } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 12582912 & n11[0] && (r10.validationError = e21[126]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function L3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10 = e20[124] + "", l10 = e20[126] && B3(e20); + function u10() { + for (var t11, n11 = arguments.length, r11 = new Array(n11), o11 = 0; o11 < n11; o11++) + r11[o11] = arguments[o11]; + return (t11 = e20)[75].apply(t11, [e20[124]].concat(r11)); + } + return { c: function() { + t10 = ji("th"), n10 = Ci(c10), r10 = $i(), l10 && l10.c(), Ai(t10, "class", "jse-table-cell jse-table-cell-gutter svelte-1bunebm"); + }, m: function(e21, c11) { + ki(e21, t10, c11), pi(t10, n10), pi(t10, r10), l10 && l10.m(t10, null), i10 = true, a10 || (s10 = ci(o10 = s3.call(null, t10, u10)), a10 = true); + }, p: function(r11, a11) { + e20 = r11, (!i10 || 8388608 & a11[0]) && c10 !== (c10 = e20[124] + "") && Ni(n10, c10), e20[126] ? l10 ? (l10.p(e20, a11), 12582912 & a11[0] && wa(l10, 1)) : ((l10 = B3(e20)).c(), wa(l10, 1), l10.m(t10, null)) : l10 && (ba(), xa(l10, 1, 1, function() { + l10 = null; + }), ka()), o10 && Yo(o10.update) && 8388608 & a11[0] && o10.update.call(null, u10); + }, i: function(e21) { + i10 || (wa(l10), i10 = true); + }, o: function(e21) { + xa(l10), i10 = false; + }, d: function(e21) { + e21 && wi(t10), l10 && l10.d(), a10 = false, s10(); + } }; + } + function F3(e20) { + var t10, n10; + return t10 = new G4({ props: { path: e20[130], value: void 0 !== e20[131] ? e20[131] : "", enforceString: oE(e20[131], e20[11].enforceStringMap, Zs(e20[130]), e20[21].parser), selection: e20[132] ? e20[11].selection : null, searchResultItems: e20[27], context: e20[21] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 8389632 & n11[0] && (r10.path = e21[130]), 8389632 & n11[0] && (r10.value = void 0 !== e21[131] ? e21[131] : ""), 10488832 & n11[0] && (r10.enforceString = oE(e21[131], e21[11].enforceStringMap, Zs(e21[130]), e21[21].parser)), 8391680 & n11[0] && (r10.selection = e21[132] ? e21[11].selection : null), 2097152 & n11[0] && (r10.context = e21[21]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function V3(e20) { + var t10, n10; + return t10 = new Z4({ props: { path: e20[130], value: e20[131], parser: e20[2], isSelected: e20[132], onEdit: e20[40] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 8389632 & n11[0] && (r10.path = e21[130]), 8389632 & n11[0] && (r10.value = e21[131]), 4 & n11[0] && (r10.parser = e21[2]), 8391680 & n11[0] && (r10.isSelected = e21[132]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function H3(e20) { + var t10, n10, r10, o10; + return n10 = new XD({ props: { selected: true, onContextMenu: e20[31] } }), { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), r10 = $i(), Ai(t10, "class", "jse-context-menu-anchor svelte-1bunebm"); + }, m: function(e21, i10) { + ki(e21, t10, i10), Ta(n10, t10, null), ki(e21, r10, i10), o10 = true; + }, p: Wo, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && (wi(t10), wi(r10)), Ra(n10); + } }; + } + function W3(e20) { + var t10, n10; + return t10 = new wq({ props: { validationError: e20[126], onExpand: LL } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 12583936 & n11[0] && (r10.validationError = e21[126]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function U3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10 = !e20[0] && e20[132] && !zE(e20[11].selection), u10 = [V3, F3], f10 = []; + function d10(e21, t11) { + return 8389632 & t11[0] && (n10 = null), null == n10 && (n10 = !!Ql(e21[131])), n10 ? 0 : 1; + } + r10 = d10(e20, [-1, -1, -1, -1, -1]), o10 = f10[r10] = u10[r10](e20); + var h10 = l10 && H3(e20), v10 = e20[126] && W3(e20); + return { c: function() { + t10 = ji("td"), o10.c(), i10 = _i(), h10 && h10.c(), a10 = _i(), v10 && v10.c(), Ai(t10, "class", "jse-table-cell svelte-1bunebm"), Ai(t10, "data-path", s10 = OO(e20[130])), zi(t10, "jse-selected-value", e20[132]); + }, m: function(e21, n11) { + ki(e21, t10, n11), f10[r10].m(t10, null), pi(t10, i10), h10 && h10.m(t10, null), pi(t10, a10), v10 && v10.m(t10, null), c10 = true; + }, p: function(e21, n11) { + var p10 = r10; + (r10 = d10(e21, n11)) === p10 ? f10[r10].p(e21, n11) : (ba(), xa(f10[p10], 1, 1, function() { + f10[p10] = null; + }), ka(), (o10 = f10[r10]) ? o10.p(e21, n11) : (o10 = f10[r10] = u10[r10](e21)).c(), wa(o10, 1), o10.m(t10, i10)), 8391681 & n11[0] && (l10 = !e21[0] && e21[132] && !zE(e21[11].selection)), l10 ? h10 ? (h10.p(e21, n11), 8391681 & n11[0] && wa(h10, 1)) : ((h10 = H3(e21)).c(), wa(h10, 1), h10.m(t10, a10)) : h10 && (ba(), xa(h10, 1, 1, function() { + h10 = null; + }), ka()), e21[126] ? v10 ? (v10.p(e21, n11), 12583936 & n11[0] && wa(v10, 1)) : ((v10 = W3(e21)).c(), wa(v10, 1), v10.m(t10, null)) : v10 && (ba(), xa(v10, 1, 1, function() { + v10 = null; + }), ka()), (!c10 || 8389632 & n11[0] && s10 !== (s10 = OO(e21[130]))) && Ai(t10, "data-path", s10), (!c10 || 8391680 & n11[0]) && zi(t10, "jse-selected-value", e21[132]); + }, i: function(e21) { + c10 || (wa(o10), wa(h10), wa(v10), c10 = true); + }, o: function(e21) { + xa(o10), xa(h10), xa(v10), c10 = false; + }, d: function(e21) { + e21 && wi(t10), f10[r10].d(), h10 && h10.d(), v10 && v10.d(); + } }; + } + function J3(e20) { + var t10; + return { c: function() { + Ai(t10 = ji("td"), "class", "jse-table-cell svelte-1bunebm"); + }, m: function(e21, n10) { + ki(e21, t10, n10); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function K3(e20) { + for (var t10, n10, r10, o10, i10 = e20[124], a10 = L3(e20), s10 = Ca(e20[10]), c10 = [], l10 = 0; l10 < s10.length; l10 += 1) + c10[l10] = U3(_3(e20, s10, l10)); + var u10 = function(e21) { + return xa(c10[e21], 1, 1, function() { + c10[e21] = null; + }); + }, f10 = e20[24] && J3(); + return { c: function() { + t10 = ji("tr"), a10.c(), n10 = $i(); + for (var e21 = 0; e21 < c10.length; e21 += 1) + c10[e21].c(); + r10 = $i(), f10 && f10.c(), Ai(t10, "class", "jse-table-row svelte-1bunebm"); + }, m: function(e21, i11) { + ki(e21, t10, i11), a10.m(t10, null), pi(t10, n10); + for (var s11 = 0; s11 < c10.length; s11 += 1) + c10[s11] && c10[s11].m(t10, null); + pi(t10, r10), f10 && f10.m(t10, null), o10 = true; + }, p: function(e21, o11) { + if (8388608 & o11[0] && Zo(i10, i10 = e21[124]) ? (ba(), xa(a10, 1, 1, Wo), ka(), (a10 = L3(e21)).c(), wa(a10, 1), a10.m(t10, n10)) : a10.p(e21, o11), 148900869 & o11[0] | 513 & o11[1]) { + var l11; + for (s10 = Ca(e21[10]), l11 = 0; l11 < s10.length; l11 += 1) { + var d10 = _3(e21, s10, l11); + c10[l11] ? (c10[l11].p(d10, o11), wa(c10[l11], 1)) : (c10[l11] = U3(d10), c10[l11].c(), wa(c10[l11], 1), c10[l11].m(t10, r10)); + } + for (ba(), l11 = s10.length; l11 < c10.length; l11 += 1) + u10(l11); + ka(); + } + e21[24] ? f10 || ((f10 = J3()).c(), f10.m(t10, null)) : f10 && (f10.d(1), f10 = null); + }, i: function(e21) { + if (!o10) { + wa(a10); + for (var t11 = 0; t11 < s10.length; t11 += 1) + wa(c10[t11]); + o10 = true; + } + }, o: function(e21) { + xa(a10), c10 = c10.filter(Boolean); + for (var t11 = 0; t11 < c10.length; t11 += 1) + xa(c10[t11]); + o10 = false; + }, d: function(e21) { + e21 && wi(t10), a10.d(e21), xi(c10, e21), f10 && f10.d(); + } }; + } + function G3(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "info", message: "You pasted a JSON ".concat(Array.isArray(e20[18].contents) ? "array" : "object", " as text"), actions: [{ icon: uP, text: "Paste as JSON instead", title: "Paste the text as JSON instead of a single value", onMouseDown: e20[34] }, { text: "Leave as is", title: "Keep the pasted content as a single value", onClick: e20[35] }] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 262144 & n11[0] && (r10.message = "You pasted a JSON ".concat(Array.isArray(e21[18].contents) ? "array" : "object", " as text")), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Q3(e20) { + var t10, n10; + return t10 = new IN({ props: { type: "success", message: "The loaded JSON document was invalid but is successfully repaired.", actions: e20[0] ? [] : [{ icon: PP, text: "Ok", title: "Accept the repaired document", onClick: e20[7] }, { icon: lP, text: "Repair manually instead", title: "Leave the document unchanged and repair it manually instead", onClick: e20[36] }], onClose: e20[6] } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 1 & n11[0] && (r10.actions = e21[0] ? [] : [{ icon: PP, text: "Ok", title: "Accept the repaired document", onClick: e21[7] }, { icon: lP, text: "Repair manually instead", title: "Leave the document unchanged and repair it manually instead", onClick: e21[36] }]), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function Y3(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10 = e20[1] && E3(e20), l10 = [P3, A3], u10 = []; + return r10 = function(e21, t11) { + return e21[26] ? 1 : 0; + }(e20), o10 = u10[r10] = l10[r10](e20), { c: function() { + t10 = ji("div"), c10 && c10.c(), n10 = $i(), o10.c(), Ai(t10, "role", "table"), Ai(t10, "class", "jse-table-mode svelte-1bunebm"), zi(t10, "no-main-menu", !e20[1]); + }, m: function(o11, l11) { + ki(o11, t10, l11), c10 && c10.m(t10, null), pi(t10, n10), u10[r10].m(t10, null), e20[77](t10), i10 = true, a10 || (s10 = [Oi(t10, "mousedown", e20[30]), Oi(t10, "keydown", e20[37]), Oi(t10, "contextmenu", e20[32])], a10 = true); + }, p: function(e21, r11) { + e21[1] ? c10 ? (c10.p(e21, r11), 2 & r11[0] && wa(c10, 1)) : ((c10 = E3(e21)).c(), wa(c10, 1), c10.m(t10, n10)) : c10 && (ba(), xa(c10, 1, 1, function() { + c10 = null; + }), ka()), o10.p(e21, r11), (!i10 || 2 & r11[0]) && zi(t10, "no-main-menu", !e21[1]); + }, i: function(e21) { + i10 || (wa(c10), wa(o10), i10 = true); + }, o: function(e21) { + xa(c10), xa(o10), i10 = false; + }, d: function(n11) { + n11 && wi(t10), c10 && c10.d(), u10[r10].d(), e20[77](null), a10 = false, Qo(s10); + } }; + } + var X3 = 18; + function Z3(e20, t10, n10) { + var r10, o10, i10, a10, s10 = Da("jsoneditor:TableMode"), c10 = Zi("simple-modal").open, l10 = Zi("absolute-popup"), u10 = l10.openAbsolutePopup, f10 = l10.closeAbsolutePopup, d10 = bN(), h10 = A$(), v10 = A$(), p10 = "undefined" == typeof window; + s10("isSSR:", p10); + var m10, g10, y10, b10, k10, w10, x10 = t10.readOnly, j10 = t10.externalContent, S10 = t10.externalSelection, C10 = t10.mainMenuBar, $10 = t10.escapeControlCharacters, _10 = t10.escapeUnicodeCharacters, O10 = t10.flattenColumns, M10 = t10.parser, E10 = t10.parseMemoizeOne, A10 = t10.validator, P10 = t10.validationParser, T8 = t10.indentation, R8 = t10.onChange, N8 = t10.onChangeMode, I10 = t10.onSelect, D10 = t10.onRenderValue, q10 = t10.onRenderMenu, z10 = t10.onRenderContextMenu, B10 = t10.onFocus, L10 = t10.onBlur, F10 = t10.onSortModal, V10 = t10.onTransformModal, H10 = t10.onJSONEditorModal; + ON({ onMount: Gi, onDestroy: Qi, getWindow: function() { + return SO(g10); + }, hasFocus: function() { + return G10 && document.hasFocus() || CO(g10); + }, onFocus: function() { + true, B10 && B10(); + }, onBlur: function() { + false, L10 && L10(); + } }); + var W10, U10 = void 0, J10 = 1e4, K10 = [], G10 = false, Q10 = {}, Y10 = 600, X10 = 0; + function Z10(e21) { + s10("updateSelection", e21); + var t11 = "function" == typeof e21 ? e21(te2.selection) || null : e21; + Ow(t11, te2.selection) || (n10(11, te2 = Ro(Ro({}, te2), {}, { selection: t11 })), I10(t11)); + } + function ee2(e21) { + te2.selection && void 0 !== e21 && (Ys(e21, KE(te2.selection)) && Ys(e21, JE(te2.selection)) || (s10("clearing selection: path does not exist anymore", te2.selection), n10(11, te2 = Ro(Ro({}, te2), {}, { selection: null })))); + } + var te2 = BM(), ne2 = false; + var re2, oe2 = xN({ onChange: function(e21) { + n10(20, ie2 = e21); + } }), ie2 = oe2.getState(); + function ae2(e21) { + var t11 = k10, r11 = J_(e21) ? e21.text !== w10 : !Ow(t11, e21.json); + if (s10("update external content", { isChanged: r11 }), r11) { + var o11 = { json: k10, text: w10 }, i11 = k10, a11 = te2, c11 = w10, l11 = ne2; + if (J_(e21)) + try { + n10(8, k10 = E10(e21.text)), n10(16, w10 = e21.text), n10(19, ne2 = false), n10(17, U10 = void 0); + } catch (t12) { + try { + n10(8, k10 = E10(Hl(e21.text))), n10(16, w10 = e21.text), n10(19, ne2 = true), n10(17, U10 = void 0); + } catch (r12) { + n10(8, k10 = void 0), n10(16, w10 = e21.text), n10(19, ne2 = false), n10(17, U10 = "" !== w10 ? H_(w10, t12.message || String(t12)) : void 0); + } + } + else + n10(8, k10 = e21.json), n10(16, w10 = void 0), n10(19, ne2 = false), n10(17, U10 = void 0); + ee2(k10), te2.sortedColumn && n10(11, te2 = Ro(Ro({}, te2), {}, { sortedColumn: null })), se2({ previousJson: i11, previousState: a11, previousText: c11, previousTextIsRepaired: l11 }); + ve2(o11, null); + } + } + function se2(e21) { + var t11 = e21.previousJson, n11 = e21.previousState, r11 = e21.previousText, o11 = e21.previousTextIsRepaired; + void 0 === t11 && void 0 === r11 || (void 0 !== k10 ? void 0 !== t11 ? oe2.add({ undo: { patch: [{ op: "replace", path: "", value: t11 }], state: PE(n11), json: void 0, text: r11, textIsRepaired: o11 }, redo: { patch: [{ op: "replace", path: "", value: k10 }], state: PE(te2), json: void 0, text: w10, textIsRepaired: ne2 } }) : oe2.add({ undo: { patch: void 0, json: void 0, text: r11, state: PE(n11), textIsRepaired: o11 }, redo: { patch: void 0, json: k10, state: PE(te2), text: w10, textIsRepaired: ne2 } }) : void 0 !== t11 && oe2.add({ undo: { patch: void 0, json: t11, state: PE(n11), text: r11, textIsRepaired: o11 }, redo: { patch: void 0, json: void 0, text: w10, textIsRepaired: ne2, state: PE(te2) } })); + } + var ce2 = [], le2 = CB(CN); + function ue2(e21, t11, r11, o11) { + jN(function() { + var i11; + try { + i11 = le2(e21, t11, r11, o11); + } catch (e23) { + i11 = [{ path: [], message: "Failed to validate: " + e23.message, severity: Za.warning }]; + } + Ow(i11, ce2) || (s10("validationErrors changed:", i11), n10(12, ce2 = i11)); + }, function(e23) { + return s10("validationErrors updated in ".concat(e23, " ms")); + }); + } + function fe2() { + return s10("validate"), U10 ? { parseError: U10, isRepairable: false } : (ue2(k10, A10, M10, P10), _w(ce2) ? null : { validationErrors: ce2 }); + } + function de2(e21, t11) { + if (s10("patch", e21, t11), void 0 === k10) + throw new Error("Cannot apply patch: no JSON"); + var r11 = { json: k10 }, o11 = k10, i11 = te2, a11 = ne2, c11 = hA(k10, e21), l11 = JM(k10, te2, e21).json, u11 = DB(te2, e21, K10), f11 = "function" == typeof t11 ? t11(l11, u11) : void 0; + n10(8, k10 = f11 && void 0 !== f11.json ? f11.json : l11); + var d11 = f11 && void 0 !== f11.state ? f11.state : u11; + n10(11, te2 = d11), n10(16, w10 = void 0), n10(19, ne2 = false), n10(18, W10 = void 0), n10(17, U10 = void 0), oe2.add({ undo: { patch: c11, json: void 0, text: void 0, state: PE(i11), textIsRepaired: a11 }, redo: { patch: e21, json: void 0, state: PE(d11), text: void 0, textIsRepaired: ne2 } }); + var h11 = { json: k10, previousJson: o11, undo: c11, redo: e21 }; + return ve2(r11, h11), h11; + } + function he2(e21, t11) { + return x10 ? { json: k10, previousJson: k10, redo: [], undo: [] } : de2(e21, t11); + } + function ve2(e21, t11) { + if ((void 0 !== e21.json || void 0 !== (null == e21 ? void 0 : e21.text)) && R8) { + if (void 0 !== w10) + R8({ text: w10, json: void 0 }, e21, { contentErrors: fe2(), patchResult: t11 }); + else if (void 0 !== k10) { + R8({ text: void 0, json: k10 }, e21, { contentErrors: fe2(), patchResult: t11 }); + } + } + } + function pe2(e21) { + s10("handleFind", e21); + } + function me2(e21) { + s10("pasted json as text", e21), n10(18, W10 = e21); + } + function ge2(e21) { + var t11 = parseInt(e21[0], 10), n11 = [String(t11 + 1)].concat(Bo(e21.slice(1))); + return Ys(k10, n11) ? RE(n11, false) : RE(e21, false); + } + function ye2() { + s10("focus"), b10 && (b10.focus(), b10.select()); + } + function be2() { + te2.selection || Z10(!Ts(k10) || _w(k10) || _w(K10) ? null : RE(["0"].concat(Bo(K10[0])), false)); + } + function ke2(e21) { + var t11 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n11 = AB(e21, K10, Q10, X3), r11 = n11 - X10, o11 = je2(e21); + if (s10("scrollTo", { path: e21, top: n11, scrollTop: X10, elem: o11 }), !y10) + return Promise.resolve(); + var i11 = y10.getBoundingClientRect(); + if (o11 && !t11) { + var a11 = o11.getBoundingClientRect(); + if (a11.bottom > i11.top && a11.top < i11.bottom) + return Promise.resolve(); + } + var c11 = -i11.height / 4; + return new Promise(o11 ? function(t12) { + d10(o11, { container: y10, offset: c11, duration: 300, callback: function() { + we2(e21), t12(); + } }); + } : function(o12) { + var i12; + d10(r11, { container: y10, offset: c11, duration: 300, callback: (i12 = xo(ko().mark(function r12() { + return ko().wrap(function(r13) { + for (; ; ) + switch (r13.prev = r13.next) { + case 0: + return r13.next = 2, ca(); + case 2: + if (AB(e21, K10, Q10, X3) === n11) { + r13.next = 8; + break; + } + return r13.next = 6, ke2(e21, t11); + case 6: + r13.next = 9; + break; + case 8: + we2(e21); + case 9: + o12(); + case 10: + case "end": + return r13.stop(); + } + }, r12); + })), function() { + return i12.apply(this, arguments); + }) }); + }); + } + function we2(e21) { + var t11 = je2(e21); + if (t11 && y10) { + var r11 = y10.getBoundingClientRect(), o11 = t11.getBoundingClientRect(); + if (o11.right > r11.right) { + var i11 = o11.right - r11.right; + n10(14, y10.scrollLeft += i11, y10); + } + if (o11.left < r11.left) { + var a11 = r11.left - o11.left; + n10(14, y10.scrollLeft -= a11, y10); + } + } + } + function xe2(e21) { + !function(e23) { + if (y10) { + var t11 = PB(e23, K10).rowIndex, r11 = AB(e23, K10, Q10, X3), o11 = r11 + (Q10[t11] || X3), i11 = y10.getBoundingClientRect(), a11 = X10, s11 = X10 + i11.height - 18; + if (o11 > s11) { + var c11 = o11 - s11; + n10(14, y10.scrollTop += c11, y10); + } + if (r11 < a11) { + var l11 = a11 - r11; + n10(14, y10.scrollTop -= l11, y10); + } + } + }(e21), we2(e21); + } + function je2(e21) { + return y10 ? y10.querySelector('td[data-path="'.concat(OO(e21), '"]')) : null; + } + function Se2(e21) { + var t11 = e21.anchor, n11 = e21.left, r11 = e21.top, o11 = e21.width, i11 = e21.height, a11 = e21.offsetTop, s11 = e21.offsetLeft, c11 = e21.showTip; + G10 = true; + var l11 = u10(u3, { json: k10, documentState: te2, parser: M10, showTip: c11, onEditValue: $e2, onEditRow: _e2, onToggleEnforceString: Oe2, onCut: Ae2, onCopy: Te2, onPaste: Ee2, onRemove: Ne2, onDuplicateRow: Ie2, onInsertBeforeRow: De2, onInsertAfterRow: qe2, onRemoveRow: ze2, onRenderContextMenu: z10, onCloseContextMenu: function() { + f10(l11), ye2(); + } }, { left: n11, top: r11, offsetTop: a11, offsetLeft: s11, width: o11, height: i11, anchor: t11, closeOnOuterClick: true, onClose: function() { + G10 = false, ye2(); + } }); + } + function Ce2(e21) { + if (!x10 && !zE(te2.selection)) { + if (e21 && (e21.stopPropagation(), e21.preventDefault()), e21 && "contextmenu" === e21.type && e21.target !== b10) + Se2({ left: e21.clientX, top: e21.clientY, width: Ms, height: Os, showTip: false }); + else { + var t11, n11 = null === (t11 = y10) || void 0 === t11 ? void 0 : t11.querySelector(".jse-table-cell.jse-selected-value"); + if (n11) + Se2({ anchor: n11, offsetTop: 2, width: Ms, height: Os, showTip: false }); + else { + var r11, o11 = null === (r11 = y10) || void 0 === r11 ? void 0 : r11.getBoundingClientRect(); + o11 && Se2({ top: o11.top + 2, left: o11.left + 2, width: Ms, height: Os, showTip: false }); + } + } + return false; + } + } + function $e2() { + if (!x10 && te2.selection) { + var e21 = JE(te2.selection); + Ql(Ws(k10, e21)) ? He2(e21) : Z10(RE(e21, true)); + } + } + function _e2() { + !x10 && te2.selection && He2(JE(te2.selection).slice(0, 1)); + } + function Oe2() { + if (!x10 && pE(te2.selection)) { + var e21 = te2.selection.path, t11 = Zs(e21), n11 = Ws(k10, e21), r11 = !oE(n11, te2.enforceStringMap, t11, M10), o11 = r11 ? String(n11) : ru(String(n11), M10); + s10("handleToggleEnforceString", { enforceString: r11, value: n11, updatedValue: o11 }), he2([{ op: "replace", path: t11, value: o11 }], function(e23, n12) { + return { state: UM(n12, t11, r11) }; + }); + } + } + function Me2() { + return (Me2 = xo(ko().mark(function e21() { + var t11, n11, r11, o11, i11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (s10("apply pasted json", W10), W10) { + e23.next = 3; + break; + } + return e23.abrupt("return"); + case 3: + r11 = (n11 = W10).path, o11 = n11.contents, AO(i11 = (null === (t11 = y10) || void 0 === t11 ? void 0 : t11.querySelector(".jse-editable-div")) || null) && i11.cancel(), he2([{ op: "replace", path: Zs(r11), value: o11 }]), setTimeout(ye2); + case 9: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function Ee2() { + c10(nI, {}, Ro(Ro({}, gs), {}, { styleWindow: { width: "450px" } }), { onClose: function() { + return ye2(); + } }); + } + function Ae2(e21) { + return Pe2.apply(this, arguments); + } + function Pe2() { + return (Pe2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, zB({ json: k10, documentState: te2, indentation: t11 ? T8 : void 0, readOnly: x10, parser: M10, onPatch: he2 }); + case 2: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function Te2() { + return Re2.apply(this, arguments); + } + function Re2() { + return Re2 = xo(ko().mark(function e21() { + var t11, n11 = arguments; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (t11 = !(n11.length > 0 && void 0 !== n11[0]) || n11[0], void 0 !== k10) { + e23.next = 3; + break; + } + return e23.abrupt("return"); + case 3: + return e23.next = 5, LB({ json: k10, documentState: te2, indentation: t11 ? T8 : void 0, parser: M10 }); + case 5: + case "end": + return e23.stop(); + } + }, e21); + })), Re2.apply(this, arguments); + } + function Ne2() { + HB({ json: k10, text: w10, documentState: te2, keepSelection: true, readOnly: x10, onChange: R8, onPatch: he2 }); + } + function Ie2() { + WB({ json: k10, documentState: te2, columns: K10, readOnly: x10, onPatch: he2 }); + } + function De2() { + UB({ json: k10, documentState: te2, columns: K10, readOnly: x10, onPatch: he2 }); + } + function qe2() { + JB({ json: k10, documentState: te2, columns: K10, readOnly: x10, onPatch: he2 }); + } + function ze2() { + KB({ json: k10, documentState: te2, columns: K10, readOnly: x10, onPatch: he2 }); + } + function Be2() { + return (Be2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, QB({ char: t11, selectInside: false, refJsonEditor: g10, json: k10, selection: te2.selection, readOnly: x10, parser: M10, onPatch: he2, onReplaceJson: Le2, onSelect: Z10 }); + case 2: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function Le2(e21, t11) { + var r11 = te2, o11 = k10, i11 = w10, a11 = { json: k10, text: w10 }, s11 = ne2, c11 = HM(k10, te2, [], uE), l11 = "function" == typeof t11 ? t11(e21, c11) : void 0; + n10(8, k10 = l11 && void 0 !== l11.json ? l11.json : e21), n10(11, te2 = l11 && void 0 !== l11.state ? l11.state : c11), n10(16, w10 = void 0), n10(19, ne2 = false), n10(17, U10 = void 0), ee2(k10), se2({ previousJson: o11, previousState: r11, previousText: i11, previousTextIsRepaired: s11 }); + ve2(a11, null); + } + function Fe2(e21, t11) { + s10("handleChangeText"); + var r11 = te2, o11 = k10, i11 = w10, a11 = { json: k10, text: w10 }, c11 = ne2; + try { + n10(8, k10 = E10(e21)), n10(11, te2 = HM(k10, te2, [], uE)), n10(16, w10 = void 0), n10(19, ne2 = false), n10(17, U10 = void 0); + } catch (t12) { + try { + n10(8, k10 = E10(Hl(e21))), n10(11, te2 = HM(k10, te2, [], uE)), n10(16, w10 = e21), n10(19, ne2 = true), n10(17, U10 = void 0); + } catch (r12) { + n10(8, k10 = void 0), n10(11, te2 = BM({ json: k10, expand: uE })), n10(16, w10 = e21), n10(19, ne2 = false), n10(17, U10 = "" !== w10 ? H_(w10, t12.message || String(t12)) : void 0); + } + } + if ("function" == typeof t11) { + var l11 = t11(k10, te2); + n10(8, k10 = l11 && l11.json ? l11.json : k10), n10(11, te2 = l11 && l11.state ? l11.state : te2); + } + ee2(k10), se2({ previousJson: o11, previousState: r11, previousText: i11, previousTextIsRepaired: c11 }); + ve2(a11, null); + } + function Ve2(e21) { + if (void 0 !== k10) { + var t11 = e21.id, n11 = e21.onTransform, r11 = e21.onClose, o11 = e21.rootPath || []; + G10 = true, V10({ id: t11 || v10, json: k10, rootPath: o11 || [], onTransform: function(e23) { + n11 ? n11({ operations: e23, json: k10, transformedJson: rc(k10, e23) }) : (s10("onTransform", o11, e23), he2(e23)); + }, onClose: function() { + G10 = false, ye2(), r11 && r11(); + } }); + } + } + function He2(e21) { + s10("openJSONEditorModal", { path: e21 }), G10 = true, H10({ content: { json: Ws(k10, e21) }, path: e21, onPatch: re2.onPatch, onClose: function() { + G10 = false, ye2(); + } }); + } + function We2(e21, t11) { + c10(HI, { text: e21, onParse: function(e23) { + return L_(e23, function(e24) { + return z_(e24, M10); + }); + }, onRepair: F_, onApply: t11 }, Ro(Ro({}, gs), {}, { styleWindow: { width: "600px", height: "500px" }, styleContent: { padding: 0, height: "100%" } }), { onClose: function() { + return ye2(); + } }); + } + function Ue2() { + if (!x10 && oe2.getState().canUndo) { + var e21 = oe2.undo(); + if (e21) { + var t11 = { json: k10, text: w10 }; + n10(8, k10 = e21.undo.patch ? rc(k10, e21.undo.patch) : e21.undo.json), n10(11, te2 = e21.undo.state), n10(16, w10 = e21.undo.text), n10(19, ne2 = e21.undo.textIsRepaired), n10(17, U10 = void 0), s10("undo", { item: e21, json: k10 }), ve2(t11, e21.undo.patch && e21.redo.patch ? { json: k10, previousJson: t11.json, redo: e21.undo.patch, undo: e21.redo.patch } : null), ye2(), te2.selection && ke2(JE(te2.selection), false); + } + } + } + function Je2() { + if (!x10 && oe2.getState().canRedo) { + var e21 = oe2.redo(); + if (e21) { + var t11 = { json: k10, text: w10 }; + n10(8, k10 = e21.redo.patch ? rc(k10, e21.redo.patch) : e21.redo.json), n10(11, te2 = e21.redo.state), n10(16, w10 = e21.redo.text), n10(19, ne2 = e21.redo.textIsRepaired), n10(17, U10 = void 0), s10("redo", { item: e21, json: k10 }), ve2(t11, e21.undo.patch && e21.redo.patch ? { json: k10, previousJson: t11.json, redo: e21.redo.patch, undo: e21.undo.patch } : null), ye2(), te2.selection && ke2(JE(te2.selection), false); + } + } + } + function Ke2(e21, t11) { + n10(70, Q10[t11] = e21.getBoundingClientRect().height, Q10); + } + return e20.$$set = function(e21) { + "readOnly" in e21 && n10(0, x10 = e21.readOnly), "externalContent" in e21 && n10(47, j10 = e21.externalContent), "externalSelection" in e21 && n10(48, S10 = e21.externalSelection), "mainMenuBar" in e21 && n10(1, C10 = e21.mainMenuBar), "escapeControlCharacters" in e21 && n10(49, $10 = e21.escapeControlCharacters), "escapeUnicodeCharacters" in e21 && n10(50, _10 = e21.escapeUnicodeCharacters), "flattenColumns" in e21 && n10(51, O10 = e21.flattenColumns), "parser" in e21 && n10(2, M10 = e21.parser), "parseMemoizeOne" in e21 && n10(52, E10 = e21.parseMemoizeOne), "validator" in e21 && n10(53, A10 = e21.validator), "validationParser" in e21 && n10(54, P10 = e21.validationParser), "indentation" in e21 && n10(3, T8 = e21.indentation), "onChange" in e21 && n10(55, R8 = e21.onChange), "onChangeMode" in e21 && n10(4, N8 = e21.onChangeMode), "onSelect" in e21 && n10(56, I10 = e21.onSelect), "onRenderValue" in e21 && n10(57, D10 = e21.onRenderValue), "onRenderMenu" in e21 && n10(5, q10 = e21.onRenderMenu), "onRenderContextMenu" in e21 && n10(58, z10 = e21.onRenderContextMenu), "onFocus" in e21 && n10(59, B10 = e21.onFocus), "onBlur" in e21 && n10(60, L10 = e21.onBlur), "onSortModal" in e21 && n10(61, F10 = e21.onSortModal), "onTransformModal" in e21 && n10(62, V10 = e21.onTransformModal), "onJSONEditorModal" in e21 && n10(63, H10 = e21.onJSONEditorModal); + }, e20.$$.update = function() { + 786432 & e20.$$.dirty[1] && n10(69, m10 = aO({ escapeControlCharacters: $10, escapeUnicodeCharacters: _10 })), 65536 & e20.$$.dirty[1] && ae2(j10), 131072 & e20.$$.dirty[1] && function(e21) { + Ow(te2.selection, e21) || (s10("applyExternalSelection", e21), (yE(e21) || null === e21) && Z10(e21)); + }(S10), 1792 & e20.$$.dirty[0] | 1048576 & e20.$$.dirty[1] && n10(10, K10 = Ts(k10) ? function(e21, t11) { + var n11, r11 = new Set(t11.map(Zs)), o11 = new Set(e21.map(Zs)), i11 = bo(r11); + try { + for (i11.s(); !(n11 = i11.n()).done; ) { + var a11 = n11.value; + o11.has(a11) || r11.delete(a11); + } + } catch (e23) { + i11.e(e23); + } finally { + i11.f(); + } + var s11, c11 = bo(o11); + try { + for (c11.s(); !(s11 = c11.n()).done; ) { + var l11 = s11.value; + r11.has(l11) || r11.add(l11); + } + } catch (e23) { + c11.e(e23); + } finally { + c11.f(); + } + return Bo(r11).map(Xs); + }(_B(k10, O10, J10), K10) : []), 1280 & e20.$$.dirty[0] && n10(25, r10 = k10 && !_w(K10)), 768 & e20.$$.dirty[0] && n10(24, o10 = Array.isArray(k10) && k10.length > J10), 256 & e20.$$.dirty[0] | 1792 & e20.$$.dirty[2] && n10(23, i10 = EB(X10, Y10, k10, Q10, X3)), 256 & e20.$$.dirty[0] && y10 && y10.scrollTo({ top: y10.scrollTop, left: y10.scrollLeft }), 2309 & e20.$$.dirty[0] | 67108864 & e20.$$.dirty[1] | 128 & e20.$$.dirty[2] && n10(21, re2 = { readOnly: x10, parser: M10, normalization: m10, getJson: function() { + return k10; + }, getDocumentState: function() { + return te2; + }, findElement: je2, findNextInside: ge2, focus: ye2, onPatch: he2, onSelect: Z10, onFind: pe2, onPasteJson: me2, onRenderValue: D10 }), 260 & e20.$$.dirty[0] | 12582912 & e20.$$.dirty[1] && ue2(k10, A10, M10, P10), 5120 & e20.$$.dirty[0] && n10(22, a10 = RB(ce2, K10)); + }, [x10, C10, M10, T8, N8, q10, ye2, function() { + if (ne2 && void 0 !== k10) { + var e21 = te2, t11 = k10, r11 = w10, o11 = { json: k10, text: w10 }, i11 = ne2; + n10(16, w10 = void 0), n10(19, ne2 = false), ee2(k10), se2({ previousJson: t11, previousState: e21, previousText: r11, previousTextIsRepaired: i11 }); + ve2(o11, null); + } + return { json: k10, text: w10 }; + }, k10, J10, K10, te2, ce2, g10, y10, b10, w10, U10, W10, ne2, ie2, re2, a10, i10, o10, r10, p10, void 0, function(e21) { + if (!x10) { + s10("onSortByHeader", e21); + var t11 = e21.sortDirection === ts.desc ? -1 : 1; + he2(Iz(k10, [], e21.path, t11), function(t12, n11) { + return { state: Ro(Ro({}, n11), {}, { sortedColumn: e21 }) }; + }); + } + }, function(e21) { + n10(72, X10 = e21.target.scrollTop); + }, function(e21) { + var t11 = e21.target, n11 = MO(t11); + if (n11) { + if (zE(te2.selection) && WE(k10, te2.selection, n11)) + return; + Z10(RE(n11, false)), e21.preventDefault(); + } + yO(t11, "BUTTON") || t11.isContentEditable || ye2(); + }, Se2, Ce2, function(e21) { + x10 || Se2({ anchor: $O(e21.target, "BUTTON"), offsetTop: 0, width: Ms, height: Os, showTip: true }); + }, function() { + return Me2.apply(this, arguments); + }, function() { + s10("clear pasted json"), n10(18, W10 = void 0), ye2(); + }, function() { + N8(Qa.text); + }, function(e21) { + var t11 = PO(e21); + if (s10("keydown", { combo: t11, key: e21.key }), "Ctrl+X" === t11 && (e21.preventDefault(), Ae2(true)), "Ctrl+Shift+X" === t11 && (e21.preventDefault(), Ae2(false)), "Ctrl+C" === t11 && (e21.preventDefault(), Te2(true)), "Ctrl+Shift+C" === t11 && (e21.preventDefault(), Te2(false)), "Ctrl+D" === t11 && e21.preventDefault(), "Delete" !== t11 && "Backspace" !== t11 || (e21.preventDefault(), Ne2()), "Insert" === t11 && e21.preventDefault(), "Ctrl+A" === t11 && e21.preventDefault(), "Ctrl+Q" === t11 && Ce2(e21), "ArrowLeft" === t11 && (e21.preventDefault(), be2(), te2.selection)) { + var n11 = function(e23, t12) { + var n12 = PB(JE(t12), e23), r12 = n12.rowIndex, o12 = n12.columnIndex; + return o12 > 0 ? RE(TB({ rowIndex: r12, columnIndex: o12 - 1 }, e23), false) : t12; + }(K10, te2.selection); + Z10(n11), xe2(JE(n11)); + } + if ("ArrowRight" === t11 && (e21.preventDefault(), be2(), te2.selection)) { + var r11 = function(e23, t12) { + var n12 = PB(JE(t12), e23), r12 = n12.rowIndex, o12 = n12.columnIndex; + return o12 < e23.length - 1 ? RE(TB({ rowIndex: r12, columnIndex: o12 + 1 }, e23), false) : t12; + }(K10, te2.selection); + Z10(r11), xe2(JE(r11)); + } + if ("ArrowUp" === t11 && (e21.preventDefault(), be2(), te2.selection)) { + var o11 = function(e23, t12) { + var n12 = PB(JE(t12), e23), r12 = n12.rowIndex, o12 = n12.columnIndex; + return r12 > 0 ? RE(TB({ rowIndex: r12 - 1, columnIndex: o12 }, e23), false) : t12; + }(K10, te2.selection); + Z10(o11), xe2(JE(o11)); + } + if ("ArrowDown" === t11 && (e21.preventDefault(), be2(), te2.selection)) { + var i11 = function(e23, t12, n12) { + var r12 = PB(JE(n12), t12), o12 = r12.rowIndex, i12 = r12.columnIndex; + return o12 < e23.length - 1 ? RE(TB({ rowIndex: o12 + 1, columnIndex: i12 }, t12), false) : n12; + }(k10, K10, te2.selection); + Z10(i11), xe2(JE(i11)); + } + if ("Enter" === t11 && te2.selection && pE(te2.selection)) { + e21.preventDefault(); + var a11 = te2.selection.path; + Ql(Ws(k10, a11)) ? He2(a11) : x10 || Z10(Ro(Ro({}, te2.selection), {}, { edit: true })); + } + if (1 === t11.replace(/^Shift\+/, "").length && te2.selection) + return e21.preventDefault(), void function(e23) { + Be2.apply(this, arguments); + }(e21.key); + if ("Ctrl+Enter" === t11 && pE(te2.selection)) { + var c11 = Ws(k10, te2.selection.path); + nu(c11) && window.open(String(c11), "_blank"); + } + "Escape" === t11 && te2.selection && (e21.preventDefault(), Z10(null)), "Ctrl+F" === t11 && e21.preventDefault(), "Ctrl+H" === t11 && e21.preventDefault(), "Ctrl+Z" === t11 && (e21.preventDefault(), Ue2()), "Ctrl+Shift+Z" === t11 && (e21.preventDefault(), Je2()); + }, function(e21) { + var t11; + e21.preventDefault(); + var n11 = null === (t11 = e21.clipboardData) || void 0 === t11 ? void 0 : t11.getData("text/plain"); + void 0 !== n11 && VB({ clipboardText: n11, json: k10, selection: te2.selection, readOnly: x10, parser: M10, onPatch: he2, onChangeText: Fe2, openRepairModal: We2 }); + }, function(e21) { + s10("select validation error", e21), Z10(RE(e21.path, false)), ke2(e21.path); + }, He2, function() { + !function(e21) { + x10 || void 0 === k10 || (G10 = true, F10({ id: h10, json: k10, rootPath: e21, onSort: function(t11) { + var n11 = t11.operations, r11 = t11.itemPath, o11 = t11.direction; + s10("onSort", n11, e21, r11, o11), he2(n11, function(e23, t12) { + return { state: Ro(Ro({}, t12), {}, { sortedColumn: { path: r11, sortDirection: -1 === o11 ? ts.desc : ts.asc } }) }; + }); + }, onClose: function() { + G10 = false, ye2(); + } })); + }([]); + }, function() { + Ve2({ rootPath: [] }); + }, Ue2, Je2, function(e21) { + n10(71, Y10 = e21.getBoundingClientRect().height); + }, Ke2, j10, S10, $10, _10, O10, E10, A10, P10, R8, I10, D10, z10, B10, L10, F10, V10, H10, fe2, de2, ke2, je2, Ve2, m10, Q10, Y10, X10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(15, b10 = e21); + }); + }, function() { + return n10(9, J10 = 1 / 0); + }, function(e21, t11) { + return Ke2(t11, e21); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(14, y10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(13, g10 = e21); + }); + }]; + } + var e82 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, Z3, Y3, Zo, { readOnly: 0, externalContent: 47, externalSelection: 48, mainMenuBar: 1, escapeControlCharacters: 49, escapeUnicodeCharacters: 50, flattenColumns: 51, parser: 2, parseMemoizeOne: 52, validator: 53, validationParser: 54, indentation: 3, onChange: 55, onChangeMode: 4, onSelect: 56, onRenderValue: 57, onRenderMenu: 5, onRenderContextMenu: 58, onFocus: 59, onBlur: 60, onSortModal: 61, onTransformModal: 62, onJSONEditorModal: 63, validate: 64, patch: 65, focus: 6, acceptAutoRepair: 7, scrollTo: 66, findElement: 67, openTransformModal: 68 }, C3, [-1, -1, -1, -1, -1]), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "validate", get: function() { + return this.$$.ctx[64]; + } }, { key: "patch", get: function() { + return this.$$.ctx[65]; + } }, { key: "focus", get: function() { + return this.$$.ctx[6]; + } }, { key: "acceptAutoRepair", get: function() { + return this.$$.ctx[7]; + } }, { key: "scrollTo", get: function() { + return this.$$.ctx[66]; + } }, { key: "findElement", get: function() { + return this.$$.ctx[67]; + } }, { key: "openTransformModal", get: function() { + return this.$$.ctx[68]; + } }]), t10; + }(); + function t8(e20) { + var t10, n10, r10 = { externalContent: e20[0], externalSelection: e20[1], readOnly: e20[2], indentation: e20[3], mainMenuBar: e20[6], navigationBar: e20[7], escapeControlCharacters: e20[10], escapeUnicodeCharacters: e20[11], parser: e20[13], parseMemoizeOne: e20[14], validator: e20[15], validationParser: e20[16], pathParser: e20[17], onError: e20[23], onChange: e20[18], onChangeMode: e20[19], onSelect: e20[20], onRenderValue: e20[21], onClassName: e20[22], onFocus: e20[24], onBlur: e20[25], onRenderMenu: e20[32], onRenderContextMenu: e20[33], onSortModal: e20[26], onTransformModal: e20[27], onJSONEditorModal: e20[28] }; + return t10 = new kL({ props: r10 }), e20[49](t10), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r11) { + Ta(t10, e21, r11), n10 = true; + }, p: function(e21, n11) { + var r11 = {}; + 1 & n11[0] && (r11.externalContent = e21[0]), 2 & n11[0] && (r11.externalSelection = e21[1]), 4 & n11[0] && (r11.readOnly = e21[2]), 8 & n11[0] && (r11.indentation = e21[3]), 64 & n11[0] && (r11.mainMenuBar = e21[6]), 128 & n11[0] && (r11.navigationBar = e21[7]), 1024 & n11[0] && (r11.escapeControlCharacters = e21[10]), 2048 & n11[0] && (r11.escapeUnicodeCharacters = e21[11]), 8192 & n11[0] && (r11.parser = e21[13]), 16384 & n11[0] && (r11.parseMemoizeOne = e21[14]), 32768 & n11[0] && (r11.validator = e21[15]), 65536 & n11[0] && (r11.validationParser = e21[16]), 131072 & n11[0] && (r11.pathParser = e21[17]), 8388608 & n11[0] && (r11.onError = e21[23]), 262144 & n11[0] && (r11.onChange = e21[18]), 524288 & n11[0] && (r11.onChangeMode = e21[19]), 1048576 & n11[0] && (r11.onSelect = e21[20]), 2097152 & n11[0] && (r11.onRenderValue = e21[21]), 4194304 & n11[0] && (r11.onClassName = e21[22]), 16777216 & n11[0] && (r11.onFocus = e21[24]), 33554432 & n11[0] && (r11.onBlur = e21[25]), 2 & n11[1] && (r11.onRenderMenu = e21[32]), 4 & n11[1] && (r11.onRenderContextMenu = e21[33]), 67108864 & n11[0] && (r11.onSortModal = e21[26]), 134217728 & n11[0] && (r11.onTransformModal = e21[27]), 268435456 & n11[0] && (r11.onJSONEditorModal = e21[28]), t10.$set(r11); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(n11) { + e20[49](null), Ra(t10, n11); + } }; + } + function n8(e20) { + var t10, n10, r10 = { externalContent: e20[0], externalSelection: e20[1], readOnly: e20[2], mainMenuBar: e20[6], escapeControlCharacters: e20[10], escapeUnicodeCharacters: e20[11], flattenColumns: e20[12], parser: e20[13], parseMemoizeOne: e20[14], validator: e20[15], validationParser: e20[16], indentation: e20[3], onChange: e20[18], onChangeMode: e20[19], onSelect: e20[20], onRenderValue: e20[21], onFocus: e20[24], onBlur: e20[25], onRenderMenu: e20[32], onRenderContextMenu: e20[33], onSortModal: e20[26], onTransformModal: e20[27], onJSONEditorModal: e20[28] }; + return t10 = new e82({ props: r10 }), e20[48](t10), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r11) { + Ta(t10, e21, r11), n10 = true; + }, p: function(e21, n11) { + var r11 = {}; + 1 & n11[0] && (r11.externalContent = e21[0]), 2 & n11[0] && (r11.externalSelection = e21[1]), 4 & n11[0] && (r11.readOnly = e21[2]), 64 & n11[0] && (r11.mainMenuBar = e21[6]), 1024 & n11[0] && (r11.escapeControlCharacters = e21[10]), 2048 & n11[0] && (r11.escapeUnicodeCharacters = e21[11]), 4096 & n11[0] && (r11.flattenColumns = e21[12]), 8192 & n11[0] && (r11.parser = e21[13]), 16384 & n11[0] && (r11.parseMemoizeOne = e21[14]), 32768 & n11[0] && (r11.validator = e21[15]), 65536 & n11[0] && (r11.validationParser = e21[16]), 8 & n11[0] && (r11.indentation = e21[3]), 262144 & n11[0] && (r11.onChange = e21[18]), 524288 & n11[0] && (r11.onChangeMode = e21[19]), 1048576 & n11[0] && (r11.onSelect = e21[20]), 2097152 & n11[0] && (r11.onRenderValue = e21[21]), 16777216 & n11[0] && (r11.onFocus = e21[24]), 33554432 & n11[0] && (r11.onBlur = e21[25]), 2 & n11[1] && (r11.onRenderMenu = e21[32]), 4 & n11[1] && (r11.onRenderContextMenu = e21[33]), 67108864 & n11[0] && (r11.onSortModal = e21[26]), 134217728 & n11[0] && (r11.onTransformModal = e21[27]), 268435456 & n11[0] && (r11.onJSONEditorModal = e21[28]), t10.$set(r11); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(n11) { + e20[48](null), Ra(t10, n11); + } }; + } + function r8(e20) { + var t10, n10, r10 = { externalContent: e20[0], externalSelection: e20[1], readOnly: e20[2], indentation: e20[3], tabSize: e20[4], mainMenuBar: e20[6], statusBar: e20[8], askToFormat: e20[9], escapeUnicodeCharacters: e20[11], parser: e20[13], validator: e20[15], validationParser: e20[16], onChange: e20[18], onSelect: e20[20], onChangeMode: e20[19], onError: e20[23], onFocus: e20[24], onBlur: e20[25], onRenderMenu: e20[32], onSortModal: e20[26], onTransformModal: e20[27] }; + return t10 = new B4({ props: r10 }), e20[47](t10), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r11) { + Ta(t10, e21, r11), n10 = true; + }, p: function(e21, n11) { + var r11 = {}; + 1 & n11[0] && (r11.externalContent = e21[0]), 2 & n11[0] && (r11.externalSelection = e21[1]), 4 & n11[0] && (r11.readOnly = e21[2]), 8 & n11[0] && (r11.indentation = e21[3]), 16 & n11[0] && (r11.tabSize = e21[4]), 64 & n11[0] && (r11.mainMenuBar = e21[6]), 256 & n11[0] && (r11.statusBar = e21[8]), 512 & n11[0] && (r11.askToFormat = e21[9]), 2048 & n11[0] && (r11.escapeUnicodeCharacters = e21[11]), 8192 & n11[0] && (r11.parser = e21[13]), 32768 & n11[0] && (r11.validator = e21[15]), 65536 & n11[0] && (r11.validationParser = e21[16]), 262144 & n11[0] && (r11.onChange = e21[18]), 1048576 & n11[0] && (r11.onSelect = e21[20]), 524288 & n11[0] && (r11.onChangeMode = e21[19]), 8388608 & n11[0] && (r11.onError = e21[23]), 16777216 & n11[0] && (r11.onFocus = e21[24]), 33554432 & n11[0] && (r11.onBlur = e21[25]), 2 & n11[1] && (r11.onRenderMenu = e21[32]), 67108864 & n11[0] && (r11.onSortModal = e21[26]), 134217728 & n11[0] && (r11.onTransformModal = e21[27]), t10.$set(r11); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(n11) { + e20[47](null), Ra(t10, n11); + } }; + } + function o8(e20) { + var t10, n10, r10, o10, i10, a10 = [r8, n8, t8], s10 = []; + function c10(e21, n11) { + return 32 & n11[0] && (t10 = null), null == t10 && (t10 = !(e21[5] !== Qa.text && "code" !== String(e21[5]))), t10 ? 0 : e21[5] === Qa.table ? 1 : 2; + } + return n10 = c10(e20, [-1, -1]), r10 = s10[n10] = a10[n10](e20), { c: function() { + r10.c(), o10 = _i(); + }, m: function(e21, t11) { + s10[n10].m(e21, t11), ki(e21, o10, t11), i10 = true; + }, p: function(e21, t11) { + var i11 = n10; + (n10 = c10(e21, t11)) === i11 ? s10[n10].p(e21, t11) : (ba(), xa(s10[i11], 1, 1, function() { + s10[i11] = null; + }), ka(), (r10 = s10[n10]) ? r10.p(e21, t11) : (r10 = s10[n10] = a10[n10](e21)).c(), wa(r10, 1), r10.m(o10.parentNode, o10)); + }, i: function(e21) { + i10 || (wa(r10), i10 = true); + }, o: function(e21) { + xa(r10), i10 = false; + }, d: function(e21) { + e21 && wi(o10), s10[n10].d(e21); + } }; + } + function i8(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10, l10 = t10.content, u10 = t10.selection, f10 = t10.readOnly, d10 = t10.indentation, h10 = t10.tabSize, v10 = t10.mode, p10 = t10.mainMenuBar, m10 = t10.navigationBar, g10 = t10.statusBar, y10 = t10.askToFormat, b10 = t10.escapeControlCharacters, k10 = t10.escapeUnicodeCharacters, w10 = t10.flattenColumns, x10 = t10.parser, j10 = t10.parseMemoizeOne, S10 = t10.validator, C10 = t10.validationParser, $10 = t10.pathParser, _10 = t10.insideModal, O10 = t10.onChange, M10 = t10.onChangeMode, E10 = t10.onSelect, A10 = t10.onRenderValue, P10 = t10.onClassName, T8 = t10.onRenderMenu, R8 = t10.onRenderContextMenu, N8 = t10.onError, I10 = t10.onFocus, D10 = t10.onBlur, q10 = t10.onSortModal, z10 = t10.onTransformModal, B10 = t10.onJSONEditorModal, L10 = { type: "separator" }; + function F10() { + return (F10 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (!i10) { + e23.next = 3; + break; + } + return e23.next = 3, i10.refresh(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + return e20.$$set = function(e21) { + "content" in e21 && n10(0, l10 = e21.content), "selection" in e21 && n10(1, u10 = e21.selection), "readOnly" in e21 && n10(2, f10 = e21.readOnly), "indentation" in e21 && n10(3, d10 = e21.indentation), "tabSize" in e21 && n10(4, h10 = e21.tabSize), "mode" in e21 && n10(5, v10 = e21.mode), "mainMenuBar" in e21 && n10(6, p10 = e21.mainMenuBar), "navigationBar" in e21 && n10(7, m10 = e21.navigationBar), "statusBar" in e21 && n10(8, g10 = e21.statusBar), "askToFormat" in e21 && n10(9, y10 = e21.askToFormat), "escapeControlCharacters" in e21 && n10(10, b10 = e21.escapeControlCharacters), "escapeUnicodeCharacters" in e21 && n10(11, k10 = e21.escapeUnicodeCharacters), "flattenColumns" in e21 && n10(12, w10 = e21.flattenColumns), "parser" in e21 && n10(13, x10 = e21.parser), "parseMemoizeOne" in e21 && n10(14, j10 = e21.parseMemoizeOne), "validator" in e21 && n10(15, S10 = e21.validator), "validationParser" in e21 && n10(16, C10 = e21.validationParser), "pathParser" in e21 && n10(17, $10 = e21.pathParser), "insideModal" in e21 && n10(34, _10 = e21.insideModal), "onChange" in e21 && n10(18, O10 = e21.onChange), "onChangeMode" in e21 && n10(19, M10 = e21.onChangeMode), "onSelect" in e21 && n10(20, E10 = e21.onSelect), "onRenderValue" in e21 && n10(21, A10 = e21.onRenderValue), "onClassName" in e21 && n10(22, P10 = e21.onClassName), "onRenderMenu" in e21 && n10(35, T8 = e21.onRenderMenu), "onRenderContextMenu" in e21 && n10(36, R8 = e21.onRenderContextMenu), "onError" in e21 && n10(23, N8 = e21.onError), "onFocus" in e21 && n10(24, I10 = e21.onFocus), "onBlur" in e21 && n10(25, D10 = e21.onBlur), "onSortModal" in e21 && n10(26, q10 = e21.onSortModal), "onTransformModal" in e21 && n10(27, z10 = e21.onTransformModal), "onJSONEditorModal" in e21 && n10(28, B10 = e21.onJSONEditorModal); + }, e20.$$.update = function() { + 524320 & e20.$$.dirty[0] && n10(46, a10 = [{ type: "button", text: "text", title: "Switch to text mode (current mode: ".concat(v10, ")"), className: "jse-group-button jse-first" + (v10 === Qa.text || "code" === v10 ? " jse-selected" : ""), onClick: function() { + return M10(Qa.text); + } }, { type: "button", text: "tree", title: "Switch to tree mode (current mode: ".concat(v10, ")"), className: "jse-group-button " + (v10 === Qa.tree ? " jse-selected" : ""), onClick: function() { + return M10(Qa.tree); + } }, { type: "button", text: "table", title: "Switch to table mode (current mode: ".concat(v10, ")"), className: "jse-group-button jse-last" + (v10 === Qa.table ? " jse-selected" : ""), onClick: function() { + return M10(Qa.table); + } }]), 32 & e20.$$.dirty[0] | 32792 & e20.$$.dirty[1] && n10(32, s10 = function(e21) { + var t11 = rI(e21[0]) ? a10.concat(e21) : a10.concat(L10, e21); + return T8(t11, { mode: v10, modal: _10 }) || t11; + }), 34 & e20.$$.dirty[0] | 40 & e20.$$.dirty[1] && n10(33, c10 = function(e21) { + return R8(e21, { mode: v10, modal: _10, selection: u10 }) || e21; + }); + }, [l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, O10, M10, E10, A10, P10, N8, I10, D10, q10, z10, B10, r10, o10, i10, s10, c10, _10, T8, R8, function(e21) { + if (r10) + return r10.patch(e21); + if (o10) + return o10.patch(e21); + if (i10) + return i10.patch(e21); + throw new Error('Method patch is not available in mode "'.concat(v10, '"')); + }, function(e21) { + if (r10) + return r10.expand(e21); + throw new Error('Method expand is not available in mode "'.concat(v10, '"')); + }, function(e21) { + if (i10) + i10.openTransformModal(e21); + else if (r10) + r10.openTransformModal(e21); + else { + if (!o10) + throw new Error('Method transform is not available in mode "'.concat(v10, '"')); + o10.openTransformModal(e21); + } + }, function() { + if (i10) + return i10.validate(); + if (r10) + return r10.validate(); + if (o10) + return o10.validate(); + throw new Error('Method validate is not available in mode "'.concat(v10, '"')); + }, function() { + return r10 ? r10.acceptAutoRepair() : l10; + }, function(e21) { + if (r10) + return r10.scrollTo(e21); + if (o10) + return o10.scrollTo(e21); + throw new Error('Method scrollTo is not available in mode "'.concat(v10, '"')); + }, function(e21) { + if (r10) + return r10.findElement(e21); + if (o10) + return o10.findElement(e21); + throw new Error('Method findElement is not available in mode "'.concat(v10, '"')); + }, function() { + i10 ? i10.focus() : r10 ? r10.focus() : o10 && o10.focus(); + }, function() { + return F10.apply(this, arguments); + }, a10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(31, i10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(30, o10 = e21); + }); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(29, r10 = e21); + }); + }]; + } + var a8 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, i8, o8, Xo, { content: 0, selection: 1, readOnly: 2, indentation: 3, tabSize: 4, mode: 5, mainMenuBar: 6, navigationBar: 7, statusBar: 8, askToFormat: 9, escapeControlCharacters: 10, escapeUnicodeCharacters: 11, flattenColumns: 12, parser: 13, parseMemoizeOne: 14, validator: 15, validationParser: 16, pathParser: 17, insideModal: 34, onChange: 18, onChangeMode: 19, onSelect: 20, onRenderValue: 21, onClassName: 22, onRenderMenu: 35, onRenderContextMenu: 36, onError: 23, onFocus: 24, onBlur: 25, onSortModal: 26, onTransformModal: 27, onJSONEditorModal: 28, patch: 37, expand: 38, transform: 39, validate: 40, acceptAutoRepair: 41, scrollTo: 42, findElement: 43, focus: 44, refresh: 45 }, null, [-1, -1]), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "patch", get: function() { + return this.$$.ctx[37]; + } }, { key: "expand", get: function() { + return this.$$.ctx[38]; + } }, { key: "transform", get: function() { + return this.$$.ctx[39]; + } }, { key: "validate", get: function() { + return this.$$.ctx[40]; + } }, { key: "acceptAutoRepair", get: function() { + return this.$$.ctx[41]; + } }, { key: "scrollTo", get: function() { + return this.$$.ctx[42]; + } }, { key: "findElement", get: function() { + return this.$$.ctx[43]; + } }, { key: "focus", get: function() { + return this.$$.ctx[44]; + } }, { key: "refresh", get: function() { + return this.$$.ctx[45]; + } }]), t10; + }(); + function s8(e20) { + mi(e20, "svelte-1m3nfgb", '.jse-modal.svelte-1m3nfgb.svelte-1m3nfgb{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-1m3nfgb .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-1m3nfgb .jse-modal-contents.svelte-1m3nfgb{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-1m3nfgb .jse-modal-contents .jse-actions.svelte-1m3nfgb{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-1m3nfgb .jse-modal-contents .jse-actions button.jse-primary.svelte-1m3nfgb{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-1m3nfgb .jse-modal-contents .jse-actions button.jse-primary.svelte-1m3nfgb:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-1m3nfgb .jse-modal-contents .jse-actions button.jse-primary.svelte-1m3nfgb:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;height:auto;min-height:500px;max-height:calc(100vh - 6rem);display:flex}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-modal-contents.svelte-1m3nfgb{padding-top:0}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-modal-contents .jse-label.svelte-1m3nfgb{font-weight:bold;display:block;box-sizing:border-box}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-modal-contents .jse-label .jse-label-inner.svelte-1m3nfgb{margin-top:calc(2 * var(--jse-padding, 10px));margin-bottom:calc(0.5 * var(--jse-padding, 10px));box-sizing:border-box}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-modal-contents .jse-label .jse-label-inner button.svelte-1m3nfgb{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;font-weight:bold;padding:0}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-modal-contents .jse-modal-inline-editor.svelte-1m3nfgb{flex:1;min-height:150px;min-width:0;display:flex;--jse-theme-color:var(--jse-modal-editor-theme-color, var(--jse-modal-theme-color, #707070));--jse-theme-color-highlight:var(--jse-modal-editor-theme-color-highlight, var(--jse-modal-theme-color-highlight, #646464))}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-actions.svelte-1m3nfgb{gap:var(--jse-padding, 10px);align-items:center}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-actions .jse-error.svelte-1m3nfgb{flex:1;color:var(--jse-error-color, #ee5341)}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-actions button.jse-secondary.svelte-1m3nfgb{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-secondary-background, #d3d3d3);color:var(--jse-button-secondary-color, var(--jse-text-color, #4d4d4d));padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-actions button.jse-secondary.svelte-1m3nfgb:hover{background:var(--jse-button-secondary-background-highlight, #e1e1e1)}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb .jse-actions button.jse-secondary.svelte-1m3nfgb:disabled{background:var(--jse-button-secondary-background-disabled, #9d9d9d)}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb input.svelte-1m3nfgb{border:var(--jse-input-border, 1px solid #d8dbdf);outline:none;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding, 10px));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:inherit;background:var(--jse-input-background, var(--jse-background-color, #fff))}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb input.svelte-1m3nfgb:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}.jse-modal.jse-jsoneditor-modal.svelte-1m3nfgb input.svelte-1m3nfgb:read-only{background:var(--jse-input-background-readonly, transparent)}'); + } + function c8(e20) { + var t10, n10; + return { c: function() { + t10 = ji("div"), n10 = Ci(e20[22]), Ai(t10, "class", "jse-error svelte-1m3nfgb"); + }, m: function(e21, r10) { + ki(e21, t10, r10), pi(t10, n10); + }, p: function(e21, t11) { + 4194304 & t11[0] && Ni(n10, e21[22]); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function l8(e20) { + var t10, n10, r10, o10, i10, a10; + return n10 = new jM({ props: { data: nP } }), { c: function() { + t10 = ji("button"), Pa(n10.$$.fragment), r10 = Ci(" Back"), Ai(t10, "type", "button"), Ai(t10, "class", "jse-secondary svelte-1m3nfgb"); + }, m: function(s10, c10) { + ki(s10, t10, c10), Ta(n10, t10, null), pi(t10, r10), o10 = true, i10 || (a10 = Oi(t10, "click", e20[27]), i10 = true); + }, p: Wo, i: function(e21) { + o10 || (wa(n10.$$.fragment, e21), o10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), o10 = false; + }, d: function(e21) { + e21 && wi(t10), Ra(n10), i10 = false, a10(); + } }; + } + function u8(e20) { + var t10, n10, r10; + return { c: function() { + (t10 = ji("button")).textContent = "Close", Ai(t10, "type", "button"), Ai(t10, "class", "jse-primary svelte-1m3nfgb"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = [Oi(t10, "click", e20[27]), ci(h8.call(null, t10))], n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, Qo(r10); + } }; + } + function f8(e20) { + var t10, n10, r10; + return { c: function() { + (t10 = ji("button")).textContent = "Apply", Ai(t10, "type", "button"), Ai(t10, "class", "jse-primary svelte-1m3nfgb"); + }, m: function(o10, i10) { + ki(o10, t10, i10), n10 || (r10 = [Oi(t10, "click", e20[26]), ci(h8.call(null, t10))], n10 = true); + }, p: Wo, d: function(e21) { + e21 && wi(t10), n10 = false, Qo(r10); + } }; + } + function d8(e20) { + var t10, n10, r10, o10, i10, a10, s10, c10, l10, u10, f10, d10, h10, v10, p10, m10, g10, y10, b10; + n10 = new XN({ props: { title: "Edit nested content " + (e20[20].length > 1 ? " (".concat(e20[20].length, ")") : ""), onClose: e20[27] } }); + var k10 = { mode: e20[23].mode, content: e20[23].content, selection: e20[23].selection, readOnly: e20[0], indentation: e20[1], tabSize: e20[2], statusBar: e20[5], askToFormat: e20[6], mainMenuBar: e20[3], navigationBar: e20[4], escapeControlCharacters: e20[7], escapeUnicodeCharacters: e20[8], flattenColumns: e20[9], parser: e20[10], parseMemoizeOne: e20[24], validator: e20[11], validationParser: e20[12], pathParser: e20[13], insideModal: true, onError: e20[31], onChange: e20[28], onChangeMode: e20[30], onSelect: e20[29], onRenderValue: e20[14], onClassName: e20[15], onFocus: LL, onBlur: LL, onRenderMenu: e20[16], onRenderContextMenu: e20[17], onSortModal: e20[18], onTransformModal: e20[19], onJSONEditorModal: e20[32] }; + d10 = new a8({ props: k10 }), e20[37](d10); + var w10 = e20[22] && c8(e20), x10 = e20[20].length > 1 && l8(e20); + function j10(e21, t11) { + return e21[0] ? u8 : f8; + } + var S10 = j10(e20), C10 = S10(e20); + return { c: function() { + t10 = ji("div"), Pa(n10.$$.fragment), r10 = $i(), o10 = ji("div"), (i10 = ji("div")).innerHTML = '
Path
', a10 = $i(), s10 = ji("input"), c10 = $i(), (l10 = ji("div")).innerHTML = '
Contents
', u10 = $i(), f10 = ji("div"), Pa(d10.$$.fragment), h10 = $i(), v10 = ji("div"), w10 && w10.c(), p10 = $i(), x10 && x10.c(), m10 = $i(), C10.c(), Ai(i10, "class", "jse-label svelte-1m3nfgb"), Ai(s10, "class", "jse-path svelte-1m3nfgb"), Ai(s10, "type", "text"), s10.readOnly = true, Ai(s10, "title", "Selected path"), s10.value = e20[25], Ai(l10, "class", "jse-label svelte-1m3nfgb"), Ai(f10, "class", "jse-modal-inline-editor svelte-1m3nfgb"), Ai(v10, "class", "jse-actions svelte-1m3nfgb"), Ai(o10, "class", "jse-modal-contents svelte-1m3nfgb"), Ai(t10, "class", "jse-modal jse-jsoneditor-modal svelte-1m3nfgb"); + }, m: function(k11, j11) { + ki(k11, t10, j11), Ta(n10, t10, null), pi(t10, r10), pi(t10, o10), pi(o10, i10), pi(o10, a10), pi(o10, s10), pi(o10, c10), pi(o10, l10), pi(o10, u10), pi(o10, f10), Ta(d10, f10, null), pi(o10, h10), pi(o10, v10), w10 && w10.m(v10, null), pi(v10, p10), x10 && x10.m(v10, null), pi(v10, m10), C10.m(v10, null), g10 = true, y10 || (b10 = ci(BI.call(null, t10, e20[27])), y10 = true); + }, p: function(e21, t11) { + var r11 = {}; + 1048576 & t11[0] && (r11.title = "Edit nested content " + (e21[20].length > 1 ? " (".concat(e21[20].length, ")") : "")), n10.$set(r11), (!g10 || 33554432 & t11[0] && s10.value !== e21[25]) && (s10.value = e21[25]); + var o11 = {}; + 8388608 & t11[0] && (o11.mode = e21[23].mode), 8388608 & t11[0] && (o11.content = e21[23].content), 8388608 & t11[0] && (o11.selection = e21[23].selection), 1 & t11[0] && (o11.readOnly = e21[0]), 2 & t11[0] && (o11.indentation = e21[1]), 4 & t11[0] && (o11.tabSize = e21[2]), 32 & t11[0] && (o11.statusBar = e21[5]), 64 & t11[0] && (o11.askToFormat = e21[6]), 8 & t11[0] && (o11.mainMenuBar = e21[3]), 16 & t11[0] && (o11.navigationBar = e21[4]), 128 & t11[0] && (o11.escapeControlCharacters = e21[7]), 256 & t11[0] && (o11.escapeUnicodeCharacters = e21[8]), 512 & t11[0] && (o11.flattenColumns = e21[9]), 1024 & t11[0] && (o11.parser = e21[10]), 16777216 & t11[0] && (o11.parseMemoizeOne = e21[24]), 2048 & t11[0] && (o11.validator = e21[11]), 4096 & t11[0] && (o11.validationParser = e21[12]), 8192 & t11[0] && (o11.pathParser = e21[13]), 16384 & t11[0] && (o11.onRenderValue = e21[14]), 32768 & t11[0] && (o11.onClassName = e21[15]), 65536 & t11[0] && (o11.onRenderMenu = e21[16]), 131072 & t11[0] && (o11.onRenderContextMenu = e21[17]), 262144 & t11[0] && (o11.onSortModal = e21[18]), 524288 & t11[0] && (o11.onTransformModal = e21[19]), d10.$set(o11), e21[22] ? w10 ? w10.p(e21, t11) : ((w10 = c8(e21)).c(), w10.m(v10, p10)) : w10 && (w10.d(1), w10 = null), e21[20].length > 1 ? x10 ? (x10.p(e21, t11), 1048576 & t11[0] && wa(x10, 1)) : ((x10 = l8(e21)).c(), wa(x10, 1), x10.m(v10, m10)) : x10 && (ba(), xa(x10, 1, 1, function() { + x10 = null; + }), ka()), S10 === (S10 = j10(e21)) && C10 ? C10.p(e21, t11) : (C10.d(1), (C10 = S10(e21)) && (C10.c(), C10.m(v10, null))); + }, i: function(e21) { + g10 || (wa(n10.$$.fragment, e21), wa(d10.$$.fragment, e21), wa(x10), g10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), xa(d10.$$.fragment, e21), xa(x10), g10 = false; + }, d: function(r11) { + r11 && wi(t10), Ra(n10), e20[37](null), Ra(d10), w10 && w10.d(), x10 && x10.d(), C10.d(), y10 = false, b10(); + } }; + } + function h8(e20) { + e20.focus(); + } + function v8(e20, t10, n10) { + var r10, o10, i10, a10, s10, c10 = Da("jsoneditor:JSONEditorModal"), l10 = t10.content, u10 = t10.path, f10 = t10.onPatch, d10 = t10.readOnly, h10 = t10.indentation, v10 = t10.tabSize, p10 = t10.mainMenuBar, m10 = t10.navigationBar, g10 = t10.statusBar, y10 = t10.askToFormat, b10 = t10.escapeControlCharacters, k10 = t10.escapeUnicodeCharacters, w10 = t10.flattenColumns, x10 = t10.parser, j10 = t10.validator, S10 = t10.validationParser, C10 = t10.pathParser, $10 = t10.onRenderValue, _10 = t10.onClassName, O10 = t10.onRenderMenu, M10 = t10.onRenderContextMenu, E10 = t10.onSortModal, A10 = t10.onTransformModal, P10 = Zi("simple-modal").close, T8 = { mode: I10(l10), content: l10, selection: null, relativePath: u10 }, R8 = [T8], N8 = void 0; + function I10(e21) { + return K_(e21) && Ts(e21.json) ? Qa.table : Qa.tree; + } + function D10() { + var e21, t11 = (null === (e21 = vb(R8)) || void 0 === e21 ? void 0 : e21.selection) || null; + yE(t11) && s10.scrollTo(JE(t11)); + } + return e20.$$set = function(e21) { + "content" in e21 && n10(33, l10 = e21.content), "path" in e21 && n10(34, u10 = e21.path), "onPatch" in e21 && n10(35, f10 = e21.onPatch), "readOnly" in e21 && n10(0, d10 = e21.readOnly), "indentation" in e21 && n10(1, h10 = e21.indentation), "tabSize" in e21 && n10(2, v10 = e21.tabSize), "mainMenuBar" in e21 && n10(3, p10 = e21.mainMenuBar), "navigationBar" in e21 && n10(4, m10 = e21.navigationBar), "statusBar" in e21 && n10(5, g10 = e21.statusBar), "askToFormat" in e21 && n10(6, y10 = e21.askToFormat), "escapeControlCharacters" in e21 && n10(7, b10 = e21.escapeControlCharacters), "escapeUnicodeCharacters" in e21 && n10(8, k10 = e21.escapeUnicodeCharacters), "flattenColumns" in e21 && n10(9, w10 = e21.flattenColumns), "parser" in e21 && n10(10, x10 = e21.parser), "validator" in e21 && n10(11, j10 = e21.validator), "validationParser" in e21 && n10(12, S10 = e21.validationParser), "pathParser" in e21 && n10(13, C10 = e21.pathParser), "onRenderValue" in e21 && n10(14, $10 = e21.onRenderValue), "onClassName" in e21 && n10(15, _10 = e21.onClassName), "onRenderMenu" in e21 && n10(16, O10 = e21.onRenderMenu), "onRenderContextMenu" in e21 && n10(17, M10 = e21.onRenderContextMenu), "onSortModal" in e21 && n10(18, E10 = e21.onSortModal), "onTransformModal" in e21 && n10(19, A10 = e21.onTransformModal); + }, e20.$$.update = function() { + 1048576 & e20.$$.dirty[0] && n10(23, r10 = vb(R8) || T8), 1048576 & e20.$$.dirty[0] && n10(36, o10 = R8.flatMap(function(e21) { + return e21.relativePath; + })), 32 & e20.$$.dirty[1] && n10(25, i10 = _w(o10) ? "(document root)" : JO(o10)), 1024 & e20.$$.dirty[0] && n10(24, a10 = CB(x10.parse)); + }, [d10, h10, v10, p10, m10, g10, y10, b10, k10, w10, x10, j10, S10, C10, $10, _10, O10, M10, E10, A10, R8, s10, N8, r10, a10, i10, function() { + if (c10("handleApply"), !d10) + try { + n10(22, N8 = void 0); + var e21 = r10.relativePath, t11 = r10.content, o11 = [{ op: "replace", path: Zs(e21), value: Q_(t11, x10).json }]; + if (R8.length > 1) { + var i11 = { json: rc(Q_(R8[R8.length - 2].content, x10).json, o11) }, a11 = Ro(Ro({}, R8[R8.length - 2] || T8), {}, { content: i11 }); + n10(20, R8 = [].concat(Bo(R8.slice(0, R8.length - 2)), [a11])), ca().then(D10); + } else + f10(o11), P10(); + } catch (e23) { + n10(22, N8 = String(e23)); + } + }, function() { + c10("handleClose"), R8.length > 1 ? (n10(20, R8 = Qk(R8)), ca().then(D10), n10(22, N8 = void 0)) : P10(); + }, function(e21) { + c10("handleChange", e21); + var t11 = Ro(Ro({}, r10), {}, { content: e21 }); + n10(20, R8 = [].concat(Bo(Qk(R8)), [t11])); + }, function(e21) { + c10("handleChangeSelection", e21); + var t11 = Ro(Ro({}, r10), {}, { selection: e21 }); + n10(20, R8 = [].concat(Bo(Qk(R8)), [t11])); + }, function(e21) { + c10("handleChangeMode", e21); + var t11 = Ro(Ro({}, r10), {}, { mode: e21 }); + n10(20, R8 = [].concat(Bo(Qk(R8)), [t11])); + }, function(e21) { + n10(22, N8 = e21.toString()), console.error(e21); + }, function(e21) { + var t11 = e21.content, r11 = e21.path; + c10("handleJSONEditorModal", { content: t11, path: r11 }); + var o11 = { mode: I10(t11), content: t11, selection: null, relativePath: r11 }; + n10(20, R8 = [].concat(Bo(R8), [o11])); + }, l10, u10, f10, o10, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(21, s10 = e21); + }); + }]; + } + var p8 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, v8, d8, Zo, { content: 33, path: 34, onPatch: 35, readOnly: 0, indentation: 1, tabSize: 2, mainMenuBar: 3, navigationBar: 4, statusBar: 5, askToFormat: 6, escapeControlCharacters: 7, escapeUnicodeCharacters: 8, flattenColumns: 9, parser: 10, validator: 11, validationParser: 12, pathParser: 13, onRenderValue: 14, onClassName: 15, onRenderMenu: 16, onRenderContextMenu: 17, onSortModal: 18, onTransformModal: 19 }, s8, [-1, -1]), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + function m8(e20, t10, n10) { + var r10 = Zi("simple-modal"); + return [r10.open, r10.close]; + } + var g8 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, m8, null, Zo, { open: 0, close: 1 }), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "open", get: function() { + return this.$$.ctx[0]; + } }, { key: "close", get: function() { + return this.$$.ctx[1]; + } }]), t10; + }(); + function y8(e20) { + mi(e20, "svelte-ybuk0j", '.jse-main.svelte-ybuk0j{width:100%;height:100%;min-width:0;min-height:150px;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;position:relative;display:flex;flex-direction:row}'); + } + function b8(e20) { + var t10, n10, r10 = { mode: e20[1], content: e20[0], selection: e20[2], readOnly: e20[3], indentation: e20[4], tabSize: e20[5], statusBar: e20[8], askToFormat: e20[9], mainMenuBar: e20[6], navigationBar: e20[7], escapeControlCharacters: e20[10], escapeUnicodeCharacters: e20[11], flattenColumns: e20[12], parser: e20[13], parseMemoizeOne: e20[27], validator: e20[14], validationParser: e20[15], pathParser: e20[16], insideModal: false, onError: e20[21], onChange: e20[28], onChangeMode: e20[32], onSelect: e20[29], onRenderValue: e20[17], onClassName: e20[18], onFocus: e20[30], onBlur: e20[31], onRenderMenu: e20[19], onRenderContextMenu: e20[20], onSortModal: e20[34], onTransformModal: e20[33], onJSONEditorModal: e20[35] }; + return t10 = new a8({ props: r10 }), e20[62](t10), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r11) { + Ta(t10, e21, r11), n10 = true; + }, p: function(e21, n11) { + var r11 = {}; + 2 & n11[0] && (r11.mode = e21[1]), 1 & n11[0] && (r11.content = e21[0]), 4 & n11[0] && (r11.selection = e21[2]), 8 & n11[0] && (r11.readOnly = e21[3]), 16 & n11[0] && (r11.indentation = e21[4]), 32 & n11[0] && (r11.tabSize = e21[5]), 256 & n11[0] && (r11.statusBar = e21[8]), 512 & n11[0] && (r11.askToFormat = e21[9]), 64 & n11[0] && (r11.mainMenuBar = e21[6]), 128 & n11[0] && (r11.navigationBar = e21[7]), 1024 & n11[0] && (r11.escapeControlCharacters = e21[10]), 2048 & n11[0] && (r11.escapeUnicodeCharacters = e21[11]), 4096 & n11[0] && (r11.flattenColumns = e21[12]), 8192 & n11[0] && (r11.parser = e21[13]), 134217728 & n11[0] && (r11.parseMemoizeOne = e21[27]), 16384 & n11[0] && (r11.validator = e21[14]), 32768 & n11[0] && (r11.validationParser = e21[15]), 65536 & n11[0] && (r11.pathParser = e21[16]), 2097152 & n11[0] && (r11.onError = e21[21]), 131072 & n11[0] && (r11.onRenderValue = e21[17]), 262144 & n11[0] && (r11.onClassName = e21[18]), 524288 & n11[0] && (r11.onRenderMenu = e21[19]), 1048576 & n11[0] && (r11.onRenderContextMenu = e21[20]), t10.$set(r11); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(n11) { + e20[62](null), Ra(t10, n11); + } }; + } + function k8(e20) { + var t10, n10, r10, o10, i10, a10 = e20[22]; + function s10(t11) { + e20[61](t11); + } + var c10 = {}; + void 0 !== e20[25] && (c10.open = e20[25]), t10 = new g8({ props: c10 }), na.push(function() { + return Aa(t10, "open", s10); + }); + var l10 = b8(e20); + return { c: function() { + Pa(t10.$$.fragment), r10 = $i(), o10 = ji("div"), l10.c(), Ai(o10, "class", "jse-main svelte-ybuk0j"), zi(o10, "jse-focus", e20[23]); + }, m: function(e21, n11) { + Ta(t10, e21, n11), ki(e21, r10, n11), ki(e21, o10, n11), l10.m(o10, null), i10 = true; + }, p: function(e21, r11) { + var s11 = {}; + !n10 && 33554432 & r11[0] && (n10 = true, s11.open = e21[25], ua(function() { + return n10 = false; + })), t10.$set(s11), 4194304 & r11[0] && Zo(a10, a10 = e21[22]) ? (ba(), xa(l10, 1, 1, Wo), ka(), (l10 = b8(e21)).c(), wa(l10, 1), l10.m(o10, null)) : l10.p(e21, r11), (!i10 || 8388608 & r11[0]) && zi(o10, "jse-focus", e21[23]); + }, i: function(e21) { + i10 || (wa(t10.$$.fragment, e21), wa(l10), i10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), xa(l10), i10 = false; + }, d: function(e21) { + e21 && (wi(r10), wi(o10)), Ra(t10, e21), l10.d(e21); + } }; + } + function w8(e20) { + var t10, n10; + return t10 = new rs({ props: { closeOnEsc: false, $$slots: { default: [k8] }, $$scope: { ctx: e20 } } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 201326591 & n11[0] | 8 & n11[2] && (r10.$$scope = { dirty: n11, ctx: e21 }), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function x8(e20) { + for (var t10, n10, r10, o10 = [{ show: null === (t10 = e20[26]) || void 0 === t10 ? void 0 : t10.component }, ks, { closeOnEsc: false }], i10 = { $$slots: { default: [w8] }, $$scope: { ctx: e20 } }, a10 = 0; a10 < o10.length; a10 += 1) + i10 = Jo(i10, o10[a10]); + return (n10 = new rs({ props: i10 })).$on("close", e20[36]), { c: function() { + Pa(n10.$$.fragment); + }, m: function(e21, t11) { + Ta(n10, e21, t11), r10 = true; + }, p: function(e21, t11) { + var r11, i11 = 67108864 & t11[0] ? Ma(o10, [{ show: null === (r11 = e21[26]) || void 0 === r11 ? void 0 : r11.component }, o10[1], o10[2]]) : {}; + 201326591 & t11[0] | 8 & t11[2] && (i11.$$scope = { dirty: t11, ctx: e21 }), n10.$set(i11); + }, i: function(e21) { + r10 || (wa(n10.$$.fragment, e21), r10 = true); + }, o: function(e21) { + xa(n10.$$.fragment, e21), r10 = false; + }, d: function(e21) { + Ra(n10, e21); + } }; + } + function j8(e20) { + var t10, n10; + return t10 = new UO({ props: { $$slots: { default: [x8] }, $$scope: { ctx: e20 } } }), { c: function() { + Pa(t10.$$.fragment); + }, m: function(e21, r10) { + Ta(t10, e21, r10), n10 = true; + }, p: function(e21, n11) { + var r10 = {}; + 268435455 & n11[0] | 8 & n11[2] && (r10.$$scope = { dirty: n11, ctx: e21 }), t10.$set(r10); + }, i: function(e21) { + n10 || (wa(t10.$$.fragment, e21), n10 = true); + }, o: function(e21) { + xa(t10.$$.fragment, e21), n10 = false; + }, d: function(e21) { + Ra(t10, e21); + } }; + } + function S8(e20, t10, n10) { + var r10, o10, i10, a10 = Da("jsoneditor:JSONEditor"), s10 = t10.content, c10 = void 0 === s10 ? { text: "" } : s10, l10 = t10.selection, u10 = void 0 === l10 ? null : l10, f10 = t10.readOnly, d10 = void 0 !== f10 && f10, h10 = t10.indentation, v10 = void 0 === h10 ? 2 : h10, p10 = t10.tabSize, m10 = void 0 === p10 ? 4 : p10, g10 = t10.mode, y10 = void 0 === g10 ? Qa.tree : g10, b10 = t10.mainMenuBar, k10 = void 0 === b10 || b10, w10 = t10.navigationBar, x10 = void 0 === w10 || w10, j10 = t10.statusBar, S10 = void 0 === j10 || j10, C10 = t10.askToFormat, $10 = void 0 === C10 || C10, _10 = t10.escapeControlCharacters, O10 = void 0 !== _10 && _10, M10 = t10.escapeUnicodeCharacters, E10 = void 0 !== M10 && M10, A10 = t10.flattenColumns, P10 = void 0 === A10 || A10, T8 = t10.parser, R8 = void 0 === T8 ? JSON : T8, N8 = t10.validator, I10 = void 0 === N8 ? null : N8, D10 = t10.validationParser, q10 = void 0 === D10 ? JSON : D10, z10 = t10.pathParser, B10 = void 0 === z10 ? { parse: KO, stringify: JO } : z10, L10 = t10.queryLanguages, F10 = void 0 === L10 ? [rM] : L10, V10 = t10.queryLanguageId, H10 = void 0 === V10 ? F10[0].id : V10, W10 = t10.onChangeQueryLanguage, U10 = void 0 === W10 ? LL : W10, J10 = t10.onChange, K10 = void 0 === J10 ? null : J10, G10 = t10.onSelect, Q10 = void 0 === G10 ? LL : G10, Y10 = t10.onRenderValue, X10 = void 0 === Y10 ? GA : Y10, Z10 = t10.onClassName, ee2 = void 0 === Z10 ? function() { + } : Z10, te2 = t10.onRenderMenu, ne2 = void 0 === te2 ? LL : te2, re2 = t10.onRenderContextMenu, oe2 = void 0 === re2 ? LL : re2, ie2 = t10.onChangeMode, ae2 = void 0 === ie2 ? LL : ie2, se2 = t10.onError, ce2 = void 0 === se2 ? function(e21) { + console.error(e21), alert(e21.toString()); + } : se2, le2 = t10.onFocus, ue2 = void 0 === le2 ? LL : le2, fe2 = t10.onBlur, de2 = void 0 === fe2 ? LL : fe2, he2 = Ps(), ve2 = false, pe2 = null, me2 = R8; + function ge2() { + return (ge2 = xo(ko().mark(function e21(t11) { + var r11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (a10("set"), !(r11 = W_(t11))) { + e23.next = 4; + break; + } + throw new Error(r11); + case 4: + return n10(22, he2 = Ps()), e23.next = 7, ca(); + case 7: + n10(0, c10 = t11); + case 8: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function ye2() { + return (ye2 = xo(ko().mark(function e21(t11) { + var r11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (a10("update"), !(r11 = W_(t11))) { + e23.next = 4; + break; + } + throw new Error(r11); + case 4: + return n10(0, c10 = t11), e23.next = 7, ca(); + case 7: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function be2() { + return be2 = xo(ko().mark(function e21(t11) { + var r11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (!J_(c10)) { + e23.next = 8; + break; + } + e23.prev = 1, n10(0, c10 = { json: R8.parse(c10.text), text: void 0 }), e23.next = 8; + break; + case 5: + throw e23.prev = 5, e23.t0 = e23.catch(1), new Error("Cannot apply patch: current document contains invalid JSON"); + case 8: + return r11 = o10.patch(t11), e23.next = 11, ca(); + case 11: + return e23.abrupt("return", r11); + case 12: + case "end": + return e23.stop(); + } + }, e21, null, [[1, 5]]); + })), be2.apply(this, arguments); + } + function ke2() { + return (ke2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return n10(2, u10 = t11), e23.next = 3, ca(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function we2() { + return (we2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return o10.expand(t11), e23.next = 3, ca(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function xe2() { + return xe2 = xo(ko().mark(function e21() { + var t11; + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return t11 = o10.acceptAutoRepair(), e23.next = 3, ca(); + case 3: + return e23.abrupt("return", t11); + case 4: + case "end": + return e23.stop(); + } + }, e21); + })), xe2.apply(this, arguments); + } + function je2() { + return (je2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, o10.scrollTo(t11); + case 2: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function Se2() { + return Ce2.apply(this, arguments); + } + function Ce2() { + return (Ce2 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return o10.focus(), e23.next = 3, ca(); + case 3: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function $e2() { + return ($e2 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return e23.next = 2, o10.refresh(); + case 2: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function _e2() { + return (_e2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return this.$set(t11), e23.next = 3, ca(); + case 3: + case "end": + return e23.stop(); + } + }, e21, this); + }))).apply(this, arguments); + } + function Oe2() { + return (Oe2 = xo(ko().mark(function e21() { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + return this.$destroy(), e23.next = 3, ca(); + case 3: + case "end": + return e23.stop(); + } + }, e21, this); + }))).apply(this, arguments); + } + function Me2() { + return (Me2 = xo(ko().mark(function e21(t11) { + return ko().wrap(function(e23) { + for (; ; ) + switch (e23.prev = e23.next) { + case 0: + if (y10 !== t11) { + e23.next = 2; + break; + } + return e23.abrupt("return"); + case 2: + return n10(1, y10 = t11), e23.next = 5, ca(); + case 5: + return e23.next = 7, Se2(); + case 7: + ae2(t11); + case 8: + case "end": + return e23.stop(); + } + }, e21); + }))).apply(this, arguments); + } + function Ee2(e21) { + a10("handleChangeQueryLanguage", e21), n10(37, H10 = e21), U10(e21); + } + function Ae2(e21) { + var t11 = e21.id, n11 = e21.json, o11 = e21.rootPath, a11 = e21.onTransform, s11 = e21.onClose; + d10 || i10(PL, { id: t11, json: n11, rootPath: o11, indentation: v10, escapeControlCharacters: O10, escapeUnicodeCharacters: E10, parser: R8, parseMemoizeOne: r10, validationParser: q10, pathParser: B10, queryLanguages: F10, queryLanguageId: H10, onChangeQueryLanguage: Ee2, onRenderValue: X10, onRenderMenu: ne2, onRenderContextMenu: oe2, onClassName: ee2, onTransform: a11 }, bs, { onClose: s11 }); + } + function Pe2(e21) { + var t11 = e21.id, n11 = e21.json, r11 = e21.rootPath, o11 = e21.onSort, a11 = e21.onClose; + d10 || i10(BL, { id: t11, json: n11, rootPath: r11, onSort: o11 }, ys, { onClose: a11 }); + } + return e20.$$set = function(e21) { + "content" in e21 && n10(0, c10 = e21.content), "selection" in e21 && n10(2, u10 = e21.selection), "readOnly" in e21 && n10(3, d10 = e21.readOnly), "indentation" in e21 && n10(4, v10 = e21.indentation), "tabSize" in e21 && n10(5, m10 = e21.tabSize), "mode" in e21 && n10(1, y10 = e21.mode), "mainMenuBar" in e21 && n10(6, k10 = e21.mainMenuBar), "navigationBar" in e21 && n10(7, x10 = e21.navigationBar), "statusBar" in e21 && n10(8, S10 = e21.statusBar), "askToFormat" in e21 && n10(9, $10 = e21.askToFormat), "escapeControlCharacters" in e21 && n10(10, O10 = e21.escapeControlCharacters), "escapeUnicodeCharacters" in e21 && n10(11, E10 = e21.escapeUnicodeCharacters), "flattenColumns" in e21 && n10(12, P10 = e21.flattenColumns), "parser" in e21 && n10(13, R8 = e21.parser), "validator" in e21 && n10(14, I10 = e21.validator), "validationParser" in e21 && n10(15, q10 = e21.validationParser), "pathParser" in e21 && n10(16, B10 = e21.pathParser), "queryLanguages" in e21 && n10(38, F10 = e21.queryLanguages), "queryLanguageId" in e21 && n10(37, H10 = e21.queryLanguageId), "onChangeQueryLanguage" in e21 && n10(39, U10 = e21.onChangeQueryLanguage), "onChange" in e21 && n10(40, K10 = e21.onChange), "onSelect" in e21 && n10(41, Q10 = e21.onSelect), "onRenderValue" in e21 && n10(17, X10 = e21.onRenderValue), "onClassName" in e21 && n10(18, ee2 = e21.onClassName), "onRenderMenu" in e21 && n10(19, ne2 = e21.onRenderMenu), "onRenderContextMenu" in e21 && n10(20, oe2 = e21.onRenderContextMenu), "onChangeMode" in e21 && n10(42, ae2 = e21.onChangeMode), "onError" in e21 && n10(21, ce2 = e21.onError), "onFocus" in e21 && n10(43, ue2 = e21.onFocus), "onBlur" in e21 && n10(44, de2 = e21.onBlur); + }, e20.$$.update = function() { + if (8193 & e20.$$.dirty[0] | 536870912 & e20.$$.dirty[1] && !rO(R8, me2)) { + if (a10("parser changed, recreate editor"), K_(c10)) { + var t11 = me2.stringify(c10.json); + n10(0, c10 = { json: void 0 !== t11 ? R8.parse(t11) : void 0 }); + } + n10(60, me2 = R8), n10(22, he2 = Ps()); + } + if (1 & e20.$$.dirty[0]) { + var o11 = W_(c10); + o11 && console.error("Error: " + o11); + } + 8192 & e20.$$.dirty[0] && n10(27, r10 = CB(R8.parse)), 2 & e20.$$.dirty[0] && (a10("mode changed to", y10), "code" === y10 && console.warn('Deprecation warning: "code" mode is renamed to "text". Please use mode="text" instead.')); + }, [c10, y10, u10, d10, v10, m10, k10, x10, S10, $10, O10, E10, P10, R8, I10, q10, B10, X10, ee2, ne2, oe2, ce2, he2, ve2, o10, i10, pe2, r10, function(e21, t11, r11) { + n10(0, c10 = e21), K10 && K10(e21, t11, r11); + }, function(e21) { + n10(2, u10 = e21), Q10(e21); + }, function() { + n10(23, ve2 = true), ue2 && ue2(); + }, function() { + n10(23, ve2 = false), de2 && de2(); + }, function(e21) { + return Me2.apply(this, arguments); + }, Ae2, Pe2, function(e21) { + var t11 = e21.content, r11 = e21.path, o11 = e21.onPatch, i11 = e21.onClose; + a10("onJSONEditorModal", { content: t11, path: r11 }), n10(26, pe2 = { component: Ka(p8, { content: t11, path: r11, onPatch: o11, readOnly: d10, indentation: v10, tabSize: m10, mainMenuBar: k10, navigationBar: x10, statusBar: S10, askToFormat: $10, escapeControlCharacters: O10, escapeUnicodeCharacters: E10, flattenColumns: P10, parser: R8, validator: void 0, validationParser: q10, pathParser: B10, onRenderValue: X10, onClassName: ee2, onRenderMenu: ne2, onRenderContextMenu: oe2, onSortModal: Pe2, onTransformModal: Ae2 }), callbacks: { onClose: i11 } }); + }, function() { + var e21, t11; + null === (e21 = pe2) || void 0 === e21 || null === (e21 = e21.callbacks) || void 0 === e21 || null === (t11 = e21.onClose) || void 0 === t11 || t11.call(e21), n10(26, pe2 = null); + }, H10, F10, U10, K10, Q10, ae2, ue2, de2, function() { + return c10; + }, function(e21) { + return ge2.apply(this, arguments); + }, function(e21) { + return ye2.apply(this, arguments); + }, function(e21) { + return be2.apply(this, arguments); + }, function(e21) { + return ke2.apply(this, arguments); + }, function(e21) { + return we2.apply(this, arguments); + }, function(e21) { + o10.transform(e21); + }, function() { + return o10.validate(); + }, function() { + return xe2.apply(this, arguments); + }, function(e21) { + return je2.apply(this, arguments); + }, function(e21) { + return o10.findElement(e21); + }, Se2, function() { + return $e2.apply(this, arguments); + }, function(e21) { + return _e2.apply(this, arguments); + }, function() { + return Oe2.apply(this, arguments); + }, me2, function(e21) { + n10(25, i10 = e21); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(24, o10 = e21); + }); + }]; + } + var C8 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, S8, j8, Zo, { content: 0, selection: 2, readOnly: 3, indentation: 4, tabSize: 5, mode: 1, mainMenuBar: 6, navigationBar: 7, statusBar: 8, askToFormat: 9, escapeControlCharacters: 10, escapeUnicodeCharacters: 11, flattenColumns: 12, parser: 13, validator: 14, validationParser: 15, pathParser: 16, queryLanguages: 38, queryLanguageId: 37, onChangeQueryLanguage: 39, onChange: 40, onSelect: 41, onRenderValue: 17, onClassName: 18, onRenderMenu: 19, onRenderContextMenu: 20, onChangeMode: 42, onError: 21, onFocus: 43, onBlur: 44, get: 45, set: 46, update: 47, patch: 48, select: 49, expand: 50, transform: 51, validate: 52, acceptAutoRepair: 53, scrollTo: 54, findElement: 55, focus: 56, refresh: 57, updateProps: 58, destroy: 59 }, y8, [-1, -1, -1]), n10; + } + return Ao(t10, Ia), Do(t10, [{ key: "get", get: function() { + return this.$$.ctx[45]; + } }, { key: "set", get: function() { + return this.$$.ctx[46]; + } }, { key: "update", get: function() { + return this.$$.ctx[47]; + } }, { key: "patch", get: function() { + return this.$$.ctx[48]; + } }, { key: "select", get: function() { + return this.$$.ctx[49]; + } }, { key: "expand", get: function() { + return this.$$.ctx[50]; + } }, { key: "transform", get: function() { + return this.$$.ctx[51]; + } }, { key: "validate", get: function() { + return this.$$.ctx[52]; + } }, { key: "acceptAutoRepair", get: function() { + return this.$$.ctx[53]; + } }, { key: "scrollTo", get: function() { + return this.$$.ctx[54]; + } }, { key: "findElement", get: function() { + return this.$$.ctx[55]; + } }, { key: "focus", get: function() { + return this.$$.ctx[56]; + } }, { key: "refresh", get: function() { + return this.$$.ctx[57]; + } }, { key: "updateProps", get: function() { + return this.$$.ctx[58]; + } }, { key: "destroy", get: function() { + return this.$$.ctx[59]; + } }]), t10; + }(); + function $8(e20) { + mi(e20, "svelte-9wp3tj", ".jse-value.jse-string.svelte-9wp3tj{color:var(--jse-value-color-string, #008000)}.jse-value.jse-object.svelte-9wp3tj,.jse-value.jse-array.svelte-9wp3tj{min-width:16px;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-value.jse-number.svelte-9wp3tj{color:var(--jse-value-color-number, #ee422e)}.jse-value.jse-boolean.svelte-9wp3tj{color:var(--jse-value-color-boolean, #ff8c00)}.jse-value.jse-null.svelte-9wp3tj{color:var(--jse-value-color-null, #004ed0)}.jse-value.jse-invalid.svelte-9wp3tj{color:var(--jse-text-color, #4d4d4d)}.jse-value.jse-url.svelte-9wp3tj{color:var(--jse-value-color-url, #008000);text-decoration:underline}.jse-enum-value.svelte-9wp3tj{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06));border:none;padding:0;font-family:inherit;font-size:inherit;cursor:pointer;outline:none}.jse-enum-value.jse-selected.svelte-9wp3tj{background:var(--jse-selection-background-color, #d3d3d3);color:inherit}.jse-enum-value.jse-value.svelte-9wp3tj:focus{color:var(--jse-text-color, #4d4d4d)}.jse-json-node.jse-selected .jse-enum-value.svelte-9wp3tj{background:transparent}"); + } + function _8(e20, t10, n10) { + var r10 = e20.slice(); + return r10[13] = t10[n10], r10; + } + function O8(e20) { + var t10, n10, r10, o10 = e20[13].text + ""; + return { c: function() { + t10 = ji("option"), n10 = Ci(o10), t10.__value = r10 = e20[13].value, Ii(t10, t10.__value); + }, m: function(e21, r11) { + ki(e21, t10, r11), pi(t10, n10); + }, p: function(e21, i10) { + 4 & i10 && o10 !== (o10 = e21[13].text + "") && Ni(n10, o10), 4 & i10 && r10 !== (r10 = e21[13].value) && (t10.__value = r10, Ii(t10, t10.__value)); + }, d: function(e21) { + e21 && wi(t10); + } }; + } + function M8(e20) { + for (var t10, n10, r10, o10, i10 = Ca(e20[2]), a10 = [], s10 = 0; s10 < i10.length; s10 += 1) + a10[s10] = O8(_8(e20, i10, s10)); + return { c: function() { + t10 = ji("select"); + for (var r11 = 0; r11 < a10.length; r11 += 1) + a10[r11].c(); + Ai(t10, "class", n10 = si("jse-enum-value ".concat(QE(e20[4], e20[0]))) + " svelte-9wp3tj"), void 0 === e20[4] && la(function() { + return e20[10].call(t10); + }), zi(t10, "jse-selected", pE(e20[1])); + }, m: function(n11, i11) { + ki(n11, t10, i11); + for (var s11 = 0; s11 < a10.length; s11 += 1) + a10[s11] && a10[s11].m(t10, null); + qi(t10, e20[4], true), e20[11](t10), r10 || (o10 = [Oi(t10, "change", e20[10]), Oi(t10, "change", e20[5]), Oi(t10, "mousedown", E8)], r10 = true); + }, p: function(e21, r11) { + var o11 = jo(r11, 1)[0]; + if (4 & o11) { + var s11; + for (i10 = Ca(e21[2]), s11 = 0; s11 < i10.length; s11 += 1) { + var c10 = _8(e21, i10, s11); + a10[s11] ? a10[s11].p(c10, o11) : (a10[s11] = O8(c10), a10[s11].c(), a10[s11].m(t10, null)); + } + for (; s11 < a10.length; s11 += 1) + a10[s11].d(1); + a10.length = i10.length; + } + 17 & o11 && n10 !== (n10 = si("jse-enum-value ".concat(QE(e21[4], e21[0]))) + " svelte-9wp3tj") && Ai(t10, "class", n10), 16 & o11 && qi(t10, e21[4]), 19 & o11 && zi(t10, "jse-selected", pE(e21[1])); + }, i: Wo, o: Wo, d: function(n11) { + n11 && wi(t10), xi(a10, n11), e20[11](null), r10 = false, Qo(o10); + } }; + } + function E8(e20) { + e20.stopPropagation(); + } + function A8(e20, t10, n10) { + var r10, o10 = t10.path, i10 = t10.value, a10 = t10.parser, s10 = t10.readOnly, c10 = t10.selection, l10 = t10.onPatch, u10 = t10.options, f10 = i10; + return e20.$$set = function(e21) { + "path" in e21 && n10(6, o10 = e21.path), "value" in e21 && n10(7, i10 = e21.value), "parser" in e21 && n10(0, a10 = e21.parser), "readOnly" in e21 && n10(8, s10 = e21.readOnly), "selection" in e21 && n10(1, c10 = e21.selection), "onPatch" in e21 && n10(9, l10 = e21.onPatch), "options" in e21 && n10(2, u10 = e21.options); + }, e20.$$.update = function() { + 128 & e20.$$.dirty && n10(4, f10 = i10), 2 & e20.$$.dirty && function(e21) { + e21 && r10 && r10.focus(); + }(c10); + }, [a10, c10, u10, r10, f10, function(e21) { + e21.stopPropagation(), s10 || l10([{ op: "replace", path: Zs(o10), value: f10 }]); + }, o10, i10, s10, l10, function() { + var e21; + e21 = this.querySelector(":checked"), f10 = e21 && e21.__value, n10(4, f10), n10(7, i10); + }, function(e21) { + na[e21 ? "unshift" : "push"](function() { + n10(3, r10 = e21), n10(2, u10); + }); + }]; + } + var P8 = function(e20) { + function t10(e21) { + var n10; + return No(this, t10), Na(Eo(n10 = _o(this, t10)), e21, A8, M8, Zo, { path: 6, value: 7, parser: 0, readOnly: 8, selection: 1, onPatch: 9, options: 2 }, $8), n10; + } + return Ao(t10, Ia), Do(t10); + }(); + var I8; + var D8 = { exports: {} }; + var q8 = {}; + var z8 = {}; + var B8 = {}; + var L8 = {}; + var F8 = {}; + var V8 = {}; + function H8() { + return I8 || (I8 = 1, function(n10) { + Object.defineProperty(n10, "__esModule", { value: true }), n10.regexpCode = n10.getEsmExportName = n10.getProperty = n10.safeStringify = n10.stringify = n10.strConcat = n10.addCodeArg = n10.str = n10._ = n10.nil = n10._Code = n10.Name = n10.IDENTIFIER = n10._CodeOrName = void 0; + var r10 = Do(function e20() { + No(this, e20); + }); + n10._CodeOrName = r10, n10.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; + var o10 = function(e20) { + function t10(e21) { + var r11; + if (No(this, t10), r11 = _o(this, t10), !n10.IDENTIFIER.test(e21)) + throw new Error("CodeGen: name must be a valid identifier"); + return r11.str = e21, r11; + } + return Ao(t10, e20), Do(t10, [{ key: "toString", value: function() { + return this.str; + } }, { key: "emptyStr", value: function() { + return false; + } }, { key: "names", get: function() { + return qo({}, this.str, 1); + } }]), t10; + }(r10); + n10.Name = o10; + var i10 = function(e20) { + function t10(e21) { + var n11; + return No(this, t10), (n11 = _o(this, t10))._items = "string" == typeof e21 ? [e21] : e21, n11; + } + return Ao(t10, e20), Do(t10, [{ key: "toString", value: function() { + return this.str; + } }, { key: "emptyStr", value: function() { + if (this._items.length > 1) + return false; + var e21 = this._items[0]; + return "" === e21 || '""' === e21; + } }, { key: "str", get: function() { + var e21; + return null !== (e21 = this._str) && void 0 !== e21 ? e21 : this._str = this._items.reduce(function(e23, t11) { + return "".concat(e23).concat(t11); + }, ""); + } }, { key: "names", get: function() { + var e21; + return null !== (e21 = this._names) && void 0 !== e21 ? e21 : this._names = this._items.reduce(function(e23, t11) { + return t11 instanceof o10 && (e23[t11.str] = (e23[t11.str] || 0) + 1), e23; + }, {}); + } }]), t10; + }(r10); + function a10(e20) { + for (var t10 = [e20[0]], n11 = 0, r11 = arguments.length, o11 = new Array(r11 > 1 ? r11 - 1 : 0), a11 = 1; a11 < r11; a11++) + o11[a11 - 1] = arguments[a11]; + for (; n11 < o11.length; ) + l10(t10, o11[n11]), t10.push(e20[++n11]); + return new i10(t10); + } + n10._Code = i10, n10.nil = new i10(""), n10._ = a10; + var s10 = new i10("+"); + function c10(e20) { + for (var t10 = [f10(e20[0])], n11 = 0, r11 = arguments.length, o11 = new Array(r11 > 1 ? r11 - 1 : 0), a11 = 1; a11 < r11; a11++) + o11[a11 - 1] = arguments[a11]; + for (; n11 < o11.length; ) + t10.push(s10), l10(t10, o11[n11]), t10.push(s10, f10(e20[++n11])); + return function(e21) { + var t11 = 1; + for (; t11 < e21.length - 1; ) { + if (e21[t11] === s10) { + var n12 = u10(e21[t11 - 1], e21[t11 + 1]); + if (void 0 !== n12) { + e21.splice(t11 - 1, 3, n12); + continue; + } + e21[t11++] = "+"; + } + t11++; + } + }(t10), new i10(t10); + } + function l10(e20, t10) { + var n11; + t10 instanceof i10 ? e20.push.apply(e20, Bo(t10._items)) : t10 instanceof o10 ? e20.push(t10) : e20.push("number" == typeof (n11 = t10) || "boolean" == typeof n11 || null === n11 ? n11 : f10(Array.isArray(n11) ? n11.join(",") : n11)); + } + function u10(e20, t10) { + if ('""' === t10) + return e20; + if ('""' === e20) + return t10; + if ("string" == typeof e20) { + if (t10 instanceof o10 || '"' !== e20[e20.length - 1]) + return; + return "string" != typeof t10 ? "".concat(e20.slice(0, -1)).concat(t10, '"') : '"' === t10[0] ? e20.slice(0, -1) + t10.slice(1) : void 0; + } + return "string" != typeof t10 || '"' !== t10[0] || e20 instanceof o10 ? void 0 : '"'.concat(e20).concat(t10.slice(1)); + } + function f10(e20) { + return JSON.stringify(e20).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); + } + n10.str = c10, n10.addCodeArg = l10, n10.strConcat = function(t10, n11) { + return n11.emptyStr() ? t10 : t10.emptyStr() ? n11 : c10(e || (e = mo(["", "", ""])), t10, n11); + }, n10.stringify = function(e20) { + return new i10(f10(e20)); + }, n10.safeStringify = f10, n10.getProperty = function(e20) { + return "string" == typeof e20 && n10.IDENTIFIER.test(e20) ? new i10(".".concat(e20)) : a10(t || (t = mo(["[", "]"])), e20); + }, n10.getEsmExportName = function(e20) { + if ("string" == typeof e20 && n10.IDENTIFIER.test(e20)) + return new i10("".concat(e20)); + throw new Error("CodeGen: invalid export name: ".concat(e20, ", use explicit $id name mapping")); + }, n10.regexpCode = function(e20) { + return new i10(e20.toString()); + }; + }(V8)), V8; + } + var W8; + var U8; + var J8 = {}; + function K8() { + return W8 || (W8 = 1, function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.ValueScope = e20.ValueScopeName = e20.Scope = e20.varKinds = e20.UsedValueState = void 0; + var t10, s10 = H8(), c10 = function(e21) { + function t11(e23) { + var n10; + return No(this, t11), (n10 = _o(this, t11, ['CodeGen: "code" for '.concat(e23, " not defined")])).value = e23.value, n10; + } + return Ao(t11, $o(Error)), Do(t11); + }(); + !function(e21) { + e21[e21.Started = 0] = "Started", e21[e21.Completed = 1] = "Completed"; + }(t10 = e20.UsedValueState || (e20.UsedValueState = {})), e20.varKinds = { const: new s10.Name("const"), let: new s10.Name("let"), var: new s10.Name("var") }; + var l10 = function() { + function e21() { + var t11 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n10 = t11.prefixes, r10 = t11.parent; + No(this, e21), this._names = {}, this._prefixes = n10, this._parent = r10; + } + return Do(e21, [{ key: "toName", value: function(e23) { + return e23 instanceof s10.Name ? e23 : this.name(e23); + } }, { key: "name", value: function(e23) { + return new s10.Name(this._newName(e23)); + } }, { key: "_newName", value: function(e23) { + var t11 = this._names[e23] || this._nameGroup(e23); + return "".concat(e23).concat(t11.index++); + } }, { key: "_nameGroup", value: function(e23) { + var t11, n10; + if ((null === (n10 = null === (t11 = this._parent) || void 0 === t11 ? void 0 : t11._prefixes) || void 0 === n10 ? void 0 : n10.has(e23)) || this._prefixes && !this._prefixes.has(e23)) + throw new Error('CodeGen: prefix "'.concat(e23, '" is not allowed in this scope')); + return this._names[e23] = { prefix: e23, index: 0 }; + } }]), e21; + }(); + e20.Scope = l10; + var u10 = function(e21) { + function t11(e23, n10) { + var r10; + return No(this, t11), (r10 = _o(this, t11, [n10])).prefix = e23, r10; + } + return Ao(t11, e21), Do(t11, [{ key: "setValue", value: function(e23, t12) { + var r10 = t12.property, o10 = t12.itemIndex; + this.value = e23, this.scopePath = (0, s10._)(n || (n = mo([".", "[", "]"])), new s10.Name(r10), o10); + } }]), t11; + }(s10.Name); + e20.ValueScopeName = u10; + var f10 = (0, s10._)(r || (r = mo(["\n"], ["\\n"]))), d10 = function(n10) { + function r10(e21) { + var t11; + return No(this, r10), (t11 = _o(this, r10, [e21]))._values = {}, t11._scope = e21.scope, t11.opts = Ro(Ro({}, e21), {}, { _n: e21.lines ? f10 : s10.nil }), t11; + } + return Ao(r10, n10), Do(r10, [{ key: "get", value: function() { + return this._scope; + } }, { key: "name", value: function(e21) { + return new u10(e21, this._newName(e21)); + } }, { key: "value", value: function(e21, t11) { + var n11; + if (void 0 === t11.ref) + throw new Error("CodeGen: ref must be passed in value"); + var r11 = this.toName(e21), o10 = r11.prefix, i10 = null !== (n11 = t11.key) && void 0 !== n11 ? n11 : t11.ref, a10 = this._values[o10]; + if (a10) { + var s11 = a10.get(i10); + if (s11) + return s11; + } else + a10 = this._values[o10] = /* @__PURE__ */ new Map(); + a10.set(i10, r11); + var c11 = this._scope[o10] || (this._scope[o10] = []), l11 = c11.length; + return c11[l11] = t11.ref, r11.setValue(t11, { property: o10, itemIndex: l11 }), r11; + } }, { key: "getValue", value: function(e21, t11) { + var n11 = this._values[e21]; + if (n11) + return n11.get(t11); + } }, { key: "scopeRefs", value: function(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._values; + return this._reduceValues(t11, function(t12) { + if (void 0 === t12.scopePath) + throw new Error('CodeGen: name "'.concat(t12, '" has no value')); + return (0, s10._)(o || (o = mo(["", "", ""])), e21, t12.scopePath); + }); + } }, { key: "scopeCode", value: function() { + var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this._values, t11 = arguments.length > 1 ? arguments[1] : void 0, n11 = arguments.length > 2 ? arguments[2] : void 0; + return this._reduceValues(e21, function(e23) { + if (void 0 === e23.value) + throw new Error('CodeGen: name "'.concat(e23, '" has no value')); + return e23.value.code; + }, t11, n11); + } }, { key: "_reduceValues", value: function(n11, r11) { + var o10 = this, l11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, u11 = arguments.length > 3 ? arguments[3] : void 0, f11 = s10.nil, d11 = function() { + var d12 = n11[h10]; + if (!d12) + return 1; + var v10 = l11[h10] = l11[h10] || /* @__PURE__ */ new Map(); + d12.forEach(function(n12) { + if (!v10.has(n12)) { + v10.set(n12, t10.Started); + var l12 = r11(n12); + if (l12) { + var d13 = o10.opts.es5 ? e20.varKinds.var : e20.varKinds.const; + f11 = (0, s10._)(i || (i = mo(["", "", " ", " = ", ";", ""])), f11, d13, n12, l12, o10.opts._n); + } else { + if (!(l12 = null == u11 ? void 0 : u11(n12))) + throw new c10(n12); + f11 = (0, s10._)(a || (a = mo(["", "", "", ""])), f11, l12, o10.opts._n); + } + v10.set(n12, t10.Completed); + } + }); + }; + for (var h10 in n11) + d11(); + return f11; + } }]), r10; + }(l10); + e20.ValueScope = d10; + }(J8)), J8; + } + function G8() { + return U8 || (U8 = 1, function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.or = e20.and = e20.not = e20.CodeGen = e20.operators = e20.varKinds = e20.ValueScopeName = e20.ValueScope = e20.Scope = e20.Name = e20.regexpCode = e20.stringify = e20.getProperty = e20.nil = e20.strConcat = e20.str = e20._ = void 0; + var t10 = H8(), n10 = K8(), r10 = H8(); + Object.defineProperty(e20, "_", { enumerable: true, get: function() { + return r10._; + } }), Object.defineProperty(e20, "str", { enumerable: true, get: function() { + return r10.str; + } }), Object.defineProperty(e20, "strConcat", { enumerable: true, get: function() { + return r10.strConcat; + } }), Object.defineProperty(e20, "nil", { enumerable: true, get: function() { + return r10.nil; + } }), Object.defineProperty(e20, "getProperty", { enumerable: true, get: function() { + return r10.getProperty; + } }), Object.defineProperty(e20, "stringify", { enumerable: true, get: function() { + return r10.stringify; + } }), Object.defineProperty(e20, "regexpCode", { enumerable: true, get: function() { + return r10.regexpCode; + } }), Object.defineProperty(e20, "Name", { enumerable: true, get: function() { + return r10.Name; + } }); + var o10 = K8(); + Object.defineProperty(e20, "Scope", { enumerable: true, get: function() { + return o10.Scope; + } }), Object.defineProperty(e20, "ValueScope", { enumerable: true, get: function() { + return o10.ValueScope; + } }), Object.defineProperty(e20, "ValueScopeName", { enumerable: true, get: function() { + return o10.ValueScopeName; + } }), Object.defineProperty(e20, "varKinds", { enumerable: true, get: function() { + return o10.varKinds; + } }), e20.operators = { GT: new t10._Code(">"), GTE: new t10._Code(">="), LT: new t10._Code("<"), LTE: new t10._Code("<="), EQ: new t10._Code("==="), NEQ: new t10._Code("!=="), NOT: new t10._Code("!"), OR: new t10._Code("||"), AND: new t10._Code("&&"), ADD: new t10._Code("+") }; + var i10 = function() { + function e21() { + No(this, e21); + } + return Do(e21, [{ key: "optimizeNodes", value: function() { + return this; + } }, { key: "optimizeNames", value: function(e23, t11) { + return this; + } }]), e21; + }(), a10 = function(e21) { + function r11(e23, t11, n11) { + var o11; + return No(this, r11), (o11 = _o(this, r11)).varKind = e23, o11.name = t11, o11.rhs = n11, o11; + } + return Ao(r11, e21), Do(r11, [{ key: "render", value: function(e23) { + var t11 = e23.es5, r12 = e23._n, o11 = t11 ? n10.varKinds.var : this.varKind, i11 = void 0 === this.rhs ? "" : " = ".concat(this.rhs); + return "".concat(o11, " ").concat(this.name).concat(i11, ";") + r12; + } }, { key: "optimizeNames", value: function(e23, t11) { + if (e23[this.name.str]) + return this.rhs && (this.rhs = I10(this.rhs, e23, t11)), this; + } }, { key: "names", get: function() { + return this.rhs instanceof t10._CodeOrName ? this.rhs.names : {}; + } }]), r11; + }(i10), h10 = function(e21) { + function n11(e23, t11, r11) { + var o11; + return No(this, n11), (o11 = _o(this, n11)).lhs = e23, o11.rhs = t11, o11.sideEffects = r11, o11; + } + return Ao(n11, e21), Do(n11, [{ key: "render", value: function(e23) { + var t11 = e23._n; + return "".concat(this.lhs, " = ").concat(this.rhs, ";") + t11; + } }, { key: "optimizeNames", value: function(e23, n12) { + if (!(this.lhs instanceof t10.Name) || e23[this.lhs.str] || this.sideEffects) + return this.rhs = I10(this.rhs, e23, n12), this; + } }, { key: "names", get: function() { + return N8(this.lhs instanceof t10.Name ? {} : Ro({}, this.lhs.names), this.rhs); + } }]), n11; + }(i10), v10 = function(e21) { + function t11(e23, n11, r11, o11) { + var i11; + return No(this, t11), (i11 = _o(this, t11, [e23, r11, o11])).op = n11, i11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var t12 = e23._n; + return "".concat(this.lhs, " ").concat(this.op, "= ").concat(this.rhs, ";") + t12; + } }]), t11; + }(h10), p10 = function(e21) { + function t11(e23) { + var n11; + return No(this, t11), (n11 = _o(this, t11)).label = e23, n11.names = {}, n11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var t12 = e23._n; + return "".concat(this.label, ":") + t12; + } }]), t11; + }(i10), m10 = function(e21) { + function t11(e23) { + var n11; + return No(this, t11), (n11 = _o(this, t11)).label = e23, n11.names = {}, n11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var t12 = e23._n, n11 = this.label ? " ".concat(this.label) : ""; + return "break".concat(n11, ";") + t12; + } }]), t11; + }(i10), g10 = function(e21) { + function t11(e23) { + var n11; + return No(this, t11), (n11 = _o(this, t11)).error = e23, n11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var t12 = e23._n; + return "throw ".concat(this.error, ";") + t12; + } }, { key: "names", get: function() { + return this.error.names; + } }]), t11; + }(i10), y10 = function(e21) { + function n11(e23) { + var t11; + return No(this, n11), (t11 = _o(this, n11)).code = e23, t11; + } + return Ao(n11, e21), Do(n11, [{ key: "render", value: function(e23) { + var t11 = e23._n; + return "".concat(this.code, ";") + t11; + } }, { key: "optimizeNodes", value: function() { + return "".concat(this.code) ? this : void 0; + } }, { key: "optimizeNames", value: function(e23, t11) { + return this.code = I10(this.code, e23, t11), this; + } }, { key: "names", get: function() { + return this.code instanceof t10._CodeOrName ? this.code.names : {}; + } }]), n11; + }(i10), b10 = function(e21) { + function t11() { + var e23, n11 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; + return No(this, t11), (e23 = _o(this, t11)).nodes = n11, e23; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return this.nodes.reduce(function(t12, n11) { + return t12 + n11.render(e23); + }, ""); + } }, { key: "optimizeNodes", value: function() { + for (var e23 = this.nodes, t12 = e23.length; t12--; ) { + var n11 = e23[t12].optimizeNodes(); + Array.isArray(n11) ? e23.splice.apply(e23, [t12, 1].concat(Bo(n11))) : n11 ? e23[t12] = n11 : e23.splice(t12, 1); + } + return e23.length > 0 ? this : void 0; + } }, { key: "optimizeNames", value: function(e23, t12) { + for (var n11 = this.nodes, r11 = n11.length; r11--; ) { + var o11 = n11[r11]; + o11.optimizeNames(e23, t12) || (D10(e23, o11.names), n11.splice(r11, 1)); + } + return n11.length > 0 ? this : void 0; + } }, { key: "names", get: function() { + return this.nodes.reduce(function(e23, t12) { + return R8(e23, t12.names); + }, {}); + } }]), t11; + }(i10), k10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return "{" + e23._n + go(Mo(t11.prototype), "render", this).call(this, e23) + "}" + e23._n; + } }]), t11; + }(b10), w10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11); + }(b10), x10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11); + }(k10); + x10.kind = "else"; + var j10 = function(e21) { + function t11(e23, n11) { + var r11; + return No(this, t11), (r11 = _o(this, t11, [n11])).condition = e23, r11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var n11 = "if(".concat(this.condition, ")") + go(Mo(t11.prototype), "render", this).call(this, e23); + return this.else && (n11 += "else " + this.else.render(e23)), n11; + } }, { key: "optimizeNodes", value: function() { + go(Mo(t11.prototype), "optimizeNodes", this).call(this); + var e23 = this.condition; + if (true === e23) + return this.nodes; + var n11 = this.else; + if (n11) { + var r11 = n11.optimizeNodes(); + n11 = this.else = Array.isArray(r11) ? new x10(r11) : r11; + } + return n11 ? false === e23 ? n11 instanceof t11 ? n11 : n11.nodes : this.nodes.length ? this : new t11(q10(e23), n11 instanceof t11 ? [n11] : n11.nodes) : false !== e23 && this.nodes.length ? this : void 0; + } }, { key: "optimizeNames", value: function(e23, n11) { + var r11; + if (this.else = null === (r11 = this.else) || void 0 === r11 ? void 0 : r11.optimizeNames(e23, n11), go(Mo(t11.prototype), "optimizeNames", this).call(this, e23, n11) || this.else) + return this.condition = I10(this.condition, e23, n11), this; + } }, { key: "names", get: function() { + var e23 = go(Mo(t11.prototype), "names", this); + return N8(e23, this.condition), this.else && R8(e23, this.else.names), e23; + } }]), t11; + }(k10); + j10.kind = "if"; + var S10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11); + }(k10); + S10.kind = "for"; + var C10 = function(e21) { + function t11(e23) { + var n11; + return No(this, t11), (n11 = _o(this, t11)).iteration = e23, n11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return "for(".concat(this.iteration, ")") + go(Mo(t11.prototype), "render", this).call(this, e23); + } }, { key: "optimizeNames", value: function(e23, n11) { + if (go(Mo(t11.prototype), "optimizeNames", this).call(this, e23, n11)) + return this.iteration = I10(this.iteration, e23, n11), this; + } }, { key: "names", get: function() { + return R8(go(Mo(t11.prototype), "names", this), this.iteration.names); + } }]), t11; + }(S10), $10 = function(e21) { + function t11(e23, n11, r11, o11) { + var i11; + return No(this, t11), (i11 = _o(this, t11)).varKind = e23, i11.name = n11, i11.from = r11, i11.to = o11, i11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var r11 = e23.es5 ? n10.varKinds.var : this.varKind, o11 = this.name, i11 = this.from, a11 = this.to; + return "for(".concat(r11, " ").concat(o11, "=").concat(i11, "; ").concat(o11, "<").concat(a11, "; ").concat(o11, "++)") + go(Mo(t11.prototype), "render", this).call(this, e23); + } }, { key: "names", get: function() { + var e23 = N8(go(Mo(t11.prototype), "names", this), this.from); + return N8(e23, this.to); + } }]), t11; + }(S10), _10 = function(e21) { + function t11(e23, n11, r11, o11) { + var i11; + return No(this, t11), (i11 = _o(this, t11)).loop = e23, i11.varKind = n11, i11.name = r11, i11.iterable = o11, i11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return "for(".concat(this.varKind, " ").concat(this.name, " ").concat(this.loop, " ").concat(this.iterable, ")") + go(Mo(t11.prototype), "render", this).call(this, e23); + } }, { key: "optimizeNames", value: function(e23, n11) { + if (go(Mo(t11.prototype), "optimizeNames", this).call(this, e23, n11)) + return this.iterable = I10(this.iterable, e23, n11), this; + } }, { key: "names", get: function() { + return R8(go(Mo(t11.prototype), "names", this), this.iterable.names); + } }]), t11; + }(S10), O10 = function(e21) { + function t11(e23, n11, r11) { + var o11; + return No(this, t11), (o11 = _o(this, t11)).name = e23, o11.args = n11, o11.async = r11, o11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var n11 = this.async ? "async " : ""; + return "".concat(n11, "function ").concat(this.name, "(").concat(this.args, ")") + go(Mo(t11.prototype), "render", this).call(this, e23); + } }]), t11; + }(k10); + O10.kind = "func"; + var M10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return "return " + go(Mo(t11.prototype), "render", this).call(this, e23); + } }]), t11; + }(b10); + M10.kind = "return"; + var E10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + var n11 = "try" + go(Mo(t11.prototype), "render", this).call(this, e23); + return this.catch && (n11 += this.catch.render(e23)), this.finally && (n11 += this.finally.render(e23)), n11; + } }, { key: "optimizeNodes", value: function() { + var e23, n11; + return go(Mo(t11.prototype), "optimizeNodes", this).call(this), null === (e23 = this.catch) || void 0 === e23 || e23.optimizeNodes(), null === (n11 = this.finally) || void 0 === n11 || n11.optimizeNodes(), this; + } }, { key: "optimizeNames", value: function(e23, n11) { + var r11, o11; + return go(Mo(t11.prototype), "optimizeNames", this).call(this, e23, n11), null === (r11 = this.catch) || void 0 === r11 || r11.optimizeNames(e23, n11), null === (o11 = this.finally) || void 0 === o11 || o11.optimizeNames(e23, n11), this; + } }, { key: "names", get: function() { + var e23 = go(Mo(t11.prototype), "names", this); + return this.catch && R8(e23, this.catch.names), this.finally && R8(e23, this.finally.names), e23; + } }]), t11; + }(k10), A10 = function(e21) { + function t11(e23) { + var n11; + return No(this, t11), (n11 = _o(this, t11)).error = e23, n11; + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return "catch(".concat(this.error, ")") + go(Mo(t11.prototype), "render", this).call(this, e23); + } }]), t11; + }(k10); + A10.kind = "catch"; + var P10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11, [{ key: "render", value: function(e23) { + return "finally" + go(Mo(t11.prototype), "render", this).call(this, e23); + } }]), t11; + }(k10); + P10.kind = "finally"; + var T8 = function() { + function r11(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + No(this, r11), this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = Ro(Ro({}, t11), {}, { _n: t11.lines ? "\n" : "" }), this._extScope = e21, this._scope = new n10.Scope({ parent: e21 }), this._nodes = [new w10()]; + } + return Do(r11, [{ key: "toString", value: function() { + return this._root.render(this.opts); + } }, { key: "name", value: function(e21) { + return this._scope.name(e21); + } }, { key: "scopeName", value: function(e21) { + return this._extScope.name(e21); + } }, { key: "scopeValue", value: function(e21, t11) { + var n11 = this._extScope.value(e21, t11); + return (this._values[n11.prefix] || (this._values[n11.prefix] = /* @__PURE__ */ new Set())).add(n11), n11; + } }, { key: "getScopeValue", value: function(e21, t11) { + return this._extScope.getValue(e21, t11); + } }, { key: "scopeRefs", value: function(e21) { + return this._extScope.scopeRefs(e21, this._values); + } }, { key: "scopeCode", value: function() { + return this._extScope.scopeCode(this._values); + } }, { key: "_def", value: function(e21, t11, n11, r12) { + var o11 = this._scope.toName(t11); + return void 0 !== n11 && r12 && (this._constants[o11.str] = n11), this._leafNode(new a10(e21, o11, n11)), o11; + } }, { key: "const", value: function(e21, t11, r12) { + return this._def(n10.varKinds.const, e21, t11, r12); + } }, { key: "let", value: function(e21, t11, r12) { + return this._def(n10.varKinds.let, e21, t11, r12); + } }, { key: "var", value: function(e21, t11, r12) { + return this._def(n10.varKinds.var, e21, t11, r12); + } }, { key: "assign", value: function(e21, t11, n11) { + return this._leafNode(new h10(e21, t11, n11)); + } }, { key: "add", value: function(t11, n11) { + return this._leafNode(new v10(t11, e20.operators.ADD, n11)); + } }, { key: "code", value: function(e21) { + return "function" == typeof e21 ? e21() : e21 !== t10.nil && this._leafNode(new y10(e21)), this; + } }, { key: "object", value: function() { + for (var e21 = ["{"], n11 = arguments.length, r12 = new Array(n11), o11 = 0; o11 < n11; o11++) + r12[o11] = arguments[o11]; + for (var i11 = 0, a11 = r12; i11 < a11.length; i11++) { + var s10 = jo(a11[i11], 2), c10 = s10[0], l10 = s10[1]; + e21.length > 1 && e21.push(","), e21.push(c10), (c10 !== l10 || this.opts.es5) && (e21.push(":"), (0, t10.addCodeArg)(e21, l10)); + } + return e21.push("}"), new t10._Code(e21); + } }, { key: "if", value: function(e21, t11, n11) { + if (this._blockNode(new j10(e21)), t11 && n11) + this.code(t11).else().code(n11).endIf(); + else if (t11) + this.code(t11).endIf(); + else if (n11) + throw new Error('CodeGen: "else" body without "then" body'); + return this; + } }, { key: "elseIf", value: function(e21) { + return this._elseNode(new j10(e21)); + } }, { key: "else", value: function() { + return this._elseNode(new x10()); + } }, { key: "endIf", value: function() { + return this._endBlockNode(j10, x10); + } }, { key: "_for", value: function(e21, t11) { + return this._blockNode(e21), t11 && this.code(t11).endFor(), this; + } }, { key: "for", value: function(e21, t11) { + return this._for(new C10(e21), t11); + } }, { key: "forRange", value: function(e21, t11, r12, o11) { + var i11 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.opts.es5 ? n10.varKinds.var : n10.varKinds.let, a11 = this._scope.toName(e21); + return this._for(new $10(i11, a11, t11, r12), function() { + return o11(a11); + }); + } }, { key: "forOf", value: function(e21, r12, o11) { + var i11 = this, a11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : n10.varKinds.const, l10 = this._scope.toName(e21); + if (this.opts.es5) { + var u10 = r12 instanceof t10.Name ? r12 : this.var("_arr", r12); + return this.forRange("_i", 0, (0, t10._)(s || (s = mo(["", ".length"])), u10), function(e23) { + i11.var(l10, (0, t10._)(c || (c = mo(["", "[", "]"])), u10, e23)), o11(l10); + }); + } + return this._for(new _10("of", a11, l10, r12), function() { + return o11(l10); + }); + } }, { key: "forIn", value: function(e21, r12, o11) { + var i11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : this.opts.es5 ? n10.varKinds.var : n10.varKinds.const; + if (this.opts.ownProperties) + return this.forOf(e21, (0, t10._)(l || (l = mo(["Object.keys(", ")"])), r12), o11); + var a11 = this._scope.toName(e21); + return this._for(new _10("in", i11, a11, r12), function() { + return o11(a11); + }); + } }, { key: "endFor", value: function() { + return this._endBlockNode(S10); + } }, { key: "label", value: function(e21) { + return this._leafNode(new p10(e21)); + } }, { key: "break", value: function(e21) { + return this._leafNode(new m10(e21)); + } }, { key: "return", value: function(e21) { + var t11 = new M10(); + if (this._blockNode(t11), this.code(e21), 1 !== t11.nodes.length) + throw new Error('CodeGen: "return" should have one node'); + return this._endBlockNode(M10); + } }, { key: "try", value: function(e21, t11, n11) { + if (!t11 && !n11) + throw new Error('CodeGen: "try" without "catch" and "finally"'); + var r12 = new E10(); + if (this._blockNode(r12), this.code(e21), t11) { + var o11 = this.name("e"); + this._currNode = r12.catch = new A10(o11), t11(o11); + } + return n11 && (this._currNode = r12.finally = new P10(), this.code(n11)), this._endBlockNode(A10, P10); + } }, { key: "throw", value: function(e21) { + return this._leafNode(new g10(e21)); + } }, { key: "block", value: function(e21, t11) { + return this._blockStarts.push(this._nodes.length), e21 && this.code(e21).endBlock(t11), this; + } }, { key: "endBlock", value: function(e21) { + var t11 = this._blockStarts.pop(); + if (void 0 === t11) + throw new Error("CodeGen: not in self-balancing block"); + var n11 = this._nodes.length - t11; + if (n11 < 0 || void 0 !== e21 && n11 !== e21) + throw new Error("CodeGen: wrong number of nodes: ".concat(n11, " vs ").concat(e21, " expected")); + return this._nodes.length = t11, this; + } }, { key: "func", value: function(e21) { + var n11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t10.nil, r12 = arguments.length > 2 ? arguments[2] : void 0, o11 = arguments.length > 3 ? arguments[3] : void 0; + return this._blockNode(new O10(e21, n11, r12)), o11 && this.code(o11).endFunc(), this; + } }, { key: "endFunc", value: function() { + return this._endBlockNode(O10); + } }, { key: "optimize", value: function() { + for (var e21 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1; e21-- > 0; ) + this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants); + } }, { key: "_leafNode", value: function(e21) { + return this._currNode.nodes.push(e21), this; + } }, { key: "_blockNode", value: function(e21) { + this._currNode.nodes.push(e21), this._nodes.push(e21); + } }, { key: "_endBlockNode", value: function(e21, t11) { + var n11 = this._currNode; + if (n11 instanceof e21 || t11 && n11 instanceof t11) + return this._nodes.pop(), this; + throw new Error('CodeGen: not in block "'.concat(t11 ? "".concat(e21.kind, "/").concat(t11.kind) : e21.kind, '"')); + } }, { key: "_elseNode", value: function(e21) { + var t11 = this._currNode; + if (!(t11 instanceof j10)) + throw new Error('CodeGen: "else" without "if"'); + return this._currNode = t11.else = e21, this; + } }, { key: "_root", get: function() { + return this._nodes[0]; + } }, { key: "_currNode", get: function() { + var e21 = this._nodes; + return e21[e21.length - 1]; + }, set: function(e21) { + var t11 = this._nodes; + t11[t11.length - 1] = e21; + } }]), r11; + }(); + function R8(e21, t11) { + for (var n11 in t11) + e21[n11] = (e21[n11] || 0) + (t11[n11] || 0); + return e21; + } + function N8(e21, n11) { + return n11 instanceof t10._CodeOrName ? R8(e21, n11.names) : e21; + } + function I10(e21, n11, r11) { + return e21 instanceof t10.Name ? i11(e21) : (o11 = e21) instanceof t10._Code && o11._items.some(function(e23) { + return e23 instanceof t10.Name && 1 === n11[e23.str] && void 0 !== r11[e23.str]; + }) ? new t10._Code(e21._items.reduce(function(e23, n12) { + return n12 instanceof t10.Name && (n12 = i11(n12)), n12 instanceof t10._Code ? e23.push.apply(e23, Bo(n12._items)) : e23.push(n12), e23; + }, [])) : e21; + var o11; + function i11(e23) { + var t11 = r11[e23.str]; + return void 0 === t11 || 1 !== n11[e23.str] ? e23 : (delete n11[e23.str], t11); + } + } + function D10(e21, t11) { + for (var n11 in t11) + e21[n11] = (e21[n11] || 0) - (t11[n11] || 0); + } + function q10(e21) { + return "boolean" == typeof e21 || "number" == typeof e21 || null === e21 ? !e21 : (0, t10._)(u || (u = mo(["!", ""])), F10(e21)); + } + e20.CodeGen = T8, e20.not = q10; + var z10 = L10(e20.operators.AND); + e20.and = function() { + for (var e21 = arguments.length, t11 = new Array(e21), n11 = 0; n11 < e21; n11++) + t11[n11] = arguments[n11]; + return t11.reduce(z10); + }; + var B10 = L10(e20.operators.OR); + function L10(e21) { + return function(n11, r11) { + return n11 === t10.nil ? r11 : r11 === t10.nil ? n11 : (0, t10._)(f || (f = mo(["", " ", " ", ""])), F10(n11), e21, F10(r11)); + }; + } + function F10(e21) { + return e21 instanceof t10.Name ? e21 : (0, t10._)(d || (d = mo(["(", ")"])), e21); + } + e20.or = function() { + for (var e21 = arguments.length, t11 = new Array(e21), n11 = 0; n11 < e21; n11++) + t11[n11] = arguments[n11]; + return t11.reduce(B10); + }; + }(F8)), F8; + } + var Q8 = {}; + !function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.checkStrictMode = e20.getErrorPath = e20.Type = e20.useFunc = e20.setEvaluated = e20.evaluatedPropsToName = e20.mergeEvaluated = e20.eachItem = e20.unescapeJsonPointer = e20.escapeJsonPointer = e20.escapeFragment = e20.unescapeFragment = e20.schemaRefOrVal = e20.schemaHasRulesButRef = e20.schemaHasRules = e20.checkUnknownRules = e20.alwaysValidSchema = e20.toHash = void 0; + var t10 = G8(), n10 = H8(); + function r10(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21.schema, n11 = e21.opts, r11 = e21.self; + if (n11.strictSchema && "boolean" != typeof t11) { + var o11 = r11.RULES.keywords; + for (var i11 in t11) + o11[i11] || d10(e21, 'unknown keyword: "'.concat(i11, '"')); + } + } + function o10(e21, t11) { + if ("boolean" == typeof e21) + return !e21; + for (var n11 in e21) + if (t11[n11]) + return true; + return false; + } + function i10(e21) { + return "number" == typeof e21 ? "".concat(e21) : e21.replace(/~/g, "~0").replace(/\//g, "~1"); + } + function a10(e21) { + return e21.replace(/~1/g, "/").replace(/~0/g, "~"); + } + function s10(e21) { + var n11 = e21.mergeNames, r11 = e21.mergeToName, o11 = e21.mergeValues, i11 = e21.resultToName; + return function(e23, a11, s11, c11) { + var l11 = void 0 === s11 ? a11 : s11 instanceof t10.Name ? (a11 instanceof t10.Name ? n11(e23, a11, s11) : r11(e23, a11, s11), s11) : a11 instanceof t10.Name ? (r11(e23, s11, a11), a11) : o11(a11, s11); + return c11 !== t10.Name || l11 instanceof t10.Name ? l11 : i11(e23, l11); + }; + } + function c10(e21, n11) { + if (true === n11) + return e21.var("props", true); + var r11 = e21.var("props", (0, t10._)(C || (C = mo(["{}"])))); + return void 0 !== n11 && l10(e21, r11, n11), r11; + } + function l10(e21, n11, r11) { + Object.keys(r11).forEach(function(r12) { + return e21.assign((0, t10._)($ || ($ = mo(["", "", ""])), n11, (0, t10.getProperty)(r12)), true); + }); + } + e20.toHash = function(e21) { + var t11, n11 = {}, r11 = bo(e21); + try { + for (r11.s(); !(t11 = r11.n()).done; ) { + n11[t11.value] = true; + } + } catch (e23) { + r11.e(e23); + } finally { + r11.f(); + } + return n11; + }, e20.alwaysValidSchema = function(e21, t11) { + return "boolean" == typeof t11 ? t11 : 0 === Object.keys(t11).length || (r10(e21, t11), !o10(t11, e21.self.RULES.all)); + }, e20.checkUnknownRules = r10, e20.schemaHasRules = o10, e20.schemaHasRulesButRef = function(e21, t11) { + if ("boolean" == typeof e21) + return !e21; + for (var n11 in e21) + if ("$ref" !== n11 && t11.all[n11]) + return true; + return false; + }, e20.schemaRefOrVal = function(e21, n11, r11, o11) { + var i11 = e21.topSchemaRef, a11 = e21.schemaPath; + if (!o11) { + if ("number" == typeof n11 || "boolean" == typeof n11) + return n11; + if ("string" == typeof n11) + return (0, t10._)(h || (h = mo(["", ""])), n11); + } + return (0, t10._)(v || (v = mo(["", "", "", ""])), i11, a11, (0, t10.getProperty)(r11)); + }, e20.unescapeFragment = function(e21) { + return a10(decodeURIComponent(e21)); + }, e20.escapeFragment = function(e21) { + return encodeURIComponent(i10(e21)); + }, e20.escapeJsonPointer = i10, e20.unescapeJsonPointer = a10, e20.eachItem = function(e21, t11) { + if (Array.isArray(e21)) { + var n11, r11 = bo(e21); + try { + for (r11.s(); !(n11 = r11.n()).done; ) { + t11(n11.value); + } + } catch (e23) { + r11.e(e23); + } finally { + r11.f(); + } + } else + t11(e21); + }, e20.mergeEvaluated = { props: s10({ mergeNames: function(e21, n11, r11) { + return e21.if((0, t10._)(p || (p = mo(["", " !== true && ", " !== undefined"])), r11, n11), function() { + e21.if((0, t10._)(m || (m = mo(["", " === true"])), n11), function() { + return e21.assign(r11, true); + }, function() { + return e21.assign(r11, (0, t10._)(g || (g = mo(["", " || {}"])), r11)).code((0, t10._)(y || (y = mo(["Object.assign(", ", ", ")"])), r11, n11)); + }); + }); + }, mergeToName: function(e21, n11, r11) { + return e21.if((0, t10._)(b || (b = mo(["", " !== true"])), r11), function() { + true === n11 ? e21.assign(r11, true) : (e21.assign(r11, (0, t10._)(k || (k = mo(["", " || {}"])), r11)), l10(e21, r11, n11)); + }); + }, mergeValues: function(e21, t11) { + return true === e21 || Ro(Ro({}, e21), t11); + }, resultToName: c10 }), items: s10({ mergeNames: function(e21, n11, r11) { + return e21.if((0, t10._)(w || (w = mo(["", " !== true && ", " !== undefined"])), r11, n11), function() { + return e21.assign(r11, (0, t10._)(x || (x = mo(["", " === true ? true : ", " > ", " ? ", " : ", ""])), n11, r11, n11, r11, n11)); + }); + }, mergeToName: function(e21, n11, r11) { + return e21.if((0, t10._)(j || (j = mo(["", " !== true"])), r11), function() { + return e21.assign(r11, true === n11 || (0, t10._)(S || (S = mo(["", " > ", " ? ", " : ", ""])), r11, n11, r11, n11)); + }); + }, mergeValues: function(e21, t11) { + return true === e21 || Math.max(e21, t11); + }, resultToName: function(e21, t11) { + return e21.var("items", t11); + } }) }, e20.evaluatedPropsToName = c10, e20.setEvaluated = l10; + var u10, f10 = {}; + function d10(e21, t11) { + var n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e21.opts.strictSchema; + if (n11) { + if (t11 = "strict mode: ".concat(t11), true === n11) + throw new Error(t11); + e21.self.logger.warn(t11); + } + } + e20.useFunc = function(e21, t11) { + return e21.scopeValue("func", { ref: t11, code: f10[t11.code] || (f10[t11.code] = new n10._Code(t11.code)) }); + }, function(e21) { + e21[e21.Num = 0] = "Num", e21[e21.Str = 1] = "Str"; + }(u10 = e20.Type || (e20.Type = {})), e20.getErrorPath = function(e21, n11, r11) { + if (e21 instanceof t10.Name) { + var o11 = n11 === u10.Num; + return r11 ? o11 ? (0, t10._)(_ || (_ = mo(['"[" + ', ' + "]"'])), e21) : (0, t10._)(O || (O = mo([`"['" + `, ` + "']"`])), e21) : o11 ? (0, t10._)(M || (M = mo(['"/" + ', ""])), e21) : (0, t10._)(E || (E = mo(['"/" + ', '.replace(/~/g, "~0").replace(/\\//g, "~1")'], ['"/" + ', '.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])), e21); + } + return r11 ? (0, t10.getProperty)(e21).toString() : "/" + i10(e21); + }, e20.checkStrictMode = d10; + }(Q8); + var Y8; + var X8; + var Z8; + var e52 = {}; + function t5() { + if (Y8) + return e52; + Y8 = 1, Object.defineProperty(e52, "__esModule", { value: true }); + var e20 = G8(), t10 = { data: new e20.Name("data"), valCxt: new e20.Name("valCxt"), instancePath: new e20.Name("instancePath"), parentData: new e20.Name("parentData"), parentDataProperty: new e20.Name("parentDataProperty"), rootData: new e20.Name("rootData"), dynamicAnchors: new e20.Name("dynamicAnchors"), vErrors: new e20.Name("vErrors"), errors: new e20.Name("errors"), this: new e20.Name("this"), self: new e20.Name("self"), scope: new e20.Name("scope"), json: new e20.Name("json"), jsonPos: new e20.Name("jsonPos"), jsonLen: new e20.Name("jsonLen"), jsonPart: new e20.Name("jsonPart") }; + return e52.default = t10, e52; + } + function n5() { + return X8 || (X8 = 1, function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.extendErrors = e20.resetErrorsCount = e20.reportExtraError = e20.reportError = e20.keyword$DataError = e20.keywordError = void 0; + var t10 = G8(), n10 = Q8, r10 = t5(); + function o10(e21, n11) { + var o11 = e21.const("err", n11); + e21.if((0, t10._)(H || (H = mo(["", " === null"])), r10.default.vErrors), function() { + return e21.assign(r10.default.vErrors, (0, t10._)(W || (W = mo(["[", "]"])), o11)); + }, (0, t10._)(U || (U = mo(["", ".push(", ")"])), r10.default.vErrors, o11)), e21.code((0, t10._)(J || (J = mo(["", "++"])), r10.default.errors)); + } + function i10(e21, n11) { + var r11 = e21.gen, o11 = e21.validateName; + e21.schemaEnv.$async ? r11.throw((0, t10._)(K || (K = mo(["new ", "(", ")"])), e21.ValidationError, n11)) : (r11.assign((0, t10._)(G || (G = mo(["", ".errors"])), o11), n11), r11.return(false)); + } + e20.keywordError = { message: function(e21) { + var n11 = e21.keyword; + return (0, t10.str)(A || (A = mo(['must pass "', '" keyword validation'])), n11); + } }, e20.keyword$DataError = { message: function(e21) { + var n11 = e21.keyword, r11 = e21.schemaType; + return r11 ? (0, t10.str)(P || (P = mo(['"', '" keyword must be ', " ($data)"])), n11, r11) : (0, t10.str)(T || (T = mo(['"', '" keyword is invalid ($data)'])), n11); + } }, e20.reportError = function(n11) { + var r11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e20.keywordError, a11 = arguments.length > 2 ? arguments[2] : void 0, c11 = arguments.length > 3 ? arguments[3] : void 0, l11 = n11.it, u10 = l11.gen, f10 = l11.compositeRule, d10 = l11.allErrors, h10 = s10(n11, r11, a11); + (null != c11 ? c11 : f10 || d10) ? o10(u10, h10) : i10(l11, (0, t10._)(R || (R = mo(["[", "]"])), h10)); + }, e20.reportExtraError = function(t11) { + var n11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e20.keywordError, a11 = arguments.length > 2 ? arguments[2] : void 0, c11 = t11.it, l11 = c11.gen, u10 = c11.compositeRule, f10 = c11.allErrors; + o10(l11, s10(t11, n11, a11)), u10 || f10 || i10(c11, r10.default.vErrors); + }, e20.resetErrorsCount = function(e21, n11) { + e21.assign(r10.default.errors, n11), e21.if((0, t10._)(N || (N = mo(["", " !== null"])), r10.default.vErrors), function() { + return e21.if(n11, function() { + return e21.assign((0, t10._)(I || (I = mo(["", ".length"])), r10.default.vErrors), n11); + }, function() { + return e21.assign(r10.default.vErrors, null); + }); + }); + }, e20.extendErrors = function(e21) { + var n11 = e21.gen, o11 = e21.keyword, i11 = e21.schemaValue, a11 = e21.data, s11 = e21.errsCount, c11 = e21.it; + if (void 0 === s11) + throw new Error("ajv implementation error"); + var l11 = n11.name("err"); + n11.forRange("i", s11, r10.default.errors, function(e23) { + n11.const(l11, (0, t10._)(D || (D = mo(["", "[", "]"])), r10.default.vErrors, e23)), n11.if((0, t10._)(q || (q = mo(["", ".instancePath === undefined"])), l11), function() { + return n11.assign((0, t10._)(z || (z = mo(["", ".instancePath"])), l11), (0, t10.strConcat)(r10.default.instancePath, c11.errorPath)); + }), n11.assign((0, t10._)(B || (B = mo(["", ".schemaPath"])), l11), (0, t10.str)(L || (L = mo(["", "/", ""])), c11.errSchemaPath, o11)), c11.opts.verbose && (n11.assign((0, t10._)(F || (F = mo(["", ".schema"])), l11), i11), n11.assign((0, t10._)(V || (V = mo(["", ".data"])), l11), a11)); + }); + }; + var a10 = { keyword: new t10.Name("keyword"), schemaPath: new t10.Name("schemaPath"), params: new t10.Name("params"), propertyName: new t10.Name("propertyName"), message: new t10.Name("message"), schema: new t10.Name("schema"), parentSchema: new t10.Name("parentSchema") }; + function s10(e21, n11, o11) { + return false === e21.it.createErrors ? (0, t10._)(Q || (Q = mo(["{}"]))) : function(e23, n12) { + var o12 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i11 = e23.gen, s11 = e23.it, u10 = [c10(s11, o12), l10(e23, o12)]; + return function(e24, n13, o13) { + var i12 = n13.params, s12 = n13.message, c11 = e24.keyword, l11 = e24.data, u11 = e24.schemaValue, f10 = e24.it, d10 = f10.opts, h10 = f10.propertyName, v10 = f10.topSchemaRef, p10 = f10.schemaPath; + o13.push([a10.keyword, c11], [a10.params, "function" == typeof i12 ? i12(e24) : i12 || (0, t10._)(ee || (ee = mo(["{}"])))]), d10.messages && o13.push([a10.message, "function" == typeof s12 ? s12(e24) : s12]); + d10.verbose && o13.push([a10.schema, u11], [a10.parentSchema, (0, t10._)(te || (te = mo(["", "", ""])), v10, p10)], [r10.default.data, l11]); + h10 && o13.push([a10.propertyName, h10]); + }(e23, n12, u10), i11.object.apply(i11, u10); + }(e21, n11, o11); + } + function c10(e21, o11) { + var i11 = e21.errorPath, a11 = o11.instancePath, s11 = a11 ? (0, t10.str)(Y || (Y = mo(["", "", ""])), i11, (0, n10.getErrorPath)(a11, n10.Type.Str)) : i11; + return [r10.default.instancePath, (0, t10.strConcat)(r10.default.instancePath, s11)]; + } + function l10(e21, r11) { + var o11 = e21.keyword, i11 = e21.it.errSchemaPath, s11 = r11.schemaPath, c11 = r11.parentSchema ? i11 : (0, t10.str)(X || (X = mo(["", "/", ""])), i11, o11); + return s11 && (c11 = (0, t10.str)(Z || (Z = mo(["", "", ""])), c11, (0, n10.getErrorPath)(s11, n10.Type.Str))), [a10.schemaPath, c11]; + } + }(L8)), L8; + } + var r5 = {}; + var o5 = {}; + Object.defineProperty(o5, "__esModule", { value: true }), o5.getRules = o5.isJSONType = void 0; + var i5 = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null", "object", "array"]); + o5.isJSONType = function(e20) { + return "string" == typeof e20 && i5.has(e20); + }, o5.getRules = function() { + var e20 = { number: { type: "number", rules: [] }, string: { type: "string", rules: [] }, array: { type: "array", rules: [] }, object: { type: "object", rules: [] } }; + return { types: Ro(Ro({}, e20), {}, { integer: true, boolean: true, null: true }), rules: [{ rules: [] }, e20.number, e20.string, e20.array, e20.object], post: { rules: [] }, all: {}, keywords: {} }; + }; + var a5; + var s5 = {}; + function c5() { + if (a5) + return s5; + function e20(e21, n10) { + return n10.rules.some(function(n11) { + return t10(e21, n11); + }); + } + function t10(e21, t11) { + var n10; + return void 0 !== e21[t11.keyword] || (null === (n10 = t11.definition.implements) || void 0 === n10 ? void 0 : n10.some(function(t12) { + return void 0 !== e21[t12]; + })); + } + return a5 = 1, Object.defineProperty(s5, "__esModule", { value: true }), s5.shouldUseRule = s5.shouldUseGroup = s5.schemaHasRulesForType = void 0, s5.schemaHasRulesForType = function(t11, n10) { + var r10 = t11.schema, o10 = t11.self.RULES.types[n10]; + return o10 && true !== o10 && e20(r10, o10); + }, s5.shouldUseGroup = e20, s5.shouldUseRule = t10, s5; + } + !function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.reportTypeError = e20.checkDataTypes = e20.checkDataType = e20.coerceAndCheckDataType = e20.getJSONTypes = e20.getSchemaTypes = e20.DataType = void 0; + var t10, n10 = o5, r10 = c5(), o10 = n5(), i10 = G8(), a10 = Q8; + function s10(e21) { + var t11 = Array.isArray(e21) ? e21 : e21 ? [e21] : []; + if (t11.every(n10.isJSONType)) + return t11; + throw new Error("type must be JSONType or JSONType[]: " + t11.join(",")); + } + !function(e21) { + e21[e21.Correct = 0] = "Correct", e21[e21.Wrong = 1] = "Wrong"; + }(t10 = e20.DataType || (e20.DataType = {})), e20.getSchemaTypes = function(e21) { + var t11 = s10(e21.type); + if (t11.includes("null")) { + if (false === e21.nullable) + throw new Error("type: null contradicts nullable: false"); + } else { + if (!t11.length && void 0 !== e21.nullable) + throw new Error('"nullable" cannot be used without "type"'); + true === e21.nullable && t11.push("null"); + } + return t11; + }, e20.getJSONTypes = s10, e20.coerceAndCheckDataType = function(e21, n11) { + var o11 = e21.gen, a11 = e21.data, s11 = e21.opts, l11 = function(e23, t11) { + return t11 ? e23.filter(function(e24) { + return c10.has(e24) || "array" === t11 && "array" === e24; + }) : []; + }(n11, s11.coerceTypes), f11 = n11.length > 0 && !(0 === l11.length && 1 === n11.length && (0, r10.schemaHasRulesForType)(e21, n11[0])); + if (f11) { + var h10 = u10(n11, a11, s11.strictNumbers, t10.Wrong); + o11.if(h10, function() { + l11.length ? function(e23, t11, n12) { + var r11 = e23.gen, o12 = e23.data, a12 = e23.opts, s12 = r11.let("dataType", (0, i10._)(re || (re = mo(["typeof ", ""])), o12)), l12 = r11.let("coerced", (0, i10._)(oe || (oe = mo(["undefined"])))); + "array" === a12.coerceTypes && r11.if((0, i10._)(ie || (ie = mo(["", " == 'object' && Array.isArray(", ") && ", ".length == 1"])), s12, o12, o12), function() { + return r11.assign(o12, (0, i10._)(ae || (ae = mo(["", "[0]"])), o12)).assign(s12, (0, i10._)(se || (se = mo(["typeof ", ""])), o12)).if(u10(t11, o12, a12.strictNumbers), function() { + return r11.assign(l12, o12); + }); + }); + r11.if((0, i10._)(ce || (ce = mo(["", " !== undefined"])), l12)); + var f12, h11 = bo(n12); + try { + for (h11.s(); !(f12 = h11.n()).done; ) { + var v10 = f12.value; + (c10.has(v10) || "array" === v10 && "array" === a12.coerceTypes) && p10(v10); + } + } catch (e24) { + h11.e(e24); + } finally { + h11.f(); + } + function p10(e24) { + switch (e24) { + case "string": + return void r11.elseIf((0, i10._)(ue || (ue = mo(["", ' == "number" || ', ' == "boolean"'])), s12, s12)).assign(l12, (0, i10._)(fe || (fe = mo(['"" + ', ""])), o12)).elseIf((0, i10._)(de || (de = mo(["", " === null"])), o12)).assign(l12, (0, i10._)(he || (he = mo(['""'])))); + case "number": + return void r11.elseIf((0, i10._)(ve || (ve = mo(["", ' == "boolean" || ', " === null\n || (", ' == "string" && ', " && ", " == +", ")"])), s12, o12, s12, o12, o12, o12)).assign(l12, (0, i10._)(pe || (pe = mo(["+", ""])), o12)); + case "integer": + return void r11.elseIf((0, i10._)(me || (me = mo(["", ' === "boolean" || ', " === null\n || (", ' === "string" && ', " && ", " == +", " && !(", " % 1))"])), s12, o12, s12, o12, o12, o12, o12)).assign(l12, (0, i10._)(ge || (ge = mo(["+", ""])), o12)); + case "boolean": + return void r11.elseIf((0, i10._)(ye || (ye = mo(["", ' === "false" || ', " === 0 || ", " === null"])), o12, o12, o12)).assign(l12, false).elseIf((0, i10._)(be || (be = mo(["", ' === "true" || ', " === 1"])), o12, o12)).assign(l12, true); + case "null": + return r11.elseIf((0, i10._)(ke || (ke = mo(["", ' === "" || ', " === 0 || ", " === false"])), o12, o12, o12)), void r11.assign(l12, null); + case "array": + r11.elseIf((0, i10._)(we || (we = mo(["", ' === "string" || ', ' === "number"\n || ', ' === "boolean" || ', " === null"])), s12, s12, s12, o12)).assign(l12, (0, i10._)(xe || (xe = mo(["[", "]"])), o12)); + } + } + r11.else(), d10(e23), r11.endIf(), r11.if((0, i10._)(le || (le = mo(["", " !== undefined"])), l12), function() { + r11.assign(o12, l12), function(e24, t12) { + var n13 = e24.gen, r12 = e24.parentData, o13 = e24.parentDataProperty; + n13.if((0, i10._)(je || (je = mo(["", " !== undefined"])), r12), function() { + return n13.assign((0, i10._)(Se || (Se = mo(["", "[", "]"])), r12, o13), t12); + }); + }(e23, l12); + }); + }(e21, n11, l11) : d10(e21); + }); + } + return f11; + }; + var c10 = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); + function l10(e21, n11, r11) { + var o11, a11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : t10.Correct, s11 = a11 === t10.Correct ? i10.operators.EQ : i10.operators.NEQ; + switch (e21) { + case "null": + return (0, i10._)(Ce || (Ce = mo(["", " ", " null"])), n11, s11); + case "array": + o11 = (0, i10._)($e || ($e = mo(["Array.isArray(", ")"])), n11); + break; + case "object": + o11 = (0, i10._)(_e || (_e = mo(["", " && typeof ", ' == "object" && !Array.isArray(', ")"])), n11, n11, n11); + break; + case "integer": + o11 = c11((0, i10._)(Oe || (Oe = mo(["!(", " % 1) && !isNaN(", ")"])), n11, n11)); + break; + case "number": + o11 = c11(); + break; + default: + return (0, i10._)(Me || (Me = mo(["typeof ", " ", " ", ""])), n11, s11, e21); + } + return a11 === t10.Correct ? o11 : (0, i10.not)(o11); + function c11() { + var e23 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : i10.nil; + return (0, i10.and)((0, i10._)(Ee || (Ee = mo(["typeof ", ' == "number"'])), n11), e23, r11 ? (0, i10._)(Ae || (Ae = mo(["isFinite(", ")"])), n11) : i10.nil); + } + } + function u10(e21, t11, n11, r11) { + if (1 === e21.length) + return l10(e21[0], t11, n11, r11); + var o11, s11 = (0, a10.toHash)(e21); + if (s11.array && s11.object) { + var c11 = (0, i10._)(Pe || (Pe = mo(["typeof ", ' != "object"'])), t11); + o11 = s11.null ? c11 : (0, i10._)(Te || (Te = mo(["!", " || ", ""])), t11, c11), delete s11.null, delete s11.array, delete s11.object; + } else + o11 = i10.nil; + for (var u11 in s11.number && delete s11.integer, s11) + o11 = (0, i10.and)(o11, l10(u11, t11, n11, r11)); + return o11; + } + e20.checkDataType = l10, e20.checkDataTypes = u10; + var f10 = { message: function(e21) { + var t11 = e21.schema; + return "must be ".concat(t11); + }, params: function(e21) { + var t11 = e21.schema, n11 = e21.schemaValue; + return "string" == typeof t11 ? (0, i10._)(Re || (Re = mo(["{type: ", "}"])), t11) : (0, i10._)(Ne || (Ne = mo(["{type: ", "}"])), n11); + } }; + function d10(e21) { + var t11 = function(e23) { + var t12 = e23.gen, n11 = e23.data, r11 = e23.schema, o11 = (0, a10.schemaRefOrVal)(e23, r11, "type"); + return { gen: t12, keyword: "type", data: n11, schema: r11.type, schemaCode: o11, schemaValue: o11, parentSchema: r11, params: {}, it: e23 }; + }(e21); + (0, o10.reportError)(t11, f10); + } + e20.reportTypeError = d10; + }(r5); + var l5; + var u5 = {}; + var f5; + var d5; + var h5 = {}; + var v5 = {}; + function p5() { + if (f5) + return v5; + f5 = 1, Object.defineProperty(v5, "__esModule", { value: true }), v5.validateUnion = v5.validateArray = v5.usePattern = v5.callValidateCode = v5.schemaProperties = v5.allSchemaProperties = v5.noPropertyInData = v5.propertyInData = v5.isOwnProperty = v5.hasPropFunc = v5.reportMissingProp = v5.checkMissingProp = v5.checkReportMissingProp = void 0; + var e20 = G8(), t10 = Q8, n10 = t5(), r10 = Q8; + function o10(t11) { + return t11.scopeValue("func", { ref: Object.prototype.hasOwnProperty, code: (0, e20._)(Fe || (Fe = mo(["Object.prototype.hasOwnProperty"]))) }); + } + function i10(t11, n11, r11) { + return (0, e20._)(Ve || (Ve = mo(["", ".call(", ", ", ")"])), o10(t11), n11, r11); + } + function a10(t11, n11, r11, o11) { + var a11 = (0, e20._)(Ue || (Ue = mo(["", "", " === undefined"])), n11, (0, e20.getProperty)(r11)); + return o11 ? (0, e20.or)(a11, (0, e20.not)(i10(t11, n11, r11))) : a11; + } + function s10(e21) { + return e21 ? Object.keys(e21).filter(function(e23) { + return "__proto__" !== e23; + }) : []; + } + v5.checkReportMissingProp = function(t11, n11) { + var r11 = t11.gen, o11 = t11.data, i11 = t11.it; + r11.if(a10(r11, o11, n11, i11.opts.ownProperties), function() { + t11.setParams({ missingProperty: (0, e20._)(Be || (Be = mo(["", ""])), n11) }, true), t11.error(); + }); + }, v5.checkMissingProp = function(t11, n11, r11) { + var o11 = t11.gen, i11 = t11.data, s11 = t11.it.opts; + return e20.or.apply(void 0, Bo(n11.map(function(t12) { + return (0, e20.and)(a10(o11, i11, t12, s11.ownProperties), (0, e20._)(Le || (Le = mo(["", " = ", ""])), r11, t12)); + }))); + }, v5.reportMissingProp = function(e21, t11) { + e21.setParams({ missingProperty: t11 }, true), e21.error(); + }, v5.hasPropFunc = o10, v5.isOwnProperty = i10, v5.propertyInData = function(t11, n11, r11, o11) { + var a11 = (0, e20._)(He || (He = mo(["", "", " !== undefined"])), n11, (0, e20.getProperty)(r11)); + return o11 ? (0, e20._)(We || (We = mo(["", " && ", ""])), a11, i10(t11, n11, r11)) : a11; + }, v5.noPropertyInData = a10, v5.allSchemaProperties = s10, v5.schemaProperties = function(e21, n11) { + return s10(n11).filter(function(r11) { + return !(0, t10.alwaysValidSchema)(e21, n11[r11]); + }); + }, v5.callValidateCode = function(t11, r11, o11, i11) { + var a11 = t11.schemaCode, s11 = t11.data, c11 = t11.it, l10 = c11.gen, u10 = c11.topSchemaRef, f10 = c11.schemaPath, d10 = c11.errorPath, h10 = t11.it, v10 = i11 ? (0, e20._)(Je || (Je = mo(["", ", ", ", ", "", ""])), a11, s11, u10, f10) : s11, p10 = [[n10.default.instancePath, (0, e20.strConcat)(n10.default.instancePath, d10)], [n10.default.parentData, h10.parentData], [n10.default.parentDataProperty, h10.parentDataProperty], [n10.default.rootData, n10.default.rootData]]; + h10.opts.dynamicRef && p10.push([n10.default.dynamicAnchors, n10.default.dynamicAnchors]); + var m10 = (0, e20._)(Ke || (Ke = mo(["", ", ", ""])), v10, l10.object.apply(l10, p10)); + return o11 !== e20.nil ? (0, e20._)(Ge || (Ge = mo(["", ".call(", ", ", ")"])), r11, o11, m10) : (0, e20._)(Qe || (Qe = mo(["", "(", ")"])), r11, m10); + }; + var c10 = (0, e20._)(Ye || (Ye = mo(["new RegExp"]))); + return v5.usePattern = function(t11, n11) { + var o11 = t11.gen, i11 = t11.it.opts, a11 = i11.unicodeRegExp ? "u" : "", s11 = i11.code.regExp, l10 = s11(n11, a11); + return o11.scopeValue("pattern", { key: l10.toString(), ref: l10, code: (0, e20._)(Xe || (Xe = mo(["", "(", ", ", ")"])), "new RegExp" === s11.code ? c10 : (0, r10.useFunc)(o11, s11), n11, a11) }); + }, v5.validateArray = function(n11) { + var r11 = n11.gen, o11 = n11.data, i11 = n11.keyword, a11 = n11.it, s11 = r11.name("valid"); + if (a11.allErrors) { + var c11 = r11.let("valid", true); + return l10(function() { + return r11.assign(c11, false); + }), c11; + } + return r11.var(s11, true), l10(function() { + return r11.break(); + }), s11; + function l10(a12) { + var c12 = r11.const("len", (0, e20._)(Ze || (Ze = mo(["", ".length"])), o11)); + r11.forRange("i", 0, c12, function(o12) { + n11.subschema({ keyword: i11, dataProp: o12, dataPropType: t10.Type.Num }, s11), r11.if((0, e20.not)(s11), a12); + }); + } + }, v5.validateUnion = function(n11) { + var r11 = n11.gen, o11 = n11.schema, i11 = n11.keyword, a11 = n11.it; + if (!Array.isArray(o11)) + throw new Error("ajv implementation error"); + if (!o11.some(function(e21) { + return (0, t10.alwaysValidSchema)(a11, e21); + }) || a11.opts.unevaluated) { + var s11 = r11.let("valid", false), c11 = r11.name("_valid"); + r11.block(function() { + return o11.forEach(function(t11, o12) { + var a12 = n11.subschema({ keyword: i11, schemaProp: o12, compositeRule: true }, c11); + r11.assign(s11, (0, e20._)(et || (et = mo(["", " || ", ""])), s11, c11)), n11.mergeValidEvaluated(a12, c11) || r11.if((0, e20.not)(s11)); + }); + }), n11.result(s11, function() { + return n11.reset(); + }, function() { + return n11.error(true); + }); + } + }, v5; + } + function m5() { + if (d5) + return h5; + d5 = 1, Object.defineProperty(h5, "__esModule", { value: true }), h5.validateKeywordUsage = h5.validSchemaType = h5.funcKeywordCode = h5.macroKeywordCode = void 0; + var e20 = G8(), t10 = t5(), n10 = p5(), r10 = n5(); + function o10(t11) { + var n11 = t11.gen, r11 = t11.data, o11 = t11.it; + n11.if(o11.parentData, function() { + return n11.assign(r11, (0, e20._)(st || (st = mo(["", "[", "]"])), o11.parentData, o11.parentDataProperty)); + }); + } + function i10(t11, n11, r11) { + if (void 0 === r11) + throw new Error('keyword "'.concat(n11, '" failed to compile')); + return t11.scopeValue("keyword", "function" == typeof r11 ? { ref: r11 } : { ref: r11, code: (0, e20.stringify)(r11) }); + } + return h5.macroKeywordCode = function(t11, n11) { + var r11 = t11.gen, o11 = t11.keyword, a10 = t11.schema, s10 = t11.parentSchema, c10 = t11.it, l10 = n11.macro.call(c10.self, a10, s10, c10), u10 = i10(r11, o11, l10); + false !== c10.opts.validateSchema && c10.self.validateSchema(l10, true); + var f10 = r11.name("valid"); + t11.subschema({ schema: l10, schemaPath: e20.nil, errSchemaPath: "".concat(c10.errSchemaPath, "/").concat(o11), topSchemaRef: u10, compositeRule: true }, f10), t11.pass(f10, function() { + return t11.error(true); + }); + }, h5.funcKeywordCode = function(a10, s10) { + var c10, l10 = a10.gen, u10 = a10.keyword, f10 = a10.schema, d10 = a10.parentSchema, h10 = a10.$data, v10 = a10.it; + !function(e21, t11) { + var n11 = e21.schemaEnv; + if (t11.async && !n11.$async) + throw new Error("async keyword in sync schema"); + }(v10, s10); + var p10 = !h10 && s10.compile ? s10.compile.call(v10.self, f10, d10, v10) : s10.validate, m10 = i10(l10, u10, p10), g10 = l10.let("valid"); + function y10() { + var r11 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : s10.async ? (0, e20._)(it || (it = mo(["await "]))) : e20.nil, o11 = v10.opts.passContext ? t10.default.this : t10.default.self, i11 = !("compile" in s10 && !h10 || false === s10.schema); + l10.assign(g10, (0, e20._)(at || (at = mo(["", "", ""])), r11, (0, n10.callValidateCode)(a10, m10, o11, i11)), s10.modifying); + } + function b10(t11) { + var n11; + l10.if((0, e20.not)(null !== (n11 = s10.valid) && void 0 !== n11 ? n11 : g10), t11); + } + a10.block$data(g10, function() { + if (false === s10.errors) + y10(), s10.modifying && o10(a10), b10(function() { + return a10.error(); + }); + else { + var n11 = s10.async ? function() { + var t11 = l10.let("ruleErrs", null); + return l10.try(function() { + return y10((0, e20._)(tt || (tt = mo(["await "])))); + }, function(n12) { + return l10.assign(g10, false).if((0, e20._)(nt || (nt = mo(["", " instanceof ", ""])), n12, v10.ValidationError), function() { + return l10.assign(t11, (0, e20._)(rt || (rt = mo(["", ".errors"])), n12)); + }, function() { + return l10.throw(n12); + }); + }), t11; + }() : (i11 = (0, e20._)(ot || (ot = mo(["", ".errors"])), m10), l10.assign(i11, null), y10(e20.nil), i11); + s10.modifying && o10(a10), b10(function() { + return function(n12, o11) { + var i12 = n12.gen; + i12.if((0, e20._)(ct || (ct = mo(["Array.isArray(", ")"])), o11), function() { + i12.assign(t10.default.vErrors, (0, e20._)(lt || (lt = mo(["", " === null ? ", " : ", ".concat(", ")"])), t10.default.vErrors, o11, t10.default.vErrors, o11)).assign(t10.default.errors, (0, e20._)(ut || (ut = mo(["", ".length"])), t10.default.vErrors)), (0, r10.extendErrors)(n12); + }, function() { + return n12.error(); + }); + }(a10, n11); + }); + } + var i11; + }), a10.ok(null !== (c10 = s10.valid) && void 0 !== c10 ? c10 : g10); + }, h5.validSchemaType = function(e21, t11) { + var n11 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; + return !t11.length || t11.some(function(t12) { + return "array" === t12 ? Array.isArray(e21) : "object" === t12 ? e21 && "object" == Ho(e21) && !Array.isArray(e21) : Ho(e21) == t12 || n11 && void 0 === e21; + }); + }, h5.validateKeywordUsage = function(e21, t11, n11) { + var r11 = e21.schema, o11 = e21.opts, i11 = e21.self, a10 = e21.errSchemaPath; + if (Array.isArray(t11.keyword) ? !t11.keyword.includes(n11) : t11.keyword !== n11) + throw new Error("ajv implementation error"); + var s10 = t11.dependencies; + if (null == s10 ? void 0 : s10.some(function(e23) { + return !Object.prototype.hasOwnProperty.call(r11, e23); + })) + throw new Error("parent schema must have dependencies of ".concat(n11, ": ").concat(s10.join(","))); + if (t11.validateSchema && !t11.validateSchema(r11[n11])) { + var c10 = 'keyword "'.concat(n11, '" value is invalid at path "').concat(a10, '": ') + i11.errorsText(t11.validateSchema.errors); + if ("log" !== o11.validateSchema) + throw new Error(c10); + i11.logger.error(c10); + } + }, h5; + } + var g5; + var y5 = {}; + var b5 = {}; + var k5 = function e18(t10, n10) { + if (t10 === n10) + return true; + if (t10 && n10 && "object" == Ho(t10) && "object" == Ho(n10)) { + if (t10.constructor !== n10.constructor) + return false; + var r10, o10, i10; + if (Array.isArray(t10)) { + if ((r10 = t10.length) != n10.length) + return false; + for (o10 = r10; 0 != o10--; ) + if (!e18(t10[o10], n10[o10])) + return false; + return true; + } + if (t10.constructor === RegExp) + return t10.source === n10.source && t10.flags === n10.flags; + if (t10.valueOf !== Object.prototype.valueOf) + return t10.valueOf() === n10.valueOf(); + if (t10.toString !== Object.prototype.toString) + return t10.toString() === n10.toString(); + if ((r10 = (i10 = Object.keys(t10)).length) !== Object.keys(n10).length) + return false; + for (o10 = r10; 0 != o10--; ) + if (!Object.prototype.hasOwnProperty.call(n10, i10[o10])) + return false; + for (o10 = r10; 0 != o10--; ) { + var a10 = i10[o10]; + if (!e18(t10[a10], n10[a10])) + return false; + } + return true; + } + return t10 != t10 && n10 != n10; + }; + var w5 = { exports: {} }; + var x5 = w5.exports = function(e20, t10, n10) { + "function" == typeof t10 && (n10 = t10, t10 = {}), j5(t10, "function" == typeof (n10 = t10.cb || n10) ? n10 : n10.pre || function() { + }, n10.post || function() { + }, e20, "", e20); + }; + function j5(e20, t10, n10, r10, o10, i10, a10, s10, c10, l10) { + if (r10 && "object" == Ho(r10) && !Array.isArray(r10)) { + for (var u10 in t10(r10, o10, i10, a10, s10, c10, l10), r10) { + var f10 = r10[u10]; + if (Array.isArray(f10)) { + if (u10 in x5.arrayKeywords) + for (var d10 = 0; d10 < f10.length; d10++) + j5(e20, t10, n10, f10[d10], o10 + "/" + u10 + "/" + d10, i10, o10, u10, r10, d10); + } else if (u10 in x5.propsKeywords) { + if (f10 && "object" == Ho(f10)) + for (var h10 in f10) + j5(e20, t10, n10, f10[h10], o10 + "/" + u10 + "/" + h10.replace(/~/g, "~0").replace(/\//g, "~1"), i10, o10, u10, r10, h10); + } else + (u10 in x5.keywords || e20.allKeys && !(u10 in x5.skipKeywords)) && j5(e20, t10, n10, f10, o10 + "/" + u10, i10, o10, u10, r10); + } + n10(r10, o10, i10, a10, s10, c10, l10); + } + } + x5.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true, if: true, then: true, else: true }, x5.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }, x5.propsKeywords = { $defs: true, definitions: true, properties: true, patternProperties: true, dependencies: true }, x5.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; + var S5 = w5.exports; + Object.defineProperty(b5, "__esModule", { value: true }), b5.getSchemaRefs = b5.resolveUrl = b5.normalizeId = b5._getFullPath = b5.getFullPath = b5.inlineRef = void 0; + var C5 = Q8; + var $5 = k5; + var _5 = S5; + var O5 = /* @__PURE__ */ new Set(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum", "const"]); + b5.inlineRef = function(e20) { + var t10 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + return "boolean" == typeof e20 || (true === t10 ? !E5(e20) : !!t10 && A5(e20) <= t10); + }; + var M5 = /* @__PURE__ */ new Set(["$ref", "$recursiveRef", "$recursiveAnchor", "$dynamicRef", "$dynamicAnchor"]); + function E5(e20) { + for (var t10 in e20) { + if (M5.has(t10)) + return true; + var n10 = e20[t10]; + if (Array.isArray(n10) && n10.some(E5)) + return true; + if ("object" == Ho(n10) && E5(n10)) + return true; + } + return false; + } + function A5(e20) { + var t10 = 0; + for (var n10 in e20) { + if ("$ref" === n10) + return 1 / 0; + if (t10++, !O5.has(n10) && ("object" == Ho(e20[n10]) && (0, C5.eachItem)(e20[n10], function(e21) { + return t10 += A5(e21); + }), t10 === 1 / 0)) + return 1 / 0; + } + return t10; + } + function P5(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ""; + false !== (arguments.length > 2 ? arguments[2] : void 0) && (t10 = N5(t10)); + var n10 = e20.parse(t10); + return T5(e20, n10); + } + function T5(e20, t10) { + return e20.serialize(t10).split("#")[0] + "#"; + } + b5.getFullPath = P5, b5._getFullPath = T5; + var R5 = /#\/?$/; + function N5(e20) { + return e20 ? e20.replace(R5, "") : ""; + } + b5.normalizeId = N5, b5.resolveUrl = function(e20, t10, n10) { + return n10 = N5(n10), e20.resolve(t10, n10); + }; + var I5; + var D5 = /^[a-z_][-a-z0-9._]*$/i; + function q5() { + if (I5) + return z8; + I5 = 1, Object.defineProperty(z8, "__esModule", { value: true }), z8.getData = z8.KeywordCxt = z8.validateFunctionCode = void 0; + var e20 = function() { + if (Z8) + return B8; + Z8 = 1, Object.defineProperty(B8, "__esModule", { value: true }), B8.boolOrEmptySchema = B8.topBoolOrEmptySchema = void 0; + var e21 = n5(), t11 = G8(), n11 = t5(), r11 = { message: "boolean schema is false" }; + function o11(t12, n12) { + var o12 = { gen: t12.gen, keyword: "false schema", data: t12.data, schema: false, schemaCode: false, schemaValue: false, params: {}, it: t12 }; + (0, e21.reportError)(o12, r11, void 0, n12); + } + return B8.topBoolOrEmptySchema = function(e23) { + var r12 = e23.gen, i11 = e23.schema, a11 = e23.validateName; + false === i11 ? o11(e23, false) : "object" == Ho(i11) && true === i11.$async ? r12.return(n11.default.data) : (r12.assign((0, t11._)(ne || (ne = mo(["", ".errors"])), a11), null), r12.return(true)); + }, B8.boolOrEmptySchema = function(e23, t12) { + var n12 = e23.gen; + false === e23.schema ? (n12.var(t12, false), o11(e23)) : n12.var(t12, true); + }, B8; + }(), t10 = r5, n10 = c5(), r10 = r5, o10 = function() { + if (l5) + return u5; + l5 = 1, Object.defineProperty(u5, "__esModule", { value: true }), u5.assignDefaults = void 0; + var e21 = G8(), t11 = Q8; + function n11(n12, r11, o11) { + var i11 = n12.gen, a11 = n12.compositeRule, s11 = n12.data, c11 = n12.opts; + if (void 0 !== o11) { + var l11 = (0, e21._)(Ie || (Ie = mo(["", "", ""])), s11, (0, e21.getProperty)(r11)); + if (a11) + (0, t11.checkStrictMode)(n12, "default is ignored for: ".concat(l11)); + else { + var u11 = (0, e21._)(De || (De = mo(["", " === undefined"])), l11); + "empty" === c11.useDefaults && (u11 = (0, e21._)(qe || (qe = mo(["", " || ", " === null || ", ' === ""'])), u11, l11, l11)), i11.if(u11, (0, e21._)(ze || (ze = mo(["", " = ", ""])), l11, (0, e21.stringify)(o11))); + } + } + } + return u5.assignDefaults = function(e23, t12) { + var r11 = e23.schema, o11 = r11.properties, i11 = r11.items; + if ("object" === t12 && o11) + for (var a11 in o11) + n11(e23, a11, o11[a11].default); + else + "array" === t12 && Array.isArray(i11) && i11.forEach(function(t13, r12) { + return n11(e23, r12, t13.default); + }); + }, u5; + }(), i10 = m5(), a10 = function() { + if (g5) + return y5; + g5 = 1, Object.defineProperty(y5, "__esModule", { value: true }), y5.extendSubschemaMode = y5.extendSubschemaData = y5.getSubschema = void 0; + var e21 = G8(), t11 = Q8; + return y5.getSubschema = function(n11, r11) { + var o11 = r11.keyword, i11 = r11.schemaProp, a11 = r11.schema, s11 = r11.schemaPath, c11 = r11.errSchemaPath, l11 = r11.topSchemaRef; + if (void 0 !== o11 && void 0 !== a11) + throw new Error('both "keyword" and "schema" passed, only one allowed'); + if (void 0 !== o11) { + var u11 = n11.schema[o11]; + return void 0 === i11 ? { schema: u11, schemaPath: (0, e21._)(ft || (ft = mo(["", "", ""])), n11.schemaPath, (0, e21.getProperty)(o11)), errSchemaPath: "".concat(n11.errSchemaPath, "/").concat(o11) } : { schema: u11[i11], schemaPath: (0, e21._)(dt || (dt = mo(["", "", "", ""])), n11.schemaPath, (0, e21.getProperty)(o11), (0, e21.getProperty)(i11)), errSchemaPath: "".concat(n11.errSchemaPath, "/").concat(o11, "/").concat((0, t11.escapeFragment)(i11)) }; + } + if (void 0 !== a11) { + if (void 0 === s11 || void 0 === c11 || void 0 === l11) + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); + return { schema: a11, schemaPath: s11, topSchemaRef: l11, errSchemaPath: c11 }; + } + throw new Error('either "keyword" or "schema" must be passed'); + }, y5.extendSubschemaData = function(n11, r11, o11) { + var i11 = o11.dataProp, a11 = o11.dataPropType, s11 = o11.data, c11 = o11.dataTypes, l11 = o11.propertyName; + if (void 0 !== s11 && void 0 !== i11) + throw new Error('both "data" and "dataProp" passed, only one allowed'); + var u11 = r11.gen; + if (void 0 !== i11) { + var f11 = r11.errorPath, d11 = r11.dataPathArr, h11 = r11.opts; + v11(u11.let("data", (0, e21._)(ht || (ht = mo(["", "", ""])), r11.data, (0, e21.getProperty)(i11)), true)), n11.errorPath = (0, e21.str)(vt || (vt = mo(["", "", ""])), f11, (0, t11.getErrorPath)(i11, a11, h11.jsPropertySyntax)), n11.parentDataProperty = (0, e21._)(pt || (pt = mo(["", ""])), i11), n11.dataPathArr = [].concat(Bo(d11), [n11.parentDataProperty]); + } + function v11(e23) { + n11.data = e23, n11.dataLevel = r11.dataLevel + 1, n11.dataTypes = [], r11.definedProperties = /* @__PURE__ */ new Set(), n11.parentData = r11.data, n11.dataNames = [].concat(Bo(r11.dataNames), [e23]); + } + void 0 !== s11 && (v11(s11 instanceof e21.Name ? s11 : u11.let("data", s11, true)), void 0 !== l11 && (n11.propertyName = l11)), c11 && (n11.dataTypes = c11); + }, y5.extendSubschemaMode = function(e23, t12) { + var n11 = t12.jtdDiscriminator, r11 = t12.jtdMetadata, o11 = t12.compositeRule, i11 = t12.createErrors, a11 = t12.allErrors; + void 0 !== o11 && (e23.compositeRule = o11), void 0 !== i11 && (e23.createErrors = i11), void 0 !== a11 && (e23.allErrors = a11), e23.jtdDiscriminator = n11, e23.jtdMetadata = r11; + }, y5; + }(), s10 = G8(), c10 = t5(), l10 = b5, u10 = Q8, f10 = n5(); + function d10(e21, t11) { + var n11 = e21.gen, r11 = e21.validateName, o11 = e21.schema, i11 = e21.schemaEnv, a11 = e21.opts; + a11.code.es5 ? n11.func(r11, (0, s10._)(mt || (mt = mo(["", ", ", ""])), c10.default.data, c10.default.valCxt), i11.$async, function() { + n11.code((0, s10._)(gt || (gt = mo(['"use strict"; ', ""])), h10(o11, a11))), function(e23, t12) { + e23.if(c10.default.valCxt, function() { + e23.var(c10.default.instancePath, (0, s10._)(wt || (wt = mo(["", ".", ""])), c10.default.valCxt, c10.default.instancePath)), e23.var(c10.default.parentData, (0, s10._)(xt || (xt = mo(["", ".", ""])), c10.default.valCxt, c10.default.parentData)), e23.var(c10.default.parentDataProperty, (0, s10._)(jt || (jt = mo(["", ".", ""])), c10.default.valCxt, c10.default.parentDataProperty)), e23.var(c10.default.rootData, (0, s10._)(St || (St = mo(["", ".", ""])), c10.default.valCxt, c10.default.rootData)), t12.dynamicRef && e23.var(c10.default.dynamicAnchors, (0, s10._)(Ct || (Ct = mo(["", ".", ""])), c10.default.valCxt, c10.default.dynamicAnchors)); + }, function() { + e23.var(c10.default.instancePath, (0, s10._)($t || ($t = mo(['""'])))), e23.var(c10.default.parentData, (0, s10._)(_t || (_t = mo(["undefined"])))), e23.var(c10.default.parentDataProperty, (0, s10._)(Ot || (Ot = mo(["undefined"])))), e23.var(c10.default.rootData, c10.default.data), t12.dynamicRef && e23.var(c10.default.dynamicAnchors, (0, s10._)(Mt || (Mt = mo(["{}"])))); + }); + }(n11, a11), n11.code(t11); + }) : n11.func(r11, (0, s10._)(yt || (yt = mo(["", ", ", ""])), c10.default.data, function(e23) { + return (0, s10._)(bt || (bt = mo(["{", '="", ', ", ", ", ", "=", "", "}={}"])), c10.default.instancePath, c10.default.parentData, c10.default.parentDataProperty, c10.default.rootData, c10.default.data, e23.dynamicRef ? (0, s10._)(kt || (kt = mo([", ", "={}"])), c10.default.dynamicAnchors) : s10.nil); + }(a11)), i11.$async, function() { + return n11.code(h10(o11, a11)).code(t11); + }); + } + function h10(e21, t11) { + var n11 = "object" == Ho(e21) && e21[t11.schemaId]; + return n11 && (t11.code.source || t11.code.process) ? (0, s10._)(Dt || (Dt = mo(["/*# sourceURL=", " */"])), n11) : s10.nil; + } + function v10(t11, n11) { + m10(t11) && (g10(t11), p10(t11)) ? function(e21, t12) { + var n12 = e21.schema, r11 = e21.gen, o11 = e21.opts; + o11.$comment && n12.$comment && b10(e21); + (function(e23) { + var t13 = e23.schema[e23.opts.schemaId]; + t13 && (e23.baseId = (0, l10.resolveUrl)(e23.opts.uriResolver, e23.baseId, t13)); + })(e21), function(e23) { + if (e23.schema.$async && !e23.schemaEnv.$async) + throw new Error("async schema in sync schema"); + }(e21); + var i11 = r11.const("_errs", c10.default.errors); + y10(e21, i11), r11.var(t12, (0, s10._)(qt || (qt = mo(["", " === ", ""])), i11, c10.default.errors)); + }(t11, n11) : (0, e20.boolOrEmptySchema)(t11, n11); + } + function p10(e21) { + var t11 = e21.schema, n11 = e21.self; + if ("boolean" == typeof t11) + return !t11; + for (var r11 in t11) + if (n11.RULES.all[r11]) + return true; + return false; + } + function m10(e21) { + return "boolean" != typeof e21.schema; + } + function g10(e21) { + (0, u10.checkUnknownRules)(e21), function(e23) { + var t11 = e23.schema, n11 = e23.errSchemaPath, r11 = e23.opts, o11 = e23.self; + t11.$ref && r11.ignoreKeywordsWithRef && (0, u10.schemaHasRulesButRef)(t11, o11.RULES) && o11.logger.warn('$ref: keywords ignored in schema at path "'.concat(n11, '"')); + }(e21); + } + function y10(e21, n11) { + if (e21.opts.jtd) + return k10(e21, [], false, n11); + var r11 = (0, t10.getSchemaTypes)(e21.schema); + k10(e21, r11, !(0, t10.coerceAndCheckDataType)(e21, r11), n11); + } + function b10(e21) { + var t11 = e21.gen, n11 = e21.schemaEnv, r11 = e21.schema, o11 = e21.errSchemaPath, i11 = e21.opts, a11 = r11.$comment; + if (true === i11.$comment) + t11.code((0, s10._)(zt || (zt = mo(["", ".logger.log(", ")"])), c10.default.self, a11)); + else if ("function" == typeof i11.$comment) { + var l11 = (0, s10.str)(Bt || (Bt = mo(["", "/$comment"])), o11), u11 = t11.scopeValue("root", { ref: n11.root }); + t11.code((0, s10._)(Lt || (Lt = mo(["", ".opts.$comment(", ", ", ", ", ".schema)"])), c10.default.self, a11, l11, u11)); + } + } + function k10(e21, t11, o11, i11) { + var a11 = e21.gen, l11 = e21.schema, f11 = e21.data, d11 = e21.allErrors, h11 = e21.opts, v11 = e21.self.RULES; + function p11(u11) { + (0, n10.shouldUseGroup)(l11, u11) && (u11.type ? (a11.if((0, r10.checkDataType)(u11.type, f11, h11.strictNumbers)), w10(e21, u11), 1 === t11.length && t11[0] === u11.type && o11 && (a11.else(), (0, r10.reportTypeError)(e21)), a11.endIf()) : w10(e21, u11), d11 || a11.if((0, s10._)(Kt || (Kt = mo(["", " === ", ""])), c10.default.errors, i11 || 0))); + } + !l11.$ref || !h11.ignoreKeywordsWithRef && (0, u10.schemaHasRulesButRef)(l11, v11) ? (h11.jtd || function(e23, t12) { + if (e23.schemaEnv.meta || !e23.opts.strictTypes) + return; + (function(e24, t13) { + if (!t13.length) + return; + if (!e24.dataTypes.length) + return void (e24.dataTypes = t13); + t13.forEach(function(t14) { + j10(e24.dataTypes, t14) || S10(e24, 'type "'.concat(t14, '" not allowed by context "').concat(e24.dataTypes.join(","), '"')); + }), function(e25, t14) { + var n11, r11 = [], o12 = bo(e25.dataTypes); + try { + for (o12.s(); !(n11 = o12.n()).done; ) { + var i12 = n11.value; + j10(t14, i12) ? r11.push(i12) : t14.includes("integer") && "number" === i12 && r11.push("integer"); + } + } catch (e26) { + o12.e(e26); + } finally { + o12.f(); + } + e25.dataTypes = r11; + }(e24, t13); + })(e23, t12), e23.opts.allowUnionTypes || function(e24, t13) { + t13.length > 1 && (2 !== t13.length || !t13.includes("null")) && S10(e24, "use allowUnionTypes to allow union type keyword"); + }(e23, t12); + !function(e24, t13) { + var r11 = e24.self.RULES.all; + for (var o12 in r11) { + var i12 = r11[o12]; + if ("object" == Ho(i12) && (0, n10.shouldUseRule)(e24.schema, i12)) { + var a12 = i12.definition.type; + a12.length && !a12.some(function(e25) { + return x10(t13, e25); + }) && S10(e24, 'missing type "'.concat(a12.join(","), '" for keyword "').concat(o12, '"')); + } + } + }(e23, e23.dataTypes); + }(e21, t11), a11.block(function() { + var e23, t12 = bo(v11.rules); + try { + for (t12.s(); !(e23 = t12.n()).done; ) { + p11(e23.value); + } + } catch (e24) { + t12.e(e24); + } finally { + t12.f(); + } + p11(v11.post); + })) : a11.block(function() { + return $10(e21, "$ref", v11.all.$ref.definition); + }); + } + function w10(e21, t11) { + var r11 = e21.gen, i11 = e21.schema; + e21.opts.useDefaults && (0, o10.assignDefaults)(e21, t11.type), r11.block(function() { + var r12, o11 = bo(t11.rules); + try { + for (o11.s(); !(r12 = o11.n()).done; ) { + var a11 = r12.value; + (0, n10.shouldUseRule)(i11, a11) && $10(e21, a11.keyword, a11.definition, t11.type); + } + } catch (e23) { + o11.e(e23); + } finally { + o11.f(); + } + }); + } + function x10(e21, t11) { + return e21.includes(t11) || "number" === t11 && e21.includes("integer"); + } + function j10(e21, t11) { + return e21.includes(t11) || "integer" === t11 && e21.includes("number"); + } + function S10(e21, t11) { + var n11 = e21.schemaEnv.baseId + e21.errSchemaPath; + t11 += ' at "'.concat(n11, '" (strictTypes)'), (0, u10.checkStrictMode)(e21, t11, e21.opts.strictTypes); + } + z8.validateFunctionCode = function(t11) { + m10(t11) && (g10(t11), p10(t11)) ? function(e21) { + var t12 = e21.schema, n11 = e21.opts, r11 = e21.gen; + d10(e21, function() { + n11.$comment && t12.$comment && b10(e21), function(e23) { + var t13 = e23.schema, n12 = e23.opts; + void 0 !== t13.default && n12.useDefaults && n12.strictSchema && (0, u10.checkStrictMode)(e23, "default is ignored in the schema root"); + }(e21), r11.let(c10.default.vErrors, null), r11.let(c10.default.errors, 0), n11.unevaluated && function(e23) { + var t13 = e23.gen, n12 = e23.validateName; + e23.evaluated = t13.const("evaluated", (0, s10._)(Et || (Et = mo(["", ".evaluated"])), n12)), t13.if((0, s10._)(At || (At = mo(["", ".dynamicProps"])), e23.evaluated), function() { + return t13.assign((0, s10._)(Pt || (Pt = mo(["", ".props"])), e23.evaluated), (0, s10._)(Tt || (Tt = mo(["undefined"])))); + }), t13.if((0, s10._)(Rt || (Rt = mo(["", ".dynamicItems"])), e23.evaluated), function() { + return t13.assign((0, s10._)(Nt || (Nt = mo(["", ".items"])), e23.evaluated), (0, s10._)(It || (It = mo(["undefined"])))); + }); + }(e21), y10(e21), function(e23) { + var t13 = e23.gen, n12 = e23.schemaEnv, r12 = e23.validateName, o11 = e23.ValidationError, i11 = e23.opts; + n12.$async ? t13.if((0, s10._)(Ft || (Ft = mo(["", " === 0"])), c10.default.errors), function() { + return t13.return(c10.default.data); + }, function() { + return t13.throw((0, s10._)(Vt || (Vt = mo(["new ", "(", ")"])), o11, c10.default.vErrors)); + }) : (t13.assign((0, s10._)(Ht || (Ht = mo(["", ".errors"])), r12), c10.default.vErrors), i11.unevaluated && function(e24) { + var t14 = e24.gen, n13 = e24.evaluated, r13 = e24.props, o12 = e24.items; + r13 instanceof s10.Name && t14.assign((0, s10._)(Ut || (Ut = mo(["", ".props"])), n13), r13); + o12 instanceof s10.Name && t14.assign((0, s10._)(Jt || (Jt = mo(["", ".items"])), n13), o12); + }(e23), t13.return((0, s10._)(Wt || (Wt = mo(["", " === 0"])), c10.default.errors))); + }(e21); + }); + }(t11) : d10(t11, function() { + return (0, e20.topBoolOrEmptySchema)(t11); + }); + }; + var C10 = function() { + function e21(t11, n11, r11) { + if (No(this, e21), (0, i10.validateKeywordUsage)(t11, n11, r11), this.gen = t11.gen, this.allErrors = t11.allErrors, this.keyword = r11, this.data = t11.data, this.schema = t11.schema[r11], this.$data = n11.$data && t11.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, u10.schemaRefOrVal)(t11, this.schema, r11, this.$data), this.schemaType = n11.schemaType, this.parentSchema = t11.schema, this.params = {}, this.it = t11, this.def = n11, this.$data) + this.schemaCode = t11.gen.const("vSchema", M10(this.$data, t11)); + else if (this.schemaCode = this.schemaValue, !(0, i10.validSchemaType)(this.schema, n11.schemaType, n11.allowUndefined)) + throw new Error("".concat(r11, " value must be ").concat(JSON.stringify(n11.schemaType))); + ("code" in n11 ? n11.trackErrors : false !== n11.errors) && (this.errsCount = t11.gen.const("_errs", c10.default.errors)); + } + return Do(e21, [{ key: "result", value: function(e23, t11, n11) { + this.failResult((0, s10.not)(e23), t11, n11); + } }, { key: "failResult", value: function(e23, t11, n11) { + this.gen.if(e23), n11 ? n11() : this.error(), t11 ? (this.gen.else(), t11(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else(); + } }, { key: "pass", value: function(e23, t11) { + this.failResult((0, s10.not)(e23), void 0, t11); + } }, { key: "fail", value: function(e23) { + if (void 0 === e23) + return this.error(), void (this.allErrors || this.gen.if(false)); + this.gen.if(e23), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else(); + } }, { key: "fail$data", value: function(e23) { + if (!this.$data) + return this.fail(e23); + var t11 = this.schemaCode; + this.fail((0, s10._)(Gt || (Gt = mo(["", " !== undefined && (", ")"])), t11, (0, s10.or)(this.invalid$data(), e23))); + } }, { key: "error", value: function(e23, t11, n11) { + if (t11) + return this.setParams(t11), this._error(e23, n11), void this.setParams({}); + this._error(e23, n11); + } }, { key: "_error", value: function(e23, t11) { + (e23 ? f10.reportExtraError : f10.reportError)(this, this.def.error, t11); + } }, { key: "$dataError", value: function() { + (0, f10.reportError)(this, this.def.$dataError || f10.keyword$DataError); + } }, { key: "reset", value: function() { + if (void 0 === this.errsCount) + throw new Error('add "trackErrors" to keyword definition'); + (0, f10.resetErrorsCount)(this.gen, this.errsCount); + } }, { key: "ok", value: function(e23) { + this.allErrors || this.gen.if(e23); + } }, { key: "setParams", value: function(e23, t11) { + t11 ? Object.assign(this.params, e23) : this.params = e23; + } }, { key: "block$data", value: function(e23, t11) { + var n11 = this, r11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : s10.nil; + this.gen.block(function() { + n11.check$data(e23, r11), t11(); + }); + } }, { key: "check$data", value: function() { + var e23 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : s10.nil, t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : s10.nil; + if (this.$data) { + var n11 = this.gen, r11 = this.schemaCode, o11 = this.schemaType, i11 = this.def; + n11.if((0, s10.or)((0, s10._)(Qt || (Qt = mo(["", " === undefined"])), r11), t11)), e23 !== s10.nil && n11.assign(e23, true), (o11.length || i11.validateSchema) && (n11.elseIf(this.invalid$data()), this.$dataError(), e23 !== s10.nil && n11.assign(e23, false)), n11.else(); + } + } }, { key: "invalid$data", value: function() { + var e23 = this.gen, t11 = this.schemaCode, n11 = this.schemaType, o11 = this.def, i11 = this.it; + return (0, s10.or)(function() { + if (n11.length) { + if (!(t11 instanceof s10.Name)) + throw new Error("ajv implementation error"); + var e24 = Array.isArray(n11) ? n11 : [n11]; + return (0, s10._)(Yt || (Yt = mo(["", ""])), (0, r10.checkDataTypes)(e24, t11, i11.opts.strictNumbers, r10.DataType.Wrong)); + } + return s10.nil; + }(), function() { + if (o11.validateSchema) { + var n12 = e23.scopeValue("validate$data", { ref: o11.validateSchema }); + return (0, s10._)(Xt || (Xt = mo(["!", "(", ")"])), n12, t11); + } + return s10.nil; + }()); + } }, { key: "subschema", value: function(e23, t11) { + var n11 = (0, a10.getSubschema)(this.it, e23); + (0, a10.extendSubschemaData)(n11, this.it, e23), (0, a10.extendSubschemaMode)(n11, e23); + var r11 = Ro(Ro(Ro({}, this.it), n11), {}, { items: void 0, props: void 0 }); + return v10(r11, t11), r11; + } }, { key: "mergeEvaluated", value: function(e23, t11) { + var n11 = this.it, r11 = this.gen; + n11.opts.unevaluated && (true !== n11.props && void 0 !== e23.props && (n11.props = u10.mergeEvaluated.props(r11, e23.props, n11.props, t11)), true !== n11.items && void 0 !== e23.items && (n11.items = u10.mergeEvaluated.items(r11, e23.items, n11.items, t11))); + } }, { key: "mergeValidEvaluated", value: function(e23, t11) { + var n11 = this, r11 = this.it, o11 = this.gen; + if (r11.opts.unevaluated && (true !== r11.props || true !== r11.items)) + return o11.if(t11, function() { + return n11.mergeEvaluated(e23, s10.Name); + }), true; + } }]), e21; + }(); + function $10(e21, t11, n11, r11) { + var o11 = new C10(e21, n11, t11); + "code" in n11 ? n11.code(o11, r11) : o11.$data && n11.validate ? (0, i10.funcKeywordCode)(o11, n11) : "macro" in n11 ? (0, i10.macroKeywordCode)(o11, n11) : (n11.compile || n11.validate) && (0, i10.funcKeywordCode)(o11, n11); + } + z8.KeywordCxt = C10; + var _10 = /^\/(?:[^~]|~0|~1)*$/, O10 = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; + function M10(e21, t11) { + var n11, r11, o11 = t11.dataLevel, i11 = t11.dataNames, a11 = t11.dataPathArr; + if ("" === e21) + return c10.default.rootData; + if ("/" === e21[0]) { + if (!_10.test(e21)) + throw new Error("Invalid JSON-pointer: ".concat(e21)); + n11 = e21, r11 = c10.default.rootData; + } else { + var l11 = O10.exec(e21); + if (!l11) + throw new Error("Invalid JSON-pointer: ".concat(e21)); + var f11 = +l11[1]; + if ("#" === (n11 = l11[2])) { + if (f11 >= o11) + throw new Error(m11("property/index", f11)); + return a11[o11 - f11]; + } + if (f11 > o11) + throw new Error(m11("data", f11)); + if (r11 = i11[o11 - f11], !n11) + return r11; + } + var d11, h11 = r11, v11 = bo(n11.split("/")); + try { + for (v11.s(); !(d11 = v11.n()).done; ) { + var p11 = d11.value; + p11 && (r11 = (0, s10._)(Zt || (Zt = mo(["", "", ""])), r11, (0, s10.getProperty)((0, u10.unescapeJsonPointer)(p11))), h11 = (0, s10._)(en || (en = mo(["", " && ", ""])), h11, r11)); + } + } catch (e23) { + v11.e(e23); + } finally { + v11.f(); + } + return h11; + function m11(e23, t12) { + return "Cannot access ".concat(e23, " ").concat(t12, " levels up, current level is ").concat(o11); + } + } + return z8.getData = M10, z8; + } + b5.getSchemaRefs = function(e20, t10) { + var n10 = this; + if ("boolean" == typeof e20) + return {}; + var r10 = this.opts, o10 = r10.schemaId, i10 = r10.uriResolver, a10 = N5(e20[o10] || t10), s10 = { "": a10 }, c10 = P5(i10, a10, false), l10 = {}, u10 = /* @__PURE__ */ new Set(); + return _5(e20, { allKeys: true }, function(e21, t11, r11, i11) { + if (void 0 !== i11) { + var a11 = c10 + t11, h10 = s10[i11]; + "string" == typeof e21[o10] && (h10 = v10.call(n10, e21[o10])), p10.call(n10, e21.$anchor), p10.call(n10, e21.$dynamicAnchor), s10[t11] = h10; + } + function v10(t12) { + var n11 = this.opts.uriResolver.resolve; + if (t12 = N5(h10 ? n11(h10, t12) : t12), u10.has(t12)) + throw d10(t12); + u10.add(t12); + var r12 = this.refs[t12]; + return "string" == typeof r12 && (r12 = this.refs[r12]), "object" == Ho(r12) ? f10(e21, r12.schema, t12) : t12 !== N5(a11) && ("#" === t12[0] ? (f10(e21, l10[t12], t12), l10[t12] = e21) : this.refs[t12] = a11), t12; + } + function p10(e23) { + if ("string" == typeof e23) { + if (!D5.test(e23)) + throw new Error('invalid anchor "'.concat(e23, '"')); + v10.call(this, "#".concat(e23)); + } + } + }), l10; + function f10(e21, t11, n11) { + if (void 0 !== t11 && !$5(e21, t11)) + throw d10(n11); + } + function d10(e21) { + return new Error('reference "'.concat(e21, '" resolves to more than one schema')); + } + }; + var z5; + var B5 = {}; + function L5() { + if (z5) + return B5; + z5 = 1, Object.defineProperty(B5, "__esModule", { value: true }); + var e20 = function(e21) { + function t10(e23) { + var n10; + return No(this, t10), (n10 = _o(this, t10, ["validation failed"])).errors = e23, n10.ajv = n10.validation = true, n10; + } + return Ao(t10, $o(Error)), Do(t10); + }(); + return B5.default = e20, B5; + } + var F5; + var V5 = {}; + function H5() { + if (F5) + return V5; + F5 = 1, Object.defineProperty(V5, "__esModule", { value: true }); + var e20 = b5, t10 = function(t11) { + function n10(t12, r10, o10, i10) { + var a10; + return No(this, n10), (a10 = _o(this, n10, [i10 || "can't resolve reference ".concat(o10, " from id ").concat(r10)])).missingRef = (0, e20.resolveUrl)(t12, r10, o10), a10.missingSchema = (0, e20.normalizeId)((0, e20.getFullPath)(t12, a10.missingRef)), a10; + } + return Ao(n10, $o(Error)), Do(n10); + }(); + return V5.default = t10, V5; + } + var W5 = {}; + Object.defineProperty(W5, "__esModule", { value: true }), W5.resolveSchema = W5.getCompilingSchema = W5.resolveRef = W5.compileSchema = W5.SchemaEnv = void 0; + var U5 = G8(); + var J5 = L5(); + var K5 = t5(); + var G5 = b5; + var Q5 = Q8; + var Y5 = q5(); + var X5 = Do(function e19(t10) { + var n10, r10; + No(this, e19), this.refs = {}, this.dynamicAnchors = {}, "object" == Ho(t10.schema) && (r10 = t10.schema), this.schema = t10.schema, this.schemaId = t10.schemaId, this.root = t10.root || this, this.baseId = null !== (n10 = t10.baseId) && void 0 !== n10 ? n10 : (0, G5.normalizeId)(null == r10 ? void 0 : r10[t10.schemaId || "$id"]), this.schemaPath = t10.schemaPath, this.localRefs = t10.localRefs, this.meta = t10.meta, this.$async = null == r10 ? void 0 : r10.$async, this.refs = {}; + }); + function Z5(e20) { + var t10 = t6.call(this, e20); + if (t10) + return t10; + var n10, r10 = (0, G5.getFullPath)(this.opts.uriResolver, e20.root.baseId), o10 = this.opts.code, i10 = o10.es5, a10 = o10.lines, s10 = this.opts.ownProperties, c10 = new U5.CodeGen(this.scope, { es5: i10, lines: a10, ownProperties: s10 }); + e20.$async && (n10 = c10.scopeValue("Error", { ref: J5.default, code: (0, U5._)(tn || (tn = mo(['require("ajv/dist/runtime/validation_error").default']))) })); + var l10 = c10.scopeName("validate"); + e20.validateName = l10; + var u10, f10 = { gen: c10, allErrors: this.opts.allErrors, data: K5.default.data, parentData: K5.default.parentData, parentDataProperty: K5.default.parentDataProperty, dataNames: [K5.default.data], dataPathArr: [U5.nil], dataLevel: 0, dataTypes: [], definedProperties: /* @__PURE__ */ new Set(), topSchemaRef: c10.scopeValue("schema", true === this.opts.code.source ? { ref: e20.schema, code: (0, U5.stringify)(e20.schema) } : { ref: e20.schema }), validateName: l10, ValidationError: n10, schema: e20.schema, schemaEnv: e20, rootId: r10, baseId: e20.baseId || r10, schemaPath: U5.nil, errSchemaPath: e20.schemaPath || (this.opts.jtd ? "" : "#"), errorPath: (0, U5._)(nn || (nn = mo(['""']))), opts: this.opts, self: this }; + try { + this._compilations.add(e20), (0, Y5.validateFunctionCode)(f10), c10.optimize(this.opts.code.optimize); + var d10 = c10.toString(); + u10 = "".concat(c10.scopeRefs(K5.default.scope), "return ").concat(d10), this.opts.code.process && (u10 = this.opts.code.process(u10, e20)); + var h10 = new Function("".concat(K5.default.self), "".concat(K5.default.scope), u10)(this, this.scope.get()); + if (this.scope.value(l10, { ref: h10 }), h10.errors = null, h10.schema = e20.schema, h10.schemaEnv = e20, e20.$async && (h10.$async = true), true === this.opts.code.source && (h10.source = { validateName: l10, validateCode: d10, scopeValues: c10._values }), this.opts.unevaluated) { + var v10 = f10.props, p10 = f10.items; + h10.evaluated = { props: v10 instanceof U5.Name ? void 0 : v10, items: p10 instanceof U5.Name ? void 0 : p10, dynamicProps: v10 instanceof U5.Name, dynamicItems: p10 instanceof U5.Name }, h10.source && (h10.source.evaluated = (0, U5.stringify)(h10.evaluated)); + } + return e20.validate = h10, e20; + } catch (t11) { + throw delete e20.validate, delete e20.validateName, u10 && this.logger.error("Error compiling schema, function code:", u10), t11; + } finally { + this._compilations.delete(e20); + } + } + function e62(e20) { + return (0, G5.inlineRef)(e20.schema, this.opts.inlineRefs) ? e20.schema : e20.validate ? e20 : Z5.call(this, e20); + } + function t6(e20) { + var t10, n10, r10, o10 = bo(this._compilations); + try { + for (o10.s(); !(t10 = o10.n()).done; ) { + var i10 = t10.value; + if (r10 = e20, (n10 = i10).schema === r10.schema && n10.root === r10.root && n10.baseId === r10.baseId) + return i10; + } + } catch (e21) { + o10.e(e21); + } finally { + o10.f(); + } + } + function n6(e20, t10) { + for (var n10; "string" == typeof (n10 = this.refs[t10]); ) + t10 = n10; + return n10 || this.schemas[t10] || r6.call(this, e20, t10); + } + function r6(e20, t10) { + var n10 = this.opts.uriResolver.parse(t10), r10 = (0, G5._getFullPath)(this.opts.uriResolver, n10), o10 = (0, G5.getFullPath)(this.opts.uriResolver, e20.baseId, void 0); + if (Object.keys(e20.schema).length > 0 && r10 === o10) + return i6.call(this, n10, e20); + var i10 = (0, G5.normalizeId)(r10), a10 = this.refs[i10] || this.schemas[i10]; + if ("string" == typeof a10) { + var s10 = r6.call(this, e20, a10); + if ("object" !== Ho(null == s10 ? void 0 : s10.schema)) + return; + return i6.call(this, n10, s10); + } + if ("object" === Ho(null == a10 ? void 0 : a10.schema)) { + if (a10.validate || Z5.call(this, a10), i10 === (0, G5.normalizeId)(t10)) { + var c10 = a10.schema, l10 = this.opts.schemaId, u10 = c10[l10]; + return u10 && (o10 = (0, G5.resolveUrl)(this.opts.uriResolver, o10, u10)), new X5({ schema: c10, schemaId: l10, root: e20, baseId: o10 }); + } + return i6.call(this, n10, a10); + } + } + W5.SchemaEnv = X5, W5.compileSchema = Z5, W5.resolveRef = function(e20, t10, n10) { + var r10; + n10 = (0, G5.resolveUrl)(this.opts.uriResolver, t10, n10); + var o10 = e20.refs[n10]; + if (o10) + return o10; + var i10 = n6.call(this, e20, n10); + if (void 0 === i10) { + var a10 = null === (r10 = e20.localRefs) || void 0 === r10 ? void 0 : r10[n10], s10 = this.opts.schemaId; + a10 && (i10 = new X5({ schema: a10, schemaId: s10, root: e20, baseId: t10 })); + } + return void 0 !== i10 ? e20.refs[n10] = e62.call(this, i10) : void 0; + }, W5.getCompilingSchema = t6, W5.resolveSchema = r6; + var o6 = /* @__PURE__ */ new Set(["properties", "patternProperties", "enum", "dependencies", "definitions"]); + function i6(e20, t10) { + var n10, r10 = t10.baseId, o10 = t10.schema, i10 = t10.root; + if ("/" === (null === (n10 = e20.fragment) || void 0 === n10 ? void 0 : n10[0])) { + var a10, s10, c10 = bo(e20.fragment.slice(1).split("/")); + try { + for (c10.s(); !(a10 = c10.n()).done; ) { + var l10 = a10.value; + if ("boolean" == typeof o10) + return; + var u10 = o10[(0, Q5.unescapeFragment)(l10)]; + if (void 0 === u10) + return; + var f10 = "object" === Ho(o10 = u10) && o10[this.opts.schemaId]; + !o6.has(l10) && f10 && (r10 = (0, G5.resolveUrl)(this.opts.uriResolver, r10, f10)); + } + } catch (e21) { + c10.e(e21); + } finally { + c10.f(); + } + if ("boolean" != typeof o10 && o10.$ref && !(0, Q5.schemaHasRulesButRef)(o10, this.RULES)) { + var d10 = (0, G5.resolveUrl)(this.opts.uriResolver, r10, o10.$ref); + s10 = r6.call(this, i10, d10); + } + var h10 = this.opts.schemaId; + return (s10 = s10 || new X5({ schema: o10, schemaId: h10, root: i10, baseId: r10 })).schema !== s10.root.schema ? s10 : void 0; + } + } + var a6 = { $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", type: "object", required: ["$data"], properties: { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, additionalProperties: false }; + var s6 = {}; + var c6 = { exports: {} }; + !function(e20) { + function t10() { + for (var e21 = arguments.length, t11 = Array(e21), n11 = 0; n11 < e21; n11++) + t11[n11] = arguments[n11]; + if (t11.length > 1) { + t11[0] = t11[0].slice(0, -1); + for (var r11 = t11.length - 1, o11 = 1; o11 < r11; ++o11) + t11[o11] = t11[o11].slice(1, -1); + return t11[r11] = t11[r11].slice(1), t11.join(""); + } + return t11[0]; + } + function n10(e21) { + return "(?:" + e21 + ")"; + } + function r10(e21) { + return void 0 === e21 ? "undefined" : null === e21 ? "null" : Object.prototype.toString.call(e21).split(" ").pop().split("]").shift().toLowerCase(); + } + function o10(e21) { + return e21.toUpperCase(); + } + function i10(e21) { + return null != e21 ? e21 instanceof Array ? e21 : "number" != typeof e21.length || e21.split || e21.setInterval || e21.call ? [e21] : Array.prototype.slice.call(e21) : []; + } + function a10(e21, t11) { + var n11 = e21; + if (t11) + for (var r11 in t11) + n11[r11] = t11[r11]; + return n11; + } + function s10(e21) { + var r11 = "[A-Za-z]", o11 = "[0-9]", i11 = t10(o11, "[A-Fa-f]"), a11 = n10(n10("%[EFef]" + i11 + "%" + i11 + i11 + "%" + i11 + i11) + "|" + n10("%[89A-Fa-f]" + i11 + "%" + i11 + i11) + "|" + n10("%" + i11 + i11)), s11 = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", c11 = t10("[\\:\\/\\?\\#\\[\\]\\@]", s11), l11 = e21 ? "[\\uE000-\\uF8FF]" : "[]", u11 = t10(r11, o11, "[\\-\\.\\_\\~]", e21 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]"); + n10(r11 + t10(r11, o11, "[\\+\\-\\.]") + "*"), n10(n10(a11 + "|" + t10(u11, s11, "[\\:]")) + "*"); + var f11 = n10(n10("25[0-5]") + "|" + n10("2[0-4]" + o11) + "|" + n10("1" + o11 + o11) + "|" + n10("0?[1-9]" + o11) + "|0?0?" + o11), d11 = n10(f11 + "\\." + f11 + "\\." + f11 + "\\." + f11), h11 = n10(i11 + "{1,4}"), v11 = n10(n10(h11 + "\\:" + h11) + "|" + d11), p11 = n10(n10(h11 + "\\:") + "{6}" + v11), m11 = n10("\\:\\:" + n10(h11 + "\\:") + "{5}" + v11), g11 = n10(n10(h11) + "?\\:\\:" + n10(h11 + "\\:") + "{4}" + v11), y11 = n10(n10(n10(h11 + "\\:") + "{0,1}" + h11) + "?\\:\\:" + n10(h11 + "\\:") + "{3}" + v11), b11 = n10(n10(n10(h11 + "\\:") + "{0,2}" + h11) + "?\\:\\:" + n10(h11 + "\\:") + "{2}" + v11), k11 = n10(n10(n10(h11 + "\\:") + "{0,3}" + h11) + "?\\:\\:" + h11 + "\\:" + v11), w11 = n10(n10(n10(h11 + "\\:") + "{0,4}" + h11) + "?\\:\\:" + v11), x11 = n10(n10(n10(h11 + "\\:") + "{0,5}" + h11) + "?\\:\\:" + h11), j11 = n10(n10(n10(h11 + "\\:") + "{0,6}" + h11) + "?\\:\\:"), S11 = n10([p11, m11, g11, y11, b11, k11, w11, x11, j11].join("|")), C11 = n10(n10(u11 + "|" + a11) + "+"); + n10("[vV]" + i11 + "+\\." + t10(u11, s11, "[\\:]") + "+"), n10(n10(a11 + "|" + t10(u11, s11)) + "*"); + var $11 = n10(a11 + "|" + t10(u11, s11, "[\\:\\@]")); + return n10(n10(a11 + "|" + t10(u11, s11, "[\\@]")) + "+"), n10(n10($11 + "|" + t10("[\\/\\?]", l11)) + "*"), { NOT_SCHEME: new RegExp(t10("[^]", r11, o11, "[\\+\\-\\.]"), "g"), NOT_USERINFO: new RegExp(t10("[^\\%\\:]", u11, s11), "g"), NOT_HOST: new RegExp(t10("[^\\%\\[\\]\\:]", u11, s11), "g"), NOT_PATH: new RegExp(t10("[^\\%\\/\\:\\@]", u11, s11), "g"), NOT_PATH_NOSCHEME: new RegExp(t10("[^\\%\\/\\@]", u11, s11), "g"), NOT_QUERY: new RegExp(t10("[^\\%]", u11, s11, "[\\:\\@\\/\\?]", l11), "g"), NOT_FRAGMENT: new RegExp(t10("[^\\%]", u11, s11, "[\\:\\@\\/\\?]"), "g"), ESCAPE: new RegExp(t10("[^]", u11, s11), "g"), UNRESERVED: new RegExp(u11, "g"), OTHER_CHARS: new RegExp(t10("[^\\%]", u11, c11), "g"), PCT_ENCODED: new RegExp(a11, "g"), IPV4ADDRESS: new RegExp("^(" + d11 + ")$"), IPV6ADDRESS: new RegExp("^\\[?(" + S11 + ")" + n10(n10("\\%25|\\%(?!" + i11 + "{2})") + "(" + C11 + ")") + "?\\]?$") }; + } + var c10 = s10(false), l10 = s10(true), u10 = /* @__PURE__ */ function() { + function e21(e23, t11) { + var n11 = [], r11 = true, o11 = false, i11 = void 0; + try { + for (var a11, s11 = e23[Symbol.iterator](); !(r11 = (a11 = s11.next()).done) && (n11.push(a11.value), !t11 || n11.length !== t11); r11 = true) + ; + } catch (e24) { + o11 = true, i11 = e24; + } finally { + try { + !r11 && s11.return && s11.return(); + } finally { + if (o11) + throw i11; + } + } + return n11; + } + return function(t11, n11) { + if (Array.isArray(t11)) + return t11; + if (Symbol.iterator in Object(t11)) + return e21(t11, n11); + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + }; + }(), f10 = function(e21) { + if (Array.isArray(e21)) { + for (var t11 = 0, n11 = Array(e21.length); t11 < e21.length; t11++) + n11[t11] = e21[t11]; + return n11; + } + return Array.from(e21); + }, d10 = 2147483647, h10 = 36, v10 = 1, p10 = 26, m10 = 38, g10 = 700, y10 = 72, b10 = 128, k10 = "-", w10 = /^xn--/, x10 = /[^\0-\x7E]/, j10 = /[\x2E\u3002\uFF0E\uFF61]/g, S10 = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, C10 = h10 - v10, $10 = Math.floor, _10 = String.fromCharCode; + function O10(e21) { + throw new RangeError(S10[e21]); + } + function M10(e21, t11) { + for (var n11 = [], r11 = e21.length; r11--; ) + n11[r11] = t11(e21[r11]); + return n11; + } + function E10(e21, t11) { + var n11 = e21.split("@"), r11 = ""; + return n11.length > 1 && (r11 = n11[0] + "@", e21 = n11[1]), r11 + M10((e21 = e21.replace(j10, ".")).split("."), t11).join("."); + } + function A10(e21) { + for (var t11 = [], n11 = 0, r11 = e21.length; n11 < r11; ) { + var o11 = e21.charCodeAt(n11++); + if (o11 >= 55296 && o11 <= 56319 && n11 < r11) { + var i11 = e21.charCodeAt(n11++); + 56320 == (64512 & i11) ? t11.push(((1023 & o11) << 10) + (1023 & i11) + 65536) : (t11.push(o11), n11--); + } else + t11.push(o11); + } + return t11; + } + var P10 = function(e21) { + return String.fromCodePoint.apply(String, f10(e21)); + }, T8 = function(e21) { + return e21 - 48 < 10 ? e21 - 22 : e21 - 65 < 26 ? e21 - 65 : e21 - 97 < 26 ? e21 - 97 : h10; + }, R8 = function(e21, t11) { + return e21 + 22 + 75 * (e21 < 26) - ((0 != t11) << 5); + }, N8 = function(e21, t11, n11) { + var r11 = 0; + for (e21 = n11 ? $10(e21 / g10) : e21 >> 1, e21 += $10(e21 / t11); e21 > C10 * p10 >> 1; r11 += h10) + e21 = $10(e21 / C10); + return $10(r11 + (C10 + 1) * e21 / (e21 + m10)); + }, I10 = function(e21) { + var t11 = [], n11 = e21.length, r11 = 0, o11 = b10, i11 = y10, a11 = e21.lastIndexOf(k10); + a11 < 0 && (a11 = 0); + for (var s11 = 0; s11 < a11; ++s11) + e21.charCodeAt(s11) >= 128 && O10("not-basic"), t11.push(e21.charCodeAt(s11)); + for (var c11 = a11 > 0 ? a11 + 1 : 0; c11 < n11; ) { + for (var l11 = r11, u11 = 1, f11 = h10; ; f11 += h10) { + c11 >= n11 && O10("invalid-input"); + var m11 = T8(e21.charCodeAt(c11++)); + (m11 >= h10 || m11 > $10((d10 - r11) / u11)) && O10("overflow"), r11 += m11 * u11; + var g11 = f11 <= i11 ? v10 : f11 >= i11 + p10 ? p10 : f11 - i11; + if (m11 < g11) + break; + var w11 = h10 - g11; + u11 > $10(d10 / w11) && O10("overflow"), u11 *= w11; + } + var x11 = t11.length + 1; + i11 = N8(r11 - l11, x11, 0 == l11), $10(r11 / x11) > d10 - o11 && O10("overflow"), o11 += $10(r11 / x11), r11 %= x11, t11.splice(r11++, 0, o11); + } + return String.fromCodePoint.apply(String, t11); + }, D10 = function(e21) { + var t11 = [], n11 = (e21 = A10(e21)).length, r11 = b10, o11 = 0, i11 = y10, a11 = true, s11 = false, c11 = void 0; + try { + for (var l11, u11 = e21[Symbol.iterator](); !(a11 = (l11 = u11.next()).done); a11 = true) { + var f11 = l11.value; + f11 < 128 && t11.push(_10(f11)); + } + } catch (e23) { + s11 = true, c11 = e23; + } finally { + try { + !a11 && u11.return && u11.return(); + } finally { + if (s11) + throw c11; + } + } + var m11 = t11.length, g11 = m11; + for (m11 && t11.push(k10); g11 < n11; ) { + var w11 = d10, x11 = true, j11 = false, S11 = void 0; + try { + for (var C11, M11 = e21[Symbol.iterator](); !(x11 = (C11 = M11.next()).done); x11 = true) { + var E11 = C11.value; + E11 >= r11 && E11 < w11 && (w11 = E11); + } + } catch (e23) { + j11 = true, S11 = e23; + } finally { + try { + !x11 && M11.return && M11.return(); + } finally { + if (j11) + throw S11; + } + } + var P11 = g11 + 1; + w11 - r11 > $10((d10 - o11) / P11) && O10("overflow"), o11 += (w11 - r11) * P11, r11 = w11; + var T10 = true, I11 = false, D11 = void 0; + try { + for (var q11, z11 = e21[Symbol.iterator](); !(T10 = (q11 = z11.next()).done); T10 = true) { + var B11 = q11.value; + if (B11 < r11 && ++o11 > d10 && O10("overflow"), B11 == r11) { + for (var L11 = o11, F11 = h10; ; F11 += h10) { + var V11 = F11 <= i11 ? v10 : F11 >= i11 + p10 ? p10 : F11 - i11; + if (L11 < V11) + break; + var H11 = L11 - V11, W11 = h10 - V11; + t11.push(_10(R8(V11 + H11 % W11, 0))), L11 = $10(H11 / W11); + } + t11.push(_10(R8(L11, 0))), i11 = N8(o11, P11, g11 == m11), o11 = 0, ++g11; + } + } + } catch (e23) { + I11 = true, D11 = e23; + } finally { + try { + !T10 && z11.return && z11.return(); + } finally { + if (I11) + throw D11; + } + } + ++o11, ++r11; + } + return t11.join(""); + }, q10 = function(e21) { + return E10(e21, function(e23) { + return w10.test(e23) ? I10(e23.slice(4).toLowerCase()) : e23; + }); + }, z10 = function(e21) { + return E10(e21, function(e23) { + return x10.test(e23) ? "xn--" + D10(e23) : e23; + }); + }, B10 = { version: "2.1.0", ucs2: { decode: A10, encode: P10 }, decode: I10, encode: D10, toASCII: z10, toUnicode: q10 }, L10 = {}; + function F10(e21) { + var t11 = e21.charCodeAt(0); + return t11 < 16 ? "%0" + t11.toString(16).toUpperCase() : t11 < 128 ? "%" + t11.toString(16).toUpperCase() : t11 < 2048 ? "%" + (t11 >> 6 | 192).toString(16).toUpperCase() + "%" + (63 & t11 | 128).toString(16).toUpperCase() : "%" + (t11 >> 12 | 224).toString(16).toUpperCase() + "%" + (t11 >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (63 & t11 | 128).toString(16).toUpperCase(); + } + function V10(e21) { + for (var t11 = "", n11 = 0, r11 = e21.length; n11 < r11; ) { + var o11 = parseInt(e21.substr(n11 + 1, 2), 16); + if (o11 < 128) + t11 += String.fromCharCode(o11), n11 += 3; + else if (o11 >= 194 && o11 < 224) { + if (r11 - n11 >= 6) { + var i11 = parseInt(e21.substr(n11 + 4, 2), 16); + t11 += String.fromCharCode((31 & o11) << 6 | 63 & i11); + } else + t11 += e21.substr(n11, 6); + n11 += 6; + } else if (o11 >= 224) { + if (r11 - n11 >= 9) { + var a11 = parseInt(e21.substr(n11 + 4, 2), 16), s11 = parseInt(e21.substr(n11 + 7, 2), 16); + t11 += String.fromCharCode((15 & o11) << 12 | (63 & a11) << 6 | 63 & s11); + } else + t11 += e21.substr(n11, 9); + n11 += 9; + } else + t11 += e21.substr(n11, 3), n11 += 3; + } + return t11; + } + function H10(e21, t11) { + function n11(e23) { + var n12 = V10(e23); + return n12.match(t11.UNRESERVED) ? n12 : e23; + } + return e21.scheme && (e21.scheme = String(e21.scheme).replace(t11.PCT_ENCODED, n11).toLowerCase().replace(t11.NOT_SCHEME, "")), void 0 !== e21.userinfo && (e21.userinfo = String(e21.userinfo).replace(t11.PCT_ENCODED, n11).replace(t11.NOT_USERINFO, F10).replace(t11.PCT_ENCODED, o10)), void 0 !== e21.host && (e21.host = String(e21.host).replace(t11.PCT_ENCODED, n11).toLowerCase().replace(t11.NOT_HOST, F10).replace(t11.PCT_ENCODED, o10)), void 0 !== e21.path && (e21.path = String(e21.path).replace(t11.PCT_ENCODED, n11).replace(e21.scheme ? t11.NOT_PATH : t11.NOT_PATH_NOSCHEME, F10).replace(t11.PCT_ENCODED, o10)), void 0 !== e21.query && (e21.query = String(e21.query).replace(t11.PCT_ENCODED, n11).replace(t11.NOT_QUERY, F10).replace(t11.PCT_ENCODED, o10)), void 0 !== e21.fragment && (e21.fragment = String(e21.fragment).replace(t11.PCT_ENCODED, n11).replace(t11.NOT_FRAGMENT, F10).replace(t11.PCT_ENCODED, o10)), e21; + } + function W10(e21) { + return e21.replace(/^0*(.*)/, "$1") || "0"; + } + function U10(e21, t11) { + var n11 = e21.match(t11.IPV4ADDRESS) || [], r11 = u10(n11, 2)[1]; + return r11 ? r11.split(".").map(W10).join(".") : e21; + } + function J10(e21, t11) { + var n11 = e21.match(t11.IPV6ADDRESS) || [], r11 = u10(n11, 3), o11 = r11[1], i11 = r11[2]; + if (o11) { + for (var a11 = o11.toLowerCase().split("::").reverse(), s11 = u10(a11, 2), c11 = s11[0], l11 = s11[1], f11 = l11 ? l11.split(":").map(W10) : [], d11 = c11.split(":").map(W10), h11 = t11.IPV4ADDRESS.test(d11[d11.length - 1]), v11 = h11 ? 7 : 8, p11 = d11.length - v11, m11 = Array(v11), g11 = 0; g11 < v11; ++g11) + m11[g11] = f11[g11] || d11[p11 + g11] || ""; + h11 && (m11[v11 - 1] = U10(m11[v11 - 1], t11)); + var y11 = m11.reduce(function(e23, t12, n12) { + if (!t12 || "0" === t12) { + var r12 = e23[e23.length - 1]; + r12 && r12.index + r12.length === n12 ? r12.length++ : e23.push({ index: n12, length: 1 }); + } + return e23; + }, []).sort(function(e23, t12) { + return t12.length - e23.length; + })[0], b11 = void 0; + if (y11 && y11.length > 1) { + var k11 = m11.slice(0, y11.index), w11 = m11.slice(y11.index + y11.length); + b11 = k11.join(":") + "::" + w11.join(":"); + } else + b11 = m11.join(":"); + return i11 && (b11 += "%" + i11), b11; + } + return e21; + } + var K10 = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, G10 = void 0 === "".match(/(){0}/)[1]; + function Q10(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n11 = {}, r11 = false !== t11.iri ? l10 : c10; + "suffix" === t11.reference && (e21 = (t11.scheme ? t11.scheme + ":" : "") + "//" + e21); + var o11 = e21.match(K10); + if (o11) { + G10 ? (n11.scheme = o11[1], n11.userinfo = o11[3], n11.host = o11[4], n11.port = parseInt(o11[5], 10), n11.path = o11[6] || "", n11.query = o11[7], n11.fragment = o11[8], isNaN(n11.port) && (n11.port = o11[5])) : (n11.scheme = o11[1] || void 0, n11.userinfo = -1 !== e21.indexOf("@") ? o11[3] : void 0, n11.host = -1 !== e21.indexOf("//") ? o11[4] : void 0, n11.port = parseInt(o11[5], 10), n11.path = o11[6] || "", n11.query = -1 !== e21.indexOf("?") ? o11[7] : void 0, n11.fragment = -1 !== e21.indexOf("#") ? o11[8] : void 0, isNaN(n11.port) && (n11.port = e21.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? o11[4] : void 0)), n11.host && (n11.host = J10(U10(n11.host, r11), r11)), void 0 !== n11.scheme || void 0 !== n11.userinfo || void 0 !== n11.host || void 0 !== n11.port || n11.path || void 0 !== n11.query ? void 0 === n11.scheme ? n11.reference = "relative" : void 0 === n11.fragment ? n11.reference = "absolute" : n11.reference = "uri" : n11.reference = "same-document", t11.reference && "suffix" !== t11.reference && t11.reference !== n11.reference && (n11.error = n11.error || "URI is not a " + t11.reference + " reference."); + var i11 = L10[(t11.scheme || n11.scheme || "").toLowerCase()]; + if (t11.unicodeSupport || i11 && i11.unicodeSupport) + H10(n11, r11); + else { + if (n11.host && (t11.domainHost || i11 && i11.domainHost)) + try { + n11.host = B10.toASCII(n11.host.replace(r11.PCT_ENCODED, V10).toLowerCase()); + } catch (e23) { + n11.error = n11.error || "Host's domain name can not be converted to ASCII via punycode: " + e23; + } + H10(n11, c10); + } + i11 && i11.parse && i11.parse(n11, t11); + } else + n11.error = n11.error || "URI can not be parsed."; + return n11; + } + function Y10(e21, t11) { + var n11 = false !== t11.iri ? l10 : c10, r11 = []; + return void 0 !== e21.userinfo && (r11.push(e21.userinfo), r11.push("@")), void 0 !== e21.host && r11.push(J10(U10(String(e21.host), n11), n11).replace(n11.IPV6ADDRESS, function(e23, t12, n12) { + return "[" + t12 + (n12 ? "%25" + n12 : "") + "]"; + })), "number" != typeof e21.port && "string" != typeof e21.port || (r11.push(":"), r11.push(String(e21.port))), r11.length ? r11.join("") : void 0; + } + var X10 = /^\.\.?\//, Z10 = /^\/\.(\/|$)/, ee2 = /^\/\.\.(\/|$)/, te2 = /^\/?(?:.|\n)*?(?=\/|$)/; + function ne2(e21) { + for (var t11 = []; e21.length; ) + if (e21.match(X10)) + e21 = e21.replace(X10, ""); + else if (e21.match(Z10)) + e21 = e21.replace(Z10, "/"); + else if (e21.match(ee2)) + e21 = e21.replace(ee2, "/"), t11.pop(); + else if ("." === e21 || ".." === e21) + e21 = ""; + else { + var n11 = e21.match(te2); + if (!n11) + throw new Error("Unexpected dot segment condition"); + var r11 = n11[0]; + e21 = e21.slice(r11.length), t11.push(r11); + } + return t11.join(""); + } + function re2(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n11 = t11.iri ? l10 : c10, r11 = [], o11 = L10[(t11.scheme || e21.scheme || "").toLowerCase()]; + if (o11 && o11.serialize && o11.serialize(e21, t11), e21.host) { + if (n11.IPV6ADDRESS.test(e21.host)) + ; + else if (t11.domainHost || o11 && o11.domainHost) + try { + e21.host = t11.iri ? B10.toUnicode(e21.host) : B10.toASCII(e21.host.replace(n11.PCT_ENCODED, V10).toLowerCase()); + } catch (n12) { + e21.error = e21.error || "Host's domain name can not be converted to " + (t11.iri ? "Unicode" : "ASCII") + " via punycode: " + n12; + } + } + H10(e21, n11), "suffix" !== t11.reference && e21.scheme && (r11.push(e21.scheme), r11.push(":")); + var i11 = Y10(e21, t11); + if (void 0 !== i11 && ("suffix" !== t11.reference && r11.push("//"), r11.push(i11), e21.path && "/" !== e21.path.charAt(0) && r11.push("/")), void 0 !== e21.path) { + var a11 = e21.path; + t11.absolutePath || o11 && o11.absolutePath || (a11 = ne2(a11)), void 0 === i11 && (a11 = a11.replace(/^\/\//, "/%2F")), r11.push(a11); + } + return void 0 !== e21.query && (r11.push("?"), r11.push(e21.query)), void 0 !== e21.fragment && (r11.push("#"), r11.push(e21.fragment)), r11.join(""); + } + function oe2(e21, t11) { + var n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r11 = {}; + return arguments[3] || (e21 = Q10(re2(e21, n11), n11), t11 = Q10(re2(t11, n11), n11)), !(n11 = n11 || {}).tolerant && t11.scheme ? (r11.scheme = t11.scheme, r11.userinfo = t11.userinfo, r11.host = t11.host, r11.port = t11.port, r11.path = ne2(t11.path || ""), r11.query = t11.query) : (void 0 !== t11.userinfo || void 0 !== t11.host || void 0 !== t11.port ? (r11.userinfo = t11.userinfo, r11.host = t11.host, r11.port = t11.port, r11.path = ne2(t11.path || ""), r11.query = t11.query) : (t11.path ? ("/" === t11.path.charAt(0) ? r11.path = ne2(t11.path) : (void 0 === e21.userinfo && void 0 === e21.host && void 0 === e21.port || e21.path ? e21.path ? r11.path = e21.path.slice(0, e21.path.lastIndexOf("/") + 1) + t11.path : r11.path = t11.path : r11.path = "/" + t11.path, r11.path = ne2(r11.path)), r11.query = t11.query) : (r11.path = e21.path, void 0 !== t11.query ? r11.query = t11.query : r11.query = e21.query), r11.userinfo = e21.userinfo, r11.host = e21.host, r11.port = e21.port), r11.scheme = e21.scheme), r11.fragment = t11.fragment, r11; + } + function ie2(e21, t11, n11) { + var r11 = a10({ scheme: "null" }, n11); + return re2(oe2(Q10(e21, r11), Q10(t11, r11), r11, true), r11); + } + function ae2(e21, t11) { + return "string" == typeof e21 ? e21 = re2(Q10(e21, t11), t11) : "object" === r10(e21) && (e21 = Q10(re2(e21, t11), t11)), e21; + } + function se2(e21, t11, n11) { + return "string" == typeof e21 ? e21 = re2(Q10(e21, n11), n11) : "object" === r10(e21) && (e21 = re2(e21, n11)), "string" == typeof t11 ? t11 = re2(Q10(t11, n11), n11) : "object" === r10(t11) && (t11 = re2(t11, n11)), e21 === t11; + } + function ce2(e21, t11) { + return e21 && e21.toString().replace(t11 && t11.iri ? l10.ESCAPE : c10.ESCAPE, F10); + } + function le2(e21, t11) { + return e21 && e21.toString().replace(t11 && t11.iri ? l10.PCT_ENCODED : c10.PCT_ENCODED, V10); + } + var ue2 = { scheme: "http", domainHost: true, parse: function(e21, t11) { + return e21.host || (e21.error = e21.error || "HTTP URIs must have a host."), e21; + }, serialize: function(e21, t11) { + var n11 = "https" === String(e21.scheme).toLowerCase(); + return e21.port !== (n11 ? 443 : 80) && "" !== e21.port || (e21.port = void 0), e21.path || (e21.path = "/"), e21; + } }, fe2 = { scheme: "https", domainHost: ue2.domainHost, parse: ue2.parse, serialize: ue2.serialize }; + function de2(e21) { + return "boolean" == typeof e21.secure ? e21.secure : "wss" === String(e21.scheme).toLowerCase(); + } + var he2 = { scheme: "ws", domainHost: true, parse: function(e21, t11) { + var n11 = e21; + return n11.secure = de2(n11), n11.resourceName = (n11.path || "/") + (n11.query ? "?" + n11.query : ""), n11.path = void 0, n11.query = void 0, n11; + }, serialize: function(e21, t11) { + if (e21.port !== (de2(e21) ? 443 : 80) && "" !== e21.port || (e21.port = void 0), "boolean" == typeof e21.secure && (e21.scheme = e21.secure ? "wss" : "ws", e21.secure = void 0), e21.resourceName) { + var n11 = e21.resourceName.split("?"), r11 = u10(n11, 2), o11 = r11[0], i11 = r11[1]; + e21.path = o11 && "/" !== o11 ? o11 : void 0, e21.query = i11, e21.resourceName = void 0; + } + return e21.fragment = void 0, e21; + } }, ve2 = { scheme: "wss", domainHost: he2.domainHost, parse: he2.parse, serialize: he2.serialize }, pe2 = {}, me2 = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", ge2 = "[0-9A-Fa-f]", ye2 = n10(n10("%[EFef]" + ge2 + "%" + ge2 + ge2 + "%" + ge2 + ge2) + "|" + n10("%[89A-Fa-f]" + ge2 + "%" + ge2 + ge2) + "|" + n10("%" + ge2 + ge2)), be2 = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", ke2 = t10("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", '[\\"\\\\]'), we2 = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", xe2 = new RegExp(me2, "g"), je2 = new RegExp(ye2, "g"), Se2 = new RegExp(t10("[^]", be2, "[\\.]", '[\\"]', ke2), "g"), Ce2 = new RegExp(t10("[^]", me2, we2), "g"), $e2 = Ce2; + function _e2(e21) { + var t11 = V10(e21); + return t11.match(xe2) ? t11 : e21; + } + var Oe2 = { scheme: "mailto", parse: function(e21, t11) { + var n11 = e21, r11 = n11.to = n11.path ? n11.path.split(",") : []; + if (n11.path = void 0, n11.query) { + for (var o11 = false, i11 = {}, a11 = n11.query.split("&"), s11 = 0, c11 = a11.length; s11 < c11; ++s11) { + var l11 = a11[s11].split("="); + switch (l11[0]) { + case "to": + for (var u11 = l11[1].split(","), f11 = 0, d11 = u11.length; f11 < d11; ++f11) + r11.push(u11[f11]); + break; + case "subject": + n11.subject = le2(l11[1], t11); + break; + case "body": + n11.body = le2(l11[1], t11); + break; + default: + o11 = true, i11[le2(l11[0], t11)] = le2(l11[1], t11); + } + } + o11 && (n11.headers = i11); + } + n11.query = void 0; + for (var h11 = 0, v11 = r11.length; h11 < v11; ++h11) { + var p11 = r11[h11].split("@"); + if (p11[0] = le2(p11[0]), t11.unicodeSupport) + p11[1] = le2(p11[1], t11).toLowerCase(); + else + try { + p11[1] = B10.toASCII(le2(p11[1], t11).toLowerCase()); + } catch (e23) { + n11.error = n11.error || "Email address's domain name can not be converted to ASCII via punycode: " + e23; + } + r11[h11] = p11.join("@"); + } + return n11; + }, serialize: function(e21, t11) { + var n11 = e21, r11 = i10(e21.to); + if (r11) { + for (var a11 = 0, s11 = r11.length; a11 < s11; ++a11) { + var c11 = String(r11[a11]), l11 = c11.lastIndexOf("@"), u11 = c11.slice(0, l11).replace(je2, _e2).replace(je2, o10).replace(Se2, F10), f11 = c11.slice(l11 + 1); + try { + f11 = t11.iri ? B10.toUnicode(f11) : B10.toASCII(le2(f11, t11).toLowerCase()); + } catch (e23) { + n11.error = n11.error || "Email address's domain name can not be converted to " + (t11.iri ? "Unicode" : "ASCII") + " via punycode: " + e23; + } + r11[a11] = u11 + "@" + f11; + } + n11.path = r11.join(","); + } + var d11 = e21.headers = e21.headers || {}; + e21.subject && (d11.subject = e21.subject), e21.body && (d11.body = e21.body); + var h11 = []; + for (var v11 in d11) + d11[v11] !== pe2[v11] && h11.push(v11.replace(je2, _e2).replace(je2, o10).replace(Ce2, F10) + "=" + d11[v11].replace(je2, _e2).replace(je2, o10).replace($e2, F10)); + return h11.length && (n11.query = h11.join("&")), n11; + } }, Me2 = /^([^\:]+)\:(.*)/, Ee2 = { scheme: "urn", parse: function(e21, t11) { + var n11 = e21.path && e21.path.match(Me2), r11 = e21; + if (n11) { + var o11 = t11.scheme || r11.scheme || "urn", i11 = n11[1].toLowerCase(), a11 = n11[2], s11 = o11 + ":" + (t11.nid || i11), c11 = L10[s11]; + r11.nid = i11, r11.nss = a11, r11.path = void 0, c11 && (r11 = c11.parse(r11, t11)); + } else + r11.error = r11.error || "URN can not be parsed."; + return r11; + }, serialize: function(e21, t11) { + var n11 = t11.scheme || e21.scheme || "urn", r11 = e21.nid, o11 = n11 + ":" + (t11.nid || r11), i11 = L10[o11]; + i11 && (e21 = i11.serialize(e21, t11)); + var a11 = e21, s11 = e21.nss; + return a11.path = (r11 || t11.nid) + ":" + s11, a11; + } }, Ae2 = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Pe2 = { scheme: "urn:uuid", parse: function(e21, t11) { + var n11 = e21; + return n11.uuid = n11.nss, n11.nss = void 0, t11.tolerant || n11.uuid && n11.uuid.match(Ae2) || (n11.error = n11.error || "UUID is not valid."), n11; + }, serialize: function(e21, t11) { + var n11 = e21; + return n11.nss = (e21.uuid || "").toLowerCase(), n11; + } }; + L10[ue2.scheme] = ue2, L10[fe2.scheme] = fe2, L10[he2.scheme] = he2, L10[ve2.scheme] = ve2, L10[Oe2.scheme] = Oe2, L10[Ee2.scheme] = Ee2, L10[Pe2.scheme] = Pe2, e20.SCHEMES = L10, e20.pctEncChar = F10, e20.pctDecChars = V10, e20.parse = Q10, e20.removeDotSegments = ne2, e20.serialize = re2, e20.resolveComponents = oe2, e20.resolve = ie2, e20.normalize = ae2, e20.equal = se2, e20.escapeComponent = ce2, e20.unescapeComponent = le2, Object.defineProperty(e20, "__esModule", { value: true }); + }(c6.exports); + var l6 = c6.exports; + Object.defineProperty(s6, "__esModule", { value: true }); + var u6 = l6; + u6.code = 'require("ajv/dist/runtime/uri").default', s6.default = u6, function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.CodeGen = e20.Name = e20.nil = e20.stringify = e20.str = e20._ = e20.KeywordCxt = void 0; + var t10 = q5(); + Object.defineProperty(e20, "KeywordCxt", { enumerable: true, get: function() { + return t10.KeywordCxt; + } }); + var n10 = G8(); + Object.defineProperty(e20, "_", { enumerable: true, get: function() { + return n10._; + } }), Object.defineProperty(e20, "str", { enumerable: true, get: function() { + return n10.str; + } }), Object.defineProperty(e20, "stringify", { enumerable: true, get: function() { + return n10.stringify; + } }), Object.defineProperty(e20, "nil", { enumerable: true, get: function() { + return n10.nil; + } }), Object.defineProperty(e20, "Name", { enumerable: true, get: function() { + return n10.Name; + } }), Object.defineProperty(e20, "CodeGen", { enumerable: true, get: function() { + return n10.CodeGen; + } }); + var r10 = L5(), o10 = H5(), i10 = o5, a10 = W5, s10 = G8(), c10 = b5, l10 = r5, u10 = Q8, f10 = a6, d10 = s6, h10 = function(e21, t11) { + return new RegExp(e21, t11); + }; + h10.code = "new RegExp"; + var v10 = ["removeAdditional", "useDefaults", "coerceTypes"], p10 = /* @__PURE__ */ new Set(["validate", "serialize", "parse", "wrapper", "root", "schema", "keyword", "pattern", "formats", "validate$data", "func", "obj", "Error"]), m10 = { errorDataPath: "", format: "`validateFormats: false` can be used instead.", nullable: '"nullable" keyword is supported by default.', jsonPointers: "Deprecated jsPropertySyntax can be used instead.", extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", sourceCode: "Use option `code: {source: true}`", strictDefaults: "It is default now, see option `strict`.", strictKeywords: "It is default now, see option `strict`.", uniqueItems: '"uniqueItems" keyword is always validated.', unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", cache: "Map is used as cache, schema object as key.", serialize: "Map is used as cache, schema object as key.", ajvErrors: "It is default now." }, g10 = { ignoreKeywordsWithRef: "", jsPropertySyntax: "", unicode: '"minLength"/"maxLength" account for unicode characters by default.' }; + var y10 = function() { + function e21() { + var t11 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + No(this, e21), this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), t11 = this.opts = Ro(Ro({}, t11), function(e23) { + var t12, n12, r12, o12, i11, a12, s11, c11, l11, u11, f11, v11, p11, m11, g11, y11, b11, k11, w11, x11, j11, S11, C11, $11, _11, O11 = e23.strict, M11 = null === (t12 = e23.code) || void 0 === t12 ? void 0 : t12.optimize, E11 = true === M11 || void 0 === M11 ? 1 : M11 || 0, A11 = null !== (r12 = null === (n12 = e23.code) || void 0 === n12 ? void 0 : n12.regExp) && void 0 !== r12 ? r12 : h10, P11 = null !== (o12 = e23.uriResolver) && void 0 !== o12 ? o12 : d10.default; + return { strictSchema: null === (a12 = null !== (i11 = e23.strictSchema) && void 0 !== i11 ? i11 : O11) || void 0 === a12 || a12, strictNumbers: null === (c11 = null !== (s11 = e23.strictNumbers) && void 0 !== s11 ? s11 : O11) || void 0 === c11 || c11, strictTypes: null !== (u11 = null !== (l11 = e23.strictTypes) && void 0 !== l11 ? l11 : O11) && void 0 !== u11 ? u11 : "log", strictTuples: null !== (v11 = null !== (f11 = e23.strictTuples) && void 0 !== f11 ? f11 : O11) && void 0 !== v11 ? v11 : "log", strictRequired: null !== (m11 = null !== (p11 = e23.strictRequired) && void 0 !== p11 ? p11 : O11) && void 0 !== m11 && m11, code: e23.code ? Ro(Ro({}, e23.code), {}, { optimize: E11, regExp: A11 }) : { optimize: E11, regExp: A11 }, loopRequired: null !== (g11 = e23.loopRequired) && void 0 !== g11 ? g11 : 200, loopEnum: null !== (y11 = e23.loopEnum) && void 0 !== y11 ? y11 : 200, meta: null === (b11 = e23.meta) || void 0 === b11 || b11, messages: null === (k11 = e23.messages) || void 0 === k11 || k11, inlineRefs: null === (w11 = e23.inlineRefs) || void 0 === w11 || w11, schemaId: null !== (x11 = e23.schemaId) && void 0 !== x11 ? x11 : "$id", addUsedSchema: null === (j11 = e23.addUsedSchema) || void 0 === j11 || j11, validateSchema: null === (S11 = e23.validateSchema) || void 0 === S11 || S11, validateFormats: null === (C11 = e23.validateFormats) || void 0 === C11 || C11, unicodeRegExp: null === ($11 = e23.unicodeRegExp) || void 0 === $11 || $11, int32range: null === (_11 = e23.int32range) || void 0 === _11 || _11, uriResolver: P11 }; + }(t11)); + var n11 = this.opts.code, r11 = n11.es5, o11 = n11.lines; + this.scope = new s10.ValueScope({ scope: {}, prefixes: p10, es5: r11, lines: o11 }), this.logger = function(e23) { + if (false === e23) + return C10; + if (void 0 === e23) + return console; + if (e23.log && e23.warn && e23.error) + return e23; + throw new Error("logger must implement log, warn and error methods"); + }(t11.logger); + var a11 = t11.validateFormats; + t11.validateFormats = false, this.RULES = (0, i10.getRules)(), b10.call(this, m10, t11, "NOT SUPPORTED"), b10.call(this, g10, t11, "DEPRECATED", "warn"), this._metaOpts = S10.call(this), t11.formats && x10.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), t11.keywords && j10.call(this, t11.keywords), "object" == Ho(t11.meta) && this.addMetaSchema(t11.meta), w10.call(this), t11.validateFormats = a11; + } + return Do(e21, [{ key: "_addVocabularies", value: function() { + this.addKeyword("$async"); + } }, { key: "_addDefaultMetaSchema", value: function() { + var e23 = this.opts, t11 = e23.$data, n11 = e23.meta, r11 = e23.schemaId, o11 = f10; + "id" === r11 && ((o11 = Ro({}, f10)).id = o11.$id, delete o11.$id), n11 && t11 && this.addMetaSchema(o11, o11[r11], false); + } }, { key: "defaultMeta", value: function() { + var e23 = this.opts, t11 = e23.meta, n11 = e23.schemaId; + return this.opts.defaultMeta = "object" == Ho(t11) ? t11[n11] || t11 : void 0; + } }, { key: "validate", value: function(e23, t11) { + var n11; + if ("string" == typeof e23) { + if (!(n11 = this.getSchema(e23))) + throw new Error('no schema with key or ref "'.concat(e23, '"')); + } else + n11 = this.compile(e23); + var r11 = n11(t11); + return "$async" in n11 || (this.errors = n11.errors), r11; + } }, { key: "compile", value: function(e23, t11) { + var n11 = this._addSchema(e23, t11); + return n11.validate || this._compileSchemaEnv(n11); + } }, { key: "compileAsync", value: function(e23, t11) { + if ("function" != typeof this.opts.loadSchema) + throw new Error("options.loadSchema should be a function"); + var n11 = this.opts.loadSchema; + return r11.call(this, e23, t11); + function r11(e24, t12) { + return i11.apply(this, arguments); + } + function i11() { + return (i11 = xo(ko().mark(function e24(t12, n12) { + var r12; + return ko().wrap(function(e25) { + for (; ; ) + switch (e25.prev = e25.next) { + case 0: + return e25.next = 2, a11.call(this, t12.$schema); + case 2: + return r12 = this._addSchema(t12, n12), e25.abrupt("return", r12.validate || c11.call(this, r12)); + case 4: + case "end": + return e25.stop(); + } + }, e24, this); + }))).apply(this, arguments); + } + function a11(e24) { + return s11.apply(this, arguments); + } + function s11() { + return (s11 = xo(ko().mark(function e24(t12) { + return ko().wrap(function(e25) { + for (; ; ) + switch (e25.prev = e25.next) { + case 0: + if (!t12 || this.getSchema(t12)) { + e25.next = 3; + break; + } + return e25.next = 3, r11.call(this, { $ref: t12 }, true); + case 3: + case "end": + return e25.stop(); + } + }, e24, this); + }))).apply(this, arguments); + } + function c11(e24) { + return l11.apply(this, arguments); + } + function l11() { + return (l11 = xo(ko().mark(function e24(t12) { + return ko().wrap(function(e25) { + for (; ; ) + switch (e25.prev = e25.next) { + case 0: + return e25.prev = 0, e25.abrupt("return", this._compileSchemaEnv(t12)); + case 4: + if (e25.prev = 4, e25.t0 = e25.catch(0), e25.t0 instanceof o10.default) { + e25.next = 8; + break; + } + throw e25.t0; + case 8: + return u11.call(this, e25.t0), e25.next = 11, f11.call(this, e25.t0.missingSchema); + case 11: + return e25.abrupt("return", c11.call(this, t12)); + case 12: + case "end": + return e25.stop(); + } + }, e24, this, [[0, 4]]); + }))).apply(this, arguments); + } + function u11(e24) { + var t12 = e24.missingSchema, n12 = e24.missingRef; + if (this.refs[t12]) + throw new Error("AnySchema ".concat(t12, " is loaded but ").concat(n12, " cannot be resolved")); + } + function f11(e24) { + return d11.apply(this, arguments); + } + function d11() { + return d11 = xo(ko().mark(function e24(n12) { + var r12; + return ko().wrap(function(e25) { + for (; ; ) + switch (e25.prev = e25.next) { + case 0: + return e25.next = 2, h11.call(this, n12); + case 2: + if (r12 = e25.sent, this.refs[n12]) { + e25.next = 6; + break; + } + return e25.next = 6, a11.call(this, r12.$schema); + case 6: + this.refs[n12] || this.addSchema(r12, n12, t11); + case 7: + case "end": + return e25.stop(); + } + }, e24, this); + })), d11.apply(this, arguments); + } + function h11(e24) { + return v11.apply(this, arguments); + } + function v11() { + return v11 = xo(ko().mark(function e24(t12) { + var r12; + return ko().wrap(function(e25) { + for (; ; ) + switch (e25.prev = e25.next) { + case 0: + if (!(r12 = this._loading[t12])) { + e25.next = 3; + break; + } + return e25.abrupt("return", r12); + case 3: + return e25.prev = 3, e25.next = 6, this._loading[t12] = n11(t12); + case 6: + return e25.abrupt("return", e25.sent); + case 7: + return e25.prev = 7, delete this._loading[t12], e25.finish(7); + case 10: + case "end": + return e25.stop(); + } + }, e24, this, [[3, , 7, 10]]); + })), v11.apply(this, arguments); + } + } }, { key: "addSchema", value: function(e23, t11, n11) { + var r11, o11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : this.opts.validateSchema; + if (Array.isArray(e23)) { + var i11, a11 = bo(e23); + try { + for (a11.s(); !(i11 = a11.n()).done; ) { + var s11 = i11.value; + this.addSchema(s11, void 0, n11, o11); + } + } catch (e24) { + a11.e(e24); + } finally { + a11.f(); + } + return this; + } + if ("object" === Ho(e23)) { + var l11 = this.opts.schemaId; + if (void 0 !== (r11 = e23[l11]) && "string" != typeof r11) + throw new Error("schema ".concat(l11, " must be string")); + } + return t11 = (0, c10.normalizeId)(t11 || r11), this._checkUnique(t11), this.schemas[t11] = this._addSchema(e23, n11, t11, o11, true), this; + } }, { key: "addMetaSchema", value: function(e23, t11) { + var n11 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.opts.validateSchema; + return this.addSchema(e23, t11, true, n11), this; + } }, { key: "validateSchema", value: function(e23, t11) { + if ("boolean" == typeof e23) + return true; + var n11; + if (void 0 !== (n11 = e23.$schema) && "string" != typeof n11) + throw new Error("$schema must be a string"); + if (!(n11 = n11 || this.opts.defaultMeta || this.defaultMeta())) + return this.logger.warn("meta-schema not available"), this.errors = null, true; + var r11 = this.validate(n11, e23); + if (!r11 && t11) { + var o11 = "schema is invalid: " + this.errorsText(); + if ("log" !== this.opts.validateSchema) + throw new Error(o11); + this.logger.error(o11); + } + return r11; + } }, { key: "getSchema", value: function(e23) { + for (var t11; "string" == typeof (t11 = k10.call(this, e23)); ) + e23 = t11; + if (void 0 === t11) { + var n11 = this.opts.schemaId, r11 = new a10.SchemaEnv({ schema: {}, schemaId: n11 }); + if (!(t11 = a10.resolveSchema.call(this, r11, e23))) + return; + this.refs[e23] = t11; + } + return t11.validate || this._compileSchemaEnv(t11); + } }, { key: "removeSchema", value: function(e23) { + if (e23 instanceof RegExp) + return this._removeAllSchemas(this.schemas, e23), this._removeAllSchemas(this.refs, e23), this; + switch (Ho(e23)) { + case "undefined": + return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this; + case "string": + var t11 = k10.call(this, e23); + return "object" == Ho(t11) && this._cache.delete(t11.schema), delete this.schemas[e23], delete this.refs[e23], this; + case "object": + var n11 = e23; + this._cache.delete(n11); + var r11 = e23[this.opts.schemaId]; + return r11 && (r11 = (0, c10.normalizeId)(r11), delete this.schemas[r11], delete this.refs[r11]), this; + default: + throw new Error("ajv.removeSchema: invalid parameter"); + } + } }, { key: "addVocabulary", value: function(e23) { + var t11, n11 = bo(e23); + try { + for (n11.s(); !(t11 = n11.n()).done; ) { + var r11 = t11.value; + this.addKeyword(r11); + } + } catch (e24) { + n11.e(e24); + } finally { + n11.f(); + } + return this; + } }, { key: "addKeyword", value: function(e23, t11) { + var n11, r11 = this; + if ("string" == typeof e23) + n11 = e23, "object" == Ho(t11) && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), t11.keyword = n11); + else { + if ("object" != Ho(e23) || void 0 !== t11) + throw new Error("invalid addKeywords parameters"); + if (n11 = (t11 = e23).keyword, Array.isArray(n11) && !n11.length) + throw new Error("addKeywords: keyword must be string or non-empty array"); + } + if (_10.call(this, n11, t11), !t11) + return (0, u10.eachItem)(n11, function(e24) { + return O10.call(r11, e24); + }), this; + E10.call(this, t11); + var o11 = Ro(Ro({}, t11), {}, { type: (0, l10.getJSONTypes)(t11.type), schemaType: (0, l10.getJSONTypes)(t11.schemaType) }); + return (0, u10.eachItem)(n11, 0 === o11.type.length ? function(e24) { + return O10.call(r11, e24, o11); + } : function(e24) { + return o11.type.forEach(function(t12) { + return O10.call(r11, e24, o11, t12); + }); + }), this; + } }, { key: "getKeyword", value: function(e23) { + var t11 = this.RULES.all[e23]; + return "object" == Ho(t11) ? t11.definition : !!t11; + } }, { key: "removeKeyword", value: function(e23) { + var t11 = this.RULES; + delete t11.keywords[e23], delete t11.all[e23]; + var n11, r11 = bo(t11.rules); + try { + for (r11.s(); !(n11 = r11.n()).done; ) { + var o11 = n11.value, i11 = o11.rules.findIndex(function(t12) { + return t12.keyword === e23; + }); + i11 >= 0 && o11.rules.splice(i11, 1); + } + } catch (e24) { + r11.e(e24); + } finally { + r11.f(); + } + return this; + } }, { key: "addFormat", value: function(e23, t11) { + return "string" == typeof t11 && (t11 = new RegExp(t11)), this.formats[e23] = t11, this; + } }, { key: "errorsText", value: function() { + var e23 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.errors, t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n11 = t11.separator, r11 = void 0 === n11 ? ", " : n11, o11 = t11.dataVar, i11 = void 0 === o11 ? "data" : o11; + return e23 && 0 !== e23.length ? e23.map(function(e24) { + return "".concat(i11).concat(e24.instancePath, " ").concat(e24.message); + }).reduce(function(e24, t12) { + return e24 + r11 + t12; + }) : "No errors"; + } }, { key: "$dataMetaSchema", value: function(e23, t11) { + var n11 = this.RULES.all; + e23 = JSON.parse(JSON.stringify(e23)); + var r11, o11 = bo(t11); + try { + for (o11.s(); !(r11 = o11.n()).done; ) { + var i11, a11 = r11.value.split("/").slice(1), s11 = e23, c11 = bo(a11); + try { + for (c11.s(); !(i11 = c11.n()).done; ) { + s11 = s11[i11.value]; + } + } catch (e24) { + c11.e(e24); + } finally { + c11.f(); + } + for (var l11 in n11) { + var u11 = n11[l11]; + if ("object" == Ho(u11)) { + var f11 = u11.definition.$data, d11 = s11[l11]; + f11 && d11 && (s11[l11] = P10(d11)); + } + } + } + } catch (e24) { + o11.e(e24); + } finally { + o11.f(); + } + return e23; + } }, { key: "_removeAllSchemas", value: function(e23, t11) { + for (var n11 in e23) { + var r11 = e23[n11]; + t11 && !t11.test(n11) || ("string" == typeof r11 ? delete e23[n11] : r11 && !r11.meta && (this._cache.delete(r11.schema), delete e23[n11])); + } + } }, { key: "_addSchema", value: function(e23, t11, n11) { + var r11, o11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : this.opts.validateSchema, i11 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.opts.addUsedSchema, s11 = this.opts.schemaId; + if ("object" == Ho(e23)) + r11 = e23[s11]; + else { + if (this.opts.jtd) + throw new Error("schema must be object"); + if ("boolean" != typeof e23) + throw new Error("schema must be object or boolean"); + } + var l11 = this._cache.get(e23); + if (void 0 !== l11) + return l11; + n11 = (0, c10.normalizeId)(r11 || n11); + var u11 = c10.getSchemaRefs.call(this, e23, n11); + return l11 = new a10.SchemaEnv({ schema: e23, schemaId: s11, meta: t11, baseId: n11, localRefs: u11 }), this._cache.set(l11.schema, l11), i11 && !n11.startsWith("#") && (n11 && this._checkUnique(n11), this.refs[n11] = l11), o11 && this.validateSchema(e23, true), l11; + } }, { key: "_checkUnique", value: function(e23) { + if (this.schemas[e23] || this.refs[e23]) + throw new Error('schema with key or id "'.concat(e23, '" already exists')); + } }, { key: "_compileSchemaEnv", value: function(e23) { + if (e23.meta ? this._compileMetaSchema(e23) : a10.compileSchema.call(this, e23), !e23.validate) + throw new Error("ajv implementation error"); + return e23.validate; + } }, { key: "_compileMetaSchema", value: function(e23) { + var t11 = this.opts; + this.opts = this._metaOpts; + try { + a10.compileSchema.call(this, e23); + } finally { + this.opts = t11; + } + } }]), e21; + }(); + function b10(e21, t11, n11) { + var r11 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "error"; + for (var o11 in e21) { + var i11 = o11; + i11 in t11 && this.logger[r11]("".concat(n11, ": option ").concat(o11, ". ").concat(e21[i11])); + } + } + function k10(e21) { + return e21 = (0, c10.normalizeId)(e21), this.schemas[e21] || this.refs[e21]; + } + function w10() { + var e21 = this.opts.schemas; + if (e21) + if (Array.isArray(e21)) + this.addSchema(e21); + else + for (var t11 in e21) + this.addSchema(e21[t11], t11); + } + function x10() { + for (var e21 in this.opts.formats) { + var t11 = this.opts.formats[e21]; + t11 && this.addFormat(e21, t11); + } + } + function j10(e21) { + if (Array.isArray(e21)) + this.addVocabulary(e21); + else + for (var t11 in this.logger.warn("keywords option as map is deprecated, pass array"), e21) { + var n11 = e21[t11]; + n11.keyword || (n11.keyword = t11), this.addKeyword(n11); + } + } + function S10() { + var e21, t11 = Ro({}, this.opts), n11 = bo(v10); + try { + for (n11.s(); !(e21 = n11.n()).done; ) { + delete t11[e21.value]; + } + } catch (e23) { + n11.e(e23); + } finally { + n11.f(); + } + return t11; + } + e20.default = y10, y10.ValidationError = r10.default, y10.MissingRefError = o10.default; + var C10 = { log: function() { + }, warn: function() { + }, error: function() { + } }; + var $10 = /^[a-z_$][a-z0-9_$:-]*$/i; + function _10(e21, t11) { + var n11 = this.RULES; + if ((0, u10.eachItem)(e21, function(e23) { + if (n11.keywords[e23]) + throw new Error("Keyword ".concat(e23, " is already defined")); + if (!$10.test(e23)) + throw new Error("Keyword ".concat(e23, " has invalid name")); + }), t11 && t11.$data && !("code" in t11) && !("validate" in t11)) + throw new Error('$data keyword must have "code" or "validate" function'); + } + function O10(e21, t11, n11) { + var r11, o11 = this, i11 = null == t11 ? void 0 : t11.post; + if (n11 && i11) + throw new Error('keyword with "post" flag cannot have "type"'); + var a11 = this.RULES, s11 = i11 ? a11.post : a11.rules.find(function(e23) { + return e23.type === n11; + }); + if (s11 || (s11 = { type: n11, rules: [] }, a11.rules.push(s11)), a11.keywords[e21] = true, t11) { + var c11 = { keyword: e21, definition: Ro(Ro({}, t11), {}, { type: (0, l10.getJSONTypes)(t11.type), schemaType: (0, l10.getJSONTypes)(t11.schemaType) }) }; + t11.before ? M10.call(this, s11, c11, t11.before) : s11.rules.push(c11), a11.all[e21] = c11, null === (r11 = t11.implements) || void 0 === r11 || r11.forEach(function(e23) { + return o11.addKeyword(e23); + }); + } + } + function M10(e21, t11, n11) { + var r11 = e21.rules.findIndex(function(e23) { + return e23.keyword === n11; + }); + r11 >= 0 ? e21.rules.splice(r11, 0, t11) : (e21.rules.push(t11), this.logger.warn("rule ".concat(n11, " is not defined"))); + } + function E10(e21) { + var t11 = e21.metaSchema; + void 0 !== t11 && (e21.$data && this.opts.$data && (t11 = P10(t11)), e21.validateSchema = this.compile(t11, true)); + } + var A10 = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }; + function P10(e21) { + return { anyOf: [e21, A10] }; + } + }(q8); + var f6 = {}; + var d6 = {}; + var h6 = {}; + Object.defineProperty(h6, "__esModule", { value: true }); + var v6 = { keyword: "id", code: function() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); + } }; + h6.default = v6; + var p6 = {}; + Object.defineProperty(p6, "__esModule", { value: true }), p6.callRef = p6.getValidate = void 0; + var m6 = H5(); + var g6 = p5(); + var y6 = G8(); + var b6 = t5(); + var k6 = W5; + var w6 = Q8; + var x6 = { keyword: "$ref", schemaType: "string", code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.it, o10 = r10.baseId, i10 = r10.schemaEnv, a10 = r10.validateName, s10 = r10.opts, c10 = r10.self, l10 = i10.root; + if (("#" === n10 || "#/" === n10) && o10 === l10.baseId) + return function() { + if (i10 === l10) + return S6(e20, a10, i10, i10.$async); + var n11 = t10.scopeValue("root", { ref: l10 }); + return S6(e20, (0, y6._)(rn || (rn = mo(["", ".validate"])), n11), l10, l10.$async); + }(); + var u10, f10, d10 = k6.resolveRef.call(c10, l10, o10, n10); + if (void 0 === d10) + throw new m6.default(r10.opts.uriResolver, o10, n10); + return d10 instanceof k6.SchemaEnv ? (f10 = j6(e20, u10 = d10), void S6(e20, f10, u10, u10.$async)) : function(r11) { + var o11 = t10.scopeValue("schema", true === s10.code.source ? { ref: r11, code: (0, y6.stringify)(r11) } : { ref: r11 }), i11 = t10.name("valid"), a11 = e20.subschema({ schema: r11, dataTypes: [], schemaPath: y6.nil, topSchemaRef: o11, errSchemaPath: n10 }, i11); + e20.mergeEvaluated(a11), e20.ok(i11); + }(d10); + } }; + function j6(e20, t10) { + var n10 = e20.gen; + return t10.validate ? n10.scopeValue("validate", { ref: t10.validate }) : (0, y6._)(on || (on = mo(["", ".validate"])), n10.scopeValue("wrapper", { ref: t10 })); + } + function S6(e20, t10, n10, r10) { + var o10 = e20.gen, i10 = e20.it, a10 = i10.allErrors, s10 = i10.schemaEnv, c10 = i10.opts.passContext ? b6.default.this : y6.nil; + function l10(e21) { + var t11 = (0, y6._)(cn || (cn = mo(["", ".errors"])), e21); + o10.assign(b6.default.vErrors, (0, y6._)(ln || (ln = mo(["", " === null ? ", " : ", ".concat(", ")"])), b6.default.vErrors, t11, b6.default.vErrors, t11)), o10.assign(b6.default.errors, (0, y6._)(un || (un = mo(["", ".length"])), b6.default.vErrors)); + } + function u10(e21) { + var t11; + if (i10.opts.unevaluated) { + var r11 = null === (t11 = null == n10 ? void 0 : n10.validate) || void 0 === t11 ? void 0 : t11.evaluated; + if (true !== i10.props) + if (r11 && !r11.dynamicProps) + void 0 !== r11.props && (i10.props = w6.mergeEvaluated.props(o10, r11.props, i10.props)); + else { + var a11 = o10.var("props", (0, y6._)(fn || (fn = mo(["", ".evaluated.props"])), e21)); + i10.props = w6.mergeEvaluated.props(o10, a11, i10.props, y6.Name); + } + if (true !== i10.items) + if (r11 && !r11.dynamicItems) + void 0 !== r11.items && (i10.items = w6.mergeEvaluated.items(o10, r11.items, i10.items)); + else { + var s11 = o10.var("items", (0, y6._)(dn || (dn = mo(["", ".evaluated.items"])), e21)); + i10.items = w6.mergeEvaluated.items(o10, s11, i10.items, y6.Name); + } + } + } + r10 ? function() { + if (!s10.$async) + throw new Error("async schema referenced by sync schema"); + var n11 = o10.let("valid"); + o10.try(function() { + o10.code((0, y6._)(an || (an = mo(["await ", ""])), (0, g6.callValidateCode)(e20, t10, c10))), u10(t10), a10 || o10.assign(n11, true); + }, function(e21) { + o10.if((0, y6._)(sn || (sn = mo(["!(", " instanceof ", ")"])), e21, i10.ValidationError), function() { + return o10.throw(e21); + }), l10(e21), a10 || o10.assign(n11, false); + }), e20.ok(n11); + }() : e20.result((0, g6.callValidateCode)(e20, t10, c10), function() { + return u10(t10); + }, function() { + return l10(t10); + }); + } + p6.getValidate = j6, p6.callRef = S6, p6.default = x6, Object.defineProperty(d6, "__esModule", { value: true }); + var C6 = p6; + var $6 = ["$schema", "$id", "$defs", "$vocabulary", { keyword: "$comment" }, "definitions", h6.default, C6.default]; + d6.default = $6; + var _6 = {}; + var O6 = {}; + Object.defineProperty(O6, "__esModule", { value: true }); + var M6 = G8(); + var E6 = M6.operators; + var A6 = { maximum: { okStr: "<=", ok: E6.LTE, fail: E6.GT }, minimum: { okStr: ">=", ok: E6.GTE, fail: E6.LT }, exclusiveMaximum: { okStr: "<", ok: E6.LT, fail: E6.GTE }, exclusiveMinimum: { okStr: ">", ok: E6.GT, fail: E6.LTE } }; + var P6 = { message: function(e20) { + var t10 = e20.keyword, n10 = e20.schemaCode; + return (0, M6.str)(hn || (hn = mo(["must be ", " ", ""])), A6[t10].okStr, n10); + }, params: function(e20) { + var t10 = e20.keyword, n10 = e20.schemaCode; + return (0, M6._)(vn || (vn = mo(["{comparison: ", ", limit: ", "}"])), A6[t10].okStr, n10); + } }; + var T6 = { keyword: Object.keys(A6), type: "number", schemaType: "number", $data: true, error: P6, code: function(e20) { + var t10 = e20.keyword, n10 = e20.data, r10 = e20.schemaCode; + e20.fail$data((0, M6._)(pn || (pn = mo(["", " ", " ", " || isNaN(", ")"])), n10, A6[t10].fail, r10, n10)); + } }; + O6.default = T6; + var R6 = {}; + Object.defineProperty(R6, "__esModule", { value: true }); + var N6 = G8(); + var I6 = { keyword: "multipleOf", type: "number", schemaType: "number", $data: true, error: { message: function(e20) { + var t10 = e20.schemaCode; + return (0, N6.str)(mn || (mn = mo(["must be multiple of ", ""])), t10); + }, params: function(e20) { + var t10 = e20.schemaCode; + return (0, N6._)(gn || (gn = mo(["{multipleOf: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.data, r10 = e20.schemaCode, o10 = e20.it.opts.multipleOfPrecision, i10 = t10.let("res"), a10 = o10 ? (0, N6._)(yn || (yn = mo(["Math.abs(Math.round(", ") - ", ") > 1e-", ""])), i10, i10, o10) : (0, N6._)(bn || (bn = mo(["", " !== parseInt(", ")"])), i10, i10); + e20.fail$data((0, N6._)(kn || (kn = mo(["(", " === 0 || (", " = ", "/", ", ", "))"])), r10, i10, n10, r10, a10)); + } }; + R6.default = I6; + var D6 = {}; + var q6 = {}; + function z6(e20) { + for (var t10, n10 = e20.length, r10 = 0, o10 = 0; o10 < n10; ) + r10++, (t10 = e20.charCodeAt(o10++)) >= 55296 && t10 <= 56319 && o10 < n10 && 56320 == (64512 & (t10 = e20.charCodeAt(o10))) && o10++; + return r10; + } + Object.defineProperty(q6, "__esModule", { value: true }), q6.default = z6, z6.code = 'require("ajv/dist/runtime/ucs2length").default', Object.defineProperty(D6, "__esModule", { value: true }); + var B6 = G8(); + var L6 = Q8; + var F6 = q6; + var V6 = { message: function(e20) { + var t10 = e20.keyword, n10 = e20.schemaCode, r10 = "maxLength" === t10 ? "more" : "fewer"; + return (0, B6.str)(wn || (wn = mo(["must NOT have ", " than ", " characters"])), r10, n10); + }, params: function(e20) { + var t10 = e20.schemaCode; + return (0, B6._)(xn || (xn = mo(["{limit: ", "}"])), t10); + } }; + var H6 = { keyword: ["maxLength", "minLength"], type: "string", schemaType: "number", $data: true, error: V6, code: function(e20) { + var t10 = e20.keyword, n10 = e20.data, r10 = e20.schemaCode, o10 = e20.it, i10 = "maxLength" === t10 ? B6.operators.GT : B6.operators.LT, a10 = false === o10.opts.unicode ? (0, B6._)(jn || (jn = mo(["", ".length"])), n10) : (0, B6._)(Sn || (Sn = mo(["", "(", ")"])), (0, L6.useFunc)(e20.gen, F6.default), n10); + e20.fail$data((0, B6._)(Cn || (Cn = mo(["", " ", " ", ""])), a10, i10, r10)); + } }; + D6.default = H6; + var W6 = {}; + Object.defineProperty(W6, "__esModule", { value: true }); + var U6 = p5(); + var J6 = G8(); + var K6 = { keyword: "pattern", type: "string", schemaType: "string", $data: true, error: { message: function(e20) { + var t10 = e20.schemaCode; + return (0, J6.str)($n || ($n = mo(['must match pattern "', '"'])), t10); + }, params: function(e20) { + var t10 = e20.schemaCode; + return (0, J6._)(_n || (_n = mo(["{pattern: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.data, n10 = e20.$data, r10 = e20.schema, o10 = e20.schemaCode, i10 = e20.it.opts.unicodeRegExp ? "u" : "", a10 = n10 ? (0, J6._)(On || (On = mo(["(new RegExp(", ", ", "))"])), o10, i10) : (0, U6.usePattern)(e20, r10); + e20.fail$data((0, J6._)(Mn || (Mn = mo(["!", ".test(", ")"])), a10, t10)); + } }; + W6.default = K6; + var G6 = {}; + Object.defineProperty(G6, "__esModule", { value: true }); + var Q6 = G8(); + var Y6 = { message: function(e20) { + var t10 = e20.keyword, n10 = e20.schemaCode, r10 = "maxProperties" === t10 ? "more" : "fewer"; + return (0, Q6.str)(En || (En = mo(["must NOT have ", " than ", " properties"])), r10, n10); + }, params: function(e20) { + var t10 = e20.schemaCode; + return (0, Q6._)(An || (An = mo(["{limit: ", "}"])), t10); + } }; + var X6 = { keyword: ["maxProperties", "minProperties"], type: "object", schemaType: "number", $data: true, error: Y6, code: function(e20) { + var t10 = e20.keyword, n10 = e20.data, r10 = e20.schemaCode, o10 = "maxProperties" === t10 ? Q6.operators.GT : Q6.operators.LT; + e20.fail$data((0, Q6._)(Pn || (Pn = mo(["Object.keys(", ").length ", " ", ""])), n10, o10, r10)); + } }; + G6.default = X6; + var Z6 = {}; + Object.defineProperty(Z6, "__esModule", { value: true }); + var e72 = p5(); + var t7 = G8(); + var n7 = Q8; + var r7 = { keyword: "required", type: "object", schemaType: "array", $data: true, error: { message: function(e20) { + var t10 = e20.params.missingProperty; + return (0, t7.str)(Tn || (Tn = mo(["must have required property '", "'"])), t10); + }, params: function(e20) { + var t10 = e20.params.missingProperty; + return (0, t7._)(Rn || (Rn = mo(["{missingProperty: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.schemaCode, o10 = e20.data, i10 = e20.$data, a10 = e20.it, s10 = a10.opts; + if (i10 || 0 !== n10.length) { + var c10 = n10.length >= s10.loopRequired; + if (a10.allErrors ? function() { + if (c10 || i10) + e20.block$data(t7.nil, m10); + else { + var t11, r11 = bo(n10); + try { + for (r11.s(); !(t11 = r11.n()).done; ) { + var o11 = t11.value; + (0, e72.checkReportMissingProp)(e20, o11); + } + } catch (e21) { + r11.e(e21); + } finally { + r11.f(); + } + } + }() : function() { + var a11 = t10.let("missing"); + if (c10 || i10) { + var l11 = t10.let("valid", true); + e20.block$data(l11, function() { + return function(n11, i11) { + e20.setParams({ missingProperty: n11 }), t10.forOf(n11, r10, function() { + t10.assign(i11, (0, e72.propertyInData)(t10, o10, n11, s10.ownProperties)), t10.if((0, t7.not)(i11), function() { + e20.error(), t10.break(); + }); + }, t7.nil); + }(a11, l11); + }), e20.ok(l11); + } else + t10.if((0, e72.checkMissingProp)(e20, n10, a11)), (0, e72.reportMissingProp)(e20, a11), t10.else(); + }(), s10.strictRequired) { + var l10, u10 = e20.parentSchema.properties, f10 = e20.it.definedProperties, d10 = bo(n10); + try { + for (d10.s(); !(l10 = d10.n()).done; ) { + var h10 = l10.value; + if (void 0 === (null == u10 ? void 0 : u10[h10]) && !f10.has(h10)) { + var v10 = a10.schemaEnv.baseId + a10.errSchemaPath, p10 = 'required property "'.concat(h10, '" is not defined at "').concat(v10, '" (strictRequired)'); + (0, n7.checkStrictMode)(a10, p10, a10.opts.strictRequired); + } + } + } catch (e21) { + d10.e(e21); + } finally { + d10.f(); + } + } + } + function m10() { + t10.forOf("prop", r10, function(n11) { + e20.setParams({ missingProperty: n11 }), t10.if((0, e72.noPropertyInData)(t10, o10, n11, s10.ownProperties), function() { + return e20.error(); + }); + }); + } + } }; + Z6.default = r7; + var o7 = {}; + Object.defineProperty(o7, "__esModule", { value: true }); + var i7 = G8(); + var a7 = { message: function(e20) { + var t10 = e20.keyword, n10 = e20.schemaCode, r10 = "maxItems" === t10 ? "more" : "fewer"; + return (0, i7.str)(Nn || (Nn = mo(["must NOT have ", " than ", " items"])), r10, n10); + }, params: function(e20) { + var t10 = e20.schemaCode; + return (0, i7._)(In || (In = mo(["{limit: ", "}"])), t10); + } }; + var s7 = { keyword: ["maxItems", "minItems"], type: "array", schemaType: "number", $data: true, error: a7, code: function(e20) { + var t10 = e20.keyword, n10 = e20.data, r10 = e20.schemaCode, o10 = "maxItems" === t10 ? i7.operators.GT : i7.operators.LT; + e20.fail$data((0, i7._)(Dn || (Dn = mo(["", ".length ", " ", ""])), n10, o10, r10)); + } }; + o7.default = s7; + var c7 = {}; + var l7 = {}; + Object.defineProperty(l7, "__esModule", { value: true }); + var u7 = k5; + u7.code = 'require("ajv/dist/runtime/equal").default', l7.default = u7, Object.defineProperty(c7, "__esModule", { value: true }); + var f7 = r5; + var d7 = G8(); + var h7 = Q8; + var v7 = l7; + var p7 = { message: function(e20) { + var t10 = e20.params, n10 = t10.i, r10 = t10.j; + return (0, d7.str)(qn || (qn = mo(["must NOT have duplicate items (items ## ", " and ", " are identical)"])), r10, n10); + }, params: function(e20) { + var t10 = e20.params, n10 = t10.i, r10 = t10.j; + return (0, d7._)(zn || (zn = mo(["{i: ", ", j: ", "}"])), n10, r10); + } }; + var m7 = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: true, error: p7, code: function(e20) { + var t10 = e20.gen, n10 = e20.data, r10 = e20.$data, o10 = e20.schema, i10 = e20.parentSchema, a10 = e20.schemaCode, s10 = e20.it; + if (r10 || o10) { + var c10 = t10.let("valid"), l10 = i10.items ? (0, f7.getSchemaTypes)(i10.items) : []; + e20.block$data(c10, function() { + var r11 = t10.let("i", (0, d7._)(Ln || (Ln = mo(["", ".length"])), n10)), o11 = t10.let("j"); + e20.setParams({ i: r11, j: o11 }), t10.assign(c10, true), t10.if((0, d7._)(Fn || (Fn = mo(["", " > 1"])), r11), function() { + return (l10.length > 0 && !l10.some(function(e21) { + return "object" === e21 || "array" === e21; + }) ? u10 : f10)(r11, o11); + }); + }, (0, d7._)(Bn || (Bn = mo(["", " === false"])), a10)), e20.ok(c10); + } + function u10(r11, o11) { + var i11 = t10.name("item"), a11 = (0, f7.checkDataTypes)(l10, i11, s10.opts.strictNumbers, f7.DataType.Wrong), u11 = t10.const("indices", (0, d7._)(Vn || (Vn = mo(["{}"])))); + t10.for((0, d7._)(Hn || (Hn = mo([";", "--;"])), r11), function() { + t10.let(i11, (0, d7._)(Wn || (Wn = mo(["", "[", "]"])), n10, r11)), t10.if(a11, (0, d7._)(Un || (Un = mo(["continue"])))), l10.length > 1 && t10.if((0, d7._)(Jn || (Jn = mo(["typeof ", ' == "string"'])), i11), (0, d7._)(Kn || (Kn = mo(["", ' += "_"'])), i11)), t10.if((0, d7._)(Gn || (Gn = mo(["typeof ", "[", '] == "number"'])), u11, i11), function() { + t10.assign(o11, (0, d7._)(Qn || (Qn = mo(["", "[", "]"])), u11, i11)), e20.error(), t10.assign(c10, false).break(); + }).code((0, d7._)(Yn || (Yn = mo(["", "[", "] = ", ""])), u11, i11, r11)); + }); + } + function f10(r11, o11) { + var i11 = (0, h7.useFunc)(t10, v7.default), a11 = t10.name("outer"); + t10.label(a11).for((0, d7._)(Xn || (Xn = mo([";", "--;"])), r11), function() { + return t10.for((0, d7._)(Zn || (Zn = mo(["", " = ", "; ", "--;"])), o11, r11, o11), function() { + return t10.if((0, d7._)(er || (er = mo(["", "(", "[", "], ", "[", "])"])), i11, n10, r11, n10, o11), function() { + e20.error(), t10.assign(c10, false).break(a11); + }); + }); + }); + } + } }; + c7.default = m7; + var g7 = {}; + Object.defineProperty(g7, "__esModule", { value: true }); + var y7 = G8(); + var b7 = Q8; + var k7 = l7; + var w7 = { keyword: "const", $data: true, error: { message: "must be equal to constant", params: function(e20) { + var t10 = e20.schemaCode; + return (0, y7._)(tr || (tr = mo(["{allowedValue: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.data, r10 = e20.$data, o10 = e20.schemaCode, i10 = e20.schema; + r10 || i10 && "object" == Ho(i10) ? e20.fail$data((0, y7._)(nr || (nr = mo(["!", "(", ", ", ")"])), (0, b7.useFunc)(t10, k7.default), n10, o10)) : e20.fail((0, y7._)(rr || (rr = mo(["", " !== ", ""])), i10, n10)); + } }; + g7.default = w7; + var x7 = {}; + Object.defineProperty(x7, "__esModule", { value: true }); + var j7 = G8(); + var S7 = Q8; + var C7 = l7; + var $7 = { keyword: "enum", schemaType: "array", $data: true, error: { message: "must be equal to one of the allowed values", params: function(e20) { + var t10 = e20.schemaCode; + return (0, j7._)(or || (or = mo(["{allowedValues: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.data, r10 = e20.$data, o10 = e20.schema, i10 = e20.schemaCode, a10 = e20.it; + if (!r10 && 0 === o10.length) + throw new Error("enum must have non-empty array"); + var s10, c10, l10 = o10.length >= a10.opts.loopEnum, u10 = function() { + return null != s10 ? s10 : s10 = (0, S7.useFunc)(t10, C7.default); + }; + if (l10 || r10) + c10 = t10.let("valid"), e20.block$data(c10, function() { + t10.assign(c10, false), t10.forOf("v", i10, function(e21) { + return t10.if((0, j7._)(ir || (ir = mo(["", "(", ", ", ")"])), u10(), n10, e21), function() { + return t10.assign(c10, true).break(); + }); + }); + }); + else { + if (!Array.isArray(o10)) + throw new Error("ajv implementation error"); + var f10 = t10.const("vSchema", i10); + c10 = j7.or.apply(void 0, Bo(o10.map(function(e21, t11) { + return function(e23, t12) { + var r11 = o10[t12]; + return "object" === Ho(r11) && null !== r11 ? (0, j7._)(ar || (ar = mo(["", "(", ", ", "[", "])"])), u10(), n10, e23, t12) : (0, j7._)(sr || (sr = mo(["", " === ", ""])), n10, r11); + }(f10, t11); + }))); + } + e20.pass(c10); + } }; + x7.default = $7, Object.defineProperty(_6, "__esModule", { value: true }); + var _7 = R6; + var O7 = D6; + var M7 = W6; + var E7 = G6; + var A7 = Z6; + var P7 = o7; + var T7 = c7; + var R7 = g7; + var N7 = x7; + var I7 = [O6.default, _7.default, O7.default, M7.default, E7.default, A7.default, P7.default, T7.default, { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, R7.default, N7.default]; + _6.default = I7; + var D7 = {}; + var q7 = {}; + Object.defineProperty(q7, "__esModule", { value: true }), q7.validateAdditionalItems = void 0; + var z7 = G8(); + var B7 = Q8; + var L7 = { keyword: "additionalItems", type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", error: { message: function(e20) { + var t10 = e20.params.len; + return (0, z7.str)(cr || (cr = mo(["must NOT have more than ", " items"])), t10); + }, params: function(e20) { + var t10 = e20.params.len; + return (0, z7._)(lr || (lr = mo(["{limit: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.parentSchema, n10 = e20.it, r10 = t10.items; + Array.isArray(r10) ? F7(e20, r10) : (0, B7.checkStrictMode)(n10, '"additionalItems" is ignored when "items" is not an array of schemas'); + } }; + function F7(e20, t10) { + var n10 = e20.gen, r10 = e20.schema, o10 = e20.data, i10 = e20.keyword, a10 = e20.it; + a10.items = true; + var s10 = n10.const("len", (0, z7._)(ur || (ur = mo(["", ".length"])), o10)); + if (false === r10) + e20.setParams({ len: t10.length }), e20.pass((0, z7._)(fr || (fr = mo(["", " <= ", ""])), s10, t10.length)); + else if ("object" == Ho(r10) && !(0, B7.alwaysValidSchema)(a10, r10)) { + var c10 = n10.var("valid", (0, z7._)(dr || (dr = mo(["", " <= ", ""])), s10, t10.length)); + n10.if((0, z7.not)(c10), function() { + return function(r11) { + n10.forRange("i", t10.length, s10, function(t11) { + e20.subschema({ keyword: i10, dataProp: t11, dataPropType: B7.Type.Num }, r11), a10.allErrors || n10.if((0, z7.not)(r11), function() { + return n10.break(); + }); + }); + }(c10); + }), e20.ok(c10); + } + } + q7.validateAdditionalItems = F7, q7.default = L7; + var V7 = {}; + var H7 = {}; + Object.defineProperty(H7, "__esModule", { value: true }), H7.validateTuple = void 0; + var W7 = G8(); + var U7 = Q8; + var J7 = p5(); + var K7 = { keyword: "items", type: "array", schemaType: ["object", "array", "boolean"], before: "uniqueItems", code: function(e20) { + var t10 = e20.schema, n10 = e20.it; + if (Array.isArray(t10)) + return G7(e20, "additionalItems", t10); + n10.items = true, (0, U7.alwaysValidSchema)(n10, t10) || e20.ok((0, J7.validateArray)(e20)); + } }; + function G7(e20, t10) { + var n10 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e20.schema, r10 = e20.gen, o10 = e20.parentSchema, i10 = e20.data, a10 = e20.keyword, s10 = e20.it; + !function(e21) { + var r11 = s10.opts, o11 = s10.errSchemaPath, i11 = n10.length, c11 = i11 === e21.minItems && (i11 === e21.maxItems || false === e21[t10]); + if (r11.strictTuples && !c11) { + var l11 = '"'.concat(a10, '" is ').concat(i11, "-tuple, but minItems or maxItems/").concat(t10, ' are not specified or different at path "').concat(o11, '"'); + (0, U7.checkStrictMode)(s10, l11, r11.strictTuples); + } + }(o10), s10.opts.unevaluated && n10.length && true !== s10.items && (s10.items = U7.mergeEvaluated.items(r10, n10.length, s10.items)); + var c10 = r10.name("valid"), l10 = r10.const("len", (0, W7._)(hr || (hr = mo(["", ".length"])), i10)); + n10.forEach(function(t11, n11) { + (0, U7.alwaysValidSchema)(s10, t11) || (r10.if((0, W7._)(vr || (vr = mo(["", " > ", ""])), l10, n11), function() { + return e20.subschema({ keyword: a10, schemaProp: n11, dataProp: n11 }, c10); + }), e20.ok(c10)); + }); + } + H7.validateTuple = G7, H7.default = K7, Object.defineProperty(V7, "__esModule", { value: true }); + var Q7 = H7; + var Y7 = { keyword: "prefixItems", type: "array", schemaType: ["array"], before: "uniqueItems", code: function(e20) { + return (0, Q7.validateTuple)(e20, "items"); + } }; + V7.default = Y7; + var X7 = {}; + Object.defineProperty(X7, "__esModule", { value: true }); + var Z7 = G8(); + var e92 = Q8; + var t9 = p5(); + var n9 = q7; + var r9 = { keyword: "items", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", error: { message: function(e20) { + var t10 = e20.params.len; + return (0, Z7.str)(pr || (pr = mo(["must NOT have more than ", " items"])), t10); + }, params: function(e20) { + var t10 = e20.params.len; + return (0, Z7._)(mr || (mr = mo(["{limit: ", "}"])), t10); + } }, code: function(e20) { + var t10 = e20.schema, n10 = e20.parentSchema, r10 = e20.it, o10 = n10.prefixItems; + r10.items = true, (0, e92.alwaysValidSchema)(r10, t10) || (o10 ? (0, n9.validateAdditionalItems)(e20, o10) : e20.ok((0, t9.validateArray)(e20))); + } }; + X7.default = r9; + var o9 = {}; + Object.defineProperty(o9, "__esModule", { value: true }); + var i9 = G8(); + var a9 = Q8; + var s9 = { message: function(e20) { + var t10 = e20.params, n10 = t10.min, r10 = t10.max; + return void 0 === r10 ? (0, i9.str)(gr || (gr = mo(["must contain at least ", " valid item(s)"])), n10) : (0, i9.str)(yr || (yr = mo(["must contain at least ", " and no more than ", " valid item(s)"])), n10, r10); + }, params: function(e20) { + var t10 = e20.params, n10 = t10.min, r10 = t10.max; + return void 0 === r10 ? (0, i9._)(br || (br = mo(["{minContains: ", "}"])), n10) : (0, i9._)(kr || (kr = mo(["{minContains: ", ", maxContains: ", "}"])), n10, r10); + } }; + var c9 = { keyword: "contains", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, error: s9, code: function(e20) { + var t10, n10, r10 = e20.gen, o10 = e20.schema, i10 = e20.parentSchema, a10 = e20.data, s10 = e20.it, c10 = i10.minContains, l10 = i10.maxContains; + s10.opts.next ? (t10 = void 0 === c10 ? 1 : c10, n10 = l10) : t10 = 1; + var u10 = r10.const("len", (0, i9._)(wr || (wr = mo(["", ".length"])), a10)); + if (e20.setParams({ min: t10, max: n10 }), void 0 !== n10 || 0 !== t10) { + if (void 0 !== n10 && t10 > n10) + return (0, a9.checkStrictMode)(s10, '"minContains" > "maxContains" is always invalid'), void e20.fail(); + if ((0, a9.alwaysValidSchema)(s10, o10)) { + var f10 = (0, i9._)(xr || (xr = mo(["", " >= ", ""])), u10, t10); + return void 0 !== n10 && (f10 = (0, i9._)(jr || (jr = mo(["", " && ", " <= ", ""])), f10, u10, n10)), void e20.pass(f10); + } + s10.items = true; + var d10 = r10.name("valid"); + void 0 === n10 && 1 === t10 ? v10(d10, function() { + return r10.if(d10, function() { + return r10.break(); + }); + }) : 0 === t10 ? (r10.let(d10, true), void 0 !== n10 && r10.if((0, i9._)(Sr || (Sr = mo(["", ".length > 0"])), a10), h10)) : (r10.let(d10, false), h10()), e20.result(d10, function() { + return e20.reset(); + }); + } else + (0, a9.checkStrictMode)(s10, '"minContains" == 0 without "maxContains": "contains" keyword ignored'); + function h10() { + var e21 = r10.name("_valid"), o11 = r10.let("count", 0); + v10(e21, function() { + return r10.if(e21, function() { + return function(e23) { + r10.code((0, i9._)(Cr || (Cr = mo(["", "++"])), e23)), void 0 === n10 ? r10.if((0, i9._)($r || ($r = mo(["", " >= ", ""])), e23, t10), function() { + return r10.assign(d10, true).break(); + }) : (r10.if((0, i9._)(_r || (_r = mo(["", " > ", ""])), e23, n10), function() { + return r10.assign(d10, false).break(); + }), 1 === t10 ? r10.assign(d10, true) : r10.if((0, i9._)(Or || (Or = mo(["", " >= ", ""])), e23, t10), function() { + return r10.assign(d10, true); + })); + }(o11); + }); + }); + } + function v10(t11, n11) { + r10.forRange("i", 0, u10, function(r11) { + e20.subschema({ keyword: "contains", dataProp: r11, dataPropType: a9.Type.Num, compositeRule: true }, t11), n11(); + }); + } + } }; + o9.default = c9; + var l9 = {}; + !function(e20) { + Object.defineProperty(e20, "__esModule", { value: true }), e20.validateSchemaDeps = e20.validatePropertyDeps = e20.error = void 0; + var t10 = G8(), n10 = Q8, r10 = p5(); + e20.error = { message: function(e21) { + var n11 = e21.params, r11 = n11.property, o11 = n11.depsCount, i11 = n11.deps, a11 = 1 === o11 ? "property" : "properties"; + return (0, t10.str)(Mr || (Mr = mo(["must have ", " ", " when property ", " is present"])), a11, i11, r11); + }, params: function(e21) { + var n11 = e21.params, r11 = n11.property, o11 = n11.depsCount, i11 = n11.deps, a11 = n11.missingProperty; + return (0, t10._)(Er || (Er = mo(["{property: ", ",\n missingProperty: ", ",\n depsCount: ", ",\n deps: ", "}"])), r11, a11, o11, i11); + } }; + var o10 = { keyword: "dependencies", type: "object", schemaType: "object", error: e20.error, code: function(e21) { + var t11 = jo(function(e23) { + var t12 = e23.schema, n12 = {}, r12 = {}; + for (var o11 in t12) { + if ("__proto__" !== o11) + (Array.isArray(t12[o11]) ? n12 : r12)[o11] = t12[o11]; + } + return [n12, r12]; + }(e21), 2), n11 = t11[0], r11 = t11[1]; + i10(e21, n11), a10(e21, r11); + } }; + function i10(e21) { + var n11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21.schema, o11 = e21.gen, i11 = e21.data, a11 = e21.it; + if (0 !== Object.keys(n11).length) { + var s10 = o11.let("missing"), c10 = function() { + var c11 = n11[l10]; + if (0 === c11.length) + return 1; + var u10 = (0, r10.propertyInData)(o11, i11, l10, a11.opts.ownProperties); + e21.setParams({ property: l10, depsCount: c11.length, deps: c11.join(", ") }), a11.allErrors ? o11.if(u10, function() { + var t11, n12 = bo(c11); + try { + for (n12.s(); !(t11 = n12.n()).done; ) { + var o12 = t11.value; + (0, r10.checkReportMissingProp)(e21, o12); + } + } catch (e23) { + n12.e(e23); + } finally { + n12.f(); + } + }) : (o11.if((0, t10._)(Ar || (Ar = mo(["", " && (", ")"])), u10, (0, r10.checkMissingProp)(e21, c11, s10))), (0, r10.reportMissingProp)(e21, s10), o11.else()); + }; + for (var l10 in n11) + c10(); + } + } + function a10(e21) { + var t11 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e21.schema, o11 = e21.gen, i11 = e21.data, a11 = e21.keyword, s10 = e21.it, c10 = o11.name("valid"), l10 = function(l11) { + if ((0, n10.alwaysValidSchema)(s10, t11[l11])) + return 1; + o11.if((0, r10.propertyInData)(o11, i11, l11, s10.opts.ownProperties), function() { + var t12 = e21.subschema({ keyword: a11, schemaProp: l11 }, c10); + e21.mergeValidEvaluated(t12, c10); + }, function() { + return o11.var(c10, true); + }), e21.ok(c10); + }; + for (var u10 in t11) + l10(u10); + } + e20.validatePropertyDeps = i10, e20.validateSchemaDeps = a10, e20.default = o10; + }(l9); + var u9 = {}; + Object.defineProperty(u9, "__esModule", { value: true }); + var f9 = G8(); + var d9 = Q8; + var h9 = { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], error: { message: "property name must be valid", params: function(e20) { + var t10 = e20.params; + return (0, f9._)(Pr || (Pr = mo(["{propertyName: ", "}"])), t10.propertyName); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.data, o10 = e20.it; + if (!(0, d9.alwaysValidSchema)(o10, n10)) { + var i10 = t10.name("valid"); + t10.forIn("key", r10, function(n11) { + e20.setParams({ propertyName: n11 }), e20.subschema({ keyword: "propertyNames", data: n11, dataTypes: ["string"], propertyName: n11, compositeRule: true }, i10), t10.if((0, f9.not)(i10), function() { + e20.error(true), o10.allErrors || t10.break(); + }); + }), e20.ok(i10); + } + } }; + u9.default = h9; + var v9 = {}; + Object.defineProperty(v9, "__esModule", { value: true }); + var p9 = p5(); + var m9 = G8(); + var g9 = t5(); + var y9 = Q8; + var b9 = { keyword: "additionalProperties", type: ["object"], schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, error: { message: "must NOT have additional properties", params: function(e20) { + var t10 = e20.params; + return (0, m9._)(Tr || (Tr = mo(["{additionalProperty: ", "}"])), t10.additionalProperty); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.parentSchema, o10 = e20.data, i10 = e20.errsCount, a10 = e20.it; + if (!i10) + throw new Error("ajv implementation error"); + var s10 = a10.allErrors, c10 = a10.opts; + if (a10.props = true, "all" === c10.removeAdditional || !(0, y9.alwaysValidSchema)(a10, n10)) { + var l10 = (0, p9.allSchemaProperties)(r10.properties), u10 = (0, p9.allSchemaProperties)(r10.patternProperties); + t10.forIn("key", o10, function(n11) { + l10.length || u10.length ? t10.if(function(n12) { + var o11; + if (l10.length > 8) { + var i11 = (0, y9.schemaRefOrVal)(a10, r10.properties, "properties"); + o11 = (0, p9.isOwnProperty)(t10, i11, n12); + } else + o11 = l10.length ? m9.or.apply(void 0, Bo(l10.map(function(e21) { + return (0, m9._)(Nr || (Nr = mo(["", " === ", ""])), n12, e21); + }))) : m9.nil; + return u10.length && (o11 = m9.or.apply(void 0, [o11].concat(Bo(u10.map(function(t11) { + return (0, m9._)(Ir || (Ir = mo(["", ".test(", ")"])), (0, p9.usePattern)(e20, t11), n12); + }))))), (0, m9.not)(o11); + }(n11), function() { + return d10(n11); + }) : d10(n11); + }), e20.ok((0, m9._)(Rr || (Rr = mo(["", " === ", ""])), i10, g9.default.errors)); + } + function f10(e21) { + t10.code((0, m9._)(Dr || (Dr = mo(["delete ", "[", "]"])), o10, e21)); + } + function d10(r11) { + if ("all" === c10.removeAdditional || c10.removeAdditional && false === n10) + f10(r11); + else { + if (false === n10) + return e20.setParams({ additionalProperty: r11 }), e20.error(), void (s10 || t10.break()); + if ("object" == Ho(n10) && !(0, y9.alwaysValidSchema)(a10, n10)) { + var o11 = t10.name("valid"); + "failing" === c10.removeAdditional ? (h10(r11, o11, false), t10.if((0, m9.not)(o11), function() { + e20.reset(), f10(r11); + })) : (h10(r11, o11), s10 || t10.if((0, m9.not)(o11), function() { + return t10.break(); + })); + } + } + } + function h10(t11, n11, r11) { + var o11 = { keyword: "additionalProperties", dataProp: t11, dataPropType: y9.Type.Str }; + false === r11 && Object.assign(o11, { compositeRule: true, createErrors: false, allErrors: false }), e20.subschema(o11, n11); + } + } }; + v9.default = b9; + var k9 = {}; + Object.defineProperty(k9, "__esModule", { value: true }); + var w9 = q5(); + var x9 = p5(); + var j9 = Q8; + var S9 = v9; + var C9 = { keyword: "properties", type: "object", schemaType: "object", code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.parentSchema, o10 = e20.data, i10 = e20.it; + "all" === i10.opts.removeAdditional && void 0 === r10.additionalProperties && S9.default.code(new w9.KeywordCxt(i10, S9.default, "additionalProperties")); + var a10, s10 = (0, x9.allSchemaProperties)(n10), c10 = bo(s10); + try { + for (c10.s(); !(a10 = c10.n()).done; ) { + var l10 = a10.value; + i10.definedProperties.add(l10); + } + } catch (e21) { + c10.e(e21); + } finally { + c10.f(); + } + i10.opts.unevaluated && s10.length && true !== i10.props && (i10.props = j9.mergeEvaluated.props(t10, (0, j9.toHash)(s10), i10.props)); + var u10 = s10.filter(function(e21) { + return !(0, j9.alwaysValidSchema)(i10, n10[e21]); + }); + if (0 !== u10.length) { + var f10, d10 = t10.name("valid"), h10 = bo(u10); + try { + for (h10.s(); !(f10 = h10.n()).done; ) { + var v10 = f10.value; + p10(v10) ? m10(v10) : (t10.if((0, x9.propertyInData)(t10, o10, v10, i10.opts.ownProperties)), m10(v10), i10.allErrors || t10.else().var(d10, true), t10.endIf()), e20.it.definedProperties.add(v10), e20.ok(d10); + } + } catch (e21) { + h10.e(e21); + } finally { + h10.f(); + } + } + function p10(e21) { + return i10.opts.useDefaults && !i10.compositeRule && void 0 !== n10[e21].default; + } + function m10(t11) { + e20.subschema({ keyword: "properties", schemaProp: t11, dataProp: t11 }, d10); + } + } }; + k9.default = C9; + var $9 = {}; + Object.defineProperty($9, "__esModule", { value: true }); + var _9 = p5(); + var O9 = G8(); + var M9 = Q8; + var E9 = Q8; + var A9 = { keyword: "patternProperties", type: "object", schemaType: "object", code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.data, o10 = e20.parentSchema, i10 = e20.it, a10 = i10.opts, s10 = (0, _9.allSchemaProperties)(n10), c10 = s10.filter(function(e21) { + return (0, M9.alwaysValidSchema)(i10, n10[e21]); + }); + if (0 !== s10.length && (c10.length !== s10.length || i10.opts.unevaluated && true !== i10.props)) { + var l10 = a10.strictSchema && !a10.allowMatchingProperties && o10.properties, u10 = t10.name("valid"); + true === i10.props || i10.props instanceof O9.Name || (i10.props = (0, E9.evaluatedPropsToName)(t10, i10.props)); + var f10 = i10.props; + !function() { + var e21, n11 = bo(s10); + try { + for (n11.s(); !(e21 = n11.n()).done; ) { + var r11 = e21.value; + l10 && d10(r11), i10.allErrors ? h10(r11) : (t10.var(u10, true), h10(r11), t10.if(u10)); + } + } catch (e23) { + n11.e(e23); + } finally { + n11.f(); + } + }(); + } + function d10(e21) { + for (var t11 in l10) + new RegExp(e21).test(t11) && (0, M9.checkStrictMode)(i10, "property ".concat(t11, " matches pattern ").concat(e21, " (use allowMatchingProperties)")); + } + function h10(n11) { + t10.forIn("key", r10, function(r11) { + t10.if((0, O9._)(qr || (qr = mo(["", ".test(", ")"])), (0, _9.usePattern)(e20, n11), r11), function() { + var o11 = c10.includes(n11); + o11 || e20.subschema({ keyword: "patternProperties", schemaProp: n11, dataProp: r11, dataPropType: E9.Type.Str }, u10), i10.opts.unevaluated && true !== f10 ? t10.assign((0, O9._)(zr || (zr = mo(["", "[", "]"])), f10, r11), true) : o11 || i10.allErrors || t10.if((0, O9.not)(u10), function() { + return t10.break(); + }); + }); + }); + } + } }; + $9.default = A9; + var P9 = {}; + Object.defineProperty(P9, "__esModule", { value: true }); + var T9 = Q8; + var R9 = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.it; + if ((0, T9.alwaysValidSchema)(r10, n10)) + e20.fail(); + else { + var o10 = t10.name("valid"); + e20.subschema({ keyword: "not", compositeRule: true, createErrors: false, allErrors: false }, o10), e20.failResult(o10, function() { + return e20.reset(); + }, function() { + return e20.error(); + }); + } + }, error: { message: "must NOT be valid" } }; + P9.default = R9; + var N9 = {}; + Object.defineProperty(N9, "__esModule", { value: true }); + var I9 = { keyword: "anyOf", schemaType: "array", trackErrors: true, code: p5().validateUnion, error: { message: "must match a schema in anyOf" } }; + N9.default = I9; + var D9 = {}; + Object.defineProperty(D9, "__esModule", { value: true }); + var q9 = G8(); + var z9 = Q8; + var B9 = { keyword: "oneOf", schemaType: "array", trackErrors: true, error: { message: "must match exactly one schema in oneOf", params: function(e20) { + var t10 = e20.params; + return (0, q9._)(Br || (Br = mo(["{passingSchemas: ", "}"])), t10.passing); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.parentSchema, o10 = e20.it; + if (!Array.isArray(n10)) + throw new Error("ajv implementation error"); + if (!o10.opts.discriminator || !r10.discriminator) { + var i10 = n10, a10 = t10.let("valid", false), s10 = t10.let("passing", null), c10 = t10.name("_valid"); + e20.setParams({ passing: s10 }), t10.block(function() { + i10.forEach(function(n11, r11) { + var i11; + (0, z9.alwaysValidSchema)(o10, n11) ? t10.var(c10, true) : i11 = e20.subschema({ keyword: "oneOf", schemaProp: r11, compositeRule: true }, c10), r11 > 0 && t10.if((0, q9._)(Lr || (Lr = mo(["", " && ", ""])), c10, a10)).assign(a10, false).assign(s10, (0, q9._)(Fr || (Fr = mo(["[", ", ", "]"])), s10, r11)).else(), t10.if(c10, function() { + t10.assign(a10, true), t10.assign(s10, r11), i11 && e20.mergeEvaluated(i11, q9.Name); + }); + }); + }), e20.result(a10, function() { + return e20.reset(); + }, function() { + return e20.error(true); + }); + } + } }; + D9.default = B9; + var L9 = {}; + Object.defineProperty(L9, "__esModule", { value: true }); + var F9 = Q8; + var V9 = { keyword: "allOf", schemaType: "array", code: function(e20) { + var t10 = e20.gen, n10 = e20.schema, r10 = e20.it; + if (!Array.isArray(n10)) + throw new Error("ajv implementation error"); + var o10 = t10.name("valid"); + n10.forEach(function(t11, n11) { + if (!(0, F9.alwaysValidSchema)(r10, t11)) { + var i10 = e20.subschema({ keyword: "allOf", schemaProp: n11 }, o10); + e20.ok(o10), e20.mergeEvaluated(i10); + } + }); + } }; + L9.default = V9; + var H9 = {}; + Object.defineProperty(H9, "__esModule", { value: true }); + var W9 = G8(); + var U9 = Q8; + var J9 = { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, error: { message: function(e20) { + var t10 = e20.params; + return (0, W9.str)(Vr || (Vr = mo(['must match "', '" schema'])), t10.ifClause); + }, params: function(e20) { + var t10 = e20.params; + return (0, W9._)(Hr || (Hr = mo(["{failingKeyword: ", "}"])), t10.ifClause); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.parentSchema, r10 = e20.it; + void 0 === n10.then && void 0 === n10.else && (0, U9.checkStrictMode)(r10, '"if" without "then" and "else" is ignored'); + var o10 = K9(r10, "then"), i10 = K9(r10, "else"); + if (o10 || i10) { + var a10, s10 = t10.let("valid", true), c10 = t10.name("_valid"); + if (a10 = e20.subschema({ keyword: "if", compositeRule: true, createErrors: false, allErrors: false }, c10), e20.mergeEvaluated(a10), e20.reset(), o10 && i10) { + var l10 = t10.let("ifClause"); + e20.setParams({ ifClause: l10 }), t10.if(c10, u10("then", l10), u10("else", l10)); + } else + o10 ? t10.if(c10, u10("then")) : t10.if((0, W9.not)(c10), u10("else")); + e20.pass(s10, function() { + return e20.error(true); + }); + } + function u10(n11, r11) { + return function() { + var o11 = e20.subschema({ keyword: n11 }, c10); + t10.assign(s10, c10), e20.mergeValidEvaluated(o11, s10), r11 ? t10.assign(r11, (0, W9._)(Wr || (Wr = mo(["", ""])), n11)) : e20.setParams({ ifClause: n11 }); + }; + } + } }; + function K9(e20, t10) { + var n10 = e20.schema[t10]; + return void 0 !== n10 && !(0, U9.alwaysValidSchema)(e20, n10); + } + H9.default = J9; + var G9 = {}; + Object.defineProperty(G9, "__esModule", { value: true }); + var Q9 = Q8; + var Y9 = { keyword: ["then", "else"], schemaType: ["object", "boolean"], code: function(e20) { + var t10 = e20.keyword, n10 = e20.parentSchema, r10 = e20.it; + void 0 === n10.if && (0, Q9.checkStrictMode)(r10, '"'.concat(t10, '" without "if" is ignored')); + } }; + G9.default = Y9, Object.defineProperty(D7, "__esModule", { value: true }); + var X9 = q7; + var Z9 = V7; + var eee = H7; + var tee = X7; + var nee = o9; + var ree = l9; + var oee = u9; + var iee = v9; + var aee = k9; + var see = $9; + var cee = P9; + var lee = N9; + var uee = D9; + var fee = L9; + var dee = H9; + var hee = G9; + D7.default = function() { + var e20 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t10 = [cee.default, lee.default, uee.default, fee.default, dee.default, hee.default, oee.default, iee.default, ree.default, aee.default, see.default]; + return e20 ? t10.push(Z9.default, tee.default) : t10.push(X9.default, eee.default), t10.push(nee.default), t10; + }; + var vee = {}; + var pee = {}; + Object.defineProperty(pee, "__esModule", { value: true }); + var mee = G8(); + var gee = { keyword: "format", type: ["number", "string"], schemaType: "string", $data: true, error: { message: function(e20) { + var t10 = e20.schemaCode; + return (0, mee.str)(Ur || (Ur = mo(['must match format "', '"'])), t10); + }, params: function(e20) { + var t10 = e20.schemaCode; + return (0, mee._)(Jr || (Jr = mo(["{format: ", "}"])), t10); + } }, code: function(e20, t10) { + var n10 = e20.gen, r10 = e20.data, o10 = e20.$data, i10 = e20.schema, a10 = e20.schemaCode, s10 = e20.it, c10 = s10.opts, l10 = s10.errSchemaPath, u10 = s10.schemaEnv, f10 = s10.self; + c10.validateFormats && (o10 ? function() { + var o11 = n10.scopeValue("formats", { ref: f10.formats, code: c10.code.formats }), i11 = n10.const("fDef", (0, mee._)(Kr || (Kr = mo(["", "[", "]"])), o11, a10)), s11 = n10.let("fType"), l11 = n10.let("format"); + n10.if((0, mee._)(Gr || (Gr = mo(["typeof ", ' == "object" && !(', " instanceof RegExp)"])), i11, i11), function() { + return n10.assign(s11, (0, mee._)(Qr || (Qr = mo(["", '.type || "string"'])), i11)).assign(l11, (0, mee._)(Yr || (Yr = mo(["", ".validate"])), i11)); + }, function() { + return n10.assign(s11, (0, mee._)(Xr || (Xr = mo(['"string"'])))).assign(l11, i11); + }), e20.fail$data((0, mee.or)(false === c10.strictSchema ? mee.nil : (0, mee._)(Zr || (Zr = mo(["", " && !", ""])), a10, l11), (d10 = u10.$async ? (0, mee._)(eo || (eo = mo(["(", ".async ? await ", "(", ") : ", "(", "))"])), i11, l11, r10, l11, r10) : (0, mee._)(to || (to = mo(["", "(", ")"])), l11, r10), h10 = (0, mee._)(no || (no = mo(["(typeof ", ' == "function" ? ', " : ", ".test(", "))"])), l11, d10, l11, r10), (0, mee._)(ro || (ro = mo(["", " && ", " !== true && ", " === ", " && !", ""])), l11, l11, s11, t10, h10)))); + var d10, h10; + }() : function() { + var o11 = f10.formats[i10]; + if (!o11) + return void function() { + if (false === c10.strictSchema) + return void f10.logger.warn(e21()); + throw new Error(e21()); + function e21() { + return 'unknown format "'.concat(i10, '" ignored in schema at path "').concat(l10, '"'); + } + }(); + if (true === o11) + return; + var a11 = jo(function(e21) { + var t11 = e21 instanceof RegExp ? (0, mee.regexpCode)(e21) : c10.code.formats ? (0, mee._)(oo || (oo = mo(["", "", ""])), c10.code.formats, (0, mee.getProperty)(i10)) : void 0, r11 = n10.scopeValue("formats", { key: i10, ref: e21, code: t11 }); + if ("object" == Ho(e21) && !(e21 instanceof RegExp)) + return [e21.type || "string", e21.validate, (0, mee._)(io || (io = mo(["", ".validate"])), r11)]; + return ["string", e21, r11]; + }(o11), 3), s11 = a11[0], d10 = a11[1], h10 = a11[2]; + s11 === t10 && e20.pass(function() { + if ("object" == Ho(o11) && !(o11 instanceof RegExp) && o11.async) { + if (!u10.$async) + throw new Error("async format in sync schema"); + return (0, mee._)(ao || (ao = mo(["await ", "(", ")"])), h10, r10); + } + return "function" == typeof d10 ? (0, mee._)(so || (so = mo(["", "(", ")"])), h10, r10) : (0, mee._)(co || (co = mo(["", ".test(", ")"])), h10, r10); + }()); + }()); + } }; + pee.default = gee, Object.defineProperty(vee, "__esModule", { value: true }); + var yee = [pee.default]; + vee.default = yee; + var bee = {}; + Object.defineProperty(bee, "__esModule", { value: true }), bee.contentVocabulary = bee.metadataVocabulary = void 0, bee.metadataVocabulary = ["title", "description", "default", "deprecated", "readOnly", "writeOnly", "examples"], bee.contentVocabulary = ["contentMediaType", "contentEncoding", "contentSchema"], Object.defineProperty(f6, "__esModule", { value: true }); + var kee = _6; + var wee = D7; + var xee = vee; + var jee = bee; + var See = [d6.default, kee.default, (0, wee.default)(), xee.default, jee.metadataVocabulary, jee.contentVocabulary]; + f6.default = See; + var Cee = {}; + var $ee = {}; + !function(e20) { + var t10; + Object.defineProperty(e20, "__esModule", { value: true }), e20.DiscrError = void 0, (t10 = e20.DiscrError || (e20.DiscrError = {})).Tag = "tag", t10.Mapping = "mapping"; + }($ee), Object.defineProperty(Cee, "__esModule", { value: true }); + var _ee = G8(); + var Oee = $ee; + var Mee = W5; + var Eee = Q8; + var Aee = { keyword: "discriminator", type: "object", schemaType: "object", error: { message: function(e20) { + var t10 = e20.params, n10 = t10.discrError, r10 = t10.tagName; + return n10 === Oee.DiscrError.Tag ? 'tag "'.concat(r10, '" must be string') : 'value of tag "'.concat(r10, '" must be in oneOf'); + }, params: function(e20) { + var t10 = e20.params, n10 = t10.discrError, r10 = t10.tag, o10 = t10.tagName; + return (0, _ee._)(lo || (lo = mo(["{error: ", ", tag: ", ", tagValue: ", "}"])), n10, o10, r10); + } }, code: function(e20) { + var t10 = e20.gen, n10 = e20.data, r10 = e20.schema, o10 = e20.parentSchema, i10 = e20.it, a10 = o10.oneOf; + if (!i10.opts.discriminator) + throw new Error("discriminator: requires discriminator option"); + var s10 = r10.propertyName; + if ("string" != typeof s10) + throw new Error("discriminator: requires propertyName"); + if (r10.mapping) + throw new Error("discriminator: mapping is not supported"); + if (!a10) + throw new Error("discriminator: requires oneOf keyword"); + var c10 = t10.let("valid", false), l10 = t10.const("tag", (0, _ee._)(uo || (uo = mo(["", "", ""])), n10, (0, _ee.getProperty)(s10))); + function u10(n11) { + var r11 = t10.name("valid"), o11 = e20.subschema({ keyword: "oneOf", schemaProp: n11 }, r11); + return e20.mergeEvaluated(o11, _ee.Name), r11; + } + t10.if((0, _ee._)(fo || (fo = mo(["typeof ", ' == "string"'])), l10), function() { + return function() { + var n11 = function() { + for (var e21, t11 = {}, n12 = f10(o10), r12 = true, c11 = 0; c11 < a10.length; c11++) { + var l11 = a10[c11]; + (null == l11 ? void 0 : l11.$ref) && !(0, Eee.schemaHasRulesButRef)(l11, i10.self.RULES) && (l11 = Mee.resolveRef.call(i10.self, i10.schemaEnv.root, i10.baseId, null == l11 ? void 0 : l11.$ref)) instanceof Mee.SchemaEnv && (l11 = l11.schema); + var u11 = null === (e21 = null == l11 ? void 0 : l11.properties) || void 0 === e21 ? void 0 : e21[s10]; + if ("object" != Ho(u11)) + throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(s10, '"')); + r12 = r12 && (n12 || f10(l11)), d10(u11, c11); + } + if (!r12) + throw new Error('discriminator: "'.concat(s10, '" must be required')); + return t11; + function f10(e23) { + var t12 = e23.required; + return Array.isArray(t12) && t12.includes(s10); + } + function d10(e23, t12) { + if (e23.const) + h10(e23.const, t12); + else { + if (!e23.enum) + throw new Error('discriminator: "properties/'.concat(s10, '" must have "const" or "enum"')); + var n13, r13 = bo(e23.enum); + try { + for (r13.s(); !(n13 = r13.n()).done; ) { + h10(n13.value, t12); + } + } catch (e24) { + r13.e(e24); + } finally { + r13.f(); + } + } + } + function h10(e23, n13) { + if ("string" != typeof e23 || e23 in t11) + throw new Error('discriminator: "'.concat(s10, '" values must be unique strings')); + t11[e23] = n13; + } + }(); + for (var r11 in t10.if(false), n11) + t10.elseIf((0, _ee._)(ho || (ho = mo(["", " === ", ""])), l10, r11)), t10.assign(c10, u10(n11[r11])); + t10.else(), e20.error(false, { discrError: Oee.DiscrError.Mapping, tag: l10, tagName: s10 }), t10.endIf(); + }(); + }, function() { + return e20.error(false, { discrError: Oee.DiscrError.Tag, tag: l10, tagName: s10 }); + }), e20.ok(c10); + } }; + Cee.default = Aee; + var Pee = { $schema: "http://json-schema.org/draft-07/schema#", $id: "http://json-schema.org/draft-07/schema#", title: "Core schema meta-schema", definitions: { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: true, default: [] } }, type: ["object", "boolean"], properties: { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: true, readOnly: { type: "boolean", default: false }, examples: { type: "array", items: true }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: true }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: false }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: true, enum: { type: "array", items: true, minItems: 1, uniqueItems: true }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: true }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, default: true }; + !function(e20, t10) { + Object.defineProperty(t10, "__esModule", { value: true }), t10.MissingRefError = t10.ValidationError = t10.CodeGen = t10.Name = t10.nil = t10.stringify = t10.str = t10._ = t10.KeywordCxt = void 0; + var n10 = f6, r10 = Cee, o10 = Pee, i10 = ["/properties"], a10 = "http://json-schema.org/draft-07/schema", s10 = function(e21) { + function t11() { + return No(this, t11), _o(this, t11, arguments); + } + return Ao(t11, e21), Do(t11, [{ key: "_addVocabularies", value: function() { + var e23 = this; + go(Mo(t11.prototype), "_addVocabularies", this).call(this), n10.default.forEach(function(t12) { + return e23.addVocabulary(t12); + }), this.opts.discriminator && this.addKeyword(r10.default); + } }, { key: "_addDefaultMetaSchema", value: function() { + if (go(Mo(t11.prototype), "_addDefaultMetaSchema", this).call(this), this.opts.meta) { + var e23 = this.opts.$data ? this.$dataMetaSchema(o10, i10) : o10; + this.addMetaSchema(e23, a10, false), this.refs["http://json-schema.org/schema"] = a10; + } + } }, { key: "defaultMeta", value: function() { + return this.opts.defaultMeta = go(Mo(t11.prototype), "defaultMeta", this).call(this) || (this.getSchema(a10) ? a10 : void 0); + } }]), t11; + }(q8.default); + e20.exports = t10 = s10, Object.defineProperty(t10, "__esModule", { value: true }), t10.default = s10; + var c10 = q5(); + Object.defineProperty(t10, "KeywordCxt", { enumerable: true, get: function() { + return c10.KeywordCxt; + } }); + var l10 = G8(); + Object.defineProperty(t10, "_", { enumerable: true, get: function() { + return l10._; + } }), Object.defineProperty(t10, "str", { enumerable: true, get: function() { + return l10.str; + } }), Object.defineProperty(t10, "stringify", { enumerable: true, get: function() { + return l10.stringify; + } }), Object.defineProperty(t10, "nil", { enumerable: true, get: function() { + return l10.nil; + } }), Object.defineProperty(t10, "Name", { enumerable: true, get: function() { + return l10.Name; + } }), Object.defineProperty(t10, "CodeGen", { enumerable: true, get: function() { + return l10.CodeGen; + } }); + var u10 = L5(); + Object.defineProperty(t10, "ValidationError", { enumerable: true, get: function() { + return u10.default; + } }); + var f10 = H5(); + Object.defineProperty(t10, "MissingRefError", { enumerable: true, get: function() { + return f10.default; + } }); + }(D8, D8.exports); + var Tee = yc(D8.exports); + var Dee = {}; + !function(e20) { + function t10(e21) { + return null !== e21 && "[object Array]" === Object.prototype.toString.call(e21); + } + function n10(e21) { + return null !== e21 && "[object Object]" === Object.prototype.toString.call(e21); + } + function r10(e21, o11) { + if (e21 === o11) + return true; + if (Object.prototype.toString.call(e21) !== Object.prototype.toString.call(o11)) + return false; + if (true === t10(e21)) { + if (e21.length !== o11.length) + return false; + for (var i11 = 0; i11 < e21.length; i11++) + if (false === r10(e21[i11], o11[i11])) + return false; + return true; + } + if (true === n10(e21)) { + var a11 = {}; + for (var s11 in e21) + if (hasOwnProperty.call(e21, s11)) { + if (false === r10(e21[s11], o11[s11])) + return false; + a11[s11] = true; + } + for (var c11 in o11) + if (hasOwnProperty.call(o11, c11) && true !== a11[c11]) + return false; + return true; + } + return false; + } + function o10(e21) { + if ("" === e21 || false === e21 || null === e21) + return true; + if (t10(e21) && 0 === e21.length) + return true; + if (n10(e21)) { + for (var r11 in e21) + if (e21.hasOwnProperty(r11)) + return false; + return true; + } + return false; + } + var i10; + i10 = "function" == typeof String.prototype.trimLeft ? function(e21) { + return e21.trimLeft(); + } : function(e21) { + return e21.match(/^\s*(.*)/)[1]; + }; + var a10 = 0, s10 = 1, c10 = 2, l10 = 3, u10 = 4, f10 = 6, d10 = 8, h10 = 9, v10 = { 0: "number", 1: "any", 2: "string", 3: "array", 4: "object", 5: "boolean", 6: "expression", 7: "null", 8: "Array", 9: "Array" }, p10 = "EOF", m10 = "UnquotedIdentifier", g10 = "QuotedIdentifier", y10 = "Rbracket", b10 = "Rparen", k10 = "Comma", w10 = "Colon", x10 = "Rbrace", j10 = "Number", S10 = "Current", C10 = "Expref", $10 = "Pipe", _10 = "Or", O10 = "And", M10 = "EQ", E10 = "GT", A10 = "LT", P10 = "GTE", T8 = "LTE", R8 = "NE", N8 = "Flatten", I10 = "Star", D10 = "Filter", q10 = "Dot", z10 = "Not", B10 = "Lbrace", L10 = "Lbracket", F10 = "Lparen", V10 = "Literal", H10 = { ".": q10, "*": I10, ",": k10, ":": w10, "{": B10, "}": x10, "]": y10, "(": F10, ")": b10, "@": S10 }, W10 = { "<": true, ">": true, "=": true, "!": true }, U10 = { " ": true, " ": true, "\n": true }; + function J10(e21) { + return e21 >= "0" && e21 <= "9" || "-" === e21; + } + function K10() { + } + K10.prototype = { tokenize: function(e21) { + var t11, n11, r11, o11, i11 = []; + for (this._current = 0; this._current < e21.length; ) + if ((o11 = e21[this._current]) >= "a" && o11 <= "z" || o11 >= "A" && o11 <= "Z" || "_" === o11) + t11 = this._current, n11 = this._consumeUnquotedIdentifier(e21), i11.push({ type: m10, value: n11, start: t11 }); + else if (void 0 !== H10[e21[this._current]]) + i11.push({ type: H10[e21[this._current]], value: e21[this._current], start: this._current }), this._current++; + else if (J10(e21[this._current])) + r11 = this._consumeNumber(e21), i11.push(r11); + else if ("[" === e21[this._current]) + r11 = this._consumeLBracket(e21), i11.push(r11); + else if ('"' === e21[this._current]) + t11 = this._current, n11 = this._consumeQuotedIdentifier(e21), i11.push({ type: g10, value: n11, start: t11 }); + else if ("'" === e21[this._current]) + t11 = this._current, n11 = this._consumeRawStringLiteral(e21), i11.push({ type: V10, value: n11, start: t11 }); + else if ("`" === e21[this._current]) { + t11 = this._current; + var a11 = this._consumeLiteral(e21); + i11.push({ type: V10, value: a11, start: t11 }); + } else if (void 0 !== W10[e21[this._current]]) + i11.push(this._consumeOperator(e21)); + else if (void 0 !== U10[e21[this._current]]) + this._current++; + else if ("&" === e21[this._current]) + t11 = this._current, this._current++, "&" === e21[this._current] ? (this._current++, i11.push({ type: O10, value: "&&", start: t11 })) : i11.push({ type: C10, value: "&", start: t11 }); + else { + if ("|" !== e21[this._current]) { + var s11 = new Error("Unknown character:" + e21[this._current]); + throw s11.name = "LexerError", s11; + } + t11 = this._current, this._current++, "|" === e21[this._current] ? (this._current++, i11.push({ type: _10, value: "||", start: t11 })) : i11.push({ type: $10, value: "|", start: t11 }); + } + return i11; + }, _consumeUnquotedIdentifier: function(e21) { + var t11, n11 = this._current; + for (this._current++; this._current < e21.length && ((t11 = e21[this._current]) >= "a" && t11 <= "z" || t11 >= "A" && t11 <= "Z" || t11 >= "0" && t11 <= "9" || "_" === t11); ) + this._current++; + return e21.slice(n11, this._current); + }, _consumeQuotedIdentifier: function(e21) { + var t11 = this._current; + this._current++; + for (var n11 = e21.length; '"' !== e21[this._current] && this._current < n11; ) { + var r11 = this._current; + "\\" !== e21[r11] || "\\" !== e21[r11 + 1] && '"' !== e21[r11 + 1] ? r11++ : r11 += 2, this._current = r11; + } + return this._current++, JSON.parse(e21.slice(t11, this._current)); + }, _consumeRawStringLiteral: function(e21) { + var t11 = this._current; + this._current++; + for (var n11 = e21.length; "'" !== e21[this._current] && this._current < n11; ) { + var r11 = this._current; + "\\" !== e21[r11] || "\\" !== e21[r11 + 1] && "'" !== e21[r11 + 1] ? r11++ : r11 += 2, this._current = r11; + } + return this._current++, e21.slice(t11 + 1, this._current - 1).replace("\\'", "'"); + }, _consumeNumber: function(e21) { + var t11 = this._current; + this._current++; + for (var n11 = e21.length; J10(e21[this._current]) && this._current < n11; ) + this._current++; + var r11 = parseInt(e21.slice(t11, this._current)); + return { type: j10, value: r11, start: t11 }; + }, _consumeLBracket: function(e21) { + var t11 = this._current; + return this._current++, "?" === e21[this._current] ? (this._current++, { type: D10, value: "[?", start: t11 }) : "]" === e21[this._current] ? (this._current++, { type: N8, value: "[]", start: t11 }) : { type: L10, value: "[", start: t11 }; + }, _consumeOperator: function(e21) { + var t11 = this._current, n11 = e21[t11]; + return this._current++, "!" === n11 ? "=" === e21[this._current] ? (this._current++, { type: R8, value: "!=", start: t11 }) : { type: z10, value: "!", start: t11 } : "<" === n11 ? "=" === e21[this._current] ? (this._current++, { type: T8, value: "<=", start: t11 }) : { type: A10, value: "<", start: t11 } : ">" === n11 ? "=" === e21[this._current] ? (this._current++, { type: P10, value: ">=", start: t11 }) : { type: E10, value: ">", start: t11 } : "=" === n11 && "=" === e21[this._current] ? (this._current++, { type: M10, value: "==", start: t11 }) : void 0; + }, _consumeLiteral: function(e21) { + this._current++; + for (var t11, n11 = this._current, r11 = e21.length; "`" !== e21[this._current] && this._current < r11; ) { + var o11 = this._current; + "\\" !== e21[o11] || "\\" !== e21[o11 + 1] && "`" !== e21[o11 + 1] ? o11++ : o11 += 2, this._current = o11; + } + var a11 = i10(e21.slice(n11, this._current)); + return a11 = a11.replace("\\`", "`"), t11 = this._looksLikeJSON(a11) ? JSON.parse(a11) : JSON.parse('"' + a11 + '"'), this._current++, t11; + }, _looksLikeJSON: function(e21) { + if ("" === e21) + return false; + if ('[{"'.indexOf(e21[0]) >= 0) + return true; + if (["true", "false", "null"].indexOf(e21) >= 0) + return true; + if (!("-0123456789".indexOf(e21[0]) >= 0)) + return false; + try { + return JSON.parse(e21), true; + } catch (e23) { + return false; + } + } }; + var G10 = {}; + function Q10() { + } + function Y10(e21) { + this.runtime = e21; + } + function X10(e21) { + this._interpreter = e21, this.functionTable = { abs: { _func: this._functionAbs, _signature: [{ types: [a10] }] }, avg: { _func: this._functionAvg, _signature: [{ types: [d10] }] }, ceil: { _func: this._functionCeil, _signature: [{ types: [a10] }] }, contains: { _func: this._functionContains, _signature: [{ types: [c10, l10] }, { types: [s10] }] }, ends_with: { _func: this._functionEndsWith, _signature: [{ types: [c10] }, { types: [c10] }] }, floor: { _func: this._functionFloor, _signature: [{ types: [a10] }] }, length: { _func: this._functionLength, _signature: [{ types: [c10, l10, u10] }] }, map: { _func: this._functionMap, _signature: [{ types: [f10] }, { types: [l10] }] }, max: { _func: this._functionMax, _signature: [{ types: [d10, h10] }] }, merge: { _func: this._functionMerge, _signature: [{ types: [u10], variadic: true }] }, max_by: { _func: this._functionMaxBy, _signature: [{ types: [l10] }, { types: [f10] }] }, sum: { _func: this._functionSum, _signature: [{ types: [d10] }] }, starts_with: { _func: this._functionStartsWith, _signature: [{ types: [c10] }, { types: [c10] }] }, min: { _func: this._functionMin, _signature: [{ types: [d10, h10] }] }, min_by: { _func: this._functionMinBy, _signature: [{ types: [l10] }, { types: [f10] }] }, type: { _func: this._functionType, _signature: [{ types: [s10] }] }, keys: { _func: this._functionKeys, _signature: [{ types: [u10] }] }, values: { _func: this._functionValues, _signature: [{ types: [u10] }] }, sort: { _func: this._functionSort, _signature: [{ types: [h10, d10] }] }, sort_by: { _func: this._functionSortBy, _signature: [{ types: [l10] }, { types: [f10] }] }, join: { _func: this._functionJoin, _signature: [{ types: [c10] }, { types: [h10] }] }, reverse: { _func: this._functionReverse, _signature: [{ types: [c10, l10] }] }, to_array: { _func: this._functionToArray, _signature: [{ types: [s10] }] }, to_string: { _func: this._functionToString, _signature: [{ types: [s10] }] }, to_number: { _func: this._functionToNumber, _signature: [{ types: [s10] }] }, not_null: { _func: this._functionNotNull, _signature: [{ types: [s10], variadic: true }] } }; + } + G10[p10] = 0, G10[m10] = 0, G10[g10] = 0, G10[y10] = 0, G10[b10] = 0, G10[k10] = 0, G10[x10] = 0, G10[j10] = 0, G10[S10] = 0, G10[C10] = 0, G10[$10] = 1, G10[_10] = 2, G10[O10] = 3, G10[M10] = 5, G10[E10] = 5, G10[A10] = 5, G10[P10] = 5, G10[T8] = 5, G10[R8] = 5, G10[N8] = 9, G10[I10] = 20, G10[D10] = 21, G10[q10] = 40, G10[z10] = 45, G10[B10] = 50, G10[L10] = 55, G10[F10] = 60, Q10.prototype = { parse: function(e21) { + this._loadTokens(e21), this.index = 0; + var t11 = this.expression(0); + if (this._lookahead(0) !== p10) { + var n11 = this._lookaheadToken(0), r11 = new Error("Unexpected token type: " + n11.type + ", value: " + n11.value); + throw r11.name = "ParserError", r11; + } + return t11; + }, _loadTokens: function(e21) { + var t11 = new K10().tokenize(e21); + t11.push({ type: p10, value: "", start: e21.length }), this.tokens = t11; + }, expression: function(e21) { + var t11 = this._lookaheadToken(0); + this._advance(); + for (var n11 = this.nud(t11), r11 = this._lookahead(0); e21 < G10[r11]; ) + this._advance(), n11 = this.led(r11, n11), r11 = this._lookahead(0); + return n11; + }, _lookahead: function(e21) { + return this.tokens[this.index + e21].type; + }, _lookaheadToken: function(e21) { + return this.tokens[this.index + e21]; + }, _advance: function() { + this.index++; + }, nud: function(e21) { + var t11, n11; + switch (e21.type) { + case V10: + return { type: "Literal", value: e21.value }; + case m10: + return { type: "Field", name: e21.value }; + case g10: + var r11 = { type: "Field", name: e21.value }; + if (this._lookahead(0) === F10) + throw new Error("Quoted identifier not allowed for function names."); + return r11; + case z10: + return { type: "NotExpression", children: [t11 = this.expression(G10.Not)] }; + case I10: + return t11 = null, { type: "ValueProjection", children: [{ type: "Identity" }, t11 = this._lookahead(0) === y10 ? { type: "Identity" } : this._parseProjectionRHS(G10.Star)] }; + case D10: + return this.led(e21.type, { type: "Identity" }); + case B10: + return this._parseMultiselectHash(); + case N8: + return { type: "Projection", children: [{ type: N8, children: [{ type: "Identity" }] }, t11 = this._parseProjectionRHS(G10.Flatten)] }; + case L10: + return this._lookahead(0) === j10 || this._lookahead(0) === w10 ? (t11 = this._parseIndexExpression(), this._projectIfSlice({ type: "Identity" }, t11)) : this._lookahead(0) === I10 && this._lookahead(1) === y10 ? (this._advance(), this._advance(), { type: "Projection", children: [{ type: "Identity" }, t11 = this._parseProjectionRHS(G10.Star)] }) : this._parseMultiselectList(); + case S10: + return { type: S10 }; + case C10: + return { type: "ExpressionReference", children: [n11 = this.expression(G10.Expref)] }; + case F10: + for (var o11 = []; this._lookahead(0) !== b10; ) + this._lookahead(0) === S10 ? (n11 = { type: S10 }, this._advance()) : n11 = this.expression(0), o11.push(n11); + return this._match(b10), o11[0]; + default: + this._errorToken(e21); + } + }, led: function(e21, t11) { + var n11; + switch (e21) { + case q10: + var r11 = G10.Dot; + return this._lookahead(0) !== I10 ? { type: "Subexpression", children: [t11, n11 = this._parseDotRHS(r11)] } : (this._advance(), { type: "ValueProjection", children: [t11, n11 = this._parseProjectionRHS(r11)] }); + case $10: + return n11 = this.expression(G10.Pipe), { type: $10, children: [t11, n11] }; + case _10: + return { type: "OrExpression", children: [t11, n11 = this.expression(G10.Or)] }; + case O10: + return { type: "AndExpression", children: [t11, n11 = this.expression(G10.And)] }; + case F10: + for (var o11, i11 = t11.name, a11 = []; this._lookahead(0) !== b10; ) + this._lookahead(0) === S10 ? (o11 = { type: S10 }, this._advance()) : o11 = this.expression(0), this._lookahead(0) === k10 && this._match(k10), a11.push(o11); + return this._match(b10), { type: "Function", name: i11, children: a11 }; + case D10: + var s11 = this.expression(0); + return this._match(y10), { type: "FilterProjection", children: [t11, n11 = this._lookahead(0) === N8 ? { type: "Identity" } : this._parseProjectionRHS(G10.Filter), s11] }; + case N8: + return { type: "Projection", children: [{ type: N8, children: [t11] }, this._parseProjectionRHS(G10.Flatten)] }; + case M10: + case R8: + case E10: + case P10: + case A10: + case T8: + return this._parseComparator(t11, e21); + case L10: + var c11 = this._lookaheadToken(0); + return c11.type === j10 || c11.type === w10 ? (n11 = this._parseIndexExpression(), this._projectIfSlice(t11, n11)) : (this._match(I10), this._match(y10), { type: "Projection", children: [t11, n11 = this._parseProjectionRHS(G10.Star)] }); + default: + this._errorToken(this._lookaheadToken(0)); + } + }, _match: function(e21) { + if (this._lookahead(0) !== e21) { + var t11 = this._lookaheadToken(0), n11 = new Error("Expected " + e21 + ", got: " + t11.type); + throw n11.name = "ParserError", n11; + } + this._advance(); + }, _errorToken: function(e21) { + var t11 = new Error("Invalid token (" + e21.type + '): "' + e21.value + '"'); + throw t11.name = "ParserError", t11; + }, _parseIndexExpression: function() { + if (this._lookahead(0) === w10 || this._lookahead(1) === w10) + return this._parseSliceExpression(); + var e21 = { type: "Index", value: this._lookaheadToken(0).value }; + return this._advance(), this._match(y10), e21; + }, _projectIfSlice: function(e21, t11) { + var n11 = { type: "IndexExpression", children: [e21, t11] }; + return "Slice" === t11.type ? { type: "Projection", children: [n11, this._parseProjectionRHS(G10.Star)] } : n11; + }, _parseSliceExpression: function() { + for (var e21 = [null, null, null], t11 = 0, n11 = this._lookahead(0); n11 !== y10 && t11 < 3; ) { + if (n11 === w10) + t11++, this._advance(); + else { + if (n11 !== j10) { + var r11 = this._lookahead(0), o11 = new Error("Syntax error, unexpected token: " + r11.value + "(" + r11.type + ")"); + throw o11.name = "Parsererror", o11; + } + e21[t11] = this._lookaheadToken(0).value, this._advance(); + } + n11 = this._lookahead(0); + } + return this._match(y10), { type: "Slice", children: e21 }; + }, _parseComparator: function(e21, t11) { + return { type: "Comparator", name: t11, children: [e21, this.expression(G10[t11])] }; + }, _parseDotRHS: function(e21) { + var t11 = this._lookahead(0); + return [m10, g10, I10].indexOf(t11) >= 0 ? this.expression(e21) : t11 === L10 ? (this._match(L10), this._parseMultiselectList()) : t11 === B10 ? (this._match(B10), this._parseMultiselectHash()) : void 0; + }, _parseProjectionRHS: function(e21) { + var t11; + if (G10[this._lookahead(0)] < 10) + t11 = { type: "Identity" }; + else if (this._lookahead(0) === L10) + t11 = this.expression(e21); + else if (this._lookahead(0) === D10) + t11 = this.expression(e21); + else { + if (this._lookahead(0) !== q10) { + var n11 = this._lookaheadToken(0), r11 = new Error("Sytanx error, unexpected token: " + n11.value + "(" + n11.type + ")"); + throw r11.name = "ParserError", r11; + } + this._match(q10), t11 = this._parseDotRHS(e21); + } + return t11; + }, _parseMultiselectList: function() { + for (var e21 = []; this._lookahead(0) !== y10; ) { + var t11 = this.expression(0); + if (e21.push(t11), this._lookahead(0) === k10 && (this._match(k10), this._lookahead(0) === y10)) + throw new Error("Unexpected token Rbracket"); + } + return this._match(y10), { type: "MultiSelectList", children: e21 }; + }, _parseMultiselectHash: function() { + for (var e21, t11, n11, r11 = [], o11 = [m10, g10]; ; ) { + if (e21 = this._lookaheadToken(0), o11.indexOf(e21.type) < 0) + throw new Error("Expecting an identifier token, got: " + e21.type); + if (t11 = e21.value, this._advance(), this._match(w10), n11 = { type: "KeyValuePair", name: t11, value: this.expression(0) }, r11.push(n11), this._lookahead(0) === k10) + this._match(k10); + else if (this._lookahead(0) === x10) { + this._match(x10); + break; + } + } + return { type: "MultiSelectHash", children: r11 }; + } }, Y10.prototype = { search: function(e21, t11) { + return this.visit(e21, t11); + }, visit: function(e21, i11) { + var a11, s11, c11, l11, u11, f11, d11, h11, v11; + switch (e21.type) { + case "Field": + return null !== i11 && n10(i11) ? void 0 === (f11 = i11[e21.name]) ? null : f11 : null; + case "Subexpression": + for (c11 = this.visit(e21.children[0], i11), v11 = 1; v11 < e21.children.length; v11++) + if (null === (c11 = this.visit(e21.children[1], c11))) + return null; + return c11; + case "IndexExpression": + return d11 = this.visit(e21.children[0], i11), this.visit(e21.children[1], d11); + case "Index": + if (!t10(i11)) + return null; + var p11 = e21.value; + return p11 < 0 && (p11 = i11.length + p11), void 0 === (c11 = i11[p11]) && (c11 = null), c11; + case "Slice": + if (!t10(i11)) + return null; + var m11 = e21.children.slice(0), g11 = this.computeSliceParams(i11.length, m11), y11 = g11[0], b11 = g11[1], k11 = g11[2]; + if (c11 = [], k11 > 0) + for (v11 = y11; v11 < b11; v11 += k11) + c11.push(i11[v11]); + else + for (v11 = y11; v11 > b11; v11 += k11) + c11.push(i11[v11]); + return c11; + case "Projection": + var w11 = this.visit(e21.children[0], i11); + if (!t10(w11)) + return null; + for (h11 = [], v11 = 0; v11 < w11.length; v11++) + null !== (s11 = this.visit(e21.children[1], w11[v11])) && h11.push(s11); + return h11; + case "ValueProjection": + if (!n10(w11 = this.visit(e21.children[0], i11))) + return null; + h11 = []; + var x11 = function(e23) { + for (var t11 = Object.keys(e23), n11 = [], r11 = 0; r11 < t11.length; r11++) + n11.push(e23[t11[r11]]); + return n11; + }(w11); + for (v11 = 0; v11 < x11.length; v11++) + null !== (s11 = this.visit(e21.children[1], x11[v11])) && h11.push(s11); + return h11; + case "FilterProjection": + if (!t10(w11 = this.visit(e21.children[0], i11))) + return null; + var j11 = [], _11 = []; + for (v11 = 0; v11 < w11.length; v11++) + o10(a11 = this.visit(e21.children[2], w11[v11])) || j11.push(w11[v11]); + for (var O11 = 0; O11 < j11.length; O11++) + null !== (s11 = this.visit(e21.children[1], j11[O11])) && _11.push(s11); + return _11; + case "Comparator": + switch (l11 = this.visit(e21.children[0], i11), u11 = this.visit(e21.children[1], i11), e21.name) { + case M10: + c11 = r10(l11, u11); + break; + case R8: + c11 = !r10(l11, u11); + break; + case E10: + c11 = l11 > u11; + break; + case P10: + c11 = l11 >= u11; + break; + case A10: + c11 = l11 < u11; + break; + case T8: + c11 = l11 <= u11; + break; + default: + throw new Error("Unknown comparator: " + e21.name); + } + return c11; + case N8: + var I11 = this.visit(e21.children[0], i11); + if (!t10(I11)) + return null; + var D11 = []; + for (v11 = 0; v11 < I11.length; v11++) + t10(s11 = I11[v11]) ? D11.push.apply(D11, s11) : D11.push(s11); + return D11; + case "Identity": + return i11; + case "MultiSelectList": + if (null === i11) + return null; + for (h11 = [], v11 = 0; v11 < e21.children.length; v11++) + h11.push(this.visit(e21.children[v11], i11)); + return h11; + case "MultiSelectHash": + if (null === i11) + return null; + var q11; + for (h11 = {}, v11 = 0; v11 < e21.children.length; v11++) + h11[(q11 = e21.children[v11]).name] = this.visit(q11.value, i11); + return h11; + case "OrExpression": + return o10(a11 = this.visit(e21.children[0], i11)) && (a11 = this.visit(e21.children[1], i11)), a11; + case "AndExpression": + return true === o10(l11 = this.visit(e21.children[0], i11)) ? l11 : this.visit(e21.children[1], i11); + case "NotExpression": + return o10(l11 = this.visit(e21.children[0], i11)); + case "Literal": + return e21.value; + case $10: + return d11 = this.visit(e21.children[0], i11), this.visit(e21.children[1], d11); + case S10: + return i11; + case "Function": + var z11 = []; + for (v11 = 0; v11 < e21.children.length; v11++) + z11.push(this.visit(e21.children[v11], i11)); + return this.runtime.callFunction(e21.name, z11); + case "ExpressionReference": + var B11 = e21.children[0]; + return B11.jmespathType = C10, B11; + default: + throw new Error("Unknown node type: " + e21.type); + } + }, computeSliceParams: function(e21, t11) { + var n11 = t11[0], r11 = t11[1], o11 = t11[2], i11 = [null, null, null]; + if (null === o11) + o11 = 1; + else if (0 === o11) { + var a11 = new Error("Invalid slice, step cannot be 0"); + throw a11.name = "RuntimeError", a11; + } + var s11 = o11 < 0; + return n11 = null === n11 ? s11 ? e21 - 1 : 0 : this.capSliceRange(e21, n11, o11), r11 = null === r11 ? s11 ? -1 : e21 : this.capSliceRange(e21, r11, o11), i11[0] = n11, i11[1] = r11, i11[2] = o11, i11; + }, capSliceRange: function(e21, t11, n11) { + return t11 < 0 ? (t11 += e21) < 0 && (t11 = n11 < 0 ? -1 : 0) : t11 >= e21 && (t11 = n11 < 0 ? e21 - 1 : e21), t11; + } }, X10.prototype = { callFunction: function(e21, t11) { + var n11 = this.functionTable[e21]; + if (void 0 === n11) + throw new Error("Unknown function: " + e21 + "()"); + return this._validateArgs(e21, t11, n11._signature), n11._func.call(this, t11); + }, _validateArgs: function(e21, t11, n11) { + var r11, o11, i11, a11; + if (n11[n11.length - 1].variadic) { + if (t11.length < n11.length) + throw r11 = 1 === n11.length ? " argument" : " arguments", new Error("ArgumentError: " + e21 + "() takes at least" + n11.length + r11 + " but received " + t11.length); + } else if (t11.length !== n11.length) + throw r11 = 1 === n11.length ? " argument" : " arguments", new Error("ArgumentError: " + e21 + "() takes " + n11.length + r11 + " but received " + t11.length); + for (var s11 = 0; s11 < n11.length; s11++) { + a11 = false, o11 = n11[s11].types, i11 = this._getTypeName(t11[s11]); + for (var c11 = 0; c11 < o11.length; c11++) + if (this._typeMatches(i11, o11[c11], t11[s11])) { + a11 = true; + break; + } + if (!a11) { + var l11 = o11.map(function(e23) { + return v10[e23]; + }).join(","); + throw new Error("TypeError: " + e21 + "() expected argument " + (s11 + 1) + " to be type " + l11 + " but received type " + v10[i11] + " instead."); + } + } + }, _typeMatches: function(e21, t11, n11) { + if (t11 === s10) + return true; + if (t11 !== h10 && t11 !== d10 && t11 !== l10) + return e21 === t11; + if (t11 === l10) + return e21 === l10; + if (e21 === l10) { + var r11; + t11 === d10 ? r11 = a10 : t11 === h10 && (r11 = c10); + for (var o11 = 0; o11 < n11.length; o11++) + if (!this._typeMatches(this._getTypeName(n11[o11]), r11, n11[o11])) + return false; + return true; + } + }, _getTypeName: function(e21) { + switch (Object.prototype.toString.call(e21)) { + case "[object String]": + return c10; + case "[object Number]": + return a10; + case "[object Array]": + return l10; + case "[object Boolean]": + return 5; + case "[object Null]": + return 7; + case "[object Object]": + return e21.jmespathType === C10 ? f10 : u10; + } + }, _functionStartsWith: function(e21) { + return 0 === e21[0].lastIndexOf(e21[1]); + }, _functionEndsWith: function(e21) { + var t11 = e21[0], n11 = e21[1]; + return -1 !== t11.indexOf(n11, t11.length - n11.length); + }, _functionReverse: function(e21) { + if (this._getTypeName(e21[0]) === c10) { + for (var t11 = e21[0], n11 = "", r11 = t11.length - 1; r11 >= 0; r11--) + n11 += t11[r11]; + return n11; + } + var o11 = e21[0].slice(0); + return o11.reverse(), o11; + }, _functionAbs: function(e21) { + return Math.abs(e21[0]); + }, _functionCeil: function(e21) { + return Math.ceil(e21[0]); + }, _functionAvg: function(e21) { + for (var t11 = 0, n11 = e21[0], r11 = 0; r11 < n11.length; r11++) + t11 += n11[r11]; + return t11 / n11.length; + }, _functionContains: function(e21) { + return e21[0].indexOf(e21[1]) >= 0; + }, _functionFloor: function(e21) { + return Math.floor(e21[0]); + }, _functionLength: function(e21) { + return n10(e21[0]) ? Object.keys(e21[0]).length : e21[0].length; + }, _functionMap: function(e21) { + for (var t11 = [], n11 = this._interpreter, r11 = e21[0], o11 = e21[1], i11 = 0; i11 < o11.length; i11++) + t11.push(n11.visit(r11, o11[i11])); + return t11; + }, _functionMerge: function(e21) { + for (var t11 = {}, n11 = 0; n11 < e21.length; n11++) { + var r11 = e21[n11]; + for (var o11 in r11) + t11[o11] = r11[o11]; + } + return t11; + }, _functionMax: function(e21) { + if (e21[0].length > 0) { + if (this._getTypeName(e21[0][0]) === a10) + return Math.max.apply(Math, e21[0]); + for (var t11 = e21[0], n11 = t11[0], r11 = 1; r11 < t11.length; r11++) + n11.localeCompare(t11[r11]) < 0 && (n11 = t11[r11]); + return n11; + } + return null; + }, _functionMin: function(e21) { + if (e21[0].length > 0) { + if (this._getTypeName(e21[0][0]) === a10) + return Math.min.apply(Math, e21[0]); + for (var t11 = e21[0], n11 = t11[0], r11 = 1; r11 < t11.length; r11++) + t11[r11].localeCompare(n11) < 0 && (n11 = t11[r11]); + return n11; + } + return null; + }, _functionSum: function(e21) { + for (var t11 = 0, n11 = e21[0], r11 = 0; r11 < n11.length; r11++) + t11 += n11[r11]; + return t11; + }, _functionType: function(e21) { + switch (this._getTypeName(e21[0])) { + case a10: + return "number"; + case c10: + return "string"; + case l10: + return "array"; + case u10: + return "object"; + case 5: + return "boolean"; + case f10: + return "expref"; + case 7: + return "null"; + } + }, _functionKeys: function(e21) { + return Object.keys(e21[0]); + }, _functionValues: function(e21) { + for (var t11 = e21[0], n11 = Object.keys(t11), r11 = [], o11 = 0; o11 < n11.length; o11++) + r11.push(t11[n11[o11]]); + return r11; + }, _functionJoin: function(e21) { + var t11 = e21[0]; + return e21[1].join(t11); + }, _functionToArray: function(e21) { + return this._getTypeName(e21[0]) === l10 ? e21[0] : [e21[0]]; + }, _functionToString: function(e21) { + return this._getTypeName(e21[0]) === c10 ? e21[0] : JSON.stringify(e21[0]); + }, _functionToNumber: function(e21) { + var t11, n11 = this._getTypeName(e21[0]); + return n11 === a10 ? e21[0] : n11 !== c10 || (t11 = +e21[0], isNaN(t11)) ? null : t11; + }, _functionNotNull: function(e21) { + for (var t11 = 0; t11 < e21.length; t11++) + if (7 !== this._getTypeName(e21[t11])) + return e21[t11]; + return null; + }, _functionSort: function(e21) { + var t11 = e21[0].slice(0); + return t11.sort(), t11; + }, _functionSortBy: function(e21) { + var t11 = e21[0].slice(0); + if (0 === t11.length) + return t11; + var n11 = this._interpreter, r11 = e21[1], o11 = this._getTypeName(n11.visit(r11, t11[0])); + if ([a10, c10].indexOf(o11) < 0) + throw new Error("TypeError"); + for (var i11 = this, s11 = [], l11 = 0; l11 < t11.length; l11++) + s11.push([l11, t11[l11]]); + s11.sort(function(e23, t12) { + var a11 = n11.visit(r11, e23[1]), s12 = n11.visit(r11, t12[1]); + if (i11._getTypeName(a11) !== o11) + throw new Error("TypeError: expected " + o11 + ", received " + i11._getTypeName(a11)); + if (i11._getTypeName(s12) !== o11) + throw new Error("TypeError: expected " + o11 + ", received " + i11._getTypeName(s12)); + return a11 > s12 ? 1 : a11 < s12 ? -1 : e23[0] - t12[0]; + }); + for (var u11 = 0; u11 < s11.length; u11++) + t11[u11] = s11[u11][1]; + return t11; + }, _functionMaxBy: function(e21) { + for (var t11, n11, r11 = e21[1], o11 = e21[0], i11 = this.createKeyFunction(r11, [a10, c10]), s11 = -1 / 0, l11 = 0; l11 < o11.length; l11++) + (n11 = i11(o11[l11])) > s11 && (s11 = n11, t11 = o11[l11]); + return t11; + }, _functionMinBy: function(e21) { + for (var t11, n11, r11 = e21[1], o11 = e21[0], i11 = this.createKeyFunction(r11, [a10, c10]), s11 = 1 / 0, l11 = 0; l11 < o11.length; l11++) + (n11 = i11(o11[l11])) < s11 && (s11 = n11, t11 = o11[l11]); + return t11; + }, createKeyFunction: function(e21, t11) { + var n11 = this, r11 = this._interpreter; + return function(o11) { + var i11 = r11.visit(e21, o11); + if (t11.indexOf(n11._getTypeName(i11)) < 0) { + var a11 = "TypeError: expected one of " + t11 + ", received " + n11._getTypeName(i11); + throw new Error(a11); + } + return i11; + }; + } }, e20.tokenize = function(e21) { + return new K10().tokenize(e21); + }, e20.compile = function(e21) { + return new Q10().parse(e21); + }, e20.search = function(e21, t11) { + var n11 = new Q10(), r11 = new X10(), o11 = new Y10(r11); + r11._interpreter = o11; + var i11 = n11.parse(t11); + return o11.search(i11, e21); + }, e20.strictDeepEqual = r10; + }(Dee); + var qee = yc(Dee); + var Fee = function(e20, t10) { + if (!(e20 instanceof t10)) + throw new TypeError("Cannot call a class as a function"); + }; + var Vee = /* @__PURE__ */ function() { + function e20(e21, t10) { + for (var n10 = 0; n10 < t10.length; n10++) { + var r10 = t10[n10]; + r10.enumerable = r10.enumerable || false, r10.configurable = true, "value" in r10 && (r10.writable = true), Object.defineProperty(e21, r10.key, r10); + } + } + return function(t10, n10, r10) { + return n10 && e20(t10.prototype, n10), r10 && e20(t10, r10), t10; + }; + }(); + var Hee = function(e20, t10) { + if (Array.isArray(e20)) + return e20; + if (Symbol.iterator in Object(e20)) + return function(e21, t11) { + var n10 = [], r10 = true, o10 = false, i10 = void 0; + try { + for (var a10, s10 = e21[Symbol.iterator](); !(r10 = (a10 = s10.next()).done) && (n10.push(a10.value), !t11 || n10.length !== t11); r10 = true) + ; + } catch (e23) { + o10 = true, i10 = e23; + } finally { + try { + !r10 && s10.return && s10.return(); + } finally { + if (o10) + throw i10; + } + } + return n10; + }(e20, t10); + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + }; + String.prototype.startsWith = String.prototype.startsWith || function(e20) { + return 0 === this.indexOf(e20); + }, String.prototype.padStart = String.prototype.padStart || function(e20, t10) { + for (var n10 = this; n10.length < e20; ) + n10 = t10 + n10; + return n10; + }; + var Wee = { cb: "0f8ff", tqw: "aebd7", q: "-ffff", qmrn: "7fffd4", zr: "0ffff", bg: "5f5dc", bsq: "e4c4", bck: "---", nch: "ebcd", b: "--ff", bvt: "8a2be2", brwn: "a52a2a", brw: "deb887", ctb: "5f9ea0", hrt: "7fff-", chcT: "d2691e", cr: "7f50", rnw: "6495ed", crns: "8dc", crms: "dc143c", cn: "-ffff", Db: "--8b", Dcn: "-8b8b", Dgnr: "b8860b", Dgr: "a9a9a9", Dgrn: "-64-", Dkhk: "bdb76b", Dmgn: "8b-8b", Dvgr: "556b2f", Drng: "8c-", Drch: "9932cc", Dr: "8b--", Dsmn: "e9967a", Dsgr: "8fbc8f", DsTb: "483d8b", DsTg: "2f4f4f", Dtrq: "-ced1", Dvt: "94-d3", ppnk: "1493", pskb: "-bfff", mgr: "696969", grb: "1e90ff", rbrc: "b22222", rwht: "af0", stg: "228b22", chs: "-ff", gnsb: "dcdcdc", st: "8f8ff", g: "d7-", gnr: "daa520", gr: "808080", grn: "-8-0", grnw: "adff2f", hnw: "0fff0", htpn: "69b4", nnr: "cd5c5c", ng: "4b-82", vr: "0", khk: "0e68c", vnr: "e6e6fa", nrb: "0f5", wngr: "7cfc-", mnch: "acd", Lb: "add8e6", Lcr: "08080", Lcn: "e0ffff", Lgnr: "afad2", Lgr: "d3d3d3", Lgrn: "90ee90", Lpnk: "b6c1", Lsmn: "a07a", Lsgr: "20b2aa", Lskb: "87cefa", LsTg: "778899", Lstb: "b0c4de", Lw: "e0", m: "-ff-", mgrn: "32cd32", nn: "af0e6", mgnt: "-ff", mrn: "8--0", mqm: "66cdaa", mmb: "--cd", mmrc: "ba55d3", mmpr: "9370db", msg: "3cb371", mmsT: "7b68ee", "": "-fa9a", mtr: "48d1cc", mmvt: "c71585", mnLb: "191970", ntc: "5fffa", mstr: "e4e1", mccs: "e4b5", vjw: "dead", nv: "--80", c: "df5e6", v: "808-0", vrb: "6b8e23", rng: "a5-", rngr: "45-", rch: "da70d6", pgnr: "eee8aa", pgrn: "98fb98", ptrq: "afeeee", pvtr: "db7093", ppwh: "efd5", pchp: "dab9", pr: "cd853f", pnk: "c0cb", pm: "dda0dd", pwrb: "b0e0e6", prp: "8-080", cc: "663399", r: "--", sbr: "bc8f8f", rb: "4169e1", sbrw: "8b4513", smn: "a8072", nbr: "4a460", sgrn: "2e8b57", ssh: "5ee", snn: "a0522d", svr: "c0c0c0", skb: "87ceeb", sTb: "6a5acd", sTgr: "708090", snw: "afa", n: "-ff7f", stb: "4682b4", tn: "d2b48c", t: "-8080", thst: "d8bfd8", tmT: "6347", trqs: "40e0d0", vt: "ee82ee", whT: "5deb3", wht: "", hts: "5f5f5", w: "-", wgrn: "9acd32" }; + function Uee(e20) { + var t10 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; + return (t10 > 0 ? e20.toFixed(t10).replace(/0+$/, "").replace(/\.$/, "") : e20.toString()) || "0"; + } + var Jee = function() { + function e20(t10, n10, r10, o10) { + Fee(this, e20); + var i10 = this; + if (void 0 === t10) + ; + else if (Array.isArray(t10)) + this.rgba = t10; + else if (void 0 === r10) { + var a10 = t10 && "" + t10; + a10 && function(t11) { + if (t11.startsWith("hsl")) { + var n11 = t11.match(/([\-\d\.e]+)/g).map(Number), r11 = Hee(n11, 4), o11 = r11[0], a11 = r11[1], s10 = r11[2], c10 = r11[3]; + void 0 === c10 && (c10 = 1), o11 /= 360, a11 /= 100, s10 /= 100, i10.hsla = [o11, a11, s10, c10]; + } else if (t11.startsWith("rgb")) { + var l10 = t11.match(/([\-\d\.e]+)/g).map(Number), u10 = Hee(l10, 4), f10 = u10[0], d10 = u10[1], h10 = u10[2], v10 = u10[3]; + void 0 === v10 && (v10 = 1), i10.rgba = [f10, d10, h10, v10]; + } else + t11.startsWith("#") ? i10.rgba = e20.hexToRgb(t11) : i10.rgba = e20.nameToRgb(t11) || e20.hexToRgb(t11); + }(a10.toLowerCase()); + } else + this.rgba = [t10, n10, r10, void 0 === o10 ? 1 : o10]; + } + return Vee(e20, [{ key: "printRGB", value: function(e21) { + var t10 = (e21 ? this.rgba : this.rgba.slice(0, 3)).map(function(e23, t11) { + return Uee(e23, 3 === t11 ? 3 : 0); + }); + return e21 ? "rgba(" + t10 + ")" : "rgb(" + t10 + ")"; + } }, { key: "printHSL", value: function(e21) { + var t10 = [360, 100, 100, 1], n10 = ["", "%", "%", ""], r10 = (e21 ? this.hsla : this.hsla.slice(0, 3)).map(function(e23, r11) { + return Uee(e23 * t10[r11], 3 === r11 ? 3 : 1) + n10[r11]; + }); + return e21 ? "hsla(" + r10 + ")" : "hsl(" + r10 + ")"; + } }, { key: "printHex", value: function(e21) { + var t10 = this.hex; + return e21 ? t10 : t10.substring(0, 7); + } }, { key: "rgba", get: function() { + if (this._rgba) + return this._rgba; + if (!this._hsla) + throw new Error("No color is set"); + return this._rgba = e20.hslToRgb(this._hsla); + }, set: function(e21) { + 3 === e21.length && (e21[3] = 1), this._rgba = e21, this._hsla = null; + } }, { key: "rgbString", get: function() { + return this.printRGB(); + } }, { key: "rgbaString", get: function() { + return this.printRGB(true); + } }, { key: "hsla", get: function() { + if (this._hsla) + return this._hsla; + if (!this._rgba) + throw new Error("No color is set"); + return this._hsla = e20.rgbToHsl(this._rgba); + }, set: function(e21) { + 3 === e21.length && (e21[3] = 1), this._hsla = e21, this._rgba = null; + } }, { key: "hslString", get: function() { + return this.printHSL(); + } }, { key: "hslaString", get: function() { + return this.printHSL(true); + } }, { key: "hex", get: function() { + var e21 = this.rgba.map(function(e23, t10) { + return t10 < 3 ? e23.toString(16) : Math.round(255 * e23).toString(16); + }); + return "#" + e21.map(function(e23) { + return e23.padStart(2, "0"); + }).join(""); + }, set: function(t10) { + this.rgba = e20.hexToRgb(t10); + } }], [{ key: "hexToRgb", value: function(e21) { + var t10 = (e21.startsWith("#") ? e21.slice(1) : e21).replace(/^(\w{3})$/, "$1F").replace(/^(\w)(\w)(\w)(\w)$/, "$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/, "$1FF"); + if (!t10.match(/^([0-9a-fA-F]{8})$/)) + throw new Error("Unknown hex color; " + e21); + var n10 = t10.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(e23) { + return parseInt(e23, 16); + }); + return n10[3] = n10[3] / 255, n10; + } }, { key: "nameToRgb", value: function(t10) { + var n10 = t10.toLowerCase().replace("at", "T").replace(/[aeiouyldf]/g, "").replace("ght", "L").replace("rk", "D").slice(-5, 4), r10 = Wee[n10]; + return void 0 === r10 ? r10 : e20.hexToRgb(r10.replace(/\-/g, "00").padStart(6, "f")); + } }, { key: "rgbToHsl", value: function(e21) { + var t10 = Hee(e21, 4), n10 = t10[0], r10 = t10[1], o10 = t10[2], i10 = t10[3]; + n10 /= 255, r10 /= 255, o10 /= 255; + var a10 = Math.max(n10, r10, o10), s10 = Math.min(n10, r10, o10), c10 = void 0, l10 = void 0, u10 = (a10 + s10) / 2; + if (a10 === s10) + c10 = l10 = 0; + else { + var f10 = a10 - s10; + switch (l10 = u10 > 0.5 ? f10 / (2 - a10 - s10) : f10 / (a10 + s10), a10) { + case n10: + c10 = (r10 - o10) / f10 + (r10 < o10 ? 6 : 0); + break; + case r10: + c10 = (o10 - n10) / f10 + 2; + break; + case o10: + c10 = (n10 - r10) / f10 + 4; + } + c10 /= 6; + } + return [c10, l10, u10, i10]; + } }, { key: "hslToRgb", value: function(e21) { + var t10 = Hee(e21, 4), n10 = t10[0], r10 = t10[1], o10 = t10[2], i10 = t10[3], a10 = void 0, s10 = void 0, c10 = void 0; + if (0 === r10) + a10 = s10 = c10 = o10; + else { + var l10 = function(e23, t11, n11) { + return n11 < 0 && (n11 += 1), n11 > 1 && (n11 -= 1), n11 < 1 / 6 ? e23 + 6 * (t11 - e23) * n11 : n11 < 0.5 ? t11 : n11 < 2 / 3 ? e23 + (t11 - e23) * (2 / 3 - n11) * 6 : e23; + }, u10 = o10 < 0.5 ? o10 * (1 + r10) : o10 + r10 - o10 * r10, f10 = 2 * o10 - u10; + a10 = l10(f10, u10, n10 + 1 / 3), s10 = l10(f10, u10, n10), c10 = l10(f10, u10, n10 - 1 / 3); + } + var d10 = [255 * a10, 255 * s10, 255 * c10].map(Math.round); + return d10[3] = i10, d10; + } }]), e20; + }(); + var Kee = function() { + function e20() { + Fee(this, e20), this._events = []; + } + return Vee(e20, [{ key: "add", value: function(e21, t10, n10) { + e21.addEventListener(t10, n10, false), this._events.push({ target: e21, type: t10, handler: n10 }); + } }, { key: "remove", value: function(t10, n10, r10) { + this._events = this._events.filter(function(o10) { + var i10 = true; + return t10 && t10 !== o10.target && (i10 = false), n10 && n10 !== o10.type && (i10 = false), r10 && r10 !== o10.handler && (i10 = false), i10 && e20._doRemove(o10.target, o10.type, o10.handler), !i10; + }); + } }, { key: "destroy", value: function() { + this._events.forEach(function(t10) { + return e20._doRemove(t10.target, t10.type, t10.handler); + }), this._events = []; + } }], [{ key: "_doRemove", value: function(e21, t10, n10) { + e21.removeEventListener(t10, n10, false); + } }]), e20; + }(); + function Gee(e20, t10, n10) { + var r10 = false; + function o10(e21, t11, n11) { + return Math.max(t11, Math.min(e21, n11)); + } + function i10(e21, i11, a11) { + if (a11 && (r10 = true), r10) { + e21.preventDefault(); + var s11 = t10.getBoundingClientRect(), c10 = s11.width, l10 = s11.height, u10 = i11.clientX, f10 = i11.clientY, d10 = o10(u10 - s11.left, 0, c10), h10 = o10(f10 - s11.top, 0, l10); + n10(d10 / c10, h10 / l10); + } + } + function a10(e21, t11) { + 1 === (void 0 === e21.buttons ? e21.which : e21.buttons) ? i10(e21, e21, t11) : r10 = false; + } + function s10(e21, t11) { + 1 === e21.touches.length ? i10(e21, e21.touches[0], t11) : r10 = false; + } + e20.add(t10, "mousedown", function(e21) { + a10(e21, true); + }), e20.add(t10, "touchstart", function(e21) { + s10(e21, true); + }), e20.add(window, "mousemove", a10), e20.add(t10, "touchmove", s10), e20.add(window, "mouseup", function(e21) { + r10 = false; + }), e20.add(t10, "touchend", function(e21) { + r10 = false; + }), e20.add(t10, "touchcancel", function(e21) { + r10 = false; + }); + } + var Qee = "keydown"; + var Yee = "mousedown"; + var Xee = "focusin"; + function Zee(e20, t10) { + return (t10 || document).querySelector(e20); + } + function ete(e20) { + e20.preventDefault(), e20.stopPropagation(); + } + function tte(e20, t10, n10, r10, o10) { + e20.add(t10, Qee, function(e21) { + n10.indexOf(e21.key) >= 0 && (o10 && ete(e21), r10(e21)); + }); + } + var nte = function() { + function e20(t10) { + Fee(this, e20), this.settings = { popup: "right", layout: "default", alpha: true, editor: true, editorFormat: "hex", cancelButton: false, defaultColor: "#0cf" }, this._events = new Kee(), this.onChange = null, this.onDone = null, this.onOpen = null, this.onClose = null, this.setOptions(t10); + } + return Vee(e20, [{ key: "setOptions", value: function(e21) { + var t10 = this; + if (e21) { + var n10 = this.settings; + if (e21 instanceof HTMLElement) + n10.parent = e21; + else { + n10.parent && e21.parent && n10.parent !== e21.parent && (this._events.remove(n10.parent), this._popupInited = false), function(e23, t11, n11) { + for (var r11 in e23) + n11 && n11.indexOf(r11) >= 0 || (t11[r11] = e23[r11]); + }(e21, n10), e21.onChange && (this.onChange = e21.onChange), e21.onDone && (this.onDone = e21.onDone), e21.onOpen && (this.onOpen = e21.onOpen), e21.onClose && (this.onClose = e21.onClose); + var r10 = e21.color || e21.colour; + r10 && this._setColor(r10); + } + var o10 = n10.parent; + if (o10 && n10.popup && !this._popupInited) { + var i10 = function(e23) { + return t10.openHandler(e23); + }; + this._events.add(o10, "click", i10), tte(this._events, o10, [" ", "Spacebar", "Enter"], i10), this._popupInited = true; + } else + e21.parent && !n10.popup && this.show(); + } + } }, { key: "openHandler", value: function(e21) { + if (this.show()) { + e21 && e21.preventDefault(), this.settings.parent.style.pointerEvents = "none"; + var t10 = e21 && e21.type === Qee ? this._domEdit : this.domElement; + setTimeout(function() { + return t10.focus(); + }, 100), this.onOpen && this.onOpen(this.colour); + } + } }, { key: "closeHandler", value: function(e21) { + var t10 = e21 && e21.type, n10 = false; + if (e21) + if (t10 === Yee || t10 === Xee) { + var r10 = (this.__containedEvent || 0) + 100; + e21.timeStamp > r10 && (n10 = true); + } else + ete(e21), n10 = true; + else + n10 = true; + n10 && this.hide() && (this.settings.parent.style.pointerEvents = "", t10 !== Yee && this.settings.parent.focus(), this.onClose && this.onClose(this.colour)); + } }, { key: "movePopup", value: function(e21, t10) { + this.closeHandler(), this.setOptions(e21), t10 && this.openHandler(); + } }, { key: "setColor", value: function(e21, t10) { + this._setColor(e21, { silent: t10 }); + } }, { key: "_setColor", value: function(e21, t10) { + if ("string" == typeof e21 && (e21 = e21.trim()), e21) { + t10 = t10 || {}; + var n10 = void 0; + try { + n10 = new Jee(e21); + } catch (e23) { + if (t10.failSilently) + return; + throw e23; + } + if (!this.settings.alpha) { + var r10 = n10.hsla; + r10[3] = 1, n10.hsla = r10; + } + this.colour = this.color = n10, this._setHSLA(null, null, null, null, t10); + } + } }, { key: "setColour", value: function(e21, t10) { + this.setColor(e21, t10); + } }, { key: "show", value: function() { + if (!this.settings.parent) + return false; + if (this.domElement) { + var e21 = this._toggleDOM(true); + return this._setPosition(), e21; + } + var t10, n10, r10 = this.settings.template || '
', o10 = (t10 = r10, (n10 = document.createElement("div")).innerHTML = t10, n10.firstElementChild); + return this.domElement = o10, this._domH = Zee(".picker_hue", o10), this._domSL = Zee(".picker_sl", o10), this._domA = Zee(".picker_alpha", o10), this._domEdit = Zee(".picker_editor input", o10), this._domSample = Zee(".picker_sample", o10), this._domOkay = Zee(".picker_done button", o10), this._domCancel = Zee(".picker_cancel button", o10), o10.classList.add("layout_" + this.settings.layout), this.settings.alpha || o10.classList.add("no_alpha"), this.settings.editor || o10.classList.add("no_editor"), this.settings.cancelButton || o10.classList.add("no_cancel"), this._ifPopup(function() { + return o10.classList.add("popup"); + }), this._setPosition(), this.colour ? this._updateUI() : this._setColor(this.settings.defaultColor), this._bindEvents(), true; + } }, { key: "hide", value: function() { + return this._toggleDOM(false); + } }, { key: "destroy", value: function() { + this._events.destroy(), this.domElement && this.settings.parent.removeChild(this.domElement); + } }, { key: "_bindEvents", value: function() { + var e21 = this, t10 = this, n10 = this.domElement, r10 = this._events; + function o10(e23, t11, n11) { + r10.add(e23, t11, n11); + } + o10(n10, "click", function(e23) { + return e23.preventDefault(); + }), Gee(r10, this._domH, function(e23, n11) { + return t10._setHSLA(e23); + }), Gee(r10, this._domSL, function(e23, n11) { + return t10._setHSLA(null, e23, 1 - n11); + }), this.settings.alpha && Gee(r10, this._domA, function(e23, n11) { + return t10._setHSLA(null, null, null, 1 - n11); + }); + var i10 = this._domEdit; + o10(i10, "input", function(e23) { + t10._setColor(this.value, { fromEditor: true, failSilently: true }); + }), o10(i10, "focus", function(e23) { + var t11 = this; + t11.selectionStart === t11.selectionEnd && t11.select(); + }), this._ifPopup(function() { + var t11 = function(t12) { + return e21.closeHandler(t12); + }; + o10(window, Yee, t11), o10(window, Xee, t11), tte(r10, n10, ["Esc", "Escape"], t11); + var i11 = function(t12) { + e21.__containedEvent = t12.timeStamp; + }; + o10(n10, Yee, i11), o10(n10, Xee, i11), o10(e21._domCancel, "click", t11); + }); + var a10 = function(t11) { + e21._ifPopup(function() { + return e21.closeHandler(t11); + }), e21.onDone && e21.onDone(e21.colour); + }; + o10(this._domOkay, "click", a10), tte(r10, n10, ["Enter"], a10); + } }, { key: "_setPosition", value: function() { + var e21 = this.settings.parent, t10 = this.domElement; + e21 !== t10.parentNode && e21.appendChild(t10), this._ifPopup(function(n10) { + "static" === getComputedStyle(e21).position && (e21.style.position = "relative"); + var r10 = true === n10 ? "popup_right" : "popup_" + n10; + ["popup_top", "popup_bottom", "popup_left", "popup_right"].forEach(function(e23) { + e23 === r10 ? t10.classList.add(e23) : t10.classList.remove(e23); + }), t10.classList.add(r10); + }); + } }, { key: "_setHSLA", value: function(e21, t10, n10, r10, o10) { + o10 = o10 || {}; + var i10 = this.colour, a10 = i10.hsla; + [e21, t10, n10, r10].forEach(function(e23, t11) { + (e23 || 0 === e23) && (a10[t11] = e23); + }), i10.hsla = a10, this._updateUI(o10), this.onChange && !o10.silent && this.onChange(i10); + } }, { key: "_updateUI", value: function(e21) { + if (this.domElement) { + e21 = e21 || {}; + var t10 = this.colour, n10 = t10.hsla, r10 = "hsl(" + 360 * n10[0] + ", 100%, 50%)", o10 = t10.hslString, i10 = t10.hslaString, a10 = this._domH, s10 = this._domSL, c10 = this._domA, l10 = Zee(".picker_selector", a10), u10 = Zee(".picker_selector", s10), f10 = Zee(".picker_selector", c10); + y10(0, l10, n10[0]), this._domSL.style.backgroundColor = this._domH.style.color = r10, y10(0, u10, n10[1]), b10(0, u10, 1 - n10[2]), s10.style.color = o10, b10(0, f10, 1 - n10[3]); + var d10 = o10, h10 = d10.replace("hsl", "hsla").replace(")", ", 0)"), v10 = "linear-gradient(" + [d10, h10] + ")"; + if (this._domA.style.background = v10 + ", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em", !e21.fromEditor) { + var p10 = this.settings.editorFormat, m10 = this.settings.alpha, g10 = void 0; + switch (p10) { + case "rgb": + g10 = t10.printRGB(m10); + break; + case "hsl": + g10 = t10.printHSL(m10); + break; + default: + g10 = t10.printHex(m10); + } + this._domEdit.value = g10; + } + this._domSample.style.color = i10; + } + function y10(e23, t11, n11) { + t11.style.left = 100 * n11 + "%"; + } + function b10(e23, t11, n11) { + t11.style.top = 100 * n11 + "%"; + } + } }, { key: "_ifPopup", value: function(e21, t10) { + this.settings.parent && this.settings.popup ? e21 && e21(this.settings.popup) : t10 && t10(); + } }, { key: "_toggleDOM", value: function(e21) { + var t10 = this.domElement; + if (!t10) + return false; + var n10 = e21 ? "" : "none", r10 = t10.style.display !== n10; + return r10 && (t10.style.display = n10), r10; + } }]), e20; + }(); + var rte = document.createElement("style"); + rte.textContent = '.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}', document.documentElement.firstElementChild.appendChild(rte), nte.StyleElement = rte; + var ote = Object.freeze({ __proto__: null, default: nte }); + + // jsoneditor.js + JSONEditorInstance = new C8({ target: JSONEditor_target, props: {} }); +})(); +/*! Bundled license information: + +vanilla-jsoneditor/standalone.js: + (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *) + +vanilla-jsoneditor/standalone.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + +vanilla-jsoneditor/standalone.js: + (*! + * vanilla-picker v2.12.2 + * https://vanilla-picker.js.org + * + * Copyright 2017-2023 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) + * Released under the ISC license. + *) +*/ diff --git a/apps/hadash/jsoneditor.wrapperjs b/apps/hadash/jsoneditor.wrapperjs new file mode 100644 index 0000000000..951d4b8b7f --- /dev/null +++ b/apps/hadash/jsoneditor.wrapperjs @@ -0,0 +1,22 @@ +/* + * JSONEditor wrapper + * + * This script is bundled together with the actual JSONEditor (https://github.com/josdejong/svelte-jsoneditor) + * using ESBuild (see below). + * + * The following global variables need to be defined before including the jsoneditor-bundle.js: + * + * JSONEditorInstance will contain the new JSONEditor instance + * JSONEditor_target element ID of container (
) for the JSONEditor + * + * To build the bundle, run the following commands: + * npm install esbuild + * npm install vanilla-jsoneditor + * ./node_modules/.bin/esbuild jsoneditor.wrapperjs --bundle --outfile=jsoneditor.bundlejs + * + */ + +import { JSONEditor } from 'vanilla-jsoneditor/standalone.js' + +JSONEditorInstance = new JSONEditor({ target: JSONEditor_target, props: {} }); + diff --git a/apps/hadash/metadata.json b/apps/hadash/metadata.json new file mode 100644 index 0000000000..646101b5ba --- /dev/null +++ b/apps/hadash/metadata.json @@ -0,0 +1,20 @@ +{ + "id": "hadash", + "name": "Home-Assistant Dashboard", + "shortName":"HA-Dash", + "version":"1.00", + "description": "Interact with Home-Assistant (query states, call services)", + "icon": "hadash.png", + "screenshots": [{ "url": "screenshot.png" }], + "type": "app", + "tags": "tool,online", + "supports": ["BANGLEJS2"], + "dependencies": { "textinput": "type" }, + "readme": "README.md", + "interface": "interface.html", + "storage": [ + { "name":"hadash.app.js", "url":"hadash.app.js" }, + { "name":"hadash.img", "url":"hadash-icon.js", "evaluate":true } + ], + "data": [{ "name":"hadash.json" }] +} diff --git a/apps/hadash/screenshot.png b/apps/hadash/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..09cd252e0544c76db0a6f00852ca7631e4d30605 GIT binary patch literal 3134 zcmb7{`8yO`8^<-#NE)V@gz#DtWyz8l;<1boGS=v^Uy?A$PWGt?V=qfJwvmzyV#dgX z>4}EPzKkV}5hF`u$-ckyJkR?Nyg!_CU+0|9b)WOY{rz6|NwGqjoaPhdhZ`;qy!;j$@umG64Y`vr=9Z=O+Ru{_brzGRMKPwlp#WwX5M z&u$01*Q`m1=RV>Mi@gOnQ$KW68uUA|AY3OC0t$g8~LA27k zZm^TNi}m)ImiO(FH$m7dT~){`p6^0>wPA9l$D<3kN>jxmQIn&%H4ETUkSlCOXstC? zE6e$du|k(7rNHgwn7J@)&F-*cJy;<(vEYEX}c!j0Nl(?EP;i zSNdP1dFaE$vkId$fCaGU^gJ;N;W%7a%Eh9nYrneoimNO^tiaklEZu-b?PhUk{1C&yL$J_>ga{YGRk`rFD`H(d~O*5NXHl+mU;F0hs5 zDyOv-`<2;iRwe)0z;7(gVe?c6L4K;fZ$I~CzD4=$RY2})l0J{RND17#>V&TrE07FC z{VsU+WGqqtQ|$|*?xo&&P}+(8#$lYPBFvKD;%Ny=gNoWBbyR3$2<0DH+`n3sAi@vE ztrsz}Ot|~ir<=d=Vxvu?b)e!f_ls`E=%On>a8$2h_pKXwBTH_?UOCWYKD8SR9&e2~q?i^y)%kY>GVT{D)*r59B#^Q&kxi z3%4j23{sT>26+F;Ck&CSJa2h;Hc9#a zSuz5dR8w!0_lHNj*rHG^wG{l3CPg~^2KjU0>{+7pO8R_QVkw3~^VjTV z8#5KS<~HvLqK)0b+nd5!TyHKhF9x!^ACCmJ>Qs49mmBtV0XxfMC{=dzBvZI%ZTw)l z1C6TrR5Ef0d1~;fs6;81_oeIu8~yjdFNB$l26Koom@BvV=z?6*zxhvD(C*?0Jj7`GBsYT4@fH6;!{}s# z06r#5Hy=QB`HWoD_8hD%<#|w{ggJfnOYhZ0QX@Yad~z`O;zJR#1}@Tcrde6`L6J-r zebhiJy_+6B*)`Lpr1l0DW^pdB!Y?+7Qcg^~t2YVT$8jV2qv^*6M*CYF29qg8&LhF; z#zuBOtuuD-zeg{;YO0H99I4x34RpFiw`NL-rZNd)V-^m*9RX$l&vUs>_H5!IVK-$Q zpSv|fQIrxXRMH*}{?(g^4QqX14RFF`Ngc1m(7*8_od z^JGC7*o@4Rhvf&Ga>r%QU*^{HKZk>3>ApEqNknDyZpT>EVdA*a=AX2vw;8|fuV!F5 zuUE)+I`kl}W={Bl(u!{87Wu1N=KTIteq8&;QfIegcroVKih}m?M)~4^P7XD|)N=7D z*?O8VOF5X)4febTnn=yE27g7!+Qw7$)Tf>B0T*J6nX6|Sg@SG>f2~e68Jfhm+7I9z zmv#K>m$YX#P6$R4y-g0lvDt>Jto|2IAd&4Iq{9Ui_msoXwCFSxJ-sT889dv_gRU_U zyI&nSya;E`6RaMs@+DIYmZL6>6k0@qwIqObS}w=Hx4DrLz_#Yt>xUT^0G4kOMbjMg z

zcOYpWjZ>V12b*N_$4iL;t@p$((l4pjp`hxZY&WVtAd)rmM4)nA}ZhH!!_c=qd z;CNzzaG*K|omb|rr^J(zzGzA}hIrmaEk^Y|_pWFjrbTaHL@g&oyow`UX_1it8N-rbC_X|? zW#As-fi|#t?fKT$dVT+GLjuxGkyV$??S*XjizVShU(94LlIVcB3~TMu7QzWFHQm|0 z`_?FEc#Bd5*Q|nVSo9-aKiS7}nO@!r3$rZxp-QO7-b!E3c&5=$n^-ym)zc?jwWgce zHU+Dd1%%)TyqXK1;a`-^Y4mL?vh0rsH(bA+_DG@8Nj>rL$}wta6d{F%76~qCl3mav z1-iNp?BDU}5F`$%s0$5k(ZxRnD^)_W1uUgho?;Lz3O`KxWIm*VE-*W3eT0b1P3i9s zIpMOM!(e4jPLR&4CR55|vUkh`%;ioQ3!c?|TtCz5L#D^v z4+V8Cw0nOZZCF72B|!?LzPa#X<0jb!f?oMt;L*KyTk{_6RLUf1|E6@@QT<_Fn<>-Y zwQWEK7pG(hhW!p!*vWP=M>22`-Fj=w^!JiY=`?iN+{>mIH6bVNA)!-@9kRm&2y zy(+fxMD)kJ`#$S}ojH4PN;aacwCKV8m(KWhF-NvK84>Og7v}^0o>KcA1aOje2z#ZE zVy}wC#Np?}giVstnROwSg#$Xrn;?V`5Af)JHk$_U`n{sKp$c9<*A2$gf8l+V|95vAjZ*aQ;WfoGL{#Jt!`ukMbsdD`{0O?v@ML@)fY~_4F08gkPnfIdz z`j6P}VQQH=&Y`7HUVD9zm|{g&_bq+Ub%*;zp{fKit=m@5U%umXAk_?CrQ65YhX3f| zlYwlA4W%lfs4ayftJ{+)>L#Si)inv6^ccz_^=(w-EgrZ#=k6BYP?Ync0`sCuh*~DA z>s=A#zT)OcEIB+kqHA_tCZNde6D#Tr6+3u0eQItEP{pofIPjY8q*;5b*lg^B!1dH;WxqDtN!1zllD|D^W_Tz=Voq>5bLn^$7PZtNW98fJ%RNmXu}9@tgdIbdIfODUiSHzf=PrBy1wNwX>r zmk`uH57J9&F%%7)q}uF=adzFXGR@eS84_`&g*04sFn=LX$*in`mNk$Ak*R#v(X(y< zQ?Y4uW{|IlnK9Q<*E6wRcF2?)y;m@fu4Yy5=S@ z-MFNDpY-pYVyC}E0yf=FQMpJPJI)<+#?1X~Twq9+=^(5zkTijlcoHjH$ z21s}6Yz>HVMgD57mj^Nut}IB~{OgKP*~|HWGUz|8MWkJ5XEjuxZ|-q8I8q%D-$YpS zlz^V)0QJzUA~$q3d=bqmp9;hFPUT1QgyUBMUFw&KeN{{;(!9#w-EO( yNdk+?3F9I-4wzh}rftsYa}~>ndjxq7fxg?mK2H#xcR2q7E>mM9yxP$H;eP=!92Zys literal 0 HcmV?d00001 From d4229a75d2083bcda255c01707d2fd730df15bd9 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 5 Sep 2024 21:51:46 +0200 Subject: [PATCH 112/451] Make icon more readable --- apps/dutchclock/README.md | 6 +++--- apps/dutchclock/app.png | Bin 1436 -> 1856 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/README.md b/apps/dutchclock/README.md index 167cd4a4c4..4faa03aa80 100644 --- a/apps/dutchclock/README.md +++ b/apps/dutchclock/README.md @@ -1,7 +1,7 @@ # Dutch Clock -This clock shows the time, in words, the way a Dutch person would tell you what time it is. Useful when learning Dutch. +This clock shows the time, in words, the way a Dutch person would tell you what time it is. Useful when learning Dutch or pretending to know Dutch. -It was inspired by my wife, who sometimes insists I tell her exactly what time it says on the watch and not just an approximation. +Dedicated my wife, who will sometimes insist I tell her exactly what time it says on the watch and not just an approximation. ## Options - Three modes: @@ -15,4 +15,4 @@ It was inspired by my wife, who sometimes insists I tell her exactly what time i ## Screenshots ![](screenshotbangle1-2.png) ![](screenshotbangle2.png) -![](screenshotbangle1.png) +![](screenshotbangle1.png) \ No newline at end of file diff --git a/apps/dutchclock/app.png b/apps/dutchclock/app.png index faacb7eaf13b86d8144a49f9afa9f0d9a49958ce..94d35b0c50425c16b10d8a39f205514250a51f76 100644 GIT binary patch delta 1825 zcmV++2j2Lc3&0ML83+Ra003az3AK?SAAbU}P)t-s|NsB~{{Gt9+QP!Z-QC^&{r&v> z{QLX+r>CcKa&oe=vY(%yRaI5>_4Uik%gxQr$H&Ll*Vp#;_VDoV&d$!o#l__0$88qL7e~92^|9w6yf}^l52nH#ax9xVTbMQp(E84h{~pv$N^x z>EYqw_xJabl9EC~LTznrP*6}_UVmObK0XNv3E0@!O-)UKfq_p?Po}1(y}iAEe}Av9 zuQ@q61qB71oSa}_U_?YjXlQ6WJUkW_7QVi|M@L6LKR+HG9#&RXN=ix^8XB9Mn-~}v z85tRUeSO>8+veuxsi~=+o}Tmb^L%`KaBy&xl$6uc)AI82@9*#U`1tDT>VJBAdg$or ziHV8a+}y6NuI=sZ6B83HEiEZ2Dd*?s&(F`StgKU0Q_<1Ug@uK-wzh+VgAoxC5D*ZG zii*L(!B|*W<>loeAtA7^umVQ?A|fIN1_m=T zGd4Ch*4EYn0s?VyaVjb*et&*`(9qD6latic)RB>qySuwlQBi<^fNyVa;NalH!^5qu ztvx+GMMXuOot;ZdOFKI|TwGid5)vmTCvs?=0GrEs07GF%84*YgakqJ3X&Jh1S?Xs)IyM`h%RKMcD1`* z|BpV-4v#+LoYnKx?>T$FZ}0p4-tRr{_d6f{3y3)03+hu$3zCk3VOf>|sO1O<9asYD zP~NAKB#18J8^wQ=kKp@*r3eIS%>&x$A%IT*;0%JG(3u(ofqyY<*6i>IDS`>+IgwG( zF@R+*A3G0me0=;v2}pc+KEGh0G(p2BElN&d7pJDBXCx#15$mH%Z1&8orOPs82+LPw z!;zD_a+Mj6J#Jk61k`I5IrH+NTw5Sb2%TR@M^=@w?#WmS)~<)Ks95JJN!+ke<{dPf zN@+`>dn&7}e19=2HY2yP815|90*iTDtA(aM?Y2C_VVfJ=x=?rux7X~bl_F3| z9p{^bc@MCL_D5 zn$Vo~Ts3UFTUsGjDhZBOPj~P%C7^y!n>wU@jnXIxN`D#*W~S^VieRmMUoF(n@2`(J zaPW{iAmQ+l?Py%4@8~>==GjZSUO0B#Qb#*32ZGiUClk8!px`5LDwEIAzj#_tYZSv0 zpkK=z%gKB=k1xcjnwP@rvKG+y5`$9U;5@_kl%n@+0lHp38|G+vWkLh;VBmd~w>aP| zQlhISDu1kDcXVI^r8t(i669(cu(zZ$0evzu^20J zB*`qy-B&W+Y=d>vTe^X(Ijw_38P}TZ!+iId%zxg={qF&FSR;Eqn`6PW3|p&|D6V|_ z1n&ykf30i8s+T6DzcYfQGGIg5yYCsWV+$WuG`y#=#~`lo2aCk`(b3fRfupJX7>lK4 zAAFdo^X7kK5YBNb7}QxSdOmgnYRgp>1CuH#F5S+!UE?rKsYd|yeqvKF^wJoaW}wy> zdVl%SIIe5Bsr8Ex{o-)9m2&H8gkc>s7#LbTbWQ|OP$LGVVH*9^gU>$iznfM*y#Uf) zX+*aBoX{9wQ30e!BiCHy5zaS+9HtvSFZG@y!(8tYTu8es}*T<3Q(x4!st z^;agDa}WrnUq_}@r(HN4^iBDD+<&}*1AT$6XEwYu1j)B=es^reY5se-#+pag z(+@8|r;e1f*f&_%&;RhF>nCRPXOE&}rB|N7z&*54J3P?ekrjV1u8X^I+o4bWMNUi< z1dcm{zy4PIJO22yJqGMw5%!Kdr6KZt@}(kyYW9b4UC@V$!Z-2D4*U(0^X!sr6%M1+ P00000NkvXXu0mjfTW)+l delta 1401 zcmV-<1%~>-4x9^+83+ad00374`G=7qAAbM|a7bBm000id000id0mpBsWB>pKF-b&0 zRA@u(nOP`xUlhQX;a*dGL>Zn)A(=|an5jG%9;B2qJn*3Vq>G{qUr`d`MT!T7n->qR zc%X;~Dan|Wv5U-eWZM6|mUHg^`o5RHb1pai{pxnsS$kj3x_j+4>|@3_@QpDSu7BT_ z9|KIyj{$NS92}&NR7`Hb#KZ)Bq$0_H)nXs9qt8j=l&kB_GZRjbv&e_e7X{>zh$ z4`t|HI5#39f(%4A!?D1?K$;sI94yR|h_DhL0^MO}XGgeuV|8_vDHIB(Qh%vvT&vZR z9{&aZrQgX@Q&Z%AIM>qB^6OowsHg}W92|tZH~jtmVP<9qxKES&q^72lolV*|UpyCipacY~Rk8OcapT^+c%xKQ+x4ef+a zK%>#H+uK``H#av~S63Iw3x5j>j2pw6o0}O=W~7sY>=kHfY0;MgxG^!tBg@On`izWO zcxh>g$k!=9RbTMgFR#xg=1r6ibndG&#wReflsL(pdU~zGgSy))G zfq?mG_ke03OKCDLQ$`E#xujIsje=H^tG8DeE+MH{-Utqph>r7Obs z%U^Tl@KZ{dn*XN(O-)Ty>v(y2Q3;KdmzP6&dOFFSot+RK9!~Ps))qA_xF3p(iz)kJ z#>R3S_k*vmFRZMr(0^P>;2!u0yg*}ic6Mxbc9wcv>}?TVI_MJ_&kg$iH!m-baYI>6 zO${Y5UUsnI;bF#GO2#uZgxKJjD&@SvFz+@W^ZrLc>P1Vq@*Nz zaPfl=iw2;P#^A#)gl>a!z}@vY@A@hk9T~M}J4s;kc)#Cp0uPP=S|| zlS6uAVey+I$o~n9@968()6?ML;Q>`uRdm9Dpg$iR9FTF|-rl5(j*h0YAFM{Pg~a`U zrx94GCMG7*969{t0aGK(0Q6}Lr+a&Qbf2G}Pkq2wBFg~uKCD7TFU-iupd*v7M3w>L z7_8=jX>FBO@6Pp-in-(|pVczkdB<$;rvg+1Z&6gykY@1u*U-&CShpPAY;u@cQ~X z9joBcx<;cBMu76c(9jT_hH(=q0ucPoD_2PH_d`Tz;SuVtz7nqxy1D#F> zcXxMGT4vye#R?QVHGHMSV?S(cY>)xx=jZf2EUzywFJXIo8!9R)NGBCpD}bkPXn$H- z8sz~jqs3AJ!>AZC6$%BtnTd;wgM@?xG8ScH9E5%IO$_i4(zN+5K@Jf%00000NkvXX Hu0mjfa@nr} From a53d1c2503ae2555ed34fc4f5911a2a1e9ce5e66 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 5 Sep 2024 21:55:02 +0200 Subject: [PATCH 113/451] Update version --- apps/dutchclock/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 5ee68b7097..7fa9e9148c 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.11", + "version":"0.12", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 17b82f9ae1c6f9acd453ec9fb08c549ffddc7ae0 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 5 Sep 2024 22:00:59 +0200 Subject: [PATCH 114/451] Add changelog --- apps/dutchclock/ChangeLog | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/dutchclock/ChangeLog diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog new file mode 100644 index 0000000000..b8e2bfeb95 --- /dev/null +++ b/apps/dutchclock/ChangeLog @@ -0,0 +1 @@ +0.12: First release \ No newline at end of file From 078e11173c9eaaeb083f49e14b7946f41f3b801c Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:42:39 -0500 Subject: [PATCH 115/451] Update to V0.08 --- apps/boxclk/ChangeLog | 7 + apps/boxclk/app.js | 557 ++++++++++++++++++++------------------ apps/boxclk/metadata.json | 4 +- 3 files changed, 307 insertions(+), 261 deletions(-) diff --git a/apps/boxclk/ChangeLog b/apps/boxclk/ChangeLog index f7ee419046..62d1b48758 100644 --- a/apps/boxclk/ChangeLog +++ b/apps/boxclk/ChangeLog @@ -5,3 +5,10 @@ 0.05: Fixes step count not resetting after a new day starts 0.06: Added clockbackground app functionality 0.07: Allow custom backgrounds per boxclk config and from the clockbg module +0.08: Improves performance, responsiveness, and bug fixes +- [+] Added box size caching to reduce calculations +- [+] Improved step count with real-time updates +- [+] Improved battery level update logic to reduce unnecessary refreshes +- [+] Fixed optional seconds not displaying in time +- [+] Fixed drag handler by adding E.stopEventPropagation() +- [+] General code optimization and cleanup \ No newline at end of file diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 67493aad95..139ad31a1f 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -1,59 +1,115 @@ { - /** - * --------------------------------------------------------------- - * 1. Module dependencies and initial configurations - * --------------------------------------------------------------- - */ - + // 1. Module dependencies and initial configurations let background = require("clockbg"); let storage = require("Storage"); let locale = require("locale"); let widgets = require("widget_utils"); - let date = new Date(); let bgImage; let configNumber = (storage.readJSON("boxclk.json", 1) || {}).selectedConfig || 0; let fileName = 'boxclk' + (configNumber > 0 ? `-${configNumber}` : '') + '.json'; - // Add a condition to check if the file exists, if it does not, default to 'boxclk.json' if (!storage.read(fileName)) { fileName = 'boxclk.json'; } let boxesConfig = storage.readJSON(fileName, 1) || {}; let boxes = {}; - let boxPos = {}; - let isDragging = {}; - let wasDragging = {}; + let isDragging = false; let doubleTapTimer = null; let g_setColor; let saveIcon = require("heatshrink").decompress(atob("mEwwkEogA/AHdP/4AK+gWVDBQWNAAIuVGBAIB+UQdhMfGBAHBCxUAgIXHIwPyCxQwEJAgXB+MAl/zBwQGBn8ggQjBGAQXG+EA/4XI/8gBIQXTGAMPC6n/C6HzkREBC6YACC6QAFC57aHCYIXOOgLsEn4XPABIX/C6vykQAEl6/WgCQBC5imFAAT2BC5gCBI4oUCC5x0IC/4X/C4K8Bl4XJ+TCCC4wKBABkvC4tEEoMQCxcBB4IWEC4XyDBUBFwIXGJAIAOIwowDABoWGGB4uHDBwWJAH4AzA")); - /** - * --------------------------------------------------------------- - * 2. Graphical and visual configurations - * --------------------------------------------------------------- - */ - + // 2. Graphical and visual configurations let w = g.getWidth(); let h = g.getHeight(); - let totalWidth, totalHeight; let drawTimeout; - /** - * --------------------------------------------------------------- - * 3. Touchscreen Handlers - * --------------------------------------------------------------- - */ - - let touchHandler; - let dragHandler; - let movementDistance = 0; - - /** - * --------------------------------------------------------------- - * 4. Font loading function - * --------------------------------------------------------------- - */ + // 3. Touch and drag handlers + let touchHandler = function(zone, e) { + let boxTouched = false; + let touchedBox = null; + + boxKeys.forEach((boxKey) => { + if (touchInText(e, boxes[boxKey], boxKey)) { + touchedBox = boxKey; + boxTouched = true; + } + }); + + if (boxTouched) { + // Toggle the selected state of the touched box + boxes[touchedBox].selected = !boxes[touchedBox].selected; + + // Update isDragging based on whether any box is selected + isDragging = boxKeys.some(key => boxes[key].selected); + + if (isDragging) { + widgets.hide(); + // Stop propagation of the touch event to prevent other handlers + E.stopEventPropagation(); + } else { + widgets.show(); + widgets.swipeOn(); + // Call updateBoxData when transitioning from dragging to not dragging + updateBoxData(); + } + } else { + // If tapped outside any box, deselect all boxes + deselectAllBoxes(); + } + + // Always redraw after a touch event + draw(); + + // Handle double tap for saving + if (!boxTouched && !isDragging) { + if (doubleTapTimer) { + clearTimeout(doubleTapTimer); + doubleTapTimer = null; + Object.keys(boxes).forEach((boxKey) => { + boxesConfig[boxKey].boxPos.x = (boxes[boxKey].pos.x / w).toFixed(3); + boxesConfig[boxKey].boxPos.y = (boxes[boxKey].pos.y / h).toFixed(3); + }); + storage.write(fileName, JSON.stringify(boxesConfig)); + displaySaveIcon(); + return; + } + + doubleTapTimer = setTimeout(() => { + doubleTapTimer = null; + }, 500); + } + }; + + let dragHandler = function(e) { + // Check if any box is being dragged + if (!isDragging) return; + + // Stop propagation of the drag event to prevent other handlers + E.stopEventPropagation(); + + boxKeys.forEach(key => { + if (boxes[key].selected) { + let boxItem = boxes[key]; + if (!boxItem.cachedSize) { + calcBoxSize(boxItem); + } + let newX = boxItem.pos.x + e.dx; + let newY = boxItem.pos.y + e.dy; + + if (newX - boxItem.cachedSize.width / 2 >= 0 && + newX + boxItem.cachedSize.width / 2 <= w && + newY - boxItem.cachedSize.height / 2 >= 0 && + newY + boxItem.cachedSize.height / 2 <= h) { + boxItem.pos.x = newX; + boxItem.pos.y = newY; + } + } + }); + + draw(); + }; + // 4. Font loading function let loadCustomFont = function() { Graphics.prototype.setFontBrunoAce = function() { // Actual height 23 (24 - 2) @@ -61,50 +117,45 @@ E.toString(require('heatshrink').decompress(atob('ABMHwADBh4DKg4bKgIPDAYUfAYV/AYX/AQMD/gmC+ADBn/AByE/GIU8AYUwLxcfAYX/8AnB//4JIP/FgMP4F+CQQBBjwJBFYRbBAd43DHoJpBh/g/xPEK4ZfDgEEORKDDAY8////wADLfZrTCgITBnhEBAYJMBAYMPw4DCM4QDjhwDCjwDBn0+AYMf/gDBh/4AYMH+ADBLpc4ToK/NGYZfnAYcfL4U/x5fBW4LvB/7vC+LvBgHAsBfIn76Cn4WBcYQDFEgJ+CQQYDyH4L/BAZbHLNYjjCAZc8ngDunycBZ4KkBa4KwBnEHY4UB+BfMgf/ZgMH/4XBc4cf4F/gE+ZgRjwAYcfj5jBM4U4M4RQBM4UA8BjIngDFEYJ8BAYUDAYQvCM4ZxBC4V+AYQvBnkBQ4M8gabBJQPAI4WAAYM/GYQaBAYJKCnqyCn5OCn4aBAYIaBAYJPCU4IABnBhIuDXCFAMD+Z/BY4IDBQwOPwEfv6TDAYUPAcwrDAYQ7BAYY/BI4cD8bLCK4RfEAA0BRYTeDcwIrFn0Pw43Bg4DugYDBjxBBU4SvDMYMH/5QBgP/LAQAP8EHN4UPwADHB4YAHA'))), 46, atob("CBEdChgYGhgaGBsaCQ=="), - 32|65536 + 32 | 65536 ); }; }; - /** - * --------------------------------------------------------------- - * 5. Initial settings of boxes and their positions - * --------------------------------------------------------------- - */ + // 5. Initial settings of boxes and their positions + let isBool = (val, defaultVal) => val !== undefined ? Boolean(val) : defaultVal; for (let key in boxesConfig) { if (key === 'bg' && boxesConfig[key].img) { bgImage = storage.read(boxesConfig[key].img); } else if (key !== 'selectedConfig') { boxes[key] = Object.assign({}, boxesConfig[key]); + // Set default values for short, shortMonth, and disableSuffix + boxes[key].short = isBool(boxes[key].short, true); + boxes[key].shortMonth = isBool(boxes[key].shortMonth, true); + boxes[key].disableSuffix = isBool(boxes[key].disableSuffix, false); + + // Set box position + boxes[key].pos = { + x: w * boxes[key].boxPos.x, + y: h * boxes[key].boxPos.y + }; + // Cache box size + boxes[key].cachedSize = null; } } let boxKeys = Object.keys(boxes); - boxKeys.forEach((key) => { - let boxConfig = boxes[key]; - boxPos[key] = { - x: w * boxConfig.boxPos.x, - y: h * boxConfig.boxPos.y - }; - isDragging[key] = false; - wasDragging[key] = false; - }); + // 6. Text and drawing functions - /** - * --------------------------------------------------------------- - * 6. Text and drawing functions - * --------------------------------------------------------------- + /* + Overwrite the setColor function to allow the + use of (x) in g.theme.x as a string + in your JSON config ("fg", "bg", "fg2", "bg2", "fgH", "bgH") */ - - // Overwrite the setColor function to allow the - // use of (x) in g.theme.x as a string - // in your JSON config ("fg", "bg", "fg2", "bg2", "fgH", "bgH") let modSetColor = function() { - // Save the original setColor function g_setColor = g.setColor; - // Overwrite setColor with the new function g.setColor = function(color) { if (typeof color === "string" && color in g.theme) { g_setColor.call(g, g.theme[color]); @@ -115,7 +166,6 @@ }; let restoreSetColor = function() { - // Restore the original setColor function if (g_setColor) { g.setColor = g_setColor; } @@ -139,25 +189,6 @@ } }; - let calcBoxSize = function(boxItem) { - g.reset(); - g.setFontAlign(0,0); - g.setFont(boxItem.font, boxItem.fontSize); - let strWidth = g.stringWidth(boxItem.string) + 2 * boxItem.outline; - let fontHeight = g.getFontHeight() + 2 * boxItem.outline; - totalWidth = strWidth + 2 * boxItem.xPadding; - totalHeight = fontHeight + 2 * boxItem.yPadding; - }; - - let calcBoxPos = function(boxKey) { - return { - x1: boxPos[boxKey].x - totalWidth / 2, - y1: boxPos[boxKey].y - totalHeight / 2, - x2: boxPos[boxKey].x + totalWidth / 2, - y2: boxPos[boxKey].y + totalHeight / 2 - }; - }; - let displaySaveIcon = function() { draw(boxes); g.drawImage(saveIcon, w / 2 - 24, h / 2 - 24); @@ -168,33 +199,15 @@ }, 2000); }; - /** - * --------------------------------------------------------------- - * 7. String forming helper functions - * --------------------------------------------------------------- - */ - - let isBool = function(val, defaultVal) { - return typeof val !== 'undefined' ? Boolean(val) : defaultVal; - }; - + // 7. String forming helper functions let getDate = function(short, shortMonth, disableSuffix) { const date = new Date(); const dayOfMonth = date.getDate(); const month = shortMonth ? locale.month(date, 1) : locale.month(date, 0); const year = date.getFullYear(); - let suffix; - if ([1, 21, 31].includes(dayOfMonth)) { - suffix = "st"; - } else if ([2, 22].includes(dayOfMonth)) { - suffix = "nd"; - } else if ([3, 23].includes(dayOfMonth)) { - suffix = "rd"; - } else { - suffix = "th"; - } - let dayOfMonthStr = disableSuffix ? dayOfMonth : dayOfMonth + suffix; - return month + " " + dayOfMonthStr + (short ? '' : (", " + year)); // not including year for short version + let suffix = ["st", "nd", "rd"][(dayOfMonth - 1) % 10] || "th"; + let dayOfMonthStr = disableSuffix ? dayOfMonth : `${dayOfMonth}${suffix}`; + return `${month} ${dayOfMonthStr}${short ? '' : `, ${year}`}`; }; let getDayOfWeek = function(date, short) { @@ -207,98 +220,179 @@ return short ? meridian[0] : meridian; }; - let modString = function(boxItem, data) { - let prefix = boxItem.prefix || ''; - let suffix = boxItem.suffix || ''; - return prefix + data + suffix; + let formatStr = function(boxItem, data) { + return `${boxItem.prefix || ''}${data}${boxItem.suffix || ''}`; }; - /** - * --------------------------------------------------------------- - * 8. Main draw function - * --------------------------------------------------------------- - */ - - let draw = (function() { - let updatePerMinute = true; + // 8. Main draw function and update logic + let lastDay = -1; + const BATTERY_UPDATE_INTERVAL = 300000; - return function(boxes) { - date = new Date(); - g.clear(); + let updateBoxData = function() { + let date = new Date(); + let currentDay = date.getDate(); + let now = Date.now(); - // Always draw backgrounds full screen - - if (bgImage) { // Check for bg in boxclk config - g.drawImage(bgImage, 0, 0); - } else { // Otherwise use clockbg module - background.fillRect(0, 0, g.getWidth(), g.getHeight()); - } - + if (boxes.time || boxes.meridian || boxes.date || boxes.dow) { if (boxes.time) { - boxes.time.string = modString(boxes.time, locale.time(date, isBool(boxes.time.short, true) ? 1 : 0).trim()); - updatePerMinute = isBool(boxes.time.short, true); + let showSeconds = !boxes.time.short; + let timeString = locale.time(date, 1).trim(); + if (showSeconds) { + let seconds = date.getSeconds().toString().padStart(2, '0'); + timeString += ':' + seconds; + } + let newTimeString = formatStr(boxes.time, timeString); + if (newTimeString !== boxes.time.string) { + boxes.time.string = newTimeString; + boxes.time.cachedSize = null; + } } + if (boxes.meridian) { - boxes.meridian.string = modString(boxes.meridian, locale.meridian(date, isBool(boxes.meridian.short, true))); + let newMeridianString = formatStr(boxes.meridian, locale.meridian(date, boxes.meridian.short)); + if (newMeridianString !== boxes.meridian.string) { + boxes.meridian.string = newMeridianString; + boxes.meridian.cachedSize = null; + } } - if (boxes.date) { - boxes.date.string = ( - modString(boxes.date, - getDate(isBool(boxes.date.short, true), - isBool(boxes.date.shortMonth, true), - isBool(boxes.date.disableSuffix, false) - ))); + + if (boxes.date && currentDay !== lastDay) { + let newDateString = formatStr(boxes.date, + getDate(boxes.date.short, + boxes.date.shortMonth, + boxes.date.noSuffix) + ); + if (newDateString !== boxes.date.string) { + boxes.date.string = newDateString; + boxes.date.cachedSize = null; + } } + if (boxes.dow) { - boxes.dow.string = modString(boxes.dow, getDayOfWeek(date, isBool(boxes.dow.short, true))); + let newDowString = formatStr(boxes.dow, getDayOfWeek(date, boxes.dow.short)); + if (newDowString !== boxes.dow.string) { + boxes.dow.string = newDowString; + boxes.dow.cachedSize = null; + } } - if (boxes.batt) { - boxes.batt.string = modString(boxes.batt, E.getBattery()); + + lastDay = currentDay; + } + + if (boxes.step) { + let newStepCount = Bangle.getHealthStatus("day").steps; + let newStepString = formatStr(boxes.step, newStepCount); + if (newStepString !== boxes.step.string) { + boxes.step.string = newStepString; + boxes.step.cachedSize = null; } - if (boxes.step) { - boxes.step.string = modString(boxes.step, Bangle.getHealthStatus("day").steps); + } + + if (boxes.batt) { + if (!boxes.batt.lastUpdate || now - boxes.batt.lastUpdate >= BATTERY_UPDATE_INTERVAL) { + let currentLevel = E.getBattery(); + if (currentLevel !== boxes.batt.lastLevel) { + let newBattString = formatStr(boxes.batt, currentLevel); + if (newBattString !== boxes.batt.string) { + boxes.batt.string = newBattString; + boxes.batt.cachedSize = null; + boxes.batt.lastLevel = currentLevel; + } + } + boxes.batt.lastUpdate = now; } - boxKeys.forEach((boxKey) => { - let boxItem = boxes[boxKey]; + } + }; + + let draw = function() { + g.clear(); + + // Always draw backgrounds full screen + if (bgImage) { // Check for bg in boxclk config + g.drawImage(bgImage, 0, 0); + } else { // Otherwise use clockbg module + background.fillRect(0, 0, g.getWidth(), g.getHeight()); + } + + if (!isDragging) { + updateBoxData(); + } + + boxKeys.forEach((boxKey) => { + let boxItem = boxes[boxKey]; + + // Set font and alignment for each box individually + g.setFont(boxItem.font, boxItem.fontSize); + g.setFontAlign(0, 0); + + // Use cached size if available, otherwise calculate and cache + if (!boxItem.cachedSize) { calcBoxSize(boxItem); - const pos = calcBoxPos(boxKey); - if (isDragging[boxKey]) { - g.setColor(boxItem.border); - g.drawRect(pos.x1, pos.y1, pos.x2, pos.y2); - } - g.drawString( - boxItem, - boxItem.string, - boxPos[boxKey].x + boxItem.xOffset, - boxPos[boxKey].y + boxItem.yOffset - ); - }); - if (!Object.values(isDragging).some(Boolean)) { - if (drawTimeout) clearTimeout(drawTimeout); - let interval = updatePerMinute ? 60000 - (Date.now() % 60000) : 1000; - drawTimeout = setTimeout(() => draw(boxes), interval); } - }; - })(); - /** - * --------------------------------------------------------------- - * 9. Helper function for touch event - * --------------------------------------------------------------- - */ + const pos = { + x1: boxItem.pos.x - boxItem.cachedSize.width / 2, + y1: boxItem.pos.y - boxItem.cachedSize.height / 2, + x2: boxItem.pos.x + boxItem.cachedSize.width / 2, + y2: boxItem.pos.y + boxItem.cachedSize.height / 2 + }; + + if (boxItem.selected) { + g.setColor(boxItem.border); + g.drawRect(pos.x1, pos.y1, pos.x2, pos.y2); + } + + g.drawString( + boxItem, + boxItem.string, + boxItem.pos.x + boxItem.xOffset, + boxItem.pos.y + boxItem.yOffset + ); + }); + + if (!isDragging) { + if (drawTimeout) clearTimeout(drawTimeout); + let updateInterval = boxes.time && !isBool(boxes.time.short, true) ? 1000 : 60000 - (Date.now() % 60000); + drawTimeout = setTimeout(draw, updateInterval); + } + }; + + // 9. Helper function for touch event + let calcBoxSize = function(boxItem) { + g.setFont(boxItem.font, boxItem.fontSize); + g.setFontAlign(0, 0); + + let strWidth = g.stringWidth(boxItem.string) + 2 * boxItem.outline; + let fontHeight = g.getFontHeight() + 2 * boxItem.outline; + let totalWidth = strWidth + 2 * boxItem.xPadding; + let totalHeight = fontHeight + 2 * boxItem.yPadding; + + boxItem.cachedSize = { + width: totalWidth, + height: totalHeight + }; + }; let touchInText = function(e, boxItem, boxKey) { - calcBoxSize(boxItem); - const pos = calcBoxPos(boxKey); + if (!boxItem.cachedSize) { + calcBoxSize(boxItem); + } + const pos = { + x1: boxItem.pos.x - boxItem.cachedSize.width / 2, + y1: boxItem.pos.y - boxItem.cachedSize.height / 2, + x2: boxItem.pos.x + boxItem.cachedSize.width / 2, + y2: boxItem.pos.y + boxItem.cachedSize.height / 2 + }; return e.x >= pos.x1 && - e.x <= pos.x2 && - e.y >= pos.y1 && - e.y <= pos.y2; + e.x <= pos.x2 && + e.y >= pos.y1 && + e.y <= pos.y2; }; let deselectAllBoxes = function() { - Object.keys(isDragging).forEach((boxKey) => { - isDragging[boxKey] = false; + isDragging = false; + boxKeys.forEach((boxKey) => { + boxes[boxKey].selected = false; }); restoreSetColor(); widgets.show(); @@ -306,96 +400,37 @@ modSetColor(); }; - /** - * --------------------------------------------------------------- - * 10. Setup function to configure event handlers - * --------------------------------------------------------------- - */ - + // 10. Setup function to configure event handlers let setup = function() { - // ------------------------------------ - // Define the touchHandler function - // ------------------------------------ - touchHandler = function(zone, e) { - wasDragging = Object.assign({}, isDragging); - let boxTouched = false; - boxKeys.forEach((boxKey) => { - if (touchInText(e, boxes[boxKey], boxKey)) { - isDragging[boxKey] = true; - wasDragging[boxKey] = true; - boxTouched = true; - } - }); - if (!boxTouched) { - if (!Object.values(isDragging).some(Boolean)) { // check if no boxes are being dragged - deselectAllBoxes(); - if (doubleTapTimer) { - clearTimeout(doubleTapTimer); - doubleTapTimer = null; - // Save boxesConfig on double tap outside of any box and when no boxes are being dragged - Object.keys(boxPos).forEach((boxKey) => { - boxesConfig[boxKey].boxPos.x = (boxPos[boxKey].x / w).toFixed(3); - boxesConfig[boxKey].boxPos.y = (boxPos[boxKey].y / h).toFixed(3); - }); - storage.write(fileName, JSON.stringify(boxesConfig)); - displaySaveIcon(); - return; - } - } else { - // if any box is being dragged, just deselect all without saving - deselectAllBoxes(); - } - } - if (Object.values(wasDragging).some(Boolean) || !boxTouched) { - draw(boxes); - } - doubleTapTimer = setTimeout(() => { - doubleTapTimer = null; - }, 500); // Increase or decrease this value based on the desired double tap timing - movementDistance = 0; - }; - - // ------------------------------------ - // Define the dragHandler function - // ------------------------------------ - dragHandler = function(e) { - // Check if any box is being dragged - if (!Object.values(isDragging).some(Boolean)) return; - // Calculate the movement distance - movementDistance += Math.abs(e.dx) + Math.abs(e.dy); - // Check if the movement distance exceeds a threshold - if (movementDistance > 1) { - boxKeys.forEach((boxKey) => { - if (isDragging[boxKey]) { - widgets.hide(); - let boxItem = boxes[boxKey]; - calcBoxSize(boxItem); - let newX = boxPos[boxKey].x + e.dx; - let newY = boxPos[boxKey].y + e.dy; - if (newX - totalWidth / 2 >= 0 && - newX + totalWidth / 2 <= w && - newY - totalHeight / 2 >= 0 && - newY + totalHeight / 2 <= h ) { - boxPos[boxKey].x = newX; - boxPos[boxKey].y = newY; - } - const pos = calcBoxPos(boxKey); - g.clearRect(pos.x1, pos.y1, pos.x2, pos.y2); - } - }); - draw(boxes); + Bangle.on('lock', function(isLocked) { + if (isLocked) { + // Screen is about to lock, deselect all boxes + deselectAllBoxes(); + // Redraw to reflect changes + draw(); } - }; + }); Bangle.on('touch', touchHandler); Bangle.on('drag', dragHandler); + if (boxes.step) { + boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); + } + if (boxes.batt) { + boxes.batt.lastLevel = E.getBattery(); + boxes.batt.string = formatStr(boxes.batt, boxes.batt.lastLevel); + boxes.batt.lastUpdate = Date.now(); + } + Bangle.setUI({ - mode : "clock", - remove : function() { - // Remove event handlers, stop draw timer, remove custom font if used + mode: "clock", + remove: function() { + // Remove event handlers, stop draw timer, remove custom font Bangle.removeListener('touch', touchHandler); Bangle.removeListener('drag', dragHandler); + Bangle.removeListener('step'); + Bangle.removeAllListeners('lock'); if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; delete Graphics.prototype.setFontBrunoAce; @@ -406,17 +441,21 @@ } }); loadCustomFont(); - draw(boxes); + draw(); }; - /** - * --------------------------------------------------------------- - * 11. Main execution part - * --------------------------------------------------------------- - */ - + // 11. Main execution Bangle.loadWidgets(); widgets.swipeOn(); modSetColor(); setup(); -} + + // Event listener for real-time step updates + Bangle.on('step', function(up) { + if (boxes.step && !isDragging) { + boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); + boxes.step.cachedSize = null; + draw(); + } + }); +} \ No newline at end of file diff --git a/apps/boxclk/metadata.json b/apps/boxclk/metadata.json index b4055f1607..27e43c3be5 100644 --- a/apps/boxclk/metadata.json +++ b/apps/boxclk/metadata.json @@ -1,7 +1,7 @@ { "id": "boxclk", "name": "Box Clock", - "version": "0.07", + "version": "0.08", "description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background", "icon": "app.png", "dependencies" : { "clockbg":"module" }, @@ -24,4 +24,4 @@ "data": [ {"name":"boxclk.json","url":"boxclk.json"} ] -} +} \ No newline at end of file From 16a5650c410616c8aef77896ab9360de29eca535 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:13:44 -0500 Subject: [PATCH 116/451] Remove redundant code --- apps/boxclk/app.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 139ad31a1f..1bb8bd9dcb 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -44,13 +44,8 @@ if (isDragging) { widgets.hide(); - // Stop propagation of the touch event to prevent other handlers - E.stopEventPropagation(); } else { - widgets.show(); - widgets.swipeOn(); - // Call updateBoxData when transitioning from dragging to not dragging - updateBoxData(); + deselectAllBoxes(); } } else { // If tapped outside any box, deselect all boxes From 48e02ba13fef2d43adaa253ec2df69d8cf5c85fd Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Fri, 6 Sep 2024 01:22:58 -0500 Subject: [PATCH 117/451] Move check for cachedSize into calcBoxSize --- apps/boxclk/app.js | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 1bb8bd9dcb..8f0449a23d 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -85,9 +85,7 @@ boxKeys.forEach(key => { if (boxes[key].selected) { let boxItem = boxes[key]; - if (!boxItem.cachedSize) { - calcBoxSize(boxItem); - } + calcBoxSize(boxItem); let newX = boxItem.pos.x + e.dx; let newY = boxItem.pos.y + e.dy; @@ -320,17 +318,9 @@ g.setFont(boxItem.font, boxItem.fontSize); g.setFontAlign(0, 0); - // Use cached size if available, otherwise calculate and cache - if (!boxItem.cachedSize) { - calcBoxSize(boxItem); - } + calcBoxSize(boxItem); - const pos = { - x1: boxItem.pos.x - boxItem.cachedSize.width / 2, - y1: boxItem.pos.y - boxItem.cachedSize.height / 2, - x2: boxItem.pos.x + boxItem.cachedSize.width / 2, - y2: boxItem.pos.y + boxItem.cachedSize.height / 2 - }; + const pos = calcBoxPos(boxItem); if (boxItem.selected) { g.setColor(boxItem.border); @@ -353,31 +343,41 @@ }; // 9. Helper function for touch event + let calcBoxPos = function(boxItem) { + calcBoxSize(boxItem); + return { + x1: boxItem.pos.x - boxItem.cachedSize.width / 2, + y1: boxItem.pos.y - boxItem.cachedSize.height / 2, + x2: boxItem.pos.x + boxItem.cachedSize.width / 2, + y2: boxItem.pos.y + boxItem.cachedSize.height / 2 + }; + }; + + // Use cached size if available, otherwise calculate and cache let calcBoxSize = function(boxItem) { + if (boxItem.cachedSize) { + return boxItem.cachedSize; + } + g.setFont(boxItem.font, boxItem.fontSize); g.setFontAlign(0, 0); - + let strWidth = g.stringWidth(boxItem.string) + 2 * boxItem.outline; let fontHeight = g.getFontHeight() + 2 * boxItem.outline; let totalWidth = strWidth + 2 * boxItem.xPadding; let totalHeight = fontHeight + 2 * boxItem.yPadding; - + boxItem.cachedSize = { width: totalWidth, height: totalHeight }; + + return boxItem.cachedSize; }; let touchInText = function(e, boxItem, boxKey) { - if (!boxItem.cachedSize) { - calcBoxSize(boxItem); - } - const pos = { - x1: boxItem.pos.x - boxItem.cachedSize.width / 2, - y1: boxItem.pos.y - boxItem.cachedSize.height / 2, - x2: boxItem.pos.x + boxItem.cachedSize.width / 2, - y2: boxItem.pos.y + boxItem.cachedSize.height / 2 - }; + calcBoxSize(boxItem); + const pos = calcBoxPos(boxItem); return e.x >= pos.x1 && e.x <= pos.x2 && e.y >= pos.y1 && From 5f6fd9247df079b9678607f79e13f8ec8858ce50 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:21:00 -0500 Subject: [PATCH 118/451] Simplified code by removing boxKeys array --- apps/boxclk/app.js | 85 +++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 8f0449a23d..faaf4b7d23 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -28,19 +28,20 @@ let boxTouched = false; let touchedBox = null; - boxKeys.forEach((boxKey) => { - if (touchInText(e, boxes[boxKey], boxKey)) { + for (let boxKey in boxes) { + if (touchInText(e, boxes[boxKey])) { touchedBox = boxKey; boxTouched = true; + break; } - }); + } if (boxTouched) { // Toggle the selected state of the touched box boxes[touchedBox].selected = !boxes[touchedBox].selected; // Update isDragging based on whether any box is selected - isDragging = boxKeys.some(key => boxes[key].selected); + isDragging = Object.values(boxes).some(box => box.selected); if (isDragging) { widgets.hide(); @@ -60,10 +61,10 @@ if (doubleTapTimer) { clearTimeout(doubleTapTimer); doubleTapTimer = null; - Object.keys(boxes).forEach((boxKey) => { + for (let boxKey in boxes) { boxesConfig[boxKey].boxPos.x = (boxes[boxKey].pos.x / w).toFixed(3); boxesConfig[boxKey].boxPos.y = (boxes[boxKey].pos.y / h).toFixed(3); - }); + } storage.write(fileName, JSON.stringify(boxesConfig)); displaySaveIcon(); return; @@ -76,30 +77,30 @@ }; let dragHandler = function(e) { - // Check if any box is being dragged - if (!isDragging) return; - - // Stop propagation of the drag event to prevent other handlers - E.stopEventPropagation(); + // Check if any box is being dragged + if (!isDragging) return; - boxKeys.forEach(key => { - if (boxes[key].selected) { - let boxItem = boxes[key]; - calcBoxSize(boxItem); - let newX = boxItem.pos.x + e.dx; - let newY = boxItem.pos.y + e.dy; + // Stop propagation of the drag event to prevent other handlers + E.stopEventPropagation(); - if (newX - boxItem.cachedSize.width / 2 >= 0 && - newX + boxItem.cachedSize.width / 2 <= w && - newY - boxItem.cachedSize.height / 2 >= 0 && - newY + boxItem.cachedSize.height / 2 <= h) { - boxItem.pos.x = newX; - boxItem.pos.y = newY; - } - } - }); + for (let key in boxes) { + if (boxes[key].selected) { + let boxItem = boxes[key]; + calcBoxSize(boxItem); + let newX = boxItem.pos.x + e.dx; + let newY = boxItem.pos.y + e.dy; - draw(); + if (newX - boxItem.cachedSize.width / 2 >= 0 && + newX + boxItem.cachedSize.width / 2 <= w && + newY - boxItem.cachedSize.height / 2 >= 0 && + newY + boxItem.cachedSize.height / 2 <= h) { + boxItem.pos.x = newX; + boxItem.pos.y = newY; + } + } + } + + draw(); }; // 4. Font loading function @@ -299,42 +300,42 @@ let draw = function() { g.clear(); - + // Always draw backgrounds full screen if (bgImage) { // Check for bg in boxclk config g.drawImage(bgImage, 0, 0); } else { // Otherwise use clockbg module background.fillRect(0, 0, g.getWidth(), g.getHeight()); } - + if (!isDragging) { updateBoxData(); } - - boxKeys.forEach((boxKey) => { + + for (let boxKey in boxes) { let boxItem = boxes[boxKey]; - + // Set font and alignment for each box individually g.setFont(boxItem.font, boxItem.fontSize); g.setFontAlign(0, 0); - + calcBoxSize(boxItem); - + const pos = calcBoxPos(boxItem); - + if (boxItem.selected) { g.setColor(boxItem.border); g.drawRect(pos.x1, pos.y1, pos.x2, pos.y2); } - + g.drawString( boxItem, boxItem.string, boxItem.pos.x + boxItem.xOffset, boxItem.pos.y + boxItem.yOffset ); - }); - + } + if (!isDragging) { if (drawTimeout) clearTimeout(drawTimeout); let updateInterval = boxes.time && !isBool(boxes.time.short, true) ? 1000 : 60000 - (Date.now() % 60000); @@ -375,7 +376,7 @@ return boxItem.cachedSize; }; - let touchInText = function(e, boxItem, boxKey) { + let touchInText = function(e, boxItem) { calcBoxSize(boxItem); const pos = calcBoxPos(boxItem); return e.x >= pos.x1 && @@ -386,9 +387,9 @@ let deselectAllBoxes = function() { isDragging = false; - boxKeys.forEach((boxKey) => { + for (let boxKey in boxes) { boxes[boxKey].selected = false; - }); + } restoreSetColor(); widgets.show(); widgets.swipeOn(); @@ -453,4 +454,4 @@ draw(); } }); -} \ No newline at end of file +} From 69d12f31148d0a34ef367d0f69a39b1b1c8f34a7 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:32:21 -0500 Subject: [PATCH 119/451] Remove boxKeys declaration --- apps/boxclk/app.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index faaf4b7d23..ce54da25d0 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -139,8 +139,6 @@ } } - let boxKeys = Object.keys(boxes); - // 6. Text and drawing functions /* From bbc9d63d513cfb43bbe4ca31d63b5b1004be5b60 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 6 Sep 2024 21:43:14 +0200 Subject: [PATCH 120/451] Fix widgets reappearing --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 17 ++++++++++------- apps/dutchclock/metadata.json | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index b8e2bfeb95..ebb8e9a25f 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -1 +1,2 @@ -0.12: First release \ No newline at end of file +0.12: First release +0.13: Fix widgets reappearing \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 9523a360c2..921f734011 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -1,5 +1,6 @@ const storage = require("Storage"); const locale = require('locale'); +const widget_utils = require('widget_utils'); const SCREEN_WIDTH = g.getWidth(); const SCREEN_HEIGHT = g.getHeight(); @@ -46,14 +47,12 @@ const Y = SCREEN_HEIGHT / 2 let date, mins; function initialize() { + // Load widgets + Bangle.loadWidgets(); + // draw immediately at first tick(); -// for (let mm = 0; mm < 60; mm++) { -// console.log(23, mm); -// console.log(getTimeLines(23 * 60 + mm)); -// } - // now check every second let secondInterval = setInterval(tick, 1000); // Stop updates when LCD is off, restart when on @@ -76,6 +75,10 @@ function tick() { mins = m; draw(); } + + if (!settings.showWidgets) { + widget_utils.hide(); + } } function draw() { @@ -106,9 +109,9 @@ function draw() { Bangle.setUI("clock"); if (settings.showWidgets) { - // Load widgets - Bangle.loadWidgets(); Bangle.drawWidgets(); + } else { + widget_utils.hide(); } } diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 7fa9e9148c..cec4842191 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.12", + "version":"0.13", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 85650f6d4b6290147db3eedeb4c3a5410ba1e320 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 6 Sep 2024 22:33:54 +0200 Subject: [PATCH 121/451] Fix midnight --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 2 +- apps/dutchclock/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index ebb8e9a25f..0f81644ea0 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -1,2 +1,3 @@ 0.12: First release -0.13: Fix widgets reappearing \ No newline at end of file +0.13: Fix widgets reappearing +0.14: Fix midnight \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 921f734011..0947b374ad 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -214,7 +214,7 @@ function getRoundMinutes(m) { const nearest = roundTo(5)(m); return { - minutes: nearest, + minutes: nearest % 60, offset: m - nearest }; } diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index cec4842191..4155e13b38 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.13", + "version":"0.14", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 610e1808f53674c4eed6421e94db876b0b0cf54f Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 6 Sep 2024 22:45:18 +0200 Subject: [PATCH 122/451] Fix midnight better --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 5 +++-- apps/dutchclock/metadata.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index 0f81644ea0..b55f0bbf12 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -1,3 +1,4 @@ 0.12: First release 0.13: Fix widgets reappearing -0.14: Fix midnight \ No newline at end of file +0.14: Fix midnight +0.15: Fix midnight better \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 0947b374ad..0e647412ca 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -15,6 +15,7 @@ const BOTTOM_SPACING = 5; const TEXT_WIDTH = SCREEN_WIDTH - 2; const MINS_IN_HOUR = 60; +const MINS_IN_DAY = 24 * MINS_IN_HOUR; const VARIANT_EXACT = 'exact'; const VARIANT_APPROXIMATE = 'approximate'; @@ -69,7 +70,7 @@ function initialize() { function tick() { date = new Date(); - const m = date.getHours() * MINS_IN_HOUR + date.getMinutes(); + const m = (date.getHours() * MINS_IN_HOUR + date.getMinutes()) % MINS_IN_DAY; if (m !== mins) { mins = m; @@ -214,7 +215,7 @@ function getRoundMinutes(m) { const nearest = roundTo(5)(m); return { - minutes: nearest % 60, + minutes: nearest, offset: m - nearest }; } diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 4155e13b38..2a711bdd4d 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.14", + "version":"0.15", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 072db5c9b9be6ecd7438dec30a4383cceaf32ab8 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 6 Sep 2024 22:53:14 +0200 Subject: [PATCH 123/451] Fix midnight decisively --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 2 +- apps/dutchclock/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index b55f0bbf12..6519f3b749 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -1,4 +1,5 @@ 0.12: First release 0.13: Fix widgets reappearing 0.14: Fix midnight -0.15: Fix midnight better \ No newline at end of file +0.15: Fix midnight better +0.16: Fix midnight decisively \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 0e647412ca..240dca514b 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -215,7 +215,7 @@ function getRoundMinutes(m) { const nearest = roundTo(5)(m); return { - minutes: nearest, + minutes: nearest % MINS_IN_DAY, offset: m - nearest }; } diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 2a711bdd4d..0f571ae5f2 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.15", + "version":"0.16", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 0219eeb0ef9d42ed34c39d6e4b205580a846b598 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 6 Sep 2024 23:10:45 +0200 Subject: [PATCH 124/451] Fix loadWidgets location --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 5 ++--- apps/dutchclock/metadata.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index 6519f3b749..bc6f1de464 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -2,4 +2,5 @@ 0.13: Fix widgets reappearing 0.14: Fix midnight 0.15: Fix midnight better -0.16: Fix midnight decisively \ No newline at end of file +0.16: Fix midnight decisively +0.17: Get loadWidgets back in the right place \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 240dca514b..b1dd20b9b7 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -48,9 +48,6 @@ const Y = SCREEN_HEIGHT / 2 let date, mins; function initialize() { - // Load widgets - Bangle.loadWidgets(); - // draw immediately at first tick(); @@ -108,6 +105,8 @@ function draw() { This should be done *before* Bangle.loadWidgets so that widgets know if they're being loaded into a clock app or not */ Bangle.setUI("clock"); + // Load widgets + Bangle.loadWidgets(); if (settings.showWidgets) { Bangle.drawWidgets(); diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 0f571ae5f2..3d5b504846 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.16", + "version":"0.17", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 4bdf4a0b5ce7a4146ec1acbe1f2b62f2e76484ef Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 6 Sep 2024 23:39:29 +0200 Subject: [PATCH 125/451] Move initialization into initialize function --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 11 +++++------ apps/dutchclock/metadata.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index bc6f1de464..7589f192d7 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -3,4 +3,5 @@ 0.14: Fix midnight 0.15: Fix midnight better 0.16: Fix midnight decisively -0.17: Get loadWidgets back in the right place \ No newline at end of file +0.17: Get loadWidgets back in the right place +0.18: Move setUI and loadWidgets to initialize function \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index b1dd20b9b7..5e026316a8 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -48,6 +48,11 @@ const Y = SCREEN_HEIGHT / 2 let date, mins; function initialize() { + // Tell Bangle this is a clock + Bangle.setUI("clock"); + // Load widgets + Bangle.loadWidgets(); + // draw immediately at first tick(); @@ -101,12 +106,6 @@ function draw() { g.drawString(bottomLines.join('\n'), SCREEN_WIDTH/2, SCREEN_HEIGHT - BOTTOM_SPACING, false); } - /* Show launcher when middle button pressed - This should be done *before* Bangle.loadWidgets so that - widgets know if they're being loaded into a clock app or not */ - Bangle.setUI("clock"); - // Load widgets - Bangle.loadWidgets(); if (settings.showWidgets) { Bangle.drawWidgets(); diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 3d5b504846..8cb0fbb861 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.17", + "version":"0.18", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 4bf23b4fbb38473f93e8fd803707ae303e9ced5d Mon Sep 17 00:00:00 2001 From: stweedo Date: Sat, 7 Sep 2024 02:37:03 -0500 Subject: [PATCH 126/451] Revise event handlers --- apps/boxclk/app.js | 180 +++++++++++++++++++++++---------------------- 1 file changed, 92 insertions(+), 88 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index ce54da25d0..8287b64c8c 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -23,84 +23,100 @@ let h = g.getHeight(); let drawTimeout; - // 3. Touch and drag handlers - let touchHandler = function(zone, e) { - let boxTouched = false; - let touchedBox = null; - - for (let boxKey in boxes) { - if (touchInText(e, boxes[boxKey])) { - touchedBox = boxKey; - boxTouched = true; - break; + // 3. Event handlers + let eventHandlers = { + touchHandler: function(zone, e) { + let boxTouched = false; + let touchedBox = null; + + for (let boxKey in boxes) { + if (touchInText(e, boxes[boxKey])) { + touchedBox = boxKey; + boxTouched = true; + break; + } } - } - - if (boxTouched) { + + if (boxTouched) { // Toggle the selected state of the touched box - boxes[touchedBox].selected = !boxes[touchedBox].selected; + boxes[touchedBox].selected = !boxes[touchedBox].selected; // Update isDragging based on whether any box is selected - isDragging = Object.values(boxes).some(box => box.selected); - - if (isDragging) { - widgets.hide(); + isDragging = Object.values(boxes).some(box => box.selected); + + if (isDragging) { + widgets.hide(); + } else { + deselectAllBoxes(); + } } else { + // If tapped outside any box, deselect all boxes deselectAllBoxes(); } - } else { - // If tapped outside any box, deselect all boxes - deselectAllBoxes(); - } - + // Always redraw after a touch event - draw(); - + draw(); + // Handle double tap for saving - if (!boxTouched && !isDragging) { - if (doubleTapTimer) { - clearTimeout(doubleTapTimer); - doubleTapTimer = null; - for (let boxKey in boxes) { - boxesConfig[boxKey].boxPos.x = (boxes[boxKey].pos.x / w).toFixed(3); - boxesConfig[boxKey].boxPos.y = (boxes[boxKey].pos.y / h).toFixed(3); + if (!boxTouched && !isDragging) { + if (doubleTapTimer) { + clearTimeout(doubleTapTimer); + doubleTapTimer = null; + for (let boxKey in boxes) { + boxesConfig[boxKey].boxPos.x = (boxes[boxKey].pos.x / w).toFixed(3); + boxesConfig[boxKey].boxPos.y = (boxes[boxKey].pos.y / h).toFixed(3); + } + storage.write(fileName, JSON.stringify(boxesConfig)); + displaySaveIcon(); + return; } - storage.write(fileName, JSON.stringify(boxesConfig)); - displaySaveIcon(); - return; + + doubleTapTimer = setTimeout(() => { + doubleTapTimer = null; + }, 500); } - - doubleTapTimer = setTimeout(() => { - doubleTapTimer = null; - }, 500); - } - }; - - let dragHandler = function(e) { - // Check if any box is being dragged - if (!isDragging) return; + }, + + dragHandler: function(e) { + if (!isDragging) return; // Stop propagation of the drag event to prevent other handlers - E.stopEventPropagation(); - - for (let key in boxes) { - if (boxes[key].selected) { - let boxItem = boxes[key]; - calcBoxSize(boxItem); - let newX = boxItem.pos.x + e.dx; - let newY = boxItem.pos.y + e.dy; - - if (newX - boxItem.cachedSize.width / 2 >= 0 && - newX + boxItem.cachedSize.width / 2 <= w && - newY - boxItem.cachedSize.height / 2 >= 0 && - newY + boxItem.cachedSize.height / 2 <= h) { - boxItem.pos.x = newX; - boxItem.pos.y = newY; + E.stopEventPropagation(); + + for (let key in boxes) { + if (boxes[key].selected) { + let boxItem = boxes[key]; + calcBoxSize(boxItem); + let newX = boxItem.pos.x + e.dx; + let newY = boxItem.pos.y + e.dy; + + if (newX - boxItem.cachedSize.width / 2 >= 0 && + newX + boxItem.cachedSize.width / 2 <= w && + newY - boxItem.cachedSize.height / 2 >= 0 && + newY + boxItem.cachedSize.height / 2 <= h) { + boxItem.pos.x = newX; + boxItem.pos.y = newY; + } } } + + draw(); + }, + + stepHandler: function(up) { + if (boxes.step && !isDragging) { + boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); + boxes.step.cachedSize = null; + draw(); + } + }, + + lockHandler: function(isLocked) { + if (isLocked) { + deselectAllBoxes(); + draw(); + } } - - draw(); }; // 4. Font loading function @@ -396,35 +412,31 @@ // 10. Setup function to configure event handlers let setup = function() { - Bangle.on('lock', function(isLocked) { - if (isLocked) { - // Screen is about to lock, deselect all boxes - deselectAllBoxes(); - // Redraw to reflect changes - draw(); - } - }); - - Bangle.on('touch', touchHandler); - Bangle.on('drag', dragHandler); - + Bangle.on('lock', eventHandlers.lockHandler); + Bangle.on('touch', eventHandlers.touchHandler); + Bangle.on('drag', eventHandlers.dragHandler); + if (boxes.step) { boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); + Bangle.on('step', eventHandlers.stepHandler); } + if (boxes.batt) { boxes.batt.lastLevel = E.getBattery(); boxes.batt.string = formatStr(boxes.batt, boxes.batt.lastLevel); boxes.batt.lastUpdate = Date.now(); } - + Bangle.setUI({ mode: "clock", remove: function() { // Remove event handlers, stop draw timer, remove custom font - Bangle.removeListener('touch', touchHandler); - Bangle.removeListener('drag', dragHandler); - Bangle.removeListener('step'); - Bangle.removeAllListeners('lock'); + Bangle.removeListener('touch', eventHandlers.touchHandler); + Bangle.removeListener('drag', eventHandlers.dragHandler); + Bangle.removeListener('lock', eventHandlers.lockHandler); + if (boxes.step) { + Bangle.removeListener('step', eventHandlers.stepHandler); + } if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; delete Graphics.prototype.setFontBrunoAce; @@ -434,6 +446,7 @@ widgets.show(); } }); + loadCustomFont(); draw(); }; @@ -443,13 +456,4 @@ widgets.swipeOn(); modSetColor(); setup(); - - // Event listener for real-time step updates - Bangle.on('step', function(up) { - if (boxes.step && !isDragging) { - boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); - boxes.step.cachedSize = null; - draw(); - } - }); } From 490b165862673c3840a7bb91797ac3eaf52de440 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sat, 7 Sep 2024 12:49:56 +0200 Subject: [PATCH 127/451] Make compatible with top and bottom widgets --- apps/dutchclock/ChangeLog | 3 +- apps/dutchclock/README.md | 8 +++- apps/dutchclock/app.js | 79 ++++++++++++++++------------------- apps/dutchclock/metadata.json | 2 +- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index 7589f192d7..16d99b124d 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -4,4 +4,5 @@ 0.15: Fix midnight better 0.16: Fix midnight decisively 0.17: Get loadWidgets back in the right place -0.18: Move setUI and loadWidgets to initialize function \ No newline at end of file +0.18: Move setUI and loadWidgets to initialize function +0.19: Make compatible with top and bottom widgets \ No newline at end of file diff --git a/apps/dutchclock/README.md b/apps/dutchclock/README.md index 4faa03aa80..787bcce1b7 100644 --- a/apps/dutchclock/README.md +++ b/apps/dutchclock/README.md @@ -1,7 +1,7 @@ # Dutch Clock -This clock shows the time, in words, the way a Dutch person would tell you what time it is. Useful when learning Dutch or pretending to know Dutch. +This clock shows the time, in words, the way a Dutch person might respond when asked what time it is. Useful when learning Dutch and/or pretending to know Dutch. -Dedicated my wife, who will sometimes insist I tell her exactly what time it says on the watch and not just an approximation. +Dedicated to my wife, who will sometimes insist I tell her exactly what time it says on the watch and not just an approximation. ## Options - Three modes: @@ -12,6 +12,10 @@ Dedicated my wife, who will sometimes insist I tell her exactly what time it say - Option to show digital time at the bottom (off by default) - Option to show the date at the bottom (on by default) +The app respects top and bottom widgets, but it gets a bit crowded when you add the time/date and you also have bottom widgets turned on. + +When you turn widgets off, you can still see the top widgets by swiping down from the top. + ## Screenshots ![](screenshotbangle1-2.png) ![](screenshotbangle2.png) diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 5e026316a8..41ace8fcad 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -1,18 +1,14 @@ +// Load libraries const storage = require("Storage"); const locale = require('locale'); const widget_utils = require('widget_utils'); -const SCREEN_WIDTH = g.getWidth(); -const SCREEN_HEIGHT = g.getHeight(); - -const TOP_SPACING = 5; +// Define constants const WIDGETS_HEIGHT = 20; const DATETIME_SPACING_HEIGHT = 5; -const TIME_HEIGHT = 10; -const DATE_HEIGHT = 10; -const BOTTOM_SPACING = 5; - -const TEXT_WIDTH = SCREEN_WIDTH - 2; +const TIME_HEIGHT = 8; +const DATE_HEIGHT = 8; +const BOTTOM_SPACING = 2; const MINS_IN_HOUR = 60; const MINS_IN_DAY = 24 * MINS_IN_HOUR; @@ -30,29 +26,39 @@ const settings = Object.assign( storage.readJSON(SETTINGS_FILE, true) || {} ); -const maxFontSize = SCREEN_HEIGHT - - TOP_SPACING - - (settings.showWidgets ? WIDGETS_HEIGHT : 0) - - (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT : 0) - - (settings.showDate ? DATE_HEIGHT : 0) - - (settings.showTime ? TIME_HEIGHT : 0); - -const X = SCREEN_WIDTH / 2; -const Y = SCREEN_HEIGHT / 2 - + TOP_SPACING / 2 - + (settings.showWidgets ? WIDGETS_HEIGHT / 2 : 0) - - (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT / 2 : 0) - - (settings.showDate ? DATE_HEIGHT / 2 : 0) - - (settings.showTime ? TIME_HEIGHT / 2 : 0); - +// Define global variables +const textBox = {}; let date, mins; +// Define functions function initialize() { + // Reset the state of the graphics library + g.clear(true); + // Tell Bangle this is a clock Bangle.setUI("clock"); + // Load widgets Bangle.loadWidgets(); + // Show widgets, or not + if (settings.showWidgets) { + Bangle.drawWidgets(); + } else { + widget_utils.swipeOn(); + } + + const dateTimeHeight = (settings.showDate || settings.showTime ? DATETIME_SPACING_HEIGHT : 0) + + (settings.showDate ? DATE_HEIGHT : 0) + + (settings.showTime ? TIME_HEIGHT : 0); + + Object.assign(textBox, { + x: Bangle.appRect.x + Bangle.appRect.w / 2, + y: Bangle.appRect.y + (Bangle.appRect.h - dateTimeHeight) / 2, + w: Bangle.appRect.w - 2, + h: Bangle.appRect.h - dateTimeHeight + }); + // draw immediately at first tick(); @@ -78,10 +84,6 @@ function tick() { mins = m; draw(); } - - if (!settings.showWidgets) { - widget_utils.hide(); - } } function draw() { @@ -89,40 +91,32 @@ function draw() { const timeLines = getTimeLines(mins); const bottomLines = getBottomLines(); - // Reset the state of the graphics library - g.clear(true); + g.reset().clearRect(Bangle.appRect); // draw the current time (4x size 7 segment) setFont(timeLines); g.setFontAlign(0,0); // align center top - g.drawString(timeLines.join("\n"), X, Y, false); + g.drawString(timeLines.join("\n"), textBox.x, textBox.y, false); if (bottomLines.length) { // draw the time and/or date, in a normal font g.setFont("6x8"); g.setFontAlign(0,1); // align center bottom // pad the date - this clears the background if the date were to change length - g.drawString(bottomLines.join('\n'), SCREEN_WIDTH/2, SCREEN_HEIGHT - BOTTOM_SPACING, false); - } - - - if (settings.showWidgets) { - Bangle.drawWidgets(); - } else { - widget_utils.hide(); + g.drawString(bottomLines.join('\n'), Bangle.appRect.w / 2, Bangle.appRect.y2 - BOTTOM_SPACING, false); } } function setFont(timeLines) { - const size = maxFontSize / timeLines.length; + const size = textBox.h / timeLines.length; g.setFont("Vector", size); let width = g.stringWidth(timeLines.join('\n')); - if (width > TEXT_WIDTH) { - g.setFont("Vector", Math.floor(size * (TEXT_WIDTH / width))); + if (width > textBox.w) { + g.setFont("Vector", Math.floor(size * (textBox.w / width))); } } @@ -263,4 +257,5 @@ function roundTo(x) { return n => Math.round(n / x) * x; } +// Let's go initialize(); \ No newline at end of file diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 8cb0fbb861..5be13d8880 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.18", + "version":"0.19", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From 0d6f7687fcbc564b0b4fc760a208a552e8dbf538 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sat, 7 Sep 2024 12:59:15 +0200 Subject: [PATCH 128/451] Remove unused constant --- apps/dutchclock/ChangeLog | 3 ++- apps/dutchclock/app.js | 1 - apps/dutchclock/metadata.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index 16d99b124d..381e421e57 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -5,4 +5,5 @@ 0.16: Fix midnight decisively 0.17: Get loadWidgets back in the right place 0.18: Move setUI and loadWidgets to initialize function -0.19: Make compatible with top and bottom widgets \ No newline at end of file +0.19: Make compatible with top and bottom widgets +0.20: Remove unused constant \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index 41ace8fcad..f970b572fc 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -4,7 +4,6 @@ const locale = require('locale'); const widget_utils = require('widget_utils'); // Define constants -const WIDGETS_HEIGHT = 20; const DATETIME_SPACING_HEIGHT = 5; const TIME_HEIGHT = 8; const DATE_HEIGHT = 8; diff --git a/apps/dutchclock/metadata.json b/apps/dutchclock/metadata.json index 5be13d8880..d336023f80 100644 --- a/apps/dutchclock/metadata.json +++ b/apps/dutchclock/metadata.json @@ -3,7 +3,7 @@ "name": "Dutch Clock", "shortName":"Dutch Clock", "icon": "app.png", - "version":"0.19", + "version":"0.20", "description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.", "type": "clock", "tags": "clock,dutch,text", From e4518870a6b5277c8f696131a353d1b474c61413 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sat, 7 Sep 2024 15:00:24 +0200 Subject: [PATCH 129/451] Prune Changelog --- apps/dutchclock/ChangeLog | 10 +--------- apps/dutchclock/app.js | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/apps/dutchclock/ChangeLog b/apps/dutchclock/ChangeLog index 381e421e57..8efcb9edb3 100644 --- a/apps/dutchclock/ChangeLog +++ b/apps/dutchclock/ChangeLog @@ -1,9 +1 @@ -0.12: First release -0.13: Fix widgets reappearing -0.14: Fix midnight -0.15: Fix midnight better -0.16: Fix midnight decisively -0.17: Get loadWidgets back in the right place -0.18: Move setUI and loadWidgets to initialize function -0.19: Make compatible with top and bottom widgets -0.20: Remove unused constant \ No newline at end of file +0.20: First release \ No newline at end of file diff --git a/apps/dutchclock/app.js b/apps/dutchclock/app.js index f970b572fc..588692a2bd 100644 --- a/apps/dutchclock/app.js +++ b/apps/dutchclock/app.js @@ -63,8 +63,8 @@ function initialize() { // now check every second let secondInterval = setInterval(tick, 1000); - // Stop updates when LCD is off, restart when on + // Stop updates when LCD is off, restart when on Bangle.on('lcdPower',on=>{ if (secondInterval) clearInterval(secondInterval); secondInterval = undefined; From 42dd3b94f4f19c008208b437aff467413c8ba6dc Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:08:41 -0500 Subject: [PATCH 130/451] Changed event handlers from an object to individual functions --- apps/boxclk/app.js | 166 ++++++++++++++++++++++----------------------- 1 file changed, 82 insertions(+), 84 deletions(-) diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 8287b64c8c..87bbcef772 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -24,98 +24,96 @@ let drawTimeout; // 3. Event handlers - let eventHandlers = { - touchHandler: function(zone, e) { - let boxTouched = false; - let touchedBox = null; - - for (let boxKey in boxes) { - if (touchInText(e, boxes[boxKey])) { - touchedBox = boxKey; - boxTouched = true; - break; - } + let touchHandler = function(zone, e) { + let boxTouched = false; + let touchedBox = null; + + for (let boxKey in boxes) { + if (touchInText(e, boxes[boxKey])) { + touchedBox = boxKey; + boxTouched = true; + break; } - - if (boxTouched) { + } + + if (boxTouched) { // Toggle the selected state of the touched box - boxes[touchedBox].selected = !boxes[touchedBox].selected; + boxes[touchedBox].selected = !boxes[touchedBox].selected; // Update isDragging based on whether any box is selected - isDragging = Object.values(boxes).some(box => box.selected); - - if (isDragging) { - widgets.hide(); - } else { - deselectAllBoxes(); - } + isDragging = Object.values(boxes).some(box => box.selected); + + if (isDragging) { + widgets.hide(); } else { - // If tapped outside any box, deselect all boxes deselectAllBoxes(); } - + } else { + // If tapped outside any box, deselect all boxes + deselectAllBoxes(); + } + // Always redraw after a touch event - draw(); - + draw(); + // Handle double tap for saving - if (!boxTouched && !isDragging) { - if (doubleTapTimer) { - clearTimeout(doubleTapTimer); - doubleTapTimer = null; - for (let boxKey in boxes) { - boxesConfig[boxKey].boxPos.x = (boxes[boxKey].pos.x / w).toFixed(3); - boxesConfig[boxKey].boxPos.y = (boxes[boxKey].pos.y / h).toFixed(3); - } - storage.write(fileName, JSON.stringify(boxesConfig)); - displaySaveIcon(); - return; + if (!boxTouched && !isDragging) { + if (doubleTapTimer) { + clearTimeout(doubleTapTimer); + doubleTapTimer = null; + for (let boxKey in boxes) { + boxesConfig[boxKey].boxPos.x = (boxes[boxKey].pos.x / w).toFixed(3); + boxesConfig[boxKey].boxPos.y = (boxes[boxKey].pos.y / h).toFixed(3); } - - doubleTapTimer = setTimeout(() => { - doubleTapTimer = null; - }, 500); + storage.write(fileName, JSON.stringify(boxesConfig)); + displaySaveIcon(); + return; } - }, - - dragHandler: function(e) { - if (!isDragging) return; + + doubleTapTimer = setTimeout(() => { + doubleTapTimer = null; + }, 500); + } + }; + + let dragHandler = function(e) { + if (!isDragging) return; // Stop propagation of the drag event to prevent other handlers - E.stopEventPropagation(); - - for (let key in boxes) { - if (boxes[key].selected) { - let boxItem = boxes[key]; - calcBoxSize(boxItem); - let newX = boxItem.pos.x + e.dx; - let newY = boxItem.pos.y + e.dy; - - if (newX - boxItem.cachedSize.width / 2 >= 0 && - newX + boxItem.cachedSize.width / 2 <= w && - newY - boxItem.cachedSize.height / 2 >= 0 && - newY + boxItem.cachedSize.height / 2 <= h) { - boxItem.pos.x = newX; - boxItem.pos.y = newY; - } + E.stopEventPropagation(); + + for (let key in boxes) { + if (boxes[key].selected) { + let boxItem = boxes[key]; + calcBoxSize(boxItem); + let newX = boxItem.pos.x + e.dx; + let newY = boxItem.pos.y + e.dy; + + if (newX - boxItem.cachedSize.width / 2 >= 0 && + newX + boxItem.cachedSize.width / 2 <= w && + newY - boxItem.cachedSize.height / 2 >= 0 && + newY + boxItem.cachedSize.height / 2 <= h) { + boxItem.pos.x = newX; + boxItem.pos.y = newY; } } - + } + + draw(); + }; + + let stepHandler = function(up) { + if (boxes.step && !isDragging) { + boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); + boxes.step.cachedSize = null; + draw(); + } + }; + + let lockHandler = function(isLocked) { + if (isLocked) { + deselectAllBoxes(); draw(); - }, - - stepHandler: function(up) { - if (boxes.step && !isDragging) { - boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); - boxes.step.cachedSize = null; - draw(); - } - }, - - lockHandler: function(isLocked) { - if (isLocked) { - deselectAllBoxes(); - draw(); - } } }; @@ -412,13 +410,13 @@ // 10. Setup function to configure event handlers let setup = function() { - Bangle.on('lock', eventHandlers.lockHandler); - Bangle.on('touch', eventHandlers.touchHandler); - Bangle.on('drag', eventHandlers.dragHandler); + Bangle.on('lock', lockHandler); + Bangle.on('touch', touchHandler); + Bangle.on('drag', dragHandler); if (boxes.step) { boxes.step.string = formatStr(boxes.step, Bangle.getHealthStatus("day").steps); - Bangle.on('step', eventHandlers.stepHandler); + Bangle.on('step', stepHandler); } if (boxes.batt) { @@ -431,11 +429,11 @@ mode: "clock", remove: function() { // Remove event handlers, stop draw timer, remove custom font - Bangle.removeListener('touch', eventHandlers.touchHandler); - Bangle.removeListener('drag', eventHandlers.dragHandler); - Bangle.removeListener('lock', eventHandlers.lockHandler); + Bangle.removeListener('touch', touchHandler); + Bangle.removeListener('drag', dragHandler); + Bangle.removeListener('lock', lockHandler); if (boxes.step) { - Bangle.removeListener('step', eventHandlers.stepHandler); + Bangle.removeListener('step', stepHandler); } if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; From 42875090611e1b4e9d884d8b8e74609411fab159 Mon Sep 17 00:00:00 2001 From: stweedo Date: Sat, 7 Sep 2024 13:09:14 -0500 Subject: [PATCH 131/451] Bump version --- apps/boxclk/ChangeLog | 3 ++- apps/boxclk/metadata.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/boxclk/ChangeLog b/apps/boxclk/ChangeLog index 62d1b48758..591d880b83 100644 --- a/apps/boxclk/ChangeLog +++ b/apps/boxclk/ChangeLog @@ -11,4 +11,5 @@ - [+] Improved battery level update logic to reduce unnecessary refreshes - [+] Fixed optional seconds not displaying in time - [+] Fixed drag handler by adding E.stopEventPropagation() -- [+] General code optimization and cleanup \ No newline at end of file +- [+] General code optimization and cleanup +0.09: Revised event handler code \ No newline at end of file diff --git a/apps/boxclk/metadata.json b/apps/boxclk/metadata.json index 27e43c3be5..c8790fe7f6 100644 --- a/apps/boxclk/metadata.json +++ b/apps/boxclk/metadata.json @@ -1,7 +1,7 @@ { "id": "boxclk", "name": "Box Clock", - "version": "0.08", + "version": "0.09", "description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background", "icon": "app.png", "dependencies" : { "clockbg":"module" }, From 36a50d1ceec0df236b7c874f61a43c150cb8e726 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 9 Sep 2024 21:43:56 +0100 Subject: [PATCH 132/451] Layout: fix differing numeric types With a slight hack --- typescript/types/layout.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typescript/types/layout.d.ts b/typescript/types/layout.d.ts index 55ddd7135a..4329d08313 100644 --- a/typescript/types/layout.d.ts +++ b/typescript/types/layout.d.ts @@ -7,7 +7,16 @@ type ExtractIds = [Depth] extends [never] ? never : (T extends { id?: infer Id extends string } - ? { [k in Id]: { -readonly [P in keyof T]: T[P] extends string ? string : T[P] } } + ? { + [k in Id]: { + -readonly [P in keyof T]: + T[P] extends string + ? string + : T[P] extends number + ? number | undefined + : T[P] + } + } : never) | ( From 563829bf82e9ff32104c3b48fd18ad8ed67700cc Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:18:25 +0800 Subject: [PATCH 133/451] calculator: truncate long numbers --- apps/calculator/ChangeLog | 1 + apps/calculator/app.js | 4 ++++ apps/calculator/metadata.json | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/calculator/ChangeLog b/apps/calculator/ChangeLog index 2e1ace7bff..7e66e5d554 100644 --- a/apps/calculator/ChangeLog +++ b/apps/calculator/ChangeLog @@ -5,3 +5,4 @@ 0.05: Grid positioning and swipe controls to switch between numbers, operators and special (for Bangle.js 2) 0.06: Bangle.js 2: Exit with a short press of the physical button 0.07: Bangle.js 2: Exit by pressing upper left corner of the screen +0.08: truncate long numbers (and append '-' to displayed value) diff --git a/apps/calculator/app.js b/apps/calculator/app.js index 465291d139..b3b2f16f53 100644 --- a/apps/calculator/app.js +++ b/apps/calculator/app.js @@ -13,6 +13,7 @@ require("Font7x11Numeric7Seg").add(Graphics); var DEFAULT_SELECTION_NUMBERS = '5', DEFAULT_SELECTION_OPERATORS = '=', DEFAULT_SELECTION_SPECIALS = 'R'; var RIGHT_MARGIN = 20; var RESULT_HEIGHT = 40; +var RESULT_MAX_LEN = Math.floor((g.getWidth() - 20) / 14); var COLORS = { // [normal, selected] DEFAULT: ['#7F8183', '#A6A6A7'], @@ -261,6 +262,9 @@ function displayOutput(num) { num = num.toString(); num = num.replace("-","- "); // fix padding for '-' g.setFont('7x11Numeric7Seg', 2); + if (num.length > RESULT_MAX_LEN) { + num = num.substr(0, RESULT_MAX_LEN - 1)+'-'; + } } g.setFontAlign(1,0); g.drawString(num, g.getWidth()-20, RESULT_HEIGHT/2); diff --git a/apps/calculator/metadata.json b/apps/calculator/metadata.json index 1674b78434..a88444e11d 100644 --- a/apps/calculator/metadata.json +++ b/apps/calculator/metadata.json @@ -2,7 +2,7 @@ "id": "calculator", "name": "Calculator", "shortName": "Calculator", - "version": "0.07", + "version": "0.08", "description": "Basic calculator reminiscent of MacOs's one. Handy for small calculus.", "icon": "calculator.png", "screenshots": [{"url":"screenshot_calculator.png"}], From 393f68260f60648cc259191405678fab2313a741 Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:42:35 +0800 Subject: [PATCH 134/451] calculator: clean-up unused variables --- apps/calculator/app.js | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/apps/calculator/app.js b/apps/calculator/app.js index b3b2f16f53..2d330708b0 100644 --- a/apps/calculator/app.js +++ b/apps/calculator/app.js @@ -89,28 +89,11 @@ function prepareScreen(screen, grid, defaultColor) { } function drawKey(name, k, selected) { - var rMargin = 0; - var bMargin = 0; var color = k.color || COLORS.DEFAULT; g.setColor(color[selected ? 1 : 0]); g.setFont('Vector', 20).setFontAlign(0,0); g.fillRect(k.xy[0], k.xy[1], k.xy[2], k.xy[3]); g.setColor(-1); - // correct margins to center the texts - if (name == '0') { - rMargin = (RIGHT_MARGIN * 2) - 7; - } else if (name === '/') { - rMargin = 5; - } else if (name === '*') { - bMargin = 5; - rMargin = 3; - } else if (name === '-') { - rMargin = 3; - } else if (name === 'R' || name === 'N') { - rMargin = k.val === 'C' ? 0 : -9; - } else if (name === '%') { - rMargin = -3; - } g.drawString(k.val || name, (k.xy[0] + k.xy[2])/2, (k.xy[1] + k.xy[3])/2); } @@ -139,29 +122,21 @@ function drawGlobal() { screen[k] = specials[k]; } drawKeys(); - var selected = DEFAULT_SELECTION_NUMBERS; - var prevSelected = DEFAULT_SELECTION_NUMBERS; } function drawNumbers() { screen = numbers; screenColor = COLORS.DEFAULT; drawKeys(); - var selected = DEFAULT_SELECTION_NUMBERS; - var prevSelected = DEFAULT_SELECTION_NUMBERS; } function drawOperators() { screen = operators; screenColor =COLORS.OPERATOR; drawKeys(); - var selected = DEFAULT_SELECTION_OPERATORS; - var prevSelected = DEFAULT_SELECTION_OPERATORS; } function drawSpecials() { screen = specials; screenColor = COLORS.SPECIAL; drawKeys(); - var selected = DEFAULT_SELECTION_SPECIALS; - var prevSelected = DEFAULT_SELECTION_SPECIALS; } function getIntWithPrecision(x) { @@ -219,8 +194,6 @@ function doMath(x, y, operator) { } function displayOutput(num) { - var len; - var minusMarge = 0; g.setBgColor(0).clearRect(0, 0, g.getWidth(), RESULT_HEIGHT-1); g.setColor(-1); if (num === Infinity || num === -Infinity || isNaN(num)) { @@ -231,9 +204,7 @@ function displayOutput(num) { num = '-INFINITY'; } else { num = 'NOT A NUMBER'; - minusMarge = -25; } - len = (num + '').length; currNumber = null; results = null; isDecimal = false; From dbeeee980fa8da3cd0cee3a93d77628c8e256506 Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:45:41 +0800 Subject: [PATCH 135/451] calculator: clean-up unused variables --- apps/calculator/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/calculator/app.js b/apps/calculator/app.js index 2d330708b0..13666defa0 100644 --- a/apps/calculator/app.js +++ b/apps/calculator/app.js @@ -10,8 +10,7 @@ g.clear(); require("Font7x11Numeric7Seg").add(Graphics); -var DEFAULT_SELECTION_NUMBERS = '5', DEFAULT_SELECTION_OPERATORS = '=', DEFAULT_SELECTION_SPECIALS = 'R'; -var RIGHT_MARGIN = 20; +var DEFAULT_SELECTION_NUMBERS = '5'; var RESULT_HEIGHT = 40; var RESULT_MAX_LEN = Math.floor((g.getWidth() - 20) / 14); var COLORS = { From c757b8576027a32488b2e212605dacd2eac9d245 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Tue, 10 Sep 2024 15:59:36 +0200 Subject: [PATCH 136/451] setuichange: throw if custom drag on some modes If custom drag handler is added together with mode updown or leftright throw an exception. --- apps/setuichange/ChangeLog | 2 ++ apps/setuichange/boot.js | 2 ++ apps/setuichange/metadata.json | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/setuichange/ChangeLog b/apps/setuichange/ChangeLog index 397e4f5090..89a3d19642 100644 --- a/apps/setuichange/ChangeLog +++ b/apps/setuichange/ChangeLog @@ -1,3 +1,5 @@ 0.01: New App! 0.02: Fix case where we tried to push to Bangle.btnWatches but it wasn't defined. +0.03: Throw exception if trying to add custom drag handler on mode updown and + leftright. diff --git a/apps/setuichange/boot.js b/apps/setuichange/boot.js index c9f7aa8985..d9df3566f7 100644 --- a/apps/setuichange/boot.js +++ b/apps/setuichange/boot.js @@ -39,6 +39,7 @@ Bangle.setUI = (function(mode, cb) { try{Bangle.buzz(30);}catch(e){} } if (mode=="updown") { + if (options.drag) throw new Error("Custom drag handler not supported in mode updown!") var dy = 0; Bangle.dragHandler = e=>{ dy += e.dy; @@ -55,6 +56,7 @@ Bangle.setUI = (function(mode, cb) { setWatch(function() { b();cb(); }, BTN1, {repeat:1, edge:"rising"}), ]; } else if (mode=="leftright") { + if (options.drag) throw new Error("Custom drag handler not supported in mode leftright!") var dx = 0; Bangle.dragHandler = e=>{ dx += e.dx; diff --git a/apps/setuichange/metadata.json b/apps/setuichange/metadata.json index 2d6cafc81c..c5aad69298 100644 --- a/apps/setuichange/metadata.json +++ b/apps/setuichange/metadata.json @@ -1,6 +1,6 @@ { "id": "setuichange", "name": "SetUI Proposals preview", - "version":"0.02", + "version":"0.03", "description": "Try out potential future changes to `Bangle.setUI`. Makes hardware button interaction snappier. Makes it possible to set custom event handlers on any type/mode, not just `\"custom\"`. Please provide feedback - see `Read more...` below.", "icon": "app.png", "tags": "", From ed534de39c049d7f77e8af8e729d2de5e0cc5d67 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Tue, 10 Sep 2024 17:31:19 +0200 Subject: [PATCH 137/451] gbdiscon: new app to disconnect from Gadgetbridge gbdiscon sends an action intent that's picked up by Gadgetbridge to disconnect the Bangle.js. It requires the Bluetooth intent API to be enabled in Gadgetbridge. The clock face is loaded immediately. --- apps/gbdiscon/ChangeLog | 1 + apps/gbdiscon/app-icon.js | 1 + apps/gbdiscon/app.js | 7 +++++++ apps/gbdiscon/app.png | Bin 0 -> 1081 bytes apps/gbdiscon/metadata.json | 13 +++++++++++++ 5 files changed, 22 insertions(+) create mode 100644 apps/gbdiscon/ChangeLog create mode 100644 apps/gbdiscon/app-icon.js create mode 100644 apps/gbdiscon/app.js create mode 100644 apps/gbdiscon/app.png create mode 100644 apps/gbdiscon/metadata.json diff --git a/apps/gbdiscon/ChangeLog b/apps/gbdiscon/ChangeLog new file mode 100644 index 0000000000..5560f00bce --- /dev/null +++ b/apps/gbdiscon/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/gbdiscon/app-icon.js b/apps/gbdiscon/app-icon.js new file mode 100644 index 0000000000..81bf148846 --- /dev/null +++ b/apps/gbdiscon/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwYHEgMkyVAkmQDJYREyQRRoARQpARQpIRRkARNggRBkgRNgARCwARNiQRBSRIREgQRBSRIREgARCSRARFhKSKCIoFCSRAjISQ0BAQJZHCI6ZBTwKPEI44tBTIMSYoZ9IBIYyEWZCHEKwbXIDwZ6MBghjBWBR7DIQbmJAAJ7BexYRHGZZHEchRrGNJYRIRpARJWI7XDCIrVHLIeACIpuIgKwBR4RcQyDLFCJbLGCJcAZZgLEiRcLCIkCZZYvFCKAjDI6BZOPqD+PWaUJa6ARCTxARICBQRFPRIRHPRIRHBg4A=")) diff --git a/apps/gbdiscon/app.js b/apps/gbdiscon/app.js new file mode 100644 index 0000000000..1652ac5068 --- /dev/null +++ b/apps/gbdiscon/app.js @@ -0,0 +1,7 @@ +{ +Bangle.setUI({mode:"custom",remove:()=>{}});"Bangle.loadWidgets"; // Allow fastloading. + +Bluetooth.println(JSON.stringify({t:"intent", action:"nodomain.freeyourgadget.gadgetbridge.BLUETOOTH_DISCONNECT", extra:{EXTRA_DEVICE_ADDRESS:NRF.getAddress()}})); + +Bangle.showClock(); +} diff --git a/apps/gbdiscon/app.png b/apps/gbdiscon/app.png new file mode 100644 index 0000000000000000000000000000000000000000..f942c9ba06957ce4fa61a9209097ebf0dea8cc03 GIT binary patch literal 1081 zcmV-91jhS`P)q$gGRCt`tm``Y2MI6V!ZLKlwW@b~{+Da7Kdax=YNWqH+g^+no znw<%}gHZ5fD8-AX;wgKHP4k;=T_}_sJa~xe4QHz6BEE{5yJ%o@p&#FOacI_KQO+{!27J{5GEmj)$j28+t-Bn zIE3iS9l&*nLjlD3R_0ANBf*tEHy|rV*MDBa=$L_6aRmqlt^g#d>S zCN^J`b0w~HXcv?E{ld838U6kSM)n2pzGwwtFS7vNd;o9N-MIM0K=>iBDY5y2U){wO zUAqTRUs5mfl9thZA*MGQh^a_4>Hs$}zB7O~YvA2-H6B3xW`8S$zXhF&Df*zne8Zvz zK6Y|2y5C^*X#?*&1M!Z5m@)8{W2DNJ8pQDs{)6a-ijrR2*!;a{(3Js2W6^UVh958x zCjy9n9G`g2M(jE!2GC9M$oK|C8k{LmuDS8RGMVXPsF z-Ic$vg)2J275&`~geiTgI7u%>kB4}Et9`lw#GOc6ylo5mPmJzGRvJ|F43qSI`;^lE za;d8j)rQL_fOx^c`_;f(Sb{i!o=8;txT2GFlWn6xKk?GsbJ61+wZm?RDLTXzoo`Pl{ZWksh8RpI2k7OtEmDE`IUaA=&~Ib zY+*;gYXMNUd%4sfxfQwo-Sdo0z0Gn9?f_1%9ol^hA0Pi2&jbhPpnc zGrzJUR{(JbL*8Ue?>#`=!B90H(|ZnZe=wAK*6Eg)`XWC<`|UNK zk^&5t^kZD6o3HW7%FC&mPXfTDp5l^jx4hJpzGO%E z)Xm2N5Y;}W=v{|=zp!1=?o7QQUVWt zO^N{ao#GYrQam9*rk$qi09kh$v`}1tG&{|I1*V;1@ZULg00000NkvXXu0mjfZ5slf literal 0 HcmV?d00001 diff --git a/apps/gbdiscon/metadata.json b/apps/gbdiscon/metadata.json new file mode 100644 index 0000000000..0a3aaa8dbc --- /dev/null +++ b/apps/gbdiscon/metadata.json @@ -0,0 +1,13 @@ +{ "id": "gbdiscon", + "name": "Disconnect from Gadgetbridge", + "shortName":"Disconnect Gadgetbridge", + "version":"0.01", + "description": "Disconnect from your android device by running this app. The app will forward you to your clock face immediately after triggering the command.", + "icon": "app.png", + "tags": "android, gadgetbridge, bluetooth, bt", + "supports" : ["BANGLEJS", "BANGLEJS2"], + "storage": [ + {"name":"gbdiscon.app.js","url":"app.js"}, + {"name":"gbdiscon.img","url":"app-icon.js","evaluate":true} + ] +} From d447b5c2e69e2f11d0f432b3975a7f17c8651df6 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 9 Sep 2024 22:01:07 +0100 Subject: [PATCH 138/451] pace: initial app --- apps/pace/ChangeLog | 1 + apps/pace/README.md | 6 ++ apps/pace/app-icon.js | 1 + apps/pace/app.js | 179 +++++++++++++++++++++++++++++++++ apps/pace/app.png | Bin 0 -> 715 bytes apps/pace/app.ts | 217 ++++++++++++++++++++++++++++++++++++++++ apps/pace/metadata.json | 14 +++ 7 files changed, 418 insertions(+) create mode 100644 apps/pace/ChangeLog create mode 100644 apps/pace/README.md create mode 100644 apps/pace/app-icon.js create mode 100644 apps/pace/app.js create mode 100644 apps/pace/app.png create mode 100644 apps/pace/app.ts create mode 100644 apps/pace/metadata.json diff --git a/apps/pace/ChangeLog b/apps/pace/ChangeLog new file mode 100644 index 0000000000..1a3bc17573 --- /dev/null +++ b/apps/pace/ChangeLog @@ -0,0 +1 @@ +0.01: New app! diff --git a/apps/pace/README.md b/apps/pace/README.md new file mode 100644 index 0000000000..f6c0ce941a --- /dev/null +++ b/apps/pace/README.md @@ -0,0 +1,6 @@ +# Description + +A running pace app, useful for races. Will also record your splits and display them to you on the pause menu. + +Drag up/down on the pause menu to scroll through your splits. +Press the button to pause/resume - when resumed, pressing the button will pause instantly, regardless of whether the screen is locked. diff --git a/apps/pace/app-icon.js b/apps/pace/app-icon.js new file mode 100644 index 0000000000..b2b8b4c17a --- /dev/null +++ b/apps/pace/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwkBiIA/AH8QRYoX/AAcAZqwXuMIQYCiAcOO456OCwwACF5orEDghzOE4oZCLxw+GDAKsXeSIqEGBKKGBwIRFGBCfIC7p5RC7oGHC8RxFC453JAw4Xda5AIEC5IAPO6AXmO5BuHC67OIUA4aERyIXEIxAAJiAuFC5gTEcgpDNBwoWCIxp4CCwp1OCIYAEOiDFNDBwVQAH4AvA=")) diff --git a/apps/pace/app.js b/apps/pace/app.js new file mode 100644 index 0000000000..5acad0cee5 --- /dev/null +++ b/apps/pace/app.js @@ -0,0 +1,179 @@ +{ + var Layout_1 = require("Layout"); + var state_1 = 1; + var drawTimeout_1; + var lastUnlazy_1 = 0; + var lastResumeTime_1 = Date.now(); + var splitTime_1 = 0; + var totalTime_1 = 0; + var splits_1 = []; + var splitDist_1 = 0; + var splitOffset_1 = 0, splitOffsetPx_1 = 0; + var lastGPS_1 = 0; + var GPS_TIMEOUT_MS_1 = 30000; + var layout_1 = new Layout_1({ + type: "v", + c: [ + { + type: "txt", + font: "6x8:2", + label: "Pace", + id: "paceLabel", + pad: 4 + }, + { + type: "txt", + font: "Vector:40", + label: "", + id: "pace", + halign: 0 + }, + { + type: "txt", + font: "6x8:2", + label: "Time", + id: "timeLabel", + pad: 4 + }, + { + type: "txt", + font: "Vector:40", + label: "", + id: "time", + halign: 0 + }, + ] + }, { + lazy: true + }); + var formatTime_1 = function (ms) { + var totalSeconds = Math.floor(ms / 1000); + var minutes = Math.floor(totalSeconds / 60); + var seconds = totalSeconds % 60; + return "".concat(minutes, ":").concat(seconds < 10 ? '0' : '').concat(seconds); + }; + var calculatePace_1 = function (time, dist) { + if (dist === 0) + return 0; + return time / dist / 1000 / 60; + }; + var draw_1 = function () { + if (state_1 === 1) { + drawSplits_1(); + return; + } + if (drawTimeout_1) + clearTimeout(drawTimeout_1); + drawTimeout_1 = setTimeout(draw_1, 1000); + var now = Date.now(); + var elapsedTime = formatTime_1(totalTime_1 + (state_1 === 0 ? now - lastResumeTime_1 : 0)); + var pace; + if (now - lastGPS_1 <= GPS_TIMEOUT_MS_1) { + pace = calculatePace_1(thisSplitTime_1(), splitDist_1).toFixed(2); + } + else { + pace = "No GPS"; + } + layout_1["time"].label = elapsedTime; + layout_1["pace"].label = pace; + layout_1.render(); + if (now - lastUnlazy_1 > 30000) + layout_1.forgetLazyState(), lastUnlazy_1 = now; + }; + var drawSplits_1 = function () { + g.clearRect(Bangle.appRect); + var barSize = 20; + var barSpacing = 10; + var w = g.getWidth(); + var h = g.getHeight(); + var max = splits_1.reduce(function (a, x) { return Math.max(a, x); }, 0); + g.setFont("6x8", 2).setFontAlign(-1, -1); + var i = 0; + for (;; i++) { + var split = splits_1[i + splitOffset_1]; + if (split == null) + break; + var y = Bangle.appRect.y + i * (barSize + barSpacing) + barSpacing / 2; + if (y > h) + break; + var size = w * split / max; + g.setColor("#00f").fillRect(0, y, size, y + barSize); + var splitPace = calculatePace_1(split, 1); + g.setColor("#fff").drawString("".concat(i + 1 + splitOffset_1, " @ ").concat(splitPace.toFixed(2)), 0, y); + } + var splitTime = thisSplitTime_1(); + var pace = calculatePace_1(splitTime, splitDist_1); + g.setColor("#fff").drawString("".concat(i + 1 + splitOffset_1, " @ ").concat(pace, " (").concat((splitTime / 1000).toFixed(2), ")"), 0, Bangle.appRect.y + i * (barSize + barSpacing) + barSpacing / 2); + }; + var thisSplitTime_1 = function () { + if (state_1 === 1) + return splitTime_1; + return Date.now() - lastResumeTime_1 + splitTime_1; + }; + var pauseRun_1 = function () { + state_1 = 1; + var now = Date.now(); + totalTime_1 += now - lastResumeTime_1; + splitTime_1 += now - lastResumeTime_1; + Bangle.setGPSPower(0, "pace"); + Bangle.removeListener('GPS', onGPS_1); + draw_1(); + }; + var resumeRun_1 = function () { + state_1 = 0; + lastResumeTime_1 = Date.now(); + Bangle.setGPSPower(1, "pace"); + Bangle.on('GPS', onGPS_1); + g.clearRect(Bangle.appRect); + layout_1.forgetLazyState(); + draw_1(); + }; + var onGPS_1 = function (fix) { + if (fix && fix.speed && state_1 === 0) { + var now = Date.now(); + var elapsedTime = now - lastGPS_1; + splitDist_1 += fix.speed * elapsedTime / 3600000; + while (splitDist_1 >= 1) { + splits_1.push(thisSplitTime_1()); + splitDist_1 -= 1; + splitTime_1 = 0; + } + lastGPS_1 = now; + } + }; + var onButton_1 = function () { + switch (state_1) { + case 0: + pauseRun_1(); + break; + case 1: + resumeRun_1(); + break; + } + }; + Bangle.on('lock', function (locked) { + if (!locked && state_1 == 0) + onButton_1(); + }); + setWatch(function () { return onButton_1(); }, BTN1, { repeat: true }); + Bangle.on('drag', function (e) { + if (state_1 !== 1 || e.b === 0) + return; + splitOffsetPx_1 -= e.dy; + if (splitOffsetPx_1 > 20) { + if (splitOffset_1 < splits_1.length - 3) + splitOffset_1++, Bangle.buzz(30); + splitOffsetPx_1 = 0; + } + else if (splitOffsetPx_1 < -20) { + if (splitOffset_1 > 0) + splitOffset_1--, Bangle.buzz(30); + splitOffsetPx_1 = 0; + } + draw_1(); + }); + Bangle.loadWidgets(); + Bangle.drawWidgets(); + g.clearRect(Bangle.appRect); + draw_1(); +} diff --git a/apps/pace/app.png b/apps/pace/app.png new file mode 100644 index 0000000000000000000000000000000000000000..ff8f29cdca8941f3a4d051ddba2b1469ea81a7a0 GIT binary patch literal 715 zcmV;+0yO=JP)6>ziQ3~@QX)^IJls6$MFG`9s z#e;I2(lls7@-iMwn7p`@2T~q9;6V|2a4AYDmq$jU6b;j0rd{jQYIo*4-`QvEvrlt= zwO-D5);{aMzqR&dK}ku;c+w2Cq_m)T4veI(OU=pwnI1F5| z1l$8o1Dk;vmfsF}rw^E(N8k&9bHL{sm(O3o4Vm>O;Jf$7Xhm*zoisRKppT! z`E3s+g-#~;R+Qfp<##NUB2Kav<#$s(@5xiZH%9?i)$`swH?l3jW9e8VS+nwcpah(u zfV@=#_EIqB$bl{ru$F?+u7V$wV|Q*voR&J^nHukw>p@x*T6pB2Ec4?@FC!Giap}LGgUSs)1`YK xlU`9H_l_LUDg=&MN#+78fF(YQv!rCAFbdFK++ROgi)sJ>002ovPDHLkV1i~1KimKS literal 0 HcmV?d00001 diff --git a/apps/pace/app.ts b/apps/pace/app.ts new file mode 100644 index 0000000000..d7928504ac --- /dev/null +++ b/apps/pace/app.ts @@ -0,0 +1,217 @@ +{ +const Layout = require("Layout"); + +const enum RunState { + RUNNING, + PAUSED +} + +let state = RunState.PAUSED; +let drawTimeout: TimeoutId | undefined; +let lastUnlazy = 0; + +let lastResumeTime = Date.now(); +let splitTime = 0; +let totalTime = 0; + +const splits: number[] = []; +let splitDist = 0; +let splitOffset = 0, splitOffsetPx = 0; + +let lastGPS = 0; +const GPS_TIMEOUT_MS = 30000; + +const layout = new Layout({ + type: "v", + c: [ + { + type: "txt", + font: "6x8:2", + label: "Pace", + id: "paceLabel", + pad: 4 + }, + { + type: "txt", + font: "Vector:40", + label: "", + id: "pace", + halign: 0 + }, + { + type: "txt", + font: "6x8:2", + label: "Time", + id: "timeLabel", + pad: 4 + }, + { + type: "txt", + font: "Vector:40", + label: "", + id: "time", + halign: 0 + }, + ] +}, { + lazy: true +}); + +const formatTime = (ms: number) => { + let totalSeconds = Math.floor(ms / 1000); + let minutes = Math.floor(totalSeconds / 60); + let seconds = totalSeconds % 60; + return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`; +}; + +const calculatePace = (time: number, dist: number) => { + if (dist === 0) return 0; + return time / dist / 1000 / 60; +}; + +const draw = () => { + if (state === RunState.PAUSED) { + // no draw-timeout here, only on user interaction + drawSplits(); + return; + } + + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = setTimeout(draw, 1000); + + const now = Date.now(); + + const elapsedTime = formatTime(totalTime + (state === RunState.RUNNING ? now - lastResumeTime : 0)); + + let pace: string; + if (now - lastGPS <= GPS_TIMEOUT_MS) { + pace = calculatePace(thisSplitTime(), splitDist).toFixed(2); + }else{ + pace = "No GPS"; + } + + layout["time"]!.label = elapsedTime; + layout["pace"]!.label = pace; + layout.render(); + + if (now - lastUnlazy > 30000) + layout.forgetLazyState(), lastUnlazy = now; +}; + +const drawSplits = () => { + g.clearRect(Bangle.appRect); + + const barSize = 20; + const barSpacing = 10; + const w = g.getWidth(); + const h = g.getHeight(); + + const max = splits.reduce((a, x) => Math.max(a, x), 0); + + g.setFont("6x8", 2).setFontAlign(-1, -1); + + let i = 0; + for(; ; i++) { + const split = splits[i + splitOffset]; + if (split == null) break; + + const y = Bangle.appRect.y + i * (barSize + barSpacing) + barSpacing / 2; + if (y > h) break; + + const size = w * split / max; // Scale bar height based on pace + g.setColor("#00f").fillRect(0, y, size, y + barSize); + + const splitPace = calculatePace(split, 1); // Pace per km + g.setColor("#fff").drawString(`${i + 1 + splitOffset} @ ${splitPace.toFixed(2)}`, 0, y); + } + + const splitTime = thisSplitTime(); + const pace = calculatePace(splitTime, splitDist); + g.setColor("#fff").drawString( + `${i + 1 + splitOffset} @ ${pace} (${(splitTime / 1000).toFixed(2)})`, + 0, + Bangle.appRect.y + i * (barSize + barSpacing) + barSpacing / 2, + ); +}; + +const thisSplitTime = () => { + if (state === RunState.PAUSED) return splitTime; + return Date.now() - lastResumeTime + splitTime; +}; + +const pauseRun = () => { + state = RunState.PAUSED; + const now = Date.now(); + totalTime += now - lastResumeTime; + splitTime += now - lastResumeTime; + Bangle.setGPSPower(0, "pace") + Bangle.removeListener('GPS', onGPS); + draw(); +}; + +const resumeRun = () => { + state = RunState.RUNNING; + lastResumeTime = Date.now(); + Bangle.setGPSPower(1, "pace"); + Bangle.on('GPS', onGPS); + + g.clearRect(Bangle.appRect); // splits -> layout, clear. layout -> splits, fine + layout.forgetLazyState(); + draw(); +}; + +const onGPS = (fix: GPSFix) => { + if (fix && fix.speed && state === RunState.RUNNING) { + const now = Date.now(); + + const elapsedTime = now - lastGPS; // ms + splitDist += fix.speed * elapsedTime / 3600000; // ms in one hour (fix.speed is in km/h) + + while (splitDist >= 1) { + splits.push(thisSplitTime()); + splitDist -= 1; + splitTime = 0; + } + + lastGPS = now; + } +}; + +const onButton = () => { + switch (state) { + case RunState.RUNNING: + pauseRun(); + break; + case RunState.PAUSED: + resumeRun(); + break; + } +}; + +Bangle.on('lock', locked => { + // treat an unlock (while running) as a pause + if(!locked && state == RunState.RUNNING) onButton(); +}); + +setWatch(() => onButton(), BTN1, { repeat: true }); + +Bangle.on('drag', e => { + if (state !== RunState.PAUSED || e.b === 0) return; + + splitOffsetPx -= e.dy; + if (splitOffsetPx > 20) { + if (splitOffset < splits.length-3) splitOffset++, Bangle.buzz(30); + splitOffsetPx = 0; + } else if (splitOffsetPx < -20) { + if (splitOffset > 0) splitOffset--, Bangle.buzz(30); + splitOffsetPx = 0; + } + draw(); +}); + +Bangle.loadWidgets(); +Bangle.drawWidgets(); + +g.clearRect(Bangle.appRect); +draw(); +} diff --git a/apps/pace/metadata.json b/apps/pace/metadata.json new file mode 100644 index 0000000000..e7066c9586 --- /dev/null +++ b/apps/pace/metadata.json @@ -0,0 +1,14 @@ +{ + "id": "pace", + "name": "Pace", + "version": "0.01", + "description": "Show pace and time running splits", + "icon": "app.png", + "tags": "run,running,fitness,outdoors", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + { "name": "pace.app.js","url": "app.js" }, + { "name": "pace.img","url": "app-icon.js","evaluate": true } + ] +} From 35b59ad217f07b388a0b885843fc14df97240125 Mon Sep 17 00:00:00 2001 From: thyttan <97237430+thyttan@users.noreply.github.com> Date: Tue, 10 Sep 2024 22:39:28 +0200 Subject: [PATCH 139/451] gbdiscon: add note re Gadgetbridge version requirement --- apps/gbdiscon/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gbdiscon/metadata.json b/apps/gbdiscon/metadata.json index 0a3aaa8dbc..ecc92d01cf 100644 --- a/apps/gbdiscon/metadata.json +++ b/apps/gbdiscon/metadata.json @@ -2,7 +2,7 @@ "name": "Disconnect from Gadgetbridge", "shortName":"Disconnect Gadgetbridge", "version":"0.01", - "description": "Disconnect from your android device by running this app. The app will forward you to your clock face immediately after triggering the command.", + "description": "Disconnect from your android device by running this app. The app will forward you to your clock face immediately after triggering the command. (Gadgetbridge nightly required until version 82 is released)", "icon": "app.png", "tags": "android, gadgetbridge, bluetooth, bt", "supports" : ["BANGLEJS", "BANGLEJS2"], From 6bf66d5fa2c689b47366b81b1ad496b3d61f559b Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:08:22 +0800 Subject: [PATCH 140/451] calculator: append '...' to truncated numbers --- apps/calculator/ChangeLog | 2 +- apps/calculator/app.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/calculator/ChangeLog b/apps/calculator/ChangeLog index 7e66e5d554..7b47d3a4ca 100644 --- a/apps/calculator/ChangeLog +++ b/apps/calculator/ChangeLog @@ -5,4 +5,4 @@ 0.05: Grid positioning and swipe controls to switch between numbers, operators and special (for Bangle.js 2) 0.06: Bangle.js 2: Exit with a short press of the physical button 0.07: Bangle.js 2: Exit by pressing upper left corner of the screen -0.08: truncate long numbers (and append '-' to displayed value) +0.08: truncate long numbers (and append '...' to displayed value) diff --git a/apps/calculator/app.js b/apps/calculator/app.js index 13666defa0..5f4e77a479 100644 --- a/apps/calculator/app.js +++ b/apps/calculator/app.js @@ -233,7 +233,7 @@ function displayOutput(num) { num = num.replace("-","- "); // fix padding for '-' g.setFont('7x11Numeric7Seg', 2); if (num.length > RESULT_MAX_LEN) { - num = num.substr(0, RESULT_MAX_LEN - 1)+'-'; + num = num.substr(0, RESULT_MAX_LEN - 1)+'...'; } } g.setFontAlign(1,0); From b1ae5d448bbe0ddcc2a1bc1ca8779ee2ebfa91e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 00:31:00 +0000 Subject: [PATCH 141/451] build(deps): bump webtools from `71f271a` to `c594022` Bumps [webtools](https://github.com/espruino/EspruinoWebTools) from `71f271a` to `c594022`. - [Commits](https://github.com/espruino/EspruinoWebTools/compare/71f271a1c7be37efe4e472b7482b08ded1d0ab6f...c59402259c779b578e68995ea0237b813fab09c0) --- updated-dependencies: - dependency-name: webtools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- webtools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webtools b/webtools index 71f271a1c7..c59402259c 160000 --- a/webtools +++ b/webtools @@ -1 +1 @@ -Subproject commit 71f271a1c7be37efe4e472b7482b08ded1d0ab6f +Subproject commit c59402259c779b578e68995ea0237b813fab09c0 From 8113cbba4d11ee79cecfed3dd2bdaa91bfc1567c Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:29:10 +0800 Subject: [PATCH 142/451] hadash: added more to-dos --- apps/hadash/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/hadash/README.md b/apps/hadash/README.md index a767543e26..1ae64d8794 100644 --- a/apps/hadash/README.md +++ b/apps/hadash/README.md @@ -57,8 +57,9 @@ that token in case your watch is stolen or lost. ## To-Do -A better way to configure the menu structure would be useful, something like a -custom editor (replacing the jsoneditor). +- A better way to configure the menu structure would be useful, something like a custom editor (replacing the jsoneditor). +- After showing a state or call a service, return to the same point in the menu. +- Config option for service calls to not show a "successful" prompt ## Author From 624cf0f510334cdcaed742e4053c4acb55de6e6c Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:38:00 -0500 Subject: [PATCH 143/451] Revised suffix formatting in getDate function --- apps/boxclk/ChangeLog | 3 ++- apps/boxclk/app.js | 19 +++++++++++++++---- apps/boxclk/boxclk-2.json | 14 +++++++------- apps/boxclk/metadata.json | 2 +- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/apps/boxclk/ChangeLog b/apps/boxclk/ChangeLog index 591d880b83..65a6c979ff 100644 --- a/apps/boxclk/ChangeLog +++ b/apps/boxclk/ChangeLog @@ -12,4 +12,5 @@ - [+] Fixed optional seconds not displaying in time - [+] Fixed drag handler by adding E.stopEventPropagation() - [+] General code optimization and cleanup -0.09: Revised event handler code \ No newline at end of file +0.09: Revised event handler code +0.10: Revised suffix formatting in getDate function \ No newline at end of file diff --git a/apps/boxclk/app.js b/apps/boxclk/app.js index 87bbcef772..71dbda94f7 100644 --- a/apps/boxclk/app.js +++ b/apps/boxclk/app.js @@ -208,12 +208,23 @@ // 7. String forming helper functions let getDate = function(short, shortMonth, disableSuffix) { const date = new Date(); - const dayOfMonth = date.getDate(); + const day = date.getDate(); const month = shortMonth ? locale.month(date, 1) : locale.month(date, 0); const year = date.getFullYear(); - let suffix = ["st", "nd", "rd"][(dayOfMonth - 1) % 10] || "th"; - let dayOfMonthStr = disableSuffix ? dayOfMonth : `${dayOfMonth}${suffix}`; - return `${month} ${dayOfMonthStr}${short ? '' : `, ${year}`}`; + + const getSuffix = (day) => { + if (day >= 11 && day <= 13) return 'th'; + const lastDigit = day % 10; + switch (lastDigit) { + case 1: return 'st'; + case 2: return 'nd'; + case 3: return 'rd'; + default: return 'th'; + } + }; + + const dayStr = disableSuffix ? day : `${day}${getSuffix(day)}`; + return `${month} ${dayStr}${short ? '' : `, ${year}`}`; // not including year for short version }; let getDayOfWeek = function(date, short) { diff --git a/apps/boxclk/boxclk-2.json b/apps/boxclk/boxclk-2.json index dde1da97e7..1bdc89252a 100644 --- a/apps/boxclk/boxclk-2.json +++ b/apps/boxclk/boxclk-2.json @@ -11,14 +11,14 @@ "xOffset": 3, "yOffset": 0, "boxPos": { - "x": "0.494", + "x": "0.5", "y": "0.739" } }, "dow": { "font": "6x8", "fontSize": 3, - "outline": 1, + "outline": 2, "color": "bgH", "outlineColor": "fg", "border": "#f0f", @@ -27,7 +27,7 @@ "xOffset": 2, "yOffset": 0, "boxPos": { - "x": "0.421", + "x": "0.5", "y": "0.201" }, "short": false @@ -35,7 +35,7 @@ "date": { "font": "6x8", "fontSize": 2, - "outline": 1, + "outline": 2, "color": "bgH", "outlineColor": "fg", "border": "#f0f", @@ -44,7 +44,7 @@ "xOffset": 1, "yOffset": 0, "boxPos": { - "x": "0.454", + "x": "0.5", "y": "0.074" }, "shortMonth": false, @@ -62,7 +62,7 @@ "xOffset": 2, "yOffset": 1, "boxPos": { - "x": "0.494", + "x": "0.5", "y": "0.926" }, "prefix": "Steps: " @@ -79,7 +79,7 @@ "xOffset": 2, "yOffset": 2, "boxPos": { - "x": "0.805", + "x": "0.8", "y": "0.427" }, "suffix": "%" diff --git a/apps/boxclk/metadata.json b/apps/boxclk/metadata.json index c8790fe7f6..48f9f82ae4 100644 --- a/apps/boxclk/metadata.json +++ b/apps/boxclk/metadata.json @@ -1,7 +1,7 @@ { "id": "boxclk", "name": "Box Clock", - "version": "0.09", + "version": "0.10", "description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background", "icon": "app.png", "dependencies" : { "clockbg":"module" }, From ca004b27001a81dec99892c3b6a919e3fd181509 Mon Sep 17 00:00:00 2001 From: Guptilious <42465910+Guptilious@users.noreply.github.com> Date: Thu, 12 Sep 2024 07:56:31 +0100 Subject: [PATCH 144/451] Update app.js added an if statement to display an alert message if the tv config file is not present. --- apps/tvremote/app.js | 150 +++++++++++++++++++++++++------------------ 1 file changed, 89 insertions(+), 61 deletions(-) diff --git a/apps/tvremote/app.js b/apps/tvremote/app.js index 628ccd81ce..1564f18572 100644 --- a/apps/tvremote/app.js +++ b/apps/tvremote/app.js @@ -9,13 +9,15 @@ let devicefile = require("Storage").readJSON(deviceFileName, true); //console.log(devicefile); -let serverDns = serverData.webServerDns; -let serverPort = serverData.port; -let tvIp = serverData.tvIp; -let username = serverData.username; -let password = serverData.password; +let serverDns = "webServerDns" in serverData ? serverData.webServerDns : 'undefined'; -let panaIp = "tvIp" in serverData ? serverData.tvIp : 'undefined'; +let serverPort = "port" in serverData ? serverData.port : 'undefined'; +let tvIp = "tvIp" in serverData ? serverData.tvIp : 'undefined'; +let username = "username" in serverData ? serverData.username : 'undefined'; +let password = "password" in serverData ? serverData.password : 'undefined'; + +let panaIp = tvIp; +//"tvIp" in serverData ? serverData.tvIp : 'undefined'; let settingsPort = "port" in serverData ? serverData.port : 'undefined'; let counter; @@ -31,7 +33,12 @@ let RIGHT_MARGIN = 15; let midpoint = (g.getWidth() / 2); let IP_AREA = [0, RESULT_HEIGHT, g.getWidth(), g.getHeight()]; // values used for key buttons let KEY_AREA = [0, 24, g.getWidth(), g.getHeight()]; -let COLORS = {DEFAULT: ['#FF0000'], BLACK: ['#000000'], WHITE: ['#FFFFFF'], GREY: ['#808080', '#222222']}; // background +let COLORS = { + DEFAULT: ['#FF0000'], + BLACK: ['#000000'], + WHITE: ['#FFFFFF'], + GREY: ['#808080', '#222222'] +}; // background let sourceApps = { "selection": { @@ -178,7 +185,7 @@ let volume = sourceApps.volume; let selection = sourceApps.selection; let numbers = sourceApps.numbers; -function assignScreen (screen) { +function assignScreen(screen) { currentScreen = screen; console.log(currentScreen); } @@ -195,14 +202,13 @@ function sendPost(keyPress) { }; Bangle.http( - serverUrl, - { - method: 'POST', - headers: { - 'Authorization': `Basic ${credentials}`, - }, - body: JSON.stringify(keyJson) - }) + serverUrl, { + method: 'POST', + headers: { + 'Authorization': `Basic ${credentials}`, + }, + body: JSON.stringify(keyJson) + }) .then(response => { console.log("Response received:", response); }).catch(error => { @@ -211,19 +217,18 @@ function sendPost(keyPress) { } function receiveDevices() { - serverPort = settingsPort; + let serverPort = settingsPort; let credentials = btoa(`${username}:${password}`); let serverUrl = `https://${serverDns}:${serverPort}/ssdp-devices.json`; return Bangle.http( - serverUrl, - { + serverUrl, { method: 'GET', headers: { 'Authorization': `Basic ${credentials}` }, }).then(data => { - require("Storage").write(deviceFileName, data); - devicefile = require("Storage").readJSON(deviceFileName, true); + require("Storage").write(deviceFileName, data); + devicefile = require("Storage").readJSON(deviceFileName, true); }); } @@ -277,7 +282,7 @@ function drawKeys(area, buttons) { function displayOutput(num, screenValue) { // top block num = num.toString(); - g.setFont('Vector', 18); //'7x11Numeric7Seg' + g.setFont('Vector', 18); //'7x11Numeric7Seg' g.setFontAlign(1, 0); g.setBgColor(0).clearRect(0, 0, g.getWidth(), RESULT_HEIGHT - 1); g.setColor(-1); // value @@ -288,27 +293,25 @@ function displayOutput(num, screenValue) { // top block function buttonPress(val, screenValue) { if (screenValue === "ip") { - if (val === "<") currNumber = currNumber.slice(0,-1); + if (val === "<") currNumber = currNumber.slice(0, -1); else if (val === ".") currNumber = currNumber + "."; else currNumber = currNumber == null ? val : currNumber + val; // currNumber is null if no value pressed let ipcount = (currNumber.match(/\./g) || []).length; - if (ipcount > 3 || currNumber.length > 15) currNumber = currNumber.slice(0,-1); + if (ipcount > 3 || currNumber.length > 15) currNumber = currNumber.slice(0, -1); displayOutput(currNumber, screenValue); } - let checkValue = appData.some(app => app.name === screenValue); // check app data + let checkValue = appData.some(app => app.name === screenValue); // check app data - if (checkValue) sendPost(val); // app values + if (checkValue) sendPost(val); // app values if (screenValue === "numbers") { if (val === '<') sendPost('back'); else if (val === 'ok') sendPost('enter'); - else sendPost("num_"+val); - } - - else if (screenValue === "selection") sendPost(selection[val].key); + else sendPost("num_" + val); + } else if (screenValue === "selection") sendPost(selection[val].key); else if (screenValue === "volume") sendPost(volume[val].key); } @@ -327,7 +330,7 @@ const powerScreen = () => { }; const appMenu = () => { - + assignScreen("apps"); E.showScroller({ h: 54, @@ -367,7 +370,7 @@ let tvSelector = { "": { title: "TV Selector", back: function() { - load();//E.showMenu(tvSelector); + load(); //E.showMenu(tvSelector); } }, "Panasonic": function() { @@ -398,7 +401,7 @@ function clearCountdown() { function countDown(callback) { require("widget_utils").show(); if (counter === 0) { - callback(); // Call the callback function when countdown reaches 0 + callback(); // Call the callback function when countdown reaches 0 return; } E.showMessage(`Searching for devices...\n${counter}`, "Device Search"); @@ -453,36 +456,51 @@ function subMenu() { if (typeof settingsPort !== 'undefined' && settingsPort !== 'undefined') { let portHeader = `Port: ${settingsPort}`; - settingssub[portHeader] = function() { IPASSIGN = "port"; ipScreen();}; + settingssub[portHeader] = function() { + IPASSIGN = "port"; + ipScreen(); + }; } else { - settingssub["Set DNS Port"] = function() { IPASSIGN = "port"; ipScreen();}; + settingssub["Set DNS Port"] = function() { + IPASSIGN = "port"; + ipScreen(); + }; } if (typeof panaIp !== 'undefined' && panaIp !== 'undefined') { let panaheader = `Pana IP: ${panaIp}`; - settingssub[panaheader] = function() { - IPASSIGN = "pana"; + settingssub[panaheader] = function() { + IPASSIGN = "pana"; E.showMenu(deviceSelect); devicefile = require("Storage").readJSON("tvdevicelist.json", true); -console.log(devicefile); + console.log(devicefile); }; } else { - settingssub["Set Pana IP"] = function() { IPASSIGN = "pana"; ipScreen();}; + settingssub["Set Pana IP"] = function() { + IPASSIGN = "pana"; + ipScreen(); + }; } if (typeof samsIp !== 'undefined' && panaIp !== 'undefined') { let samsheader = `Sams IP: ${samsIp}`; - settingssub[samsheader] = function() { IPASSIGN = "sams"; ipScreen();}; + settingssub[samsheader] = function() { + IPASSIGN = "sams"; + ipScreen(); + }; } else { - settingssub["Set Sams IP"] = function() { IPASSIGN = "sams"; ipScreen();}; + settingssub["Set Sams IP"] = function() { + IPASSIGN = "sams"; + ipScreen(); + }; } E.showMenu(settingssub); } const deviceMenu = () => { -let parsedResp = JSON.parse(devicefile.resp); - E.showScroller({ + let parsedResp = JSON.parse(devicefile.resp); + E.showScroller({ h: 54, c: parsedResp.length, draw: (i, r) => { @@ -515,13 +533,16 @@ let parsedResp = JSON.parse(devicefile.resp); let deviceSelect = { - "" : { title : "Device Select", - back : function() { subMenu(); } - }, - "Manual IP Assign" : function() { + "": { + title: "Device Select", + back: function() { + subMenu(); + } + }, + "Manual IP Assign": function() { ipScreen(); }, - "Device Select" : function() { + "Device Select": function() { receiveDevices(); counter = 5; countDown(deviceMenu); @@ -549,7 +570,7 @@ function swipeHandler(LR, UD) { sendPost("enter"); } } - if (LR == 1) { // swipe right + if (LR == 1) { // swipe right if (currentScreen === "apps") { assignScreen("power"); E.showScroller(); @@ -560,13 +581,13 @@ function swipeHandler(LR, UD) { sendPost("back"); } } - if (UD == -1) { // swipe up + if (UD == -1) { // swipe up if (currentScreen === "selection") { assignScreen("volume"); prepareScreen(volume, volumeGrid, COLORS.DEFAULT, KEY_AREA); drawKeys(KEY_AREA, volume); } else if (currentScreen === "volume") { - sendPost("enter"); + sendPost("enter"); } else if (currentScreen === "ip") { buttonPress(".", "ip"); } else if (currentScreen == "numbers") { @@ -575,15 +596,15 @@ function swipeHandler(LR, UD) { drawKeys(KEY_AREA, selection); } } - if (UD == 1) { // swipe down - if (currentScreen === "volume") { - assignScreen("selection"); - prepareScreen(selection, selectionGrid, COLORS.DEFAULT, KEY_AREA); - drawKeys(KEY_AREA, selection); - } else if (currentScreen === "selection") { - assignScreen("numbers"); - prepareScreen(numbers, numbersGrid, COLORS.DEFAULT, KEY_AREA); - drawKeys(KEY_AREA, numbers); + if (UD == 1) { // swipe down + if (currentScreen === "volume") { + assignScreen("selection"); + prepareScreen(selection, selectionGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, selection); + } else if (currentScreen === "selection") { + assignScreen("numbers"); + prepareScreen(numbers, numbersGrid, COLORS.DEFAULT, KEY_AREA); + drawKeys(KEY_AREA, numbers); } } } @@ -624,4 +645,11 @@ Bangle.on('touch', touchHandler); Bangle.loadWidgets(); Bangle.drawWidgets(); -mainMenu(); + +if (serverData === undefined) { + E.showAlert(`${serverDataFile}.json missing.\nSee READ.me`, "Config Error").then(function() { + mainMenu(); + }); +} else { + mainMenu(); +} From 9e0ce08f7db7d69ce74443227e6f278f9eb5bc69 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 12 Sep 2024 08:54:15 +0100 Subject: [PATCH 145/451] fix overflow issue mentioned in https://github.com/espruino/BangleApps/pull/3548#issuecomment-2345498696 --- css/main.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/css/main.css b/css/main.css index 810b9a032e..ce27a0eb70 100644 --- a/css/main.css +++ b/css/main.css @@ -81,7 +81,10 @@ a.btn.btn-link.dropdown-toggle { min-height: 8em; } -.tile-content { position: relative; } +.tile-content { + position: relative; + overflow-wrap: anywhere; /* stop long text like links pushing the width out too far*/ +} .link-github { position:absolute; top: 36px; @@ -137,4 +140,4 @@ Not sure how to get 'normal' wrap behaviour (eg fill up until max-width, then wr /*.tooltip:hover::after { white-space: normal; min-width: 160px; -}*/ \ No newline at end of file +}*/ From 824fef0e1a3f70da303b8f106e5d7504df29135c Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Thu, 12 Sep 2024 03:02:18 -0500 Subject: [PATCH 146/451] Update screenshot to match boxclk-2.json config change --- apps/boxclk/screenshot-2.png | Bin 7460 -> 11609 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/boxclk/screenshot-2.png b/apps/boxclk/screenshot-2.png index 568a310b9cd99ad364fd26ed1a84ccc3119eee8a..361185406efa82df2d2d8ce74cf1102415b53771 100644 GIT binary patch literal 11609 zcmV-fEvC|mP)PyA07*naRCr$PU5j!orw+9L|D%0t2LyVz#LTXpo48W(@h-!F5UoZC@%{7j_4D=m z5B_|AjdBnF{{H^@`bp|V-|O~JdGP!D`}^zX=jZGC{q^(p{Wbpnn$NvH*Zrk(^!X(^ z_5Q1#^*IT3)*rqH3SSi1?cQ&{3e5JuTCN_r`o;T4{k(p&eo*^GKa^a$T3~y3T7x6+ zpQ~4=KYEb6^;9OqRsuVD)cdZ%nB(#KomIacC83ND_TbCU_g~{*p3tt>$;Vio^SL=k zx{|UwsVkZ-x;{24yp&WbF@5Zn=Wm=CH;WDB_QiX*U)|@w>k1qxYeflpcd3cR=MVyO zq$RO3WWB^}5M;K8J||=hb$%eIhrHr*J*ul-dR|Y)?r>>fB?~f@$ygA7@`p%l zkRy~A!j3Ki$K@LeoC%u-w>lt2<(+uw0ty3K0j4h{_8th4aT`#t^_w>2ee>*C)b6U3 zD&-{NZ=@U(EAG*T(3iXzi%@n*O_}-UsJmp~DxJ7drlG)*k|JenBCaErP=S|HZbTKF zR&!2;h@1xS;a;3LL{N={YBU8EQKmRlEMM6;so5nYBCWqd1eQpAg20*+4>|W}go7dB zB&)8qTm|+ylzrDZeeNhd15|>!snLRmF7xNhMB@=Xo8#0TB!Sbq9dl$5le_^m>7xRL zFFCya%UhF)OY{3qzl4%1Ifb35mUAk2K!MRh4k>H!J>#}ZfJTA0_dp}>;A|TT$6JWg zZAny+*U$)OA{i@uq^(tMs13W%>EkBk#E5%Qj+OWI@<2|eT}FYca`^cY3T%)!a!?Qg z&hM*;eKe-R0#9rRI0Zu0+wWhNIB&;e?`c%DQF9MILg7`tYuWU|lPRQbSIY5TAOfbr zQwaQzSKv>X@*4tg=wzcPx#(yCJN_=SRL8QpBm@8&M%IY(Rsq2xvyZ^1161uGay{!A z+byq=5+R1JfBBOG!G5Yex*gPy)Xz(_$w5#phoIlak|BN2-*@HHEzkP#p8|8PrWGU_ zxKn|5CwNhT*UlXIzt;*)`maNTRQ)C|MYQ&SNZXZ9w>;lDYFi_B+_F4i>^t&858TVU@xc?M5Se!hi@DXLu zoRuN(i1Cm#0(nu4w_qZ8*#q%$1!fD?6oI2UVSiYG%Ls@33RTLX>Ipe8 zabbk04x+zYUr#Hr_94U;T+KcM7zlw8*F*?~1_~)ymm4=`tlKoyAM`zXKawYSUhj-8 z1M>RERL&g|IwL}zj#d#Eu3^yl{yG99fp-Tq8lXrJ|0(d04Bs#+#yN{P-$Mlc`wEN@ zSkIs?=Rt~zCWv_6A#)LepZbr{gzR!!Gy$9Pi4gdz2JO1CcNw=BLej{MhuU8StSV)C zyB7i}{IYpdghd4=ZWkf~npjn;^4AquA*of`eUhYvz(_99cvTht?Ft+q@NRd_fl|~% z+wIbW5?UM_M&kS<-`{Wfg}@oou7S(TA$ROk0&Dw`Z@k!vM*D`b7aMTL%&)0CYo+71 zkuhmH%FK_7z0vOvJ$hexFWp5n!F=x{a(kQ(rBpoxa9F)O!{;9<@`3|9j>XY5FHrKl z(Vu$quF~!2Q|@ZatPP64id2->LEubTb-QSsM3WY6i3W0qrpo7c|0{vCcSn^WaOHJO zn#vxbr%9o`2H#Z~JIYpnjjphrCkC3*|z1~#gQO{D2>eFcUR=975 zz>Yji2u$d2PX(AWbe~jWE!OXy7h*O;`x}V}xCbT2sn|zI@qqtdSiyaI`tI>+|)_62iI8@p{(kEs@w9 z8&!UW3zrd?PN9yr=?pf>aT6pUt*9viYkPZ&q-gF>Ixv;ba6j6ZHq$GyJ|}!@_DE3*Bp0{ z_`sqp{EOGmz+f;0RS0}y-^NLF>}uU_o#m5OQrVOC1PDx1W+w>|t`fFd|7R&MLf(5y ztDokaxH9P8+pob@&29~}%Yn!Ew(6OU8|}&0KD@aLDU-LI+R@8+4?l1~YOWITpq2#C zMbzpxCpD`QcThpTsGXJ1xrlfGj!yj7i7n84)kEMzS<%Kw3w%VsSpKy@K3a)0PA(a9 z4@5QsU*3m+8!bRqT&uDS`cn$5Xao2ARuna&I*tOT!%$H?uE0@3z)C&Q^G zlGW5oJq-octVbB~0%Dge`;^;6;CSCx%napyK#Sw+9f=~jd**LdyxC&qMM&G(Rn#t$ z1B+=m=L7PgDk^hrHLuaHl+zv{aJJkY3as(l;l3MfrGJlR8$DuP_JF|4=D32Kh9}YL z#IDwjV&6gjt{ix?_=2ljPoOYS63>!l1ajtHg{nR<>1Qi4)4cC1A*VBCd`fJ+5|F#R z1%a7ZI>-?CZSNp(YK}`2Du>`o{e1A(+Lr#|Dey^>?T(y-{K1i&Z8p$)>Q*0t6$zm~ zhoEE>60m^%owWxLCKl9gt>IaX0pfkW9_zZK8l2PkNFzj515w$DYk46e>yxy{^=%~_ zm`}cpHi)LU2psL4=sP7UA(N>>I?XJVKSyAFVqwK{oGS3-P{({SLV(7isf)nom6ZwA zP~a}*Lu)Dhy;NY21E&Z)9_Of>t{R_0)JQ4~#XB14BI037YaZWgJ8nN#xWU{X9DDdXpE;Q+L)M6_3Nmf2NbxX#AO5~ z?}LlLFsjJely(s#N&V>!93dyWg=mFZ{=z_q3LJQIj&%4J`qfona$ntD41NrO`AnhC z{#gWm2pK$6euThx7D^SfUYR8oUfrw*j=!!i@j^s9yGf+Zm+=GNL10&@Qv`O_mk9!E ze_@%+-BF$*=Nx^v!+95-%Ba{>ypXOm>Nz@n?8$R^w`zA2@g_nJti26-h|u5JRteDndz42A!x^bUsGAa`rcGe1t=UE z!wQsS)cK$j7ug*FCSK1N#xgcJhu?xzd?wR*3NR5k`dYfFX-Y#`#v2#$=y=A^oPCU0} z3*Ett52%W~Oicww*CIsn@i}lZTeF!EAu}c(JM@*z#i`|&h zxK{b8EHaPp0?Z1Mt&7Z=%aUJY9*rlai+-=zTnSJ8RN9?$;8X6KATEzZFd1yrZSyAY z!p&RKky4(2@8@!h>$7Q@^kC8S7IzdUs}YUBxBfOUFA9lORNv{uTL|n3DqDL!g1~o? zH$vZ-M^ey6EUu2Fh*rBEvR07bbPy4bKdBcXz1+anZ}|E8`584-lhzDb#u~A0ZRXLn zJ*~*yAh4%ERb-0tCuDgQvV69h8+T(dFapZec)6b^TJ?cv>>8oQVa;;}VQImw@12tp za|6qH1|xpI+qHn-mP@<49!21eQpeoaj^GKWjgYgde3gYkN7vAM4ZeXR>7931%K9q_ z7=mS#tK(7e#}y%T&9WL@6wzpjL~^q<8%Kk4%7F{dQHG$3nd~AkQV4GdXs|rvXx?wU z6gfhAJA0^&(p=MDH6-TXL+8vcF0B@JI!mONHFCH}(e&PH0nI`_ioiZ^&1YN}eP8dm zqqLgaRun-iC$&K{KB~)Ki0yVSN~B&so|8&eY2R6ynho;k8t;Gg-P_wBFCsV3Q?s0k zGcG(haN);S9_62``g37^TtEK=p3i=YmP9sU;%g=M1VeJ*6N-R_% z>sc87KHXo@w>1}4DpfvPL@>$gZV@L-fZ%uE;puY0-__Onq#uidG&W*I=C#3#m(dzth}u143nBC#d*S)ZDbAwL1Y*1yak;gQ7Fq;E zqnYHypWM)p+KrUd5AO7*6r|a9x-7q;W^XbCQ!!l0+Klmdb0N1;2!Z+bGtbl>BC*yJ z4}od=&bfy+GfL5DQ8)FxN9eZ}IiMg~&7a~*%5T@qm)pW)e%qd|gx?%FUm>5)HY-PD zy~8E$)VKiZWOXnFx&)K?YtSgk?`^Du50Mol9z6rAm82qXT|9T<>Ilpc$L^%ydY&wC9bcL=$d0@Zy~V0`#~VF;Wj0&UtyoduP0}2 z``e|&Y;Mx}in#82gBO>)s**#}9n}5wM)XPy$hf8;_^HhL>vaw{M&1DR%6fnI0tjgUov}#|AU)>SU zzET-3xYUHzBz$TGIkj3Aa4P5E`rdZ4dp34hMdzzB2VS@9%o$CqPGX}KWz4wg$+9D? zFWEfc3(4!96O!dBdWgG@JifY0Jc^Yij3P^8OQQ9VMqFL4;;o3dEt;18hyd;6q?!6P{`JJ z9Qi8$vheFz{TpO@!hOv;ZMJs%dH1xvkGyOu&VP<|+2*)%oY?2r?VNt{4w=>Q0i=Ag zig$BbI4PK|QsEBQ5O6(wCjv{3t7!s4;5>grq{Q6s+wpGL@#m{t@)U8uH#_r26G$Bw zT6L-*^(-r7*baSiLX6^*+WUUDSm#O!FEhWe?hBG-J`Ep%4>I2%(RR77M@_PKXav^J z;|1F|&szOi{ShaPw;y;TGI9T%zz)9y6CPYgp~PQ8U}as``bKby*B|mS>evf$pu|#1 zt)DnUYAtTVNRu)3mQ4wxRj*=fT^-n5Tz7IWJ1MrmH_91S%@WDa+-bjiK^0e#xtdUja?Uj?9*h5~V zsL}iMbE9)&MdnmJl!l)crb5vIE@~goccJ(85E6&^IFK;R_p?9i$}2f3!jmNxg?zgL z`{yTy?y`P}lR#`|_#Ft`;lAO5Ef~bjIBkKYyflU3{&J54dri9D3E$&qP!yBxsvNWS zwr>CN2SOS_?RGp72?FE08*0ew@4$J;OZAEG9IIMeu(9d5?YqeDKv8zwpwqVS$yjeE zM67(FznC^h^lx}xTeWmPj}ZUv8NUW8XqQ47 zq#e@;B=ki$Ht&Fs#0yOB(qjiMVT~Ca{Bw{TU2-YF#o3WFi?|xXqP!1>2wYgtXvE%L z4n=*JMYcWC+ru)K8PXhCpX9*#vj`y#Cq`+Q*6Y+{Y~BxtdW^r%7R!aFgKHPWxbXZI zynjz};LNq<;RWuREaCBA&3gqh7lKSK(W~T-xLtc1jaOjA^ALEvM{TPcI)Ph5^~~xf zC$Bpdt8aK$x!9dHR@>!nybh8%%a3|N*Ej8^Se?lEU) zjm7nnEg9u1WWf%h$vk7?Udif%?4Dr@wCmHUK-`{UeFIvP9 zc#X>`0&BB_W*#qJ5kRE4uV=-=jm<#*%;u&s0pTYrM!j?A4ES}sNSs<6*1Uo{IT0OK zVy&7yCgXG(Rz~ft%y1q#J94R4Y3RW<=H3uL>y5Bpi>s>#>x`|uDw(tjZG@>z8A6Za zK+4>{qR-5D?7{CSafrb4z594II2&f@5Sg~|970~ii9hcrmPq@}PF`H<5&D7IIAqss zb(9#*J;Zyf_IZ0E80Ry@N9FhBjWZ#7`#|QJW(6p$DzNGILKU7Hj7eHotXDvhpf2TR zdp3gZ@R39#^*i4iPsF-`bG9cKlZn7l6j{~Z8^r?$5PN{Uds)Ixu?pLf`DZ0ZbYl<{ z7na#LWAYm*@=#o5t|LTg-f*h#iId1nSCPbsyz{R6q)3MCmCh^SXGN&zh%3Rq#41n~S(y^hU+Drb$XR zNihKJ4%FX6WR1Yt4jdl}!+|-+tSfPJ`uI5nCgs(6iUW2%{Iro@m4B{}oUY?UbC9_* z-Bn^v2h=@q<@Tx_DIHZ8-nrq(!|n{$ybw1GsFL8WiDz!V&ayR57`H73 z2Vo1|kTK|X4wzS8)fa>ww7G#fgOcp(hULtdu*`%ZQ_-jz6b zho1)L8F{wSu7&&z#AXP5#~f_Dl>p?-_ymDHeBhJh5~s_7<4Hg2WbqA&7eWNNALB^> z!E<2rz4#Xwc7C!X-w|2#49Yo<=d#&D>+|1578wt|iNGutA=n8@?HiL?s=O`&*A%6^ zx>pD+V<6(S0MVRsl!S}G(aK1_S3$lvnX?_a#}T+T2Gvp`DsUflVIilqb*wnBW!ml|9is0)D$(STI0hrnttdifJGgmjT*_s27*YcPyA z!!!F;*$nZQIkEChaRlDmy)g~R7K9-JFW`*^alEgMye7Z1@-Aq0w+CP(I$R>w3w^1) zx?QoCB3Akh1ag}3c;;S3GP#3%`c@K&A2~cE+J@XwQSmXy*5>b|}jl^p+ z2qnSW{#bEeptgucsbzbuzc;d2V}vYy*yS|>59;6`ut2;-%fuo$Jk_gMQ=-HkzD|C_ z!tPI%)_=}Dn8~>|cjcu1V_kn{!8qAfhz%hw;=U0PTkPKn&PTG$(}69vQ$XelOXjML zTE=zM=fJ`C%_kC4Vn!eLnMyU^* zDVu8#Zt}GWA?SFJoxxGg~&nfwoM(is_(z0-mv`#;=udmM5=-a z{|S}jm(t2%2vk4zE*NKp5nJ4|OHJ*~+{+WRTF_6>$ArI9uJ|Y65 z-O{o}ZSO=CfzS7eVINU}#VMK7A3byOeH7aeAA0n;G7HO}%}_hNW-e~u5NkJsSV!vy z6?9GvLD|L-Un3m%u)?B~x;3&Ci`P)GR_ z=?s;U2rSNKy%&Ksg}{R9mB0#Y5!m=KyWIHXn02pPttlfoXXg1xc5@5T5^+Ss71>1ui@!SggQ4 zD|d5tRgu_4)aZMpKCQsgpDUE@AvupaBO2i&?K%~$G6h)$riCbrJ~MIKv|>}yWZ9UN z_jDWthBNk2!OFK`rB3omR1lVzA;0l2B5*3}H_AC5W6OQ7?Q#7OQ*MtN6CoNfKuiZYncmVQ&udAm-2&X5H?0I^yn!F|7BWx5 z3+wZ}5#A2rzBFBVg;>-bg$7;Ggqj1h6cWjiw3b9dr=F9gLv zkku?A@P=%gLi59deOlq3uCJ_+-GU#Mv&lPb;*l+q>NALh%#@slAM+B?lXC?pPGn52 zwm@qDH`*YMB`hMqAYxiBrM-f^`Y^x#&HB1}DV!eaVd$ECBURG~Y!3u&z0t@joi-!q z#UTRck^fny7(e6i=vH4rqDeA7@7A|+s|80GyY(egwcWlu3OuH|M7FnaZ;0rM14jr< zYY67T6&%;N(ssS8+~B}EstI`^NHl6kE**h^ex1uvhMc@r>wbTSQ;+Im6gF)uTL`w@ zH2`BZ8zSKyt>wFJ83KFnc&i(2ztB#qJ)Y9PYfo^j2t4H{=319<;M&=%8WJ-$0v*Au z^V~%h1k~I|%#Gv=5U2@If#+aQURzy(KH7FiX*?xVG@x~B{hhWz`hmR=I__DfFpx12 zeCN*igHI56yE_}&I0pds{SG3P6pmRB$ACb@)bSReL$JO({ku#@>FI(ZT1=S_E{qEQ+%_0Bkmnkx#N2I#00-PQUMCHyxku(1S@zg%%& zlQ~{xu3y#2n>tT8aOD5(BeGeD-9aRza2}=3xMQV0(B6Ne0*eLZJf0?4*@akgK^8(B zh>4IKSRk=;_Danp>1~*e(n##aph}Je7h+YVhFi(#G%n1kApyV8u9GQUsCE>A-hf$C zwOsYZaAGSCJN0ItI#%Pa7V0A3$Yr4^Dvd%znYV@efwwop_d?hxv}cg`qY5mkm~nD+ z6b^fp-yA|-Rm^I+hZK0uu6-BHnnxpL>eiaMfYu?nV|I!pE_*w9H}ds#;)Rg6-Gtr- zbliqGXLS+x#>GX!snO!&|0yujc;V6mSxW=%tCjXTBR3D!j1DX_O-^CS5Ljerx3H6AJ4t7vyZNK)p<&#oqv6tlvW zcVG?o$7-)Y^}ResM0m59_rQ&P5Ydoy;m(M;@e%mS%wrLFovBCkAj~KmLmuS29Surm zLWM5C6mD>_(y={Qk+h#v*Zy7v#(k+O@K|5&yF0Fld^MgarOBP} zlQhP%a;<(!f$46GS$CA_{Rn}zKfDwR@ks=(BF#hP%$Pa$9h!XBmI?=k2>ejr!W@pm z;&ggfYZ$rAgnNIcACWoFBo1%Cu#;(TwpnbeM+p3@9JnT<$4cppNQ>{+cqzL?wR0k-?`}b@B&bIK`T^w=dp6xy29QbkyY!0keHg}L%7|FyB z{E!f<)j+E$-Hou?KaIdH*MENMcxT@DrI7mM1;0ih+SMlpwh)*EJ)6&a@!U>al@r5l z>8M-9&&@J*#sZYuhyBF0<_Gt_5hz4?5WL)9D&@fnv~qSh*C9v%J~|V<|F?_>*T_k0 z8~!=Za!N5Ag8Q;|p);5A?4@?0?IZXx0^eQO4a=f_PB9CDp(=0_X>LB=Z7r40r)c0l zF&|H^nRr{K)%PP`x9h-sPuQ@7%s0OB$83B#k3zH3+52>}9QQ&f^u1^UtK#E+U=%O> zXTEolyo%5Ofek`xju+(7ZP2>x)}vuzujc4xV>%pI;>_flYRUl@dB;HY0-YxPuV_kB0hLDOU?V z;f1JL*=b#7jxsLo%>MyDvmGjh9-kQYHnT2^t z;v+58C(MDPi%XC><2(hT%P6pYim}KmDNWH_FDrkCMil$#x$e?)M~<8`C)L112fmEm?JqXm&ni{1>fpQ#eZ zJ9>29yL_flyeCI+SDqxF41p{1|7NP`$$!?rlpOjd*Lk9S8-0?kGUC2^G#vzvxC`Kp z!GgraP#{2~a*hCbnGRxCO&(1mPQI#}8!p161ME09*Dw@lK%`)i<$XZ@L<1lw@qyx# ztAf>z=Rs7*t&2Dl_aG9x3iE&ftpX#?Jfu-qV1@7;k$~{yoxW2}yq|;eR0s^qI|^0- z5W|6=L|`ZOLDMU~;Je1vM57^ZMD+ba;xYX*GneW?S0G$DUCN;pxMD_io(zIu_^g;- z6|9kElFb%~cnam9{3GiI`#2^QTo@+S0SYESU{3z14!INe4g>}?Af5FgjSa+Cc~{p8 zNXYkF#5p_|T+d5TaZy6f86j{*QAH$9u+*v`d?YI+pOxpq$rCYl8hzKl1~*5BhB2Z{e00vm72>=RsILin`> zyk&Qezz-lX|_=1#Ytxz`dFUb{vs5;=4j06T}$C0u#S}w zuFd78h#a0J1YQt&>f)L1i9Hc5sdyo}{Y46_ z);ce&bB89Jyz%D5_3G=n_!P2c7d{6**u03Ml?34jh?=@+lph#!!ha|N6MM+~$Iwjk z8&MkyT#~;)V54hW>d}Il`@20on-ogY1|1u+odk{-;*<*qoLOHln{eX}f@P*ErCE&u z?bg%rOHZ<^@+0UsD)u)Ae<5BMfujxyI>!*Tq=a>k6WWPW>3l-*bL)PLz?EpCGX-FN z-7W{dLrW^}s+d<4%MozMEl)~iCY86!fsM?&6btmxaDK3JXQ~t2Qh^@PlSNv6*I1%aytk=~cG%kd$^30DaFo`R(sws-`CBVezIU%aC zcQpiNUWp3witCZui=bdQ!PdDs^947A*; zB8b5D8rs?op3qBBj4p$IMb0@ZlLeG1Z>+d(vAHz!ww{aqjXa-Fo{n|!{K}A?H73YT zg}O}8ZiQMHis(GP&p=OH<)drC^)hIP@-F6=Et-Yf7xO#?@C;cQk-MVM(u{!eMJPW%&7>0(dXA1j;&Xm#d)!nVzmAT Xa30JV9(e8j00000NkvXXu0mjfEOLoP literal 7460 zcmV+<9oyoGP)Py6-bqA3RCr$PUD1~8Cc{{XeEpkw<#5a;Tnndv4jQ=s3rp>w8@EOt++skgn)k z@Ky^jtR+Ewt8#(HQUK0_mgC5aQ46zj|KBH*%j|wVIi~(JCg!ZIt%iRO;A^>P3c$;? zG8z~KPj9;P`eRL_PxO7H%^uT!0>h%dPX=&o%x9U_E2le)>u=5TDY0MAv8)#mIJ|mL zxjUav2JpD*UU*W#SSC0Z#Qz;l$-sIk_DZEy0NxROEbMqgPl*k01hDL7lwzP&X#c{RmI#ml?wF<1LCvJ7 z2ZdRYTzPKFcYyPfmrSgOm~J-?eNn^B0Jdy41Y;gK z`2UXRfRo>2;!B@yJI4%if>`TaW*E;7UO!8Jni=YNzye0M>*$vrgvh_>Im<$Wat;GK zQB`3u6>EArbQuzb98mxe@>BKs5CB_26qQ{-07cISfyovpLI}`Z$QUYCM$ChNam5e& zzjS@Q5aPwYTNF{p%BHbAhV%48@=bhlWlQ#nLH*9kdyEe1OEWXFKa0FcatgrYde&lM zmQfP`)>#Mb@QPW5Pdqll; zjND=1EuuEYWW~V9R$0bH4xVVAlN5!WP`BvkaE7I8S|WG=IKjM99kseQr$iK^>Zvda z0Ap&S7#Nv#0)Wk-J`uoj!)D4RjP|W%qhq6JO3D%Wpz}P>zzx8hYy%t9dNChj>Tax9 zvJ`qRgNT9I7?cHgv_9li6(UISDQ7qkfgBA^N!6jgVgLgMW*ByrgN6Xy={f13vj((C zL(f;)$6!JI|O06!TMp2O-Jc^4=2kR6U%gm0PpA|5=zaR$l+8_D5dD_jLv3xg2PQh70Uef>J zVvL^QN`nPJ|K;Q88=Gb9+WFV&4bV;L%vcZhwh=!#iVgK0xov#8-n5QzV!fFZnDP#; zbb-VZUOOWj)t@>KJjk%;uE9~yxkHvu+B?PVhvtxNgN8xc%3<1)J$b|&>082#O5=!StMvI~Gm?dTc62(crZ z8cb{*ohfF3-Q(0F2;Hoy7?_zTo?3T~!&la@ftU#OdzkT_nGD?X#@wzAtuR<7_E4a^ zIk{_Rb-VAHd@X7oJy-cvFKJ&R>H3Y4AF_zSzzD>EsVyqs*eAlkryufH3^5BqMBoe) zmpYiiAB{>`dBMPzIztF)90zMtj)wA+1Xu>{88ybh1O<5>$%0*@ zQ~qu<@ENNPpd<>&sQiFxY|$>b*;zs}@P>%%-MlT#Ab;3*`iLP?wa74@S)ikL7OatS z`=Btr#2eM^LvM?@6k=q&FvF)k`$;tGaIEfJFvzz$NC3XVj17e1hd!HZWH7uCrN@9e zq&Zz-FeKY8Rt|yFbtxJs%^MH18MyY?_1l{R7&35XP&7*p;)T?WY7X!pFS8!6zM7$$ z93stf+?eUY3``&vffePWnKXjUz?*Vk2G;M|gq9zWE*ppDv_RhBcS(>Up9v69@~cTjKvqsg=$1G}3XHe*YBQ@0T5u5KBL zc?|4jEmj8&5zrQ0bY9wwflo#%MoL_e=cQ|0qlAGs3&1P`AMIJIc;>duZEd_yj%L;; zf|gE5wx^j7hF5jozKA2wW@I*r&Je<4;F5&c*dhD#F$^q#c`~UJ>rP_eW`;|oo zr#A_Iy+I7DL;ozqUiH`v+%RtPRz%?@vWKfwv z5}WT$RBaY%+N-k=nW!Wd^Yo$pa@fsgZE~mdKZ$g>Pi?>oW$O({zLSoO9WPdgLiWdP`dR=)nW_EOYne{`>dy zI!n2a-$ai}K&3q+_0lD`j))#Kqr2s#c zfo%Zqn-AASmCoNPP&BD6L`lb@vfO1~^4E06NHegWc-e{giiO;hzTW45nJ#YKBm~z1 zm}vZyL`>#PcEH^EOVpK`5mfl3`!(>AAn`RQG+M6bJ22}H{#YjZ0@zEUT&qaM1tLc7 zy%8$b6t$6i<oX_`v$gBdg<6Y19ojCByGg1bX&oX3$5i<(_Sido$}nPvi8JlUMLM#Z&$MJo6q{NMjH*_n zzPA8HRXz2bV&Di^QAfC)m+G=BRAu!%T0fday~an|;ZtjS$}Gj0;$4Mvutjd&gfT7` z^M@Q56#hAG@(mXI3~`3}-;Q}lV%eZuB;y8)zK!@?0B3{U3Fa7O#MMk|#?GOzfMa6s zaKN?aVq`lY)7tsj32qy%VlIG()fuZG3u4r2W`QWz3f=n8`0RSo^Ga!5mxdx8yU&jf z{07F={roim&VrZ8D)89^{{p++@Z>ghhndr{FtbAlnb_{%(BK*@{A&Pg*&(|?Yeu<| zRz-G)S%+@;pqN+YW6g3}L2*_>L1@{q|=&(m3mQO5I_FV%~{)tzkpOZu0HdG!w2 zJ20>ek1{Ds)(4DS#lRX=Q71AD{w5jEKK+!Wi$jF=sAW4}PU zfU$NKyxBpufN|w5mCbozn3vTvCmt<#n3Z+QjKNSb@FOuV+uN+%3@gbx-bIfI{rU~D zF<@Zzx(jWz%gg0W1NOv!Ol~rxd;MFGO)&eJU|jvKnRh;HWlAkOpM_eVEe7oHUT8GAA_FN}THGO@>v z$K}{Bpm^7Hd3O*?aFzRx^_%tHr8dsrqnuO8&pZ!|76^fX#fuL0KKbq#>gb!&o2k|W z05{GG0C+U~*cn)y_(w5lcQ1ZI3}?o4%a~eS&T+OAW$@&t1nQTLPrQ37$T;R50lZBD zQFBZAi-C`7Jfn8*17HYA=8dy?OrDm7GMX`)+bMP2%X|VY0LTpB z5qPiX{{F-mjUN}WnMMXzXGvzB!auw;zRVVpA6YUK6D!jWW)}*ho{UUl1v2bSO!$-@L@c;ZSUEdnLWqrE%00$C z_C5xCRDPd-`JG=cTxGciGBsV1=x{|~(mCEoBhcTs^RomR*x)@QR}6vl5C&tLIifDl zg02hF47`0I?12A-xHpQCp1i}rm@!#nvvMQMl4Ydl%UyFVYbP_jAQ?Huz&oW*1@H{U z9S*Z*Z8Y7!^M@F*_nf7U2pSU%oXz5x0Ct!6yYv6QKG=Lp5StMwwx|D&TO~YSF_ck6$rnWy8P<=hVf3~8t z`ll9_*EftKQ3i}^$e9VIs~AR=D2jg4%&5O)Ey{PKtufx_fn}C#U#~y*b7u_PbKtR7 z8L$Hwt`I!~P4DZhJcd zng;8$4#+?yX}>In7KUOOnDQyfz-GT**H#z9Fu*eyxcLYqQ;)In;mxlMzM!2vFv5aB zz^Zq&PF)@WR}&bD22#&wcS;a$t&e74W5KC90GXNaVU|IoptXFvjTe>?EIHSf1NGXB z8ejeI7us>t(=`j{cDh{V9tE#Ev&_+x8Q{Gxu=Yhv8Z}cW{M0s#Hr9k&9dK8&n8ME zUe}qvM?6$UlvF;-CL=L&?_-XEvo5PLh(l|p5x<0E-z@W-4T(Icp*S5!u?#k1oIA?8 z4nR|ncrF+?>z>iBQVfh@mq3^4SlbLE(hVW-dT(a1e;@qJ)2J8O^0S$EV2v}2kxvG` zYXpUvSH~%=vxFRq(M0yMtvx$v5_&#Tq*)1(9TrBN1;$MOO$KHwBD+eRY&6@1u`i~8 z-oou7q&cg3;>J_fv@yA8Ox%P){^rM-pHi`~%L9Ele^lc0rX5LM!m|yVMFYdk zl8NyINUwQ%oYd>i@+?G{d0FEFrz0{viSu2-BV&JL6VzE$e(-q~e1px_A%s=gY~Rkv z-0VYIX9pA&5aGiXJ-Dm#=#Jk_RKz-D1~Nb$Occke%gR|QEo0!GQmgID5|SGOk9a5B zx!zQz^(k$z9nI<#EEh4GS9Nqf+6Az;E?`GY8pMMQuztmx7tz>zA`@>Oo^^9jJ3|Gr z*@#ELI_OUKN}b;No9T)@bMX;bU#XR z!Z)4yI4TTsOwns27%bfaD zSGJsaI&2XW4}=}jF*}`sM;35s)J%EqOaT%0twP{4F)Xx;dSOb(7FP1+Ol+x#tZ_R7 zBZa8vo%kifz`89jg>${)6$zXMIR%`vrP5d-59 z&U%}Wa~Sgk?-t*Hj>4V9NwG1zyO4;PBV)|;5A%(T!fJ2Jz9pFb;a=YC4Wf!^E9)k_ zqZ?AwL)UpD#`f3*p~W+d#b#5OsIEksM|R))`xYf20QU+n=mS^fWCpIz1skuNS7#>J z>_L$`C^Z$LT35|dvGD-&T2nAFp-^co!@KO5^48N3z%mvdAq5VZbEG11u$4~Uv}ihu zyy$o*xr=)?Khx+QT3E9qv<)(KmuU|jwK*VwLk!H$vI#7lpdyXPWFtIvPxa*2n>>ms zj3^m*fB?H_T5ESu92J=q7n3Q z{CT3`ycoJW!z3BoOdA+?*a=6tv99y>7sbHH(NmsVJ|Zh_E>fJ3jW})Zv7b%8q{hCO zX$Er!7;Y+G0U0)UU_=cg5X&$?+YJ)uc z85z(Fb4BW7ZIUKT5Af2sloG%j5pW>}?&VJ@T_*@-z&AA}K0S^#8D`+gSFc*;Z@M$! zqiziBt^81X6@aZ_E`~LDjGF2Mlg2n-K_`v|J*cHRMS{5MV#4;#q*oh{X#(J-Q7U()>YkZHkXzhth=CDks-WM?!=gm@@_k3ju^GA#%uvV&GJ`@WB8^%xi`Z$WbWqtzK;G7nmb#M#tkl1_pMix~X$p#V%+U4>7u2xp}1e1#s&rLFundQU}T(DUg z0yvoJs4|jd*a_JCtnH3AxWIQASOjJUh{ZY14yPpSY~DA$Ppw#Jz|%)0

#uQBUgR~!7yO@#H zFas+pf>{WwGn0YD+6x)XR26N28P6LA1`37&JYqk@dM*Py?-nNG_st~KSqShJwO&A@ zEJT-SSR{=&fNf*p!0E-lrP;{9ek%Y+8F(dtt+lOUU`ZBdYL|MY= z6N!Cg<|ty9cLFeL%C0ZjN=6vCH#1TI21<4vm;e%MlaWOO+s1EZVAck+0bK2YXeCfW zL4^_SMuvC#CmdFM5P%~LEbZ`RU}7lfO^X9y+Xh}K&N_fS3qh#0$LBpkw2(mMStXj0 zYy?$_oKP?OV8+0xzeF4fH!ZR@@yaDOK}J;2o^dwvs3uMZ)|F5UtTs%{76}Fx)lf?7 z0h?_%I`BO(N79Q^V&IUK2;sW{eD2`w$%%$)0)PnJ%oCX^yKz&32?;mUBE-O9>ijaW zu+l=mSxE@SKahd5vEFY1@T(taA@^lq25MNQmq~M@A9R?(KKo;u%Ul%x5dc3P1OE{Kdv?~@Fz@%cnf?fXpNN6u z&bUgz9CGJ19{ASBh+<%-%T|qM$3GuJXlB^Mn0j-5b_kJm=Br!?z|nq;C`JI72_xn) z@a)dKX? za1LT%lfS9M_bcTk>B6!s!w{0>1r!jDL&pZR0u5nVMD5FKBjD(9Q=lnTR zb40cW+DJW&>{|jj!obW34`a<^;9^mzpz&^3^Bp$EJ-w(8^!z5~joN?qSb9qUGp>ag zVk&WDv{R_6=ut9b4zXZkXgM1#M$BwPUzE9K34IiR8PH}Kp%^rjXACP8E>P!nNw05v zOfz4JC)*u~WwT9u6o50G>_Nt>FU7#RGP+@p!}h;NG8{6(DGQv8%|5BjJplH$ojvbJ z`G5!G{APav*{X+fDy@Kb|3Ulrb7O+px<72yFfe2PK>eF7qVkjh<3hg*!13<;C72YB zW<09>-smvAagN^+z1 zVg`jYg(F`vFkmnm!0bp8a_8>Yh&=;gSfk=o?UJ_o0+?|w3EWKoL1S(o^4_0Fok9OqE7`W=uDgYB!XBoJ_EFw>3lSll>0G_ZxPh=ef z%T`wyAqsd;2j=e}z!u>kJIu7v)sdQm_|<&$7C45NUI%6|la zqu~T&1V)BwcTznlZ#*1AL>F1iz+^HuZx}XI Date: Thu, 12 Sep 2024 10:05:40 +0100 Subject: [PATCH 147/451] Update apps/tvremote/app.js Co-authored-by: thyttan <97237430+thyttan@users.noreply.github.com> --- apps/tvremote/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tvremote/app.js b/apps/tvremote/app.js index 1564f18572..55d9fe9ad9 100644 --- a/apps/tvremote/app.js +++ b/apps/tvremote/app.js @@ -647,7 +647,7 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); if (serverData === undefined) { - E.showAlert(`${serverDataFile}.json missing.\nSee READ.me`, "Config Error").then(function() { + E.showAlert(`No settings.\nSee READ.me`, "Config Error").then(function() { mainMenu(); }); } else { From 144bf5a28aa3dae91e3835a76a0901babac8f02a Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 12 Sep 2024 13:03:03 +0100 Subject: [PATCH 148/451] On Android, try and use saveFile for backups --- backup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backup.js b/backup.js index 09f65af998..2475c80027 100644 --- a/backup.js +++ b/backup.js @@ -53,7 +53,12 @@ function bangleDownload() { }).then(content => { Progress.hide({ sticky: true }); showToast('Backup complete!', 'success'); - Espruino.Core.Utils.fileSaveDialog(content, "Banglejs backup.zip"); + if (typeof Android !== "undefined" && typeof Android.saveFile === 'function') { + // Recent Gadgetbridge version that provides the saveFile interface + Android.saveFile("Banglejs backup.zip", "application/zip", content); + } else { + Espruino.Core.Utils.fileSaveDialog(content, "Banglejs backup.zip"); + } }).catch(err => { Progress.hide({ sticky: true }); showToast('Backup failed, ' + err, 'error'); From e5458fc5a009bed5bee19305881219b0cba38b9b Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 12 Sep 2024 13:33:54 +0100 Subject: [PATCH 149/451] fix recent change for file backup --- backup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.js b/backup.js index 2475c80027..cc4c327bc1 100644 --- a/backup.js +++ b/backup.js @@ -55,7 +55,7 @@ function bangleDownload() { showToast('Backup complete!', 'success'); if (typeof Android !== "undefined" && typeof Android.saveFile === 'function') { // Recent Gadgetbridge version that provides the saveFile interface - Android.saveFile("Banglejs backup.zip", "application/zip", content); + Android.saveFile("Banglejs backup.zip", "application/zip", btoa(content)); } else { Espruino.Core.Utils.fileSaveDialog(content, "Banglejs backup.zip"); } From 2569ef966a1d20d3916017fa44fbb6cd03c69420 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:33:07 +0200 Subject: [PATCH 150/451] Update blc.js additional functions (change colors in settings) --- apps/blc/blc.js | 329 +++++++++++++++++++++++++++++------------------- 1 file changed, 199 insertions(+), 130 deletions(-) diff --git a/apps/blc/blc.js b/apps/blc/blc.js index 8a0f93d708..b12492a5ee 100644 --- a/apps/blc/blc.js +++ b/apps/blc/blc.js @@ -2,135 +2,204 @@ { // must be inside our own scope here so that when we are unloaded everything disappears // we also define functions using 'let fn = function() {..}' for the same reason. function decls are global - let drawTimeout; - - // Actually draw the watch face - let draw = function() - { - // Bangle.js2 -> 176x176 - var x_rgt = g.getWidth(); - var y_bot = g.getHeight(); - //var x_cntr = x_rgt / 2; - var y_cntr = y_bot / 18*7; // not to high because of widget-field (1/3 is to high) - g.reset().clearRect(Bangle.appRect); // clear whole background (w/o widgets) - - let white = [1,1,1]; - let red = [1,0,0]; - let green = [0,1,0]; - //let blue = [0,0,1]; - let yellow = [1,1,0]; - //let magenta = [1,0,1]; - //let cyan = [0,1,1]; - let black = [0,0,0]; - let bord_col = white; - let col_off = black; - - var col = new Array(red, green, yellow, yellow); // [R,G,B] - - let pot_2 = [1, 2, 4, 8, 16, 32]; // array with powers of two, because power-op (**) - // doesn't work -> maybe also faster - - var nr_lines = 4; // 4 rows: hour (hr), minute (min), day (day), month (mon) - - // Arrays: [hr, min, day, mon] - //No of Bits: 5 6 5 4 - let msbits = [4, 5, 4, 3]; // MSB = No bits - 1 - let rad = [12, 12, 8, 8]; // radiuses for each row - var x_dist = 28; - let y_dist = [0, 30, 60, 85]; // y-position from y_centr for each row from top - // don't calc. automatic as for x, because of different spaces - var x_offs_rgt = 16; // distance from right border (layout) - - // Date-Time-Array: 4x6 Bit - //var idx_hr = 0; - //var idx_min = 1; - //var idx_day = 2; - //var idx_mon = 3; - var dt_bit_arr = [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]]; - - var date_time = new Date(); - var hr = date_time.getHours(); // 0..23 - var min = date_time.getMinutes(); // 0..59 - var day = date_time.getDate(); // 1..31 - var mon = date_time.getMonth() + 1; // GetMonth() -> 0..11 - - let dt_array = [hr, min, day, mon]; - - -//////////////////////////////////////// -// compute bit-pattern from time/date and draw leds -//////////////////////////////////////// - var line_cnt = 0; - var cnt = 0; - var bit_cnt = 0; - - while (line_cnt < nr_lines) - { - - //////////////////////////////////////// - // compute bit-pattern - bit_cnt = msbits[line_cnt]; - - while (bit_cnt >= 0) - { - if (dt_array[line_cnt] >= pot_2[bit_cnt]) - { - dt_array[line_cnt] -= pot_2[bit_cnt]; - dt_bit_arr[line_cnt][bit_cnt] = 1; - } - else - { - dt_bit_arr[line_cnt][bit_cnt] = 0; - } - bit_cnt--; - } - - //////////////////////////////////////// - // draw leds (first white border for black screen, then led itself) - cnt = 0; - - while (cnt <= msbits[line_cnt]) - { - g.setColor(bord_col[0], bord_col[1], bord_col[2]); - g.drawCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-20+y_dist[line_cnt], rad[line_cnt]); - - if (dt_bit_arr[line_cnt][cnt] == 1) - { - g.setColor(col[line_cnt][0], col[line_cnt][1], col[line_cnt][2]); - } - else - { - g.setColor(col_off[0], col_off[1], col_off[2]); - } - g.fillCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-20+y_dist[line_cnt], rad[line_cnt]-1); - cnt++; - } - line_cnt++; - } - - // queue next draw - if (drawTimeout) clearTimeout(drawTimeout); - drawTimeout = setTimeout(function() - { - drawTimeout = undefined; - draw(); - }, 60000 - (Date.now() % 60000)); - }; - - // Show launcher when middle button pressed - Bangle.setUI( - { - mode : "clock", - remove : function() - { - // Called to unload all of the clock app - if (drawTimeout) clearTimeout(drawTimeout); - drawTimeout = undefined; - } - }); - // Load widgets - Bangle.loadWidgets(); - draw(); - setTimeout(Bangle.drawWidgets,0); + const SETTINGSFILE = "BinaryClk.settings.json"; + + // variables defined from settings + let HourCol; + let MinCol; + let DayCol; + let MonCol; + let RingOn; + + // color arrays + // !!! don't change order unless change oder in BinaryClk.settings.js !!! + // !!! order must correspond to each other between arrays !!! + let LED_Colors = ["#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000"]; + let LED_ColorNames = ["white", "red", "green", "blue", "yellow", "magenta", "cyan", "black"]; + + // load settings + let loadSettings = function() + { + function def (value, def) {return value !== undefined ? value : def;} + + var settings = require('Storage').readJSON(SETTINGSFILE, true) || {}; + // get name from setting, find index of name and assign corresponding color code by index + HourCol = LED_Colors[LED_ColorNames.indexOf(def(settings.HourCol, "red"))]; + MinCol = LED_Colors[LED_ColorNames.indexOf(def(settings.MinCol, "green"))]; + DayCol = LED_Colors[LED_ColorNames.indexOf(def(settings.DayCol, "yellow"))]; + MonCol = LED_Colors[LED_ColorNames.indexOf(def(settings.MonCol, "yellow"))]; + RingOn = def(settings.RingOn, true); + + delete settings; // settings in local var -> no more required + } + + + function getTemperature() + { + try + { + var temperature = E.getTemperature(); + var formatted = require("locale").temp(temperature).replace(/[^\d-]/g, ''); + return formatted; + } + catch(ex) + { + print(ex); + return "?"; + } + } + + function getSteps() + { + var steps = Bangle.getHealthStatus("day").steps; + return steps; + } + + + let drawTimeout; + + // actually draw the watch face + let draw = function() + { + // Bangle.js2 -> 176x176 + var x_rgt = g.getWidth(); + var y_bot = g.getHeight(); + var x_cntr = x_rgt / 2; + var y_cntr = y_bot / 18*7; + g.reset().clearRect(Bangle.appRect); // clear whole background (w/o widgets) + + var white = "#FFF"; + var black = "#000"; + var bord_col = white; + var col_off = black; + + var col = new Array(HourCol, MinCol, DayCol, MonCol); // each #rgb + if (g.theme.dark) + { + bord_col = white; + col_off = black; + } + else + { + bord_col = black; + col_off = white; + } + + let pwr2 = [1, 2, 4, 8, 16, 32]; // array with powers of 2, because poweroperator '**' doesnt work + // maybe also faster + + + var no_lines = 4; // 4 rows: hour (hr), minute (min), day (day), month (mon) + var no_hour = 5; + var no_min = 6; + var no_day = 5; + var no_mon = 4; + + // arrays: [hr, min, day, mon] + let msbits = [no_hour-1, no_min-1, no_day-1, no_mon-1]; // MSB = No bits - 1 + let rad = [13, 13, 9, 9]; // radiuses for each row + var x_dist = 29; + let y_dist = [0, 35, 75, 100]; // y-position from y_centr for each row from top + // don't calc. automatic as for x, because of different spaces + var x_offs_rgt = 15; // offset from right border (layout) + var y_offs_cntr = 25; // vertical offset from center + + //////////////////////////////////////// + // compute bit-pattern from time/date and draw leds + //////////////////////////////////////// + + // date-time-array: 4x6 bit + var idx_hour = 0; + var idx_min = 1; + var idx_day = 2; + var idx_mon = 3; + var dt_bit_arr = [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]]; + + var date_time = new Date(); + var hour = date_time.getHours(); // 0..23 + var min = date_time.getMinutes(); // 0..59 + var day = date_time.getDate(); // 1..31 + var mon = date_time.getMonth() + 1; // GetMonth() -> 0..11 + + let dt_array = [hour, min, day, mon]; + + var line_cnt = 0; + var cnt = 0; + var bit_cnt = 0; + + while (line_cnt < no_lines) + { + + //////////////////////////////////////// + // compute bit-pattern + bit_cnt = msbits[line_cnt]; + + while (bit_cnt >= 0) + { + if (dt_array[line_cnt] >= pwr2[bit_cnt]) + { + dt_array[line_cnt] -= pwr2[bit_cnt]; + dt_bit_arr[line_cnt][bit_cnt] = 1; + } + else + { + dt_bit_arr[line_cnt][bit_cnt] = 0; + } + bit_cnt--; + } + + //////////////////////////////////////// + // draw leds (and border, if enabled) + cnt = 0; + + while (cnt <= msbits[line_cnt]) + { + if (RingOn) // draw outer ring, if enabled + { + g.setColor(bord_col); + g.drawCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-y_offs_cntr+y_dist[line_cnt], rad[line_cnt]); + } + if (dt_bit_arr[line_cnt][cnt] == 1) + { + g.setColor(col[line_cnt]); + } + else + { + g.setColor(col_off); + } + g.fillCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-y_offs_cntr+y_dist[line_cnt], rad[line_cnt]-1); + cnt++; + } + line_cnt++; + } + + // queue next draw + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = setTimeout(function() + { + drawTimeout = undefined; + draw(); + }, 60000 - (Date.now() % 60000)); + } + + + // Init the settings of the app + loadSettings(); + + // Show launcher when middle button pressed + Bangle.setUI( + { + mode : "clock", + remove : function() + { + // Called to unload all of the clock app + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = undefined; + } + }); + // Load widgets + Bangle.loadWidgets(); + draw(); + setTimeout(Bangle.drawWidgets,0); } From 2da349874b4fc63ff7f90bd89b3bd143339874b5 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:35:14 +0200 Subject: [PATCH 151/451] Update metadata.json --- apps/blc/metadata.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/blc/metadata.json b/apps/blc/metadata.json index 174926ebca..53dde47e3e 100644 --- a/apps/blc/metadata.json +++ b/apps/blc/metadata.json @@ -1,10 +1,10 @@ { "id":"blc", "name":"Binary LED Clock", - "version": "0.10", - "description": "Binary LED Clock with date", + "version": "0.40", + "description": "a binary LED-Clock with time and date and customizable LED-colors", "icon":"blc-icon.png", - "screenshots": [{"url":"screenshot_blc.bmp"}], + "screenshots": [{"url":"screenshot_blc_1.bmp"},{"url":"screenshot_blc_2.bmp"}], "type": "clock", "tags": "clock", "supports": ["BANGLEJS2"], @@ -12,6 +12,8 @@ "readme": "README.md", "storage": [ {"name":"blc.app.js","url":"blc.js"}, + {"name":"blc.settings.js","url":"blc.settings.js"}, {"name":"blc.img","url":"blc-icon.js","evaluate":true} - ] + ], + "data": [{"name":"blc.settings.json"}] } From ca055b4a31b7cd1676aec5a6a7c7fc774f73525b Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:37:23 +0200 Subject: [PATCH 152/451] upload new screenshots upload new screenshots for V0.4 --- apps/blc/screenshot_blc_1.bmp | Bin 0 -> 92982 bytes apps/blc/screenshot_blc_2.bmp | Bin 0 -> 92982 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/blc/screenshot_blc_1.bmp create mode 100644 apps/blc/screenshot_blc_2.bmp diff --git a/apps/blc/screenshot_blc_1.bmp b/apps/blc/screenshot_blc_1.bmp new file mode 100644 index 0000000000000000000000000000000000000000..8a8c86ce5683649fdda1f9837764aaf13b70081f GIT binary patch literal 92982 zcmeI5;g#Gr42112QbHz|)L^6OXn^=JC^@A>QJk3Z5Vz0T+5246t{1V8`;KmY_l00ck)1V8`;KmY_l00ck) z1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY{38-d@~m)G{M zuD`#ht=F#KDjVHqhSD{`w%&DXdaGW~?TlN~TlJ1r{U}eDu7|eu5_^r)#_N|? z_}Vj#zo)I&uHgd$AOHd&00JNY0w4eaAOHfP1n?)ggm*6pLH*GB^LwkVjFG2H*SfaS z#vIZH*h-cTHO*!<8Wtr_8C`4HvJKpBC)3`1SYg7JIXK?x!|0VMUKZ=FRcv)k&1nN{ zb(V{%bj@(~j6QpitvhTK86 zh6G<+s_gbeL9aZ;y0crwR(Hj=RMCVW5u1V8`;KmY_l00ck) z1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00cl_5d!RAH!8Q!v%xko+z7(( z+=l|OXUuRLwrY3mMI#rCq-=8ZXR z)9LcSY#YG#63F*Pm$vQ-)%roUsm@;WMFIcgLR%VpL`pTIncJVH}xX{f_iR8DA)$D?F4XmUG{%JxFFkrH$_QGC+HHK+yW0S00qVNhv4FP zm{7Ss=*vvc~c^kr1fy9#UXFUTyq7+lTu0GH zPrePv9B4bS=i3wk!c8+#5Nre3QZTk0)%63>As3&;ez&cD!;-R@Rub!LP1^vr`c#w3 zXPKLe2H7^(Tk^rC5T;}I4u zrkS{9hI0h&>%unf$nLaJ0Ra#I0T2KI5C8!X009sH0T2KI5CDOV2;c`t>9F>K5Yb() zpF=i(sQMDv79Y+U3dHq>vxb5%U@LCHrI_fY_k`v;l-f1*V!bl0trzQ++u3T*U`D6v zglo6VEQ2{a5SVC&GG&L&A)}4JbTgnOY@pXyAKzOa^@I4`SuC1phz?@$yV;udYZ4!L zA2mby?F2g}c58}MisycwU$0sK|i1$&IUn0BoMxD zJ#wQ#>&K(ZNu>6X}RpNOj_FwqifZwNOeaD2B? zb%p8snqI6|Cc1jDUb&rZbeAP`2fb!jyacu&!&yUtxZZHqQ1At8#VxoO3rY6%`6|qC z?!4|XV0&kR3J8Dz2!H?xfB*=900@8p2!H?xfB*=9z?uZapJfFVhXnHfVIci%7_ZL} z2s(PvcDT#Z51p0}ZCP=+3IrVj1!hO!@<_Q#>4ef1_jTF1cW&=z4m&`SrD9*LZYUrJ+e>>W4C}Z;uK;`QpT@Y+4cF ztB%0sq~6{S>~o+#N%ko1rgiSEx()zT7XqK{hvSt0|5%`YxHrS0yqtW!jmraasTCOO z2)wf&>Qk%J(dn0yq}y7P#`W|xuAg=u)iR8S1PaMh7X1C9J~bAs^Z1x`x0a{XicMWzb1}30&z~ z^-6-_n7{>N@b`;W8tQ>GNH4k-^_RevqE)XX7>)^CFn*#R>eDa%kV4l*wuejL>RGE^ zNiZA}xL|yHKd^JBen`35BihL&FjccYzp4U;GXyRe-`)=_aebcsekif;Uzs6ptpqOp zV4bYiD_5a@Xf;Dw@ZJVWe|6sPD|`=0cb6{PAFY56hja} WAmZFxp2Ph3WEdiX00cnbPT)WNq@{)c literal 0 HcmV?d00001 diff --git a/apps/blc/screenshot_blc_2.bmp b/apps/blc/screenshot_blc_2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..ee07e3bb3942b81c845a5e4258b0f5c1bc84f00c GIT binary patch literal 92982 zcmeI3VV2uA41|+g^awpc4$%KSNiNqLwxndCGz5wO1lXiKe%dTa4+h{zNZ#yA{`&jZ z@1H;F>sR^uvwZ#Y`1<+dk1{H+$NT$a|MOqGKmY_l00ck)1V8`;KmY_l00ck)1V8`; zKmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1ipqq`+o|` zIBMUpjUxFnpY8NZ1Mur+SM&pH1!h7o$TTY-bxoNA+K8bAGtN@|y4F?cSh(^OG zX+ks_$u=GW%QF9TLpR{CH--taUaVIZn0m2ZdDzB7nE&*p3RN7AXN6?&32T5*PjS16 z3@DU0ol-`9q|_^AF57qrRK`*R1BcIjL;ynV+3j{SqZr<#LxFg|45NmE8@BNf#9}62 z+z7{`$UHbR(P1%35X^;65Rimocm(3shfzbp4cqveLM&$TMf5{Cpd<*BAH7&!5{k?l zS=`6f;;@(`2v;>t{hs+zIrVOw#R0+tob~P)-fp|EQbwnz)GK8!TSH4&%bCfbf8}b-Rj&>Auj5^~zGQUaVIhw($@geK|wOhHgN^gm>SRCPbrQh%_M@jbs}S zfn`}}x-k@hIM}wk?uGZ(+t`b7FTA&YVb#91g~vl^Q>-;EK-yPS@vUbWf2VEKuHgd$ zAOHd&00JNY0w4eaAOHfX1n@Vwf_E(lN&V3K`+IL)Sw;;PeiLK(6|tBo(N@YA03pFv zvJ6<$Y*wRTrSy)hZI8KZ*#=HiXSF9Ew&1X34uMmBF?wYwuZpF|!g+BPTOCt#wF$O5 z%gI!_W_YxRzV;+reE}b>G20LYdK{@wF$Ns%W1ThW-vS=l5D5J_TEC2 zea?y;Mpc3R;NEG=cBq)Ds#W+f$B4iKNJY|*O0B<(h%XxK8!*?lrtDo z63@vOC0aQaec6XmRe&hBxxYQN%+DaP>s5Ze?vJ74;8*g7x z?yYAT!!{5?6ioPl00@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p z2!H?xfB*=9z$66NKR4Q^_iKY~VYm>4;kge5V$VDX6coK{Q;4w_i^F1u0?|CR+Ae{k zPsEZg7L%$i8H@8p-u5lMa<{#L&~}KrfEBAvf{p;k`?H#3f=+}$vm;#z%XYx#gWw|ct;$7yGSMA+X>p;k`-ElE87Ywi8Vm^6zhf1A`jCbzt5(GUCSZl!?VOPpRk)Q=YjUJYGYdB1R=u~{Xn-sUiW4k zTvD|y4I29f>~`Bt0?K~AFUZzcBt^Zr+Pf{$fskQKh>`|3Yfh@FXPZ>*TDCnnQR{9R zQ3aTMlB!+H)$L$}uS)exFV-tda=louT+UW~2zH^m8UF7LdlE#f zLBP=rd&nBwLzNZ+?q)zsSTHZ4t)H#;F7eY@Tr>d@9mK_Nvo-D4B(8WPE_O_8YAUG} zGaoi>m8LQCVN;V;D`q}y+A2-sC?8GInk(XBHM6Ov5>dl^*i;PBEHWQ9)i{V6=EJ69 zh-NX$N0Te086GC8d=Sk`pf+CIMQu!jke!no4ZhhnWbZwbN;vMK^P)j7uW6m!XkZHO ziOG!yJ*8=#+-P75?}=mGuCkyX3W2y69UKipykp&ZCDkl(7u8IIUS88WxzWHB-V>7> z4SGt`I=Run6y6iZx?N>KKj8Ur^hfQwxQlw221lM--^q;zx9pB!a-+fV&aLm{MuS^+ zM{um$;mW_)EO8grOaq?JH77S3xNLY3xzT_tTyt`xfy;&m#kz6#b{^Lctt-Zh5~z(A zaj^zwQ#Tyu!=~S9>)y2{uo8~A*h#UerV>%ZeArYB(JV3_Hq|(Y8s@{MVu)rj%14u{ zXllB9msqg4s4Quhi4Nl8x7nKZ>k;4U2Tw-COisYv5|i%><+%wsTEd+Rfh!QGpU%3= z^f|5<>y-tkUaVIxXPezt1zn}rza9c(9mA-hKukD{8VWwZR@_4P;!cwNc|Qv?^qtqa z4A`ETU Date: Thu, 12 Sep 2024 16:39:19 +0200 Subject: [PATCH 153/451] add settings files add settings files for V4.0 --- apps/blc/blc.settings.js | 72 ++++++++++++++++++++++++++++++++++++++ apps/blc/blc.settings.json | 7 ++++ 2 files changed, 79 insertions(+) create mode 100644 apps/blc/blc.settings.js create mode 100644 apps/blc/blc.settings.json diff --git a/apps/blc/blc.settings.js b/apps/blc/blc.settings.js new file mode 100644 index 0000000000..33d6246203 --- /dev/null +++ b/apps/blc/blc.settings.js @@ -0,0 +1,72 @@ +// Change settings for BinaryClk + +(function(back){ + + // color array -- don't change order unless change oder in BinaryClk.js + let LED_ColorNames = ["white", "red", "green", "blue", "yellow", "magenta", "cyan", "black"]; + + var FILE = "BinaryClk.settings.json"; + // Load settings + var settings = Object.assign({ + HourCol: "red", + MinCol: "green", + DayCol: "yellow", + MonCol: "yellow", + RingOn: true, + }, require('Storage').readJSON(FILE, true) || {}); + + function writeSettings(){ + require('Storage').writeJSON(FILE, settings); + } + + // Helper method which uses int-based menu item for set of string values + function stringItems(startvalue, writer, values) { + return{ + value: (startvalue === undefined ? 0 : values.indexOf(startvalue)), + format: v => values[v], + min: 0, + max: values.length - 1, + wrap: true, + step: 1, + onchange: v => { + writer(values[v]); + writeSettings(); + } + }; + } + + // Helper method which breaks string set settings down to local settings object + function stringInSettings(name, values) { + return stringItems(settings[name], v => settings[name] = v, values); + } + + // Show the menu + var mainmenu = { + "" : { + "title" : "BinaryCLK" + }, + "< Back" : () => back(), + 'Color Hour.:': stringInSettings("HourCol", LED_ColorNames), + 'Color Minute:': stringInSettings("MinCol", LED_ColorNames), + 'Color Day': stringInSettings("DayCol", LED_ColorNames), + 'Color Month:': stringInSettings("MonCol", LED_ColorNames), + 'LED ring on/off': { + value: (settings.RingOn !== undefined ? settings.RingOn : true), + onchange: v => { + settings.RingOn = v; + writeSettings(); + } + }, + }; + + // Show submenues + //var submenu1 = { + //"": { + // "title": "Show sub1..." + //}, + //"< Back": () => E.showMenu(mainmenu), + //"ItemName": stringInSettings("settingsVar", ["Yes", "No", "DontCare"]), + //}; + + E.showMenu(mainmenu); +}); diff --git a/apps/blc/blc.settings.json b/apps/blc/blc.settings.json new file mode 100644 index 0000000000..acdb1a78a7 --- /dev/null +++ b/apps/blc/blc.settings.json @@ -0,0 +1,7 @@ +{ + "HourCol": "red", + "MinCol": "green", + "DayCol": "yellow", + "MonCol": "yellow", + "RingOn": true +}; From 5403964960006f27f338275866e9f2f34ec16ed7 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:40:04 +0200 Subject: [PATCH 154/451] Delete apps/blc/screenshot_blc.bmp screenshot is outdated --- apps/blc/screenshot_blc.bmp | Bin 15562 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 apps/blc/screenshot_blc.bmp diff --git a/apps/blc/screenshot_blc.bmp b/apps/blc/screenshot_blc.bmp deleted file mode 100644 index 50b8539bbde952b4b8be2b09aee5ed2691245fc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15562 zcmeHNOOD(i5GC4YH6fMxkIm^qs)?j>7BGNsQx`gr-kqJ?W3C9|*>X9me5r8P2y9VzSzsZ+K&*iel zvx&L#=sJiLmg!K4o6#_mAHs# zlKU0HH39+_rS-&2JB4IzN0n4W>+NXb59v8do+=^DWKttSyWp-{%DFp^#NA8)>P9>2 z(S?rea0#h{V;_=eN4!o2TRqJnnmtvJ#m@2%z>i);fzxi8j{|O^9ZmcgRyvkZpv_yz zLgPUg61aqdyd*Fpv}?SyS)vdsQ$naHBDA|leKGP%h@Nh$pdHP^lTt*1bisMsD?da> zjJ7yzY>q+*Pzw>-(UbW{f1X7&fePmwpLhh>z~#a$JWH1n2TDj?lo}D*@#?UUbKfnS zAofF3q;ps+VBv{u?ENny_Cwe+If&S^2=PAO54wJ7&nWLA+9_M8al9VyTpR`uur+75*LgD}yp&h;Xa=d(R9*=J zlej_PIfQn(6J7{TA3oJ^qlnaDw##{qE-bF9!}AF3a$@JOTh_U_q!Ndx+;wjhKg^7d z_NMo-HLmh?nJdwHngUIMrojKDfK8@J;pgvOZj>P*wNQ9ZRLS6`6{3Hb5PQc<4%3^# z7JWIc;-BI*)?v&0PS+|zH+e{YAT!QiV;!!}dotZFyxmLZbV&an*kVa?9VjABo!hs{ zyxoc7%<5a2*PQ5FSl%1rOn!)?`xB{Wne3f;Z#x%byrP3S*wCeGL&^7zNMzrt^SU^z z&g;%abzURqO#))8zR9L&e(;Gh8D9v6CYtPcZ%ynH`thCD=-Az8xwXxhQQE>w=k4Cg EUtq$(RR910 From 19391a0136a0afaf20dc34d0c32cbf3ee54c9408 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:44:52 +0200 Subject: [PATCH 155/451] Update README.md Added description for new functionalities. --- apps/blc/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/blc/README.md b/apps/blc/README.md index a3581cdc74..3d126bcf83 100644 --- a/apps/blc/README.md +++ b/apps/blc/README.md @@ -9,5 +9,9 @@ From top to bottom the watch face shows four rows of leds: * day (yellow leds, top row) * month (yellow leds, bottom row) -As usual, luminous leds represent a logical one, dark leds a logcal '0'. +The colors are default colors and can be changed at the settings page, also, the outer ring can be disabled. + +The rightmost LED represents 1, the second 2, the third 4, the next 8 and so on, i.e. values are the powers of two. + +As usual, luminous leds represent a logical one, and "dark" leds a logcal '0'. Dark means the color of the background. Widgets aren't affected and are shown as normal. From 8bd5f3e56f79bc3a9fb2c5d9b58ff27ec6c35293 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:46:40 +0200 Subject: [PATCH 156/451] Update ChangeLog --- apps/blc/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/blc/ChangeLog b/apps/blc/ChangeLog index 4860c24a6d..6075cacf8d 100644 --- a/apps/blc/ChangeLog +++ b/apps/blc/ChangeLog @@ -1 +1,4 @@ 0.10: New app introduced to the app loader! +0.20: skipped (internal revision) +0.30: skipped (internal revision) +0.40: added functionality for customizing colors From 8336e4e7c52882d494dc05e222bff96f07dee7e1 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:02:07 +0200 Subject: [PATCH 157/451] Update blc.settings.js removed space/tab mix --- apps/blc/blc.settings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/blc/blc.settings.js b/apps/blc/blc.settings.js index 33d6246203..be10d9e894 100644 --- a/apps/blc/blc.settings.js +++ b/apps/blc/blc.settings.js @@ -62,10 +62,10 @@ // Show submenues //var submenu1 = { //"": { - // "title": "Show sub1..." - //}, - //"< Back": () => E.showMenu(mainmenu), - //"ItemName": stringInSettings("settingsVar", ["Yes", "No", "DontCare"]), + // "title": "Show sub1..." + //}, + //"< Back": () => E.showMenu(mainmenu), + //"ItemName": stringInSettings("settingsVar", ["Yes", "No", "DontCare"]), //}; E.showMenu(mainmenu); From 3bdaad5fa44ca519f6fef95ec3cf3c2afecb57fd Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:02:53 +0200 Subject: [PATCH 158/451] Update blc.js removed unused variables and cleaned tab/space-mix --- apps/blc/blc.js | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/apps/blc/blc.js b/apps/blc/blc.js index b12492a5ee..51663e5026 100644 --- a/apps/blc/blc.js +++ b/apps/blc/blc.js @@ -34,30 +34,7 @@ delete settings; // settings in local var -> no more required } - - function getTemperature() - { - try - { - var temperature = E.getTemperature(); - var formatted = require("locale").temp(temperature).replace(/[^\d-]/g, ''); - return formatted; - } - catch(ex) - { - print(ex); - return "?"; - } - } - - function getSteps() - { - var steps = Bangle.getHealthStatus("day").steps; - return steps; - } - - - let drawTimeout; + let drawTimeout; // actually draw the watch face let draw = function() @@ -65,7 +42,7 @@ // Bangle.js2 -> 176x176 var x_rgt = g.getWidth(); var y_bot = g.getHeight(); - var x_cntr = x_rgt / 2; + //var x_cntr = x_rgt / 2; var y_cntr = y_bot / 18*7; g.reset().clearRect(Bangle.appRect); // clear whole background (w/o widgets) @@ -110,10 +87,10 @@ //////////////////////////////////////// // date-time-array: 4x6 bit - var idx_hour = 0; - var idx_min = 1; - var idx_day = 2; - var idx_mon = 3; + //var idx_hour = 0; + //var idx_min = 1; + //var idx_day = 2; + //var idx_mon = 3; var dt_bit_arr = [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]]; var date_time = new Date(); From b5491e1371f03e96e3f066eec358e8ce2315d0fc Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:05:12 +0200 Subject: [PATCH 159/451] Update blc.js --- apps/blc/blc.js | 352 ++++++++++++++++++++++++------------------------ 1 file changed, 176 insertions(+), 176 deletions(-) diff --git a/apps/blc/blc.js b/apps/blc/blc.js index 51663e5026..6015bc548a 100644 --- a/apps/blc/blc.js +++ b/apps/blc/blc.js @@ -3,180 +3,180 @@ { // must be inside our own scope here so that when we are unloaded everything disappears // we also define functions using 'let fn = function() {..}' for the same reason. function decls are global - const SETTINGSFILE = "BinaryClk.settings.json"; - - // variables defined from settings - let HourCol; - let MinCol; - let DayCol; - let MonCol; - let RingOn; - - // color arrays - // !!! don't change order unless change oder in BinaryClk.settings.js !!! - // !!! order must correspond to each other between arrays !!! - let LED_Colors = ["#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000"]; - let LED_ColorNames = ["white", "red", "green", "blue", "yellow", "magenta", "cyan", "black"]; - - // load settings - let loadSettings = function() - { - function def (value, def) {return value !== undefined ? value : def;} - - var settings = require('Storage').readJSON(SETTINGSFILE, true) || {}; - // get name from setting, find index of name and assign corresponding color code by index - HourCol = LED_Colors[LED_ColorNames.indexOf(def(settings.HourCol, "red"))]; - MinCol = LED_Colors[LED_ColorNames.indexOf(def(settings.MinCol, "green"))]; - DayCol = LED_Colors[LED_ColorNames.indexOf(def(settings.DayCol, "yellow"))]; - MonCol = LED_Colors[LED_ColorNames.indexOf(def(settings.MonCol, "yellow"))]; - RingOn = def(settings.RingOn, true); - - delete settings; // settings in local var -> no more required - } - - let drawTimeout; - - // actually draw the watch face - let draw = function() - { - // Bangle.js2 -> 176x176 - var x_rgt = g.getWidth(); - var y_bot = g.getHeight(); - //var x_cntr = x_rgt / 2; - var y_cntr = y_bot / 18*7; - g.reset().clearRect(Bangle.appRect); // clear whole background (w/o widgets) - - var white = "#FFF"; - var black = "#000"; - var bord_col = white; - var col_off = black; - - var col = new Array(HourCol, MinCol, DayCol, MonCol); // each #rgb - if (g.theme.dark) - { - bord_col = white; - col_off = black; - } - else - { - bord_col = black; - col_off = white; - } - - let pwr2 = [1, 2, 4, 8, 16, 32]; // array with powers of 2, because poweroperator '**' doesnt work - // maybe also faster - - - var no_lines = 4; // 4 rows: hour (hr), minute (min), day (day), month (mon) - var no_hour = 5; - var no_min = 6; - var no_day = 5; - var no_mon = 4; - - // arrays: [hr, min, day, mon] - let msbits = [no_hour-1, no_min-1, no_day-1, no_mon-1]; // MSB = No bits - 1 - let rad = [13, 13, 9, 9]; // radiuses for each row - var x_dist = 29; - let y_dist = [0, 35, 75, 100]; // y-position from y_centr for each row from top - // don't calc. automatic as for x, because of different spaces - var x_offs_rgt = 15; // offset from right border (layout) - var y_offs_cntr = 25; // vertical offset from center - - //////////////////////////////////////// - // compute bit-pattern from time/date and draw leds - //////////////////////////////////////// - - // date-time-array: 4x6 bit - //var idx_hour = 0; - //var idx_min = 1; - //var idx_day = 2; - //var idx_mon = 3; - var dt_bit_arr = [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]]; - - var date_time = new Date(); - var hour = date_time.getHours(); // 0..23 - var min = date_time.getMinutes(); // 0..59 - var day = date_time.getDate(); // 1..31 - var mon = date_time.getMonth() + 1; // GetMonth() -> 0..11 - - let dt_array = [hour, min, day, mon]; - - var line_cnt = 0; - var cnt = 0; - var bit_cnt = 0; - - while (line_cnt < no_lines) - { - - //////////////////////////////////////// - // compute bit-pattern - bit_cnt = msbits[line_cnt]; - - while (bit_cnt >= 0) - { - if (dt_array[line_cnt] >= pwr2[bit_cnt]) - { - dt_array[line_cnt] -= pwr2[bit_cnt]; - dt_bit_arr[line_cnt][bit_cnt] = 1; - } - else - { - dt_bit_arr[line_cnt][bit_cnt] = 0; - } - bit_cnt--; - } - - //////////////////////////////////////// - // draw leds (and border, if enabled) - cnt = 0; - - while (cnt <= msbits[line_cnt]) - { - if (RingOn) // draw outer ring, if enabled - { - g.setColor(bord_col); - g.drawCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-y_offs_cntr+y_dist[line_cnt], rad[line_cnt]); - } - if (dt_bit_arr[line_cnt][cnt] == 1) - { - g.setColor(col[line_cnt]); - } - else - { - g.setColor(col_off); - } - g.fillCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-y_offs_cntr+y_dist[line_cnt], rad[line_cnt]-1); - cnt++; - } - line_cnt++; - } - - // queue next draw - if (drawTimeout) clearTimeout(drawTimeout); - drawTimeout = setTimeout(function() - { - drawTimeout = undefined; - draw(); - }, 60000 - (Date.now() % 60000)); - } - - - // Init the settings of the app - loadSettings(); - - // Show launcher when middle button pressed - Bangle.setUI( - { - mode : "clock", - remove : function() - { - // Called to unload all of the clock app - if (drawTimeout) clearTimeout(drawTimeout); - drawTimeout = undefined; - } - }); - // Load widgets - Bangle.loadWidgets(); - draw(); - setTimeout(Bangle.drawWidgets,0); + const SETTINGSFILE = "BinaryClk.settings.json"; + + // variables defined from settings + let HourCol; + let MinCol; + let DayCol; + let MonCol; + let RingOn; + + // color arrays + // !!! don't change order unless change oder in BinaryClk.settings.js !!! + // !!! order must correspond to each other between arrays !!! + let LED_Colors = ["#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000"]; + let LED_ColorNames = ["white", "red", "green", "blue", "yellow", "magenta", "cyan", "black"]; + + // load settings + let loadSettings = function() + { + function def (value, def) {return value !== undefined ? value : def;} + + var settings = require('Storage').readJSON(SETTINGSFILE, true) || {}; + // get name from setting, find index of name and assign corresponding color code by index + HourCol = LED_Colors[LED_ColorNames.indexOf(def(settings.HourCol, "red"))]; + MinCol = LED_Colors[LED_ColorNames.indexOf(def(settings.MinCol, "green"))]; + DayCol = LED_Colors[LED_ColorNames.indexOf(def(settings.DayCol, "yellow"))]; + MonCol = LED_Colors[LED_ColorNames.indexOf(def(settings.MonCol, "yellow"))]; + RingOn = def(settings.RingOn, true); + + delete settings; // settings in local var -> no more required + } + + let drawTimeout; + + // actually draw the watch face + let draw = function() + { + // Bangle.js2 -> 176x176 + var x_rgt = g.getWidth(); + var y_bot = g.getHeight(); + //var x_cntr = x_rgt / 2; + var y_cntr = y_bot / 18*7; + g.reset().clearRect(Bangle.appRect); // clear whole background (w/o widgets) + + var white = "#FFF"; + var black = "#000"; + var bord_col = white; + var col_off = black; + + var col = new Array(HourCol, MinCol, DayCol, MonCol); // each #rgb + if (g.theme.dark) + { + bord_col = white; + col_off = black; + } + else + { + bord_col = black; + col_off = white; + } + + let pwr2 = [1, 2, 4, 8, 16, 32]; // array with powers of 2, because poweroperator '**' doesnt work + // maybe also faster + + + var no_lines = 4; // 4 rows: hour (hr), minute (min), day (day), month (mon) + var no_hour = 5; + var no_min = 6; + var no_day = 5; + var no_mon = 4; + + // arrays: [hr, min, day, mon] + let msbits = [no_hour-1, no_min-1, no_day-1, no_mon-1]; // MSB = No bits - 1 + let rad = [13, 13, 9, 9]; // radiuses for each row + var x_dist = 29; + let y_dist = [0, 35, 75, 100]; // y-position from y_centr for each row from top + // don't calc. automatic as for x, because of different spaces + var x_offs_rgt = 15; // offset from right border (layout) + var y_offs_cntr = 25; // vertical offset from center + + //////////////////////////////////////// + // compute bit-pattern from time/date and draw leds + //////////////////////////////////////// + + // date-time-array: 4x6 bit + //var idx_hour = 0; + //var idx_min = 1; + //var idx_day = 2; + //var idx_mon = 3; + var dt_bit_arr = [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]]; + + var date_time = new Date(); + var hour = date_time.getHours(); // 0..23 + var min = date_time.getMinutes(); // 0..59 + var day = date_time.getDate(); // 1..31 + var mon = date_time.getMonth() + 1; // GetMonth() -> 0..11 + + let dt_array = [hour, min, day, mon]; + + var line_cnt = 0; + var cnt = 0; + var bit_cnt = 0; + + while (line_cnt < no_lines) + { + + //////////////////////////////////////// + // compute bit-pattern + bit_cnt = msbits[line_cnt]; + + while (bit_cnt >= 0) + { + if (dt_array[line_cnt] >= pwr2[bit_cnt]) + { + dt_array[line_cnt] -= pwr2[bit_cnt]; + dt_bit_arr[line_cnt][bit_cnt] = 1; + } + else + { + dt_bit_arr[line_cnt][bit_cnt] = 0; + } + bit_cnt--; + } + + //////////////////////////////////////// + // draw leds (and border, if enabled) + cnt = 0; + + while (cnt <= msbits[line_cnt]) + { + if (RingOn) // draw outer ring, if enabled + { + g.setColor(bord_col); + g.drawCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-y_offs_cntr+y_dist[line_cnt], rad[line_cnt]); + } + if (dt_bit_arr[line_cnt][cnt] == 1) + { + g.setColor(col[line_cnt]); + } + else + { + g.setColor(col_off); + } + g.fillCircle(x_rgt-x_offs_rgt-cnt*x_dist, y_cntr-y_offs_cntr+y_dist[line_cnt], rad[line_cnt]-1); + cnt++; + } + line_cnt++; + } + + // queue next draw + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = setTimeout(function() + { + drawTimeout = undefined; + draw(); + }, 60000 - (Date.now() % 60000)); + } + + + // Init the settings of the app + loadSettings(); + + // Show launcher when middle button pressed + Bangle.setUI( + { + mode : "clock", + remove : function() + { + // Called to unload all of the clock app + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = undefined; + } + }); + // Load widgets + Bangle.loadWidgets(); + draw(); + setTimeout(Bangle.drawWidgets,0); } From 15c2ddb3c99fee0e2ee3742451d8add4b90aaed4 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:05:31 +0200 Subject: [PATCH 160/451] Update blc.settings.js --- apps/blc/blc.settings.js | 126 +++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/apps/blc/blc.settings.js b/apps/blc/blc.settings.js index be10d9e894..270ece0719 100644 --- a/apps/blc/blc.settings.js +++ b/apps/blc/blc.settings.js @@ -1,72 +1,72 @@ // Change settings for BinaryClk (function(back){ - - // color array -- don't change order unless change oder in BinaryClk.js - let LED_ColorNames = ["white", "red", "green", "blue", "yellow", "magenta", "cyan", "black"]; + + // color array -- don't change order unless change oder in BinaryClk.js + let LED_ColorNames = ["white", "red", "green", "blue", "yellow", "magenta", "cyan", "black"]; - var FILE = "BinaryClk.settings.json"; - // Load settings - var settings = Object.assign({ - HourCol: "red", - MinCol: "green", - DayCol: "yellow", - MonCol: "yellow", - RingOn: true, - }, require('Storage').readJSON(FILE, true) || {}); + var FILE = "BinaryClk.settings.json"; + // Load settings + var settings = Object.assign({ + HourCol: "red", + MinCol: "green", + DayCol: "yellow", + MonCol: "yellow", + RingOn: true, + }, require('Storage').readJSON(FILE, true) || {}); - function writeSettings(){ - require('Storage').writeJSON(FILE, settings); - } + function writeSettings(){ + require('Storage').writeJSON(FILE, settings); + } - // Helper method which uses int-based menu item for set of string values - function stringItems(startvalue, writer, values) { - return{ - value: (startvalue === undefined ? 0 : values.indexOf(startvalue)), - format: v => values[v], - min: 0, - max: values.length - 1, - wrap: true, - step: 1, - onchange: v => { - writer(values[v]); - writeSettings(); - } - }; - } + // Helper method which uses int-based menu item for set of string values + function stringItems(startvalue, writer, values) { + return{ + value: (startvalue === undefined ? 0 : values.indexOf(startvalue)), + format: v => values[v], + min: 0, + max: values.length - 1, + wrap: true, + step: 1, + onchange: v => { + writer(values[v]); + writeSettings(); + } + }; + } - // Helper method which breaks string set settings down to local settings object - function stringInSettings(name, values) { - return stringItems(settings[name], v => settings[name] = v, values); - } + // Helper method which breaks string set settings down to local settings object + function stringInSettings(name, values) { + return stringItems(settings[name], v => settings[name] = v, values); + } - // Show the menu - var mainmenu = { - "" : { - "title" : "BinaryCLK" - }, - "< Back" : () => back(), - 'Color Hour.:': stringInSettings("HourCol", LED_ColorNames), - 'Color Minute:': stringInSettings("MinCol", LED_ColorNames), - 'Color Day': stringInSettings("DayCol", LED_ColorNames), - 'Color Month:': stringInSettings("MonCol", LED_ColorNames), - 'LED ring on/off': { - value: (settings.RingOn !== undefined ? settings.RingOn : true), - onchange: v => { - settings.RingOn = v; - writeSettings(); - } - }, - }; - - // Show submenues - //var submenu1 = { - //"": { - // "title": "Show sub1..." - //}, - //"< Back": () => E.showMenu(mainmenu), - //"ItemName": stringInSettings("settingsVar", ["Yes", "No", "DontCare"]), - //}; - - E.showMenu(mainmenu); + // Show the menu + var mainmenu = { + "" : { + "title" : "BinaryCLK" + }, + "< Back" : () => back(), + 'Color Hour.:': stringInSettings("HourCol", LED_ColorNames), + 'Color Minute:': stringInSettings("MinCol", LED_ColorNames), + 'Color Day': stringInSettings("DayCol", LED_ColorNames), + 'Color Month:': stringInSettings("MonCol", LED_ColorNames), + 'LED ring on/off': { + value: (settings.RingOn !== undefined ? settings.RingOn : true), + onchange: v => { + settings.RingOn = v; + writeSettings(); + } + }, + }; + + // Show submenues + //var submenu1 = { + //"": { + // "title": "Show sub1..." + //}, + //"< Back": () => E.showMenu(mainmenu), + //"ItemName": stringInSettings("settingsVar", ["Yes", "No", "DontCare"]), + //}; + + E.showMenu(mainmenu); }); From b7b23b83f1adb4b26c4bd49352f6a298dfb8ce16 Mon Sep 17 00:00:00 2001 From: aemkai <87898467+aemkai@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:08:26 +0200 Subject: [PATCH 161/451] Update blc.settings.js --- apps/blc/blc.settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/blc/blc.settings.js b/apps/blc/blc.settings.js index 270ece0719..00e9c284bb 100644 --- a/apps/blc/blc.settings.js +++ b/apps/blc/blc.settings.js @@ -43,7 +43,7 @@ // Show the menu var mainmenu = { "" : { - "title" : "BinaryCLK" + "title" : "BinaryCLK" }, "< Back" : () => back(), 'Color Hour.:': stringInSettings("HourCol", LED_ColorNames), From 8aa839be26dfca48c32381659d7d31e9cc5acf7d Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Tue, 10 Sep 2024 22:05:03 +0100 Subject: [PATCH 162/451] promenu: factor out `drawLine()` --- apps/promenu/bootb2.ts | 80 ++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/apps/promenu/bootb2.ts b/apps/promenu/bootb2.ts index 11ae56e1bf..1b4781b6cb 100644 --- a/apps/promenu/bootb2.ts +++ b/apps/promenu/bootb2.ts @@ -39,6 +39,49 @@ E.showMenu = (items?: Menu): MenuInstance => { scroll: selected, }; + const drawLine = ( + name: string, + v: string, + item: ActualMenuItem, + idx: number, + x: number, + y: number, + ) => { + const hl = (idx === selected && !selectEdit); + if(g.theme.dark){ + fillRectRnd(x, y, x2, y + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg + 40); + }else{ + fillRectRnd(x, y, x2, y + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg - 20); + } + + g.setFont12x20() + .setColor(hl ? g.theme.fgH : g.theme.fg) + .setFontAlign(-1, -1); + + const vplain = v.indexOf("\0") < 0; + if(vplain && name.length >= 17 - v.length && typeof item === "object"){ + g.drawString(name.substring(0, 12 - v.length) + "...", x + 3.7, y + 2.7); + }else if(vplain && name.length >= 15){ + g.drawString(name.substring(0, 15) + "...", x + 3.7, y + 2.7); + }else{ + g.drawString(name, x + 3.7, y + 2.7); + } + + let xo = x2; + if (selectEdit && idx === selected) { + xo -= 24 + 1; + g.setColor(g.theme.fgH) + .drawImage( + "\x0c\x05\x81\x00 \x07\x00\xF9\xF0\x0E\x00@", + xo, + y + (fontHeight - 10) / 2, + {scale:2}, + ); + } + g.setFontAlign(1, -1); + g.drawString(v, xo - 2, y + 1); + }; + const l = { draw: (rowmin?: number, rowmax?: number) => { let rows = 0|Math.min((y2 - y) / fontHeight, menuItems.length); @@ -66,17 +109,7 @@ E.showMenu = (items?: Menu): MenuInstance => { const name = menuItems[idx]; const item = items![name]! as ActualMenuItem; - const hl = (idx === selected && !selectEdit); - if(g.theme.dark){ - fillRectRnd(x, iy, x2, iy + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg + 40); - }else{ - fillRectRnd(x, iy, x2, iy + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg - 20); - } - - g.setColor(hl ? g.theme.fgH : g.theme.fg); - g.setFontAlign( - 1, -1); - - let v; + let v: string; if (typeof item === "object") { v = "format" in item ? (item.format as any)(item.value) // format(), value: T @@ -86,30 +119,7 @@ E.showMenu = (items?: Menu): MenuInstance => { v = ""; } - /*???*/{ - const vplain = v.indexOf("\0") < 0; - if(vplain && name.length >= 17 - v.length && typeof item === "object"){ - g.drawString(name.substring(0, 12 - v.length) + "...", x + 3.7, iy + 2.7); - }else if(vplain && name.length >= 15){ - g.drawString(name.substring(0, 15) + "...", x + 3.7, iy + 2.7); - }else{ - g.drawString(name, x + 3.7, iy + 2.7); - } - - let xo = x2; - if (selectEdit && idx === selected) { - xo -= 24 + 1; - g.setColor(g.theme.fgH) - .drawImage( - "\x0c\x05\x81\x00 \x07\x00\xF9\xF0\x0E\x00@", - xo, - iy + (fontHeight - 10) / 2, - {scale:2}, - ); - } - g.setFontAlign(1, -1); - g.drawString(v, xo - 2, iy + 1); - } + drawLine(name, v, item, idx, x, iy); g.setColor(g.theme.fg); iy += fontHeight; From 4061b419c61af1f8815147b61db6843e83341f27 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 12 Sep 2024 18:22:37 +0100 Subject: [PATCH 163/451] promenu: scroll truncated menu lines --- apps/promenu/bootb2.ts | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/apps/promenu/bootb2.ts b/apps/promenu/bootb2.ts index 1b4781b6cb..269bbdffa0 100644 --- a/apps/promenu/bootb2.ts +++ b/apps/promenu/bootb2.ts @@ -38,6 +38,7 @@ E.showMenu = (items?: Menu): MenuInstance => { const scroller = { scroll: selected, }; + let nameScroller: IntervalId | null = null; const drawLine = ( name: string, @@ -46,6 +47,7 @@ E.showMenu = (items?: Menu): MenuInstance => { idx: number, x: number, y: number, + nameScroll: number = 0, ) => { const hl = (idx === selected && !selectEdit); if(g.theme.dark){ @@ -59,12 +61,14 @@ E.showMenu = (items?: Menu): MenuInstance => { .setFontAlign(-1, -1); const vplain = v.indexOf("\0") < 0; + let truncated = true; if(vplain && name.length >= 17 - v.length && typeof item === "object"){ - g.drawString(name.substring(0, 12 - v.length) + "...", x + 3.7, y + 2.7); + g.drawString(name.substring(nameScroll, nameScroll + 12 - v.length) + "...", x + 3.7, y + 2.7); }else if(vplain && name.length >= 15){ - g.drawString(name.substring(0, 15) + "...", x + 3.7, y + 2.7); + g.drawString(name.substring(nameScroll, nameScroll + 15) + "...", x + 3.7, y + 2.7); }else{ g.drawString(name, x + 3.7, y + 2.7); + truncated = false; } let xo = x2; @@ -80,10 +84,13 @@ E.showMenu = (items?: Menu): MenuInstance => { } g.setFontAlign(1, -1); g.drawString(v, xo - 2, y + 1); + + return truncated; }; const l = { draw: (rowmin?: number, rowmax?: number) => { + if (nameScroller) clearInterval(nameScroller), nameScroller = null; let rows = 0|Math.min((y2 - y) / fontHeight, menuItems.length); let idx = E.clip(selected - (rows>>1), 0, menuItems.length - rows); @@ -119,7 +126,22 @@ E.showMenu = (items?: Menu): MenuInstance => { v = ""; } - drawLine(name, v, item, idx, x, iy); + const truncated = drawLine(name, v, item, idx, x, iy, 0); + if (truncated && idx === selected){ + let nameScroll = 0; + nameScroller = setInterval(( + name: string, + v: string, + item: ActualMenuItem, + idx: number, + x: number, + iy: number, + ) => { + drawLine(name, v, item, idx, x, iy, nameScroll); + nameScroll += 1; + if (nameScroll >= name.length - 5) nameScroll = 0; + }, 300, name, v, item, idx, x, iy); + } g.setColor(g.theme.fg); iy += fontHeight; @@ -201,6 +223,7 @@ E.showMenu = (items?: Menu): MenuInstance => { mode: "updown", back, remove: () => { + if (nameScroller) clearInterval(nameScroller); Bangle.removeListener("swipe", onSwipe); }, } as SetUIArg<"updown">, From aa6e46898f1d605fe1394b8b6abe159ce52b3ef3 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 12 Sep 2024 18:22:47 +0100 Subject: [PATCH 164/451] promenu: generate js --- apps/promenu/bootb2.js | 81 +++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/apps/promenu/bootb2.js b/apps/promenu/bootb2.js index 434f0c07f2..c066cae35a 100644 --- a/apps/promenu/bootb2.js +++ b/apps/promenu/bootb2.js @@ -31,8 +31,45 @@ E.showMenu = function (items) { var scroller = { scroll: selected, }; + var nameScroller = null; + var drawLine = function (name, v, item, idx, x, y, nameScroll) { + if (nameScroll === void 0) { nameScroll = 0; } + var hl = (idx === selected && !selectEdit); + if (g.theme.dark) { + fillRectRnd(x, y, x2, y + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg + 40); + } + else { + fillRectRnd(x, y, x2, y + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg - 20); + } + g.setFont12x20() + .setColor(hl ? g.theme.fgH : g.theme.fg) + .setFontAlign(-1, -1); + var vplain = v.indexOf("\0") < 0; + var truncated = true; + if (vplain && name.length >= 17 - v.length && typeof item === "object") { + g.drawString(name.substring(nameScroll, nameScroll + 12 - v.length) + "...", x + 3.7, y + 2.7); + } + else if (vplain && name.length >= 15) { + g.drawString(name.substring(nameScroll, nameScroll + 15) + "...", x + 3.7, y + 2.7); + } + else { + g.drawString(name, x + 3.7, y + 2.7); + truncated = false; + } + var xo = x2; + if (selectEdit && idx === selected) { + xo -= 24 + 1; + g.setColor(g.theme.fgH) + .drawImage("\x0c\x05\x81\x00 \x07\x00\xF9\xF0\x0E\x00@", xo, y + (fontHeight - 10) / 2, { scale: 2 }); + } + g.setFontAlign(1, -1); + g.drawString(v, xo - 2, y + 1); + return truncated; + }; var l = { draw: function (rowmin, rowmax) { + if (nameScroller) + clearInterval(nameScroller), nameScroller = null; var rows = 0 | Math.min((y2 - y) / fontHeight, menuItems.length); var idx = E.clip(selected - (rows >> 1), 0, menuItems.length - rows); if (idx != lastIdx) @@ -55,18 +92,9 @@ E.showMenu = function (items) { rows = 1 + rowmax - rowmin; } } - while (rows--) { + var _loop_1 = function () { var name = menuItems[idx]; var item = items[name]; - var hl = (idx === selected && !selectEdit); - if (g.theme.dark) { - fillRectRnd(x, iy, x2, iy + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg + 40); - } - else { - fillRectRnd(x, iy, x2, iy + fontHeight - 3, 7, hl ? g.theme.bgH : g.theme.bg - 20); - } - g.setColor(hl ? g.theme.fgH : g.theme.fg); - g.setFontAlign(-1, -1); var v = void 0; if (typeof item === "object") { v = "format" in item @@ -78,29 +106,22 @@ E.showMenu = function (items) { else { v = ""; } - { - var vplain = v.indexOf("\0") < 0; - if (vplain && name.length >= 17 - v.length && typeof item === "object") { - g.drawString(name.substring(0, 12 - v.length) + "...", x + 3.7, iy + 2.7); - } - else if (vplain && name.length >= 15) { - g.drawString(name.substring(0, 15) + "...", x + 3.7, iy + 2.7); - } - else { - g.drawString(name, x + 3.7, iy + 2.7); - } - var xo = x2; - if (selectEdit && idx === selected) { - xo -= 24 + 1; - g.setColor(g.theme.fgH) - .drawImage("\x0c\x05\x81\x00 \x07\x00\xF9\xF0\x0E\x00@", xo, iy + (fontHeight - 10) / 2, { scale: 2 }); - } - g.setFontAlign(1, -1); - g.drawString(v, xo - 2, iy + 1); + var truncated = drawLine(name, v, item, idx, x, iy, 0); + if (truncated && idx === selected) { + var nameScroll_1 = 0; + nameScroller = setInterval(function (name, v, item, idx, x, iy) { + drawLine(name, v, item, idx, x, iy, nameScroll_1); + nameScroll_1 += 1; + if (nameScroll_1 >= name.length - 5) + nameScroll_1 = 0; + }, 300, name, v, item, idx, x, iy); } g.setColor(g.theme.fg); iy += fontHeight; idx++; + }; + while (rows--) { + _loop_1(); } g.setFontAlign(-1, -1); g.setColor((idx < menuItems.length) ? g.theme.fg : g.theme.bg).fillPoly([72, 166, 104, 166, 88, 174]); @@ -170,6 +191,8 @@ E.showMenu = function (items) { mode: "updown", back: back, remove: function () { + if (nameScroller) + clearInterval(nameScroller); Bangle.removeListener("swipe", onSwipe); }, }, function (dir) { From c35dbf0a52d5977f411916f12af7052974c6bc2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:26:43 +0000 Subject: [PATCH 165/451] build(deps): bump webtools from `c594022` to `dcede45` Bumps [webtools](https://github.com/espruino/EspruinoWebTools) from `c594022` to `dcede45`. - [Commits](https://github.com/espruino/EspruinoWebTools/compare/c59402259c779b578e68995ea0237b813fab09c0...dcede4522c6d8236531f070fb53dfcd5f0f7d223) --- updated-dependencies: - dependency-name: webtools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- webtools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webtools b/webtools index c59402259c..dcede4522c 160000 --- a/webtools +++ b/webtools @@ -1 +1 @@ -Subproject commit c59402259c779b578e68995ea0237b813fab09c0 +Subproject commit dcede4522c6d8236531f070fb53dfcd5f0f7d223 From 27450db7a6f72c19e572afc34cc37f5b44ceca52 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Fri, 13 Sep 2024 09:05:53 +0100 Subject: [PATCH 166/451] Merge pull request #3572 from Guptilious/master --- apps/tvremote/README.md | 9 +++++++++ apps/tvremote/app.js | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/apps/tvremote/README.md b/apps/tvremote/README.md index 77ee3681f7..1d33c2a100 100644 --- a/apps/tvremote/README.md +++ b/apps/tvremote/README.md @@ -60,3 +60,12 @@ Vol Commands * Swipe Up - Play/Pause Back Button - Should take you back to the previous menu screen. + +# Requests +If you have any issues or suggestions for improvements, please feel free to message [me](https://github.com/Guptilious). + + + + +# Creator +[Guptilious](https://github.com/Guptilious) diff --git a/apps/tvremote/app.js b/apps/tvremote/app.js index 55d9fe9ad9..ffb54dd7ac 100644 --- a/apps/tvremote/app.js +++ b/apps/tvremote/app.js @@ -1,3 +1,11 @@ +/****************************************************************** +* Creator Guptilious (https://github.com/Guptilious) +* Future Features: +* Samsung TV Support +* customiser page so config can be created prior to install. +* +*****************************************************************/ + require("Font7x11Numeric7Seg").add(Graphics); let deviceFileName = "tvdevicelist.json"; From 001783fcb7c902ed0bffd1acd94c584ad917b36b Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Fri, 13 Sep 2024 09:07:19 +0100 Subject: [PATCH 167/451] fix recent change for file backup --- backup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.js b/backup.js index 2475c80027..cc4c327bc1 100644 --- a/backup.js +++ b/backup.js @@ -55,7 +55,7 @@ function bangleDownload() { showToast('Backup complete!', 'success'); if (typeof Android !== "undefined" && typeof Android.saveFile === 'function') { // Recent Gadgetbridge version that provides the saveFile interface - Android.saveFile("Banglejs backup.zip", "application/zip", content); + Android.saveFile("Banglejs backup.zip", "application/zip", btoa(content)); } else { Espruino.Core.Utils.fileSaveDialog(content, "Banglejs backup.zip"); } From a6bf39620e4540b2615b1d670cf3502f93242540 Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Fri, 13 Sep 2024 20:50:07 +0800 Subject: [PATCH 168/451] hadash: banish evil eval --- apps/hadash/hadash.app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/hadash/hadash.app.js b/apps/hadash/hadash.app.js index d4ebf47a6b..e34b5283b0 100644 --- a/apps/hadash/hadash.app.js +++ b/apps/hadash/hadash.app.js @@ -114,8 +114,8 @@ function getServiceInputData(entry, level) { if (idx == -1) { idx = entry.input[key].options.push(entry.input[key].value) - 1; } - // the setTimeout method can not be used for the "format" CB since it expects a return value - using eval instead: - eval('CBs["'+key+'_format"] = function(v) { return entry.input["'+key+'"].options[v]; }'); + // the setTimeout method can not be used for the "format" CB since it expects a return value: + CBs[`${key}_format`] = ((key) => function(v) { return entry.input[key].options[v]; })(key); serviceInputMenu[label] = { value: parseInt(idx), min: 0, From 0e53f127a101f4f873cbcec835c872fe7f8628df Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 14 Sep 2024 22:01:43 +0200 Subject: [PATCH 169/451] Improve sanity check for locales --- .eslintrc.js | 1 + apps/locale/locale.html | 72 +++++++----- apps/locale/locales.js | 2 +- apps/locale/sanitycheck.js | 233 +++++++++++++++++++++++++++++++++++++ bin/sanitycheck.js | 108 ++++++++++++++--- 5 files changed, 373 insertions(+), 43 deletions(-) create mode 100644 apps/locale/sanitycheck.js diff --git a/.eslintrc.js b/.eslintrc.js index e79f87a5db..b7590a77eb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -112,6 +112,7 @@ module.exports = { "getSerial": "readonly", "getTime": "readonly", "global": "readonly", + "globalThis": "readonly", "HIGH": "readonly", "I2C1": "readonly", "Infinity": "readonly", diff --git a/apps/locale/locale.html b/apps/locale/locale.html index 71bfecea95..5b370d735a 100644 --- a/apps/locale/locale.html +++ b/apps/locale/locale.html @@ -21,15 +21,17 @@

-

+

+

Then click

+ - + @@ -416,7 +420,7 @@

Device info

if (webrtc) showWebRTCID(webrtc.peerId); else { webrtc = webrtcInit({ - bridge:true, + bridge:true, onStatus : function(s) { showToast(s); }, @@ -432,7 +436,7 @@

Device info

onPortDisconnect : function(serialPort) { }, onPortWrite : function(data, cb) { - Puck.write(data, cb); + Puck.write(data, cb); } }); connection.on("data", function(d) { diff --git a/core b/core index 8f4b43bab5..7e5ac0271f 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 8f4b43bab57ddc482533b1a00bb03601dc7ead79 +Subproject commit 7e5ac0271f794bcacda3a5a692cfa479457eb4dd diff --git a/css/main.css b/css/main.css index ce27a0eb70..be1040d84f 100644 --- a/css/main.css +++ b/css/main.css @@ -81,8 +81,8 @@ a.btn.btn-link.dropdown-toggle { min-height: 8em; } -.tile-content { - position: relative; +.tile-content { + position: relative; overflow-wrap: anywhere; /* stop long text like links pushing the width out too far*/ } .link-github { @@ -141,3 +141,64 @@ Not sure how to get 'normal' wrap behaviour (eg fill up until max-width, then wr white-space: normal; min-width: 160px; }*/ + +/* Terminal */ +/* ----------------------------------------------------- */ +.terminal +{ + font-size: 12px; + background-color: #222; + color: white; + display: block; + border: 0; + padding: 10px; + overflow: auto; /* adds scrollbar if needed */ + + position: absolute; + left: 0px; + top: 0px; + bottom: 0px; + right: 0px; + + -o-user-select: text; + -moz-user-select: text; + -webkit-user-select: text; + user-select: text; +} + +.termLine { + font-family: Fixed, monospace; + tab-size: 4; + min-height: 1em; +} + +.terminal.focus +{ + background-color: #333; +} + +.terminal__focus +{ + position: absolute; + top: -100px; /* hide it */ +} + +.terminal a +{ + color:#88F; +} +.terminal a:visited +{ + color:#88F; +} + +.terminal--connected.focus .terminal__cursor +{ + animation: blink 1s step-end 0s infinite; +} + +.terminal--webcam.focus .terminal__cursor +{ + text-shadow: none; + animation: blink_webcam 1s step-end 0s infinite; +} \ No newline at end of file diff --git a/index.html b/index.html index c8c34db666..608c90f91c 100644 --- a/index.html +++ b/index.html @@ -190,14 +190,18 @@

Settings