diff --git a/.obsidian/icons/test-pack/Wien3Wappen.svg b/.obsidian/icons/test-pack/Wien3Wappen.svg
new file mode 100644
index 00000000..76ec99ba
--- /dev/null
+++ b/.obsidian/icons/test-pack/Wien3Wappen.svg
@@ -0,0 +1,97 @@
+
+
diff --git a/.obsidian/plugins/cron/data.json b/.obsidian/plugins/cron/data.json
index 6796bedd..f0127c92 100644
--- a/.obsidian/plugins/cron/data.json
+++ b/.obsidian/plugins/cron/data.json
@@ -19,7 +19,7 @@
"601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d": {
"locked": false,
"lockedDeviceName": "iPhone",
- "lastRun": "2024-08-16T08:03:40+02:00"
+ "lastRun": "2024-09-11T07:35:52+02:00"
}
}
}
\ No newline at end of file
diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json
index a18d243a..803e467c 100644
--- a/.obsidian/plugins/obsidian-activity-history/data.json
+++ b/.obsidian/plugins/obsidian-activity-history/data.json
@@ -12,8 +12,8 @@
"checkpointList": [
{
"path": "/",
- "date": "2024-08-16",
- "size": 9208587
+ "date": "2024-09-11",
+ "size": 9778271
}
],
"activityHistory": [
@@ -3810,7 +3810,111 @@
},
{
"date": "2024-08-16",
- "value": 3776
+ "value": 3780
+ },
+ {
+ "date": "2024-08-17",
+ "value": 82945
+ },
+ {
+ "date": "2024-08-18",
+ "value": 116417
+ },
+ {
+ "date": "2024-08-19",
+ "value": 29115
+ },
+ {
+ "date": "2024-08-20",
+ "value": 17989
+ },
+ {
+ "date": "2024-08-21",
+ "value": 3750
+ },
+ {
+ "date": "2024-08-22",
+ "value": 2272
+ },
+ {
+ "date": "2024-08-23",
+ "value": 2546
+ },
+ {
+ "date": "2024-08-24",
+ "value": 14670
+ },
+ {
+ "date": "2024-08-25",
+ "value": 39536
+ },
+ {
+ "date": "2024-08-26",
+ "value": 3418
+ },
+ {
+ "date": "2024-08-27",
+ "value": 6103
+ },
+ {
+ "date": "2024-08-28",
+ "value": 7190
+ },
+ {
+ "date": "2024-08-29",
+ "value": 1814
+ },
+ {
+ "date": "2024-08-30",
+ "value": 1818
+ },
+ {
+ "date": "2024-08-31",
+ "value": 1686
+ },
+ {
+ "date": "2024-09-01",
+ "value": 88320
+ },
+ {
+ "date": "2024-09-02",
+ "value": 1700
+ },
+ {
+ "date": "2024-09-03",
+ "value": 17946
+ },
+ {
+ "date": "2024-09-04",
+ "value": 1785
+ },
+ {
+ "date": "2024-09-05",
+ "value": 1547
+ },
+ {
+ "date": "2024-09-06",
+ "value": 1815
+ },
+ {
+ "date": "2024-09-07",
+ "value": 1472
+ },
+ {
+ "date": "2024-09-08",
+ "value": 200726
+ },
+ {
+ "date": "2024-09-09",
+ "value": 2327
+ },
+ {
+ "date": "2024-09-10",
+ "value": 2865
+ },
+ {
+ "date": "2024-09-11",
+ "value": 1442
}
]
}
diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json
index 0d322ea5..f1cf11e9 100644
--- a/.obsidian/plugins/obsidian-commits/data.json
+++ b/.obsidian/plugins/obsidian-commits/data.json
@@ -1120,7 +1120,7 @@
"links": 1
},
"02.02 Paris/@@Paris.md": {
- "size": 4639,
+ "size": 3428,
"tags": 3,
"links": 9
},
@@ -1205,7 +1205,7 @@
"links": 9
},
"01.03 Family/Hilaire Bédier.md": {
- "size": 1888,
+ "size": 2106,
"tags": 3,
"links": 6
},
@@ -1220,7 +1220,7 @@
"links": 6
},
"01.03 Family/Ophélie Bédier.md": {
- "size": 1894,
+ "size": 2116,
"tags": 3,
"links": 6
},
@@ -1440,7 +1440,7 @@
"links": 1
},
"03.01 Reading list/@Reading master.md": {
- "size": 3154,
+ "size": 3472,
"tags": 2,
"links": 2
},
@@ -1517,10 +1517,10 @@
"05.02 Networks/Selfhosting.md": {
"size": 9487,
"tags": 5,
- "links": 18
+ "links": 19
},
"05.02 Networks/Configuring UFW.md": {
- "size": 29826,
+ "size": 4862,
"tags": 2,
"links": 7
},
@@ -1570,12 +1570,12 @@
"links": 1
},
"01.02 Home/Household.md": {
- "size": 2620,
+ "size": 3785,
"tags": 2,
"links": 4
},
"01.02 Home/Life mementos.md": {
- "size": 2687,
+ "size": 710,
"tags": 0,
"links": 1
},
@@ -1745,7 +1745,7 @@
"links": 2
},
"01.01 Life Orga/@Finances.md": {
- "size": 5483,
+ "size": 3574,
"tags": 4,
"links": 5
},
@@ -1755,9 +1755,9 @@
"links": 8
},
"01.01 Life Orga/@Lifestyle.md": {
- "size": 3310,
+ "size": 5320,
"tags": 4,
- "links": 8
+ "links": 14
},
"01.01 Life Orga/@Personal projects.md": {
"size": 2729,
@@ -2030,7 +2030,7 @@
"links": 6
},
"06.02 Investments/Crypto Tasks.md": {
- "size": 7493,
+ "size": 8336,
"tags": 3,
"links": 12
},
@@ -3059,11 +3059,6 @@
"tags": 2,
"links": 3
},
- "04.03 Creative snippets/2021-12-04 MRCK - lil dialogue.md": {
- "size": 937,
- "tags": 2,
- "links": 1
- },
"02.03 Zürich/Gül.md": {
"size": 1551,
"tags": 3,
@@ -6290,7 +6285,7 @@
"links": 4
},
"01.07 Animals/@Sally.md": {
- "size": 3420,
+ "size": 3794,
"tags": 2,
"links": 4
},
@@ -7040,7 +7035,7 @@
"links": 2
},
"01.07 Animals/2023-07-13 Health check.md": {
- "size": 4762,
+ "size": 1135,
"tags": 3,
"links": 3
},
@@ -8759,11 +8754,6 @@
"tags": 1,
"links": 2
},
- "00.02 Inbox/Gaslight.md": {
- "size": 878,
- "tags": 3,
- "links": 1
- },
"00.02 Inbox/Bad Kids.md": {
"size": 867,
"tags": 3,
@@ -9797,7 +9787,7 @@
"00.03 News/Exclusive Life Aboard a Nuclear Submarine as the US Responds to Threats Around the Globe.md": {
"size": 41441,
"tags": 4,
- "links": 1
+ "links": 2
},
"00.03 News/Cillian Murphy Is the Man of the Moment.md": {
"size": 40753,
@@ -10124,11 +10114,6 @@
"tags": 0,
"links": 2
},
- "00.02 Inbox/Underworld.md": {
- "size": 880,
- "tags": 1,
- "links": 2
- },
"00.01 Admin/Calendars/2024-03-18.md": {
"size": 1412,
"tags": 0,
@@ -10205,7 +10190,7 @@
"links": 6
},
"03.01 Reading list/Nightwood.md": {
- "size": 864,
+ "size": 963,
"tags": 1,
"links": 3
},
@@ -10396,8 +10381,8 @@
},
"00.03 News/The soft life why millennials are quitting the rat race.md": {
"size": 16096,
- "tags": 4,
- "links": 1
+ "tags": 3,
+ "links": 2
},
"00.03 News/The last days of Boston Market.md": {
"size": 13437,
@@ -11001,8 +10986,8 @@
},
"00.03 News/The Insulin Empire Edward Ongweso Jr. & Athena Sofides.md": {
"size": 35721,
- "tags": 5,
- "links": 1
+ "tags": 3,
+ "links": 2
},
"00.03 News/Buying Baja Hakai Magazine.md": {
"size": 37605,
@@ -11300,7 +11285,7 @@
"links": 3
},
"01.06 Health/2024-06-29 Fungal treatment.md": {
- "size": 6711,
+ "size": 12568,
"tags": 2,
"links": 3
},
@@ -11832,7 +11817,7 @@
"00.03 News/I Can’t Overstate How Bananas This Arizona Primary Is. The QAnon Shaman Isn’t Even the Weirdest Part..md": {
"size": 29088,
"tags": 3,
- "links": 1
+ "links": 2
},
"00.01 Admin/Calendars/2024-08-07.md": {
"size": 1255,
@@ -11872,12 +11857,12 @@
"00.03 News/Ozempic Boom Inside USA’s Weight-Loss Drug Capital.md": {
"size": 1690,
"tags": 3,
- "links": 1
+ "links": 2
},
"00.03 News/Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign.md": {
"size": 28470,
"tags": 4,
- "links": 1
+ "links": 2
},
"00.03 News/The Chipotle Bowl Thrower Who Was Forced to Work Fast Food.md": {
"size": 33196,
@@ -11887,7 +11872,7 @@
"00.03 News/What I Saw in the Darién Gap.md": {
"size": 55006,
"tags": 3,
- "links": 1
+ "links": 2
},
"00.01 Admin/Calendars/2024-08-12.md": {
"size": 1255,
@@ -11925,17 +11910,347 @@
"links": 1
},
"00.01 Admin/Calendars/2024-08-16.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "00.01 Admin/Calendars/2024-08-17.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 7
+ },
+ "00.03 News/Escaping Oklahoma A Worker’s Story From Inside an Illegal Marijuana Operation.md": {
+ "size": 16884,
+ "tags": 3,
+ "links": 2
+ },
+ "00.03 News/Armed and Underground Inside the Turbulent, Secret World of an American Militia.md": {
+ "size": 49508,
+ "tags": 4,
+ "links": 2
+ },
+ "00.03 News/After Nike Leaders Promised Climate Action, Their Corporate Jets Kept Flying — and Polluting.md": {
+ "size": 14710,
+ "tags": 5,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/2024-08-18.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 5
+ },
+ "00.03 News/The California Beach Town Awash in Poop.md": {
+ "size": 44113,
+ "tags": 4,
+ "links": 2
+ },
+ "00.03 News/How McDonald’s Found Out Its Wildly Popular Monopoly Game Was a Fraud.md": {
+ "size": 26048,
+ "tags": 5,
+ "links": 2
+ },
+ "00.03 News/The Vigil Keepers of January 6th.md": {
+ "size": 44917,
+ "tags": 3,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/2024-08-19.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "00.01 Admin/Calendars/2024-08-20.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "00.03 News/Trump Assassination Attempt Laid Bare Long-standing Vulnerabilities in the Secret Service.md": {
+ "size": 16141,
+ "tags": 4,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/2024-08-21.md": {
+ "size": 1268,
+ "tags": 0,
+ "links": 5
+ },
+ "03.04 Cinematheque/The Red Circle (1970).md": {
+ "size": 2270,
+ "tags": 1,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/2024-08-22.md": {
+ "size": 1268,
+ "tags": 0,
+ "links": 7
+ },
+ "00.01 Admin/Calendars/2024-08-23.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 10
+ },
+ "00.01 Admin/Calendars/Events/2024-08-23 ⚽️ PSG - Montpellier (6-0).md": {
+ "size": 468,
+ "tags": 0,
+ "links": 2
+ },
+ "03.04 Cinematheque/Arizona Dream (1993).md": {
+ "size": 2192,
+ "tags": 1,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/2024-08-24.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "03.02 Travels/Wien.md": {
+ "size": 8756,
+ "tags": 3,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/2024-08-25.md": {
+ "size": 1255,
+ "tags": 0,
+ "links": 6
+ },
+ "00.03 News/From Fiery Revolutionary to Sunshine State Retiree The THC-Fueled Twilight of the Last of the Chicago 7.md": {
+ "size": 24927,
+ "tags": 5,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/2024-08-26.md": {
+ "size": 1255,
+ "tags": 0,
+ "links": 8
+ },
+ "00.01 Admin/Calendars/2024-08-27.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "04.03 Creative snippets/New Year well Wishes.md": {
+ "size": 2224,
+ "tags": 0,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/2024-08-28.md": {
+ "size": 1255,
+ "tags": 0,
+ "links": 7
+ },
+ "02.03 Zürich/Seehaus.md": {
+ "size": 1516,
+ "tags": 3,
+ "links": 2
+ },
+ "04.03 Creative snippets/The Times They are a-changing.md": {
+ "size": 1024,
+ "tags": 0,
+ "links": 1
+ },
+ "04.03 Creative snippets/If.md": {
+ "size": 1006,
+ "tags": 0,
+ "links": 1
+ },
+ "04.03 Creative snippets/Génie & Folie.md": {
+ "size": 815,
+ "tags": 0,
+ "links": 1
+ },
+ "04.03 Creative snippets/Couronnement de l'Art.md": {
+ "size": 835,
+ "tags": 0,
+ "links": 1
+ },
+ "04.03 Creative snippets/Silence of Friends.md": {
+ "size": 763,
+ "tags": 0,
+ "links": 1
+ },
+ "04.03 Creative snippets/Qu'est-ce Qui Nous Tente.md": {
+ "size": 773,
+ "tags": 0,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/2024-08-29.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "03.01 Reading list/Underworld.md": {
+ "size": 1039,
+ "tags": 4,
+ "links": 3
+ },
+ "00.01 Admin/Calendars/2024-08-30.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 7
+ },
+ "00.01 Admin/Calendars/2024-08-31.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 5
+ },
+ "00.01 Admin/Calendars/2024-09-01.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "03.01 Reading list/Gaslight.md": {
+ "size": 1064,
+ "tags": 3,
+ "links": 2
+ },
+ "00.03 News/Fear and Joy in Chicago Fintan O’Toole.md": {
+ "size": 19567,
+ "tags": 3,
+ "links": 2
+ },
+ "00.03 News/How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador.md": {
+ "size": 35227,
+ "tags": 3,
+ "links": 2
+ },
+ "00.03 News/How to Make Millions as a Professional Whistleblower.md": {
+ "size": 28672,
+ "tags": 3,
+ "links": 1
+ },
+ "00.02 Inbox/Diplomacy.md": {
+ "size": 883,
+ "tags": 2,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/Events/2024-09-01 ⚽️ LOSC - PSG (1-3).md": {
+ "size": 438,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2024-09-18 ⚽️ PSG - FC Girona.md": {
+ "size": 192,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2024-10-01 ⚽️ Arsenal - PSG.md": {
+ "size": 187,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2024-10-22 ⚽️ PSG - PSV Eindhoven.md": {
+ "size": 189,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2024-11-06 ⚽️ PSG - Atletico Madrid.md": {
+ "size": 204,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2024-12-10 ⚽️ RB Salzburg - PSG.md": {
+ "size": 195,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2025-01-22 ⚽️ PSG - Man City.md": {
+ "size": 190,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2025-01-29 ⚽️ Stuttgart - PSG.md": {
+ "size": 191,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/Events/2024-11-26 ⚽️ Bayern - PSG.md": {
+ "size": 186,
+ "tags": 0,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/2024-09-02.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "00.01 Admin/Calendars/2024-09-03.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 7
+ },
+ "00.03 News/The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists.md": {
+ "size": 16592,
+ "tags": 3,
+ "links": 2
+ },
+ "00.01 Admin/Calendars/2024-09-04.md": {
+ "size": 1517,
+ "tags": 0,
+ "links": 6
+ },
+ "00.01 Admin/Calendars/2024-09-05.md": {
+ "size": 1394,
+ "tags": 0,
+ "links": 4
+ },
+ "00.01 Admin/Calendars/2024-09-06.md": {
+ "size": 1390,
+ "tags": 0,
+ "links": 4
+ },
+ "00.01 Admin/Calendars/2024-09-07.md": {
"size": 1412,
"tags": 0,
"links": 4
+ },
+ "00.01 Admin/Calendars/2024-09-08.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 8
+ },
+ "00.03 News/These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly.md": {
+ "size": 73931,
+ "tags": 4,
+ "links": 1
+ },
+ "00.03 News/Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons.md": {
+ "size": 36531,
+ "tags": 4,
+ "links": 1
+ },
+ "00.03 News/Anatomy of a Murder.md": {
+ "size": 59865,
+ "tags": 3,
+ "links": 1
+ },
+ "00.03 News/Why I changed my mind about volunteering.md": {
+ "size": 28254,
+ "tags": 3,
+ "links": 1
+ },
+ "00.01 Admin/Calendars/2024-09-09.md": {
+ "size": 1255,
+ "tags": 0,
+ "links": 4
+ },
+ "00.01 Admin/Calendars/2024-09-10.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 6
+ },
+ "00.01 Admin/Calendars/2024-09-11.md": {
+ "size": 1412,
+ "tags": 0,
+ "links": 5
}
},
"commitTypes": {
"/": {
- "Refactor": 11773,
- "Create": 2872,
- "Link": 14236,
- "Expand": 2312
+ "Refactor": 11826,
+ "Create": 2938,
+ "Link": 14386,
+ "Expand": 2367
}
},
"dailyCommits": {
@@ -11945,147 +12260,177 @@
"2": 33,
"3": 12,
"4": 46,
- "5": 16,
- "6": 75,
- "7": 1125,
- "8": 3333,
- "9": 1230,
- "10": 839,
- "11": 625,
- "12": 6820,
- "13": 786,
- "14": 676,
- "15": 1006,
- "16": 770,
- "17": 919,
- "18": 7465,
- "19": 1083,
- "20": 962,
- "21": 908,
- "22": 814,
- "23": 1414
+ "5": 17,
+ "6": 77,
+ "7": 1165,
+ "8": 3381,
+ "9": 1244,
+ "10": 845,
+ "11": 631,
+ "12": 6827,
+ "13": 805,
+ "14": 689,
+ "15": 1020,
+ "16": 781,
+ "17": 946,
+ "18": 7471,
+ "19": 1084,
+ "20": 971,
+ "21": 935,
+ "22": 831,
+ "23": 1470
}
},
"weeklyCommits": {
"/": {
- "Mon": 3444,
- "Tue": 1965,
- "Wed": 8064,
- "Thu": 1552,
- "Fri": 1627,
+ "Mon": 3473,
+ "Tue": 2002,
+ "Wed": 8122,
+ "Thu": 1572,
+ "Fri": 1652,
"Sat": 0,
- "Sun": 14541
+ "Sun": 14696
}
},
"recentCommits": {
"/": {
"Expanded": [
- " @@Zürich ",
- " 2024-06-29 Fungal treatment ",
- " 2024-08-01 ",
- " 2024-06-29 Fungal treatment ",
- " Bookmarks - Media ",
" 2024-06-29 Fungal treatment ",
+ " @Sally ",
" Household ",
- " 2024-08-01 Tonsilitis ",
- " 2024-08-01 Tonsilitis ",
- " 2024-06-29 Fungal treatment ",
+ " Crypto Tasks ",
" Configuring UFW ",
+ " 2024-09-06 ",
+ " 2024-09-05 ",
" 2024-06-29 Fungal treatment ",
- " Household ",
- " Server Alias ",
- " 2024-06-29 Fungal treatment ",
- " 2023-07-13 Health check ",
- " 2024-07-29 ",
- " 2024-06-29 Fungal treatment ",
- " @Family ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " Strozzi ",
- " 2024-07-07 Contact ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " Opportune de Villeneuve ",
- " 2024-07-13 ",
- " @@London ",
- " Jacqueline Bédier ",
- " 2024-07-12 ",
- " 2023-02-25 Polyp in Galbladder ",
- " 2023-02-25 Polyp in Galbladder ",
- " 2024-06-29 Fungal treatment ",
- " Bar am Wasser ",
+ " Ophélie Bédier ",
+ " 2024-09-04 ",
+ " 2024-11-06 ⚽️ PSG - Atletico Madrid ",
+ " 2024-12-10 ⚽️ RB Salzburg - PSG ",
+ " 2025-01-22 ⚽️ PSG - Man City ",
+ " 2025-01-29 ⚽️ Stuttgart - PSG ",
+ " 2024-11-26 ⚽️ Bayern - PSG ",
+ " 2024-09-18 ⚽️ PSG - FC Girona ",
+ " 2024-10-01 ⚽️ Arsenal - PSG ",
+ " 2024-10-22 ⚽️ PSG - PSV Eindhoven ",
+ " 2024-09-01 ⚽️ LOSC - PSG ",
+ " 2024-09-01 ⚽️ LOSC - PSG ",
+ " 2024-09-01 ⚽️ LOSC - PSG ",
+ " Configuring UFW ",
+ " Gaslight ",
" 2024-06-29 Fungal treatment ",
+ " Qu'est-ce Qui Nous Tente ",
+ " Silence of Friends ",
+ " Couronnement de l'Art ",
+ " Génie & Folie ",
+ " If ",
+ " The Times They are a-changing ",
+ " Nightwood ",
+ " New Year well Wishes ",
+ " New Year well Wishes ",
+ " New Year well Wishes ",
" Household ",
- " @Finances ",
- " 2024-06-29 Fungal treatment ",
- " 2024-07-07 ",
- " 2024-06-29 Fungal treatment ",
+ " Hilaire Bédier ",
+ " @Lifestyle ",
" 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment ",
- " Hosting Tasks ",
- " 2024-07-02 Checkup ",
- " 2024-06-29 Fungal treatment ",
- " 2024-06-29 Fungal treatment "
+ " Wien ",
+ " Wien ",
+ " Wien ",
+ " Wien ",
+ " Wien ",
+ " Wien ",
+ " @Lifestyle ",
+ " @Lifestyle ",
+ " Configuring UFW ",
+ " 2024-08-23 ⚽️ PSG - Montpellier ",
+ " 2024-08-23 ⚽️ PSG - Montpellier ",
+ " 2024-08-23 ⚽️ PSG - Montpellier ",
+ " @Reading master "
],
"Created": [
- " 2024-08-16 ",
- " Sleepy Hollow (1999) ",
- " 2024-08-15 ",
- " The Social Dilemma (2020) ",
- " 2024-08-14 ",
- " 2024-08-13 ",
- " The Pink Panther (1963) ",
- " 2024-08-12 ",
- " What I Saw in the Darién Gap ",
- " The Chipotle Bowl Thrower Who Was Forced to Work Fast Food ",
- " Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign ",
- " Ozempic Boom Inside USA’s Weight-Loss Drug Capital ",
- " Interstellar (2014) ",
- " 2024-08-11 ",
- " 2024-08-10 ",
- " Dallas Buyers Club (2013) ",
- " 2024-08-09 ",
- " 2024-08-08 ",
- " 2024-08-07 ",
- " I Can’t Overstate How Bananas This Arizona Primary Is. The QAnon Shaman Isn’t Even the Weirdest Part. ",
- " The movement desperately trying to get people to have more babies ",
- " Why CVS and Target Locking Up Products Is Backfiring ",
- " The skydiver who survived a 14,000-foot fall - ESPN ",
- " Marjorie Taylor Greene’s and Brad Raffensperger’s Voter Registrations Targeted in Georgia’s New Online Portal ",
- " Why We Investigated Matthew Trewhella, the Far-Right Wisconsin Pastor Influencing Republican Politics ",
- " 2024-08-06 ",
- " 2024-08-05 ",
+ " 2024-09-11 ",
+ " 2024-09-10 ",
+ " 2024-09-09 ",
+ " Why I changed my mind about volunteering ",
+ " Anatomy of a Murder ",
+ " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ",
+ " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ",
+ " 2024-09-08 ",
+ " 2024-09-07 ",
+ " 2024-09-06 ",
+ " 2024-09-05 ",
+ " 2024-09-04 ",
+ " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ",
+ " 2024-09-03 ",
+ " 2024-09-02 ",
+ " 2025-01-29 ⚽️ Stuttgart - PSG ",
+ " 2025-01-22 ⚽️ PSG - Man City ",
+ " 2024-12-10 ⚽️ RB Salzburg - PSG ",
+ " 2024-11-26 Bayern - PSG ",
+ " 2024-11-06 ⚽️ PSG - Atletico Madrid ",
+ " 2024-10-22 ⚽️ PSG - PSV Eindhoven ",
+ " 2024-10-01 ⚽️ Arsenal - PSG ",
+ " 2024-09-18 ⚽️ PSG - FC Girona ",
+ " 2024-09-01 ⚽️ LOSC - PSG ",
+ " Diplomacy ",
+ " Diplomacy ",
+ " How to Make Millions as a Professional Whistleblower ",
+ " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ",
+ " Fear and Joy in Chicago Fintan O’Toole ",
+ " 2024-09-01 ",
+ " 2024-08-31 ",
+ " 2024-08-30 ",
+ " 2024-08-29 ",
" Untitled ",
- " Magic Mike (2012) ",
- " Killer Joe (2011) ",
- " 2024-08-04 ",
- " 2024-08-03 ",
- " The People vs Larry Flynt (1996) ",
- " Amistad (1997) ",
- " 2024-08-02 ",
- " 2024-08-01 ",
- " 2024-07-31 ",
- " 2024-07-30 ",
- " Braveheart (1995) ",
- " How four U.S. presidents unleashed economic warfare across the globe ",
- " I Accidentally Uncovered a Nationwide Scam Run by Fake Hosts on Airbnb ",
- " 2024-07-29 ",
- " A Time to Kill (1996) ",
- " 2024-07-28 ",
- " 2024-07-27 ",
- " 2024-07-26 ",
- " 2024-07-25 ",
- " 2024-07-24 ",
- " Bob Marley - One Love (2024) ",
- " 2024-07-23 ",
- " Goodbye Christopher Robin (2017) "
+ " Untitled ",
+ " Untitled ",
+ " Untitled ",
+ " Untitled ",
+ " Untitled ",
+ " Seehaus ",
+ " 2024-08-28 ",
+ " Untitled ",
+ " 2024-08-27 ",
+ " 2024-08-26 ",
+ " ‘The Blind Side’ Made Him Famous. But He Has a Different Story to Tell. ",
+ " From Fiery Revolutionary to Sunshine State Retiree The THC-Fueled Twilight of the Last of the Chicago 7 ",
+ " 2024-08-25 ",
+ " Untitled ",
+ " 2024-08-24 ",
+ " Arizona Dream (1993) ",
+ " 2024-08-23 ⚽️ PSG - Montpellier "
],
"Renamed": [
+ " Why I changed my mind about volunteering ",
+ " Anatomy of a Murder ",
+ " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ",
+ " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ",
+ " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ",
+ " 2024-11-26 ⚽️ Bayern - PSG ",
+ " 2024-09-01 ⚽️ LOSC - PSG (1-3) ",
+ " How to Make Millions as a Professional Whistleblower ",
+ " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ",
+ " Fear and Joy in Chicago Fintan O’Toole ",
+ " Gaslight ",
+ " Underworld ",
+ " Qu'est-ce Qui Nous Tente ",
+ " Silence of Friends ",
+ " Couronnement de l'Art ",
+ " Génie & Folie ",
+ " If ",
+ " The Times They are a-changing ",
+ " Seehaus ",
+ " New Year well Wishes ",
+ " From Fiery Revolutionary to Sunshine State Retiree The THC-Fueled Twilight of the Last of the Chicago 7 ",
+ " Wien ",
+ " 2024-08-23 ⚽️ PSG - Montpellier (6-0) ",
+ " Trump Assassination Attempt Laid Bare Long-standing Vulnerabilities in the Secret Service ",
+ " The Vigil Keepers of January 6th ",
+ " How McDonald’s Found Out Its Wildly Popular Monopoly Game Was a Fraud ",
+ " The California Beach Town Awash in Poop ",
+ " After Nike Leaders Promised Climate Action, Their Corporate Jets Kept Flying — and Polluting ",
+ " Armed and Underground Inside the Turbulent, Secret World of an American Militia ",
+ " Escaping Oklahoma A Worker’s Story From Inside an Illegal Marijuana Operation ",
" What I Saw in the Darién Gap ",
" The Chipotle Bowl Thrower Who Was Forced to Work Fast Food ",
" Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign ",
@@ -12106,39 +12451,35 @@
" 📃 Template Scene ",
" 🧭 layout$address ",
" 🍷 Template Wine ",
- " 📔 Template Wiki ",
- " 📺 Template TVShow ",
- " 🛩️ Template Travel ",
- " ⏳ Template Timeline ",
- " ☑️ Template Task ",
- " 📚 Template Source ",
- " 🖥️ Template Server ",
- " 🧑🏼🍳 Template Recipe ",
- " 🏷️ Template Product ",
- " 📖 Template Pocket Source ",
- " 🪴 Template Plant ",
- " 📍 Template Place ",
- " 👤 Template Person ",
- " 📝 Template Note ",
- " 🎶 Template Music ",
- " 🎬 Template Movie ",
- " 📈 Template Investment ",
- " 🎮 Template Game ",
- " 🗓️ Template Daily ",
- " 🎭 Template Creation ",
- " ☕️ Template Coffee ",
- " 🔖 Template Bookmark ",
- " 🐱 Template Animal ",
- " Pablo Escobar’s Abandoned Hippos Are Wreaking Havoc in the Colombian Jungle ",
- " Doctors Are Increasingly Worried About Biden ",
- " A double life The cocaine kingpin who hid as a professional soccer player ",
- " Adam Nayman It was one of the most sexually explicit movies of the ‘90s. Here’s why this Tom Cruise and Nicole Kidman thriller still shocks today ",
- " Strozzi ",
- " 2024-07-07 Contact ",
- " She Made $10,000 a Month Defrauding Apps like Uber and Instacart. Meet the Queen of the Rideshare Mafia ",
- " The Great American Novels "
+ " 📔 Template Wiki "
],
"Tagged": [
+ " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ",
+ " Anatomy of a Murder ",
+ " Why I changed my mind about volunteering ",
+ " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ",
+ " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ",
+ " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ",
+ " Diplomacy ",
+ " How to Make Millions as a Professional Whistleblower ",
+ " How to Make Millions as a Professional Whistleblower ",
+ " Fear and Joy in Chicago Fintan O’Toole ",
+ " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ",
+ " Underworld ",
+ " Seehaus ",
+ " Seehaus ",
+ " From Fiery Revolutionary to Sunshine State Retiree The THC-Fueled Twilight of the Last of the Chicago 7 ",
+ " Wien ",
+ " Arizona Dream (1993) ",
+ " The Red Circle (1970) ",
+ " Trump Assassination Attempt Laid Bare Long-standing Vulnerabilities in the Secret Service ",
+ " The Vigil Keepers of January 6th ",
+ " The Vigil Keepers of January 6th ",
+ " The California Beach Town Awash in Poop ",
+ " How McDonald’s Found Out Its Wildly Popular Monopoly Game Was a Fraud ",
+ " After Nike Leaders Promised Climate Action, Their Corporate Jets Kept Flying — and Polluting ",
+ " Escaping Oklahoma A Worker’s Story From Inside an Illegal Marijuana Operation ",
+ " Armed and Underground Inside the Turbulent, Secret World of an American Militia ",
" Sleepy Hollow (1999) ",
" The Social Dilemma (2020) ",
" The Pink Panther (1963) ",
@@ -12163,35 +12504,26 @@
" Amistad (1997) ",
" Braveheart (1995) ",
" How four U.S. presidents unleashed economic warfare across the globe ",
- " I Accidentally Uncovered a Nationwide Scam Run by Fake Hosts on Airbnb ",
- " A Time to Kill (1996) ",
- " Bob Marley - One Love (2024) ",
- " Goodbye Christopher Robin (2017) ",
- " Doctors Are Increasingly Worried About Biden ",
- " Pablo Escobar’s Abandoned Hippos Are Wreaking Havoc in the Colombian Jungle ",
- " Adam Nayman It was one of the most sexually explicit movies of the ‘90s. Here’s why this Tom Cruise and Nicole Kidman thriller still shocks today ",
- " A double life The cocaine kingpin who hid as a professional soccer player ",
- " How a Con Man Ended Up in Solitary in Colorado Supermax Federal Prison ",
- " A British Nurse Was Found Guilty of Killing Seven Babies. Did She Do It ",
- " For the Women Who Accused the Trump Campaign of Harassment, It’s Been More Harassment ",
- " Segregation Academies Still Operate Across the South. One Town Grapples With Its Divided Schools. ",
- " An Iowa paperboy disappeared 41 years ago. His mother is still on the case ",
- " The big idea can you inherit memories from your ancestors ",
- " ‘The whole bridge just fell down.’ The final minutes before the Key Bridge collapsed ",
- " The New Rules ",
- " They came for Florida's sun and sand. They got soaring costs and a culture war. ",
- " Gangsters, Money and Murder How Chinese Organized Crime Is Dominating America’s Illegal Marijuana Market ",
- " Russia, Ukraine, and the Coming Schism in Orthodox Christianity ",
- " The Pentagon’s Silicon Valley Problem, by Andrew Cockburn ",
- " ‘The Death of Slim Shady’ or Not, You Can’t Kill Eminem. Not Really. ",
- " @News ",
- " Inside the Savage, Surreal, Booming World of Professional Slap Fighting ",
- " Chinese Organized Crime’s Latest U.S. Target Gift Cards ",
- " Nat Friedman Embraces AI to Translate the Herculaneum Papyri ",
- " Sextortion Scams Are Driving Teen Boys to Suicide ",
- " How Russian Spies Get Flipped or Expelled, As Told by a Spycatcher "
+ " I Accidentally Uncovered a Nationwide Scam Run by Fake Hosts on Airbnb "
],
"Refactored": [
+ " 2023-07-13 Health check ",
+ " 2024-09-09 ",
+ " 2024-09-06 ",
+ " 2024-09-04 ",
+ " Life mementos ",
+ " Life mementos ",
+ " Life mementos ",
+ " Life mementos ",
+ " Life mementos ",
+ " 2024-08-28 ",
+ " @Finances ",
+ " 2024-08-26 ",
+ " @@Paris ",
+ " 2024-08-25 ",
+ " 2024-08-22 ",
+ " 2024-08-21 ",
+ " Configuring UFW ",
" 2024-08-12 ",
" Ozempic Boom Inside USA’s Weight-Loss Drug Capital ",
" 2024-08-07 ",
@@ -12225,26 +12557,12 @@
" Lemon Zucchini Muffins ",
" Lemon Zucchini Muffins ",
" 2024-05-09 ",
- " 2024-05-08 ",
- " Household ",
- " 2024-04-28 ",
- " 2024-04-24 ",
- " Achille Bédier ",
- " 2024-04-13 ",
- " 2024-04-11 ",
- " 2024-04-04 ",
- " 2024-03-31 ",
- " @Draft1 ",
- " @@Project2 ",
- " 2024-03-26 ",
- " 2024-03-17 ",
- " 2024-03-10 ",
- " 2024-03-01 ⚽️ AS Monaco - PSG ",
- " 2024-02-25 ",
- " Sesame Seared Tuna Steak ",
- " 2024-02-20 "
+ " 2024-05-08 "
],
"Deleted": [
+ " Diplomacy ",
+ " 2021-12-04 MRCK - lil dialogue ",
+ " ‘The Blind Side’ Made Him Famous. But He Has a Different Story to Tell. ",
" Why CVS and Target Locking Up Products Is Backfiring ",
" Adam Nayman It was one of the most sexually explicit movies of the ‘90s. Here’s why this Tom Cruise and Nicole Kidman thriller still shocks today ",
" travel$visit ",
@@ -12292,65 +12610,65 @@
" Why Bill Watterson Vanished - The American Conservative ",
" What Really Happened to JFK ",
" Why Does Crypto Matter Matt Levine on BTC, ETH, Blockchain ",
- " The Tunnels of Gaza ",
- " Reuters, New York Times Top List of Fossil Fuel Industry’s Favorite Media Partners ",
- " The Lonely Battle to Save Species on a Tiny Speck in the Pacific ",
- " The revolt of the Christian home-schoolers "
+ " The Tunnels of Gaza "
],
"Linked": [
- " 2024-08-16 ",
- " 2024-08-15 ",
- " Sleepy Hollow (1999) ",
- " 2024-08-15 ",
- " 2024-08-15 ",
- " 2024-08-15 ",
- " 2024-08-14 ",
- " The Social Dilemma (2020) ",
- " 2024-08-14 ",
- " 2024-08-13 ",
- " The Chipotle Bowl Thrower Who Was Forced to Work Fast Food ",
- " 2024-08-13 ",
- " What Happens to Harlem When It’s White ",
- " 2024-08-12 ",
- " The Pink Panther (1963) ",
- " 2024-08-12 ",
- " I Accidentally Uncovered a Nationwide Scam Run by Fake Hosts on Airbnb ",
- " 2024-08-12 ",
- " 2024-08-11 ",
- " Inside Snapchat’s Teen Opioid Crisis ",
- " What I Saw in the Darién Gap ",
- " The Chipotle Bowl Thrower Who Was Forced to Work Fast Food ",
- " Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign ",
+ " 2024-09-11 ",
+ " 2024-09-11 ",
+ " 2024-09-10 ",
+ " 2024-09-10 ",
+ " 2024-09-09 ",
+ " Anatomy of a Murder ",
+ " Why I changed my mind about volunteering ",
+ " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ",
+ " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ",
+ " 2024-09-08 ",
+ " 2024-09-08 ",
+ " Fear and Joy in Chicago Fintan O’Toole ",
+ " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ",
+ " 2024-09-07 ",
+ " 2024-09-06 ",
+ " 2024-09-05 ",
+ " 2024-09-04 ",
+ " 2024-09-04 ",
+ " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ",
+ " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ",
+ " 2024-09-03 ",
+ " 2024-09-02 ",
+ " 2024-09-03 ",
+ " 2024-09-02 ",
+ " 2024-11-06 ⚽️ PSG - Atletico Madrid ",
+ " 2024-12-10 ⚽️ RB Salzburg - PSG ",
+ " 2025-01-22 ⚽️ PSG - Man City ",
+ " 2025-01-29 ⚽️ Stuttgart - PSG ",
+ " 2024-11-26 ⚽️ Bayern - PSG ",
+ " 2024-09-18 ⚽️ PSG - FC Girona ",
+ " 2024-10-01 ⚽️ Arsenal - PSG ",
+ " 2024-10-22 ⚽️ PSG - PSV Eindhoven ",
+ " 2024-09-01 ⚽️ LOSC - PSG ",
+ " 2024-09-01 ",
+ " Diplomacy ",
+ " How to Make Millions as a Professional Whistleblower ",
+ " Fear and Joy in Chicago Fintan O’Toole ",
+ " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ",
+ " Gaslight ",
" Ozempic Boom Inside USA’s Weight-Loss Drug Capital ",
- " Marjorie Taylor Greene’s and Brad Raffensperger’s Voter Registrations Targeted in Georgia’s New Online Portal ",
- " 2024-08-11 ",
- " Interstellar (2014) ",
- " Why Did a Father of 16 Hire a Dark-Web Hit Man ",
- " The skydiver who survived a 14,000-foot fall - ESPN ",
- " Why We Investigated Matthew Trewhella, the Far-Right Wisconsin Pastor Influencing Republican Politics ",
- " How four U.S. presidents unleashed economic warfare across the globe ",
- " The movement desperately trying to get people to have more babies ",
- " 2024-08-10 ",
- " 2024-08-11 ",
- " 2024-08-10 ",
- " 2024-08-09 ",
- " Dallas Buyers Club (2013) ",
- " 2024-08-09 ",
- " 2024-08-09 ",
- " 2024-08-09 ",
- " 2024-08-08 ",
- " 2024-08-08 ",
- " 2024-08-07 ",
- " I Can’t Overstate How Bananas This Arizona Primary Is. The QAnon Shaman Isn’t Even the Weirdest Part. ",
- " The movement desperately trying to get people to have more babies ",
- " Why CVS and Target Locking Up Products Is Backfiring ",
- " The skydiver who survived a 14,000-foot fall - ESPN ",
- " Why We Investigated Matthew Trewhella, the Far-Right Wisconsin Pastor Influencing Republican Politics ",
- " Marjorie Taylor Greene’s and Brad Raffensperger’s Voter Registrations Targeted in Georgia’s New Online Portal ",
- " 2024-08-06 ",
- " Joe Biden should drop out "
+ " 2024-09-01 ",
+ " 2024-08-31 ",
+ " 2024-08-31 ",
+ " What I Saw in the Darién Gap ",
+ " 2024-08-30 ",
+ " 2024-08-30 ",
+ " The Vigil Keepers of January 6th ",
+ " Underworld ",
+ " 2024-08-29 ",
+ " Exclusive Life Aboard a Nuclear Submarine as the US Responds to Threats Around the Globe ",
+ " 2024-08-29 "
],
"Removed Tags from": [
+ " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ",
+ " The soft life why millennials are quitting the rat race ",
+ " The Insulin Empire Edward Ongweso Jr. & Athena Sofides ",
" She Made $10,000 a Month Defrauding Apps like Uber and Instacart. Meet the Queen of the Rideshare Mafia ",
" How a Con Man Ended Up in Solitary in Colorado Supermax Federal Prison ",
" A British Nurse Was Found Guilty of Killing Seven Babies. Did She Do It ",
@@ -12398,10 +12716,7 @@
" Multiple Trump Witnesses Have Received Significant Financial Benefits From His Businesses, Campaign ",
" Jerry West, as a player and exec, sustained excellence during a lifetime of emotional struggle ",
" The Local Girls Who Inspired the Hollywood Classic “Mean Girls” ",
- " How Two Single Moms Escaped an Alleged Sex-Trafficking Ring and Ultimately Saved Each Other ",
- " Behind the New Iron Curtain, by Marzio G. Mian, Translated by Elettra Pauletto ",
- " Hippy, capitalist, guru, grocer the forgotten genius who changed British food ",
- " How a Script Doctor Found His Own Voice "
+ " How Two Single Moms Escaped an Alleged Sex-Trafficking Ring and Ultimately Saved Each Other "
],
"Removed Links from": [
" How a Con Man Ended Up in Solitary in Colorado Supermax Federal Prison ",
diff --git a/.obsidian/plugins/obsidian-icon-folder/data.json b/.obsidian/plugins/obsidian-icon-folder/data.json
index f69baf7a..8f9fdb2e 100644
--- a/.obsidian/plugins/obsidian-icon-folder/data.json
+++ b/.obsidian/plugins/obsidian-icon-folder/data.json
@@ -6,11 +6,11 @@
"emojiStyle": "native",
"iconColor": null,
"recentlyUsedIcons": [
+ "TpWien3Wappen",
"TpWappenGenfMatt",
"❤️🔥",
"TpUnteribergBlazon",
- "TpServerRemix1ByMerlin2525",
- "TpPharmacieLogoSvgVector"
+ "TpServerRemix1ByMerlin2525"
],
"recentlyUsedIconsSize": 5,
"rules": [],
@@ -129,5 +129,6 @@
"02.03 Zürich/Dr Awad Abuawad.md": "TpPharmacieLogoSvgVector",
"02.03 Zürich/Dr Cleopatra Morales.md": "TpPharmacieLogoSvgVector",
"01.04 Partner/Gordana.md": "❤️🔥",
- "01.03 Family/Dorothée Moulin.md": "TpWappenGenfMatt"
+ "01.03 Family/Dorothée Moulin.md": "TpWappenGenfMatt",
+ "03.02 Travels/Wien.md": "TpWien3Wappen"
}
\ No newline at end of file
diff --git a/.obsidian/plugins/obsidian-minimal-settings/main.js b/.obsidian/plugins/obsidian-minimal-settings/main.js
index 7bcd5f7b..973794ce 100644
--- a/.obsidian/plugins/obsidian-minimal-settings/main.js
+++ b/.obsidian/plugins/obsidian-minimal-settings/main.js
@@ -3,979 +3,4 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
-var __export = (target, all) => {
- __markAsModule(target);
- for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
-};
-var __reExport = (target, module2, desc) => {
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
- for (let key of __getOwnPropNames(module2))
- if (!__hasOwnProp.call(target, key) && key !== "default")
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
- }
- return target;
-};
-var __toModule = (module2) => {
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
-};
-var __async = (__this, __arguments, generator) => {
- return new Promise((resolve, reject) => {
- var fulfilled = (value) => {
- try {
- step(generator.next(value));
- } catch (e) {
- reject(e);
- }
- };
- var rejected = (value) => {
- try {
- step(generator.throw(value));
- } catch (e) {
- reject(e);
- }
- };
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
- step((generator = generator.apply(__this, __arguments)).next());
- });
-};
-
-// main.ts
-__export(exports, {
- default: () => MinimalTheme
-});
-var import_obsidian = __toModule(require("obsidian"));
-var MinimalTheme = class extends import_obsidian.Plugin {
- onload() {
- return __async(this, null, function* () {
- yield this.loadSettings();
- this.addSettingTab(new MinimalSettingTab(this.app, this));
- this.loadRules();
- let settingsUpdate = () => {
- const fontSize = this.app.vault.getConfig("baseFontSize");
- this.settings.textNormal = fontSize;
- if (this.app.vault.getConfig("foldHeading")) {
- this.settings.folding = true;
- this.saveData(this.settings);
- console.log("Folding is on");
- } else {
- this.settings.folding = false;
- this.saveData(this.settings);
- console.log("Folding is off");
- }
- document.body.classList.toggle("minimal-folding", this.settings.folding);
- if (this.app.vault.getConfig("showLineNumber")) {
- this.settings.lineNumbers = true;
- this.saveData(this.settings);
- console.log("Line numbers are on");
- } else {
- this.settings.lineNumbers = false;
- this.saveData(this.settings);
- console.log("Line numbers are off");
- }
- document.body.classList.toggle("minimal-line-nums", this.settings.lineNumbers);
- if (this.app.vault.getConfig("readableLineLength")) {
- this.settings.readableLineLength = true;
- this.saveData(this.settings);
- console.log("Readable line length is on");
- } else {
- this.settings.readableLineLength = false;
- this.saveData(this.settings);
- console.log("Readable line length is off");
- }
- document.body.classList.toggle("minimal-readable", this.settings.readableLineLength);
- document.body.classList.toggle("minimal-readable-off", !this.settings.readableLineLength);
- };
- let sidebarUpdate = () => {
- const sidebarEl = document.getElementsByClassName("mod-left-split")[0];
- const ribbonEl = document.getElementsByClassName("side-dock-ribbon")[0];
- if (sidebarEl && ribbonEl && document.body.classList.contains("theme-light") && this.settings.lightStyle == "minimal-light-contrast") {
- sidebarEl.addClass("theme-dark");
- ribbonEl.addClass("theme-dark");
- } else if (sidebarEl && ribbonEl) {
- sidebarEl.removeClass("theme-dark");
- ribbonEl.removeClass("theme-dark");
- }
- };
- this.registerEvent(app.vault.on("config-changed", settingsUpdate));
- this.registerEvent(app.workspace.on("css-change", sidebarUpdate));
- settingsUpdate();
- app.workspace.onLayoutReady(() => {
- sidebarUpdate();
- });
- const lightStyles = ["minimal-light", "minimal-light-tonal", "minimal-light-contrast", "minimal-light-white"];
- const darkStyles = ["minimal-dark", "minimal-dark-tonal", "minimal-dark-black"];
- const imgGridStyles = ["img-grid", "img-grid-ratio", "img-nogrid"];
- const tableWidthStyles = ["table-100", "table-default-width", "table-wide", "table-max"];
- const iframeWidthStyles = ["iframe-100", "iframe-default-width", "iframe-wide", "iframe-max"];
- const imgWidthStyles = ["img-100", "img-default-width", "img-wide", "img-max"];
- const mapWidthStyles = ["map-100", "map-default-width", "map-wide", "map-max"];
- const chartWidthStyles = ["chart-100", "chart-default-width", "chart-wide", "chart-max"];
- this.addCommand({
- id: "increase-body-font-size",
- name: "Increase body font size",
- callback: () => {
- this.settings.textNormal = this.settings.textNormal + 0.5;
- this.saveData(this.settings);
- this.setFontSize();
- }
- });
- this.addCommand({
- id: "decrease-body-font-size",
- name: "Decrease body font size",
- callback: () => {
- this.settings.textNormal = this.settings.textNormal - 0.5;
- this.saveData(this.settings);
- this.setFontSize();
- }
- });
- this.addCommand({
- id: "toggle-minimal-dark-cycle",
- name: "Cycle between dark mode styles",
- callback: () => {
- this.settings.darkStyle = darkStyles[(darkStyles.indexOf(this.settings.darkStyle) + 1) % darkStyles.length];
- this.saveData(this.settings);
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-light-cycle",
- name: "Cycle between light mode styles",
- callback: () => {
- this.settings.lightStyle = lightStyles[(lightStyles.indexOf(this.settings.lightStyle) + 1) % lightStyles.length];
- this.saveData(this.settings);
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-hidden-borders",
- name: "Toggle sidebar borders",
- callback: () => {
- this.settings.bordersToggle = !this.settings.bordersToggle;
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "toggle-colorful-headings",
- name: "Toggle colorful headings",
- callback: () => {
- this.settings.colorfulHeadings = !this.settings.colorfulHeadings;
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "toggle-minimal-focus-mode",
- name: "Toggle focus mode",
- callback: () => {
- this.settings.focusMode = !this.settings.focusMode;
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "toggle-minimal-colorful-frame",
- name: "Toggle colorful window frame",
- callback: () => {
- this.settings.colorfulFrame = !this.settings.colorfulFrame;
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "cycle-minimal-table-width",
- name: "Cycle between table width options",
- callback: () => {
- this.settings.tableWidth = tableWidthStyles[(tableWidthStyles.indexOf(this.settings.tableWidth) + 1) % tableWidthStyles.length];
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "cycle-minimal-image-width",
- name: "Cycle between image width options",
- callback: () => {
- this.settings.imgWidth = imgWidthStyles[(imgWidthStyles.indexOf(this.settings.imgWidth) + 1) % imgWidthStyles.length];
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "cycle-minimal-iframe-width",
- name: "Cycle between iframe width options",
- callback: () => {
- this.settings.iframeWidth = iframeWidthStyles[(iframeWidthStyles.indexOf(this.settings.iframeWidth) + 1) % iframeWidthStyles.length];
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "cycle-minimal-chart-width",
- name: "Cycle between chart width options",
- callback: () => {
- this.settings.chartWidth = chartWidthStyles[(chartWidthStyles.indexOf(this.settings.chartWidth) + 1) % chartWidthStyles.length];
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "cycle-minimal-map-width",
- name: "Cycle between map width options",
- callback: () => {
- this.settings.mapWidth = mapWidthStyles[(mapWidthStyles.indexOf(this.settings.mapWidth) + 1) % mapWidthStyles.length];
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "toggle-minimal-img-grid",
- name: "Toggle image grids",
- callback: () => {
- this.settings.imgGrid = !this.settings.imgGrid;
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.addCommand({
- id: "toggle-minimal-switch",
- name: "Switch between light and dark mode",
- callback: () => {
- this.updateTheme();
- }
- });
- this.addCommand({
- id: "toggle-minimal-light-default",
- name: "Use light mode (default)",
- callback: () => {
- this.settings.lightStyle = "minimal-light";
- this.saveData(this.settings);
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-light-white",
- name: "Use light mode (all white)",
- callback: () => {
- this.settings.lightStyle = "minimal-light-white";
- this.saveData(this.settings);
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-light-tonal",
- name: "Use light mode (low contrast)",
- callback: () => {
- this.settings.lightStyle = "minimal-light-tonal";
- this.saveData(this.settings);
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-light-contrast",
- name: "Use light mode (high contrast)",
- callback: () => {
- this.settings.lightStyle = "minimal-light-contrast";
- this.saveData(this.settings);
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-dark-default",
- name: "Use dark mode (default)",
- callback: () => {
- this.settings.darkStyle = "minimal-dark";
- this.saveData(this.settings);
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-dark-tonal",
- name: "Use dark mode (low contrast)",
- callback: () => {
- this.settings.darkStyle = "minimal-dark-tonal";
- this.saveData(this.settings);
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-dark-black",
- name: "Use dark mode (true black)",
- callback: () => {
- this.settings.darkStyle = "minimal-dark-black";
- this.saveData(this.settings);
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-atom-light",
- name: "Switch light color scheme to Atom (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-atom-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-ayu-light",
- name: "Switch light color scheme to Ayu (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-ayu-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-catppuccin-light",
- name: "Switch light color scheme to Catppuccin (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-catppuccin-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-default-light",
- name: "Switch light color scheme to default (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-default-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-gruvbox-light",
- name: "Switch light color scheme to Gruvbox (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-gruvbox-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-eink-light",
- name: "Switch light color scheme to E-ink (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-eink-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-everforest-light",
- name: "Switch light color scheme to Everforest (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-everforest-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-flexoki-light",
- name: "Switch light color scheme to Flexoki (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-flexoki-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-macos-light",
- name: "Switch light color scheme to macOS (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-macos-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-notion-light",
- name: "Switch light color scheme to Sky (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-notion-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-nord-light",
- name: "Switch light color scheme to Nord (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-nord-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-rose-pine-light",
- name: "Switch light color scheme to Ros\xE9 Pine (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-rose-pine-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-solarized-light",
- name: "Switch light color scheme to Solarized (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-solarized-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-things-light",
- name: "Switch light color scheme to Things (light)",
- callback: () => {
- this.settings.lightScheme = "minimal-things-light";
- this.saveData(this.settings);
- this.updateLightScheme();
- this.updateLightStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-atom-dark",
- name: "Switch dark color scheme to Atom (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-atom-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-ayu-dark",
- name: "Switch dark color scheme to Ayu (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-ayu-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-catppuccin-dark",
- name: "Switch dark color scheme to Catppuccin (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-catppuccin-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-dracula-dark",
- name: "Switch dark color scheme to Dracula (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-dracula-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-default-dark",
- name: "Switch dark color scheme to default (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-default-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-eink-dark",
- name: "Switch dark color scheme to E-ink (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-eink-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-everforest-dark",
- name: "Switch dark color scheme to Everforest (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-everforest-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-flexoki-dark",
- name: "Switch dark color scheme to Flexoki (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-flexoki-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-gruvbox-dark",
- name: "Switch dark color scheme to Gruvbox (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-gruvbox-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-macos-dark",
- name: "Switch dark color scheme to macOS (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-macos-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-nord-dark",
- name: "Switch dark color scheme to Nord (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-nord-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-notion-dark",
- name: "Switch dark color scheme to Sky (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-notion-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-rose-pine-dark",
- name: "Switch dark color scheme to Ros\xE9 Pine (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-rose-pine-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-solarized-dark",
- name: "Switch dark color scheme to Solarized (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-solarized-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-things-dark",
- name: "Switch dark color scheme to Things (dark)",
- callback: () => {
- this.settings.darkScheme = "minimal-things-dark";
- this.saveData(this.settings);
- this.updateDarkScheme();
- this.updateDarkStyle();
- }
- });
- this.addCommand({
- id: "toggle-minimal-dev-block-width",
- name: "Dev \u2014 Show block widths",
- callback: () => {
- this.settings.devBlockWidth = !this.settings.devBlockWidth;
- this.saveData(this.settings);
- this.refresh();
- }
- });
- this.refresh();
- });
- }
- onunload() {
- console.log("Unloading Minimal Theme Settings plugin");
- const sidebarEl = document.getElementsByClassName("mod-left-split")[0];
- const ribbonEl = document.getElementsByClassName("side-dock-ribbon")[0];
- sidebarEl.removeClass("theme-dark");
- ribbonEl.removeClass("theme-dark");
- this.unloadRules();
- this.removeStyle();
- this.removeSettings();
- this.removeLightScheme();
- this.removeDarkScheme();
- }
- loadSettings() {
- return __async(this, null, function* () {
- this.settings = Object.assign(DEFAULT_SETTINGS, yield this.loadData());
- });
- }
- saveSettings() {
- return __async(this, null, function* () {
- yield this.saveData(this.settings);
- });
- }
- refresh() {
- this.updateStyle();
- }
- loadRules() {
- const css = document.createElement("style");
- css.id = "minimal-theme";
- document.getElementsByTagName("head")[0].appendChild(css);
- document.body.classList.add("minimal-theme");
- this.updateStyle();
- }
- unloadRules() {
- const styleElement = document.getElementById("minimal-theme");
- if (styleElement) {
- styleElement.parentNode.removeChild(styleElement);
- }
- document.body.classList.remove("minimal-theme");
- }
- setFontSize() {
- this.app.vault.setConfig("baseFontSize", this.settings.textNormal);
- this.app.updateFontSize();
- }
- updateStyle() {
- this.removeStyle();
- this.removeSettings();
- document.body.addClass(this.settings.lightStyle, this.settings.lightScheme, this.settings.darkStyle, this.settings.darkScheme);
- document.body.classList.toggle("borders-none", !this.settings.bordersToggle);
- document.body.classList.toggle("colorful-headings", this.settings.colorfulHeadings);
- document.body.classList.toggle("colorful-frame", this.settings.colorfulFrame);
- document.body.classList.toggle("colorful-active", this.settings.colorfulActiveStates);
- document.body.classList.toggle("minimal-focus-mode", this.settings.focusMode);
- document.body.classList.toggle("links-int-on", this.settings.underlineInternal);
- document.body.classList.toggle("links-ext-on", this.settings.underlineExternal);
- document.body.classList.toggle("full-width-media", this.settings.fullWidthMedia);
- document.body.classList.toggle("img-grid", this.settings.imgGrid);
- document.body.classList.toggle("minimal-dev-block-width", this.settings.devBlockWidth);
- document.body.classList.toggle("minimal-status-off", !this.settings.minimalStatus);
- document.body.classList.toggle("full-file-names", !this.settings.trimNames);
- document.body.classList.toggle("labeled-nav", this.settings.labeledNav);
- document.body.classList.toggle("minimal-folding", this.settings.folding);
- document.body.addClass(this.settings.chartWidth, this.settings.tableWidth, this.settings.imgWidth, this.settings.iframeWidth, this.settings.mapWidth);
- const el = document.getElementById("minimal-theme");
- if (!el)
- throw "minimal-theme element not found!";
- else {
- el.innerText = "body.minimal-theme{--font-ui-small:" + this.settings.textSmall + "px;--line-height:" + this.settings.lineHeight + ";--line-width:" + this.settings.lineWidth + "rem;--line-width-wide:" + this.settings.lineWidthWide + "rem;--max-width:" + this.settings.maxWidth + "%;--font-editor-override:" + this.settings.editorFont + ";";
- }
- }
- updateDarkStyle() {
- document.body.removeClass("theme-light", "minimal-dark", "minimal-dark-tonal", "minimal-dark-black");
- document.body.addClass("theme-dark", this.settings.darkStyle);
- if (this.app.vault.getConfig("theme") !== "system") {
- this.app.setTheme("obsidian");
- this.app.vault.setConfig("theme", "obsidian");
- }
- this.app.workspace.trigger("css-change");
- }
- updateLightStyle() {
- document.body.removeClass("theme-dark", "minimal-light", "minimal-light-tonal", "minimal-light-contrast", "minimal-light-white");
- document.body.addClass("theme-light", this.settings.lightStyle);
- if (this.app.vault.getConfig("theme") !== "system") {
- this.app.setTheme("moonstone");
- this.app.vault.setConfig("theme", "moonstone");
- }
- this.app.workspace.trigger("css-change");
- }
- updateDarkScheme() {
- this.removeDarkScheme();
- document.body.addClass(this.settings.darkScheme);
- }
- updateLightScheme() {
- this.removeLightScheme();
- document.body.addClass(this.settings.lightScheme);
- }
- updateTheme() {
- if (this.app.vault.getConfig("theme") === "system") {
- if (document.body.classList.contains("theme-light")) {
- document.body.removeClass("theme-light");
- document.body.addClass("theme-dark");
- } else {
- document.body.removeClass("theme-dark");
- document.body.addClass("theme-light");
- }
- } else {
- if (document.body.classList.contains("theme-light")) {
- document.body.removeClass("theme-light");
- document.body.addClass("theme-dark");
- } else {
- document.body.removeClass("theme-dark");
- document.body.addClass("theme-light");
- }
- const currentTheme = this.app.vault.getConfig("theme");
- const newTheme = currentTheme === "moonstone" ? "obsidian" : "moonstone";
- this.app.setTheme(newTheme);
- this.app.vault.setConfig("theme", newTheme);
- }
- this.app.workspace.trigger("css-change");
- }
- removeSettings() {
- document.body.removeClass("borders-none", "colorful-headings", "colorful-frame", "colorful-active", "minimal-focus-mode", "links-int-on", "links-ext-on", "full-width-media", "img-grid", "minimal-dev-block-width", "minimal-status-off", "full-file-names", "labeled-nav", "minimal-folding");
- document.body.removeClass("table-wide", "table-max", "table-100", "table-default-width", "iframe-wide", "iframe-max", "iframe-100", "iframe-default-width", "img-wide", "img-max", "img-100", "img-default-width", "chart-wide", "chart-max", "chart-100", "chart-default-width", "map-wide", "map-max", "map-100", "map-default-width");
- }
- removeStyle() {
- document.body.removeClass("minimal-light", "minimal-light-tonal", "minimal-light-contrast", "minimal-light-white", "minimal-dark", "minimal-dark-tonal", "minimal-dark-black");
- }
- removeDarkScheme() {
- document.body.removeClass("minimal-atom-dark", "minimal-ayu-dark", "minimal-catppuccin-dark", "minimal-default-dark", "minimal-dracula-dark", "minimal-eink-dark", "minimal-everforest-dark", "minimal-flexoki-dark", "minimal-gruvbox-dark", "minimal-macos-dark", "minimal-nord-dark", "minimal-notion-dark", "minimal-rose-pine-dark", "minimal-solarized-dark", "minimal-things-dark");
- }
- removeLightScheme() {
- document.body.removeClass("minimal-atom-light", "minimal-ayu-light", "minimal-catppuccin-light", "minimal-default-light", "minimal-eink-light", "minimal-everforest-light", "minimal-flexoki-light", "minimal-gruvbox-light", "minimal-macos-light", "minimal-nord-light", "minimal-notion-light", "minimal-rose-pine-light", "minimal-solarized-light", "minimal-things-light");
- }
-};
-var DEFAULT_SETTINGS = {
- lightStyle: "minimal-light",
- darkStyle: "minimal-dark",
- lightScheme: "minimal-default-light",
- darkScheme: "minimal-default-dark",
- editorFont: "",
- lineHeight: 1.5,
- lineWidth: 40,
- lineWidthWide: 50,
- maxWidth: 88,
- textNormal: 16,
- textSmall: 13,
- imgGrid: false,
- imgWidth: "img-default-width",
- tableWidth: "table-default-width",
- iframeWidth: "iframe-default-width",
- mapWidth: "map-default-width",
- chartWidth: "chart-default-width",
- colorfulHeadings: false,
- colorfulFrame: false,
- colorfulActiveStates: false,
- trimNames: true,
- labeledNav: false,
- fullWidthMedia: true,
- bordersToggle: true,
- minimalStatus: true,
- focusMode: false,
- underlineInternal: true,
- underlineExternal: true,
- folding: true,
- lineNumbers: false,
- readableLineLength: false,
- devBlockWidth: false
-};
-var MinimalSettingTab = class extends import_obsidian.PluginSettingTab {
- constructor(app2, plugin) {
- super(app2, plugin);
- this.plugin = plugin;
- }
- display() {
- let { containerEl } = this;
- containerEl.empty();
- const colorSection = containerEl.createEl("div", { cls: "setting-item setting-item-heading" });
- const colorSectionInfo = colorSection.createEl("div", { cls: "setting-item-info" });
- colorSectionInfo.createEl("div", { text: "Color scheme", cls: "setting-item-name" });
- const colorDesc = colorSectionInfo.createEl("div", { cls: "setting-item-description" });
- colorDesc.appendChild(createEl("span", {
- text: "To create a custom color scheme use the "
- }));
- colorDesc.appendChild(createEl("a", {
- text: "Style Settings",
- href: "obsidian://show-plugin?id=obsidian-style-settings"
- }));
- colorDesc.appendText(" plugin. See ");
- colorDesc.appendChild(createEl("a", {
- text: "documentation",
- href: "https://minimal.guide/features/color-schemes"
- }));
- colorDesc.appendText(" for details.");
- new import_obsidian.Setting(containerEl).setName("Light mode color scheme").setDesc("Preset color options for light mode.").addDropdown((dropdown) => dropdown.addOption("minimal-default-light", "Default").addOption("minimal-atom-light", "Atom").addOption("minimal-ayu-light", "Ayu").addOption("minimal-catppuccin-light", "Catppuccin").addOption("minimal-eink-light", "E-ink (beta)").addOption("minimal-everforest-light", "Everforest").addOption("minimal-flexoki-light", "Flexoki").addOption("minimal-gruvbox-light", "Gruvbox").addOption("minimal-macos-light", "macOS").addOption("minimal-nord-light", "Nord").addOption("minimal-rose-pine-light", "Ros\xE9 Pine").addOption("minimal-notion-light", "Sky").addOption("minimal-solarized-light", "Solarized").addOption("minimal-things-light", "Things").setValue(this.plugin.settings.lightScheme).onChange((value) => {
- this.plugin.settings.lightScheme = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.updateLightScheme();
- }));
- new import_obsidian.Setting(containerEl).setName("Light mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown((dropdown) => dropdown.addOption("minimal-light", "Default").addOption("minimal-light-white", "All white").addOption("minimal-light-tonal", "Low contrast").addOption("minimal-light-contrast", "High contrast").setValue(this.plugin.settings.lightStyle).onChange((value) => {
- this.plugin.settings.lightStyle = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.updateLightStyle();
- }));
- new import_obsidian.Setting(containerEl).setName("Dark mode color scheme").setDesc("Preset colors options for dark mode.").addDropdown((dropdown) => dropdown.addOption("minimal-default-dark", "Default").addOption("minimal-atom-dark", "Atom").addOption("minimal-ayu-dark", "Ayu").addOption("minimal-catppuccin-dark", "Catppuccin").addOption("minimal-dracula-dark", "Dracula").addOption("minimal-eink-dark", "E-ink (beta)").addOption("minimal-everforest-dark", "Everforest").addOption("minimal-flexoki-dark", "Flexoki").addOption("minimal-gruvbox-dark", "Gruvbox").addOption("minimal-macos-dark", "macOS").addOption("minimal-nord-dark", "Nord").addOption("minimal-rose-pine-dark", "Ros\xE9 Pine").addOption("minimal-notion-dark", "Sky").addOption("minimal-solarized-dark", "Solarized").addOption("minimal-things-dark", "Things").setValue(this.plugin.settings.darkScheme).onChange((value) => {
- this.plugin.settings.darkScheme = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.updateDarkScheme();
- }));
- new import_obsidian.Setting(containerEl).setName("Dark mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown((dropdown) => dropdown.addOption("minimal-dark", "Default").addOption("minimal-dark-tonal", "Low contrast").addOption("minimal-dark-black", "True black").setValue(this.plugin.settings.darkStyle).onChange((value) => {
- this.plugin.settings.darkStyle = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.updateDarkStyle();
- }));
- containerEl.createEl("br");
- const featuresSection = containerEl.createEl("div", { cls: "setting-item setting-item-heading" });
- const featuresSectionInfo = featuresSection.createEl("div", { cls: "setting-item-info" });
- featuresSectionInfo.createEl("div", { text: "Features", cls: "setting-item-name" });
- const featuresSectionDesc = featuresSectionInfo.createEl("div", { cls: "setting-item-description" });
- featuresSectionDesc.appendChild(createEl("span", {
- text: "See "
- }));
- featuresSectionDesc.appendChild(createEl("a", {
- text: "documentation",
- href: "https://minimal.guide"
- }));
- featuresSectionDesc.appendText(" for details.");
- new import_obsidian.Setting(containerEl).setName("Text labels for primary navigation").setDesc("Navigation items in the left sidebar uses text labels.").addToggle((toggle) => toggle.setValue(this.plugin.settings.labeledNav).onChange((value) => {
- this.plugin.settings.labeledNav = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Colorful window frame").setDesc("The top area of the app uses your accent color.").addToggle((toggle) => toggle.setValue(this.plugin.settings.colorfulFrame).onChange((value) => {
- this.plugin.settings.colorfulFrame = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Colorful active states").setDesc("Active file and menu items use your accent color.").addToggle((toggle) => toggle.setValue(this.plugin.settings.colorfulActiveStates).onChange((value) => {
- this.plugin.settings.colorfulActiveStates = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Colorful headings").setDesc("Headings use a different color for each size.").addToggle((toggle) => toggle.setValue(this.plugin.settings.colorfulHeadings).onChange((value) => {
- this.plugin.settings.colorfulHeadings = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Minimal status bar").setDesc("Turn off to use full-width status bar.").addToggle((toggle) => toggle.setValue(this.plugin.settings.minimalStatus).onChange((value) => {
- this.plugin.settings.minimalStatus = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Trim file names in sidebars").setDesc("Use ellipses to fit file names on a single line.").addToggle((toggle) => toggle.setValue(this.plugin.settings.trimNames).onChange((value) => {
- this.plugin.settings.trimNames = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Workspace borders").setDesc("Display divider lines between workspace elements.").addToggle((toggle) => toggle.setValue(this.plugin.settings.bordersToggle).onChange((value) => {
- this.plugin.settings.bordersToggle = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Focus mode").setDesc("Hide tab bar and status bar, hover to display. Can be toggled via hotkey.").addToggle((toggle) => toggle.setValue(this.plugin.settings.focusMode).onChange((value) => {
- this.plugin.settings.focusMode = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Underline internal links").setDesc("Show underlines on internal links.").addToggle((toggle) => toggle.setValue(this.plugin.settings.underlineInternal).onChange((value) => {
- this.plugin.settings.underlineInternal = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Underline external links").setDesc("Show underlines on external links.").addToggle((toggle) => toggle.setValue(this.plugin.settings.underlineExternal).onChange((value) => {
- this.plugin.settings.underlineExternal = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Maximize media").setDesc("Images and videos fill the width of the line.").addToggle((toggle) => toggle.setValue(this.plugin.settings.fullWidthMedia).onChange((value) => {
- this.plugin.settings.fullWidthMedia = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- containerEl.createEl("br");
- const layoutSection = containerEl.createEl("div", { cls: "setting-item setting-item-heading" });
- const layoutSectionInfo = layoutSection.createEl("div", { cls: "setting-item-info" });
- layoutSectionInfo.createEl("div", { text: "Layout", cls: "setting-item-name" });
- const layoutSectionDesc = layoutSectionInfo.createEl("div", { cls: "setting-item-description" });
- layoutSectionDesc.appendChild(createEl("span", {
- text: "These options can also be defined on a per-file basis, see "
- }));
- layoutSectionDesc.appendChild(createEl("a", {
- text: "documentation",
- href: "https://minimal.guide/features/block-width"
- }));
- layoutSectionDesc.appendText(" for details.");
- new import_obsidian.Setting(containerEl).setName("Image grids").setDesc("Turn consecutive images into columns \u2014 to make a new row, add an extra line break between images.").addToggle((toggle) => toggle.setValue(this.plugin.settings.imgGrid).onChange((value) => {
- this.plugin.settings.imgGrid = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Chart width").setDesc("Default width for chart blocks.").addDropdown((dropdown) => dropdown.addOption("chart-default-width", "Default").addOption("chart-wide", "Wide line width").addOption("chart-max", "Maximum line width").addOption("chart-100", "100% pane width").setValue(this.plugin.settings.chartWidth).onChange((value) => {
- this.plugin.settings.chartWidth = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Iframe width").setDesc("Default width for iframe blocks.").addDropdown((dropdown) => dropdown.addOption("iframe-default-width", "Default").addOption("iframe-wide", "Wide line width").addOption("iframe-max", "Maximum line width").addOption("iframe-100", "100% pane width").setValue(this.plugin.settings.iframeWidth).onChange((value) => {
- this.plugin.settings.iframeWidth = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Image width").setDesc("Default width for image blocks.").addDropdown((dropdown) => dropdown.addOption("img-default-width", "Default").addOption("img-wide", "Wide line width").addOption("img-max", "Maximum line width").addOption("img-100", "100% pane width").setValue(this.plugin.settings.imgWidth).onChange((value) => {
- this.plugin.settings.imgWidth = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Map width").setDesc("Default width for map blocks.").addDropdown((dropdown) => dropdown.addOption("map-default-width", "Default").addOption("map-wide", "Wide line width").addOption("map-max", "Maximum line width").addOption("map-100", "100% pane width").setValue(this.plugin.settings.mapWidth).onChange((value) => {
- this.plugin.settings.mapWidth = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Table width").setDesc("Default width for table and Dataview blocks.").addDropdown((dropdown) => dropdown.addOption("table-default-width", "Default").addOption("table-wide", "Wide line width").addOption("table-max", "Maximum line width").addOption("table-100", "100% pane width").setValue(this.plugin.settings.tableWidth).onChange((value) => {
- this.plugin.settings.tableWidth = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- containerEl.createEl("br");
- containerEl.createEl("div", { text: "Typography", cls: "setting-item setting-item-heading" });
- new import_obsidian.Setting(containerEl).setName("Text font size").setDesc("Used for the main text (default 16).").addText((text) => text.setPlaceholder("16").setValue((this.plugin.settings.textNormal || "") + "").onChange((value) => {
- this.plugin.settings.textNormal = parseFloat(value);
- this.plugin.saveData(this.plugin.settings);
- this.plugin.setFontSize();
- }));
- new import_obsidian.Setting(containerEl).setName("Small font size").setDesc("Used for text in the sidebars and tabs (default 13).").addText((text) => text.setPlaceholder("13").setValue((this.plugin.settings.textSmall || "") + "").onChange((value) => {
- this.plugin.settings.textSmall = parseFloat(value);
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Line height").setDesc("Line height of text (default 1.5).").addText((text) => text.setPlaceholder("1.5").setValue((this.plugin.settings.lineHeight || "") + "").onChange((value) => {
- this.plugin.settings.lineHeight = parseFloat(value);
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Normal line width").setDesc("Number of characters per line (default 40).").addText((text) => text.setPlaceholder("40").setValue((this.plugin.settings.lineWidth || "") + "").onChange((value) => {
- this.plugin.settings.lineWidth = parseInt(value.trim());
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Wide line width").setDesc("Number of characters per line for wide elements (default 50).").addText((text) => text.setPlaceholder("50").setValue((this.plugin.settings.lineWidthWide || "") + "").onChange((value) => {
- this.plugin.settings.lineWidthWide = parseInt(value.trim());
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Maximum line width %").setDesc("Percentage of space inside a pane that a line can fill (default 88).").addText((text) => text.setPlaceholder("88").setValue((this.plugin.settings.maxWidth || "") + "").onChange((value) => {
- this.plugin.settings.maxWidth = parseInt(value.trim());
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- new import_obsidian.Setting(containerEl).setName("Editor font").setDesc("Overrides the text font defined in Obsidian Appearance settings when in edit mode.").addText((text) => text.setPlaceholder("").setValue((this.plugin.settings.editorFont || "") + "").onChange((value) => {
- this.plugin.settings.editorFont = value;
- this.plugin.saveData(this.plugin.settings);
- this.plugin.refresh();
- }));
- }
-};
-//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibWFpbi50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHsgQXBwLCBXb3Jrc3BhY2UsIE1vZGFsLCBOb3RpY2UsIFBsdWdpbiwgUG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KTtcclxuICAgICAgICAgIH0pXHJcbiAgICAgICAgKTtcclxuXHJcbiAgICBuZXcgU2V0dGluZyhjb250YWluZXJFbClcclxuICAgICAgLnNldE5hbWUoJ0ltYWdlIHdpZHRoJylcclxuICAgICAgLnNldERlc2MoJ0RlZmF1bHQgd2lkdGggZm9yIGltYWdlIGJsb2Nrcy4nKVxyXG4gICAgICAuYWRkRHJvcGRvd24oZHJvcGRvd24gPT4gZHJvcGRvd25cclxuICAgICAgICAuYWRkT3B0aW9uKCdpbWctZGVmYXVsdC13aWR0aCcsJ0RlZmF1bHQnKVxyXG4gICAgICAgIC5hZGRPcHRpb24oJ2ltZy13aWRlJywnV2lkZSBsaW5lIHdpZHRoJylcclxuICAgICAgICAuYWRkT3B0aW9uKCdpbWctbWF4JywnTWF4aW11bSBsaW5lIHdpZHRoJylcclxuICAgICAgICAuYWRkT3B0aW9uKCdpbWctMTAwJywnMTAwJSBwYW5lIHdpZHRoJylcclxuICAgICAgICAuc2V0VmFsdWUodGhpcy5wbHVnaW4uc2V0dGluZ3MuaW1nV2lkdGgpXHJcbiAgICAgICAgICAub25DaGFuZ2UoKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMucGx1Z2luLnNldHRpbmdzLmltZ1dpZHRoID0gdmFsdWU7XHJcbiAgICAgICAgICAgIHRoaXMucGx1Z2luLnNhdmVEYXRhKHRoaXMucGx1Z2luLnNldHRpbmdzKTtcclxuICAgICAgICAgICAgdGhpcy5wbHVnaW4ucmVmcmVzaCgpO1xyXG4gICAgICAgICAgfSlcclxuICAgICAgICApO1xyXG5cclxuICAgIG5ldyBTZXR0aW5nKGNvbnRhaW5lckVsKVxyXG4gICAgICAuc2V0TmFtZSgnTWFwIHdpZHRoJylcclxuICAgICAgLnNldERlc2MoJ0RlZmF1bHQgd2lkdGggZm9yIG1hcCBibG9ja3MuJylcclxuICAgICAgLmFkZERyb3Bkb3duKGRyb3Bkb3duID0+IGRyb3Bkb3duXHJcbiAgICAgIC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FFBQVEsd0VBQ1IsUUFBUSxVQUFRLEtBQUssZUFBZSxNQUNsQyxTQUFVLE1BQUssT0FBTyxTQUFTLFlBQVksTUFBTSxJQUNqRCxTQUFTLENBQUMsVUFBVTtBQUNuQixXQUFLLE9BQU8sU0FBUyxXQUFXLFNBQVMsTUFBTTtBQUMvQyxXQUFLLE9BQU8sU0FBUyxLQUFLLE9BQU87QUFDakMsV0FBSyxPQUFPO0FBQUE7QUFFbEIsUUFBSSx3QkFBUSxhQUNULFFBQVEsZUFDUixRQUFRLHNGQUNSLFFBQVEsVUFBUSxLQUFLLGVBQWUsSUFDbEMsU0FBVSxNQUFLLE9BQU8sU0FBUyxjQUFjLE1BQU0sSUFDbkQsU0FBUyxDQUFDLFVBQVU7QUFDbkIsV0FBSyxPQUFPLFNBQVMsYUFBYTtBQUNsQyxXQUFLLE9BQU8sU0FBUyxLQUFLLE9BQU87QUFDakMsV0FBSyxPQUFPO0FBQUE7QUFBQTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQo=
+var x=Object.create;var u=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var v=n=>u(n,"__esModule",{value:!0});var O=(n,t)=>{v(n);for(var s in t)u(n,s,{get:t[s],enumerable:!0})},E=(n,t,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of W(t))!N.call(n,l)&&l!=="default"&&u(n,l,{get:()=>t[l],enumerable:!(s=L(t,l))||s.enumerable});return n},y=n=>E(v(u(n!=null?x(T(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var p=(n,t,s)=>new Promise((l,d)=>{var f=h=>{try{m(s.next(h))}catch(o){d(o)}},g=h=>{try{m(s.throw(h))}catch(o){d(o)}},m=h=>h.done?l(h.value):Promise.resolve(h.value).then(f,g);m((s=s.apply(n,t)).next())});O(exports,{default:()=>S});var C=y(require("obsidian"));var a=y(require("obsidian")),D={lightStyle:"minimal-light",darkStyle:"minimal-dark",lightScheme:"minimal-default-light",darkScheme:"minimal-default-dark",editorFont:"",lineHeight:1.5,lineWidth:40,lineWidthWide:50,maxWidth:88,textNormal:16,textSmall:13,imgGrid:!1,imgWidth:"img-default-width",tableWidth:"table-default-width",iframeWidth:"iframe-default-width",mapWidth:"map-default-width",chartWidth:"chart-default-width",colorfulHeadings:!1,colorfulFrame:!1,colorfulActiveStates:!1,trimNames:!0,labeledNav:!1,fullWidthMedia:!0,bordersToggle:!0,minimalStatus:!0,focusMode:!1,underlineInternal:!0,underlineExternal:!0,folding:!0,lineNumbers:!1,readableLineLength:!1,devBlockWidth:!1},b=class extends a.PluginSettingTab{constructor(t,s){super(t,s);this.plugin=s}display(){let{containerEl:t}=this;t.empty();let l=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});l.createEl("div",{text:"Color scheme",cls:"setting-item-name"});let d=l.createEl("div",{cls:"setting-item-description"});d.appendChild(createEl("span",{text:"To create a custom color scheme use the "})),d.appendChild(createEl("a",{text:"Style Settings",href:"obsidian://show-plugin?id=obsidian-style-settings"})),d.appendText(" plugin. See "),d.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide/features/color-schemes"})),d.appendText(" for details."),new a.Setting(t).setName("Light mode color scheme").setDesc("Preset color options for light mode.").addDropdown(i=>i.addOption("minimal-default-light","Default").addOption("minimal-atom-light","Atom").addOption("minimal-ayu-light","Ayu").addOption("minimal-catppuccin-light","Catppuccin").addOption("minimal-eink-light","E-ink (beta)").addOption("minimal-everforest-light","Everforest").addOption("minimal-flexoki-light","Flexoki").addOption("minimal-gruvbox-light","Gruvbox").addOption("minimal-macos-light","macOS").addOption("minimal-nord-light","Nord").addOption("minimal-rose-pine-light","Ros\xE9 Pine").addOption("minimal-notion-light","Sky").addOption("minimal-solarized-light","Solarized").addOption("minimal-things-light","Things").setValue(this.plugin.settings.lightScheme).onChange(e=>{this.plugin.settings.lightScheme=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateLightScheme()})),new a.Setting(t).setName("Light mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown(i=>i.addOption("minimal-light","Default").addOption("minimal-light-white","All white").addOption("minimal-light-tonal","Low contrast").addOption("minimal-light-contrast","High contrast").setValue(this.plugin.settings.lightStyle).onChange(e=>{this.plugin.settings.lightStyle=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateLightStyle()})),new a.Setting(t).setName("Dark mode color scheme").setDesc("Preset colors options for dark mode.").addDropdown(i=>i.addOption("minimal-default-dark","Default").addOption("minimal-atom-dark","Atom").addOption("minimal-ayu-dark","Ayu").addOption("minimal-catppuccin-dark","Catppuccin").addOption("minimal-dracula-dark","Dracula").addOption("minimal-eink-dark","E-ink (beta)").addOption("minimal-everforest-dark","Everforest").addOption("minimal-flexoki-dark","Flexoki").addOption("minimal-gruvbox-dark","Gruvbox").addOption("minimal-macos-dark","macOS").addOption("minimal-nord-dark","Nord").addOption("minimal-rose-pine-dark","Ros\xE9 Pine").addOption("minimal-notion-dark","Sky").addOption("minimal-solarized-dark","Solarized").addOption("minimal-things-dark","Things").setValue(this.plugin.settings.darkScheme).onChange(e=>{this.plugin.settings.darkScheme=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateDarkScheme()})),new a.Setting(t).setName("Dark mode background contrast").setDesc("Level of contrast between sidebar and main content.").addDropdown(i=>i.addOption("minimal-dark","Default").addOption("minimal-dark-tonal","Low contrast").addOption("minimal-dark-black","True black").setValue(this.plugin.settings.darkStyle).onChange(e=>{this.plugin.settings.darkStyle=e,this.plugin.saveData(this.plugin.settings),this.plugin.updateDarkStyle()})),t.createEl("br");let g=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});g.createEl("div",{text:"Features",cls:"setting-item-name"});let m=g.createEl("div",{cls:"setting-item-description"});m.appendChild(createEl("span",{text:"See "})),m.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide"})),m.appendText(" for details."),new a.Setting(t).setName("Text labels for primary navigation").setDesc("Navigation items in the left sidebar uses text labels.").addToggle(i=>i.setValue(this.plugin.settings.labeledNav).onChange(e=>{this.plugin.settings.labeledNav=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful window frame").setDesc("The top area of the app uses your accent color.").addToggle(i=>i.setValue(this.plugin.settings.colorfulFrame).onChange(e=>{this.plugin.settings.colorfulFrame=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful active states").setDesc("Active file and menu items use your accent color.").addToggle(i=>i.setValue(this.plugin.settings.colorfulActiveStates).onChange(e=>{this.plugin.settings.colorfulActiveStates=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Colorful headings").setDesc("Headings use a different color for each size.").addToggle(i=>i.setValue(this.plugin.settings.colorfulHeadings).onChange(e=>{this.plugin.settings.colorfulHeadings=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Minimal status bar").setDesc("Turn off to use full-width status bar.").addToggle(i=>i.setValue(this.plugin.settings.minimalStatus).onChange(e=>{this.plugin.settings.minimalStatus=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Trim file names in sidebars").setDesc("Use ellipses to fit file names on a single line.").addToggle(i=>i.setValue(this.plugin.settings.trimNames).onChange(e=>{this.plugin.settings.trimNames=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Workspace borders").setDesc("Display divider lines between workspace elements.").addToggle(i=>i.setValue(this.plugin.settings.bordersToggle).onChange(e=>{this.plugin.settings.bordersToggle=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Focus mode").setDesc("Hide tab bar and status bar, hover to display. Can be toggled via hotkey.").addToggle(i=>i.setValue(this.plugin.settings.focusMode).onChange(e=>{this.plugin.settings.focusMode=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Underline internal links").setDesc("Show underlines on internal links.").addToggle(i=>i.setValue(this.plugin.settings.underlineInternal).onChange(e=>{this.plugin.settings.underlineInternal=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Underline external links").setDesc("Show underlines on external links.").addToggle(i=>i.setValue(this.plugin.settings.underlineExternal).onChange(e=>{this.plugin.settings.underlineExternal=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Maximize media").setDesc("Images and videos fill the width of the line.").addToggle(i=>i.setValue(this.plugin.settings.fullWidthMedia).onChange(e=>{this.plugin.settings.fullWidthMedia=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),t.createEl("br");let o=t.createEl("div",{cls:"setting-item setting-item-heading"}).createEl("div",{cls:"setting-item-info"});o.createEl("div",{text:"Layout",cls:"setting-item-name"});let r=o.createEl("div",{cls:"setting-item-description"});r.appendChild(createEl("span",{text:"These options can also be defined on a per-file basis, see "})),r.appendChild(createEl("a",{text:"documentation",href:"https://minimal.guide/features/block-width"})),r.appendText(" for details."),new a.Setting(t).setName("Image grids").setDesc("Turn consecutive images into columns \u2014 to make a new row, add an extra line break between images.").addToggle(i=>i.setValue(this.plugin.settings.imgGrid).onChange(e=>{this.plugin.settings.imgGrid=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Chart width").setDesc("Default width for chart blocks.").addDropdown(i=>i.addOption("chart-default-width","Default").addOption("chart-wide","Wide line width").addOption("chart-max","Maximum line width").addOption("chart-100","100% pane width").setValue(this.plugin.settings.chartWidth).onChange(e=>{this.plugin.settings.chartWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Iframe width").setDesc("Default width for iframe blocks.").addDropdown(i=>i.addOption("iframe-default-width","Default").addOption("iframe-wide","Wide line width").addOption("iframe-max","Maximum line width").addOption("iframe-100","100% pane width").setValue(this.plugin.settings.iframeWidth).onChange(e=>{this.plugin.settings.iframeWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Image width").setDesc("Default width for image blocks.").addDropdown(i=>i.addOption("img-default-width","Default").addOption("img-wide","Wide line width").addOption("img-max","Maximum line width").addOption("img-100","100% pane width").setValue(this.plugin.settings.imgWidth).onChange(e=>{this.plugin.settings.imgWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Map width").setDesc("Default width for map blocks.").addDropdown(i=>i.addOption("map-default-width","Default").addOption("map-wide","Wide line width").addOption("map-max","Maximum line width").addOption("map-100","100% pane width").setValue(this.plugin.settings.mapWidth).onChange(e=>{this.plugin.settings.mapWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Table width").setDesc("Default width for table and Dataview blocks.").addDropdown(i=>i.addOption("table-default-width","Default").addOption("table-wide","Wide line width").addOption("table-max","Maximum line width").addOption("table-100","100% pane width").setValue(this.plugin.settings.tableWidth).onChange(e=>{this.plugin.settings.tableWidth=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),t.createEl("br"),t.createEl("div",{text:"Typography",cls:"setting-item setting-item-heading"}),new a.Setting(t).setName("Text font size").setDesc("Used for the main text (default 16).").addText(i=>i.setPlaceholder("16").setValue((this.plugin.settings.textNormal||"")+"").onChange(e=>{this.plugin.settings.textNormal=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.setFontSize()})),new a.Setting(t).setName("Small font size").setDesc("Used for text in the sidebars and tabs (default 13).").addText(i=>i.setPlaceholder("13").setValue((this.plugin.settings.textSmall||"")+"").onChange(e=>{this.plugin.settings.textSmall=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Line height").setDesc("Line height of text (default 1.5).").addText(i=>i.setPlaceholder("1.5").setValue((this.plugin.settings.lineHeight||"")+"").onChange(e=>{this.plugin.settings.lineHeight=parseFloat(e),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Normal line width").setDesc("Number of characters per line (default 40).").addText(i=>i.setPlaceholder("40").setValue((this.plugin.settings.lineWidth||"")+"").onChange(e=>{this.plugin.settings.lineWidth=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Wide line width").setDesc("Number of characters per line for wide elements (default 50).").addText(i=>i.setPlaceholder("50").setValue((this.plugin.settings.lineWidthWide||"")+"").onChange(e=>{this.plugin.settings.lineWidthWide=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Maximum line width %").setDesc("Percentage of space inside a pane that a line can fill (default 88).").addText(i=>i.setPlaceholder("88").setValue((this.plugin.settings.maxWidth||"")+"").onChange(e=>{this.plugin.settings.maxWidth=parseInt(e.trim()),this.plugin.saveData(this.plugin.settings),this.plugin.refresh()})),new a.Setting(t).setName("Editor font").setDesc("Overrides the text font defined in Obsidian Appearance settings when in edit mode.").addText(i=>i.setPlaceholder("").setValue((this.plugin.settings.editorFont||"")+"").onChange(e=>{this.plugin.settings.editorFont=e,this.plugin.saveData(this.plugin.settings),this.plugin.refresh()}))}};var S=class extends C.Plugin{onload(){return p(this,null,function*(){yield this.loadSettings(),this.addSettingTab(new b(this.app,this)),this.loadRules();let t=()=>{let i=this.app.vault.getConfig("baseFontSize");this.settings.textNormal=i;let e=!1,w=!1,k=!1;this.app.vault.getConfig("foldHeading")?(this.settings.folding=!0,console.log("Folding is on"),e=!0):(this.settings.folding=!1,console.log("Folding is off")),this.app.vault.getConfig("showLineNumber")?(this.settings.lineNumbers=!0,console.log("Line numbers are on"),w=!0):(this.settings.lineNumbers=!1,console.log("Line numbers are off")),this.app.vault.getConfig("readableLineLength")?(this.settings.readableLineLength=!0,console.log("Readable line length is on"),k=!0):(this.settings.readableLineLength=!1,console.log("Readable line length is off"));let c=document.body.classList;c.toggle("minimal-folding",e),c.toggle("minimal-line-nums",w),c.toggle("minimal-readable",k),c.toggle("minimal-readable-off",!k),this.saveData(this.settings)},s=()=>{let i=document.getElementsByClassName("mod-left-split")[0],e=document.getElementsByClassName("side-dock-ribbon")[0];i&&e&&document.body.classList.contains("theme-light")&&this.settings.lightStyle=="minimal-light-contrast"?(i.addClass("theme-dark"),e.addClass("theme-dark")):i&&e&&(i.removeClass("theme-dark"),e.removeClass("theme-dark"))};this.registerEvent(app.vault.on("config-changed",t)),this.registerEvent(app.workspace.on("css-change",s)),t(),app.workspace.onLayoutReady(()=>{s()});let l=["minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white"],d=["minimal-dark","minimal-dark-tonal","minimal-dark-black"],f=["img-grid","img-grid-ratio","img-nogrid"],g=["table-100","table-default-width","table-wide","table-max"],m=["iframe-100","iframe-default-width","iframe-wide","iframe-max"],h=["img-100","img-default-width","img-wide","img-max"],o=["map-100","map-default-width","map-wide","map-max"],r=["chart-100","chart-default-width","chart-wide","chart-max"];this.addCommand({id:"increase-body-font-size",name:"Increase body font size",callback:()=>{this.settings.textNormal=this.settings.textNormal+.5,this.saveData(this.settings),this.setFontSize()}}),this.addCommand({id:"decrease-body-font-size",name:"Decrease body font size",callback:()=>{this.settings.textNormal=this.settings.textNormal-.5,this.saveData(this.settings),this.setFontSize()}}),this.addCommand({id:"toggle-minimal-dark-cycle",name:"Cycle between dark mode styles",callback:()=>{this.settings.darkStyle=d[(d.indexOf(this.settings.darkStyle)+1)%d.length],this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-light-cycle",name:"Cycle between light mode styles",callback:()=>{this.settings.lightStyle=l[(l.indexOf(this.settings.lightStyle)+1)%l.length],this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-hidden-borders",name:"Toggle sidebar borders",callback:()=>{this.settings.bordersToggle=!this.settings.bordersToggle,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-colorful-headings",name:"Toggle colorful headings",callback:()=>{this.settings.colorfulHeadings=!this.settings.colorfulHeadings,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-focus-mode",name:"Toggle focus mode",callback:()=>{this.settings.focusMode=!this.settings.focusMode,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-colorful-frame",name:"Toggle colorful window frame",callback:()=>{this.settings.colorfulFrame=!this.settings.colorfulFrame,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-table-width",name:"Cycle between table width options",callback:()=>{this.settings.tableWidth=g[(g.indexOf(this.settings.tableWidth)+1)%g.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-image-width",name:"Cycle between image width options",callback:()=>{this.settings.imgWidth=h[(h.indexOf(this.settings.imgWidth)+1)%h.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-iframe-width",name:"Cycle between iframe width options",callback:()=>{this.settings.iframeWidth=m[(m.indexOf(this.settings.iframeWidth)+1)%m.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-chart-width",name:"Cycle between chart width options",callback:()=>{this.settings.chartWidth=r[(r.indexOf(this.settings.chartWidth)+1)%r.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"cycle-minimal-map-width",name:"Cycle between map width options",callback:()=>{this.settings.mapWidth=o[(o.indexOf(this.settings.mapWidth)+1)%o.length],this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-img-grid",name:"Toggle image grids",callback:()=>{this.settings.imgGrid=!this.settings.imgGrid,this.saveData(this.settings),this.refresh()}}),this.addCommand({id:"toggle-minimal-switch",name:"Switch between light and dark mode",callback:()=>{this.updateTheme()}}),this.addCommand({id:"toggle-minimal-light-default",name:"Use light mode (default)",callback:()=>{this.settings.lightStyle="minimal-light",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-white",name:"Use light mode (all white)",callback:()=>{this.settings.lightStyle="minimal-light-white",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-tonal",name:"Use light mode (low contrast)",callback:()=>{this.settings.lightStyle="minimal-light-tonal",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-light-contrast",name:"Use light mode (high contrast)",callback:()=>{this.settings.lightStyle="minimal-light-contrast",this.saveData(this.settings),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-dark-default",name:"Use dark mode (default)",callback:()=>{this.settings.darkStyle="minimal-dark",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dark-tonal",name:"Use dark mode (low contrast)",callback:()=>{this.settings.darkStyle="minimal-dark-tonal",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dark-black",name:"Use dark mode (true black)",callback:()=>{this.settings.darkStyle="minimal-dark-black",this.saveData(this.settings),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-atom-light",name:"Switch light color scheme to Atom (light)",callback:()=>{this.settings.lightScheme="minimal-atom-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-ayu-light",name:"Switch light color scheme to Ayu (light)",callback:()=>{this.settings.lightScheme="minimal-ayu-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-catppuccin-light",name:"Switch light color scheme to Catppuccin (light)",callback:()=>{this.settings.lightScheme="minimal-catppuccin-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-default-light",name:"Switch light color scheme to default (light)",callback:()=>{this.settings.lightScheme="minimal-default-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-gruvbox-light",name:"Switch light color scheme to Gruvbox (light)",callback:()=>{this.settings.lightScheme="minimal-gruvbox-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-eink-light",name:"Switch light color scheme to E-ink (light)",callback:()=>{this.settings.lightScheme="minimal-eink-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-everforest-light",name:"Switch light color scheme to Everforest (light)",callback:()=>{this.settings.lightScheme="minimal-everforest-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-flexoki-light",name:"Switch light color scheme to Flexoki (light)",callback:()=>{this.settings.lightScheme="minimal-flexoki-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-macos-light",name:"Switch light color scheme to macOS (light)",callback:()=>{this.settings.lightScheme="minimal-macos-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-notion-light",name:"Switch light color scheme to Sky (light)",callback:()=>{this.settings.lightScheme="minimal-notion-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-nord-light",name:"Switch light color scheme to Nord (light)",callback:()=>{this.settings.lightScheme="minimal-nord-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-rose-pine-light",name:"Switch light color scheme to Ros\xE9 Pine (light)",callback:()=>{this.settings.lightScheme="minimal-rose-pine-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-solarized-light",name:"Switch light color scheme to Solarized (light)",callback:()=>{this.settings.lightScheme="minimal-solarized-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-things-light",name:"Switch light color scheme to Things (light)",callback:()=>{this.settings.lightScheme="minimal-things-light",this.saveData(this.settings),this.updateLightScheme(),this.updateLightStyle()}}),this.addCommand({id:"toggle-minimal-atom-dark",name:"Switch dark color scheme to Atom (dark)",callback:()=>{this.settings.darkScheme="minimal-atom-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-ayu-dark",name:"Switch dark color scheme to Ayu (dark)",callback:()=>{this.settings.darkScheme="minimal-ayu-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-catppuccin-dark",name:"Switch dark color scheme to Catppuccin (dark)",callback:()=>{this.settings.darkScheme="minimal-catppuccin-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dracula-dark",name:"Switch dark color scheme to Dracula (dark)",callback:()=>{this.settings.darkScheme="minimal-dracula-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-default-dark",name:"Switch dark color scheme to default (dark)",callback:()=>{this.settings.darkScheme="minimal-default-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-eink-dark",name:"Switch dark color scheme to E-ink (dark)",callback:()=>{this.settings.darkScheme="minimal-eink-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-everforest-dark",name:"Switch dark color scheme to Everforest (dark)",callback:()=>{this.settings.darkScheme="minimal-everforest-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-flexoki-dark",name:"Switch dark color scheme to Flexoki (dark)",callback:()=>{this.settings.darkScheme="minimal-flexoki-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-gruvbox-dark",name:"Switch dark color scheme to Gruvbox (dark)",callback:()=>{this.settings.darkScheme="minimal-gruvbox-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-macos-dark",name:"Switch dark color scheme to macOS (dark)",callback:()=>{this.settings.darkScheme="minimal-macos-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-nord-dark",name:"Switch dark color scheme to Nord (dark)",callback:()=>{this.settings.darkScheme="minimal-nord-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-notion-dark",name:"Switch dark color scheme to Sky (dark)",callback:()=>{this.settings.darkScheme="minimal-notion-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-rose-pine-dark",name:"Switch dark color scheme to Ros\xE9 Pine (dark)",callback:()=>{this.settings.darkScheme="minimal-rose-pine-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-solarized-dark",name:"Switch dark color scheme to Solarized (dark)",callback:()=>{this.settings.darkScheme="minimal-solarized-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-things-dark",name:"Switch dark color scheme to Things (dark)",callback:()=>{this.settings.darkScheme="minimal-things-dark",this.saveData(this.settings),this.updateDarkScheme(),this.updateDarkStyle()}}),this.addCommand({id:"toggle-minimal-dev-block-width",name:"Dev \u2014 Show block widths",callback:()=>{this.settings.devBlockWidth=!this.settings.devBlockWidth,this.saveData(this.settings),this.refresh()}}),this.refresh()})}onunload(){console.log("Unloading Minimal Theme Settings plugin");let t=document.getElementsByClassName("mod-left-split")[0];t&&t.removeClass("theme-dark");let s=document.getElementsByClassName("side-dock-ribbon")[0];s&&s.removeClass("theme-dark"),this.unloadRules(),this.removeStyle(),this.removeSettings(),this.removeLightScheme(),this.removeDarkScheme()}loadSettings(){return p(this,null,function*(){this.settings=Object.assign(D,yield this.loadData())})}saveSettings(){return p(this,null,function*(){yield this.saveData(this.settings)})}refresh(){this.updateStyle()}loadRules(){let t=document.createElement("style");t.id="minimal-theme",document.getElementsByTagName("head")[0].appendChild(t),document.body.classList.add("minimal-theme"),this.updateStyle()}unloadRules(){let t=document.getElementById("minimal-theme");t&&t.parentNode.removeChild(t),document.body.classList.remove("minimal-theme")}setFontSize(){this.app.vault.setConfig("baseFontSize",this.settings.textNormal),this.app.updateFontSize()}updateStyle(){this.removeStyle(),this.removeSettings(),document.body.addClass(this.settings.lightStyle,this.settings.lightScheme,this.settings.darkStyle,this.settings.darkScheme),document.body.classList.toggle("borders-none",!this.settings.bordersToggle),document.body.classList.toggle("colorful-headings",this.settings.colorfulHeadings),document.body.classList.toggle("colorful-frame",this.settings.colorfulFrame),document.body.classList.toggle("colorful-active",this.settings.colorfulActiveStates),document.body.classList.toggle("minimal-focus-mode",this.settings.focusMode),document.body.classList.toggle("links-int-on",this.settings.underlineInternal),document.body.classList.toggle("links-ext-on",this.settings.underlineExternal),document.body.classList.toggle("full-width-media",this.settings.fullWidthMedia),document.body.classList.toggle("img-grid",this.settings.imgGrid),document.body.classList.toggle("minimal-dev-block-width",this.settings.devBlockWidth),document.body.classList.toggle("minimal-status-off",!this.settings.minimalStatus),document.body.classList.toggle("full-file-names",!this.settings.trimNames),document.body.classList.toggle("labeled-nav",this.settings.labeledNav),document.body.classList.toggle("minimal-folding",this.settings.folding),document.body.addClass(this.settings.chartWidth,this.settings.tableWidth,this.settings.imgWidth,this.settings.iframeWidth,this.settings.mapWidth);let t=document.getElementById("minimal-theme");if(t)t.innerText="body.minimal-theme{--font-ui-small:"+this.settings.textSmall+"px;--line-height:"+this.settings.lineHeight+";--line-width:"+this.settings.lineWidth+"rem;--line-width-wide:"+this.settings.lineWidthWide+"rem;--max-width:"+this.settings.maxWidth+"%;--font-editor-override:"+this.settings.editorFont+";";else throw"minimal-theme element not found!"}updateDarkStyle(){document.body.removeClass("theme-light","minimal-dark","minimal-dark-tonal","minimal-dark-black"),document.body.addClass("theme-dark",this.settings.darkStyle),this.app.vault.getConfig("theme")!=="system"&&(this.app.setTheme("obsidian"),this.app.vault.setConfig("theme","obsidian")),this.app.workspace.trigger("css-change")}updateLightStyle(){document.body.removeClass("theme-dark","minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white"),document.body.addClass("theme-light",this.settings.lightStyle),this.app.vault.getConfig("theme")!=="system"&&(this.app.setTheme("moonstone"),this.app.vault.setConfig("theme","moonstone")),this.app.workspace.trigger("css-change")}updateDarkScheme(){this.removeDarkScheme(),document.body.addClass(this.settings.darkScheme)}updateLightScheme(){this.removeLightScheme(),document.body.addClass(this.settings.lightScheme)}updateTheme(){if(this.app.vault.getConfig("theme")==="system")document.body.classList.contains("theme-light")?(document.body.removeClass("theme-light"),document.body.addClass("theme-dark")):(document.body.removeClass("theme-dark"),document.body.addClass("theme-light"));else{document.body.classList.contains("theme-light")?(document.body.removeClass("theme-light"),document.body.addClass("theme-dark")):(document.body.removeClass("theme-dark"),document.body.addClass("theme-light"));let s=this.app.vault.getConfig("theme")==="moonstone"?"obsidian":"moonstone";this.app.setTheme(s),this.app.vault.setConfig("theme",s)}this.app.workspace.trigger("css-change")}removeSettings(){document.body.removeClass("borders-none","colorful-headings","colorful-frame","colorful-active","minimal-focus-mode","links-int-on","links-ext-on","full-width-media","img-grid","minimal-dev-block-width","minimal-status-off","full-file-names","labeled-nav","minimal-folding"),document.body.removeClass("table-wide","table-max","table-100","table-default-width","iframe-wide","iframe-max","iframe-100","iframe-default-width","img-wide","img-max","img-100","img-default-width","chart-wide","chart-max","chart-100","chart-default-width","map-wide","map-max","map-100","map-default-width")}removeStyle(){document.body.removeClass("minimal-light","minimal-light-tonal","minimal-light-contrast","minimal-light-white","minimal-dark","minimal-dark-tonal","minimal-dark-black")}removeDarkScheme(){document.body.removeClass("minimal-atom-dark","minimal-ayu-dark","minimal-catppuccin-dark","minimal-default-dark","minimal-dracula-dark","minimal-eink-dark","minimal-everforest-dark","minimal-flexoki-dark","minimal-gruvbox-dark","minimal-macos-dark","minimal-nord-dark","minimal-notion-dark","minimal-rose-pine-dark","minimal-solarized-dark","minimal-things-dark")}removeLightScheme(){document.body.removeClass("minimal-atom-light","minimal-ayu-light","minimal-catppuccin-light","minimal-default-light","minimal-eink-light","minimal-everforest-light","minimal-flexoki-light","minimal-gruvbox-light","minimal-macos-light","minimal-nord-light","minimal-notion-light","minimal-rose-pine-light","minimal-solarized-light","minimal-things-light")}};
diff --git a/.obsidian/plugins/obsidian-minimal-settings/manifest.json b/.obsidian/plugins/obsidian-minimal-settings/manifest.json
index 741b1c88..4606938b 100644
--- a/.obsidian/plugins/obsidian-minimal-settings/manifest.json
+++ b/.obsidian/plugins/obsidian-minimal-settings/manifest.json
@@ -1,7 +1,7 @@
{
"id": "obsidian-minimal-settings",
"name": "Minimal Theme Settings",
- "version": "8.0.2",
+ "version": "8.1.1",
"minAppVersion": "1.1.9",
"description": "Change the colors, fonts and features of Minimal Theme.",
"author": "@kepano",
diff --git a/.obsidian/plugins/obsidian-reminder-plugin/data.json b/.obsidian/plugins/obsidian-reminder-plugin/data.json
index 5ef196c8..0f3dde40 100644
--- a/.obsidian/plugins/obsidian-reminder-plugin/data.json
+++ b/.obsidian/plugins/obsidian-reminder-plugin/data.json
@@ -2,11 +2,6 @@
"scanned": true,
"reminders": {
"05.01 Computer setup/Storage and Syncing.md": [
- {
- "title": ":cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%%",
- "time": "2024-09-09",
- "rowNumber": 178
- },
{
"title": ":coin: Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%%",
"time": "2024-10-03",
@@ -25,7 +20,12 @@
{
"title": ":camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%%",
"time": "2024-10-10",
- "rowNumber": 180
+ "rowNumber": 181
+ },
+ {
+ "title": ":cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%%",
+ "time": "2024-12-09",
+ "rowNumber": 178
},
{
"title": ":iphone: Backup [[Storage and Syncing|news for previous year]] %%done_del%%",
@@ -48,33 +48,28 @@
"05.02 Networks/Server Cloud.md": [
{
"title": ":cloud: [[Selfhosting]], [[Server Cloud|Cloud]]: Upgrader & Health checks %%done_del%%",
- "time": "2024-09-01",
- "rowNumber": 284
+ "time": "2025-01-01",
+ "rowNumber": 285
},
{
"title": ":cloud: [[Server Cloud]]: Backup server %%done_del%%",
- "time": "2024-09-03",
+ "time": "2025-03-04",
"rowNumber": 279
}
],
"05.02 Networks/Server Alias.md": [
- {
- "title": ":email: [[Server Alias]]: Backup server %%done_del%%",
- "time": "2024-09-03",
- "rowNumber": 347
- },
{
"title": ":email: [[Selfhosting]], [[Server Alias|Email Alias]]: Upgrader & Health checks %%done_del%%",
"time": "2024-11-30",
"rowNumber": 338
+ },
+ {
+ "title": ":email: [[Server Alias]]: Backup server %%done_del%%",
+ "time": "2025-03-04",
+ "rowNumber": 347
}
],
"05.02 Networks/Server Tools.md": [
- {
- "title": ":closed_lock_with_key: [[Selfhosting]], [[Server Tools|Tools]]: Upgrader Bitwarden & Health checks %%done_del%%",
- "time": "2024-08-17",
- "rowNumber": 581
- },
{
"title": ":hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%%",
"time": "2024-10-01",
@@ -84,6 +79,11 @@
"title": ":desktop_computer: [[Selfhosting]], [[Server Tools|Tools]]: Upgrader Gitea & Health checks %%done_del%%",
"time": "2024-10-18",
"rowNumber": 579
+ },
+ {
+ "title": ":closed_lock_with_key: [[Selfhosting]], [[Server Tools|Tools]]: Upgrader Bitwarden & Health checks %%done_del%%",
+ "time": "2024-12-17",
+ "rowNumber": 581
}
],
"05.02 Networks/Server VPN.md": [
@@ -123,16 +123,16 @@
}
],
"04.01 lebv.org/lebv Research Tasks.md": [
- {
- "title": ":fleur_de_lis:: [[lebv Research Tasks|Research]]: Lieux: que sont devenus Fleurimont & Le Pavillon aujourd'hui?",
- "time": "2024-08-25",
- "rowNumber": 69
- },
{
"title": ":fleur_de_lis: [[lebv Research Tasks|Research]]: membres de la famille: reprendre les citations militaires (promotion/décoration)",
"time": "2024-09-30",
"rowNumber": 70
},
+ {
+ "title": ":fleur_de_lis:: [[lebv Research Tasks|Research]]: Lieux: que sont devenus Fleurimont & Le Pavillon aujourd'hui?",
+ "time": "2024-12-25",
+ "rowNumber": 69
+ },
{
"title": ":fleur_de_lis: [[lebv Research Tasks|Research]]: membres de la famille: éplucher les mentions du Nobiliaire de Guyenne & Gascogne",
"time": "2024-12-31",
@@ -140,27 +140,27 @@
}
],
"01.03 Family/Amaury de Villeneuve.md": [
- {
- "title": ":birthday: **[[Amaury de Villeneuve|Papa]]** %%done_del%%",
- "time": "2024-08-30",
- "rowNumber": 125
- },
{
"title": ":crown: Fête des pères %%done_del%%",
"time": "2025-06-15",
- "rowNumber": 129
+ "rowNumber": 130
+ },
+ {
+ "title": ":birthday: **[[Amaury de Villeneuve|Papa]]** %%done_del%%",
+ "time": "2025-08-30",
+ "rowNumber": 125
}
],
"01.03 Family/Laurence Bédier.md": [
- {
- "title": ":birthday: **[[Laurence Bédier|Maman]]** %%done_del%%",
- "time": "2024-09-04",
- "rowNumber": 105
- },
{
"title": ":crown: Fête des mères %%done_del%%",
"time": "2025-05-25",
- "rowNumber": 108
+ "rowNumber": 109
+ },
+ {
+ "title": ":birthday: **[[Laurence Bédier|Maman]]** %%done_del%%",
+ "time": "2025-09-04",
+ "rowNumber": 105
}
],
"01.03 Family/Noémie de Villeneuve.md": [
@@ -313,7 +313,7 @@
"01.03 Family/Hilaire Bédier.md": [
{
"title": ":birthday: **[[Hilaire Bédier|Hilaire]]** %%done_del%%",
- "time": "2024-08-26",
+ "time": "2025-08-26",
"rowNumber": 105
}
],
@@ -334,48 +334,48 @@
"01.02 Home/Household.md": [
{
"title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%",
- "time": "2024-08-20",
- "rowNumber": 78
+ "time": "2024-09-17",
+ "rowNumber": 80
},
{
"title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%",
- "time": "2024-08-26",
- "rowNumber": 87
+ "time": "2024-09-23",
+ "rowNumber": 92
},
{
"title": "♻ [[Household]]: *Paper* recycling collection %%done_del%%",
- "time": "2024-08-27",
+ "time": "2024-09-24",
"rowNumber": 75
},
{
"title": "🛎️ :house: [[Household]]: Pay rent %%done_del%%",
- "time": "2024-08-31",
- "rowNumber": 85
+ "time": "2024-09-30",
+ "rowNumber": 89
},
{
"title": ":blue_car: [[Household]]: Change to Winter tyres @ [[Rex Automobile CH]] %%done_del%%",
"time": "2024-10-15",
- "rowNumber": 96
+ "rowNumber": 103
},
{
"title": ":ski: [[Household]]: Organise yearly ski servicing ([[Ski Rental Zürich]]) %%done_del%%",
"time": "2024-10-31",
- "rowNumber": 104
+ "rowNumber": 111
},
{
"title": ":blue_car: [[Household]]: Clean car %%done_del%%",
"time": "2024-11-30",
- "rowNumber": 98
+ "rowNumber": 105
},
{
"title": ":blue_car: [[Household]]: Renew [road vignette](https://www.e-vignette.ch/) %%done_del%%",
"time": "2024-12-20",
- "rowNumber": 97
+ "rowNumber": 104
},
{
"title": ":blue_car: [[Household]]: Change to Summer tyres @ [[Rex Automobile CH]] %%done_del%%",
"time": "2025-04-15",
- "rowNumber": 95
+ "rowNumber": 102
}
],
"01.03 Family/Pia Bousquié.md": [
@@ -393,14 +393,9 @@
}
],
"01.01 Life Orga/@Finances.md": [
- {
- "title": ":heavy_dollar_sign: [[@Finances|Finances]]: Swiss tax self declaration %%done_del%%",
- "time": "2024-08-31",
- "rowNumber": 127
- },
{
"title": ":heavy_dollar_sign: [[@Finances|Finances]]: update crypto prices within Obsidian %%done_del%%",
- "time": "2024-09-10",
+ "time": "2024-10-08",
"rowNumber": 116
},
{
@@ -411,7 +406,12 @@
{
"title": ":heavy_dollar_sign: [[@Finances|Finances]]: Close yearly accounts %%done_del%%",
"time": "2025-01-07",
- "rowNumber": 125
+ "rowNumber": 118
+ },
+ {
+ "title": ":heavy_dollar_sign: [[@Finances|Finances]]: Swiss tax self declaration %%done_del%%",
+ "time": "2025-04-29",
+ "rowNumber": 119
}
],
"01.01 Life Orga/@Personal projects.md": [
@@ -451,30 +451,30 @@
"06.02 Investments/Crypto Tasks.md": [
{
"title": ":ballot_box_with_ballot: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%%",
- "time": "2024-09-03",
+ "time": "2024-10-01",
"rowNumber": 72
},
{
"title": ":chart: Check [[Nimbus]] earnings %%done_del%%",
- "time": "2024-09-09",
- "rowNumber": 93
+ "time": "2024-10-14",
+ "rowNumber": 94
}
],
"05.02 Networks/Configuring UFW.md": [
{
"title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%%",
- "time": "2024-08-17",
+ "time": "2024-09-14",
"rowNumber": 239
},
{
"title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%%",
- "time": "2024-08-17",
- "rowNumber": 321
+ "time": "2024-09-14",
+ "rowNumber": 243
},
{
"title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%%",
- "time": "2024-08-17",
- "rowNumber": 328
+ "time": "2024-09-14",
+ "rowNumber": 247
}
],
"01.03 Family/Amélie Solanet.md": [
@@ -515,21 +515,21 @@
"00.08 Bookmarks/Bookmarks - Selfhosted Apps.md": [
{
"title": ":label: [[Bookmarks - Selfhosted apps]]: Review bookmarks %%done_del%%",
- "time": "2024-08-22",
+ "time": "2024-11-22",
"rowNumber": 178
}
],
"00.08 Bookmarks/Bookmarks - Utilities.md": [
{
"title": ":label: [[Bookmarks - Utilities]]: review bookmarks %%done_del%%",
- "time": "2024-09-02",
+ "time": "2024-12-02",
"rowNumber": 172
}
],
"00.08 Bookmarks/Bookmarks - Mac applications.md": [
{
"title": ":label: [[Bookmarks - Mac applications]]: review bookmarks %%done_del%%",
- "time": "2024-09-09",
+ "time": "2024-12-09",
"rowNumber": 123
}
],
@@ -555,35 +555,30 @@
}
],
"02.02 Paris/@@Paris.md": [
- {
- "title": ":sunny: :racehorse: [[@@Paris|:test_grandes_armes_de_paris:]]: Check out the [Open de France](https://www.poloclubchantilly.com/)",
- "time": "2024-08-25",
- "rowNumber": 109
- },
- {
- "title": ":maple_leaf: :partying_face: [[@@Paris|:test_grandes_armes_de_paris:]]: Fête des Puces %%done_del%%",
- "time": "2024-09-21",
- "rowNumber": 99
- },
{
"title": "🎭:frame_with_picture: [[@@Paris|:test_grandes_armes_de_paris:]]: Check out [exhibitions](https://www.offi.fr/expositions-musees/programme.html) %%done_del%%",
"time": "2024-10-31",
"rowNumber": 90
},
{
- "title": ":birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%%",
- "time": "2024-12-12",
- "rowNumber": 150
+ "title": ":maple_leaf: :partying_face: [[@@Paris|:test_grandes_armes_de_paris:]]: Fête des Puces %%done_del%%",
+ "time": "2024-09-21",
+ "rowNumber": 96
},
{
- "title": ":snowflake: :sports_medal:[[@@Paris|:test_grandes_armes_de_paris:]]: Check out the [6 Nations](https://billetterie.ffr.fr/fr)",
+ "title": ":snowflake: :sports_medal:[[@@Paris|:test_grandes_armes_de_paris:]]: Check out the [6 Nations](https://billetterie.ffr.fr/fr) %%done_del%%",
"time": "2025-01-30",
- "rowNumber": 105
+ "rowNumber": 102
},
{
- "title": ":sunny: :sports_medal:[[@@Paris|:test_grandes_armes_de_paris:]]: Check out [RG](https://www.rolandgarros.com/fr-fr/page/billetterie-roland-garros)",
+ "title": ":sunny: :sports_medal:[[@@Paris|:test_grandes_armes_de_paris:]]: Check out [RG](https://www.rolandgarros.com/fr-fr/page/billetterie-roland-garros) %%done_del%%",
"time": "2025-03-10",
- "rowNumber": 107
+ "rowNumber": 103
+ },
+ {
+ "title": ":birthday: **Virginie Parent**, [[@@Paris|Paris]] %%done_del%%",
+ "time": "2024-12-12",
+ "rowNumber": 144
}
],
"00.01 Admin/Calendars/2022-08-26.md": [
@@ -640,15 +635,45 @@
}
],
"01.01 Life Orga/@Lifestyle.md": [
+ {
+ "title": "🏊🏼♂️ [[@Lifestyle|Lifestyle]]: Swim more regularly in Summer",
+ "time": "2024-09-30",
+ "rowNumber": 80
+ },
+ {
+ "title": ":snowflake: :racehorse: [[@Switzerland|St. Moritz]], [[@Lifestyle|Lifestyle]]: Check out the [St Moritz Snow Polo](https://www.snowpolo-stmoritz.com/) %%done_del%%",
+ "time": "2024-10-15",
+ "rowNumber": 228
+ },
+ {
+ "title": ":snowflake: :racehorse: 🇦🇷 [[@Lifestyle|Lifestyle]]: Check out the Abierto de Polo %%done_del%%",
+ "time": "2024-11-15",
+ "rowNumber": 229
+ },
{
"title": "🍎 [[@Lifestyle|Lifestyle]]: Transitioner sucres synthétiques vers sucres naturels",
"time": "2024-12-31",
"rowNumber": 79
},
{
- "title": "🎹 [[@Lifestyle|Lifestyle]]: Start a vinyl collection",
- "time": "2024-12-31",
- "rowNumber": 81
+ "title": ":watch: [[@Lifestyle|Lifestyle]] Change wristband of B&M watch %%done_del%%",
+ "time": "2025-03-21",
+ "rowNumber": 117
+ },
+ {
+ "title": ":sunny: :racehorse: [[@France|:fr:]], [[@Lifestyle|Lifestyle]]: Check out the [Coupe d’Or](https://www.deauvillepoloclub.com/coupe-d-or) %%done_del%%",
+ "time": "2025-08-10",
+ "rowNumber": 225
+ },
+ {
+ "title": ":sunny: :racehorse: [[@Switzerland|Gstaad]], [[@Lifestyle|Lifestyle]]: Check out the [Gold Cup Gstaad](https://www.polo-gstaad.ch/) %%done_del%%",
+ "time": "2025-08-10",
+ "rowNumber": 227
+ },
+ {
+ "title": ":sunny: :racehorse: [[@@Paris|Paris]], [[@Lifestyle|Lifestyle]]: Check out the [Open de France](https://www.poloclubchantilly.com/) %%done_del%%",
+ "time": "2025-08-25",
+ "rowNumber": 226
}
],
"06.02 Investments/Equity Tasks.md": [
@@ -673,16 +698,16 @@
}
],
"01.07 Animals/@Sally.md": [
- {
- "title": ":racehorse: [[@Sally|Sally]]: Pay for horseshoes (150 CHF) %%done_del%%",
- "time": "2024-09-10",
- "rowNumber": 142
- },
{
"title": ":racehorse: [[@Sally|Sally]]: Vet check %%done_del%%",
"time": "2024-09-30",
"rowNumber": 136
},
+ {
+ "title": ":racehorse: [[@Sally|Sally]]: Pay for horseshoes (150 CHF) %%done_del%%",
+ "time": "2024-10-10",
+ "rowNumber": 142
+ },
{
"title": ":racehorse: [[@Sally|Sally]]: EHV-1 vaccination dose %%done_del%%",
"time": "2025-01-31",
@@ -717,15 +742,15 @@
],
"01.07 Animals/2023-07-13 Health check.md": [
{
- "title": ":racehorse: [[@Sally|Sally]], [[2023-07-13 Health check|Note]]: Check front hoofs healing",
- "time": "2024-08-27",
+ "title": ":racehorse: [[@Sally|Sally]], [[2023-07-13 Health check|Note]]: Check front hoofs healing %%done_del%%",
+ "time": "2024-10-10",
"rowNumber": 53
}
],
"01.03 Family/Ophélie Bédier.md": [
{
"title": ":birthday: **[[Ophélie Bédier|Ophélie]]** %%done_del%%",
- "time": "2024-09-05",
+ "time": "2025-09-05",
"rowNumber": 105
}
],
@@ -760,7 +785,7 @@
"00.08 Bookmarks/Bookmarks - Art.md": [
{
"title": ":label: [[Bookmarks - Art]]: Review bookmarks %%done_del%%",
- "time": "2024-08-26",
+ "time": "2024-11-26",
"rowNumber": 97
}
],
@@ -779,11 +804,6 @@
}
],
"02.03 Zürich/@@Zürich.md": [
- {
- "title": ":sunny: :partying_face: [[@@Zürich|:test_zurich_coat_of_arms:]]: Zürich Openair %%done_del%%",
- "time": "2024-08-23",
- "rowNumber": 121
- },
{
"title": "🎭:frame_with_picture: [[@@Zürich|:test_zurich_coat_of_arms:]]: Check out exhibitions at the [Rietberg](https://rietberg.ch/en/) %%done_del%%",
"time": "2024-09-15",
@@ -842,7 +862,7 @@
{
"title": ":hibiscus: :runner: [[@@Zürich|Zürich]]: Zürich Marathon %%done_del%%",
"time": "2025-04-21",
- "rowNumber": 129
+ "rowNumber": 130
},
{
"title": ":hibiscus: :fork_and_knife: [[@@Zürich|:test_zurich_coat_of_arms:]]: Book a restaurant with terrace for the season: [[Albishaus]], [[Restaurant Boldern]], [[Zur Buech]], [[Jardin Zürichberg]], [[Bistro Rigiblick]], [[Portofino am See]], [[La Réserve|La Muña]] %%done_del%%",
@@ -872,17 +892,22 @@
{
"title": ":sunny: :runner: [[@@Zürich|:test_zurich_coat_of_arms:]]: Check out tickets to Weltklasse Zürich %%done_del%%",
"time": "2025-08-01",
- "rowNumber": 130
+ "rowNumber": 131
},
{
"title": ":sunny: :partying_face: [[@@Zürich|:test_zurich_coat_of_arms:]]: Street Parade %%done_del%%",
"time": "2025-08-10",
"rowNumber": 118
},
+ {
+ "title": ":sunny: :partying_face: [[@@Zürich|:test_zurich_coat_of_arms:]]: Zürich Openair %%done_del%%",
+ "time": "2025-08-23",
+ "rowNumber": 121
+ },
{
"title": ":sunny: :partying_face: [[@@Zürich|:test_zurich_coat_of_arms:]]: Check out Seenachtfest Rapperswil-Jona %%done_del%%",
"time": "2027-08-01",
- "rowNumber": 122
+ "rowNumber": 123
}
],
"03.02 Travels/Geneva.md": [
@@ -988,25 +1013,25 @@
"00.01 Admin/Calendars/2024-04-29.md": [
{
"title": "09:12 🍴: [[@@Zürich|Zürich]]: Book [[Restaurant Boldern]]",
- "time": "2024-07-30",
+ "time": "2024-09-20",
"rowNumber": 105
},
{
"title": "09:13 :fork_and_knife: [[@@Zürich|Zürich]]: Book [[Zur Buech]]",
- "time": "2024-08-30",
+ "time": "2024-09-30",
"rowNumber": 106
}
],
"01.06 Health/2024-06-29 Fungal treatment.md": [
{
"title": ":test_pharmacie_logo_svg_vector: [[2024-06-29 Fungal treatment|Fungus]]: Take the pill %%done_del%%",
- "time": "2024-08-17",
+ "time": "2024-09-12",
"rowNumber": 58
},
{
"title": ":test_pharmacie_logo_svg_vector: [[2024-06-29 Fungal treatment|Fungus]]: Nail lack %%done_del%%",
- "time": "2024-08-17",
- "rowNumber": 90
+ "time": "2024-09-12",
+ "rowNumber": 116
}
],
"01.06 Health/2023-02-25 Polyp in Galbladder.md": [
@@ -1017,16 +1042,51 @@
}
],
"00.01 Admin/Calendars/2024-07-29.md": [
+ {
+ "title": "09:20 📨 [[@Family|Family]]: Repondre a Papa",
+ "time": "2024-08-30",
+ "rowNumber": 104
+ },
{
"title": "08:18 ⚽ [[@Lifestyle|Lifestyle]]: Check the Como 07 [schedule](https://comofootball.com/en/matches-and-tickets/)",
- "time": "2024-08-20",
+ "time": "2024-09-15",
"rowNumber": 103
- },
+ }
+ ],
+ "05.02 Networks/Selfhosting.md": [
{
- "title": "09:20 📨 [[@Family|Family]]: Repondre a Papa",
- "time": "2024-08-30",
+ "title": ":desktop_computer: [[Selfhosting|Self hosting]]: Check log activity for all servers %%done_del%%",
+ "time": "2024-09-17",
+ "rowNumber": 302
+ }
+ ],
+ "04.03 Creative snippets/New Year well Wishes.md": [
+ {
+ "title": ":clinking_glasses: [[New Year well Wishes]]: Check to use text for New Year's well wishes %%done_del%%",
+ "time": "2024-12-29",
+ "rowNumber": 108
+ }
+ ],
+ "00.01 Admin/Calendars/2024-09-03.md": [
+ {
+ "title": "13:44 :tshirt: [[@Lifestyle|Lifestyle]]: Check sales on 3rd jersey (black with horse) of Juventus, [[2024-09-03|link]]",
+ "time": "2025-04-30",
+ "rowNumber": 103
+ }
+ ],
+ "00.01 Admin/Calendars/2024-09-04.md": [
+ {
+ "title": "17:49 :blue_car: [[@Life Admin|Admin]]: Contact garage for revision, [[2024-09-04|link]]",
+ "time": "2024-09-15",
"rowNumber": 104
}
+ ],
+ "00.01 Admin/Calendars/2024-09-08.md": [
+ {
+ "title": "08:35 :movie_camera: [[@Lifestyle|Lifestyle]]: Download Dersou Ouzala [[2024-09-08|link]]",
+ "time": "2024-09-17",
+ "rowNumber": 103
+ }
]
},
"debug": false,
diff --git a/.obsidian/plugins/obsidian-style-settings/main.js b/.obsidian/plugins/obsidian-style-settings/main.js
index b7e0ea00..0e0ed28f 100644
--- a/.obsidian/plugins/obsidian-style-settings/main.js
+++ b/.obsidian/plugins/obsidian-style-settings/main.js
@@ -1,9858 +1,163 @@
/*
-THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
-if you want to view the source visit the plugins github repository
+THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
+if you want to view the source, please visit the github repository of this plugin
*/
-'use strict';
-
-var obsidian = require('obsidian');
-
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-
-function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-}
-
-class ExportModal extends obsidian.Modal {
- constructor(app, plugin, section, config) {
- super(app);
- this.plugin = plugin;
- this.config = config;
- this.section = section;
- }
- onOpen() {
- const { contentEl, modalEl } = this;
- modalEl.addClass('modal-style-settings');
- new obsidian.Setting(contentEl)
- .setName(`Export settings for: ${this.section}`)
- .then((setting) => {
- const output = JSON.stringify(this.config, null, 2);
- // Build a copy to clipboard link
- setting.controlEl.createEl('a', {
- cls: 'style-settings-copy',
- text: 'Copy to clipboard',
- href: '#',
- }, (copyButton) => {
- new obsidian.TextAreaComponent(contentEl)
- .setValue(output)
- .then((textarea) => {
- copyButton.addEventListener('click', (e) => {
- e.preventDefault();
- // Select the textarea contents and copy them to the clipboard
- textarea.inputEl.select();
- textarea.inputEl.setSelectionRange(0, 99999);
- document.execCommand('copy');
- copyButton.addClass('success');
- setTimeout(() => {
- // If the button is still in the dom, remove the success class
- if (copyButton.parentNode) {
- copyButton.removeClass('success');
- }
- }, 2000);
- });
- });
- });
- // Build a download link
- setting.controlEl.createEl('a', {
- cls: 'style-settings-download',
- text: 'Download',
- attr: {
- download: 'style-settings.json',
- href: `data:application/json;charset=utf-8,${encodeURIComponent(output)}`,
- },
- });
- });
- }
- onClose() {
- const { contentEl } = this;
- contentEl.empty();
- }
-}
-
-class ImportModal extends obsidian.Modal {
- constructor(app, plugin) {
- super(app);
- this.plugin = plugin;
- }
- onOpen() {
- const { contentEl, modalEl } = this;
- modalEl.addClass('modal-style-settings');
- new obsidian.Setting(contentEl)
- .setName('Import style setting')
- .setDesc('Import an entire or partial configuration. Warning: this may override existing settings');
- new obsidian.Setting(contentEl).then((setting) => {
- // Build an error message container
- const errorSpan = createSpan({
- cls: 'style-settings-import-error',
- text: 'Error importing config',
- });
- setting.nameEl.appendChild(errorSpan);
- // Attempt to parse the imported data and close if successful
- const importAndClose = (str) => __awaiter(this, void 0, void 0, function* () {
- if (str) {
- try {
- const importedSettings = JSON.parse(str);
- yield this.plugin.settingsManager.setSettings(importedSettings);
- this.plugin.settingsTab.display();
- this.close();
- }
- catch (e) {
- errorSpan.addClass('active');
- errorSpan.setText(`Error importing style settings: ${e}`);
- }
- }
- else {
- errorSpan.addClass('active');
- errorSpan.setText(`Error importing style settings: config is empty`);
- }
- });
- // Build a file input
- setting.controlEl.createEl('input', {
- cls: 'style-settings-import-input',
- attr: {
- id: 'style-settings-import-input',
- name: 'style-settings-import-input',
- type: 'file',
- accept: '.json',
- },
- }, (importInput) => {
- // Set up a FileReader so we can parse the file contents
- importInput.addEventListener('change', (e) => {
- const reader = new FileReader();
- reader.onload = (e) => __awaiter(this, void 0, void 0, function* () {
- yield importAndClose(e.target.result.toString().trim());
- });
- reader.readAsText(e.target.files[0]);
- });
- });
- // Build a label we will style as a link
- setting.controlEl.createEl('label', {
- cls: 'style-settings-import-label',
- text: 'Import from file',
- attr: {
- for: 'style-settings-import-input',
- },
- });
- new obsidian.TextAreaComponent(contentEl)
- .setPlaceholder('Paste config here...')
- .then((ta) => {
- new obsidian.ButtonComponent(contentEl)
- .setButtonText('Save')
- .onClick(() => __awaiter(this, void 0, void 0, function* () {
- yield importAndClose(ta.getValue().trim());
- }));
- });
- });
- }
- onClose() {
- const { contentEl } = this;
- contentEl.empty();
- }
-}
-
-const SettingType = {
- HEADING: 'heading',
- INFO_TEXT: 'info-text',
- CLASS_TOGGLE: 'class-toggle',
- CLASS_SELECT: 'class-select',
- VARIABLE_TEXT: 'variable-text',
- VARIABLE_NUMBER: 'variable-number',
- VARIABLE_NUMBER_SLIDER: 'variable-number-slider',
- VARIABLE_SELECT: 'variable-select',
- VARIABLE_COLOR: 'variable-color',
- VARIABLE_THEMED_COLOR: 'variable-themed-color',
- COLOR_GRADIENT: 'color-gradient',
-};
-
-var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
-function getDefaultExportFromCjs (x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
-}
-
-function createCommonjsModule(fn, basedir, module) {
- return module = {
- path: basedir,
- exports: {},
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
- }
- }, fn(module, module.exports), module.exports;
-}
-
-function commonjsRequire () {
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
-}
-
-var chroma = createCommonjsModule(function (module, exports) {
-/**
- * chroma.js - JavaScript library for color conversions
- *
- * Copyright (c) 2011-2019, Gregor Aisch
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The name Gregor Aisch may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * -------------------------------------------------------
- *
- * chroma.js includes colors from colorbrewer2.org, which are released under
- * the following license:
- *
- * Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
- * and The Pennsylvania State University.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * ------------------------------------------------------
- *
- * Named colors are taken from X11 Color Names.
- * http://www.w3.org/TR/css3-color/#svg-color
- *
- * @preserve
- */
-
-(function (global, factory) {
- module.exports = factory() ;
-}(commonjsGlobal, (function () {
- var limit = function (x, min, max) {
- if ( min === void 0 ) min=0;
- if ( max === void 0 ) max=1;
-
- return x < min ? min : x > max ? max : x;
- };
-
- var clip_rgb = function (rgb) {
- rgb._clipped = false;
- rgb._unclipped = rgb.slice(0);
- for (var i=0; i<=3; i++) {
- if (i < 3) {
- if (rgb[i] < 0 || rgb[i] > 255) { rgb._clipped = true; }
- rgb[i] = limit(rgb[i], 0, 255);
- } else if (i === 3) {
- rgb[i] = limit(rgb[i], 0, 1);
- }
- }
- return rgb;
- };
-
- // ported from jQuery's $.type
- var classToType = {};
- for (var i = 0, list = ['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Undefined', 'Null']; i < list.length; i += 1) {
- var name = list[i];
-
- classToType[("[object " + name + "]")] = name.toLowerCase();
- }
- var type = function(obj) {
- return classToType[Object.prototype.toString.call(obj)] || "object";
- };
-
- var unpack = function (args, keyOrder) {
- if ( keyOrder === void 0 ) keyOrder=null;
-
- // if called with more than 3 arguments, we return the arguments
- if (args.length >= 3) { return Array.prototype.slice.call(args); }
- // with less than 3 args we check if first arg is object
- // and use the keyOrder string to extract and sort properties
- if (type(args[0]) == 'object' && keyOrder) {
- return keyOrder.split('')
- .filter(function (k) { return args[0][k] !== undefined; })
- .map(function (k) { return args[0][k]; });
- }
- // otherwise we just return the first argument
- // (which we suppose is an array of args)
- return args[0];
- };
-
- var last = function (args) {
- if (args.length < 2) { return null; }
- var l = args.length-1;
- if (type(args[l]) == 'string') { return args[l].toLowerCase(); }
- return null;
- };
-
- var PI = Math.PI;
-
- var utils = {
- clip_rgb: clip_rgb,
- limit: limit,
- type: type,
- unpack: unpack,
- last: last,
- PI: PI,
- TWOPI: PI*2,
- PITHIRD: PI/3,
- DEG2RAD: PI / 180,
- RAD2DEG: 180 / PI
- };
-
- var input = {
- format: {},
- autodetect: []
- };
-
- var last$1 = utils.last;
- var clip_rgb$1 = utils.clip_rgb;
- var type$1 = utils.type;
-
-
- var Color = function Color() {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var me = this;
- if (type$1(args[0]) === 'object' &&
- args[0].constructor &&
- args[0].constructor === this.constructor) {
- // the argument is already a Color instance
- return args[0];
- }
-
- // last argument could be the mode
- var mode = last$1(args);
- var autodetect = false;
-
- if (!mode) {
- autodetect = true;
- if (!input.sorted) {
- input.autodetect = input.autodetect.sort(function (a,b) { return b.p - a.p; });
- input.sorted = true;
- }
- // auto-detect format
- for (var i = 0, list = input.autodetect; i < list.length; i += 1) {
- var chk = list[i];
-
- mode = chk.test.apply(chk, args);
- if (mode) { break; }
- }
- }
-
- if (input.format[mode]) {
- var rgb = input.format[mode].apply(null, autodetect ? args : args.slice(0,-1));
- me._rgb = clip_rgb$1(rgb);
- } else {
- throw new Error('unknown format: '+args);
- }
-
- // add alpha channel
- if (me._rgb.length === 3) { me._rgb.push(1); }
- };
-
- Color.prototype.toString = function toString () {
- if (type$1(this.hex) == 'function') { return this.hex(); }
- return ("[" + (this._rgb.join(',')) + "]");
- };
-
- var Color_1 = Color;
-
- var chroma = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( chroma.Color, [ null ].concat( args) ));
- };
-
- chroma.Color = Color_1;
- chroma.version = '2.1.2';
-
- var chroma_1 = chroma;
-
- var unpack$1 = utils.unpack;
- var max = Math.max;
-
- var rgb2cmyk = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$1(args, 'rgb');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- r = r / 255;
- g = g / 255;
- b = b / 255;
- var k = 1 - max(r,max(g,b));
- var f = k < 1 ? 1 / (1-k) : 0;
- var c = (1-r-k) * f;
- var m = (1-g-k) * f;
- var y = (1-b-k) * f;
- return [c,m,y,k];
- };
-
- var rgb2cmyk_1 = rgb2cmyk;
-
- var unpack$2 = utils.unpack;
-
- var cmyk2rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$2(args, 'cmyk');
- var c = args[0];
- var m = args[1];
- var y = args[2];
- var k = args[3];
- var alpha = args.length > 4 ? args[4] : 1;
- if (k === 1) { return [0,0,0,alpha]; }
- return [
- c >= 1 ? 0 : 255 * (1-c) * (1-k), // r
- m >= 1 ? 0 : 255 * (1-m) * (1-k), // g
- y >= 1 ? 0 : 255 * (1-y) * (1-k), // b
- alpha
- ];
- };
-
- var cmyk2rgb_1 = cmyk2rgb;
-
- var unpack$3 = utils.unpack;
- var type$2 = utils.type;
-
-
-
- Color_1.prototype.cmyk = function() {
- return rgb2cmyk_1(this._rgb);
- };
-
- chroma_1.cmyk = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['cmyk']) ));
- };
-
- input.format.cmyk = cmyk2rgb_1;
-
- input.autodetect.push({
- p: 2,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$3(args, 'cmyk');
- if (type$2(args) === 'array' && args.length === 4) {
- return 'cmyk';
- }
- }
- });
-
- var unpack$4 = utils.unpack;
- var last$2 = utils.last;
- var rnd = function (a) { return Math.round(a*100)/100; };
-
- /*
- * supported arguments:
- * - hsl2css(h,s,l)
- * - hsl2css(h,s,l,a)
- * - hsl2css([h,s,l], mode)
- * - hsl2css([h,s,l,a], mode)
- * - hsl2css({h,s,l,a}, mode)
- */
- var hsl2css = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var hsla = unpack$4(args, 'hsla');
- var mode = last$2(args) || 'lsa';
- hsla[0] = rnd(hsla[0] || 0);
- hsla[1] = rnd(hsla[1]*100) + '%';
- hsla[2] = rnd(hsla[2]*100) + '%';
- if (mode === 'hsla' || (hsla.length > 3 && hsla[3]<1)) {
- hsla[3] = hsla.length > 3 ? hsla[3] : 1;
- mode = 'hsla';
- } else {
- hsla.length = 3;
- }
- return (mode + "(" + (hsla.join(',')) + ")");
- };
-
- var hsl2css_1 = hsl2css;
-
- var unpack$5 = utils.unpack;
-
- /*
- * supported arguments:
- * - rgb2hsl(r,g,b)
- * - rgb2hsl(r,g,b,a)
- * - rgb2hsl([r,g,b])
- * - rgb2hsl([r,g,b,a])
- * - rgb2hsl({r,g,b,a})
- */
- var rgb2hsl = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$5(args, 'rgba');
- var r = args[0];
- var g = args[1];
- var b = args[2];
-
- r /= 255;
- g /= 255;
- b /= 255;
-
- var min = Math.min(r, g, b);
- var max = Math.max(r, g, b);
-
- var l = (max + min) / 2;
- var s, h;
-
- if (max === min){
- s = 0;
- h = Number.NaN;
- } else {
- s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);
- }
-
- if (r == max) { h = (g - b) / (max - min); }
- else if (g == max) { h = 2 + (b - r) / (max - min); }
- else if (b == max) { h = 4 + (r - g) / (max - min); }
-
- h *= 60;
- if (h < 0) { h += 360; }
- if (args.length>3 && args[3]!==undefined) { return [h,s,l,args[3]]; }
- return [h,s,l];
- };
-
- var rgb2hsl_1 = rgb2hsl;
-
- var unpack$6 = utils.unpack;
- var last$3 = utils.last;
-
-
- var round = Math.round;
-
- /*
- * supported arguments:
- * - rgb2css(r,g,b)
- * - rgb2css(r,g,b,a)
- * - rgb2css([r,g,b], mode)
- * - rgb2css([r,g,b,a], mode)
- * - rgb2css({r,g,b,a}, mode)
- */
- var rgb2css = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var rgba = unpack$6(args, 'rgba');
- var mode = last$3(args) || 'rgb';
- if (mode.substr(0,3) == 'hsl') {
- return hsl2css_1(rgb2hsl_1(rgba), mode);
- }
- rgba[0] = round(rgba[0]);
- rgba[1] = round(rgba[1]);
- rgba[2] = round(rgba[2]);
- if (mode === 'rgba' || (rgba.length > 3 && rgba[3]<1)) {
- rgba[3] = rgba.length > 3 ? rgba[3] : 1;
- mode = 'rgba';
- }
- return (mode + "(" + (rgba.slice(0,mode==='rgb'?3:4).join(',')) + ")");
- };
-
- var rgb2css_1 = rgb2css;
-
- var unpack$7 = utils.unpack;
- var round$1 = Math.round;
-
- var hsl2rgb = function () {
- var assign;
-
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- args = unpack$7(args, 'hsl');
- var h = args[0];
- var s = args[1];
- var l = args[2];
- var r,g,b;
- if (s === 0) {
- r = g = b = l*255;
- } else {
- var t3 = [0,0,0];
- var c = [0,0,0];
- var t2 = l < 0.5 ? l * (1+s) : l+s-l*s;
- var t1 = 2 * l - t2;
- var h_ = h / 360;
- t3[0] = h_ + 1/3;
- t3[1] = h_;
- t3[2] = h_ - 1/3;
- for (var i=0; i<3; i++) {
- if (t3[i] < 0) { t3[i] += 1; }
- if (t3[i] > 1) { t3[i] -= 1; }
- if (6 * t3[i] < 1)
- { c[i] = t1 + (t2 - t1) * 6 * t3[i]; }
- else if (2 * t3[i] < 1)
- { c[i] = t2; }
- else if (3 * t3[i] < 2)
- { c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6; }
- else
- { c[i] = t1; }
- }
- (assign = [round$1(c[0]*255),round$1(c[1]*255),round$1(c[2]*255)], r = assign[0], g = assign[1], b = assign[2]);
- }
- if (args.length > 3) {
- // keep alpha channel
- return [r,g,b,args[3]];
- }
- return [r,g,b,1];
- };
-
- var hsl2rgb_1 = hsl2rgb;
-
- var RE_RGB = /^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/;
- var RE_RGBA = /^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/;
- var RE_RGB_PCT = /^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;
- var RE_RGBA_PCT = /^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;
- var RE_HSL = /^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;
- var RE_HSLA = /^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;
-
- var round$2 = Math.round;
-
- var css2rgb = function (css) {
- css = css.toLowerCase().trim();
- var m;
-
- if (input.format.named) {
- try {
- return input.format.named(css);
- } catch (e) {
- // eslint-disable-next-line
- }
- }
-
- // rgb(250,20,0)
- if ((m = css.match(RE_RGB))) {
- var rgb = m.slice(1,4);
- for (var i=0; i<3; i++) {
- rgb[i] = +rgb[i];
- }
- rgb[3] = 1; // default alpha
- return rgb;
- }
-
- // rgba(250,20,0,0.4)
- if ((m = css.match(RE_RGBA))) {
- var rgb$1 = m.slice(1,5);
- for (var i$1=0; i$1<4; i$1++) {
- rgb$1[i$1] = +rgb$1[i$1];
- }
- return rgb$1;
- }
-
- // rgb(100%,0%,0%)
- if ((m = css.match(RE_RGB_PCT))) {
- var rgb$2 = m.slice(1,4);
- for (var i$2=0; i$2<3; i$2++) {
- rgb$2[i$2] = round$2(rgb$2[i$2] * 2.55);
- }
- rgb$2[3] = 1; // default alpha
- return rgb$2;
- }
-
- // rgba(100%,0%,0%,0.4)
- if ((m = css.match(RE_RGBA_PCT))) {
- var rgb$3 = m.slice(1,5);
- for (var i$3=0; i$3<3; i$3++) {
- rgb$3[i$3] = round$2(rgb$3[i$3] * 2.55);
- }
- rgb$3[3] = +rgb$3[3];
- return rgb$3;
- }
-
- // hsl(0,100%,50%)
- if ((m = css.match(RE_HSL))) {
- var hsl = m.slice(1,4);
- hsl[1] *= 0.01;
- hsl[2] *= 0.01;
- var rgb$4 = hsl2rgb_1(hsl);
- rgb$4[3] = 1;
- return rgb$4;
- }
-
- // hsla(0,100%,50%,0.5)
- if ((m = css.match(RE_HSLA))) {
- var hsl$1 = m.slice(1,4);
- hsl$1[1] *= 0.01;
- hsl$1[2] *= 0.01;
- var rgb$5 = hsl2rgb_1(hsl$1);
- rgb$5[3] = +m[4]; // default alpha = 1
- return rgb$5;
- }
- };
-
- css2rgb.test = function (s) {
- return RE_RGB.test(s) ||
- RE_RGBA.test(s) ||
- RE_RGB_PCT.test(s) ||
- RE_RGBA_PCT.test(s) ||
- RE_HSL.test(s) ||
- RE_HSLA.test(s);
- };
-
- var css2rgb_1 = css2rgb;
-
- var type$3 = utils.type;
-
-
-
-
- Color_1.prototype.css = function(mode) {
- return rgb2css_1(this._rgb, mode);
- };
-
- chroma_1.css = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['css']) ));
- };
-
- input.format.css = css2rgb_1;
-
- input.autodetect.push({
- p: 5,
- test: function (h) {
- var rest = [], len = arguments.length - 1;
- while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];
-
- if (!rest.length && type$3(h) === 'string' && css2rgb_1.test(h)) {
- return 'css';
- }
- }
- });
-
- var unpack$8 = utils.unpack;
-
- input.format.gl = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var rgb = unpack$8(args, 'rgba');
- rgb[0] *= 255;
- rgb[1] *= 255;
- rgb[2] *= 255;
- return rgb;
- };
-
- chroma_1.gl = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['gl']) ));
- };
-
- Color_1.prototype.gl = function() {
- var rgb = this._rgb;
- return [rgb[0]/255, rgb[1]/255, rgb[2]/255, rgb[3]];
- };
-
- var unpack$9 = utils.unpack;
-
- var rgb2hcg = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$9(args, 'rgb');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- var min = Math.min(r, g, b);
- var max = Math.max(r, g, b);
- var delta = max - min;
- var c = delta * 100 / 255;
- var _g = min / (255 - delta) * 100;
- var h;
- if (delta === 0) {
- h = Number.NaN;
- } else {
- if (r === max) { h = (g - b) / delta; }
- if (g === max) { h = 2+(b - r) / delta; }
- if (b === max) { h = 4+(r - g) / delta; }
- h *= 60;
- if (h < 0) { h += 360; }
- }
- return [h, c, _g];
- };
-
- var rgb2hcg_1 = rgb2hcg;
-
- var unpack$a = utils.unpack;
- var floor = Math.floor;
-
- /*
- * this is basically just HSV with some minor tweaks
- *
- * hue.. [0..360]
- * chroma .. [0..1]
- * grayness .. [0..1]
- */
-
- var hcg2rgb = function () {
- var assign, assign$1, assign$2, assign$3, assign$4, assign$5;
-
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- args = unpack$a(args, 'hcg');
- var h = args[0];
- var c = args[1];
- var _g = args[2];
- var r,g,b;
- _g = _g * 255;
- var _c = c * 255;
- if (c === 0) {
- r = g = b = _g;
- } else {
- if (h === 360) { h = 0; }
- if (h > 360) { h -= 360; }
- if (h < 0) { h += 360; }
- h /= 60;
- var i = floor(h);
- var f = h - i;
- var p = _g * (1 - c);
- var q = p + _c * (1 - f);
- var t = p + _c * f;
- var v = p + _c;
- switch (i) {
- case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break
- case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break
- case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break
- case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break
- case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break
- case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break
- }
- }
- return [r, g, b, args.length > 3 ? args[3] : 1];
- };
-
- var hcg2rgb_1 = hcg2rgb;
-
- var unpack$b = utils.unpack;
- var type$4 = utils.type;
-
-
-
-
-
-
- Color_1.prototype.hcg = function() {
- return rgb2hcg_1(this._rgb);
- };
-
- chroma_1.hcg = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['hcg']) ));
- };
-
- input.format.hcg = hcg2rgb_1;
-
- input.autodetect.push({
- p: 1,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$b(args, 'hcg');
- if (type$4(args) === 'array' && args.length === 3) {
- return 'hcg';
- }
- }
- });
-
- var unpack$c = utils.unpack;
- var last$4 = utils.last;
- var round$3 = Math.round;
-
- var rgb2hex = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$c(args, 'rgba');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- var a = ref[3];
- var mode = last$4(args) || 'auto';
- if (a === undefined) { a = 1; }
- if (mode === 'auto') {
- mode = a < 1 ? 'rgba' : 'rgb';
- }
- r = round$3(r);
- g = round$3(g);
- b = round$3(b);
- var u = r << 16 | g << 8 | b;
- var str = "000000" + u.toString(16); //#.toUpperCase();
- str = str.substr(str.length - 6);
- var hxa = '0' + round$3(a * 255).toString(16);
- hxa = hxa.substr(hxa.length - 2);
- switch (mode.toLowerCase()) {
- case 'rgba': return ("#" + str + hxa);
- case 'argb': return ("#" + hxa + str);
- default: return ("#" + str);
- }
- };
-
- var rgb2hex_1 = rgb2hex;
-
- var RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
- var RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;
-
- var hex2rgb = function (hex) {
- if (hex.match(RE_HEX)) {
- // remove optional leading #
- if (hex.length === 4 || hex.length === 7) {
- hex = hex.substr(1);
- }
- // expand short-notation to full six-digit
- if (hex.length === 3) {
- hex = hex.split('');
- hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
- }
- var u = parseInt(hex, 16);
- var r = u >> 16;
- var g = u >> 8 & 0xFF;
- var b = u & 0xFF;
- return [r,g,b,1];
- }
-
- // match rgba hex format, eg #FF000077
- if (hex.match(RE_HEXA)) {
- if (hex.length === 5 || hex.length === 9) {
- // remove optional leading #
- hex = hex.substr(1);
- }
- // expand short-notation to full eight-digit
- if (hex.length === 4) {
- hex = hex.split('');
- hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2]+hex[3]+hex[3];
- }
- var u$1 = parseInt(hex, 16);
- var r$1 = u$1 >> 24 & 0xFF;
- var g$1 = u$1 >> 16 & 0xFF;
- var b$1 = u$1 >> 8 & 0xFF;
- var a = Math.round((u$1 & 0xFF) / 0xFF * 100) / 100;
- return [r$1,g$1,b$1,a];
- }
-
- // we used to check for css colors here
- // if _input.css? and rgb = _input.css hex
- // return rgb
-
- throw new Error(("unknown hex color: " + hex));
- };
-
- var hex2rgb_1 = hex2rgb;
-
- var type$5 = utils.type;
-
-
-
-
- Color_1.prototype.hex = function(mode) {
- return rgb2hex_1(this._rgb, mode);
- };
-
- chroma_1.hex = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['hex']) ));
- };
-
- input.format.hex = hex2rgb_1;
- input.autodetect.push({
- p: 4,
- test: function (h) {
- var rest = [], len = arguments.length - 1;
- while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];
-
- if (!rest.length && type$5(h) === 'string' && [3,4,5,6,7,8,9].indexOf(h.length) >= 0) {
- return 'hex';
- }
- }
- });
-
- var unpack$d = utils.unpack;
- var TWOPI = utils.TWOPI;
- var min = Math.min;
- var sqrt = Math.sqrt;
- var acos = Math.acos;
-
- var rgb2hsi = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- /*
- borrowed from here:
- http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp
- */
- var ref = unpack$d(args, 'rgb');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- r /= 255;
- g /= 255;
- b /= 255;
- var h;
- var min_ = min(r,g,b);
- var i = (r+g+b) / 3;
- var s = i > 0 ? 1 - min_/i : 0;
- if (s === 0) {
- h = NaN;
- } else {
- h = ((r-g)+(r-b)) / 2;
- h /= sqrt((r-g)*(r-g) + (r-b)*(g-b));
- h = acos(h);
- if (b > g) {
- h = TWOPI - h;
- }
- h /= TWOPI;
- }
- return [h*360,s,i];
- };
-
- var rgb2hsi_1 = rgb2hsi;
-
- var unpack$e = utils.unpack;
- var limit$1 = utils.limit;
- var TWOPI$1 = utils.TWOPI;
- var PITHIRD = utils.PITHIRD;
- var cos = Math.cos;
-
- /*
- * hue [0..360]
- * saturation [0..1]
- * intensity [0..1]
- */
- var hsi2rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- /*
- borrowed from here:
- http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp
- */
- args = unpack$e(args, 'hsi');
- var h = args[0];
- var s = args[1];
- var i = args[2];
- var r,g,b;
-
- if (isNaN(h)) { h = 0; }
- if (isNaN(s)) { s = 0; }
- // normalize hue
- if (h > 360) { h -= 360; }
- if (h < 0) { h += 360; }
- h /= 360;
- if (h < 1/3) {
- b = (1-s)/3;
- r = (1+s*cos(TWOPI$1*h)/cos(PITHIRD-TWOPI$1*h))/3;
- g = 1 - (b+r);
- } else if (h < 2/3) {
- h -= 1/3;
- r = (1-s)/3;
- g = (1+s*cos(TWOPI$1*h)/cos(PITHIRD-TWOPI$1*h))/3;
- b = 1 - (r+g);
- } else {
- h -= 2/3;
- g = (1-s)/3;
- b = (1+s*cos(TWOPI$1*h)/cos(PITHIRD-TWOPI$1*h))/3;
- r = 1 - (g+b);
- }
- r = limit$1(i*r*3);
- g = limit$1(i*g*3);
- b = limit$1(i*b*3);
- return [r*255, g*255, b*255, args.length > 3 ? args[3] : 1];
- };
-
- var hsi2rgb_1 = hsi2rgb;
-
- var unpack$f = utils.unpack;
- var type$6 = utils.type;
-
-
-
-
-
-
- Color_1.prototype.hsi = function() {
- return rgb2hsi_1(this._rgb);
- };
-
- chroma_1.hsi = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['hsi']) ));
- };
-
- input.format.hsi = hsi2rgb_1;
-
- input.autodetect.push({
- p: 2,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$f(args, 'hsi');
- if (type$6(args) === 'array' && args.length === 3) {
- return 'hsi';
- }
- }
- });
-
- var unpack$g = utils.unpack;
- var type$7 = utils.type;
-
-
-
-
-
-
- Color_1.prototype.hsl = function() {
- return rgb2hsl_1(this._rgb);
- };
-
- chroma_1.hsl = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['hsl']) ));
- };
-
- input.format.hsl = hsl2rgb_1;
-
- input.autodetect.push({
- p: 2,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$g(args, 'hsl');
- if (type$7(args) === 'array' && args.length === 3) {
- return 'hsl';
- }
- }
- });
-
- var unpack$h = utils.unpack;
- var min$1 = Math.min;
- var max$1 = Math.max;
-
- /*
- * supported arguments:
- * - rgb2hsv(r,g,b)
- * - rgb2hsv([r,g,b])
- * - rgb2hsv({r,g,b})
- */
- var rgb2hsl$1 = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$h(args, 'rgb');
- var r = args[0];
- var g = args[1];
- var b = args[2];
- var min_ = min$1(r, g, b);
- var max_ = max$1(r, g, b);
- var delta = max_ - min_;
- var h,s,v;
- v = max_ / 255.0;
- if (max_ === 0) {
- h = Number.NaN;
- s = 0;
- } else {
- s = delta / max_;
- if (r === max_) { h = (g - b) / delta; }
- if (g === max_) { h = 2+(b - r) / delta; }
- if (b === max_) { h = 4+(r - g) / delta; }
- h *= 60;
- if (h < 0) { h += 360; }
- }
- return [h, s, v]
- };
-
- var rgb2hsv = rgb2hsl$1;
-
- var unpack$i = utils.unpack;
- var floor$1 = Math.floor;
-
- var hsv2rgb = function () {
- var assign, assign$1, assign$2, assign$3, assign$4, assign$5;
-
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- args = unpack$i(args, 'hsv');
- var h = args[0];
- var s = args[1];
- var v = args[2];
- var r,g,b;
- v *= 255;
- if (s === 0) {
- r = g = b = v;
- } else {
- if (h === 360) { h = 0; }
- if (h > 360) { h -= 360; }
- if (h < 0) { h += 360; }
- h /= 60;
-
- var i = floor$1(h);
- var f = h - i;
- var p = v * (1 - s);
- var q = v * (1 - s * f);
- var t = v * (1 - s * (1 - f));
-
- switch (i) {
- case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break
- case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break
- case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break
- case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break
- case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break
- case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break
- }
- }
- return [r,g,b,args.length > 3?args[3]:1];
- };
-
- var hsv2rgb_1 = hsv2rgb;
-
- var unpack$j = utils.unpack;
- var type$8 = utils.type;
-
-
-
-
-
-
- Color_1.prototype.hsv = function() {
- return rgb2hsv(this._rgb);
- };
-
- chroma_1.hsv = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['hsv']) ));
- };
-
- input.format.hsv = hsv2rgb_1;
-
- input.autodetect.push({
- p: 2,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$j(args, 'hsv');
- if (type$8(args) === 'array' && args.length === 3) {
- return 'hsv';
- }
- }
- });
-
- var labConstants = {
- // Corresponds roughly to RGB brighter/darker
- Kn: 18,
-
- // D65 standard referent
- Xn: 0.950470,
- Yn: 1,
- Zn: 1.088830,
-
- t0: 0.137931034, // 4 / 29
- t1: 0.206896552, // 6 / 29
- t2: 0.12841855, // 3 * t1 * t1
- t3: 0.008856452, // t1 * t1 * t1
- };
-
- var unpack$k = utils.unpack;
- var pow = Math.pow;
-
- var rgb2lab = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$k(args, 'rgb');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- var ref$1 = rgb2xyz(r,g,b);
- var x = ref$1[0];
- var y = ref$1[1];
- var z = ref$1[2];
- var l = 116 * y - 16;
- return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];
- };
-
- var rgb_xyz = function (r) {
- if ((r /= 255) <= 0.04045) { return r / 12.92; }
- return pow((r + 0.055) / 1.055, 2.4);
- };
-
- var xyz_lab = function (t) {
- if (t > labConstants.t3) { return pow(t, 1 / 3); }
- return t / labConstants.t2 + labConstants.t0;
- };
-
- var rgb2xyz = function (r,g,b) {
- r = rgb_xyz(r);
- g = rgb_xyz(g);
- b = rgb_xyz(b);
- var x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / labConstants.Xn);
- var y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / labConstants.Yn);
- var z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / labConstants.Zn);
- return [x,y,z];
- };
-
- var rgb2lab_1 = rgb2lab;
-
- var unpack$l = utils.unpack;
- var pow$1 = Math.pow;
-
- /*
- * L* [0..100]
- * a [-100..100]
- * b [-100..100]
- */
- var lab2rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$l(args, 'lab');
- var l = args[0];
- var a = args[1];
- var b = args[2];
- var x,y,z, r,g,b_;
-
- y = (l + 16) / 116;
- x = isNaN(a) ? y : y + a / 500;
- z = isNaN(b) ? y : y - b / 200;
-
- y = labConstants.Yn * lab_xyz(y);
- x = labConstants.Xn * lab_xyz(x);
- z = labConstants.Zn * lab_xyz(z);
-
- r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB
- g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);
- b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);
-
- return [r,g,b_,args.length > 3 ? args[3] : 1];
- };
-
- var xyz_rgb = function (r) {
- return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow$1(r, 1 / 2.4) - 0.055)
- };
-
- var lab_xyz = function (t) {
- return t > labConstants.t1 ? t * t * t : labConstants.t2 * (t - labConstants.t0)
- };
-
- var lab2rgb_1 = lab2rgb;
-
- var unpack$m = utils.unpack;
- var type$9 = utils.type;
-
-
-
-
-
-
- Color_1.prototype.lab = function() {
- return rgb2lab_1(this._rgb);
- };
-
- chroma_1.lab = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['lab']) ));
- };
-
- input.format.lab = lab2rgb_1;
-
- input.autodetect.push({
- p: 2,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$m(args, 'lab');
- if (type$9(args) === 'array' && args.length === 3) {
- return 'lab';
- }
- }
- });
-
- var unpack$n = utils.unpack;
- var RAD2DEG = utils.RAD2DEG;
- var sqrt$1 = Math.sqrt;
- var atan2 = Math.atan2;
- var round$4 = Math.round;
-
- var lab2lch = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$n(args, 'lab');
- var l = ref[0];
- var a = ref[1];
- var b = ref[2];
- var c = sqrt$1(a * a + b * b);
- var h = (atan2(b, a) * RAD2DEG + 360) % 360;
- if (round$4(c*10000) === 0) { h = Number.NaN; }
- return [l, c, h];
- };
-
- var lab2lch_1 = lab2lch;
-
- var unpack$o = utils.unpack;
-
-
-
- var rgb2lch = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$o(args, 'rgb');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- var ref$1 = rgb2lab_1(r,g,b);
- var l = ref$1[0];
- var a = ref$1[1];
- var b_ = ref$1[2];
- return lab2lch_1(l,a,b_);
- };
-
- var rgb2lch_1 = rgb2lch;
-
- var unpack$p = utils.unpack;
- var DEG2RAD = utils.DEG2RAD;
- var sin = Math.sin;
- var cos$1 = Math.cos;
-
- var lch2lab = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- /*
- Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.
- These formulas were invented by David Dalrymple to obtain maximum contrast without going
- out of gamut if the parameters are in the range 0-1.
-
- A saturation multiplier was added by Gregor Aisch
- */
- var ref = unpack$p(args, 'lch');
- var l = ref[0];
- var c = ref[1];
- var h = ref[2];
- if (isNaN(h)) { h = 0; }
- h = h * DEG2RAD;
- return [l, cos$1(h) * c, sin(h) * c]
- };
-
- var lch2lab_1 = lch2lab;
-
- var unpack$q = utils.unpack;
-
-
-
- var lch2rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$q(args, 'lch');
- var l = args[0];
- var c = args[1];
- var h = args[2];
- var ref = lch2lab_1 (l,c,h);
- var L = ref[0];
- var a = ref[1];
- var b_ = ref[2];
- var ref$1 = lab2rgb_1 (L,a,b_);
- var r = ref$1[0];
- var g = ref$1[1];
- var b = ref$1[2];
- return [r, g, b, args.length > 3 ? args[3] : 1];
- };
-
- var lch2rgb_1 = lch2rgb;
-
- var unpack$r = utils.unpack;
-
-
- var hcl2rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var hcl = unpack$r(args, 'hcl').reverse();
- return lch2rgb_1.apply(void 0, hcl);
- };
-
- var hcl2rgb_1 = hcl2rgb;
-
- var unpack$s = utils.unpack;
- var type$a = utils.type;
-
-
-
-
-
-
- Color_1.prototype.lch = function() { return rgb2lch_1(this._rgb); };
- Color_1.prototype.hcl = function() { return rgb2lch_1(this._rgb).reverse(); };
-
- chroma_1.lch = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['lch']) ));
- };
- chroma_1.hcl = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['hcl']) ));
- };
-
- input.format.lch = lch2rgb_1;
- input.format.hcl = hcl2rgb_1;
-
- ['lch','hcl'].forEach(function (m) { return input.autodetect.push({
- p: 2,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$s(args, m);
- if (type$a(args) === 'array' && args.length === 3) {
- return m;
- }
- }
- }); });
-
- /**
- X11 color names
-
- http://www.w3.org/TR/css3-color/#svg-color
- */
-
- var w3cx11 = {
- aliceblue: '#f0f8ff',
- antiquewhite: '#faebd7',
- aqua: '#00ffff',
- aquamarine: '#7fffd4',
- azure: '#f0ffff',
- beige: '#f5f5dc',
- bisque: '#ffe4c4',
- black: '#000000',
- blanchedalmond: '#ffebcd',
- blue: '#0000ff',
- blueviolet: '#8a2be2',
- brown: '#a52a2a',
- burlywood: '#deb887',
- cadetblue: '#5f9ea0',
- chartreuse: '#7fff00',
- chocolate: '#d2691e',
- coral: '#ff7f50',
- cornflower: '#6495ed',
- cornflowerblue: '#6495ed',
- cornsilk: '#fff8dc',
- crimson: '#dc143c',
- cyan: '#00ffff',
- darkblue: '#00008b',
- darkcyan: '#008b8b',
- darkgoldenrod: '#b8860b',
- darkgray: '#a9a9a9',
- darkgreen: '#006400',
- darkgrey: '#a9a9a9',
- darkkhaki: '#bdb76b',
- darkmagenta: '#8b008b',
- darkolivegreen: '#556b2f',
- darkorange: '#ff8c00',
- darkorchid: '#9932cc',
- darkred: '#8b0000',
- darksalmon: '#e9967a',
- darkseagreen: '#8fbc8f',
- darkslateblue: '#483d8b',
- darkslategray: '#2f4f4f',
- darkslategrey: '#2f4f4f',
- darkturquoise: '#00ced1',
- darkviolet: '#9400d3',
- deeppink: '#ff1493',
- deepskyblue: '#00bfff',
- dimgray: '#696969',
- dimgrey: '#696969',
- dodgerblue: '#1e90ff',
- firebrick: '#b22222',
- floralwhite: '#fffaf0',
- forestgreen: '#228b22',
- fuchsia: '#ff00ff',
- gainsboro: '#dcdcdc',
- ghostwhite: '#f8f8ff',
- gold: '#ffd700',
- goldenrod: '#daa520',
- gray: '#808080',
- green: '#008000',
- greenyellow: '#adff2f',
- grey: '#808080',
- honeydew: '#f0fff0',
- hotpink: '#ff69b4',
- indianred: '#cd5c5c',
- indigo: '#4b0082',
- ivory: '#fffff0',
- khaki: '#f0e68c',
- laserlemon: '#ffff54',
- lavender: '#e6e6fa',
- lavenderblush: '#fff0f5',
- lawngreen: '#7cfc00',
- lemonchiffon: '#fffacd',
- lightblue: '#add8e6',
- lightcoral: '#f08080',
- lightcyan: '#e0ffff',
- lightgoldenrod: '#fafad2',
- lightgoldenrodyellow: '#fafad2',
- lightgray: '#d3d3d3',
- lightgreen: '#90ee90',
- lightgrey: '#d3d3d3',
- lightpink: '#ffb6c1',
- lightsalmon: '#ffa07a',
- lightseagreen: '#20b2aa',
- lightskyblue: '#87cefa',
- lightslategray: '#778899',
- lightslategrey: '#778899',
- lightsteelblue: '#b0c4de',
- lightyellow: '#ffffe0',
- lime: '#00ff00',
- limegreen: '#32cd32',
- linen: '#faf0e6',
- magenta: '#ff00ff',
- maroon: '#800000',
- maroon2: '#7f0000',
- maroon3: '#b03060',
- mediumaquamarine: '#66cdaa',
- mediumblue: '#0000cd',
- mediumorchid: '#ba55d3',
- mediumpurple: '#9370db',
- mediumseagreen: '#3cb371',
- mediumslateblue: '#7b68ee',
- mediumspringgreen: '#00fa9a',
- mediumturquoise: '#48d1cc',
- mediumvioletred: '#c71585',
- midnightblue: '#191970',
- mintcream: '#f5fffa',
- mistyrose: '#ffe4e1',
- moccasin: '#ffe4b5',
- navajowhite: '#ffdead',
- navy: '#000080',
- oldlace: '#fdf5e6',
- olive: '#808000',
- olivedrab: '#6b8e23',
- orange: '#ffa500',
- orangered: '#ff4500',
- orchid: '#da70d6',
- palegoldenrod: '#eee8aa',
- palegreen: '#98fb98',
- paleturquoise: '#afeeee',
- palevioletred: '#db7093',
- papayawhip: '#ffefd5',
- peachpuff: '#ffdab9',
- peru: '#cd853f',
- pink: '#ffc0cb',
- plum: '#dda0dd',
- powderblue: '#b0e0e6',
- purple: '#800080',
- purple2: '#7f007f',
- purple3: '#a020f0',
- rebeccapurple: '#663399',
- red: '#ff0000',
- rosybrown: '#bc8f8f',
- royalblue: '#4169e1',
- saddlebrown: '#8b4513',
- salmon: '#fa8072',
- sandybrown: '#f4a460',
- seagreen: '#2e8b57',
- seashell: '#fff5ee',
- sienna: '#a0522d',
- silver: '#c0c0c0',
- skyblue: '#87ceeb',
- slateblue: '#6a5acd',
- slategray: '#708090',
- slategrey: '#708090',
- snow: '#fffafa',
- springgreen: '#00ff7f',
- steelblue: '#4682b4',
- tan: '#d2b48c',
- teal: '#008080',
- thistle: '#d8bfd8',
- tomato: '#ff6347',
- turquoise: '#40e0d0',
- violet: '#ee82ee',
- wheat: '#f5deb3',
- white: '#ffffff',
- whitesmoke: '#f5f5f5',
- yellow: '#ffff00',
- yellowgreen: '#9acd32'
- };
-
- var w3cx11_1 = w3cx11;
-
- var type$b = utils.type;
-
-
-
-
-
- Color_1.prototype.name = function() {
- var hex = rgb2hex_1(this._rgb, 'rgb');
- for (var i = 0, list = Object.keys(w3cx11_1); i < list.length; i += 1) {
- var n = list[i];
-
- if (w3cx11_1[n] === hex) { return n.toLowerCase(); }
- }
- return hex;
- };
-
- input.format.named = function (name) {
- name = name.toLowerCase();
- if (w3cx11_1[name]) { return hex2rgb_1(w3cx11_1[name]); }
- throw new Error('unknown color name: '+name);
- };
-
- input.autodetect.push({
- p: 5,
- test: function (h) {
- var rest = [], len = arguments.length - 1;
- while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];
-
- if (!rest.length && type$b(h) === 'string' && w3cx11_1[h.toLowerCase()]) {
- return 'named';
- }
- }
- });
-
- var unpack$t = utils.unpack;
-
- var rgb2num = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var ref = unpack$t(args, 'rgb');
- var r = ref[0];
- var g = ref[1];
- var b = ref[2];
- return (r << 16) + (g << 8) + b;
- };
-
- var rgb2num_1 = rgb2num;
-
- var type$c = utils.type;
-
- var num2rgb = function (num) {
- if (type$c(num) == "number" && num >= 0 && num <= 0xFFFFFF) {
- var r = num >> 16;
- var g = (num >> 8) & 0xFF;
- var b = num & 0xFF;
- return [r,g,b,1];
- }
- throw new Error("unknown num color: "+num);
- };
-
- var num2rgb_1 = num2rgb;
-
- var type$d = utils.type;
-
-
-
- Color_1.prototype.num = function() {
- return rgb2num_1(this._rgb);
- };
-
- chroma_1.num = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['num']) ));
- };
-
- input.format.num = num2rgb_1;
-
- input.autodetect.push({
- p: 5,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- if (args.length === 1 && type$d(args[0]) === 'number' && args[0] >= 0 && args[0] <= 0xFFFFFF) {
- return 'num';
- }
- }
- });
-
- var unpack$u = utils.unpack;
- var type$e = utils.type;
- var round$5 = Math.round;
-
- Color_1.prototype.rgb = function(rnd) {
- if ( rnd === void 0 ) rnd=true;
-
- if (rnd === false) { return this._rgb.slice(0,3); }
- return this._rgb.slice(0,3).map(round$5);
- };
-
- Color_1.prototype.rgba = function(rnd) {
- if ( rnd === void 0 ) rnd=true;
-
- return this._rgb.slice(0,4).map(function (v,i) {
- return i<3 ? (rnd === false ? v : round$5(v)) : v;
- });
- };
-
- chroma_1.rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['rgb']) ));
- };
-
- input.format.rgb = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var rgba = unpack$u(args, 'rgba');
- if (rgba[3] === undefined) { rgba[3] = 1; }
- return rgba;
- };
-
- input.autodetect.push({
- p: 3,
- test: function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- args = unpack$u(args, 'rgba');
- if (type$e(args) === 'array' && (args.length === 3 ||
- args.length === 4 && type$e(args[3]) == 'number' && args[3] >= 0 && args[3] <= 1)) {
- return 'rgb';
- }
- }
- });
-
- /*
- * Based on implementation by Neil Bartlett
- * https://github.com/neilbartlett/color-temperature
- */
-
- var log = Math.log;
-
- var temperature2rgb = function (kelvin) {
- var temp = kelvin / 100;
- var r,g,b;
- if (temp < 66) {
- r = 255;
- g = -155.25485562709179 - 0.44596950469579133 * (g = temp-2) + 104.49216199393888 * log(g);
- b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp-10) + 115.67994401066147 * log(b);
- } else {
- r = 351.97690566805693 + 0.114206453784165 * (r = temp-55) - 40.25366309332127 * log(r);
- g = 325.4494125711974 + 0.07943456536662342 * (g = temp-50) - 28.0852963507957 * log(g);
- b = 255;
- }
- return [r,g,b,1];
- };
-
- var temperature2rgb_1 = temperature2rgb;
-
- /*
- * Based on implementation by Neil Bartlett
- * https://github.com/neilbartlett/color-temperature
- **/
-
-
- var unpack$v = utils.unpack;
- var round$6 = Math.round;
-
- var rgb2temperature = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- var rgb = unpack$v(args, 'rgb');
- var r = rgb[0], b = rgb[2];
- var minTemp = 1000;
- var maxTemp = 40000;
- var eps = 0.4;
- var temp;
- while (maxTemp - minTemp > eps) {
- temp = (maxTemp + minTemp) * 0.5;
- var rgb$1 = temperature2rgb_1(temp);
- if ((rgb$1[2] / rgb$1[0]) >= (b / r)) {
- maxTemp = temp;
- } else {
- minTemp = temp;
- }
- }
- return round$6(temp);
- };
-
- var rgb2temperature_1 = rgb2temperature;
-
- Color_1.prototype.temp =
- Color_1.prototype.kelvin =
- Color_1.prototype.temperature = function() {
- return rgb2temperature_1(this._rgb);
- };
-
- chroma_1.temp =
- chroma_1.kelvin =
- chroma_1.temperature = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- return new (Function.prototype.bind.apply( Color_1, [ null ].concat( args, ['temp']) ));
- };
-
- input.format.temp =
- input.format.kelvin =
- input.format.temperature = temperature2rgb_1;
-
- var type$f = utils.type;
-
- Color_1.prototype.alpha = function(a, mutate) {
- if ( mutate === void 0 ) mutate=false;
-
- if (a !== undefined && type$f(a) === 'number') {
- if (mutate) {
- this._rgb[3] = a;
- return this;
- }
- return new Color_1([this._rgb[0], this._rgb[1], this._rgb[2], a], 'rgb');
- }
- return this._rgb[3];
- };
-
- Color_1.prototype.clipped = function() {
- return this._rgb._clipped || false;
- };
-
- Color_1.prototype.darken = function(amount) {
- if ( amount === void 0 ) amount=1;
-
- var me = this;
- var lab = me.lab();
- lab[0] -= labConstants.Kn * amount;
- return new Color_1(lab, 'lab').alpha(me.alpha(), true);
- };
-
- Color_1.prototype.brighten = function(amount) {
- if ( amount === void 0 ) amount=1;
-
- return this.darken(-amount);
- };
-
- Color_1.prototype.darker = Color_1.prototype.darken;
- Color_1.prototype.brighter = Color_1.prototype.brighten;
-
- Color_1.prototype.get = function(mc) {
- var ref = mc.split('.');
- var mode = ref[0];
- var channel = ref[1];
- var src = this[mode]();
- if (channel) {
- var i = mode.indexOf(channel);
- if (i > -1) { return src[i]; }
- throw new Error(("unknown channel " + channel + " in mode " + mode));
- } else {
- return src;
- }
- };
-
- var type$g = utils.type;
- var pow$2 = Math.pow;
-
- var EPS = 1e-7;
- var MAX_ITER = 20;
-
- Color_1.prototype.luminance = function(lum) {
- if (lum !== undefined && type$g(lum) === 'number') {
- if (lum === 0) {
- // return pure black
- return new Color_1([0,0,0,this._rgb[3]], 'rgb');
- }
- if (lum === 1) {
- // return pure white
- return new Color_1([255,255,255,this._rgb[3]], 'rgb');
- }
- // compute new color using...
- var cur_lum = this.luminance();
- var mode = 'rgb';
- var max_iter = MAX_ITER;
-
- var test = function (low, high) {
- var mid = low.interpolate(high, 0.5, mode);
- var lm = mid.luminance();
- if (Math.abs(lum - lm) < EPS || !max_iter--) {
- // close enough
- return mid;
- }
- return lm > lum ? test(low, mid) : test(mid, high);
- };
-
- var rgb = (cur_lum > lum ? test(new Color_1([0,0,0]), this) : test(this, new Color_1([255,255,255]))).rgb();
- return new Color_1(rgb.concat( [this._rgb[3]]));
- }
- return rgb2luminance.apply(void 0, (this._rgb).slice(0,3));
- };
-
-
- var rgb2luminance = function (r,g,b) {
- // relative luminance
- // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
- r = luminance_x(r);
- g = luminance_x(g);
- b = luminance_x(b);
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
- };
-
- var luminance_x = function (x) {
- x /= 255;
- return x <= 0.03928 ? x/12.92 : pow$2((x+0.055)/1.055, 2.4);
- };
-
- var interpolator = {};
-
- var type$h = utils.type;
-
-
- var mix = function (col1, col2, f) {
- if ( f === void 0 ) f=0.5;
- var rest = [], len = arguments.length - 3;
- while ( len-- > 0 ) rest[ len ] = arguments[ len + 3 ];
-
- var mode = rest[0] || 'lrgb';
- if (!interpolator[mode] && !rest.length) {
- // fall back to the first supported mode
- mode = Object.keys(interpolator)[0];
- }
- if (!interpolator[mode]) {
- throw new Error(("interpolation mode " + mode + " is not defined"));
- }
- if (type$h(col1) !== 'object') { col1 = new Color_1(col1); }
- if (type$h(col2) !== 'object') { col2 = new Color_1(col2); }
- return interpolator[mode](col1, col2, f)
- .alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
- };
-
- Color_1.prototype.mix =
- Color_1.prototype.interpolate = function(col2, f) {
- if ( f === void 0 ) f=0.5;
- var rest = [], len = arguments.length - 2;
- while ( len-- > 0 ) rest[ len ] = arguments[ len + 2 ];
-
- return mix.apply(void 0, [ this, col2, f ].concat( rest ));
- };
-
- Color_1.prototype.premultiply = function(mutate) {
- if ( mutate === void 0 ) mutate=false;
-
- var rgb = this._rgb;
- var a = rgb[3];
- if (mutate) {
- this._rgb = [rgb[0]*a, rgb[1]*a, rgb[2]*a, a];
- return this;
- } else {
- return new Color_1([rgb[0]*a, rgb[1]*a, rgb[2]*a, a], 'rgb');
- }
- };
-
- Color_1.prototype.saturate = function(amount) {
- if ( amount === void 0 ) amount=1;
-
- var me = this;
- var lch = me.lch();
- lch[1] += labConstants.Kn * amount;
- if (lch[1] < 0) { lch[1] = 0; }
- return new Color_1(lch, 'lch').alpha(me.alpha(), true);
- };
-
- Color_1.prototype.desaturate = function(amount) {
- if ( amount === void 0 ) amount=1;
-
- return this.saturate(-amount);
- };
-
- var type$i = utils.type;
-
- Color_1.prototype.set = function(mc, value, mutate) {
- if ( mutate === void 0 ) mutate=false;
-
- var ref = mc.split('.');
- var mode = ref[0];
- var channel = ref[1];
- var src = this[mode]();
- if (channel) {
- var i = mode.indexOf(channel);
- if (i > -1) {
- if (type$i(value) == 'string') {
- switch(value.charAt(0)) {
- case '+': src[i] += +value; break;
- case '-': src[i] += +value; break;
- case '*': src[i] *= +(value.substr(1)); break;
- case '/': src[i] /= +(value.substr(1)); break;
- default: src[i] = +value;
- }
- } else if (type$i(value) === 'number') {
- src[i] = value;
- } else {
- throw new Error("unsupported value for Color.set");
- }
- var out = new Color_1(src, mode);
- if (mutate) {
- this._rgb = out._rgb;
- return this;
- }
- return out;
- }
- throw new Error(("unknown channel " + channel + " in mode " + mode));
- } else {
- return src;
- }
- };
-
- var rgb$1 = function (col1, col2, f) {
- var xyz0 = col1._rgb;
- var xyz1 = col2._rgb;
- return new Color_1(
- xyz0[0] + f * (xyz1[0]-xyz0[0]),
- xyz0[1] + f * (xyz1[1]-xyz0[1]),
- xyz0[2] + f * (xyz1[2]-xyz0[2]),
- 'rgb'
- )
- };
-
- // register interpolator
- interpolator.rgb = rgb$1;
-
- var sqrt$2 = Math.sqrt;
- var pow$3 = Math.pow;
-
- var lrgb = function (col1, col2, f) {
- var ref = col1._rgb;
- var x1 = ref[0];
- var y1 = ref[1];
- var z1 = ref[2];
- var ref$1 = col2._rgb;
- var x2 = ref$1[0];
- var y2 = ref$1[1];
- var z2 = ref$1[2];
- return new Color_1(
- sqrt$2(pow$3(x1,2) * (1-f) + pow$3(x2,2) * f),
- sqrt$2(pow$3(y1,2) * (1-f) + pow$3(y2,2) * f),
- sqrt$2(pow$3(z1,2) * (1-f) + pow$3(z2,2) * f),
- 'rgb'
- )
- };
-
- // register interpolator
- interpolator.lrgb = lrgb;
-
- var lab$1 = function (col1, col2, f) {
- var xyz0 = col1.lab();
- var xyz1 = col2.lab();
- return new Color_1(
- xyz0[0] + f * (xyz1[0]-xyz0[0]),
- xyz0[1] + f * (xyz1[1]-xyz0[1]),
- xyz0[2] + f * (xyz1[2]-xyz0[2]),
- 'lab'
- )
- };
-
- // register interpolator
- interpolator.lab = lab$1;
-
- var _hsx = function (col1, col2, f, m) {
- var assign, assign$1;
-
- var xyz0, xyz1;
- if (m === 'hsl') {
- xyz0 = col1.hsl();
- xyz1 = col2.hsl();
- } else if (m === 'hsv') {
- xyz0 = col1.hsv();
- xyz1 = col2.hsv();
- } else if (m === 'hcg') {
- xyz0 = col1.hcg();
- xyz1 = col2.hcg();
- } else if (m === 'hsi') {
- xyz0 = col1.hsi();
- xyz1 = col2.hsi();
- } else if (m === 'lch' || m === 'hcl') {
- m = 'hcl';
- xyz0 = col1.hcl();
- xyz1 = col2.hcl();
- }
-
- var hue0, hue1, sat0, sat1, lbv0, lbv1;
- if (m.substr(0, 1) === 'h') {
- (assign = xyz0, hue0 = assign[0], sat0 = assign[1], lbv0 = assign[2]);
- (assign$1 = xyz1, hue1 = assign$1[0], sat1 = assign$1[1], lbv1 = assign$1[2]);
- }
-
- var sat, hue, lbv, dh;
-
- if (!isNaN(hue0) && !isNaN(hue1)) {
- // both colors have hue
- if (hue1 > hue0 && hue1 - hue0 > 180) {
- dh = hue1-(hue0+360);
- } else if (hue1 < hue0 && hue0 - hue1 > 180) {
- dh = hue1+360-hue0;
- } else {
- dh = hue1 - hue0;
- }
- hue = hue0 + f * dh;
- } else if (!isNaN(hue0)) {
- hue = hue0;
- if ((lbv1 == 1 || lbv1 == 0) && m != 'hsv') { sat = sat0; }
- } else if (!isNaN(hue1)) {
- hue = hue1;
- if ((lbv0 == 1 || lbv0 == 0) && m != 'hsv') { sat = sat1; }
- } else {
- hue = Number.NaN;
- }
-
- if (sat === undefined) { sat = sat0 + f * (sat1 - sat0); }
- lbv = lbv0 + f * (lbv1-lbv0);
- return new Color_1([hue, sat, lbv], m);
- };
-
- var lch$1 = function (col1, col2, f) {
- return _hsx(col1, col2, f, 'lch');
- };
-
- // register interpolator
- interpolator.lch = lch$1;
- interpolator.hcl = lch$1;
-
- var num$1 = function (col1, col2, f) {
- var c1 = col1.num();
- var c2 = col2.num();
- return new Color_1(c1 + f * (c2-c1), 'num')
- };
-
- // register interpolator
- interpolator.num = num$1;
-
- var hcg$1 = function (col1, col2, f) {
- return _hsx(col1, col2, f, 'hcg');
- };
-
- // register interpolator
- interpolator.hcg = hcg$1;
-
- var hsi$1 = function (col1, col2, f) {
- return _hsx(col1, col2, f, 'hsi');
- };
-
- // register interpolator
- interpolator.hsi = hsi$1;
-
- var hsl$1 = function (col1, col2, f) {
- return _hsx(col1, col2, f, 'hsl');
- };
-
- // register interpolator
- interpolator.hsl = hsl$1;
-
- var hsv$1 = function (col1, col2, f) {
- return _hsx(col1, col2, f, 'hsv');
- };
-
- // register interpolator
- interpolator.hsv = hsv$1;
-
- var clip_rgb$2 = utils.clip_rgb;
- var pow$4 = Math.pow;
- var sqrt$3 = Math.sqrt;
- var PI$1 = Math.PI;
- var cos$2 = Math.cos;
- var sin$1 = Math.sin;
- var atan2$1 = Math.atan2;
-
- var average = function (colors, mode, weights) {
- if ( mode === void 0 ) mode='lrgb';
- if ( weights === void 0 ) weights=null;
-
- var l = colors.length;
- if (!weights) { weights = Array.from(new Array(l)).map(function () { return 1; }); }
- // normalize weights
- var k = l / weights.reduce(function(a, b) { return a + b; });
- weights.forEach(function (w,i) { weights[i] *= k; });
- // convert colors to Color objects
- colors = colors.map(function (c) { return new Color_1(c); });
- if (mode === 'lrgb') {
- return _average_lrgb(colors, weights)
- }
- var first = colors.shift();
- var xyz = first.get(mode);
- var cnt = [];
- var dx = 0;
- var dy = 0;
- // initial color
- for (var i=0; i= 360) { A$1 -= 360; }
- xyz[i$1] = A$1;
- } else {
- xyz[i$1] = xyz[i$1]/cnt[i$1];
- }
- }
- alpha /= l;
- return (new Color_1(xyz, mode)).alpha(alpha > 0.99999 ? 1 : alpha, true);
- };
-
-
- var _average_lrgb = function (colors, weights) {
- var l = colors.length;
- var xyz = [0,0,0,0];
- for (var i=0; i < colors.length; i++) {
- var col = colors[i];
- var f = weights[i] / l;
- var rgb = col._rgb;
- xyz[0] += pow$4(rgb[0],2) * f;
- xyz[1] += pow$4(rgb[1],2) * f;
- xyz[2] += pow$4(rgb[2],2) * f;
- xyz[3] += rgb[3] * f;
- }
- xyz[0] = sqrt$3(xyz[0]);
- xyz[1] = sqrt$3(xyz[1]);
- xyz[2] = sqrt$3(xyz[2]);
- if (xyz[3] > 0.9999999) { xyz[3] = 1; }
- return new Color_1(clip_rgb$2(xyz));
- };
-
- // minimal multi-purpose interface
-
- // @requires utils color analyze
-
-
- var type$j = utils.type;
-
- var pow$5 = Math.pow;
-
- var scale = function(colors) {
-
- // constructor
- var _mode = 'rgb';
- var _nacol = chroma_1('#ccc');
- var _spread = 0;
- // const _fixed = false;
- var _domain = [0, 1];
- var _pos = [];
- var _padding = [0,0];
- var _classes = false;
- var _colors = [];
- var _out = false;
- var _min = 0;
- var _max = 1;
- var _correctLightness = false;
- var _colorCache = {};
- var _useCache = true;
- var _gamma = 1;
-
- // private methods
-
- var setColors = function(colors) {
- colors = colors || ['#fff', '#000'];
- if (colors && type$j(colors) === 'string' && chroma_1.brewer &&
- chroma_1.brewer[colors.toLowerCase()]) {
- colors = chroma_1.brewer[colors.toLowerCase()];
- }
- if (type$j(colors) === 'array') {
- // handle single color
- if (colors.length === 1) {
- colors = [colors[0], colors[0]];
- }
- // make a copy of the colors
- colors = colors.slice(0);
- // convert to chroma classes
- for (var c=0; c= _classes[i]) {
- i++;
- }
- return i-1;
- }
- return 0;
- };
-
- var tMapLightness = function (t) { return t; };
- var tMapDomain = function (t) { return t; };
-
- // const classifyValue = function(value) {
- // let val = value;
- // if (_classes.length > 2) {
- // const n = _classes.length-1;
- // const i = getClass(value);
- // const minc = _classes[0] + ((_classes[1]-_classes[0]) * (0 + (_spread * 0.5))); // center of 1st class
- // const maxc = _classes[n-1] + ((_classes[n]-_classes[n-1]) * (1 - (_spread * 0.5))); // center of last class
- // val = _min + ((((_classes[i] + ((_classes[i+1] - _classes[i]) * 0.5)) - minc) / (maxc-minc)) * (_max - _min));
- // }
- // return val;
- // };
-
- var getColor = function(val, bypassMap) {
- var col, t;
- if (bypassMap == null) { bypassMap = false; }
- if (isNaN(val) || (val === null)) { return _nacol; }
- if (!bypassMap) {
- if (_classes && (_classes.length > 2)) {
- // find the class
- var c = getClass(val);
- t = c / (_classes.length-2);
- } else if (_max !== _min) {
- // just interpolate between min/max
- t = (val - _min) / (_max - _min);
- } else {
- t = 1;
- }
- } else {
- t = val;
- }
-
- // domain map
- t = tMapDomain(t);
-
- if (!bypassMap) {
- t = tMapLightness(t); // lightness correction
- }
-
- if (_gamma !== 1) { t = pow$5(t, _gamma); }
-
- t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));
-
- t = Math.min(1, Math.max(0, t));
-
- var k = Math.floor(t * 10000);
-
- if (_useCache && _colorCache[k]) {
- col = _colorCache[k];
- } else {
- if (type$j(_colors) === 'array') {
- //for i in [0.._pos.length-1]
- for (var i=0; i<_pos.length; i++) {
- var p = _pos[i];
- if (t <= p) {
- col = _colors[i];
- break;
- }
- if ((t >= p) && (i === (_pos.length-1))) {
- col = _colors[i];
- break;
- }
- if (t > p && t < _pos[i+1]) {
- t = (t-p)/(_pos[i+1]-p);
- col = chroma_1.interpolate(_colors[i], _colors[i+1], t, _mode);
- break;
- }
- }
- } else if (type$j(_colors) === 'function') {
- col = _colors(t);
- }
- if (_useCache) { _colorCache[k] = col; }
- }
- return col;
- };
-
- var resetCache = function () { return _colorCache = {}; };
-
- setColors(colors);
-
- // public interface
-
- var f = function(v) {
- var c = chroma_1(getColor(v));
- if (_out && c[_out]) { return c[_out](); } else { return c; }
- };
-
- f.classes = function(classes) {
- if (classes != null) {
- if (type$j(classes) === 'array') {
- _classes = classes;
- _domain = [classes[0], classes[classes.length-1]];
- } else {
- var d = chroma_1.analyze(_domain);
- if (classes === 0) {
- _classes = [d.min, d.max];
- } else {
- _classes = chroma_1.limits(d, 'e', classes);
- }
- }
- return f;
- }
- return _classes;
- };
-
-
- f.domain = function(domain) {
- if (!arguments.length) {
- return _domain;
- }
- _min = domain[0];
- _max = domain[domain.length-1];
- _pos = [];
- var k = _colors.length;
- if ((domain.length === k) && (_min !== _max)) {
- // update positions
- for (var i = 0, list = Array.from(domain); i < list.length; i += 1) {
- var d = list[i];
-
- _pos.push((d-_min) / (_max-_min));
- }
- } else {
- for (var c=0; c 2) {
- // set domain map
- var tOut = domain.map(function (d,i) { return i/(domain.length-1); });
- var tBreaks = domain.map(function (d) { return (d - _min) / (_max - _min); });
- if (!tBreaks.every(function (val, i) { return tOut[i] === val; })) {
- tMapDomain = function (t) {
- if (t <= 0 || t >= 1) { return t; }
- var i = 0;
- while (t >= tBreaks[i+1]) { i++; }
- var f = (t - tBreaks[i]) / (tBreaks[i+1] - tBreaks[i]);
- var out = tOut[i] + f * (tOut[i+1] - tOut[i]);
- return out;
- };
- }
-
- }
- }
- _domain = [_min, _max];
- return f;
- };
-
- f.mode = function(_m) {
- if (!arguments.length) {
- return _mode;
- }
- _mode = _m;
- resetCache();
- return f;
- };
-
- f.range = function(colors, _pos) {
- setColors(colors);
- return f;
- };
-
- f.out = function(_o) {
- _out = _o;
- return f;
- };
-
- f.spread = function(val) {
- if (!arguments.length) {
- return _spread;
- }
- _spread = val;
- return f;
- };
-
- f.correctLightness = function(v) {
- if (v == null) { v = true; }
- _correctLightness = v;
- resetCache();
- if (_correctLightness) {
- tMapLightness = function(t) {
- var L0 = getColor(0, true).lab()[0];
- var L1 = getColor(1, true).lab()[0];
- var pol = L0 > L1;
- var L_actual = getColor(t, true).lab()[0];
- var L_ideal = L0 + ((L1 - L0) * t);
- var L_diff = L_actual - L_ideal;
- var t0 = 0;
- var t1 = 1;
- var max_iter = 20;
- while ((Math.abs(L_diff) > 1e-2) && (max_iter-- > 0)) {
- (function() {
- if (pol) { L_diff *= -1; }
- if (L_diff < 0) {
- t0 = t;
- t += (t1 - t) * 0.5;
- } else {
- t1 = t;
- t += (t0 - t) * 0.5;
- }
- L_actual = getColor(t, true).lab()[0];
- return L_diff = L_actual - L_ideal;
- })();
- }
- return t;
- };
- } else {
- tMapLightness = function (t) { return t; };
- }
- return f;
- };
-
- f.padding = function(p) {
- if (p != null) {
- if (type$j(p) === 'number') {
- p = [p,p];
- }
- _padding = p;
- return f;
- } else {
- return _padding;
- }
- };
-
- f.colors = function(numColors, out) {
- // If no arguments are given, return the original colors that were provided
- if (arguments.length < 2) { out = 'hex'; }
- var result = [];
-
- if (arguments.length === 0) {
- result = _colors.slice(0);
-
- } else if (numColors === 1) {
- result = [f(0.5)];
-
- } else if (numColors > 1) {
- var dm = _domain[0];
- var dd = _domain[1] - dm;
- result = __range__(0, numColors, false).map(function (i) { return f( dm + ((i/(numColors-1)) * dd) ); });
-
- } else { // returns all colors based on the defined classes
- colors = [];
- var samples = [];
- if (_classes && (_classes.length > 2)) {
- for (var i = 1, end = _classes.length, asc = 1 <= end; asc ? i < end : i > end; asc ? i++ : i--) {
- samples.push((_classes[i-1]+_classes[i])*0.5);
- }
- } else {
- samples = _domain;
- }
- result = samples.map(function (v) { return f(v); });
- }
-
- if (chroma_1[out]) {
- result = result.map(function (c) { return c[out](); });
- }
- return result;
- };
-
- f.cache = function(c) {
- if (c != null) {
- _useCache = c;
- return f;
- } else {
- return _useCache;
- }
- };
-
- f.gamma = function(g) {
- if (g != null) {
- _gamma = g;
- return f;
- } else {
- return _gamma;
- }
- };
-
- f.nodata = function(d) {
- if (d != null) {
- _nacol = chroma_1(d);
- return f;
- } else {
- return _nacol;
- }
- };
-
- return f;
- };
-
- function __range__(left, right, inclusive) {
- var range = [];
- var ascending = left < right;
- var end = !inclusive ? right : ascending ? right + 1 : right - 1;
- for (var i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {
- range.push(i);
- }
- return range;
- }
-
- //
- // interpolates between a set of colors uzing a bezier spline
- //
-
- // @requires utils lab
-
-
-
-
- var bezier = function(colors) {
- var assign, assign$1, assign$2;
-
- var I, lab0, lab1, lab2;
- colors = colors.map(function (c) { return new Color_1(c); });
- if (colors.length === 2) {
- // linear interpolation
- (assign = colors.map(function (c) { return c.lab(); }), lab0 = assign[0], lab1 = assign[1]);
- I = function(t) {
- var lab = ([0, 1, 2].map(function (i) { return lab0[i] + (t * (lab1[i] - lab0[i])); }));
- return new Color_1(lab, 'lab');
- };
- } else if (colors.length === 3) {
- // quadratic bezier interpolation
- (assign$1 = colors.map(function (c) { return c.lab(); }), lab0 = assign$1[0], lab1 = assign$1[1], lab2 = assign$1[2]);
- I = function(t) {
- var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t) * lab0[i]) + (2 * (1-t) * t * lab1[i]) + (t * t * lab2[i]); }));
- return new Color_1(lab, 'lab');
- };
- } else if (colors.length === 4) {
- // cubic bezier interpolation
- var lab3;
- (assign$2 = colors.map(function (c) { return c.lab(); }), lab0 = assign$2[0], lab1 = assign$2[1], lab2 = assign$2[2], lab3 = assign$2[3]);
- I = function(t) {
- var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t)*(1-t) * lab0[i]) + (3 * (1-t) * (1-t) * t * lab1[i]) + (3 * (1-t) * t * t * lab2[i]) + (t*t*t * lab3[i]); }));
- return new Color_1(lab, 'lab');
- };
- } else if (colors.length === 5) {
- var I0 = bezier(colors.slice(0, 3));
- var I1 = bezier(colors.slice(2, 5));
- I = function(t) {
- if (t < 0.5) {
- return I0(t*2);
- } else {
- return I1((t-0.5)*2);
- }
- };
- }
- return I;
- };
-
- var bezier_1 = function (colors) {
- var f = bezier(colors);
- f.scale = function () { return scale(f); };
- return f;
- };
-
- /*
- * interpolates between a set of colors uzing a bezier spline
- * blend mode formulas taken from http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/
- */
-
-
-
-
- var blend = function (bottom, top, mode) {
- if (!blend[mode]) {
- throw new Error('unknown blend mode ' + mode);
- }
- return blend[mode](bottom, top);
- };
-
- var blend_f = function (f) { return function (bottom,top) {
- var c0 = chroma_1(top).rgb();
- var c1 = chroma_1(bottom).rgb();
- return chroma_1.rgb(f(c0, c1));
- }; };
-
- var each = function (f) { return function (c0, c1) {
- var out = [];
- out[0] = f(c0[0], c1[0]);
- out[1] = f(c0[1], c1[1]);
- out[2] = f(c0[2], c1[2]);
- return out;
- }; };
-
- var normal = function (a) { return a; };
- var multiply = function (a,b) { return a * b / 255; };
- var darken$1 = function (a,b) { return a > b ? b : a; };
- var lighten = function (a,b) { return a > b ? a : b; };
- var screen = function (a,b) { return 255 * (1 - (1-a/255) * (1-b/255)); };
- var overlay = function (a,b) { return b < 128 ? 2 * a * b / 255 : 255 * (1 - 2 * (1 - a / 255 ) * ( 1 - b / 255 )); };
- var burn = function (a,b) { return 255 * (1 - (1 - b / 255) / (a/255)); };
- var dodge = function (a,b) {
- if (a === 255) { return 255; }
- a = 255 * (b / 255) / (1 - a / 255);
- return a > 255 ? 255 : a
- };
-
- // # add = (a,b) ->
- // # if (a + b > 255) then 255 else a + b
-
- blend.normal = blend_f(each(normal));
- blend.multiply = blend_f(each(multiply));
- blend.screen = blend_f(each(screen));
- blend.overlay = blend_f(each(overlay));
- blend.darken = blend_f(each(darken$1));
- blend.lighten = blend_f(each(lighten));
- blend.dodge = blend_f(each(dodge));
- blend.burn = blend_f(each(burn));
- // blend.add = blend_f(each(add));
-
- var blend_1 = blend;
-
- // cubehelix interpolation
- // based on D.A. Green "A colour scheme for the display of astronomical intensity images"
- // http://astron-soc.in/bulletin/11June/289392011.pdf
-
- var type$k = utils.type;
- var clip_rgb$3 = utils.clip_rgb;
- var TWOPI$2 = utils.TWOPI;
- var pow$6 = Math.pow;
- var sin$2 = Math.sin;
- var cos$3 = Math.cos;
-
-
- var cubehelix = function(start, rotations, hue, gamma, lightness) {
- if ( start === void 0 ) start=300;
- if ( rotations === void 0 ) rotations=-1.5;
- if ( hue === void 0 ) hue=1;
- if ( gamma === void 0 ) gamma=1;
- if ( lightness === void 0 ) lightness=[0,1];
-
- var dh = 0, dl;
- if (type$k(lightness) === 'array') {
- dl = lightness[1] - lightness[0];
- } else {
- dl = 0;
- lightness = [lightness, lightness];
- }
-
- var f = function(fract) {
- var a = TWOPI$2 * (((start+120)/360) + (rotations * fract));
- var l = pow$6(lightness[0] + (dl * fract), gamma);
- var h = dh !== 0 ? hue[0] + (fract * dh) : hue;
- var amp = (h * l * (1-l)) / 2;
- var cos_a = cos$3(a);
- var sin_a = sin$2(a);
- var r = l + (amp * ((-0.14861 * cos_a) + (1.78277* sin_a)));
- var g = l + (amp * ((-0.29227 * cos_a) - (0.90649* sin_a)));
- var b = l + (amp * (+1.97294 * cos_a));
- return chroma_1(clip_rgb$3([r*255,g*255,b*255,1]));
- };
-
- f.start = function(s) {
- if ((s == null)) { return start; }
- start = s;
- return f;
- };
-
- f.rotations = function(r) {
- if ((r == null)) { return rotations; }
- rotations = r;
- return f;
- };
-
- f.gamma = function(g) {
- if ((g == null)) { return gamma; }
- gamma = g;
- return f;
- };
-
- f.hue = function(h) {
- if ((h == null)) { return hue; }
- hue = h;
- if (type$k(hue) === 'array') {
- dh = hue[1] - hue[0];
- if (dh === 0) { hue = hue[1]; }
- } else {
- dh = 0;
- }
- return f;
- };
-
- f.lightness = function(h) {
- if ((h == null)) { return lightness; }
- if (type$k(h) === 'array') {
- lightness = h;
- dl = h[1] - h[0];
- } else {
- lightness = [h,h];
- dl = 0;
- }
- return f;
- };
-
- f.scale = function () { return chroma_1.scale(f); };
-
- f.hue(hue);
-
- return f;
- };
-
- var digits = '0123456789abcdef';
-
- var floor$2 = Math.floor;
- var random = Math.random;
-
- var random_1 = function () {
- var code = '#';
- for (var i=0; i<6; i++) {
- code += digits.charAt(floor$2(random() * 16));
- }
- return new Color_1(code, 'hex');
- };
-
- var log$1 = Math.log;
- var pow$7 = Math.pow;
- var floor$3 = Math.floor;
- var abs = Math.abs;
-
-
- var analyze = function (data, key) {
- if ( key === void 0 ) key=null;
-
- var r = {
- min: Number.MAX_VALUE,
- max: Number.MAX_VALUE*-1,
- sum: 0,
- values: [],
- count: 0
- };
- if (type(data) === 'object') {
- data = Object.values(data);
- }
- data.forEach(function (val) {
- if (key && type(val) === 'object') { val = val[key]; }
- if (val !== undefined && val !== null && !isNaN(val)) {
- r.values.push(val);
- r.sum += val;
- if (val < r.min) { r.min = val; }
- if (val > r.max) { r.max = val; }
- r.count += 1;
- }
- });
-
- r.domain = [r.min, r.max];
-
- r.limits = function (mode, num) { return limits(r, mode, num); };
-
- return r;
- };
-
-
- var limits = function (data, mode, num) {
- if ( mode === void 0 ) mode='equal';
- if ( num === void 0 ) num=7;
-
- if (type(data) == 'array') {
- data = analyze(data);
- }
- var min = data.min;
- var max = data.max;
- var values = data.values.sort(function (a,b) { return a-b; });
-
- if (num === 1) { return [min,max]; }
-
- var limits = [];
-
- if (mode.substr(0,1) === 'c') { // continuous
- limits.push(min);
- limits.push(max);
- }
-
- if (mode.substr(0,1) === 'e') { // equal interval
- limits.push(min);
- for (var i=1; i 0');
- }
- var min_log = Math.LOG10E * log$1(min);
- var max_log = Math.LOG10E * log$1(max);
- limits.push(min);
- for (var i$1=1; i$1 pb
- var pr = p - pb;
- limits.push((values[pb]*(1-pr)) + (values[pb+1]*pr));
- }
- }
- limits.push(max);
-
- }
-
- else if (mode.substr(0,1) === 'k') { // k-means clustering
- /*
- implementation based on
- http://code.google.com/p/figue/source/browse/trunk/figue.js#336
- simplified for 1-d input values
- */
- var cluster;
- var n = values.length;
- var assignments = new Array(n);
- var clusterSizes = new Array(num);
- var repeat = true;
- var nb_iters = 0;
- var centroids = null;
-
- // get seed values
- centroids = [];
- centroids.push(min);
- for (var i$3=1; i$3 200) {
- repeat = false;
- }
- }
-
- // finished k-means clustering
- // the next part is borrowed from gabrielflor.it
- var kClusters = {};
- for (var j$5=0; j$5 l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);
- };
-
- var sqrt$4 = Math.sqrt;
- var atan2$2 = Math.atan2;
- var abs$1 = Math.abs;
- var cos$4 = Math.cos;
- var PI$2 = Math.PI;
-
- var deltaE = function(a, b, L, C) {
- if ( L === void 0 ) L=1;
- if ( C === void 0 ) C=1;
-
- // Delta E (CMC)
- // see http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CMC.html
- a = new Color_1(a);
- b = new Color_1(b);
- var ref = Array.from(a.lab());
- var L1 = ref[0];
- var a1 = ref[1];
- var b1 = ref[2];
- var ref$1 = Array.from(b.lab());
- var L2 = ref$1[0];
- var a2 = ref$1[1];
- var b2 = ref$1[2];
- var c1 = sqrt$4((a1 * a1) + (b1 * b1));
- var c2 = sqrt$4((a2 * a2) + (b2 * b2));
- var sl = L1 < 16.0 ? 0.511 : (0.040975 * L1) / (1.0 + (0.01765 * L1));
- var sc = ((0.0638 * c1) / (1.0 + (0.0131 * c1))) + 0.638;
- var h1 = c1 < 0.000001 ? 0.0 : (atan2$2(b1, a1) * 180.0) / PI$2;
- while (h1 < 0) { h1 += 360; }
- while (h1 >= 360) { h1 -= 360; }
- var t = (h1 >= 164.0) && (h1 <= 345.0) ? (0.56 + abs$1(0.2 * cos$4((PI$2 * (h1 + 168.0)) / 180.0))) : (0.36 + abs$1(0.4 * cos$4((PI$2 * (h1 + 35.0)) / 180.0)));
- var c4 = c1 * c1 * c1 * c1;
- var f = sqrt$4(c4 / (c4 + 1900.0));
- var sh = sc * (((f * t) + 1.0) - f);
- var delL = L1 - L2;
- var delC = c1 - c2;
- var delA = a1 - a2;
- var delB = b1 - b2;
- var dH2 = ((delA * delA) + (delB * delB)) - (delC * delC);
- var v1 = delL / (L * sl);
- var v2 = delC / (C * sc);
- var v3 = sh;
- return sqrt$4((v1 * v1) + (v2 * v2) + (dH2 / (v3 * v3)));
- };
-
- // simple Euclidean distance
- var distance = function(a, b, mode) {
- if ( mode === void 0 ) mode='lab';
-
- // Delta E (CIE 1976)
- // see http://www.brucelindbloom.com/index.html?Equations.html
- a = new Color_1(a);
- b = new Color_1(b);
- var l1 = a.get(mode);
- var l2 = b.get(mode);
- var sum_sq = 0;
- for (var i in l1) {
- var d = (l1[i] || 0) - (l2[i] || 0);
- sum_sq += d*d;
- }
- return Math.sqrt(sum_sq);
- };
-
- var valid = function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
-
- try {
- new (Function.prototype.bind.apply( Color_1, [ null ].concat( args) ));
- return true;
- } catch (e) {
- return false;
- }
- };
-
- // some pre-defined color scales:
-
-
-
-
- var scales = {
- cool: function cool() { return scale([chroma_1.hsl(180,1,.9), chroma_1.hsl(250,.7,.4)]) },
- hot: function hot() { return scale(['#000','#f00','#ff0','#fff']).mode('rgb') }
- };
-
- /**
- ColorBrewer colors for chroma.js
-
- Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
- Pennsylvania State University.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software distributed
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
- specific language governing permissions and limitations under the License.
- */
-
- var colorbrewer = {
- // sequential
- OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],
- PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],
- BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],
- Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],
- BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],
- YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],
- YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],
- Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],
- RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],
- Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],
- YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],
- Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],
- GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],
- Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],
- YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],
- PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],
- Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],
- PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],
- Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],
-
- // diverging
-
- Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
- RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],
- RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
- PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],
- PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],
- RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],
- BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],
- RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],
- PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],
-
- // qualitative
-
- Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],
- Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],
- Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],
- Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],
- Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],
- Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],
- Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],
- Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2'],
- };
-
- // add lowercase aliases for case-insensitive matches
- for (var i$1 = 0, list$1 = Object.keys(colorbrewer); i$1 < list$1.length; i$1 += 1) {
- var key = list$1[i$1];
-
- colorbrewer[key.toLowerCase()] = colorbrewer[key];
- }
-
- var colorbrewer_1 = colorbrewer;
-
- // feel free to comment out anything to rollup
- // a smaller chroma.js built
-
- // io --> convert colors
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- // operators --> modify existing Colors
-
-
-
-
-
-
-
-
-
-
- // interpolators
-
-
-
-
-
-
-
-
-
-
- // generators -- > create new colors
- chroma_1.average = average;
- chroma_1.bezier = bezier_1;
- chroma_1.blend = blend_1;
- chroma_1.cubehelix = cubehelix;
- chroma_1.mix = chroma_1.interpolate = mix;
- chroma_1.random = random_1;
- chroma_1.scale = scale;
-
- // other utility methods
- chroma_1.analyze = analyze_1.analyze;
- chroma_1.contrast = contrast;
- chroma_1.deltaE = deltaE;
- chroma_1.distance = distance;
- chroma_1.limits = analyze_1.limits;
- chroma_1.valid = valid;
-
- // scale
- chroma_1.scales = scales;
-
- // colors
- chroma_1.colors = w3cx11_1;
- chroma_1.brewer = colorbrewer_1;
-
- var chroma_js = chroma_1;
-
- return chroma_js;
-
-})));
-});
-
-function generateColorVariables(key, format, colorStr, opacity, altFormats = []) {
- const parsedColor = chroma(colorStr);
- const alts = altFormats.reduce((a, alt) => {
- a.push(...generateColorVariables(alt.id, alt.format, colorStr, opacity));
- return a;
- }, []);
- switch (format) {
- case 'hex':
- return [{ key, value: colorStr }, ...alts];
- case 'hsl':
- return [
- {
- key,
- value: parsedColor.css('hsl'),
- },
- ...alts,
- ];
- case 'hsl-values': {
- const hsl = parsedColor.hsl();
- const alpha = opacity ? `,${parsedColor.alpha()}` : '';
- const h = isNaN(hsl[0]) ? 0 : hsl[0];
- return [
- {
- key,
- value: `${h},${hsl[1] * 100}%,${hsl[2] * 100}%${alpha}`,
- },
- ...alts,
- ];
- }
- case 'hsl-split': {
- const hsl = parsedColor.hsl();
- const h = isNaN(hsl[0]) ? 0 : hsl[0];
- const out = [
- {
- key: `${key}-h`,
- value: h.toString(),
- },
- {
- key: `${key}-s`,
- value: (hsl[1] * 100).toString() + '%',
- },
- {
- key: `${key}-l`,
- value: (hsl[2] * 100).toString() + '%',
- },
- ...alts,
- ];
- if (opacity)
- out.push({
- key: `${key}-a`,
- value: parsedColor.alpha().toString(),
- });
- return out;
- }
- case 'hsl-split-decimal': {
- const hsl = parsedColor.hsl();
- const h = isNaN(hsl[0]) ? 0 : hsl[0];
- const out = [
- {
- key: `${key}-h`,
- value: h.toString(),
- },
- {
- key: `${key}-s`,
- value: hsl[1].toString(),
- },
- {
- key: `${key}-l`,
- value: hsl[2].toString(),
- },
- ...alts,
- ];
- if (opacity)
- out.push({
- key: `${key}-a`,
- value: parsedColor.alpha().toString(),
- });
- return out;
- }
- case 'rgb':
- return [
- {
- key,
- value: parsedColor.css(),
- },
- ...alts,
- ];
- case 'rgb-values': {
- const rgb = parsedColor.rgb();
- const alpha = opacity ? `,${parsedColor.alpha()}` : '';
- return [
- {
- key,
- value: `${rgb[0]},${rgb[1]},${rgb[2]}${alpha}`,
- },
- ...alts,
- ];
- }
- case 'rgb-split': {
- const rgb = parsedColor.rgb();
- const out = [
- {
- key: `${key}-r`,
- value: rgb[0].toString(),
- },
- {
- key: `${key}-g`,
- value: rgb[1].toString(),
- },
- {
- key: `${key}-b`,
- value: rgb[2].toString(),
- },
- ...alts,
- ];
- if (opacity)
- out.push({
- key: `${key}-a`,
- value: parsedColor.alpha().toString(),
- });
- return out;
- }
- }
-}
-function pushColors(arr, id, from, to, format, step, pad) {
- const scale = chroma.scale([from.trim(), to.trim()]).domain([0, 100]);
- for (let i = 0; i <= 100; i++) {
- if (i % step === 0) {
- const c = scale(i);
- arr.push(...generateColorVariables(`${id}-${i.toString().padStart(pad, '0')}`, format, c.css(), c.alpha() !== 1));
- }
- }
-}
-function getCSSVariables(settings, config, gradients, settingsManager) {
- const vars = [];
- const themedLight = [];
- const themedDark = [];
- const gradientCandidates = {};
- const gradientCandidatesLight = {};
- const gradientCandidatesDark = {};
- const seenGradientSections = new Set();
- for (const key in settings) {
- const [sectionId, settingId, modifier] = key.split('@@');
- const section = config[sectionId];
- if (!section)
- continue;
- const setting = config[sectionId][settingId];
- if (!setting)
- continue;
- const value = settings[key];
- switch (setting.type) {
- case SettingType.VARIABLE_NUMBER:
- case SettingType.VARIABLE_NUMBER_SLIDER: {
- const format = setting
- .format;
- const val = value !== undefined
- ? value
- : setting.default;
- vars.push({
- key: setting.id,
- value: `${val}${format || ''}`,
- });
- continue;
- }
- case SettingType.VARIABLE_TEXT:
- case SettingType.VARIABLE_SELECT: {
- const format_text = setting;
- let text = value !== undefined
- ? value.toString()
- : format_text.default.toString();
- if (format_text.quotes) {
- if (text !== `""`) {
- text = `'${text}'`;
- }
- else {
- text = ``;
- }
- }
- vars.push({
- key: setting.id,
- value: text,
- });
- continue;
- }
- case SettingType.VARIABLE_COLOR: {
- if (!seenGradientSections.has(sectionId))
- seenGradientSections.add(sectionId);
- const colorSetting = setting;
- const color = value !== undefined ? value.toString() : colorSetting.default;
- vars.push(...generateColorVariables(setting.id, colorSetting.format, color, colorSetting.opacity, colorSetting['alt-format']));
- generateColorVariables(setting.id, 'rgb', color, colorSetting.opacity).forEach((kv) => {
- gradientCandidates[kv.key] = kv.value;
- });
- continue;
- }
- case SettingType.VARIABLE_THEMED_COLOR: {
- if (!seenGradientSections.has(sectionId))
- seenGradientSections.add(sectionId);
- const colorSetting = setting;
- const colorKey = modifier === 'light' ? 'default-light' : 'default-dark';
- const color = value !== undefined ? value.toString() : colorSetting[colorKey];
- (modifier === 'light' ? themedLight : themedDark).push(...generateColorVariables(setting.id, colorSetting.format, color, colorSetting.opacity, colorSetting['alt-format']));
- generateColorVariables(setting.id, 'rgb', color, colorSetting.opacity).forEach((kv) => {
- if (modifier === 'light') {
- gradientCandidatesLight[kv.key] = kv.value;
- }
- else {
- gradientCandidatesDark[kv.key] = kv.value;
- }
- });
- continue;
- }
- }
- }
- seenGradientSections.forEach((sectionId) => {
- const g = gradients[sectionId];
- if (!g)
- return;
- g.forEach((def) => {
- var _a, _b, _c;
- const { from, to, format, step, id, pad = 0 } = def;
- if (gradientCandidatesLight[from]) {
- const fromColor = gradientCandidatesLight[from];
- const toColor = gradientCandidatesLight[to] ||
- ((_a = settingsManager.plugin.getCSSVar(to).light) === null || _a === void 0 ? void 0 : _a.trim());
- if (toColor) {
- pushColors(themedLight, id, fromColor, toColor, format, step, pad);
- }
- }
- if (gradientCandidatesDark[from]) {
- const fromColor = gradientCandidatesDark[from];
- const toColor = gradientCandidatesDark[to] ||
- ((_b = settingsManager.plugin.getCSSVar(to).dark) === null || _b === void 0 ? void 0 : _b.trim());
- if (toColor) {
- pushColors(themedDark, id, fromColor, toColor, format, step, pad);
- }
- }
- if (gradientCandidates[from]) {
- const fromColor = gradientCandidates[from];
- const toColor = gradientCandidates[to] ||
- ((_c = settingsManager.plugin.getCSSVar(to).current) === null || _c === void 0 ? void 0 : _c.trim());
- if (toColor) {
- pushColors(vars, id, fromColor, toColor, format, step, pad);
- }
- }
- });
- });
- return [vars, themedLight, themedDark];
-}
-class CSSSettingsManager {
- constructor(plugin) {
- this.config = {};
- this.gradients = {};
- this.plugin = plugin;
- this.settings = {};
- this.styleTag = document.createElement('style');
- this.styleTag.id = 'css-settings-manager';
- document.getElementsByTagName('head')[0].appendChild(this.styleTag);
- }
- cleanup() {
- this.styleTag.remove();
- this.removeClasses();
- }
- save() {
- return __awaiter(this, void 0, void 0, function* () {
- yield this.plugin.saveData(this.settings);
- this.setCSSVariables();
- });
- }
- load() {
- return __awaiter(this, void 0, void 0, function* () {
- this.settings = Object.assign({}, yield this.plugin.loadData());
- });
- }
- initClasses() {
- Object.keys(this.config).forEach((section) => {
- const config = this.config[section];
- Object.keys(config).forEach((settingId) => {
- const setting = config[settingId];
- if (setting.type === SettingType.CLASS_TOGGLE) {
- const classToggle = setting;
- const value = this.getSetting(section, settingId);
- if (value === true ||
- (value === undefined && classToggle.default === true)) {
- document.body.classList.add(setting.id);
- }
- }
- else if (setting.type === SettingType.CLASS_SELECT) {
- const multiToggle = setting;
- let value = this.getSetting(section, settingId);
- if (value === undefined && !!multiToggle.default) {
- value = multiToggle.default;
- }
- else if (value === undefined) {
- value = 'none';
- }
- if (value !== 'none') {
- document.body.classList.add(value);
- }
- }
- });
- });
- }
- removeClasses() {
- Object.keys(this.config).forEach((section) => {
- const config = this.config[section];
- Object.keys(config).forEach((settingId) => {
- const setting = config[settingId];
- if (setting.type === SettingType.CLASS_TOGGLE) {
- document.body.classList.remove(setting.id);
- }
- else if (setting.type === SettingType.CLASS_SELECT) {
- const multiToggle = setting;
- multiToggle.options.forEach((v) => {
- if (typeof v === 'string') {
- document.body.classList.remove(v);
- }
- else {
- document.body.classList.remove(v.value);
- }
- });
- }
- });
- });
- }
- setCSSVariables() {
- const [vars, themedLight, themedDark] = getCSSVariables(this.settings, this.config, this.gradients, this);
- this.styleTag.innerText = `
- body.css-settings-manager {
- ${vars.reduce((combined, current) => {
- return combined + `--${current.key}: ${current.value}; `;
- }, '')}
- }
-
- body.theme-light.css-settings-manager {
- ${themedLight.reduce((combined, current) => {
- return combined + `--${current.key}: ${current.value}; `;
- }, '')}
- }
-
- body.theme-dark.css-settings-manager {
- ${themedDark.reduce((combined, current) => {
- return combined + `--${current.key}: ${current.value}; `;
- }, '')}
- }
- `
- .trim()
- .replace(/[\r\n\s]+/g, ' ');
- this.plugin.app.workspace.trigger('css-change', {
- source: 'style-settings',
- });
- }
- setConfig(settings) {
- this.config = {};
- this.gradients = {};
- settings.forEach((s) => {
- this.config[s.id] = {};
- s.settings.forEach((setting) => {
- this.config[s.id][setting.id] = setting;
- if (setting.type === SettingType.COLOR_GRADIENT) {
- if (!this.gradients[s.id])
- this.gradients[s.id] = [];
- this.gradients[s.id].push(setting);
- }
- });
- });
- let pruned = false;
- for (const key in this.settings) {
- const [sectionId, settingId] = key.split('@@');
- if (this.config[sectionId] && !this.config[sectionId][settingId]) {
- delete this.settings[key];
- pruned = true;
- }
- }
- if (pruned) {
- this.save();
- }
- else {
- this.setCSSVariables();
- }
- }
- getSetting(sectionId, settingId) {
- return this.settings[`${sectionId}@@${settingId}`];
- }
- getSettings(sectionId, ids) {
- return ids.reduce((settings, id) => {
- const fullId = `${sectionId}@@${id}`;
- const alts = ['dark', 'light'];
- if (this.settings[fullId]) {
- settings[fullId] = this.settings[fullId];
- }
- alts.forEach((alt) => {
- const id = `${fullId}@@${alt}`;
- if (this.settings[id]) {
- settings[id] = this.settings[id];
- }
- });
- return settings;
- }, {});
- }
- setSetting(sectionId, settingId, value) {
- this.settings[`${sectionId}@@${settingId}`] = value;
- this.save();
- this.removeClasses();
- this.initClasses();
- }
- setSettings(settings) {
- Object.keys(settings).forEach((id) => {
- this.settings[id] = settings[id];
- });
- this.removeClasses();
- this.initClasses();
- return this.save();
- }
- clearSetting(sectionId, settingId) {
- delete this.settings[`${sectionId}@@${settingId}`];
- this.save();
- this.removeClasses();
- this.initClasses();
- }
- clearSection(sectionId) {
- Object.keys(this.settings).forEach((key) => {
- const [section] = key.split('@@');
- if (section === sectionId) {
- delete this.settings[key];
- }
- });
- this.save();
- this.removeClasses();
- this.initClasses();
- }
- export(section, config) {
- new ExportModal(this.plugin.app, this.plugin, section, config).open();
- }
- import() {
- new ImportModal(this.plugin.app, this.plugin).open();
- }
-}
-
-const ar = {};
-
-const cz = {};
-
-const da = {};
-
-const de = {
- 'Default:': 'Standard:',
- 'Error:': 'Fehler:',
- 'missing default light value, or value is not in a valid color format': 'Fehlender heller standard Wert oder Wert ist in keinem validen Farb-Format',
- 'missing default dark value, or value is not in a valid color format': 'Fehlender dunkler standard Wert oder Wert ist in keinem validen Farb-Format',
- 'missing default value, or value is not in a valid color format': 'Fehlender standard Wert oder Wert ist in keinem validen Farb-Format',
- 'missing default value': 'Fehlender standard Wert',
-};
-
-const en = {
- 'Default:': 'Default:',
- 'Error:': 'Error:',
- 'missing default light value, or value is not in a valid color format': 'missing default light value, or value is not in a valid color format',
- 'missing default dark value, or value is not in a valid color format': 'missing default dark value, or value is not in a valid color format',
- 'missing default value, or value is not in a valid color format': 'missing default value, or value is not in a valid color format',
- 'missing default value': 'missing default value',
-};
-
-const es = {};
-
-const fr = {};
-
-const hi = {};
-
-const id = {};
-
-const it = {};
-
-const ja = {};
-
-const ko = {};
-
-const nl = {
- 'Default:': 'Standaard:',
- 'Error:': 'Error:',
- 'missing default light value, or value is not in a valid color format': 'Geen standaard waarde voor het lichte thema, of de waarde is niet in het goede formaat',
- 'missing default dark value, or value is not in a valid color format': 'Geen standaard waarde voor het donkere thema, of de waarde is niet in het goede formaat',
- 'missing default value, or value is not in a valid color format': 'Geen standaard waarde, of de waarde is niet in het goede formaat',
- 'missing default value': 'Geen standaard waarde',
-};
-
-const no = {};
-
-const pl = {};
-
-const pt = {};
-
-const ptBr = {};
-
-const ro = {};
-
-const ru = {};
-
-const sq = {};
-
-const tr = {};
-
-const uk = {};
-
-const zh = {
- 'Default:': '默认:',
- 'Error:': '错误:',
- 'missing default light value, or value is not in a valid color format': '缺少默认的浅色模式色值,或该色值没有采用一个有效的颜色格式',
- 'missing default dark value, or value is not in a valid color format': '缺少默认的深色模式色值,或该色值没有采用一个有效的颜色格式',
- 'missing default value, or value is not in a valid color format': '缺少默认色值,或该色值没有采用一个有效的颜色格式',
- 'missing default value': '缺少默认色值',
-};
-
-const zhTw = {};
-
-const lang = window.localStorage.getItem('language');
-const localeMap = {
- ar,
- cz,
- da,
- de,
- en,
- es,
- fr,
- hi,
- id,
- it,
- ja,
- ko,
- nl,
- no,
- pl,
- 'pt-BR': ptBr,
- pt,
- ro,
- ru,
- sq,
- tr,
- uk,
- 'zh-TW': zhTw,
- zh,
-};
-const locale = localeMap[lang || 'en'];
-function t(str) {
- if (!locale) {
- console.error('Error: Style Settings locale not found', lang);
- }
- return (locale && locale[str]) || en[str];
-}
-
-const settingRegExp = /\/\*!?\s*@settings[\r\n]+?([\s\S]+?)\*\//g;
-const nameRegExp = /^name:\s*(.+)$/m;
-function getTitle(config) {
- if (lang) {
- return config[`title.${lang}`] || config.title;
- }
- return config.title;
-}
-function getDescription(config) {
- if (lang) {
- return (config[`description.${lang}`] ||
- config.description);
- }
- return config.description;
-}
-function isValidDefaultColor(color) {
- return /^(#|rgb|hsl)/.test(color);
-}
-function getPickrSettings(opts) {
- const { el, isView, containerEl, swatches, opacity, defaultColor } = opts;
- return {
- el,
- container: isView ? document.body : containerEl,
- theme: 'nano',
- swatches,
- lockOpacity: !opacity,
- default: defaultColor,
- position: 'left-middle',
- components: {
- preview: true,
- hue: true,
- opacity: !!opacity,
- interaction: {
- hex: true,
- rgba: true,
- hsla: true,
- input: true,
- cancel: true,
- save: true,
- },
- },
- };
-}
-function onPickrCancel(instance) {
- instance.hide();
-}
-function sanitizeText(str) {
- if (str === '') {
- return `""`;
- }
- return str.replace(/[;<>]/g, '');
-}
-function createDescription(description, def, defLabel) {
- const fragment = createFragment();
- if (description) {
- fragment.appendChild(document.createTextNode(description));
- }
- if (def) {
- const small = createEl('small');
- small.appendChild(createEl('strong', { text: `${t('Default:')} ` }));
- small.appendChild(document.createTextNode(defLabel || def));
- const div = createEl('div');
- div.appendChild(small);
- fragment.appendChild(div);
- }
- return fragment;
-}
-
-var fuzzysort = createCommonjsModule(function (module) {
-((root, UMD) => {
- if(module.exports) module.exports = UMD();
- else root['fuzzysort'] = UMD();
-})(commonjsGlobal, _ => {
-
- var single = (search, target) => { if(search=='farzher')return {target:"farzher was here (^-^*)/",score:0,_indexes:[0]}
- if(!search || !target) return NULL
-
- var preparedSearch = getPreparedSearch(search);
- if(!isObj(target)) target = getPrepared(target);
-
- var searchBitflags = preparedSearch.bitflags;
- if((searchBitflags & target._bitflags) !== searchBitflags) return NULL
-
- return algorithm(preparedSearch, target)
- };
-
-
- var go = (search, targets, options) => { if(search=='farzher')return [{target:"farzher was here (^-^*)/",score:0,_indexes:[0],obj:targets?targets[0]:NULL}]
- if(!search) return options&&options.all ? all(search, targets, options) : noResults
-
- var preparedSearch = getPreparedSearch(search);
- var searchBitflags = preparedSearch.bitflags;
- preparedSearch.containsSpace;
-
- var threshold = options&&options.threshold || INT_MIN;
- var limit = options&&options['limit'] || INT_MAX; // for some reason only limit breaks when minified
-
- var resultsLen = 0; var limitedCount = 0;
- var targetsLen = targets.length;
-
- // This code is copy/pasted 3 times for performance reasons [options.keys, options.key, no keys]
-
- // options.key
- if(options && options.key) {
- var key = options.key;
- for(var i = 0; i < targetsLen; ++i) { var obj = targets[i];
- var target = getValue(obj, key);
- if(!target) continue
- if(!isObj(target)) target = getPrepared(target);
-
- if((searchBitflags & target._bitflags) !== searchBitflags) continue
- var result = algorithm(preparedSearch, target);
- if(result === NULL) continue
- if(result.score < threshold) continue
-
- // have to clone result so duplicate targets from different obj can each reference the correct obj
- result = {target:result.target, _targetLower:'', _targetLowerCodes:NULL, _nextBeginningIndexes:NULL, _bitflags:0, score:result.score, _indexes:result._indexes, obj:obj}; // hidden
-
- if(resultsLen < limit) { q.add(result); ++resultsLen; }
- else {
- ++limitedCount;
- if(result.score > q.peek().score) q.replaceTop(result);
- }
- }
-
- // options.keys
- } else if(options && options.keys) {
- var scoreFn = options['scoreFn'] || defaultScoreFn;
- var keys = options.keys;
- var keysLen = keys.length;
- for(var i = 0; i < targetsLen; ++i) { var obj = targets[i];
- var objResults = new Array(keysLen);
- for (var keyI = 0; keyI < keysLen; ++keyI) {
- var key = keys[keyI];
- var target = getValue(obj, key);
- if(!target) { objResults[keyI] = NULL; continue }
- if(!isObj(target)) target = getPrepared(target);
-
- if((searchBitflags & target._bitflags) !== searchBitflags) objResults[keyI] = NULL;
- else objResults[keyI] = algorithm(preparedSearch, target);
- }
- objResults.obj = obj; // before scoreFn so scoreFn can use it
- var score = scoreFn(objResults);
- if(score === NULL) continue
- if(score < threshold) continue
- objResults.score = score;
- if(resultsLen < limit) { q.add(objResults); ++resultsLen; }
- else {
- ++limitedCount;
- if(score > q.peek().score) q.replaceTop(objResults);
- }
- }
-
- // no keys
- } else {
- for(var i = 0; i < targetsLen; ++i) { var target = targets[i];
- if(!target) continue
- if(!isObj(target)) target = getPrepared(target);
-
- if((searchBitflags & target._bitflags) !== searchBitflags) continue
- var result = algorithm(preparedSearch, target);
- if(result === NULL) continue
- if(result.score < threshold) continue
- if(resultsLen < limit) { q.add(result); ++resultsLen; }
- else {
- ++limitedCount;
- if(result.score > q.peek().score) q.replaceTop(result);
- }
- }
- }
-
- if(resultsLen === 0) return noResults
- var results = new Array(resultsLen);
- for(var i = resultsLen - 1; i >= 0; --i) results[i] = q.poll();
- results.total = resultsLen + limitedCount;
- return results
- };
-
-
- var highlight = (result, hOpen, hClose) => {
- if(typeof hOpen === 'function') return highlightCallback(result, hOpen)
- if(result === NULL) return NULL
- if(hOpen === undefined) hOpen = '';
- if(hClose === undefined) hClose = '';
- var highlighted = '';
- var matchesIndex = 0;
- var opened = false;
- var target = result.target;
- var targetLen = target.length;
- var indexes = result._indexes;
- indexes = indexes.slice(0, indexes.len).sort((a,b)=>a-b);
- for(var i = 0; i < targetLen; ++i) { var char = target[i];
- if(indexes[matchesIndex] === i) {
- ++matchesIndex;
- if(!opened) { opened = true;
- highlighted += hOpen;
- }
-
- if(matchesIndex === indexes.length) {
- highlighted += char + hClose + target.substr(i+1);
- break
- }
- } else {
- if(opened) { opened = false;
- highlighted += hClose;
- }
- }
- highlighted += char;
- }
-
- return highlighted
- };
- var highlightCallback = (result, cb) => {
- if(result === NULL) return NULL
- var target = result.target;
- var targetLen = target.length;
- var indexes = result._indexes;
- indexes = indexes.slice(0, indexes.len).sort((a,b)=>a-b);
- var highlighted = '';
- var matchI = 0;
- var indexesI = 0;
- var opened = false;
- var result = [];
- for(var i = 0; i < targetLen; ++i) { var char = target[i];
- if(indexes[indexesI] === i) {
- ++indexesI;
- if(!opened) { opened = true;
- result.push(highlighted); highlighted = '';
- }
-
- if(indexesI === indexes.length) {
- highlighted += char;
- result.push(cb(highlighted, matchI++)); highlighted = '';
- result.push(target.substr(i+1));
- break
- }
- } else {
- if(opened) { opened = false;
- result.push(cb(highlighted, matchI++)); highlighted = '';
- }
- }
- highlighted += char;
- }
- return result
- };
-
-
- var indexes = result => result._indexes.slice(0, result._indexes.len).sort((a,b)=>a-b);
-
-
- var prepare = (target) => {
- if(typeof target !== 'string') target = '';
- var info = prepareLowerInfo(target);
- return {'target':target, _targetLower:info._lower, _targetLowerCodes:info.lowerCodes, _nextBeginningIndexes:NULL, _bitflags:info.bitflags, 'score':NULL, _indexes:[0], 'obj':NULL} // hidden
- };
-
-
- // Below this point is only internal code
- // Below this point is only internal code
- // Below this point is only internal code
- // Below this point is only internal code
-
-
- var prepareSearch = (search) => {
- if(typeof search !== 'string') search = '';
- search = search.trim();
- var info = prepareLowerInfo(search);
-
- var spaceSearches = [];
- if(info.containsSpace) {
- var searches = search.split(/\s+/);
- searches = [...new Set(searches)]; // distinct
- for(var i=0; i {
- if(target.length > 999) return prepare(target) // don't cache huge targets
- var targetPrepared = preparedCache.get(target);
- if(targetPrepared !== undefined) return targetPrepared
- targetPrepared = prepare(target);
- preparedCache.set(target, targetPrepared);
- return targetPrepared
- };
- var getPreparedSearch = (search) => {
- if(search.length > 999) return prepareSearch(search) // don't cache huge searches
- var searchPrepared = preparedSearchCache.get(search);
- if(searchPrepared !== undefined) return searchPrepared
- searchPrepared = prepareSearch(search);
- preparedSearchCache.set(search, searchPrepared);
- return searchPrepared
- };
-
-
- var all = (search, targets, options) => {
- var results = []; results.total = targets.length;
-
- var limit = options && options.limit || INT_MAX;
-
- if(options && options.key) {
- for(var i=0;i= limit) return results
- }
- } else if(options && options.keys) {
- for(var i=0;i= 0; --keyI) {
- var target = getValue(obj, options.keys[keyI]);
- if(!target) { objResults[keyI] = NULL; continue }
- if(!isObj(target)) target = getPrepared(target);
- target.score = INT_MIN;
- target._indexes.len = 0;
- objResults[keyI] = target;
- }
- objResults.obj = obj;
- objResults.score = INT_MIN;
- results.push(objResults); if(results.length >= limit) return results
- }
- } else {
- for(var i=0;i= limit) return results
- }
- }
-
- return results
- };
-
-
- var algorithm = (preparedSearch, prepared, allowSpaces=false) => {
- if(allowSpaces===false && preparedSearch.containsSpace) return algorithmSpaces(preparedSearch, prepared)
-
- var searchLower = preparedSearch._lower;
- var searchLowerCodes = preparedSearch.lowerCodes;
- var searchLowerCode = searchLowerCodes[0];
- var targetLowerCodes = prepared._targetLowerCodes;
- var searchLen = searchLowerCodes.length;
- var targetLen = targetLowerCodes.length;
- var searchI = 0; // where we at
- var targetI = 0; // where you at
- var matchesSimpleLen = 0;
-
- // very basic fuzzy match; to remove non-matching targets ASAP!
- // walk through target. find sequential matches.
- // if all chars aren't found then exit
- for(;;) {
- var isMatch = searchLowerCode === targetLowerCodes[targetI];
- if(isMatch) {
- matchesSimple[matchesSimpleLen++] = targetI;
- ++searchI; if(searchI === searchLen) break
- searchLowerCode = searchLowerCodes[searchI];
- }
- ++targetI; if(targetI >= targetLen) return NULL // Failed to find searchI
- }
-
- var searchI = 0;
- var successStrict = false;
- var matchesStrictLen = 0;
-
- var nextBeginningIndexes = prepared._nextBeginningIndexes;
- if(nextBeginningIndexes === NULL) nextBeginningIndexes = prepared._nextBeginningIndexes = prepareNextBeginningIndexes(prepared.target);
- targetI = matchesSimple[0]===0 ? 0 : nextBeginningIndexes[matchesSimple[0]-1];
-
- // Our target string successfully matched all characters in sequence!
- // Let's try a more advanced and strict test to improve the score
- // only count it as a match if it's consecutive or a beginning character!
- var backtrackCount = 0;
- if(targetI !== targetLen) for(;;) {
- if(targetI >= targetLen) {
- // We failed to find a good spot for this search char, go back to the previous search char and force it forward
- if(searchI <= 0) break // We failed to push chars forward for a better match
-
- ++backtrackCount; if(backtrackCount > 200) break // exponential backtracking is taking too long, just give up and return a bad match
-
- --searchI;
- var lastMatch = matchesStrict[--matchesStrictLen];
- targetI = nextBeginningIndexes[lastMatch];
-
- } else {
- var isMatch = searchLowerCodes[searchI] === targetLowerCodes[targetI];
- if(isMatch) {
- matchesStrict[matchesStrictLen++] = targetI;
- ++searchI; if(searchI === searchLen) { successStrict = true; break }
- ++targetI;
- } else {
- targetI = nextBeginningIndexes[targetI];
- }
- }
- }
-
- // check if it's a substring match
- var substringIndex = prepared._targetLower.indexOf(searchLower, matchesSimple[0]); // perf: this is slow
- var isSubstring = ~substringIndex;
- if(isSubstring && !successStrict) { // rewrite the indexes from basic to the substring
- for(var i=0; i 24) score *= (uniqueBeginningIndexes-24)*10; // quite arbitrary numbers here ...
- }
-
- if(isSubstring) score /= 1+searchLen*searchLen*1; // bonus for being a full substring
- if(isSubstringBeginning) score /= 1+searchLen*searchLen*1; // bonus for substring starting on a beginningIndex
-
- score -= targetLen - searchLen; // penality for longer targets
- prepared.score = score;
-
- for(var i = 0; i < matchesBestLen; ++i) prepared._indexes[i] = matchesBest[i];
- prepared._indexes.len = matchesBestLen;
-
- return prepared
- }
- };
- var algorithmSpaces = (preparedSearch, target) => {
- var seen_indexes = new Set();
- var score = 0;
- var result = NULL;
-
- var first_seen_index_last_search = 0;
- var searches = preparedSearch.spaceSearches;
- for(var i=0; i score) {
- return allowSpacesResult
- }
-
- result.score = score;
-
- var i = 0;
- for (let index of seen_indexes) result._indexes[i++] = index;
- result._indexes.len = i;
-
- return result
- };
-
-
- var prepareLowerInfo = (str) => {
- var strLen = str.length;
- var lower = str.toLowerCase();
- var lowerCodes = []; // new Array(strLen) sparse array is too slow
- var bitflags = 0;
- var containsSpace = false; // space isn't stored in bitflags because of how searching with a space works
-
- for(var i = 0; i < strLen; ++i) {
- var lowerCode = lowerCodes[i] = lower.charCodeAt(i);
-
- if(lowerCode === 32) {
- containsSpace = true;
- continue // it's important that we don't set any bitflags for space
- }
-
- var bit = lowerCode>=97&&lowerCode<=122 ? lowerCode-97 // alphabet
- : lowerCode>=48&&lowerCode<=57 ? 26 // numbers
- // 3 bits available
- : lowerCode<=127 ? 30 // other ascii
- : 31; // other utf8
- bitflags |= 1< {
- var targetLen = target.length;
- var beginningIndexes = []; var beginningIndexesLen = 0;
- var wasUpper = false;
- var wasAlphanum = false;
- for(var i = 0; i < targetLen; ++i) {
- var targetCode = target.charCodeAt(i);
- var isUpper = targetCode>=65&&targetCode<=90;
- var isAlphanum = isUpper || targetCode>=97&&targetCode<=122 || targetCode>=48&&targetCode<=57;
- var isBeginning = isUpper && !wasUpper || !wasAlphanum || !isAlphanum;
- wasUpper = isUpper;
- wasAlphanum = isAlphanum;
- if(isBeginning) beginningIndexes[beginningIndexesLen++] = i;
- }
- return beginningIndexes
- };
- var prepareNextBeginningIndexes = (target) => {
- var targetLen = target.length;
- var beginningIndexes = prepareBeginningIndexes(target);
- var nextBeginningIndexes = []; // new Array(targetLen) sparse array is too slow
- var lastIsBeginning = beginningIndexes[0];
- var lastIsBeginningI = 0;
- for(var i = 0; i < targetLen; ++i) {
- if(lastIsBeginning > i) {
- nextBeginningIndexes[i] = lastIsBeginning;
- } else {
- lastIsBeginning = beginningIndexes[++lastIsBeginningI];
- nextBeginningIndexes[i] = lastIsBeginning===undefined ? targetLen : lastIsBeginning;
- }
- }
- return nextBeginningIndexes
- };
-
-
- var cleanup = () => { preparedCache.clear(); preparedSearchCache.clear(); matchesSimple = []; matchesStrict = []; };
-
- var preparedCache = new Map();
- var preparedSearchCache = new Map();
- var matchesSimple = []; var matchesStrict = [];
-
-
- // for use with keys. just returns the maximum score
- var defaultScoreFn = (a) => {
- var max = INT_MIN;
- var len = a.length;
- for (var i = 0; i < len; ++i) {
- var result = a[i]; if(result === NULL) continue
- var score = result.score;
- if(score > max) max = score;
- }
- if(max === INT_MIN) return NULL
- return max
- };
-
- // prop = 'key' 2.5ms optimized for this case, seems to be about as fast as direct obj[prop]
- // prop = 'key1.key2' 10ms
- // prop = ['key1', 'key2'] 27ms
- var getValue = (obj, prop) => {
- var tmp = obj[prop]; if(tmp !== undefined) return tmp
- var segs = prop;
- if(!Array.isArray(prop)) segs = prop.split('.');
- var len = segs.length;
- var i = -1;
- while (obj && (++i < len)) obj = obj[segs[i]];
- return obj
- };
-
- var isObj = (x) => { return typeof x === 'object' }; // faster as a function
- // var INT_MAX = 9007199254740991; var INT_MIN = -INT_MAX
- var INT_MAX = Infinity; var INT_MIN = -INT_MAX;
- var noResults = []; noResults.total = 0;
- var NULL = null;
-
-
- // Hacked version of https://github.com/lemire/FastPriorityQueue.js
- var fastpriorityqueue=r=>{var e=[],o=0,a={},v=r=>{for(var a=0,v=e[a],c=1;c>1]=e[a],c=1+(a<<1);}for(var f=a-1>>1;a>0&&v.score>1)e[a]=e[f];e[a]=v;};return a.add=(r=>{var a=o;e[o++]=r;for(var v=a-1>>1;a>0&&r.score>1)e[a]=e[v];e[a]=r;}),a.poll=(r=>{if(0!==o){var a=e[0];return e[0]=e[--o],v(),a}}),a.peek=(r=>{if(0!==o)return e[0]}),a.replaceTop=(r=>{e[0]=r,v();}),a};
- var q = fastpriorityqueue(); // reuse this
-
-
- // fuzzysort is written this way for minification. all names are mangeled unless quoted
- return {'single':single, 'go':go, 'highlight':highlight, 'prepare':prepare, 'indexes':indexes, 'cleanup':cleanup}
-}); // UMD
-
-// TODO: (feature) frecency
-// TODO: (perf) use different sorting algo depending on the # of results?
-// TODO: (perf) preparedCache is a memory leak
-// TODO: (like sublime) backslash === forwardslash
-// TODO: (perf) prepareSearch seems slow
-});
-
-class AbstractSettingComponent extends obsidian.Component {
- constructor(parent, sectionId, sectionName, setting, settingsManager, isView) {
- super();
- this.childEl = null;
- this.parent = parent;
- this.sectionId = sectionId;
- this.sectionName = sectionName;
- this.setting = setting;
- this.settingsManager = settingsManager;
- this.isView = isView;
- }
- get containerEl() {
- return this.parent instanceof HTMLElement
- ? this.parent
- : this.parent.childEl;
- }
- onload() {
- this.render();
- }
- onunload() {
- this.destroy();
- }
- /**
- * Matches the Component against `str`. A perfect match returns 0, no match returns negative infinity.
- *
- * @param str the string to match this Component against.
- */
- match(str) {
- var _a, _b, _c, _d;
- if (!str) {
- return Number.NEGATIVE_INFINITY;
- }
- return Math.max((_b = (_a = fuzzysort.single(str, getTitle(this.setting))) === null || _a === void 0 ? void 0 : _a.score) !== null && _b !== void 0 ? _b : Number.NEGATIVE_INFINITY, (_d = (_c = fuzzysort.single(str, getDescription(this.setting))) === null || _c === void 0 ? void 0 : _c.score) !== null && _d !== void 0 ? _d : Number.NEGATIVE_INFINITY);
- }
- /**
- * Matches the Component against `str`. A match returns true, no match or a bad match returns false.
- *
- * @param str the string to match this Component against.
- */
- decisiveMatch(str) {
- return this.match(str) > -100000;
- }
-}
-
-const resetTooltip = 'Restore default';
-
-class ClassMultiToggleSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting.default !== 'string') {
- return console.error(`${t('Error:')} ${title} ${t('missing default value')}`);
- }
- let prevValue = this.getPreviousValue();
- const defaultLabel = this.getDefaultOptionLabel();
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(createDescription(description, this.setting.default, defaultLabel));
- this.settingEl.addDropdown((dropdown) => {
- if (this.setting.allowEmpty) {
- dropdown.addOption('none', '');
- }
- for (const o of this.setting.options) {
- if (typeof o === 'string') {
- dropdown.addOption(o, o);
- }
- else {
- dropdown.addOption(o.value, o.label);
- }
- }
- dropdown.setValue(prevValue);
- dropdown.onChange((value) => {
- this.settingsManager.setSetting(this.sectionId, this.setting.id, value);
- prevValue = value;
- });
- this.dropdownComponent = dropdown;
- });
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- this.dropdownComponent.setValue(this.setting.default || 'none');
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
- getDefaultOption() {
- if (this.setting.default) {
- return this.setting.options.find((o) => {
- if (typeof o === 'string') {
- return o === this.setting.default;
- }
- return o.value === this.setting.default;
- });
- }
- return undefined;
- }
- getDefaultOptionLabel() {
- const defaultOption = this.getDefaultOption();
- if (defaultOption) {
- if (typeof defaultOption === 'string') {
- return defaultOption;
- }
- return defaultOption.label;
- }
- return undefined;
- }
- getPreviousValue() {
- const prevValue = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- if (prevValue === undefined) {
- if (this.setting.default) {
- return this.setting.default;
- }
- return 'none';
- }
- return prevValue;
- }
-}
-
-class ClassToggleSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(description !== null && description !== void 0 ? description : '');
- this.settingEl.addToggle((toggle) => {
- const value = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- toggle.setValue(value !== undefined ? !!value : !!this.setting.default);
- toggle.onChange((value) => {
- this.settingsManager.setSetting(this.sectionId, this.setting.id, value);
- });
- this.toggleComponent = toggle;
- });
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- const value = !!this.setting.default;
- this.toggleComponent.setValue(value);
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
-}
-
-class InfoTextSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setClass('style-settings-info-text');
- if (title) {
- this.settingEl.setName(title);
- }
- if (description) {
- if (this.setting.markdown) {
- obsidian.MarkdownRenderer.renderMarkdown(description, this.settingEl.descEl, '', this);
- this.settingEl.descEl.addClass('style-settings-markdown');
- }
- else {
- this.settingEl.setDesc(description);
- }
- }
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
-}
-
-var pickr_min = createCommonjsModule(function (module, exports) {
-/*! Pickr 1.8.4 MIT | https://github.com/Simonwep/pickr */
-!function(t,e){module.exports=e();}(self,(function(){return (()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]});},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});}},e={};t.d(e,{default:()=>x});var o={};function n(t,e,o,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n);}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o1&&void 0!==arguments[1]?arguments[1]:t=>t;function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"));}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)));}const{min:h,max:u,floor:d,round:v}=Math;function m(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return [255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function f(t,e,o){return m(t,e,o).map((t=>v(t).toString(16).padStart(2,"0")))}function g(t,e,o){const n=m(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=h(1-i,1-s,1-r);return [100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}function b(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function y(t,e,o){const n=h(t/=255,e/=255,o/=255),i=u(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else {a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1);}return [360*r,100*a,100*i]}function _(t,e,o,n){e/=100,o/=100;return [...y(255*(1-h(1,(t/=100)*(1-(n/=100))+n)),255*(1-h(1,e*(1-n)+n)),255*(1-h(1,o*(1-n)+n)))]}function w(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return [t,isNaN(n)?0:n,i]}function A(t){return y(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function C(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return "#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e){if(!(n=e[i].exec(t)))continue;const s=t=>!!n[2]==("number"==typeof t);switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return {values:_(t,e,s,r),type:i}}case"rgba":{const[,,,t,e,r,a]=o(n);if(t>255||e>255||r>255||a<0||a>1||!s(a))break t;return {values:[...y(t,e,r),a],a,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...A(e),o],a:o,type:i}}case"hsla":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[...w(t,e,r),a],a,type:i}}case"hsva":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[t,e,r,a],a,type:i}}}}return {values:null,type:null}}function $(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=(t,e)=>function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return e(~o?t.map((t=>Number(t.toFixed(o)))):t)},s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...b(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...m(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=g(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=f(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>$(s.h,s.s,s.v,s.a)};return s}const k=t=>Math.max(Math.min(t,1),0);function S(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update(k(e.cache.x+.01*n),k(e.cache.y+.01*i)),t.preventDefault();}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault());}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t);},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,la.left+a.width&&(l=a.left+a.width),ca.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top;}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=k(l/a.width),h=k(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(h);default:return o.onchange(p,h)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove);},trigger(){e._tapmove();},update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o});},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1});}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function O(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation();}));return {destroy:()=>s(...e)}}const E={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8},L=(t,e,o)=>{const{container:n,margin:i,position:s,variantFlipOrder:r,positionFlipOrder:a}={container:document.documentElement.getBoundingClientRect(),...E,...o},{left:l,top:c}=e.style;e.style.left="0",e.style.top="0";const p=t.getBoundingClientRect(),h=e.getBoundingClientRect(),u={t:p.top-h.height-i,b:p.bottom+i,r:p.right+i,l:p.left-h.width-i},d={vs:p.left,vm:p.left+p.width/2+-h.width/2,ve:p.left+p.width-h.width,hs:p.top,hm:p.bottom-p.height/2-h.height/2,he:p.bottom-h.height},[v,m="middle"]=s.split("-"),f=a[v],g=r[m],{top:b,left:y,bottom:_,right:w}=n;for(const t of f){const o="t"===t||"b"===t,n=u[t],[i,s]=o?["top","left"]:["left","top"],[r,a]=o?[h.height,h.width]:[h.width,h.height],[l,c]=o?[_,w]:[w,_],[p,v]=o?[b,y]:[y,b];if(!(n
l))for(const r of g){const l=d[(o?"v":"h")+r];if(!(lc))return e.style[s]=l-h[s]+"px",e.style[i]=n-h[i]+"px",t+r}}return e.style.left=l,e.style.top=c,null};function P(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class x{constructor(t){P(this,"_initializingActive",!0),P(this,"_recalc",!0),P(this,"_nanopop",null),P(this,"_root",null),P(this,"_color",$()),P(this,"_lastColor",$()),P(this,"_swatchColors",[]),P(this,"_setupAnimationFrame",null),P(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=t=Object.assign({...x.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:h,app:u}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return {update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n;const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return L(e,o,n)}}})(h,u,{margin:r}),h.setAttribute("role","button"),h.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!u.offsetWidth)return d._setupAnimationFrame=requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init");}));}_preBuild(){const{options:t}=this;for(const e of ["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n
\n\n ${o?"":''}\n\n
\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n \n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n
\n `),h=p.interaction;return h.options.find((t=>!t.hidden&&!t.classList.add("active"))),h.type=()=>h.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root);}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app);}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide();}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:S({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const h=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[h===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p);}}),hue:S({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger();}}),opacity:S({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger();}}),selectable:O({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch");}})};this._components=r;}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel");})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide();})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation();})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null);})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide();}),{capture:!0}));}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e);}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)));}),{capture:!0}));}this._eventBindings=o;}_rePositioningPicker(){const{options:t}=this;if(!t.inline){if(!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px";}}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):"";}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this);}_clearColor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"));}_parseLocalColor(t){const{values:e,type:o,a:n}=C(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||x.I18N_DEFAULTS[t]}_emit(t){for(var e=arguments.length,o=new Array(e>1?e-1:0),n=1;nt(...o,this)));}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return ~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=$(...e),s=r(``);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this);}))),!0}return !1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return !1}applyColor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()));}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null));}hide(){return !!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return !this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:360,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return !1;this._color=$(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return !!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return !1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return P(x,"utils",o),P(x,"version","1.8.4"),P(x,"I18N_DEFAULTS",{"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"}),P(x,"DEFAULT_OPTIONS",{appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"}),P(x,"create",(t=>new x(t))),e=e.default})()}));
-
-});
-
-var Pickr = /*@__PURE__*/getDefaultExportFromCjs(pickr_min);
-
-class VariableColorSettingComponent extends AbstractSettingComponent {
- render() {
- var _a;
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting.default !== 'string' ||
- !isValidDefaultColor(this.setting.default)) {
- this.setting.default = (_a = this.settingsManager.plugin
- .getCSSVar(this.setting.id)
- .current) === null || _a === void 0 ? void 0 : _a.trim();
- }
- if (typeof this.setting.default !== 'string' ||
- !isValidDefaultColor(this.setting.default)) {
- return console.error(`${t('Error:')} ${title} ${t('missing default value, or value is not in a valid color format')}`);
- }
- const value = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- const swatches = [];
- if (this.setting.default) {
- swatches.push(this.setting.default);
- }
- if (value !== undefined) {
- swatches.push(value);
- }
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(createDescription(description, this.setting.default));
- // fix, so that the color is correctly shown before the color picker has been opened
- const defaultColor = value !== undefined ? value : this.setting.default;
- this.containerEl.style.setProperty('--pcr-color', defaultColor);
- this.pickr = Pickr.create(getPickrSettings({
- isView: this.isView,
- el: this.settingEl.controlEl.createDiv({ cls: 'picker' }),
- containerEl: this.containerEl,
- swatches: swatches,
- opacity: this.setting.opacity,
- defaultColor: defaultColor,
- }));
- this.pickr.on('save', (color, instance) => {
- if (!color)
- return;
- this.settingsManager.setSetting(this.sectionId, this.setting.id, color.toHEXA().toString());
- instance.hide();
- instance.addSwatch(color.toHEXA().toString());
- });
- this.pickr.on('show', () => {
- const { result } = this.pickr.getRoot().interaction;
- activeWindow.requestAnimationFrame(() => {
- activeWindow.requestAnimationFrame(() => result.select());
- });
- });
- this.pickr.on('cancel', onPickrCancel);
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- this.pickr.setColor(this.setting.default);
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a, _b;
- (_a = this.pickr) === null || _a === void 0 ? void 0 : _a.destroyAndRemove();
- this.pickr = undefined;
- (_b = this.settingEl) === null || _b === void 0 ? void 0 : _b.settingEl.remove();
- }
-}
-
-class VariableNumberSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting.default !== 'number') {
- return console.error(`${t('Error:')} ${title} ${t('missing default value')}`);
- }
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(createDescription(description, this.setting.default.toString(10)));
- this.settingEl.addText((text) => {
- const value = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- const onChange = obsidian.debounce((value) => {
- const isFloat = /\./.test(value);
- this.settingsManager.setSetting(this.sectionId, this.setting.id, isFloat ? parseFloat(value) : parseInt(value, 10));
- }, 250, true);
- text.setValue(value !== undefined ? value.toString() : this.setting.default.toString());
- text.onChange(onChange);
- this.textComponent = text;
- });
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- this.textComponent.setValue(this.setting.default.toString());
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
-}
-
-class VariableNumberSliderSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting.default !== 'number') {
- return console.error(`${t('Error:')} ${title} ${t('missing default value')}`);
- }
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(createDescription(description, this.setting.default.toString(10)));
- this.settingEl.addSlider((slider) => {
- const value = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- const onChange = obsidian.debounce((value) => {
- this.settingsManager.setSetting(this.sectionId, this.setting.id, value);
- }, 250, true);
- slider.setDynamicTooltip();
- slider.setLimits(this.setting.min, this.setting.max, this.setting.step);
- slider.setValue(value !== undefined ? value : this.setting.default);
- slider.onChange(onChange);
- this.sliderComponent = slider;
- });
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- this.sliderComponent.setValue(this.setting.default);
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
-}
-
-class VariableSelectSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting.default !== 'string') {
- return console.error(`${t('Error:')} ${title} ${t('missing default value')}`);
- }
- const defaultLabel = this.getDefaultOptionLabel();
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(createDescription(description, this.setting.default, defaultLabel));
- this.settingEl.addDropdown((dropdown) => {
- const value = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- for (const o of this.setting.options) {
- if (typeof o === 'string') {
- dropdown.addOption(o, o);
- }
- else {
- dropdown.addOption(o.value, o.label);
- }
- }
- dropdown.setValue(value !== undefined ? value : this.setting.default);
- dropdown.onChange((value) => {
- this.settingsManager.setSetting(this.sectionId, this.setting.id, value);
- });
- this.dropdownComponent = dropdown;
- });
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- this.dropdownComponent.setValue(this.setting.default);
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
- getDefaultOption() {
- if (this.setting.default) {
- return this.setting.options.find((o) => {
- if (typeof o === 'string') {
- return o === this.setting.default;
- }
- return o.value === this.setting.default;
- });
- }
- return undefined;
- }
- getDefaultOptionLabel() {
- const defaultOption = this.getDefaultOption();
- if (defaultOption) {
- if (typeof defaultOption === 'string') {
- return defaultOption;
- }
- return defaultOption.label;
- }
- return undefined;
- }
-}
-
-class VariableTextSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting.default !== 'string') {
- return console.error(`${t('Error:')} ${title} ${t('missing default value')}`);
- }
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- this.settingEl.setDesc(createDescription(description, this.setting.default));
- this.settingEl.addText((text) => {
- let value = this.settingsManager.getSetting(this.sectionId, this.setting.id);
- const onChange = obsidian.debounce((value) => {
- this.settingsManager.setSetting(this.sectionId, this.setting.id, sanitizeText(value));
- }, 250, true);
- if (this.setting.quotes && value === `""`) {
- value = ``;
- }
- text.setValue(value ? value.toString() : this.setting.default);
- text.onChange(onChange);
- this.textComponent = text;
- });
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset');
- b.onClick(() => {
- this.textComponent.setValue(this.setting.default);
- this.settingsManager.clearSetting(this.sectionId, this.setting.id);
- });
- b.setTooltip(resetTooltip);
- });
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- }
-}
-
-class VariableThemedColorSettingComponent extends AbstractSettingComponent {
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- if (typeof this.setting['default-light'] !== 'string' ||
- !isValidDefaultColor(this.setting['default-light'])) {
- return console.error(`${t('Error:')} ${title} ${t('missing default light value, or value is not in a valid color format')}`);
- }
- if (typeof this.setting['default-dark'] !== 'string' ||
- !isValidDefaultColor(this.setting['default-dark'])) {
- return console.error(`${t('Error:')} ${title} ${t('missing default dark value, or value is not in a valid color format')}`);
- }
- const idLight = `${this.setting.id}@@light`;
- const idDark = `${this.setting.id}@@dark`;
- const valueLight = this.settingsManager.getSetting(this.sectionId, idLight);
- const valueDark = this.settingsManager.getSetting(this.sectionId, idDark);
- const swatchesLight = [];
- const swatchesDark = [];
- if (this.setting['default-light']) {
- swatchesLight.push(this.setting['default-light']);
- }
- if (valueLight !== undefined) {
- swatchesLight.push(valueLight);
- }
- if (this.setting['default-dark']) {
- swatchesDark.push(this.setting['default-dark']);
- }
- if (valueDark !== undefined) {
- swatchesDark.push(valueDark);
- }
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setName(title);
- // Construct description
- this.settingEl.descEl.createSpan({}, (span) => {
- if (description) {
- span.appendChild(document.createTextNode(description));
- }
- });
- this.settingEl.descEl.createDiv({}, (div) => {
- div.createEl('small', {}, (sm) => {
- sm.appendChild(createEl('strong', { text: 'Default (light): ' }));
- sm.appendChild(document.createTextNode(this.setting['default-light']));
- });
- div.createEl('br');
- div.createEl('small', {}, (sm) => {
- sm.appendChild(createEl('strong', { text: 'Default (dark): ' }));
- sm.appendChild(document.createTextNode(this.setting['default-dark']));
- });
- });
- const wrapper = this.settingEl.controlEl.createDiv({
- cls: 'themed-color-wrapper',
- });
- // Create light color picker
- this.createColorPickerLight(wrapper, this.containerEl, swatchesLight, valueLight, idLight);
- // Create dark color picker
- this.createColorPickerDark(wrapper, this.containerEl, swatchesDark, valueDark, idDark);
- this.settingEl.settingEl.dataset.id = this.setting.id;
- }
- destroy() {
- var _a, _b, _c;
- (_a = this.pickrLight) === null || _a === void 0 ? void 0 : _a.destroyAndRemove();
- (_b = this.pickrDark) === null || _b === void 0 ? void 0 : _b.destroyAndRemove();
- this.pickrLight = undefined;
- this.pickrDark = undefined;
- (_c = this.settingEl) === null || _c === void 0 ? void 0 : _c.settingEl.remove();
- }
- createColorPickerLight(wrapper, containerEl, swatchesLight, valueLight, idLight) {
- const themeLightWrapper = wrapper.createDiv({ cls: 'theme-light' });
- // fix, so that the color is correctly shown before the color picker has been opened
- const defaultColor = valueLight !== undefined
- ? valueLight
- : this.setting['default-light'];
- themeLightWrapper.style.setProperty('--pcr-color', defaultColor);
- this.pickrLight = Pickr.create(getPickrSettings({
- isView: this.isView,
- el: themeLightWrapper.createDiv({ cls: 'picker' }),
- containerEl,
- swatches: swatchesLight,
- opacity: this.setting.opacity,
- defaultColor: defaultColor,
- }));
- this.pickrLight.on('show', () => {
- const { result } = this.pickrLight.getRoot().interaction;
- activeWindow.requestAnimationFrame(() => activeWindow.requestAnimationFrame(() => result.select()));
- });
- this.pickrLight.on('save', (color, instance) => this.onSave(idLight, color, instance));
- this.pickrLight.on('cancel', onPickrCancel);
- const themeLightReset = new obsidian.ButtonComponent(themeLightWrapper.createDiv({ cls: 'pickr-reset' }));
- themeLightReset.setIcon('reset');
- themeLightReset.onClick(() => {
- this.pickrLight.setColor(this.setting['default-light']);
- this.settingsManager.clearSetting(this.sectionId, idLight);
- });
- themeLightReset.setTooltip(resetTooltip);
- }
- createColorPickerDark(wrapper, containerEl, swatchesDark, valueDark, idDark) {
- const themeDarkWrapper = wrapper.createDiv({ cls: 'theme-dark' });
- // fix, so that the color is correctly shown before the color picker has been opened
- const defaultColor = valueDark !== undefined
- ? valueDark
- : this.setting['default-dark'];
- themeDarkWrapper.style.setProperty('--pcr-color', defaultColor);
- this.pickrDark = Pickr.create(getPickrSettings({
- isView: this.isView,
- el: themeDarkWrapper.createDiv({ cls: 'picker' }),
- containerEl,
- swatches: swatchesDark,
- opacity: this.setting.opacity,
- defaultColor: defaultColor,
- }));
- this.pickrDark.on('show', () => {
- const { result } = this.pickrDark.getRoot().interaction;
- activeWindow.requestAnimationFrame(() => activeWindow.requestAnimationFrame(() => result.select()));
- });
- this.pickrDark.on('save', (color, instance) => this.onSave(idDark, color, instance));
- this.pickrDark.on('cancel', onPickrCancel);
- const themeDarkReset = new obsidian.ButtonComponent(themeDarkWrapper.createDiv({ cls: 'pickr-reset' }));
- themeDarkReset.setIcon('reset');
- themeDarkReset.onClick(() => {
- this.pickrDark.setColor(this.setting['default-dark']);
- this.settingsManager.clearSetting(this.sectionId, idDark);
- });
- themeDarkReset.setTooltip(resetTooltip);
- }
- onSave(id, color, instance) {
- if (!color)
- return;
- this.settingsManager.setSetting(this.sectionId, id, color.toHEXA().toString());
- instance.hide();
- instance.addSwatch(color.toHEXA().toString());
- }
-}
-
-function createSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView) {
- if (setting.type === SettingType.HEADING) {
- return new HeadingSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.INFO_TEXT) {
- return new InfoTextSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.CLASS_TOGGLE) {
- return new ClassToggleSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.CLASS_SELECT) {
- return new ClassMultiToggleSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.VARIABLE_TEXT) {
- return new VariableTextSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.VARIABLE_NUMBER) {
- return new VariableNumberSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.VARIABLE_NUMBER_SLIDER) {
- return new VariableNumberSliderSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.VARIABLE_SELECT) {
- return new VariableSelectSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.VARIABLE_COLOR) {
- return new VariableColorSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else if (setting.type === SettingType.VARIABLE_THEMED_COLOR) {
- return new VariableThemedColorSettingComponent(parent, sectionId, sectionName, setting, settingsManager, isView);
- }
- else {
- return undefined;
- }
-}
-function buildSettingComponentTree(opts) {
- const { containerEl, isView, sectionId, settings, settingsManager, sectionName, } = opts;
- const root = new HeadingSettingComponent(containerEl, sectionId, sectionName, settings[0], settingsManager, isView);
- let currentHeading = root;
- for (const setting of settings.splice(1)) {
- if (setting.type === 'heading') {
- const newHeading = setting;
- if (newHeading.level < currentHeading.setting.level) {
- while (newHeading.level < currentHeading.setting.level) {
- currentHeading = currentHeading.parent;
- }
- if (currentHeading.setting.id === root.setting.id) {
- currentHeading = currentHeading.addSettingChild(newHeading);
- }
- else {
- currentHeading = currentHeading.parent.addSettingChild(newHeading);
- }
- }
- else if (newHeading.level === currentHeading.setting.level) {
- currentHeading = currentHeading.parent.addSettingChild(newHeading);
- }
- else {
- currentHeading = currentHeading.addSettingChild(newHeading);
- }
- }
- else {
- currentHeading.addSettingChild(setting);
- }
- }
- return root;
-}
-class HeadingSettingComponent extends AbstractSettingComponent {
- constructor() {
- super(...arguments);
- this.children = [];
- this.filteredChildren = [];
- this.filterMode = false;
- this.filterResultCount = 0;
- }
- render() {
- const title = getTitle(this.setting);
- const description = getDescription(this.setting);
- this.settingEl = new obsidian.Setting(this.containerEl);
- this.settingEl.setHeading();
- this.settingEl.setClass('style-settings-heading');
- this.settingEl.setName(title);
- this.settingEl.setDesc(description !== null && description !== void 0 ? description : '');
- this.settingEl.settingEl.dataset.level = this.setting.level.toString();
- this.settingEl.settingEl.dataset.id = this.setting.id;
- const iconContainer = createSpan({
- cls: 'style-settings-collapse-indicator',
- });
- obsidian.setIcon(iconContainer, 'right-triangle');
- this.settingEl.nameEl.prepend(iconContainer);
- this.resultsEl = this.settingEl.nameEl.createSpan({
- cls: 'style-settings-filter-result-count',
- text: this.filterMode ? `${this.filterResultCount} Results` : undefined,
- });
- this.settingEl.settingEl.addEventListener('click', () => {
- this.toggleVisible();
- });
- this.addResetButton();
- this.addExportButton();
- this.childEl = this.containerEl.createDiv({
- cls: 'style-settings-container',
- });
- this.setCollapsed(this.setting.collapsed);
- }
- destroy() {
- var _a;
- this.removeChildren();
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.remove();
- this.childEl.remove();
- }
- filter(filterString) {
- var _a;
- this.filteredChildren = [];
- this.filterResultCount = 0;
- for (const child of this.children) {
- if (child.setting.type === SettingType.HEADING) {
- const childResultCount = child.filter(filterString);
- if (childResultCount > 0) {
- this.filterResultCount += childResultCount;
- this.filteredChildren.push(child);
- }
- }
- else {
- if (child.decisiveMatch(filterString)) {
- this.filteredChildren.push(child);
- this.filterResultCount += 1;
- }
- }
- }
- this.filterMode = true;
- if (this.filterResultCount) {
- this.setCollapsed(false);
- }
- else {
- this.setCollapsed(true);
- }
- this.renderChildren();
- (_a = this.resultsEl) === null || _a === void 0 ? void 0 : _a.setText(`${this.filterResultCount} Results`);
- return this.filterResultCount;
- }
- clearFilter() {
- var _a;
- this.filteredChildren = [];
- for (const child of this.children) {
- if (child.setting.type === SettingType.HEADING) {
- child.clearFilter();
- }
- }
- this.filterMode = false;
- this.setCollapsed(true);
- this.renderChildren();
- (_a = this.resultsEl) === null || _a === void 0 ? void 0 : _a.empty();
- }
- renderChildren() {
- this.removeChildren();
- if (this.filterMode) {
- for (const child of this.filteredChildren) {
- this.addChild(child);
- }
- }
- else {
- for (const child of this.children) {
- this.addChild(child);
- }
- }
- }
- removeChildren() {
- for (const child of this.children) {
- this.removeChild(child);
- }
- }
- toggleVisible() {
- this.setCollapsed(!this.setting.collapsed);
- }
- setCollapsed(collapsed) {
- var _a;
- this.setting.collapsed = collapsed;
- (_a = this.settingEl) === null || _a === void 0 ? void 0 : _a.settingEl.toggleClass('is-collapsed', collapsed);
- if (collapsed) {
- this.removeChildren();
- }
- else {
- this.renderChildren();
- }
- }
- addResetButton() {
- if (this.setting.resetFn) {
- this.settingEl.addExtraButton((b) => {
- b.setIcon('reset')
- .setTooltip('Reset all settings to default')
- .onClick(this.setting.resetFn);
- });
- }
- }
- addExportButton() {
- this.settingEl.addExtraButton((b) => {
- b.setIcon('install');
- b.setTooltip('Export settings');
- b.extraSettingsEl.onClickEvent((e) => {
- e.stopPropagation();
- let title = getTitle(this.setting);
- title =
- this.sectionName === title ? title : `${this.sectionName} > ${title}`;
- this.settingsManager.export(title, this.settingsManager.getSettings(this.sectionId, this.getAllChildrenIds()));
- });
- });
- }
- addSettingChild(child) {
- const newSettingComponent = createSettingComponent(this, this.sectionId, this.sectionName, child, this.settingsManager, this.isView);
- if (!newSettingComponent) {
- return undefined;
- }
- this.children.push(newSettingComponent);
- return newSettingComponent;
- }
- getAllChildrenIds() {
- const children = [];
- for (const child of this.children) {
- children.push(child.setting.id);
- if (child.setting.type === 'heading') {
- children.push(...child.getAllChildrenIds());
- }
- }
- return children;
- }
-}
-
-class SettingsMarkup extends obsidian.Component {
- constructor(app, plugin, containerEl, isView) {
- super();
- this.settingsComponentTrees = [];
- this.filterString = '';
- this.settings = [];
- this.errorList = [];
- this.app = app;
- this.plugin = plugin;
- this.containerEl = containerEl;
- this.isView = !!isView;
- }
- onload() {
- this.display();
- }
- onunload() {
- this.settingsComponentTrees = [];
- }
- display() {
- this.generate(this.settings);
- }
- removeChildren() {
- for (const settingsComponentTree of this.settingsComponentTrees) {
- this.removeChild(settingsComponentTree);
- }
- }
- /**
- * Recursively destroys all setting elements.
- */
- cleanup() {
- var _a;
- this.removeChildren();
- (_a = this.settingsContainerEl) === null || _a === void 0 ? void 0 : _a.empty();
- }
- setSettings(settings, errorList) {
- this.settings = settings;
- this.errorList = errorList;
- if (this.containerEl.parentNode) {
- this.generate(settings);
- }
- }
- displayErrors() {
- const { containerEl, errorList } = this;
- errorList.forEach((err) => {
- containerEl.createDiv({ cls: 'style-settings-error' }, (wrapper) => {
- wrapper.createDiv({
- cls: 'style-settings-error-name',
- text: `Error: ${err.name}`,
- });
- wrapper.createDiv({
- cls: 'style-settings-error-desc',
- text: err.error,
- });
- });
- });
- }
- displayEmpty() {
- const { containerEl } = this;
- containerEl.createDiv({ cls: 'style-settings-empty' }, (wrapper) => {
- wrapper.createDiv({
- cls: 'style-settings-empty-name',
- text: 'No style settings found',
- });
- wrapper.createDiv({ cls: 'style-settings-empty-desc' }).appendChild(createFragment((frag) => {
- frag.appendText('Style settings configured by theme and plugin authors will show up here. You can also create your own configuration by creating a CSS snippet in your vault. ');
- frag.createEl('a', {
- text: 'Click here for details and examples.',
- href: 'https://github.com/mgmeyers/obsidian-style-settings#obsidian-style-settings-plugin',
- });
- }));
- });
- }
- generate(settings) {
- var _a;
- const { containerEl, plugin } = this;
- containerEl.empty();
- this.cleanup();
- this.displayErrors();
- if (settings.length === 0) {
- return this.displayEmpty();
- }
- new obsidian.Setting(containerEl).then((setting) => {
- // Build and import link to open the import modal
- setting.controlEl.createEl('a', {
- cls: 'style-settings-import',
- text: 'Import',
- href: '#',
- }, (el) => {
- el.addEventListener('click', (e) => {
- e.preventDefault();
- this.plugin.settingsManager.import();
- });
- });
- // Build and export link to open the export modal
- setting.controlEl.createEl('a', {
- cls: 'style-settings-export',
- text: 'Export',
- href: '#',
- }, (el) => {
- el.addEventListener('click', (e) => {
- e.preventDefault();
- this.plugin.settingsManager.export('All settings', this.plugin.settingsManager.settings);
- });
- });
- // Searchbar
- let searchComponent;
- setting.addSearch((s) => {
- searchComponent = s;
- });
- // move the search component from the back to the front
- setting.nameEl.appendChild(setting.controlEl.lastChild);
- searchComponent.setValue(this.filterString);
- searchComponent.onChange(obsidian.debounce((value) => {
- this.filterString = value;
- if (value) {
- this.filter();
- }
- else {
- this.clearFilter();
- }
- }, 250, true));
- searchComponent.setPlaceholder('Search Style Settings...');
- });
- this.settingsContainerEl = containerEl.createDiv();
- this.settingsComponentTrees = [];
- for (const s of settings) {
- const options = [
- {
- id: s.id,
- type: 'heading',
- title: s.name,
- level: 0,
- collapsed: (_a = s.collapsed) !== null && _a !== void 0 ? _a : true,
- resetFn: () => {
- plugin.settingsManager.clearSection(s.id);
- this.rerender();
- },
- },
- ...s.settings,
- ];
- try {
- const settingsComponentTree = buildSettingComponentTree({
- containerEl: this.settingsContainerEl,
- isView: this.isView,
- sectionId: s.id,
- sectionName: s.name,
- settings: options,
- settingsManager: plugin.settingsManager,
- });
- this.addChild(settingsComponentTree);
- this.settingsComponentTrees.push(settingsComponentTree);
- }
- catch (e) {
- console.error('Style Settings | Failed to render section', e);
- }
- }
- }
- /**
- * Recursively filter all setting elements based on `filterString` and then re-renders.
- */
- filter() {
- for (const settingsComponentTree of this.settingsComponentTrees) {
- settingsComponentTree.filter(this.filterString);
- }
- }
- /**
- * Recursively clears the filter and then re-renders.
- */
- clearFilter() {
- for (const settingsComponentTree of this.settingsComponentTrees) {
- settingsComponentTree.clearFilter();
- }
- }
- rerender() {
- this.cleanup();
- this.display();
- }
-}
-
-class CSSSettingsTab extends obsidian.PluginSettingTab {
- constructor(app, plugin) {
- super(app, plugin);
- this.plugin = plugin;
- }
- rerender() {
- var _a;
- (_a = this.settingsMarkup) === null || _a === void 0 ? void 0 : _a.rerender();
- }
- setSettings(settings, errorList) {
- this.settings = settings;
- this.errorList = errorList;
- if (this.settingsMarkup) {
- this.settingsMarkup.setSettings(settings, errorList);
- }
- }
- display() {
- this.settingsMarkup = this.plugin.addChild(new SettingsMarkup(this.app, this.plugin, this.containerEl));
- if (this.settings) {
- this.settingsMarkup.setSettings(this.settings, this.errorList);
- }
- }
- hide() {
- this.plugin.removeChild(this.settingsMarkup);
- this.settingsMarkup = null;
- }
-}
-
-const viewType = 'style-settings';
-class SettingsView extends obsidian.ItemView {
- constructor(plugin, leaf) {
- super(leaf);
- this.plugin = plugin;
- }
- rerender() {
- var _a;
- (_a = this.settingsMarkup) === null || _a === void 0 ? void 0 : _a.rerender();
- }
- setSettings(settings, errorList) {
- this.settings = settings;
- this.errorList = errorList;
- if (this.settingsMarkup) {
- this.settingsMarkup.setSettings(settings, errorList);
- }
- }
- onload() {
- this.settingsMarkup = this.addChild(new SettingsMarkup(this.plugin.app, this.plugin, this.contentEl, true));
- if (this.settings) {
- this.settingsMarkup.setSettings(this.settings, this.errorList);
- }
- }
- onunload() {
- this.settingsMarkup = null;
- }
- getViewType() {
- return viewType;
- }
- getIcon() {
- return 'gear';
- }
- getDisplayText() {
- return 'Style Settings';
- }
-}
-
-// Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment
-const INDENT_REGEX = /^(?:( )+|\t+)/;
-
-const INDENT_TYPE_SPACE = 'space';
-const INDENT_TYPE_TAB = 'tab';
-
-/**
-Make a Map that counts how many indents/unindents have occurred for a given size and how many lines follow a given indentation.
-
-The key is a concatenation of the indentation type (s = space and t = tab) and the size of the indents/unindents.
-
-```
-indents = {
- t3: [1, 0],
- t4: [1, 5],
- s5: [1, 0],
- s12: [1, 0],
-}
-```
-*/
-function makeIndentsMap(string, ignoreSingleSpaces) {
- const indents = new Map();
-
- // Remember the size of previous line's indentation
- let previousSize = 0;
- let previousIndentType;
-
- // Indents key (ident type + size of the indents/unindents)
- let key;
-
- for (const line of string.split(/\n/g)) {
- if (!line) {
- // Ignore empty lines
- continue;
- }
-
- let indent;
- let indentType;
- let weight;
- let entry;
- const matches = line.match(INDENT_REGEX);
-
- if (matches === null) {
- previousSize = 0;
- previousIndentType = '';
- } else {
- indent = matches[0].length;
- indentType = matches[1] ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB;
-
- // Ignore single space unless it's the only indent detected to prevent common false positives
- if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) {
- continue;
- }
-
- if (indentType !== previousIndentType) {
- previousSize = 0;
- }
-
- previousIndentType = indentType;
-
- weight = 0;
-
- const indentDifference = indent - previousSize;
- previousSize = indent;
-
- // Previous line have same indent?
- if (indentDifference === 0) {
- weight++;
- // We use the key from previous loop
- } else {
- const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference;
- key = encodeIndentsKey(indentType, absoluteIndentDifference);
- }
-
- // Update the stats
- entry = indents.get(key);
- entry = entry === undefined ? [1, 0] : [++entry[0], entry[1] + weight];
-
- indents.set(key, entry);
- }
- }
-
- return indents;
-}
-
-// Encode the indent type and amount as a string (e.g. 's4') for use as a compound key in the indents Map.
-function encodeIndentsKey(indentType, indentAmount) {
- const typeCharacter = indentType === INDENT_TYPE_SPACE ? 's' : 't';
- return typeCharacter + String(indentAmount);
-}
-
-// Extract the indent type and amount from a key of the indents Map.
-function decodeIndentsKey(indentsKey) {
- const keyHasTypeSpace = indentsKey[0] === 's';
- const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB;
-
- const amount = Number(indentsKey.slice(1));
-
- return {type, amount};
-}
-
-// Return the key (e.g. 's4') from the indents Map that represents the most common indent,
-// or return undefined if there are no indents.
-function getMostUsedKey(indents) {
- let result;
- let maxUsed = 0;
- let maxWeight = 0;
-
- for (const [key, [usedCount, weight]] of indents) {
- if (usedCount > maxUsed || (usedCount === maxUsed && weight > maxWeight)) {
- maxUsed = usedCount;
- maxWeight = weight;
- result = key;
- }
- }
-
- return result;
-}
-
-function makeIndentString(type, amount) {
- const indentCharacter = type === INDENT_TYPE_SPACE ? ' ' : '\t';
- return indentCharacter.repeat(amount);
-}
-
-function detectIndent(string) {
- if (typeof string !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- // Identify indents while skipping single space indents to avoid common edge cases (e.g. code comments)
- // If no indents are identified, run again and include all indents for comprehensive detection
- let indents = makeIndentsMap(string, true);
- if (indents.size === 0) {
- indents = makeIndentsMap(string, false);
- }
-
- const keyOfMostUsedIndent = getMostUsedKey(indents);
-
- let type;
- let amount = 0;
- let indent = '';
-
- if (keyOfMostUsedIndent !== undefined) {
- ({type, amount} = decodeIndentsKey(keyOfMostUsedIndent));
- indent = makeIndentString(type, amount);
- }
-
- return {
- amount,
- type,
- indent,
- };
-}
-
-/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
-function isNothing(subject) {
- return (typeof subject === 'undefined') || (subject === null);
-}
-
-
-function isObject(subject) {
- return (typeof subject === 'object') && (subject !== null);
-}
-
-
-function toArray(sequence) {
- if (Array.isArray(sequence)) return sequence;
- else if (isNothing(sequence)) return [];
-
- return [ sequence ];
-}
-
-
-function extend(target, source) {
- var index, length, key, sourceKeys;
-
- if (source) {
- sourceKeys = Object.keys(source);
-
- for (index = 0, length = sourceKeys.length; index < length; index += 1) {
- key = sourceKeys[index];
- target[key] = source[key];
- }
- }
-
- return target;
-}
-
-
-function repeat(string, count) {
- var result = '', cycle;
-
- for (cycle = 0; cycle < count; cycle += 1) {
- result += string;
- }
-
- return result;
-}
-
-
-function isNegativeZero(number) {
- return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
-}
-
-
-var isNothing_1 = isNothing;
-var isObject_1 = isObject;
-var toArray_1 = toArray;
-var repeat_1 = repeat;
-var isNegativeZero_1 = isNegativeZero;
-var extend_1 = extend;
-
-var common = {
- isNothing: isNothing_1,
- isObject: isObject_1,
- toArray: toArray_1,
- repeat: repeat_1,
- isNegativeZero: isNegativeZero_1,
- extend: extend_1
-};
-
-// YAML error class. http://stackoverflow.com/questions/8458984
-
-
-function formatError(exception, compact) {
- var where = '', message = exception.reason || '(unknown reason)';
-
- if (!exception.mark) return message;
-
- if (exception.mark.name) {
- where += 'in "' + exception.mark.name + '" ';
- }
-
- where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
-
- if (!compact && exception.mark.snippet) {
- where += '\n\n' + exception.mark.snippet;
- }
-
- return message + ' ' + where;
-}
-
-
-function YAMLException$1(reason, mark) {
- // Super constructor
- Error.call(this);
-
- this.name = 'YAMLException';
- this.reason = reason;
- this.mark = mark;
- this.message = formatError(this, false);
-
- // Include stack trace in error object
- if (Error.captureStackTrace) {
- // Chrome and NodeJS
- Error.captureStackTrace(this, this.constructor);
- } else {
- // FF, IE 10+ and Safari 6+. Fallback for others
- this.stack = (new Error()).stack || '';
- }
-}
-
-
-// Inherit from Error
-YAMLException$1.prototype = Object.create(Error.prototype);
-YAMLException$1.prototype.constructor = YAMLException$1;
-
-
-YAMLException$1.prototype.toString = function toString(compact) {
- return this.name + ': ' + formatError(this, compact);
-};
-
-
-var exception = YAMLException$1;
-
-// get snippet for a single line, respecting maxLength
-function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
- var head = '';
- var tail = '';
- var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
-
- if (position - lineStart > maxHalfLength) {
- head = ' ... ';
- lineStart = position - maxHalfLength + head.length;
- }
-
- if (lineEnd - position > maxHalfLength) {
- tail = ' ...';
- lineEnd = position + maxHalfLength - tail.length;
- }
-
- return {
- str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail,
- pos: position - lineStart + head.length // relative position
- };
-}
-
-
-function padStart(string, max) {
- return common.repeat(' ', max - string.length) + string;
-}
-
-
-function makeSnippet(mark, options) {
- options = Object.create(options || null);
-
- if (!mark.buffer) return null;
-
- if (!options.maxLength) options.maxLength = 79;
- if (typeof options.indent !== 'number') options.indent = 1;
- if (typeof options.linesBefore !== 'number') options.linesBefore = 3;
- if (typeof options.linesAfter !== 'number') options.linesAfter = 2;
-
- var re = /\r?\n|\r|\0/g;
- var lineStarts = [ 0 ];
- var lineEnds = [];
- var match;
- var foundLineNo = -1;
-
- while ((match = re.exec(mark.buffer))) {
- lineEnds.push(match.index);
- lineStarts.push(match.index + match[0].length);
-
- if (mark.position <= match.index && foundLineNo < 0) {
- foundLineNo = lineStarts.length - 2;
- }
- }
-
- if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
-
- var result = '', i, line;
- var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
- var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
-
- for (i = 1; i <= options.linesBefore; i++) {
- if (foundLineNo - i < 0) break;
- line = getLine(
- mark.buffer,
- lineStarts[foundLineNo - i],
- lineEnds[foundLineNo - i],
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
- maxLineLength
- );
- result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
- ' | ' + line.str + '\n' + result;
- }
-
- line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
- result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
- ' | ' + line.str + '\n';
- result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n';
-
- for (i = 1; i <= options.linesAfter; i++) {
- if (foundLineNo + i >= lineEnds.length) break;
- line = getLine(
- mark.buffer,
- lineStarts[foundLineNo + i],
- lineEnds[foundLineNo + i],
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
- maxLineLength
- );
- result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
- ' | ' + line.str + '\n';
- }
-
- return result.replace(/\n$/, '');
-}
-
-
-var snippet = makeSnippet;
-
-var TYPE_CONSTRUCTOR_OPTIONS = [
- 'kind',
- 'multi',
- 'resolve',
- 'construct',
- 'instanceOf',
- 'predicate',
- 'represent',
- 'representName',
- 'defaultStyle',
- 'styleAliases'
-];
-
-var YAML_NODE_KINDS = [
- 'scalar',
- 'sequence',
- 'mapping'
-];
-
-function compileStyleAliases(map) {
- var result = {};
-
- if (map !== null) {
- Object.keys(map).forEach(function (style) {
- map[style].forEach(function (alias) {
- result[String(alias)] = style;
- });
- });
- }
-
- return result;
-}
-
-function Type$1(tag, options) {
- options = options || {};
-
- Object.keys(options).forEach(function (name) {
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
- throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
- }
- });
-
- // TODO: Add tag format check.
- this.options = options; // keep original options in case user wants to extend this type later
- this.tag = tag;
- this.kind = options['kind'] || null;
- this.resolve = options['resolve'] || function () { return true; };
- this.construct = options['construct'] || function (data) { return data; };
- this.instanceOf = options['instanceOf'] || null;
- this.predicate = options['predicate'] || null;
- this.represent = options['represent'] || null;
- this.representName = options['representName'] || null;
- this.defaultStyle = options['defaultStyle'] || null;
- this.multi = options['multi'] || false;
- this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
-
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
- throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
- }
-}
-
-var type = Type$1;
-
-/*eslint-disable max-len*/
-
-
-
-
-
-function compileList(schema, name) {
- var result = [];
-
- schema[name].forEach(function (currentType) {
- var newIndex = result.length;
-
- result.forEach(function (previousType, previousIndex) {
- if (previousType.tag === currentType.tag &&
- previousType.kind === currentType.kind &&
- previousType.multi === currentType.multi) {
-
- newIndex = previousIndex;
- }
- });
-
- result[newIndex] = currentType;
- });
-
- return result;
-}
-
-
-function compileMap(/* lists... */) {
- var result = {
- scalar: {},
- sequence: {},
- mapping: {},
- fallback: {},
- multi: {
- scalar: [],
- sequence: [],
- mapping: [],
- fallback: []
- }
- }, index, length;
-
- function collectType(type) {
- if (type.multi) {
- result.multi[type.kind].push(type);
- result.multi['fallback'].push(type);
- } else {
- result[type.kind][type.tag] = result['fallback'][type.tag] = type;
- }
- }
-
- for (index = 0, length = arguments.length; index < length; index += 1) {
- arguments[index].forEach(collectType);
- }
- return result;
-}
-
-
-function Schema$1(definition) {
- return this.extend(definition);
-}
-
-
-Schema$1.prototype.extend = function extend(definition) {
- var implicit = [];
- var explicit = [];
-
- if (definition instanceof type) {
- // Schema.extend(type)
- explicit.push(definition);
-
- } else if (Array.isArray(definition)) {
- // Schema.extend([ type1, type2, ... ])
- explicit = explicit.concat(definition);
-
- } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
- // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
- if (definition.implicit) implicit = implicit.concat(definition.implicit);
- if (definition.explicit) explicit = explicit.concat(definition.explicit);
-
- } else {
- throw new exception('Schema.extend argument should be a Type, [ Type ], ' +
- 'or a schema definition ({ implicit: [...], explicit: [...] })');
- }
-
- implicit.forEach(function (type$1) {
- if (!(type$1 instanceof type)) {
- throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
- }
-
- if (type$1.loadKind && type$1.loadKind !== 'scalar') {
- throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
- }
-
- if (type$1.multi) {
- throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
- }
- });
-
- explicit.forEach(function (type$1) {
- if (!(type$1 instanceof type)) {
- throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
- }
- });
-
- var result = Object.create(Schema$1.prototype);
-
- result.implicit = (this.implicit || []).concat(implicit);
- result.explicit = (this.explicit || []).concat(explicit);
-
- result.compiledImplicit = compileList(result, 'implicit');
- result.compiledExplicit = compileList(result, 'explicit');
- result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
-
- return result;
-};
-
-
-var schema = Schema$1;
-
-var str = new type('tag:yaml.org,2002:str', {
- kind: 'scalar',
- construct: function (data) { return data !== null ? data : ''; }
-});
-
-var seq = new type('tag:yaml.org,2002:seq', {
- kind: 'sequence',
- construct: function (data) { return data !== null ? data : []; }
-});
-
-var map = new type('tag:yaml.org,2002:map', {
- kind: 'mapping',
- construct: function (data) { return data !== null ? data : {}; }
-});
-
-var failsafe = new schema({
- explicit: [
- str,
- seq,
- map
- ]
-});
-
-function resolveYamlNull(data) {
- if (data === null) return true;
-
- var max = data.length;
-
- return (max === 1 && data === '~') ||
- (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
-}
-
-function constructYamlNull() {
- return null;
-}
-
-function isNull(object) {
- return object === null;
-}
-
-var _null = new type('tag:yaml.org,2002:null', {
- kind: 'scalar',
- resolve: resolveYamlNull,
- construct: constructYamlNull,
- predicate: isNull,
- represent: {
- canonical: function () { return '~'; },
- lowercase: function () { return 'null'; },
- uppercase: function () { return 'NULL'; },
- camelcase: function () { return 'Null'; },
- empty: function () { return ''; }
- },
- defaultStyle: 'lowercase'
-});
-
-function resolveYamlBoolean(data) {
- if (data === null) return false;
-
- var max = data.length;
-
- return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
- (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
-}
-
-function constructYamlBoolean(data) {
- return data === 'true' ||
- data === 'True' ||
- data === 'TRUE';
-}
-
-function isBoolean(object) {
- return Object.prototype.toString.call(object) === '[object Boolean]';
-}
-
-var bool = new type('tag:yaml.org,2002:bool', {
- kind: 'scalar',
- resolve: resolveYamlBoolean,
- construct: constructYamlBoolean,
- predicate: isBoolean,
- represent: {
- lowercase: function (object) { return object ? 'true' : 'false'; },
- uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
- camelcase: function (object) { return object ? 'True' : 'False'; }
- },
- defaultStyle: 'lowercase'
-});
-
-function isHexCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
- ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
- ((0x61/* a */ <= c) && (c <= 0x66/* f */));
-}
-
-function isOctCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
-}
-
-function isDecCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
-}
-
-function resolveYamlInteger(data) {
- if (data === null) return false;
-
- var max = data.length,
- index = 0,
- hasDigits = false,
- ch;
-
- if (!max) return false;
-
- ch = data[index];
-
- // sign
- if (ch === '-' || ch === '+') {
- ch = data[++index];
- }
-
- if (ch === '0') {
- // 0
- if (index + 1 === max) return true;
- ch = data[++index];
-
- // base 2, base 8, base 16
-
- if (ch === 'b') {
- // base 2
- index++;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (ch !== '0' && ch !== '1') return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
-
-
- if (ch === 'x') {
- // base 16
- index++;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isHexCode(data.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
-
-
- if (ch === 'o') {
- // base 8
- index++;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isOctCode(data.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
- }
-
- // base 10 (except 0)
-
- // value should not start with `_`;
- if (ch === '_') return false;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isDecCode(data.charCodeAt(index))) {
- return false;
- }
- hasDigits = true;
- }
-
- // Should have digits and should not end with `_`
- if (!hasDigits || ch === '_') return false;
-
- return true;
-}
-
-function constructYamlInteger(data) {
- var value = data, sign = 1, ch;
-
- if (value.indexOf('_') !== -1) {
- value = value.replace(/_/g, '');
- }
-
- ch = value[0];
-
- if (ch === '-' || ch === '+') {
- if (ch === '-') sign = -1;
- value = value.slice(1);
- ch = value[0];
- }
-
- if (value === '0') return 0;
-
- if (ch === '0') {
- if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
- if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
- if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
- }
-
- return sign * parseInt(value, 10);
-}
-
-function isInteger(object) {
- return (Object.prototype.toString.call(object)) === '[object Number]' &&
- (object % 1 === 0 && !common.isNegativeZero(object));
-}
-
-var int = new type('tag:yaml.org,2002:int', {
- kind: 'scalar',
- resolve: resolveYamlInteger,
- construct: constructYamlInteger,
- predicate: isInteger,
- represent: {
- binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
- octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
- decimal: function (obj) { return obj.toString(10); },
- /* eslint-disable max-len */
- hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
- },
- defaultStyle: 'decimal',
- styleAliases: {
- binary: [ 2, 'bin' ],
- octal: [ 8, 'oct' ],
- decimal: [ 10, 'dec' ],
- hexadecimal: [ 16, 'hex' ]
- }
-});
-
-var YAML_FLOAT_PATTERN = new RegExp(
- // 2.5e4, 2.5 and integers
- '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
- // .2e4, .2
- // special case, seems not from spec
- '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
- // .inf
- '|[-+]?\\.(?:inf|Inf|INF)' +
- // .nan
- '|\\.(?:nan|NaN|NAN))$');
-
-function resolveYamlFloat(data) {
- if (data === null) return false;
-
- if (!YAML_FLOAT_PATTERN.test(data) ||
- // Quick hack to not allow integers end with `_`
- // Probably should update regexp & check speed
- data[data.length - 1] === '_') {
- return false;
- }
-
- return true;
-}
-
-function constructYamlFloat(data) {
- var value, sign;
-
- value = data.replace(/_/g, '').toLowerCase();
- sign = value[0] === '-' ? -1 : 1;
-
- if ('+-'.indexOf(value[0]) >= 0) {
- value = value.slice(1);
- }
-
- if (value === '.inf') {
- return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
-
- } else if (value === '.nan') {
- return NaN;
- }
- return sign * parseFloat(value, 10);
-}
-
-
-var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
-
-function representYamlFloat(object, style) {
- var res;
-
- if (isNaN(object)) {
- switch (style) {
- case 'lowercase': return '.nan';
- case 'uppercase': return '.NAN';
- case 'camelcase': return '.NaN';
- }
- } else if (Number.POSITIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '.inf';
- case 'uppercase': return '.INF';
- case 'camelcase': return '.Inf';
- }
- } else if (Number.NEGATIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '-.inf';
- case 'uppercase': return '-.INF';
- case 'camelcase': return '-.Inf';
- }
- } else if (common.isNegativeZero(object)) {
- return '-0.0';
- }
-
- res = object.toString(10);
-
- // JS stringifier can build scientific format without dots: 5e-100,
- // while YAML requres dot: 5.e-100. Fix it with simple hack
-
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
-}
-
-function isFloat(object) {
- return (Object.prototype.toString.call(object) === '[object Number]') &&
- (object % 1 !== 0 || common.isNegativeZero(object));
-}
-
-var float = new type('tag:yaml.org,2002:float', {
- kind: 'scalar',
- resolve: resolveYamlFloat,
- construct: constructYamlFloat,
- predicate: isFloat,
- represent: representYamlFloat,
- defaultStyle: 'lowercase'
-});
-
-var json = failsafe.extend({
- implicit: [
- _null,
- bool,
- int,
- float
- ]
-});
-
-var core = json;
-
-var YAML_DATE_REGEXP = new RegExp(
- '^([0-9][0-9][0-9][0-9])' + // [1] year
- '-([0-9][0-9])' + // [2] month
- '-([0-9][0-9])$'); // [3] day
-
-var YAML_TIMESTAMP_REGEXP = new RegExp(
- '^([0-9][0-9][0-9][0-9])' + // [1] year
- '-([0-9][0-9]?)' + // [2] month
- '-([0-9][0-9]?)' + // [3] day
- '(?:[Tt]|[ \\t]+)' + // ...
- '([0-9][0-9]?)' + // [4] hour
- ':([0-9][0-9])' + // [5] minute
- ':([0-9][0-9])' + // [6] second
- '(?:\\.([0-9]*))?' + // [7] fraction
- '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
- '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
-
-function resolveYamlTimestamp(data) {
- if (data === null) return false;
- if (YAML_DATE_REGEXP.exec(data) !== null) return true;
- if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
- return false;
-}
-
-function constructYamlTimestamp(data) {
- var match, year, month, day, hour, minute, second, fraction = 0,
- delta = null, tz_hour, tz_minute, date;
-
- match = YAML_DATE_REGEXP.exec(data);
- if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
-
- if (match === null) throw new Error('Date resolve error');
-
- // match: [1] year [2] month [3] day
-
- year = +(match[1]);
- month = +(match[2]) - 1; // JS month starts with 0
- day = +(match[3]);
-
- if (!match[4]) { // no hour
- return new Date(Date.UTC(year, month, day));
- }
-
- // match: [4] hour [5] minute [6] second [7] fraction
-
- hour = +(match[4]);
- minute = +(match[5]);
- second = +(match[6]);
-
- if (match[7]) {
- fraction = match[7].slice(0, 3);
- while (fraction.length < 3) { // milli-seconds
- fraction += '0';
- }
- fraction = +fraction;
- }
-
- // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
-
- if (match[9]) {
- tz_hour = +(match[10]);
- tz_minute = +(match[11] || 0);
- delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
- if (match[9] === '-') delta = -delta;
- }
-
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
-
- if (delta) date.setTime(date.getTime() - delta);
-
- return date;
-}
-
-function representYamlTimestamp(object /*, style*/) {
- return object.toISOString();
-}
-
-var timestamp = new type('tag:yaml.org,2002:timestamp', {
- kind: 'scalar',
- resolve: resolveYamlTimestamp,
- construct: constructYamlTimestamp,
- instanceOf: Date,
- represent: representYamlTimestamp
-});
-
-function resolveYamlMerge(data) {
- return data === '<<' || data === null;
-}
-
-var merge = new type('tag:yaml.org,2002:merge', {
- kind: 'scalar',
- resolve: resolveYamlMerge
-});
-
-/*eslint-disable no-bitwise*/
-
-
-
-
-
-// [ 64, 65, 66 ] -> [ padding, CR, LF ]
-var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
-
-
-function resolveYamlBinary(data) {
- if (data === null) return false;
-
- var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
-
- // Convert one by one.
- for (idx = 0; idx < max; idx++) {
- code = map.indexOf(data.charAt(idx));
-
- // Skip CR/LF
- if (code > 64) continue;
-
- // Fail on illegal characters
- if (code < 0) return false;
-
- bitlen += 6;
- }
-
- // If there are any bits left, source was corrupted
- return (bitlen % 8) === 0;
-}
-
-function constructYamlBinary(data) {
- var idx, tailbits,
- input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
- max = input.length,
- map = BASE64_MAP,
- bits = 0,
- result = [];
-
- // Collect by 6*4 bits (3 bytes)
-
- for (idx = 0; idx < max; idx++) {
- if ((idx % 4 === 0) && idx) {
- result.push((bits >> 16) & 0xFF);
- result.push((bits >> 8) & 0xFF);
- result.push(bits & 0xFF);
- }
-
- bits = (bits << 6) | map.indexOf(input.charAt(idx));
- }
-
- // Dump tail
-
- tailbits = (max % 4) * 6;
-
- if (tailbits === 0) {
- result.push((bits >> 16) & 0xFF);
- result.push((bits >> 8) & 0xFF);
- result.push(bits & 0xFF);
- } else if (tailbits === 18) {
- result.push((bits >> 10) & 0xFF);
- result.push((bits >> 2) & 0xFF);
- } else if (tailbits === 12) {
- result.push((bits >> 4) & 0xFF);
- }
-
- return new Uint8Array(result);
-}
-
-function representYamlBinary(object /*, style*/) {
- var result = '', bits = 0, idx, tail,
- max = object.length,
- map = BASE64_MAP;
-
- // Convert every three bytes to 4 ASCII characters.
-
- for (idx = 0; idx < max; idx++) {
- if ((idx % 3 === 0) && idx) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- }
-
- bits = (bits << 8) + object[idx];
- }
-
- // Dump tail
-
- tail = max % 3;
-
- if (tail === 0) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- } else if (tail === 2) {
- result += map[(bits >> 10) & 0x3F];
- result += map[(bits >> 4) & 0x3F];
- result += map[(bits << 2) & 0x3F];
- result += map[64];
- } else if (tail === 1) {
- result += map[(bits >> 2) & 0x3F];
- result += map[(bits << 4) & 0x3F];
- result += map[64];
- result += map[64];
- }
-
- return result;
-}
-
-function isBinary(obj) {
- return Object.prototype.toString.call(obj) === '[object Uint8Array]';
-}
-
-var binary = new type('tag:yaml.org,2002:binary', {
- kind: 'scalar',
- resolve: resolveYamlBinary,
- construct: constructYamlBinary,
- predicate: isBinary,
- represent: representYamlBinary
-});
-
-var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
-var _toString$2 = Object.prototype.toString;
-
-function resolveYamlOmap(data) {
- if (data === null) return true;
-
- var objectKeys = [], index, length, pair, pairKey, pairHasKey,
- object = data;
-
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
- pairHasKey = false;
-
- if (_toString$2.call(pair) !== '[object Object]') return false;
-
- for (pairKey in pair) {
- if (_hasOwnProperty$3.call(pair, pairKey)) {
- if (!pairHasKey) pairHasKey = true;
- else return false;
- }
- }
-
- if (!pairHasKey) return false;
-
- if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
- else return false;
- }
-
- return true;
-}
-
-function constructYamlOmap(data) {
- return data !== null ? data : [];
-}
-
-var omap = new type('tag:yaml.org,2002:omap', {
- kind: 'sequence',
- resolve: resolveYamlOmap,
- construct: constructYamlOmap
-});
-
-var _toString$1 = Object.prototype.toString;
-
-function resolveYamlPairs(data) {
- if (data === null) return true;
-
- var index, length, pair, keys, result,
- object = data;
-
- result = new Array(object.length);
-
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
-
- if (_toString$1.call(pair) !== '[object Object]') return false;
-
- keys = Object.keys(pair);
-
- if (keys.length !== 1) return false;
-
- result[index] = [ keys[0], pair[keys[0]] ];
- }
-
- return true;
-}
-
-function constructYamlPairs(data) {
- if (data === null) return [];
-
- var index, length, pair, keys, result,
- object = data;
-
- result = new Array(object.length);
-
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
-
- keys = Object.keys(pair);
-
- result[index] = [ keys[0], pair[keys[0]] ];
- }
-
- return result;
-}
-
-var pairs = new type('tag:yaml.org,2002:pairs', {
- kind: 'sequence',
- resolve: resolveYamlPairs,
- construct: constructYamlPairs
-});
-
-var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
-
-function resolveYamlSet(data) {
- if (data === null) return true;
-
- var key, object = data;
-
- for (key in object) {
- if (_hasOwnProperty$2.call(object, key)) {
- if (object[key] !== null) return false;
- }
- }
-
- return true;
-}
-
-function constructYamlSet(data) {
- return data !== null ? data : {};
-}
-
-var set = new type('tag:yaml.org,2002:set', {
- kind: 'mapping',
- resolve: resolveYamlSet,
- construct: constructYamlSet
-});
-
-var _default = core.extend({
- implicit: [
- timestamp,
- merge
- ],
- explicit: [
- binary,
- omap,
- pairs,
- set
- ]
-});
-
-/*eslint-disable max-len,no-use-before-define*/
-
-
-
-
-
-
-
-var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
-
-
-var CONTEXT_FLOW_IN = 1;
-var CONTEXT_FLOW_OUT = 2;
-var CONTEXT_BLOCK_IN = 3;
-var CONTEXT_BLOCK_OUT = 4;
-
-
-var CHOMPING_CLIP = 1;
-var CHOMPING_STRIP = 2;
-var CHOMPING_KEEP = 3;
-
-
-var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
-var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
-var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
-var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
-var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
-
-
-function _class(obj) { return Object.prototype.toString.call(obj); }
-
-function is_EOL(c) {
- return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
-}
-
-function is_WHITE_SPACE(c) {
- return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
-}
-
-function is_WS_OR_EOL(c) {
- return (c === 0x09/* Tab */) ||
- (c === 0x20/* Space */) ||
- (c === 0x0A/* LF */) ||
- (c === 0x0D/* CR */);
-}
-
-function is_FLOW_INDICATOR(c) {
- return c === 0x2C/* , */ ||
- c === 0x5B/* [ */ ||
- c === 0x5D/* ] */ ||
- c === 0x7B/* { */ ||
- c === 0x7D/* } */;
-}
-
-function fromHexCode(c) {
- var lc;
-
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
- }
-
- /*eslint-disable no-bitwise*/
- lc = c | 0x20;
-
- if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
- return lc - 0x61 + 10;
- }
-
- return -1;
-}
-
-function escapedHexLen(c) {
- if (c === 0x78/* x */) { return 2; }
- if (c === 0x75/* u */) { return 4; }
- if (c === 0x55/* U */) { return 8; }
- return 0;
-}
-
-function fromDecimalCode(c) {
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
- }
-
- return -1;
-}
-
-function simpleEscapeSequence(c) {
- /* eslint-disable indent */
- return (c === 0x30/* 0 */) ? '\x00' :
- (c === 0x61/* a */) ? '\x07' :
- (c === 0x62/* b */) ? '\x08' :
- (c === 0x74/* t */) ? '\x09' :
- (c === 0x09/* Tab */) ? '\x09' :
- (c === 0x6E/* n */) ? '\x0A' :
- (c === 0x76/* v */) ? '\x0B' :
- (c === 0x66/* f */) ? '\x0C' :
- (c === 0x72/* r */) ? '\x0D' :
- (c === 0x65/* e */) ? '\x1B' :
- (c === 0x20/* Space */) ? ' ' :
- (c === 0x22/* " */) ? '\x22' :
- (c === 0x2F/* / */) ? '/' :
- (c === 0x5C/* \ */) ? '\x5C' :
- (c === 0x4E/* N */) ? '\x85' :
- (c === 0x5F/* _ */) ? '\xA0' :
- (c === 0x4C/* L */) ? '\u2028' :
- (c === 0x50/* P */) ? '\u2029' : '';
-}
-
-function charFromCodepoint(c) {
- if (c <= 0xFFFF) {
- return String.fromCharCode(c);
- }
- // Encode UTF-16 surrogate pair
- // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
- return String.fromCharCode(
- ((c - 0x010000) >> 10) + 0xD800,
- ((c - 0x010000) & 0x03FF) + 0xDC00
- );
-}
-
-var simpleEscapeCheck = new Array(256); // integer, for fast access
-var simpleEscapeMap = new Array(256);
-for (var i = 0; i < 256; i++) {
- simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
- simpleEscapeMap[i] = simpleEscapeSequence(i);
-}
-
-
-function State$1(input, options) {
- this.input = input;
-
- this.filename = options['filename'] || null;
- this.schema = options['schema'] || _default;
- this.onWarning = options['onWarning'] || null;
- // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
- // if such documents have no explicit %YAML directive
- this.legacy = options['legacy'] || false;
-
- this.json = options['json'] || false;
- this.listener = options['listener'] || null;
-
- this.implicitTypes = this.schema.compiledImplicit;
- this.typeMap = this.schema.compiledTypeMap;
-
- this.length = input.length;
- this.position = 0;
- this.line = 0;
- this.lineStart = 0;
- this.lineIndent = 0;
-
- // position of first leading tab in the current line,
- // used to make sure there are no tabs in the indentation
- this.firstTabInLine = -1;
-
- this.documents = [];
-
- /*
- this.version;
- this.checkLineBreaks;
- this.tagMap;
- this.anchorMap;
- this.tag;
- this.anchor;
- this.kind;
- this.result;*/
-
-}
-
-
-function generateError(state, message) {
- var mark = {
- name: state.filename,
- buffer: state.input.slice(0, -1), // omit trailing \0
- position: state.position,
- line: state.line,
- column: state.position - state.lineStart
- };
-
- mark.snippet = snippet(mark);
-
- return new exception(message, mark);
-}
-
-function throwError(state, message) {
- throw generateError(state, message);
-}
-
-function throwWarning(state, message) {
- if (state.onWarning) {
- state.onWarning.call(null, generateError(state, message));
- }
-}
-
-
-var directiveHandlers = {
-
- YAML: function handleYamlDirective(state, name, args) {
-
- var match, major, minor;
-
- if (state.version !== null) {
- throwError(state, 'duplication of %YAML directive');
- }
-
- if (args.length !== 1) {
- throwError(state, 'YAML directive accepts exactly one argument');
- }
-
- match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
-
- if (match === null) {
- throwError(state, 'ill-formed argument of the YAML directive');
- }
-
- major = parseInt(match[1], 10);
- minor = parseInt(match[2], 10);
-
- if (major !== 1) {
- throwError(state, 'unacceptable YAML version of the document');
- }
-
- state.version = args[0];
- state.checkLineBreaks = (minor < 2);
-
- if (minor !== 1 && minor !== 2) {
- throwWarning(state, 'unsupported YAML version of the document');
- }
- },
-
- TAG: function handleTagDirective(state, name, args) {
-
- var handle, prefix;
-
- if (args.length !== 2) {
- throwError(state, 'TAG directive accepts exactly two arguments');
- }
-
- handle = args[0];
- prefix = args[1];
-
- if (!PATTERN_TAG_HANDLE.test(handle)) {
- throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
- }
-
- if (_hasOwnProperty$1.call(state.tagMap, handle)) {
- throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
- }
-
- if (!PATTERN_TAG_URI.test(prefix)) {
- throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
- }
-
- try {
- prefix = decodeURIComponent(prefix);
- } catch (err) {
- throwError(state, 'tag prefix is malformed: ' + prefix);
- }
-
- state.tagMap[handle] = prefix;
- }
-};
-
-
-function captureSegment(state, start, end, checkJson) {
- var _position, _length, _character, _result;
-
- if (start < end) {
- _result = state.input.slice(start, end);
-
- if (checkJson) {
- for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
- _character = _result.charCodeAt(_position);
- if (!(_character === 0x09 ||
- (0x20 <= _character && _character <= 0x10FFFF))) {
- throwError(state, 'expected valid JSON character');
- }
- }
- } else if (PATTERN_NON_PRINTABLE.test(_result)) {
- throwError(state, 'the stream contains non-printable characters');
- }
-
- state.result += _result;
- }
-}
-
-function mergeMappings(state, destination, source, overridableKeys) {
- var sourceKeys, key, index, quantity;
-
- if (!common.isObject(source)) {
- throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
- }
-
- sourceKeys = Object.keys(source);
-
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
- key = sourceKeys[index];
-
- if (!_hasOwnProperty$1.call(destination, key)) {
- destination[key] = source[key];
- overridableKeys[key] = true;
- }
- }
-}
-
-function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
- startLine, startLineStart, startPos) {
-
- var index, quantity;
-
- // The output is a plain object here, so keys can only be strings.
- // We need to convert keyNode to a string, but doing so can hang the process
- // (deeply nested arrays that explode exponentially using aliases).
- if (Array.isArray(keyNode)) {
- keyNode = Array.prototype.slice.call(keyNode);
-
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
- if (Array.isArray(keyNode[index])) {
- throwError(state, 'nested arrays are not supported inside keys');
- }
-
- if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
- keyNode[index] = '[object Object]';
- }
- }
- }
-
- // Avoid code execution in load() via toString property
- // (still use its own toString for arrays, timestamps,
- // and whatever user schema extensions happen to have @@toStringTag)
- if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
- keyNode = '[object Object]';
- }
-
-
- keyNode = String(keyNode);
-
- if (_result === null) {
- _result = {};
- }
-
- if (keyTag === 'tag:yaml.org,2002:merge') {
- if (Array.isArray(valueNode)) {
- for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
- mergeMappings(state, _result, valueNode[index], overridableKeys);
- }
- } else {
- mergeMappings(state, _result, valueNode, overridableKeys);
- }
- } else {
- if (!state.json &&
- !_hasOwnProperty$1.call(overridableKeys, keyNode) &&
- _hasOwnProperty$1.call(_result, keyNode)) {
- state.line = startLine || state.line;
- state.lineStart = startLineStart || state.lineStart;
- state.position = startPos || state.position;
- throwError(state, 'duplicated mapping key');
- }
-
- // used for this specific key only because Object.defineProperty is slow
- if (keyNode === '__proto__') {
- Object.defineProperty(_result, keyNode, {
- configurable: true,
- enumerable: true,
- writable: true,
- value: valueNode
- });
- } else {
- _result[keyNode] = valueNode;
- }
- delete overridableKeys[keyNode];
- }
-
- return _result;
-}
-
-function readLineBreak(state) {
- var ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x0A/* LF */) {
- state.position++;
- } else if (ch === 0x0D/* CR */) {
- state.position++;
- if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
- state.position++;
- }
- } else {
- throwError(state, 'a line break is expected');
- }
-
- state.line += 1;
- state.lineStart = state.position;
- state.firstTabInLine = -1;
-}
-
-function skipSeparationSpace(state, allowComments, checkIndent) {
- var lineBreaks = 0,
- ch = state.input.charCodeAt(state.position);
-
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
- state.firstTabInLine = state.position;
- }
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (allowComments && ch === 0x23/* # */) {
- do {
- ch = state.input.charCodeAt(++state.position);
- } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
- }
-
- if (is_EOL(ch)) {
- readLineBreak(state);
-
- ch = state.input.charCodeAt(state.position);
- lineBreaks++;
- state.lineIndent = 0;
-
- while (ch === 0x20/* Space */) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
- } else {
- break;
- }
- }
-
- if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
- throwWarning(state, 'deficient indentation');
- }
-
- return lineBreaks;
-}
-
-function testDocumentSeparator(state) {
- var _position = state.position,
- ch;
-
- ch = state.input.charCodeAt(_position);
-
- // Condition state.position === state.lineStart is tested
- // in parent on each call, for efficiency. No needs to test here again.
- if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
- ch === state.input.charCodeAt(_position + 1) &&
- ch === state.input.charCodeAt(_position + 2)) {
-
- _position += 3;
-
- ch = state.input.charCodeAt(_position);
-
- if (ch === 0 || is_WS_OR_EOL(ch)) {
- return true;
- }
- }
-
- return false;
-}
-
-function writeFoldedLines(state, count) {
- if (count === 1) {
- state.result += ' ';
- } else if (count > 1) {
- state.result += common.repeat('\n', count - 1);
- }
-}
-
-
-function readPlainScalar(state, nodeIndent, withinFlowCollection) {
- var preceding,
- following,
- captureStart,
- captureEnd,
- hasPendingContent,
- _line,
- _lineStart,
- _lineIndent,
- _kind = state.kind,
- _result = state.result,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (is_WS_OR_EOL(ch) ||
- is_FLOW_INDICATOR(ch) ||
- ch === 0x23/* # */ ||
- ch === 0x26/* & */ ||
- ch === 0x2A/* * */ ||
- ch === 0x21/* ! */ ||
- ch === 0x7C/* | */ ||
- ch === 0x3E/* > */ ||
- ch === 0x27/* ' */ ||
- ch === 0x22/* " */ ||
- ch === 0x25/* % */ ||
- ch === 0x40/* @ */ ||
- ch === 0x60/* ` */) {
- return false;
- }
-
- if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
- following = state.input.charCodeAt(state.position + 1);
-
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- return false;
- }
- }
-
- state.kind = 'scalar';
- state.result = '';
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
-
- while (ch !== 0) {
- if (ch === 0x3A/* : */) {
- following = state.input.charCodeAt(state.position + 1);
-
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- break;
- }
-
- } else if (ch === 0x23/* # */) {
- preceding = state.input.charCodeAt(state.position - 1);
-
- if (is_WS_OR_EOL(preceding)) {
- break;
- }
-
- } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
- withinFlowCollection && is_FLOW_INDICATOR(ch)) {
- break;
-
- } else if (is_EOL(ch)) {
- _line = state.line;
- _lineStart = state.lineStart;
- _lineIndent = state.lineIndent;
- skipSeparationSpace(state, false, -1);
-
- if (state.lineIndent >= nodeIndent) {
- hasPendingContent = true;
- ch = state.input.charCodeAt(state.position);
- continue;
- } else {
- state.position = captureEnd;
- state.line = _line;
- state.lineStart = _lineStart;
- state.lineIndent = _lineIndent;
- break;
- }
- }
-
- if (hasPendingContent) {
- captureSegment(state, captureStart, captureEnd, false);
- writeFoldedLines(state, state.line - _line);
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
- }
-
- if (!is_WHITE_SPACE(ch)) {
- captureEnd = state.position + 1;
- }
-
- ch = state.input.charCodeAt(++state.position);
- }
-
- captureSegment(state, captureStart, captureEnd, false);
-
- if (state.result) {
- return true;
- }
-
- state.kind = _kind;
- state.result = _result;
- return false;
-}
-
-function readSingleQuotedScalar(state, nodeIndent) {
- var ch,
- captureStart, captureEnd;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x27/* ' */) {
- return false;
- }
-
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
-
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x27/* ' */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
-
- if (ch === 0x27/* ' */) {
- captureStart = state.position;
- state.position++;
- captureEnd = state.position;
- } else {
- return true;
- }
-
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
-
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a single quoted scalar');
-
- } else {
- state.position++;
- captureEnd = state.position;
- }
- }
-
- throwError(state, 'unexpected end of the stream within a single quoted scalar');
-}
-
-function readDoubleQuotedScalar(state, nodeIndent) {
- var captureStart,
- captureEnd,
- hexLength,
- hexResult,
- tmp,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x22/* " */) {
- return false;
- }
-
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
-
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x22/* " */) {
- captureSegment(state, captureStart, state.position, true);
- state.position++;
- return true;
-
- } else if (ch === 0x5C/* \ */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
-
- if (is_EOL(ch)) {
- skipSeparationSpace(state, false, nodeIndent);
-
- // TODO: rework to inline fn with no type cast?
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
- state.result += simpleEscapeMap[ch];
- state.position++;
-
- } else if ((tmp = escapedHexLen(ch)) > 0) {
- hexLength = tmp;
- hexResult = 0;
-
- for (; hexLength > 0; hexLength--) {
- ch = state.input.charCodeAt(++state.position);
-
- if ((tmp = fromHexCode(ch)) >= 0) {
- hexResult = (hexResult << 4) + tmp;
-
- } else {
- throwError(state, 'expected hexadecimal character');
- }
- }
-
- state.result += charFromCodepoint(hexResult);
-
- state.position++;
-
- } else {
- throwError(state, 'unknown escape sequence');
- }
-
- captureStart = captureEnd = state.position;
-
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
-
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a double quoted scalar');
-
- } else {
- state.position++;
- captureEnd = state.position;
- }
- }
-
- throwError(state, 'unexpected end of the stream within a double quoted scalar');
-}
-
-function readFlowCollection(state, nodeIndent) {
- var readNext = true,
- _line,
- _lineStart,
- _pos,
- _tag = state.tag,
- _result,
- _anchor = state.anchor,
- following,
- terminator,
- isPair,
- isExplicitPair,
- isMapping,
- overridableKeys = Object.create(null),
- keyNode,
- keyTag,
- valueNode,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x5B/* [ */) {
- terminator = 0x5D;/* ] */
- isMapping = false;
- _result = [];
- } else if (ch === 0x7B/* { */) {
- terminator = 0x7D;/* } */
- isMapping = true;
- _result = {};
- } else {
- return false;
- }
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
-
- ch = state.input.charCodeAt(++state.position);
-
- while (ch !== 0) {
- skipSeparationSpace(state, true, nodeIndent);
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === terminator) {
- state.position++;
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = isMapping ? 'mapping' : 'sequence';
- state.result = _result;
- return true;
- } else if (!readNext) {
- throwError(state, 'missed comma between flow collection entries');
- } else if (ch === 0x2C/* , */) {
- // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
- throwError(state, "expected the node content, but found ','");
- }
-
- keyTag = keyNode = valueNode = null;
- isPair = isExplicitPair = false;
-
- if (ch === 0x3F/* ? */) {
- following = state.input.charCodeAt(state.position + 1);
-
- if (is_WS_OR_EOL(following)) {
- isPair = isExplicitPair = true;
- state.position++;
- skipSeparationSpace(state, true, nodeIndent);
- }
- }
-
- _line = state.line; // Save the current line.
- _lineStart = state.lineStart;
- _pos = state.position;
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- keyTag = state.tag;
- keyNode = state.result;
- skipSeparationSpace(state, true, nodeIndent);
-
- ch = state.input.charCodeAt(state.position);
-
- if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
- isPair = true;
- ch = state.input.charCodeAt(++state.position);
- skipSeparationSpace(state, true, nodeIndent);
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- valueNode = state.result;
- }
-
- if (isMapping) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
- } else if (isPair) {
- _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
- } else {
- _result.push(keyNode);
- }
-
- skipSeparationSpace(state, true, nodeIndent);
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x2C/* , */) {
- readNext = true;
- ch = state.input.charCodeAt(++state.position);
- } else {
- readNext = false;
- }
- }
-
- throwError(state, 'unexpected end of the stream within a flow collection');
-}
-
-function readBlockScalar(state, nodeIndent) {
- var captureStart,
- folding,
- chomping = CHOMPING_CLIP,
- didReadContent = false,
- detectedIndent = false,
- textIndent = nodeIndent,
- emptyLines = 0,
- atMoreIndented = false,
- tmp,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x7C/* | */) {
- folding = false;
- } else if (ch === 0x3E/* > */) {
- folding = true;
- } else {
- return false;
- }
-
- state.kind = 'scalar';
- state.result = '';
-
- while (ch !== 0) {
- ch = state.input.charCodeAt(++state.position);
-
- if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
- if (CHOMPING_CLIP === chomping) {
- chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
- } else {
- throwError(state, 'repeat of a chomping mode identifier');
- }
-
- } else if ((tmp = fromDecimalCode(ch)) >= 0) {
- if (tmp === 0) {
- throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
- } else if (!detectedIndent) {
- textIndent = nodeIndent + tmp - 1;
- detectedIndent = true;
- } else {
- throwError(state, 'repeat of an indentation width identifier');
- }
-
- } else {
- break;
- }
- }
-
- if (is_WHITE_SPACE(ch)) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (is_WHITE_SPACE(ch));
-
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (!is_EOL(ch) && (ch !== 0));
- }
- }
-
- while (ch !== 0) {
- readLineBreak(state);
- state.lineIndent = 0;
-
- ch = state.input.charCodeAt(state.position);
-
- while ((!detectedIndent || state.lineIndent < textIndent) &&
- (ch === 0x20/* Space */)) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (!detectedIndent && state.lineIndent > textIndent) {
- textIndent = state.lineIndent;
- }
-
- if (is_EOL(ch)) {
- emptyLines++;
- continue;
- }
-
- // End of the scalar.
- if (state.lineIndent < textIndent) {
-
- // Perform the chomping.
- if (chomping === CHOMPING_KEEP) {
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- } else if (chomping === CHOMPING_CLIP) {
- if (didReadContent) { // i.e. only if the scalar is not empty.
- state.result += '\n';
- }
- }
-
- // Break this `while` cycle and go to the funciton's epilogue.
- break;
- }
-
- // Folded style: use fancy rules to handle line breaks.
- if (folding) {
-
- // Lines starting with white space characters (more-indented lines) are not folded.
- if (is_WHITE_SPACE(ch)) {
- atMoreIndented = true;
- // except for the first content line (cf. Example 8.1)
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
-
- // End of more-indented block.
- } else if (atMoreIndented) {
- atMoreIndented = false;
- state.result += common.repeat('\n', emptyLines + 1);
-
- // Just one line break - perceive as the same line.
- } else if (emptyLines === 0) {
- if (didReadContent) { // i.e. only if we have already read some scalar content.
- state.result += ' ';
- }
-
- // Several line breaks - perceive as different lines.
- } else {
- state.result += common.repeat('\n', emptyLines);
- }
-
- // Literal style: just add exact number of line breaks between content lines.
- } else {
- // Keep all line breaks except the header line break.
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- }
-
- didReadContent = true;
- detectedIndent = true;
- emptyLines = 0;
- captureStart = state.position;
-
- while (!is_EOL(ch) && (ch !== 0)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- captureSegment(state, captureStart, state.position, false);
- }
-
- return true;
-}
-
-function readBlockSequence(state, nodeIndent) {
- var _line,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = [],
- following,
- detected = false,
- ch;
-
- // there is a leading tab before this token, so it can't be a block sequence/mapping;
- // it can still be flow sequence/mapping or a scalar
- if (state.firstTabInLine !== -1) return false;
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
-
- ch = state.input.charCodeAt(state.position);
-
- while (ch !== 0) {
- if (state.firstTabInLine !== -1) {
- state.position = state.firstTabInLine;
- throwError(state, 'tab characters must not be used in indentation');
- }
-
- if (ch !== 0x2D/* - */) {
- break;
- }
-
- following = state.input.charCodeAt(state.position + 1);
-
- if (!is_WS_OR_EOL(following)) {
- break;
- }
-
- detected = true;
- state.position++;
-
- if (skipSeparationSpace(state, true, -1)) {
- if (state.lineIndent <= nodeIndent) {
- _result.push(null);
- ch = state.input.charCodeAt(state.position);
- continue;
- }
- }
-
- _line = state.line;
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
- _result.push(state.result);
- skipSeparationSpace(state, true, -1);
-
- ch = state.input.charCodeAt(state.position);
-
- if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
- throwError(state, 'bad indentation of a sequence entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
-
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'sequence';
- state.result = _result;
- return true;
- }
- return false;
-}
-
-function readBlockMapping(state, nodeIndent, flowIndent) {
- var following,
- allowCompact,
- _line,
- _keyLine,
- _keyLineStart,
- _keyPos,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = {},
- overridableKeys = Object.create(null),
- keyTag = null,
- keyNode = null,
- valueNode = null,
- atExplicitKey = false,
- detected = false,
- ch;
-
- // there is a leading tab before this token, so it can't be a block sequence/mapping;
- // it can still be flow sequence/mapping or a scalar
- if (state.firstTabInLine !== -1) return false;
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
-
- ch = state.input.charCodeAt(state.position);
-
- while (ch !== 0) {
- if (!atExplicitKey && state.firstTabInLine !== -1) {
- state.position = state.firstTabInLine;
- throwError(state, 'tab characters must not be used in indentation');
- }
-
- following = state.input.charCodeAt(state.position + 1);
- _line = state.line; // Save the current line.
-
- //
- // Explicit notation case. There are two separate blocks:
- // first for the key (denoted by "?") and second for the value (denoted by ":")
- //
- if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
-
- if (ch === 0x3F/* ? */) {
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
-
- detected = true;
- atExplicitKey = true;
- allowCompact = true;
-
- } else if (atExplicitKey) {
- // i.e. 0x3A/* : */ === character after the explicit key.
- atExplicitKey = false;
- allowCompact = true;
-
- } else {
- throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
- }
-
- state.position += 1;
- ch = following;
-
- //
- // Implicit notation case. Flow-style node as the key first, then ":", and the value.
- //
- } else {
- _keyLine = state.line;
- _keyLineStart = state.lineStart;
- _keyPos = state.position;
-
- if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
- // Neither implicit nor explicit notation.
- // Reading is done. Go to the epilogue.
- break;
- }
-
- if (state.line === _line) {
- ch = state.input.charCodeAt(state.position);
-
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (ch === 0x3A/* : */) {
- ch = state.input.charCodeAt(++state.position);
-
- if (!is_WS_OR_EOL(ch)) {
- throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
- }
-
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
-
- detected = true;
- atExplicitKey = false;
- allowCompact = false;
- keyTag = state.tag;
- keyNode = state.result;
-
- } else if (detected) {
- throwError(state, 'can not read an implicit mapping pair; a colon is missed');
-
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
-
- } else if (detected) {
- throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
-
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
- }
-
- //
- // Common reading code for both explicit and implicit notations.
- //
- if (state.line === _line || state.lineIndent > nodeIndent) {
- if (atExplicitKey) {
- _keyLine = state.line;
- _keyLineStart = state.lineStart;
- _keyPos = state.position;
- }
-
- if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
- if (atExplicitKey) {
- keyNode = state.result;
- } else {
- valueNode = state.result;
- }
- }
-
- if (!atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
- keyTag = keyNode = valueNode = null;
- }
-
- skipSeparationSpace(state, true, -1);
- ch = state.input.charCodeAt(state.position);
- }
-
- if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
- throwError(state, 'bad indentation of a mapping entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
-
- //
- // Epilogue.
- //
-
- // Special case: last mapping's node contains only the key in explicit notation.
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
- }
-
- // Expose the resulting mapping.
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'mapping';
- state.result = _result;
- }
-
- return detected;
-}
-
-function readTagProperty(state) {
- var _position,
- isVerbatim = false,
- isNamed = false,
- tagHandle,
- tagName,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x21/* ! */) return false;
-
- if (state.tag !== null) {
- throwError(state, 'duplication of a tag property');
- }
-
- ch = state.input.charCodeAt(++state.position);
-
- if (ch === 0x3C/* < */) {
- isVerbatim = true;
- ch = state.input.charCodeAt(++state.position);
-
- } else if (ch === 0x21/* ! */) {
- isNamed = true;
- tagHandle = '!!';
- ch = state.input.charCodeAt(++state.position);
-
- } else {
- tagHandle = '!';
- }
-
- _position = state.position;
-
- if (isVerbatim) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && ch !== 0x3E/* > */);
-
- if (state.position < state.length) {
- tagName = state.input.slice(_position, state.position);
- ch = state.input.charCodeAt(++state.position);
- } else {
- throwError(state, 'unexpected end of the stream within a verbatim tag');
- }
- } else {
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
-
- if (ch === 0x21/* ! */) {
- if (!isNamed) {
- tagHandle = state.input.slice(_position - 1, state.position + 1);
-
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
- throwError(state, 'named tag handle cannot contain such characters');
- }
-
- isNamed = true;
- _position = state.position + 1;
- } else {
- throwError(state, 'tag suffix cannot contain exclamation marks');
- }
- }
-
- ch = state.input.charCodeAt(++state.position);
- }
-
- tagName = state.input.slice(_position, state.position);
-
- if (PATTERN_FLOW_INDICATORS.test(tagName)) {
- throwError(state, 'tag suffix cannot contain flow indicator characters');
- }
- }
-
- if (tagName && !PATTERN_TAG_URI.test(tagName)) {
- throwError(state, 'tag name cannot contain such characters: ' + tagName);
- }
-
- try {
- tagName = decodeURIComponent(tagName);
- } catch (err) {
- throwError(state, 'tag name is malformed: ' + tagName);
- }
-
- if (isVerbatim) {
- state.tag = tagName;
-
- } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
- state.tag = state.tagMap[tagHandle] + tagName;
-
- } else if (tagHandle === '!') {
- state.tag = '!' + tagName;
-
- } else if (tagHandle === '!!') {
- state.tag = 'tag:yaml.org,2002:' + tagName;
-
- } else {
- throwError(state, 'undeclared tag handle "' + tagHandle + '"');
- }
-
- return true;
-}
-
-function readAnchorProperty(state) {
- var _position,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x26/* & */) return false;
-
- if (state.anchor !== null) {
- throwError(state, 'duplication of an anchor property');
- }
-
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (state.position === _position) {
- throwError(state, 'name of an anchor node must contain at least one character');
- }
-
- state.anchor = state.input.slice(_position, state.position);
- return true;
-}
-
-function readAlias(state) {
- var _position, alias,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x2A/* * */) return false;
-
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (state.position === _position) {
- throwError(state, 'name of an alias node must contain at least one character');
- }
-
- alias = state.input.slice(_position, state.position);
-
- if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
- throwError(state, 'unidentified alias "' + alias + '"');
- }
-
- state.result = state.anchorMap[alias];
- skipSeparationSpace(state, true, -1);
- return true;
-}
-
-function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
- var allowBlockStyles,
- allowBlockScalars,
- allowBlockCollections,
- indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- }
- }
-
- if (indentStatus === 1) {
- while (readTagProperty(state) || readAnchorProperty(state)) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
- allowBlockCollections = allowBlockStyles;
-
- if (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- } else {
- allowBlockCollections = false;
- }
- }
- }
-
- if (allowBlockCollections) {
- allowBlockCollections = atNewLine || allowCompact;
- }
-
- if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
- if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
- flowIndent = parentIndent;
- } else {
- flowIndent = parentIndent + 1;
- }
-
- blockIndent = state.position - state.lineStart;
-
- if (indentStatus === 1) {
- if (allowBlockCollections &&
- (readBlockSequence(state, blockIndent) ||
- readBlockMapping(state, blockIndent, flowIndent)) ||
- readFlowCollection(state, flowIndent)) {
- hasContent = true;
- } else {
- if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
- readSingleQuotedScalar(state, flowIndent) ||
- readDoubleQuotedScalar(state, flowIndent)) {
- hasContent = true;
-
- } else if (readAlias(state)) {
- hasContent = true;
-
- if (state.tag !== null || state.anchor !== null) {
- throwError(state, 'alias node should not have any properties');
- }
-
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
- hasContent = true;
-
- if (state.tag === null) {
- state.tag = '?';
- }
- }
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- }
- } else if (indentStatus === 0) {
- // Special case: block sequences are allowed to have same indentation level as the parent.
- // http://www.yaml.org/spec/1.2/spec.html#id2799784
- hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
- }
- }
-
- if (state.tag === null) {
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
-
- } else if (state.tag === '?') {
- // Implicit resolving is not allowed for non-scalar types, and '?'
- // non-specific tag is only automatically assigned to plain scalars.
- //
- // We only need to check kind conformity in case user explicitly assigns '?'
- // tag, for example like this: "!> [0]"
- //
- if (state.result !== null && state.kind !== 'scalar') {
- throwError(state, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state.kind + '"');
- }
-
- for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
- type = state.implicitTypes[typeIndex];
-
- if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
- state.result = type.construct(state.result);
- state.tag = type.tag;
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- break;
- }
- }
- } else if (state.tag !== '!') {
- if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
- type = state.typeMap[state.kind || 'fallback'][state.tag];
- } else {
- // looking for multi type
- type = null;
- typeList = state.typeMap.multi[state.kind || 'fallback'];
-
- for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
- if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
- type = typeList[typeIndex];
- break;
- }
- }
- }
-
- if (!type) {
- throwError(state, 'unknown tag !<' + state.tag + '>');
- }
-
- if (state.result !== null && type.kind !== state.kind) {
- throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
- }
-
- if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
- throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
- } else {
- state.result = type.construct(state.result, state.tag);
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- }
- }
-
- if (state.listener !== null) {
- state.listener('close', state);
- }
- return state.tag !== null || state.anchor !== null || hasContent;
-}
-
-function readDocument(state) {
- var documentStart = state.position,
- _position,
- directiveName,
- directiveArgs,
- hasDirectives = false,
- ch;
-
- state.version = null;
- state.checkLineBreaks = state.legacy;
- state.tagMap = Object.create(null);
- state.anchorMap = Object.create(null);
-
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- skipSeparationSpace(state, true, -1);
-
- ch = state.input.charCodeAt(state.position);
-
- if (state.lineIndent > 0 || ch !== 0x25/* % */) {
- break;
- }
-
- hasDirectives = true;
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- directiveName = state.input.slice(_position, state.position);
- directiveArgs = [];
-
- if (directiveName.length < 1) {
- throwError(state, 'directive name must not be less than one character in length');
- }
-
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && !is_EOL(ch));
- break;
- }
-
- if (is_EOL(ch)) break;
-
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- directiveArgs.push(state.input.slice(_position, state.position));
- }
-
- if (ch !== 0) readLineBreak(state);
-
- if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
- directiveHandlers[directiveName](state, directiveName, directiveArgs);
- } else {
- throwWarning(state, 'unknown document directive "' + directiveName + '"');
- }
- }
-
- skipSeparationSpace(state, true, -1);
-
- if (state.lineIndent === 0 &&
- state.input.charCodeAt(state.position) === 0x2D/* - */ &&
- state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
- state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
-
- } else if (hasDirectives) {
- throwError(state, 'directives end mark is expected');
- }
-
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
- skipSeparationSpace(state, true, -1);
-
- if (state.checkLineBreaks &&
- PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
- throwWarning(state, 'non-ASCII line breaks are interpreted as content');
- }
-
- state.documents.push(state.result);
-
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
-
- if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
- }
- return;
- }
-
- if (state.position < (state.length - 1)) {
- throwError(state, 'end of the stream or a document separator is expected');
- } else {
- return;
- }
-}
-
-
-function loadDocuments(input, options) {
- input = String(input);
- options = options || {};
-
- if (input.length !== 0) {
-
- // Add tailing `\n` if not exists
- if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
- input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
- input += '\n';
- }
-
- // Strip BOM
- if (input.charCodeAt(0) === 0xFEFF) {
- input = input.slice(1);
- }
- }
-
- var state = new State$1(input, options);
-
- var nullpos = input.indexOf('\0');
-
- if (nullpos !== -1) {
- state.position = nullpos;
- throwError(state, 'null byte is not allowed in input');
- }
-
- // Use 0 as string terminator. That significantly simplifies bounds check.
- state.input += '\0';
-
- while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
- state.lineIndent += 1;
- state.position += 1;
- }
-
- while (state.position < (state.length - 1)) {
- readDocument(state);
- }
-
- return state.documents;
-}
-
-
-function loadAll$1(input, iterator, options) {
- if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
- options = iterator;
- iterator = null;
- }
-
- var documents = loadDocuments(input, options);
-
- if (typeof iterator !== 'function') {
- return documents;
- }
-
- for (var index = 0, length = documents.length; index < length; index += 1) {
- iterator(documents[index]);
- }
-}
-
-
-function load$1(input, options) {
- var documents = loadDocuments(input, options);
-
- if (documents.length === 0) {
- /*eslint-disable no-undefined*/
- return undefined;
- } else if (documents.length === 1) {
- return documents[0];
- }
- throw new exception('expected a single document in the stream, but found more');
-}
-
-
-var loadAll_1 = loadAll$1;
-var load_1 = load$1;
-
-var loader = {
- loadAll: loadAll_1,
- load: load_1
-};
-
-/*eslint-disable no-use-before-define*/
-
-
-
-
-
-var _toString = Object.prototype.toString;
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-var CHAR_BOM = 0xFEFF;
-var CHAR_TAB = 0x09; /* Tab */
-var CHAR_LINE_FEED = 0x0A; /* LF */
-var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
-var CHAR_SPACE = 0x20; /* Space */
-var CHAR_EXCLAMATION = 0x21; /* ! */
-var CHAR_DOUBLE_QUOTE = 0x22; /* " */
-var CHAR_SHARP = 0x23; /* # */
-var CHAR_PERCENT = 0x25; /* % */
-var CHAR_AMPERSAND = 0x26; /* & */
-var CHAR_SINGLE_QUOTE = 0x27; /* ' */
-var CHAR_ASTERISK = 0x2A; /* * */
-var CHAR_COMMA = 0x2C; /* , */
-var CHAR_MINUS = 0x2D; /* - */
-var CHAR_COLON = 0x3A; /* : */
-var CHAR_EQUALS = 0x3D; /* = */
-var CHAR_GREATER_THAN = 0x3E; /* > */
-var CHAR_QUESTION = 0x3F; /* ? */
-var CHAR_COMMERCIAL_AT = 0x40; /* @ */
-var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
-var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
-var CHAR_GRAVE_ACCENT = 0x60; /* ` */
-var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
-var CHAR_VERTICAL_LINE = 0x7C; /* | */
-var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
-
-var ESCAPE_SEQUENCES = {};
-
-ESCAPE_SEQUENCES[0x00] = '\\0';
-ESCAPE_SEQUENCES[0x07] = '\\a';
-ESCAPE_SEQUENCES[0x08] = '\\b';
-ESCAPE_SEQUENCES[0x09] = '\\t';
-ESCAPE_SEQUENCES[0x0A] = '\\n';
-ESCAPE_SEQUENCES[0x0B] = '\\v';
-ESCAPE_SEQUENCES[0x0C] = '\\f';
-ESCAPE_SEQUENCES[0x0D] = '\\r';
-ESCAPE_SEQUENCES[0x1B] = '\\e';
-ESCAPE_SEQUENCES[0x22] = '\\"';
-ESCAPE_SEQUENCES[0x5C] = '\\\\';
-ESCAPE_SEQUENCES[0x85] = '\\N';
-ESCAPE_SEQUENCES[0xA0] = '\\_';
-ESCAPE_SEQUENCES[0x2028] = '\\L';
-ESCAPE_SEQUENCES[0x2029] = '\\P';
-
-var DEPRECATED_BOOLEANS_SYNTAX = [
- 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
- 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
-];
-
-var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
-
-function compileStyleMap(schema, map) {
- var result, keys, index, length, tag, style, type;
-
- if (map === null) return {};
-
- result = {};
- keys = Object.keys(map);
-
- for (index = 0, length = keys.length; index < length; index += 1) {
- tag = keys[index];
- style = String(map[tag]);
-
- if (tag.slice(0, 2) === '!!') {
- tag = 'tag:yaml.org,2002:' + tag.slice(2);
- }
- type = schema.compiledTypeMap['fallback'][tag];
-
- if (type && _hasOwnProperty.call(type.styleAliases, style)) {
- style = type.styleAliases[style];
- }
-
- result[tag] = style;
- }
-
- return result;
-}
-
-function encodeHex(character) {
- var string, handle, length;
-
- string = character.toString(16).toUpperCase();
-
- if (character <= 0xFF) {
- handle = 'x';
- length = 2;
- } else if (character <= 0xFFFF) {
- handle = 'u';
- length = 4;
- } else if (character <= 0xFFFFFFFF) {
- handle = 'U';
- length = 8;
- } else {
- throw new exception('code point within a string may not be greater than 0xFFFFFFFF');
- }
-
- return '\\' + handle + common.repeat('0', length - string.length) + string;
-}
-
-
-var QUOTING_TYPE_SINGLE = 1,
- QUOTING_TYPE_DOUBLE = 2;
-
-function State(options) {
- this.schema = options['schema'] || _default;
- this.indent = Math.max(1, (options['indent'] || 2));
- this.noArrayIndent = options['noArrayIndent'] || false;
- this.skipInvalid = options['skipInvalid'] || false;
- this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
- this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
- this.sortKeys = options['sortKeys'] || false;
- this.lineWidth = options['lineWidth'] || 80;
- this.noRefs = options['noRefs'] || false;
- this.noCompatMode = options['noCompatMode'] || false;
- this.condenseFlow = options['condenseFlow'] || false;
- this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
- this.forceQuotes = options['forceQuotes'] || false;
- this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
-
- this.implicitTypes = this.schema.compiledImplicit;
- this.explicitTypes = this.schema.compiledExplicit;
-
- this.tag = null;
- this.result = '';
-
- this.duplicates = [];
- this.usedDuplicates = null;
-}
-
-// Indents every line in a string. Empty lines (\n only) are not indented.
-function indentString(string, spaces) {
- var ind = common.repeat(' ', spaces),
- position = 0,
- next = -1,
- result = '',
- line,
- length = string.length;
-
- while (position < length) {
- next = string.indexOf('\n', position);
- if (next === -1) {
- line = string.slice(position);
- position = length;
- } else {
- line = string.slice(position, next + 1);
- position = next + 1;
- }
-
- if (line.length && line !== '\n') result += ind;
-
- result += line;
- }
-
- return result;
-}
-
-function generateNextLine(state, level) {
- return '\n' + common.repeat(' ', state.indent * level);
-}
-
-function testImplicitResolving(state, str) {
- var index, length, type;
-
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
- type = state.implicitTypes[index];
-
- if (type.resolve(str)) {
- return true;
- }
- }
-
- return false;
-}
-
-// [33] s-white ::= s-space | s-tab
-function isWhitespace(c) {
- return c === CHAR_SPACE || c === CHAR_TAB;
-}
-
-// Returns true if the character can be printed without escaping.
-// From YAML 1.2: "any allowed characters known to be non-printable
-// should also be escaped. [However,] This isn’t mandatory"
-// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
-function isPrintable(c) {
- return (0x00020 <= c && c <= 0x00007E)
- || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
- || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
- || (0x10000 <= c && c <= 0x10FFFF);
-}
-
-// [34] ns-char ::= nb-char - s-white
-// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
-// [26] b-char ::= b-line-feed | b-carriage-return
-// Including s-white (for some reason, examples doesn't match specs in this aspect)
-// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
-function isNsCharOrWhitespace(c) {
- return isPrintable(c)
- && c !== CHAR_BOM
- // - b-char
- && c !== CHAR_CARRIAGE_RETURN
- && c !== CHAR_LINE_FEED;
-}
-
-// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out
-// c = flow-in ⇒ ns-plain-safe-in
-// c = block-key ⇒ ns-plain-safe-out
-// c = flow-key ⇒ ns-plain-safe-in
-// [128] ns-plain-safe-out ::= ns-char
-// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
-// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )
-// | ( /* An ns-char preceding */ “#” )
-// | ( “:” /* Followed by an ns-plain-safe(c) */ )
-function isPlainSafe(c, prev, inblock) {
- var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
- var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
- return (
- // ns-plain-safe
- inblock ? // c = flow-in
- cIsNsCharOrWhitespace
- : cIsNsCharOrWhitespace
- // - c-flow-indicator
- && c !== CHAR_COMMA
- && c !== CHAR_LEFT_SQUARE_BRACKET
- && c !== CHAR_RIGHT_SQUARE_BRACKET
- && c !== CHAR_LEFT_CURLY_BRACKET
- && c !== CHAR_RIGHT_CURLY_BRACKET
- )
- // ns-plain-char
- && c !== CHAR_SHARP // false on '#'
- && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
- || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
- || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
-}
-
-// Simplified test for values allowed as the first character in plain style.
-function isPlainSafeFirst(c) {
- // Uses a subset of ns-char - c-indicator
- // where ns-char = nb-char - s-white.
- // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part
- return isPrintable(c) && c !== CHAR_BOM
- && !isWhitespace(c) // - s-white
- // - (c-indicator ::=
- // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
- && c !== CHAR_MINUS
- && c !== CHAR_QUESTION
- && c !== CHAR_COLON
- && c !== CHAR_COMMA
- && c !== CHAR_LEFT_SQUARE_BRACKET
- && c !== CHAR_RIGHT_SQUARE_BRACKET
- && c !== CHAR_LEFT_CURLY_BRACKET
- && c !== CHAR_RIGHT_CURLY_BRACKET
- // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
- && c !== CHAR_SHARP
- && c !== CHAR_AMPERSAND
- && c !== CHAR_ASTERISK
- && c !== CHAR_EXCLAMATION
- && c !== CHAR_VERTICAL_LINE
- && c !== CHAR_EQUALS
- && c !== CHAR_GREATER_THAN
- && c !== CHAR_SINGLE_QUOTE
- && c !== CHAR_DOUBLE_QUOTE
- // | “%” | “@” | “`”)
- && c !== CHAR_PERCENT
- && c !== CHAR_COMMERCIAL_AT
- && c !== CHAR_GRAVE_ACCENT;
-}
-
-// Simplified test for values allowed as the last character in plain style.
-function isPlainSafeLast(c) {
- // just not whitespace or colon, it will be checked to be plain character later
- return !isWhitespace(c) && c !== CHAR_COLON;
-}
-
-// Same as 'string'.codePointAt(pos), but works in older browsers.
-function codePointAt(string, pos) {
- var first = string.charCodeAt(pos), second;
- if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
- second = string.charCodeAt(pos + 1);
- if (second >= 0xDC00 && second <= 0xDFFF) {
- // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
- return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
- }
- }
- return first;
-}
-
-// Determines whether block indentation indicator is required.
-function needIndentIndicator(string) {
- var leadingSpaceRe = /^\n* /;
- return leadingSpaceRe.test(string);
-}
-
-var STYLE_PLAIN = 1,
- STYLE_SINGLE = 2,
- STYLE_LITERAL = 3,
- STYLE_FOLDED = 4,
- STYLE_DOUBLE = 5;
-
-// Determines which scalar styles are possible and returns the preferred style.
-// lineWidth = -1 => no limit.
-// Pre-conditions: str.length > 0.
-// Post-conditions:
-// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
-// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
-// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
-function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
- testAmbiguousType, quotingType, forceQuotes, inblock) {
-
- var i;
- var char = 0;
- var prevChar = null;
- var hasLineBreak = false;
- var hasFoldableLine = false; // only checked if shouldTrackWidth
- var shouldTrackWidth = lineWidth !== -1;
- var previousLineBreak = -1; // count the first line correctly
- var plain = isPlainSafeFirst(codePointAt(string, 0))
- && isPlainSafeLast(codePointAt(string, string.length - 1));
-
- if (singleLineOnly || forceQuotes) {
- // Case: no block styles.
- // Check for disallowed characters to rule out plain and single.
- for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
- char = codePointAt(string, i);
- if (!isPrintable(char)) {
- return STYLE_DOUBLE;
- }
- plain = plain && isPlainSafe(char, prevChar, inblock);
- prevChar = char;
- }
- } else {
- // Case: block styles permitted.
- for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
- char = codePointAt(string, i);
- if (char === CHAR_LINE_FEED) {
- hasLineBreak = true;
- // Check if any line can be folded.
- if (shouldTrackWidth) {
- hasFoldableLine = hasFoldableLine ||
- // Foldable line = too long, and not more-indented.
- (i - previousLineBreak - 1 > lineWidth &&
- string[previousLineBreak + 1] !== ' ');
- previousLineBreak = i;
- }
- } else if (!isPrintable(char)) {
- return STYLE_DOUBLE;
- }
- plain = plain && isPlainSafe(char, prevChar, inblock);
- prevChar = char;
- }
- // in case the end is missing a \n
- hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
- (i - previousLineBreak - 1 > lineWidth &&
- string[previousLineBreak + 1] !== ' '));
- }
- // Although every style can represent \n without escaping, prefer block styles
- // for multiline, since they're more readable and they don't add empty lines.
- // Also prefer folding a super-long line.
- if (!hasLineBreak && !hasFoldableLine) {
- // Strings interpretable as another type have to be quoted;
- // e.g. the string 'true' vs. the boolean true.
- if (plain && !forceQuotes && !testAmbiguousType(string)) {
- return STYLE_PLAIN;
- }
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
- }
- // Edge case: block indentation indicator can only have one digit.
- if (indentPerLevel > 9 && needIndentIndicator(string)) {
- return STYLE_DOUBLE;
- }
- // At this point we know block styles are valid.
- // Prefer literal style unless we want to fold.
- if (!forceQuotes) {
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
- }
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
-}
-
-// Note: line breaking/folding is implemented for only the folded style.
-// NB. We drop the last trailing newline (if any) of a returned block scalar
-// since the dumper adds its own newline. This always works:
-// • No ending newline => unaffected; already using strip "-" chomping.
-// • Ending newline => removed then restored.
-// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
-function writeScalar(state, string, level, iskey, inblock) {
- state.dump = (function () {
- if (string.length === 0) {
- return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
- }
- if (!state.noCompatMode) {
- if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
- return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
- }
- }
-
- var indent = state.indent * Math.max(1, level); // no 0-indent scalars
- // As indentation gets deeper, let the width decrease monotonically
- // to the lower bound min(state.lineWidth, 40).
- // Note that this implies
- // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
- // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
- // This behaves better than a constant minimum width which disallows narrower options,
- // or an indent threshold which causes the width to suddenly increase.
- var lineWidth = state.lineWidth === -1
- ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
-
- // Without knowing if keys are implicit/explicit, assume implicit for safety.
- var singleLineOnly = iskey
- // No block styles in flow mode.
- || (state.flowLevel > -1 && level >= state.flowLevel);
- function testAmbiguity(string) {
- return testImplicitResolving(state, string);
- }
-
- switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
- testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
-
- case STYLE_PLAIN:
- return string;
- case STYLE_SINGLE:
- return "'" + string.replace(/'/g, "''") + "'";
- case STYLE_LITERAL:
- return '|' + blockHeader(string, state.indent)
- + dropEndingNewline(indentString(string, indent));
- case STYLE_FOLDED:
- return '>' + blockHeader(string, state.indent)
- + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
- case STYLE_DOUBLE:
- return '"' + escapeString(string) + '"';
- default:
- throw new exception('impossible error: invalid scalar style');
- }
- }());
-}
-
-// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
-function blockHeader(string, indentPerLevel) {
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
-
- // note the special case: the string '\n' counts as a "trailing" empty line.
- var clip = string[string.length - 1] === '\n';
- var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
- var chomp = keep ? '+' : (clip ? '' : '-');
-
- return indentIndicator + chomp + '\n';
-}
-
-// (See the note for writeScalar.)
-function dropEndingNewline(string) {
- return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
-}
-
-// Note: a long line without a suitable break point will exceed the width limit.
-// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
-function foldString(string, width) {
- // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
- // unless they're before or after a more-indented line, or at the very
- // beginning or end, in which case $k$ maps to $k$.
- // Therefore, parse each chunk as newline(s) followed by a content line.
- var lineRe = /(\n+)([^\n]*)/g;
-
- // first line (possibly an empty line)
- var result = (function () {
- var nextLF = string.indexOf('\n');
- nextLF = nextLF !== -1 ? nextLF : string.length;
- lineRe.lastIndex = nextLF;
- return foldLine(string.slice(0, nextLF), width);
- }());
- // If we haven't reached the first content line yet, don't add an extra \n.
- var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
- var moreIndented;
-
- // rest of the lines
- var match;
- while ((match = lineRe.exec(string))) {
- var prefix = match[1], line = match[2];
- moreIndented = (line[0] === ' ');
- result += prefix
- + (!prevMoreIndented && !moreIndented && line !== ''
- ? '\n' : '')
- + foldLine(line, width);
- prevMoreIndented = moreIndented;
- }
-
- return result;
-}
-
-// Greedy line breaking.
-// Picks the longest line under the limit each time,
-// otherwise settles for the shortest line over the limit.
-// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
-function foldLine(line, width) {
- if (line === '' || line[0] === ' ') return line;
-
- // Since a more-indented line adds a \n, breaks can't be followed by a space.
- var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
- var match;
- // start is an inclusive index. end, curr, and next are exclusive.
- var start = 0, end, curr = 0, next = 0;
- var result = '';
-
- // Invariants: 0 <= start <= length-1.
- // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
- // Inside the loop:
- // A match implies length >= 2, so curr and next are <= length-2.
- while ((match = breakRe.exec(line))) {
- next = match.index;
- // maintain invariant: curr - start <= width
- if (next - start > width) {
- end = (curr > start) ? curr : next; // derive end <= length-2
- result += '\n' + line.slice(start, end);
- // skip the space that was output as \n
- start = end + 1; // derive start <= length-1
- }
- curr = next;
- }
-
- // By the invariants, start <= length-1, so there is something left over.
- // It is either the whole string or a part starting from non-whitespace.
- result += '\n';
- // Insert a break if the remainder is too long and there is a break available.
- if (line.length - start > width && curr > start) {
- result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
- } else {
- result += line.slice(start);
- }
-
- return result.slice(1); // drop extra \n joiner
-}
-
-// Escapes a double-quoted string.
-function escapeString(string) {
- var result = '';
- var char = 0;
- var escapeSeq;
-
- for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
- char = codePointAt(string, i);
- escapeSeq = ESCAPE_SEQUENCES[char];
-
- if (!escapeSeq && isPrintable(char)) {
- result += string[i];
- if (char >= 0x10000) result += string[i + 1];
- } else {
- result += escapeSeq || encodeHex(char);
- }
- }
-
- return result;
-}
-
-function writeFlowSequence(state, level, object) {
- var _result = '',
- _tag = state.tag,
- index,
- length,
- value;
-
- for (index = 0, length = object.length; index < length; index += 1) {
- value = object[index];
-
- if (state.replacer) {
- value = state.replacer.call(object, String(index), value);
- }
-
- // Write only valid elements, put null instead of invalid elements.
- if (writeNode(state, level, value, false, false) ||
- (typeof value === 'undefined' &&
- writeNode(state, level, null, false, false))) {
-
- if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
- _result += state.dump;
- }
- }
-
- state.tag = _tag;
- state.dump = '[' + _result + ']';
-}
-
-function writeBlockSequence(state, level, object, compact) {
- var _result = '',
- _tag = state.tag,
- index,
- length,
- value;
-
- for (index = 0, length = object.length; index < length; index += 1) {
- value = object[index];
-
- if (state.replacer) {
- value = state.replacer.call(object, String(index), value);
- }
-
- // Write only valid elements, put null instead of invalid elements.
- if (writeNode(state, level + 1, value, true, true, false, true) ||
- (typeof value === 'undefined' &&
- writeNode(state, level + 1, null, true, true, false, true))) {
-
- if (!compact || _result !== '') {
- _result += generateNextLine(state, level);
- }
-
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- _result += '-';
- } else {
- _result += '- ';
- }
-
- _result += state.dump;
- }
- }
-
- state.tag = _tag;
- state.dump = _result || '[]'; // Empty sequence if no valid values.
-}
-
-function writeFlowMapping(state, level, object) {
- var _result = '',
- _tag = state.tag,
- objectKeyList = Object.keys(object),
- index,
- length,
- objectKey,
- objectValue,
- pairBuffer;
-
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
-
- pairBuffer = '';
- if (_result !== '') pairBuffer += ', ';
-
- if (state.condenseFlow) pairBuffer += '"';
-
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
-
- if (state.replacer) {
- objectValue = state.replacer.call(object, objectKey, objectValue);
- }
-
- if (!writeNode(state, level, objectKey, false, false)) {
- continue; // Skip this pair because of invalid key;
- }
-
- if (state.dump.length > 1024) pairBuffer += '? ';
-
- pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
-
- if (!writeNode(state, level, objectValue, false, false)) {
- continue; // Skip this pair because of invalid value.
- }
-
- pairBuffer += state.dump;
-
- // Both key and value are valid.
- _result += pairBuffer;
- }
-
- state.tag = _tag;
- state.dump = '{' + _result + '}';
-}
-
-function writeBlockMapping(state, level, object, compact) {
- var _result = '',
- _tag = state.tag,
- objectKeyList = Object.keys(object),
- index,
- length,
- objectKey,
- objectValue,
- explicitPair,
- pairBuffer;
-
- // Allow sorting keys so that the output file is deterministic
- if (state.sortKeys === true) {
- // Default sorting
- objectKeyList.sort();
- } else if (typeof state.sortKeys === 'function') {
- // Custom sort function
- objectKeyList.sort(state.sortKeys);
- } else if (state.sortKeys) {
- // Something is wrong
- throw new exception('sortKeys must be a boolean or a function');
- }
-
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- pairBuffer = '';
-
- if (!compact || _result !== '') {
- pairBuffer += generateNextLine(state, level);
- }
-
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
-
- if (state.replacer) {
- objectValue = state.replacer.call(object, objectKey, objectValue);
- }
-
- if (!writeNode(state, level + 1, objectKey, true, true, true)) {
- continue; // Skip this pair because of invalid key.
- }
-
- explicitPair = (state.tag !== null && state.tag !== '?') ||
- (state.dump && state.dump.length > 1024);
-
- if (explicitPair) {
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += '?';
- } else {
- pairBuffer += '? ';
- }
- }
-
- pairBuffer += state.dump;
-
- if (explicitPair) {
- pairBuffer += generateNextLine(state, level);
- }
-
- if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
- continue; // Skip this pair because of invalid value.
- }
-
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += ':';
- } else {
- pairBuffer += ': ';
- }
-
- pairBuffer += state.dump;
-
- // Both key and value are valid.
- _result += pairBuffer;
- }
-
- state.tag = _tag;
- state.dump = _result || '{}'; // Empty mapping if no valid pairs.
-}
-
-function detectType(state, object, explicit) {
- var _result, typeList, index, length, type, style;
-
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
-
- for (index = 0, length = typeList.length; index < length; index += 1) {
- type = typeList[index];
-
- if ((type.instanceOf || type.predicate) &&
- (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
- (!type.predicate || type.predicate(object))) {
-
- if (explicit) {
- if (type.multi && type.representName) {
- state.tag = type.representName(object);
- } else {
- state.tag = type.tag;
- }
- } else {
- state.tag = '?';
- }
-
- if (type.represent) {
- style = state.styleMap[type.tag] || type.defaultStyle;
-
- if (_toString.call(type.represent) === '[object Function]') {
- _result = type.represent(object, style);
- } else if (_hasOwnProperty.call(type.represent, style)) {
- _result = type.represent[style](object, style);
- } else {
- throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
- }
-
- state.dump = _result;
- }
-
- return true;
- }
- }
-
- return false;
-}
-
-// Serializes `object` and writes it to global `result`.
-// Returns true on success, or false on invalid object.
-//
-function writeNode(state, level, object, block, compact, iskey, isblockseq) {
- state.tag = null;
- state.dump = object;
-
- if (!detectType(state, object, false)) {
- detectType(state, object, true);
- }
-
- var type = _toString.call(state.dump);
- var inblock = block;
- var tagStr;
-
- if (block) {
- block = (state.flowLevel < 0 || state.flowLevel > level);
- }
-
- var objectOrArray = type === '[object Object]' || type === '[object Array]',
- duplicateIndex,
- duplicate;
-
- if (objectOrArray) {
- duplicateIndex = state.duplicates.indexOf(object);
- duplicate = duplicateIndex !== -1;
- }
-
- if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
- compact = false;
- }
-
- if (duplicate && state.usedDuplicates[duplicateIndex]) {
- state.dump = '*ref_' + duplicateIndex;
- } else {
- if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
- state.usedDuplicates[duplicateIndex] = true;
- }
- if (type === '[object Object]') {
- if (block && (Object.keys(state.dump).length !== 0)) {
- writeBlockMapping(state, level, state.dump, compact);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + state.dump;
- }
- } else {
- writeFlowMapping(state, level, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
- }
- } else if (type === '[object Array]') {
- if (block && (state.dump.length !== 0)) {
- if (state.noArrayIndent && !isblockseq && level > 0) {
- writeBlockSequence(state, level - 1, state.dump, compact);
- } else {
- writeBlockSequence(state, level, state.dump, compact);
- }
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + state.dump;
- }
- } else {
- writeFlowSequence(state, level, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
- }
- } else if (type === '[object String]') {
- if (state.tag !== '?') {
- writeScalar(state, state.dump, level, iskey, inblock);
- }
- } else if (type === '[object Undefined]') {
- return false;
- } else {
- if (state.skipInvalid) return false;
- throw new exception('unacceptable kind of an object to dump ' + type);
- }
-
- if (state.tag !== null && state.tag !== '?') {
- // Need to encode all characters except those allowed by the spec:
- //
- // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
- // [36] ns-hex-digit ::= ns-dec-digit
- // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
- // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
- // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”
- // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”
- // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”
- // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”
- //
- // Also need to encode '!' because it has special meaning (end of tag prefix).
- //
- tagStr = encodeURI(
- state.tag[0] === '!' ? state.tag.slice(1) : state.tag
- ).replace(/!/g, '%21');
-
- if (state.tag[0] === '!') {
- tagStr = '!' + tagStr;
- } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
- tagStr = '!!' + tagStr.slice(18);
- } else {
- tagStr = '!<' + tagStr + '>';
- }
-
- state.dump = tagStr + ' ' + state.dump;
- }
- }
-
- return true;
-}
-
-function getDuplicateReferences(object, state) {
- var objects = [],
- duplicatesIndexes = [],
- index,
- length;
-
- inspectNode(object, objects, duplicatesIndexes);
-
- for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
- state.duplicates.push(objects[duplicatesIndexes[index]]);
- }
- state.usedDuplicates = new Array(length);
-}
-
-function inspectNode(object, objects, duplicatesIndexes) {
- var objectKeyList,
- index,
- length;
-
- if (object !== null && typeof object === 'object') {
- index = objects.indexOf(object);
- if (index !== -1) {
- if (duplicatesIndexes.indexOf(index) === -1) {
- duplicatesIndexes.push(index);
- }
- } else {
- objects.push(object);
-
- if (Array.isArray(object)) {
- for (index = 0, length = object.length; index < length; index += 1) {
- inspectNode(object[index], objects, duplicatesIndexes);
- }
- } else {
- objectKeyList = Object.keys(object);
-
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
- }
- }
- }
- }
-}
-
-function dump$1(input, options) {
- options = options || {};
-
- var state = new State(options);
-
- if (!state.noRefs) getDuplicateReferences(input, state);
-
- var value = input;
-
- if (state.replacer) {
- value = state.replacer.call({ '': value }, '', value);
- }
-
- if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
-
- return '';
-}
-
-var dump_1 = dump$1;
-
-var dumper = {
- dump: dump_1
-};
-
-function renamed(from, to) {
- return function () {
- throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
- 'Use yaml.' + to + ' instead, which is now safe by default.');
- };
-}
-
-
-var Type = type;
-var Schema = schema;
-var FAILSAFE_SCHEMA = failsafe;
-var JSON_SCHEMA = json;
-var CORE_SCHEMA = core;
-var DEFAULT_SCHEMA = _default;
-var load = loader.load;
-var loadAll = loader.loadAll;
-var dump = dumper.dump;
-var YAMLException = exception;
-
-// Re-export all types in case user wants to create custom schema
-var types = {
- binary: binary,
- float: float,
- map: map,
- null: _null,
- pairs: pairs,
- set: set,
- timestamp: timestamp,
- bool: bool,
- int: int,
- merge: merge,
- omap: omap,
- seq: seq,
- str: str
-};
-
-// Removed functions from JS-YAML 3.0.x
-var safeLoad = renamed('safeLoad', 'load');
-var safeLoadAll = renamed('safeLoadAll', 'loadAll');
-var safeDump = renamed('safeDump', 'dump');
-
-var jsYaml = {
- Type: Type,
- Schema: Schema,
- FAILSAFE_SCHEMA: FAILSAFE_SCHEMA,
- JSON_SCHEMA: JSON_SCHEMA,
- CORE_SCHEMA: CORE_SCHEMA,
- DEFAULT_SCHEMA: DEFAULT_SCHEMA,
- load: load,
- loadAll: loadAll,
- dump: dump,
- YAMLException: YAMLException,
- types: types,
- safeLoad: safeLoad,
- safeLoadAll: safeLoadAll,
- safeDump: safeDump
-};
+var al=Object.create;var Kt=Object.defineProperty;var sl=Object.getOwnPropertyDescriptor;var ol=Object.getOwnPropertyNames;var ll=Object.getPrototypeOf,cl=Object.prototype.hasOwnProperty;var Zr=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),ul=(e,n)=>{for(var t in n)Kt(e,t,{get:n[t],enumerable:!0})},Zn=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ol(n))!cl.call(e,i)&&i!==t&&Kt(e,i,{get:()=>n[i],enumerable:!(a=sl(n,i))||a.enumerable});return e};var Xt=(e,n,t)=>(t=e!=null?al(ll(e)):{},Zn(n||!e||!e.__esModule?Kt(t,"default",{value:e,enumerable:!0}):t,e)),fl=e=>Zn(Kt({},"__esModule",{value:!0}),e);var Jn=Zr((Jr,en)=>{(function(e,n){typeof Jr=="object"&&typeof en!="undefined"?en.exports=n():typeof define=="function"&&define.amd?define(n):e.chroma=n()})(Jr,function(){"use strict";for(var e=function(r,s,o){return s===void 0&&(s=0),o===void 0&&(o=1),ro?o:r},n=function(r){r._clipped=!1,r._unclipped=r.slice(0);for(var s=0;s<=3;s++)s<3?((r[s]<0||r[s]>255)&&(r._clipped=!0),r[s]=e(r[s],0,255)):s===3&&(r[s]=e(r[s],0,1));return r},t={},a=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];a=3?Array.prototype.slice.call(r):c(r[0])=="object"&&s?s.split("").filter(function(o){return r[0][o]!==void 0}).map(function(o){return r[0][o]}):r[0]},p=function(r){if(r.length<2)return null;var s=r.length-1;return c(r[s])=="string"?r[s].toLowerCase():null},w=Math.PI,S={clip_rgb:n,limit:e,type:c,unpack:f,last:p,PI:w,TWOPI:w*2,PITHIRD:w/3,DEG2RAD:w/180,RAD2DEG:180/w},E={format:{},autodetect:[]},B=S.last,Y=S.clip_rgb,K=S.type,Q=function(){for(var s=[],o=arguments.length;o--;)s[o]=arguments[o];var g=this;if(K(s[0])==="object"&&s[0].constructor&&s[0].constructor===this.constructor)return s[0];var b=B(s),y=!1;if(!b){y=!0,E.sorted||(E.autodetect=E.autodetect.sort(function(R,O){return O.p-R.p}),E.sorted=!0);for(var d=0,A=E.autodetect;d4?r[4]:1;return y===1?[0,0,0,d]:[o>=1?0:255*(1-o)*(1-y),g>=1?0:255*(1-g)*(1-y),b>=1?0:255*(1-b)*(1-y),d]},Pe=xe,Qe=S.unpack,ie=S.type;L.prototype.cmyk=function(){return qe(this._rgb)},F.cmyk=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["cmyk"])))},E.format.cmyk=Pe,E.autodetect.push({p:2,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=Qe(r,"cmyk"),ie(r)==="array"&&r.length===4)return"cmyk"}});var Tt=S.unpack,Ve=S.last,V=function(r){return Math.round(r*100)/100},M=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=Tt(r,"hsla"),g=Ve(r)||"lsa";return o[0]=V(o[0]||0),o[1]=V(o[1]*100)+"%",o[2]=V(o[2]*100)+"%",g==="hsla"||o.length>3&&o[3]<1?(o[3]=o.length>3?o[3]:1,g="hsla"):o.length=3,g+"("+o.join(",")+")"},_=M,u=S.unpack,h=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];r=u(r,"rgba");var o=r[0],g=r[1],b=r[2];o/=255,g/=255,b/=255;var y=Math.min(o,g,b),d=Math.max(o,g,b),A=(d+y)/2,k,N;return d===y?(k=0,N=Number.NaN):k=A<.5?(d-y)/(d+y):(d-y)/(2-d-y),o==d?N=(g-b)/(d-y):g==d?N=2+(b-o)/(d-y):b==d&&(N=4+(o-g)/(d-y)),N*=60,N<0&&(N+=360),r.length>3&&r[3]!==void 0?[N,k,A,r[3]]:[N,k,A]},m=h,C=S.unpack,v=S.last,x=Math.round,T=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=C(r,"rgba"),g=v(r)||"rgb";return g.substr(0,3)=="hsl"?_(m(o),g):(o[0]=x(o[0]),o[1]=x(o[1]),o[2]=x(o[2]),(g==="rgba"||o.length>3&&o[3]<1)&&(o[3]=o.length>3?o[3]:1,g="rgba"),g+"("+o.slice(0,g==="rgb"?3:4).join(",")+")")},I=T,D=S.unpack,P=Math.round,G=function(){for(var r,s=[],o=arguments.length;o--;)s[o]=arguments[o];s=D(s,"hsl");var g=s[0],b=s[1],y=s[2],d,A,k;if(b===0)d=A=k=y*255;else{var N=[0,0,0],R=[0,0,0],O=y<.5?y*(1+b):y+b-y*b,j=2*y-O,H=g/360;N[0]=H+1/3,N[1]=H,N[2]=H-1/3;for(var X=0;X<3;X++)N[X]<0&&(N[X]+=1),N[X]>1&&(N[X]-=1),6*N[X]<1?R[X]=j+(O-j)*6*N[X]:2*N[X]<1?R[X]=O:3*N[X]<2?R[X]=j+(O-j)*(2/3-N[X])*6:R[X]=j;r=[P(R[0]*255),P(R[1]*255),P(R[2]*255)],d=r[0],A=r[1],k=r[2]}return s.length>3?[d,A,k,s[3]]:[d,A,k,1]},q=G,U=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,fe=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,le=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Oe=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ye=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Se=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ae=Math.round,Re=function(r){r=r.toLowerCase().trim();var s;if(E.format.named)try{return E.format.named(r)}catch(X){}if(s=r.match(U)){for(var o=s.slice(1,4),g=0;g<3;g++)o[g]=+o[g];return o[3]=1,o}if(s=r.match(fe)){for(var b=s.slice(1,5),y=0;y<4;y++)b[y]=+b[y];return b}if(s=r.match(le)){for(var d=s.slice(1,4),A=0;A<3;A++)d[A]=ae(d[A]*2.55);return d[3]=1,d}if(s=r.match(Oe)){for(var k=s.slice(1,5),N=0;N<3;N++)k[N]=ae(k[N]*2.55);return k[3]=+k[3],k}if(s=r.match(ye)){var R=s.slice(1,4);R[1]*=.01,R[2]*=.01;var O=q(R);return O[3]=1,O}if(s=r.match(Se)){var j=s.slice(1,4);j[1]*=.01,j[2]*=.01;var H=q(j);return H[3]=+s[4],H}};Re.test=function(r){return U.test(r)||fe.test(r)||le.test(r)||Oe.test(r)||ye.test(r)||Se.test(r)};var _e=Re,Ke=S.type;L.prototype.css=function(r){return I(this._rgb,r)},F.css=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["css"])))},E.format.css=_e,E.autodetect.push({p:5,test:function(r){for(var s=[],o=arguments.length-1;o-- >0;)s[o]=arguments[o+1];if(!s.length&&Ke(r)==="string"&&_e.test(r))return"css"}});var Le=S.unpack;E.format.gl=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=Le(r,"rgba");return o[0]*=255,o[1]*=255,o[2]*=255,o},F.gl=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["gl"])))},L.prototype.gl=function(){var r=this._rgb;return[r[0]/255,r[1]/255,r[2]/255,r[3]]};var et=S.unpack,gt=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=et(r,"rgb"),g=o[0],b=o[1],y=o[2],d=Math.min(g,b,y),A=Math.max(g,b,y),k=A-d,N=k*100/255,R=d/(255-k)*100,O;return k===0?O=Number.NaN:(g===A&&(O=(b-y)/k),b===A&&(O=2+(y-g)/k),y===A&&(O=4+(g-b)/k),O*=60,O<0&&(O+=360)),[O,N,R]},tt=gt,Ar=S.unpack,kr=Math.floor,Tr=function(){for(var r,s,o,g,b,y,d=[],A=arguments.length;A--;)d[A]=arguments[A];d=Ar(d,"hcg");var k=d[0],N=d[1],R=d[2],O,j,H;R=R*255;var X=N*255;if(N===0)O=j=H=R;else{k===360&&(k=0),k>360&&(k-=360),k<0&&(k+=360),k/=60;var ee=kr(k),Z=k-ee,se=R*(1-N),ge=se+X*(1-Z),Me=se+X*Z,Ie=se+X;switch(ee){case 0:r=[Ie,Me,se],O=r[0],j=r[1],H=r[2];break;case 1:s=[ge,Ie,se],O=s[0],j=s[1],H=s[2];break;case 2:o=[se,Ie,Me],O=o[0],j=o[1],H=o[2];break;case 3:g=[se,ge,Ie],O=g[0],j=g[1],H=g[2];break;case 4:b=[Me,se,Ie],O=b[0],j=b[1],H=b[2];break;case 5:y=[Ie,se,ge],O=y[0],j=y[1],H=y[2];break}}return[O,j,H,d.length>3?d[3]:1]},Lr=Tr,Mr=S.unpack,Ir=S.type;L.prototype.hcg=function(){return tt(this._rgb)},F.hcg=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["hcg"])))},E.format.hcg=Lr,E.autodetect.push({p:1,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=Mr(r,"hcg"),Ir(r)==="array"&&r.length===3)return"hcg"}});var jt=S.unpack,Lt=S.last,Gt=Math.round,ja=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=jt(r,"rgba"),g=o[0],b=o[1],y=o[2],d=o[3],A=Lt(r)||"auto";d===void 0&&(d=1),A==="auto"&&(A=d<1?"rgba":"rgb"),g=Gt(g),b=Gt(b),y=Gt(y);var k=g<<16|b<<8|y,N="000000"+k.toString(16);N=N.substr(N.length-6);var R="0"+Gt(d*255).toString(16);switch(R=R.substr(R.length-2),A.toLowerCase()){case"rgba":return"#"+N+R;case"argb":return"#"+R+N;default:return"#"+N}},An=ja,Ga=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ya=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Ua=function(r){if(r.match(Ga)){(r.length===4||r.length===7)&&(r=r.substr(1)),r.length===3&&(r=r.split(""),r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var s=parseInt(r,16),o=s>>16,g=s>>8&255,b=s&255;return[o,g,b,1]}if(r.match(Ya)){(r.length===5||r.length===9)&&(r=r.substr(1)),r.length===4&&(r=r.split(""),r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]);var y=parseInt(r,16),d=y>>24&255,A=y>>16&255,k=y>>8&255,N=Math.round((y&255)/255*100)/100;return[d,A,k,N]}throw new Error("unknown hex color: "+r)},kn=Ua,Wa=S.type;L.prototype.hex=function(r){return An(this._rgb,r)},F.hex=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["hex"])))},E.format.hex=kn,E.autodetect.push({p:4,test:function(r){for(var s=[],o=arguments.length-1;o-- >0;)s[o]=arguments[o+1];if(!s.length&&Wa(r)==="string"&&[3,4,5,6,7,8,9].indexOf(r.length)>=0)return"hex"}});var qa=S.unpack,Tn=S.TWOPI,za=Math.min,Ka=Math.sqrt,Xa=Math.acos,Qa=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=qa(r,"rgb"),g=o[0],b=o[1],y=o[2];g/=255,b/=255,y/=255;var d,A=za(g,b,y),k=(g+b+y)/3,N=k>0?1-A/k:0;return N===0?d=NaN:(d=(g-b+(g-y))/2,d/=Ka((g-b)*(g-b)+(g-y)*(b-y)),d=Xa(d),y>b&&(d=Tn-d),d/=Tn),[d*360,N,k]},Za=Qa,Ja=S.unpack,Fr=S.limit,pt=S.TWOPI,Nr=S.PITHIRD,ht=Math.cos,es=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];r=Ja(r,"hsi");var o=r[0],g=r[1],b=r[2],y,d,A;return isNaN(o)&&(o=0),isNaN(g)&&(g=0),o>360&&(o-=360),o<0&&(o+=360),o/=360,o<1/3?(A=(1-g)/3,y=(1+g*ht(pt*o)/ht(Nr-pt*o))/3,d=1-(A+y)):o<2/3?(o-=1/3,y=(1-g)/3,d=(1+g*ht(pt*o)/ht(Nr-pt*o))/3,A=1-(y+d)):(o-=2/3,d=(1-g)/3,A=(1+g*ht(pt*o)/ht(Nr-pt*o))/3,y=1-(d+A)),y=Fr(b*y*3),d=Fr(b*d*3),A=Fr(b*A*3),[y*255,d*255,A*255,r.length>3?r[3]:1]},ts=es,rs=S.unpack,ns=S.type;L.prototype.hsi=function(){return Za(this._rgb)},F.hsi=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["hsi"])))},E.format.hsi=ts,E.autodetect.push({p:2,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=rs(r,"hsi"),ns(r)==="array"&&r.length===3)return"hsi"}});var is=S.unpack,as=S.type;L.prototype.hsl=function(){return m(this._rgb)},F.hsl=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["hsl"])))},E.format.hsl=q,E.autodetect.push({p:2,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=is(r,"hsl"),as(r)==="array"&&r.length===3)return"hsl"}});var ss=S.unpack,os=Math.min,ls=Math.max,cs=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];r=ss(r,"rgb");var o=r[0],g=r[1],b=r[2],y=os(o,g,b),d=ls(o,g,b),A=d-y,k,N,R;return R=d/255,d===0?(k=Number.NaN,N=0):(N=A/d,o===d&&(k=(g-b)/A),g===d&&(k=2+(b-o)/A),b===d&&(k=4+(o-g)/A),k*=60,k<0&&(k+=360)),[k,N,R]},us=cs,fs=S.unpack,gs=Math.floor,ps=function(){for(var r,s,o,g,b,y,d=[],A=arguments.length;A--;)d[A]=arguments[A];d=fs(d,"hsv");var k=d[0],N=d[1],R=d[2],O,j,H;if(R*=255,N===0)O=j=H=R;else{k===360&&(k=0),k>360&&(k-=360),k<0&&(k+=360),k/=60;var X=gs(k),ee=k-X,Z=R*(1-N),se=R*(1-N*ee),ge=R*(1-N*(1-ee));switch(X){case 0:r=[R,ge,Z],O=r[0],j=r[1],H=r[2];break;case 1:s=[se,R,Z],O=s[0],j=s[1],H=s[2];break;case 2:o=[Z,R,ge],O=o[0],j=o[1],H=o[2];break;case 3:g=[Z,se,R],O=g[0],j=g[1],H=g[2];break;case 4:b=[ge,Z,R],O=b[0],j=b[1],H=b[2];break;case 5:y=[R,Z,se],O=y[0],j=y[1],H=y[2];break}}return[O,j,H,d.length>3?d[3]:1]},hs=ps,ds=S.unpack,vs=S.type;L.prototype.hsv=function(){return us(this._rgb)},F.hsv=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["hsv"])))},E.format.hsv=hs,E.autodetect.push({p:2,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=ds(r,"hsv"),vs(r)==="array"&&r.length===3)return"hsv"}});var Be={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ms=S.unpack,Ln=Math.pow,bs=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=ms(r,"rgb"),g=o[0],b=o[1],y=o[2],d=ys(g,b,y),A=d[0],k=d[1],N=d[2],R=116*k-16;return[R<0?0:R,500*(A-k),200*(k-N)]},Or=function(r){return(r/=255)<=.04045?r/12.92:Ln((r+.055)/1.055,2.4)},Dr=function(r){return r>Be.t3?Ln(r,1/3):r/Be.t2+Be.t0},ys=function(r,s,o){r=Or(r),s=Or(s),o=Or(o);var g=Dr((.4124564*r+.3575761*s+.1804375*o)/Be.Xn),b=Dr((.2126729*r+.7151522*s+.072175*o)/Be.Yn),y=Dr((.0193339*r+.119192*s+.9503041*o)/Be.Zn);return[g,b,y]},Mn=bs,Ss=S.unpack,Cs=Math.pow,xs=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];r=Ss(r,"lab");var o=r[0],g=r[1],b=r[2],y,d,A,k,N,R;return d=(o+16)/116,y=isNaN(g)?d:d+g/500,A=isNaN(b)?d:d-b/200,d=Be.Yn*$r(d),y=Be.Xn*$r(y),A=Be.Zn*$r(A),k=Rr(3.2404542*y-1.5371385*d-.4985314*A),N=Rr(-.969266*y+1.8760108*d+.041556*A),R=Rr(.0556434*y-.2040259*d+1.0572252*A),[k,N,R,r.length>3?r[3]:1]},Rr=function(r){return 255*(r<=.00304?12.92*r:1.055*Cs(r,1/2.4)-.055)},$r=function(r){return r>Be.t1?r*r*r:Be.t2*(r-Be.t0)},In=xs,ws=S.unpack,Es=S.type;L.prototype.lab=function(){return Mn(this._rgb)},F.lab=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["lab"])))},E.format.lab=In,E.autodetect.push({p:2,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=ws(r,"lab"),Es(r)==="array"&&r.length===3)return"lab"}});var _s=S.unpack,As=S.RAD2DEG,ks=Math.sqrt,Ts=Math.atan2,Ls=Math.round,Ms=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=_s(r,"lab"),g=o[0],b=o[1],y=o[2],d=ks(b*b+y*y),A=(Ts(y,b)*As+360)%360;return Ls(d*1e4)===0&&(A=Number.NaN),[g,d,A]},Is=Ms,Fs=S.unpack,Ns=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=Fs(r,"rgb"),g=o[0],b=o[1],y=o[2],d=Mn(g,b,y),A=d[0],k=d[1],N=d[2];return Is(A,k,N)},Fn=Ns,Os=S.unpack,Ds=S.DEG2RAD,Rs=Math.sin,$s=Math.cos,Ps=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=Os(r,"lch"),g=o[0],b=o[1],y=o[2];return isNaN(y)&&(y=0),y=y*Ds,[g,$s(y)*b,Rs(y)*b]},Vs=Ps,Bs=S.unpack,Hs=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];r=Bs(r,"lch");var o=r[0],g=r[1],b=r[2],y=Vs(o,g,b),d=y[0],A=y[1],k=y[2],N=In(d,A,k),R=N[0],O=N[1],j=N[2];return[R,O,j,r.length>3?r[3]:1]},Nn=Hs,js=S.unpack,Gs=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=js(r,"hcl").reverse();return Nn.apply(void 0,o)},Ys=Gs,Us=S.unpack,Ws=S.type;L.prototype.lch=function(){return Fn(this._rgb)},L.prototype.hcl=function(){return Fn(this._rgb).reverse()},F.lch=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["lch"])))},F.hcl=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["hcl"])))},E.format.lch=Nn,E.format.hcl=Ys,["lch","hcl"].forEach(function(r){return E.autodetect.push({p:2,test:function(){for(var s=[],o=arguments.length;o--;)s[o]=arguments[o];if(s=Us(s,r),Ws(s)==="array"&&s.length===3)return r}})});var qs={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},dt=qs,zs=S.type;L.prototype.name=function(){for(var r=An(this._rgb,"rgb"),s=0,o=Object.keys(dt);s0;)s[o]=arguments[o+1];if(!s.length&&zs(r)==="string"&&dt[r.toLowerCase()])return"named"}});var Ks=S.unpack,Xs=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=Ks(r,"rgb"),g=o[0],b=o[1],y=o[2];return(g<<16)+(b<<8)+y},Qs=Xs,Zs=S.type,Js=function(r){if(Zs(r)=="number"&&r>=0&&r<=16777215){var s=r>>16,o=r>>8&255,g=r&255;return[s,o,g,1]}throw new Error("unknown num color: "+r)},eo=Js,to=S.type;L.prototype.num=function(){return Qs(this._rgb)},F.num=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["num"])))},E.format.num=eo,E.autodetect.push({p:5,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r.length===1&&to(r[0])==="number"&&r[0]>=0&&r[0]<=16777215)return"num"}});var On=S.unpack,Dn=S.type,Rn=Math.round;L.prototype.rgb=function(r){return r===void 0&&(r=!0),r===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Rn)},L.prototype.rgba=function(r){return r===void 0&&(r=!0),this._rgb.slice(0,4).map(function(s,o){return o<3?r===!1?s:Rn(s):s})},F.rgb=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["rgb"])))},E.format.rgb=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=On(r,"rgba");return o[3]===void 0&&(o[3]=1),o},E.autodetect.push({p:3,test:function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];if(r=On(r,"rgba"),Dn(r)==="array"&&(r.length===3||r.length===4&&Dn(r[3])=="number"&&r[3]>=0&&r[3]<=1))return"rgb"}});var Yt=Math.log,ro=function(r){var s=r/100,o,g,b;return s<66?(o=255,g=-155.25485562709179-.44596950469579133*(g=s-2)+104.49216199393888*Yt(g),b=s<20?0:-254.76935184120902+.8274096064007395*(b=s-10)+115.67994401066147*Yt(b)):(o=351.97690566805693+.114206453784165*(o=s-55)-40.25366309332127*Yt(o),g=325.4494125711974+.07943456536662342*(g=s-50)-28.0852963507957*Yt(g),b=255),[o,g,b,1]},$n=ro,no=S.unpack,io=Math.round,ao=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];for(var o=no(r,"rgb"),g=o[0],b=o[2],y=1e3,d=4e4,A=.4,k;d-y>A;){k=(d+y)*.5;var N=$n(k);N[2]/N[0]>=b/g?d=k:y=k}return io(k)},so=ao;L.prototype.temp=L.prototype.kelvin=L.prototype.temperature=function(){return so(this._rgb)},F.temp=F.kelvin=F.temperature=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return new(Function.prototype.bind.apply(L,[null].concat(r,["temp"])))},E.format.temp=E.format.kelvin=E.format.temperature=$n;var oo=S.type;L.prototype.alpha=function(r,s){return s===void 0&&(s=!1),r!==void 0&&oo(r)==="number"?s?(this._rgb[3]=r,this):new L([this._rgb[0],this._rgb[1],this._rgb[2],r],"rgb"):this._rgb[3]},L.prototype.clipped=function(){return this._rgb._clipped||!1},L.prototype.darken=function(r){r===void 0&&(r=1);var s=this,o=s.lab();return o[0]-=Be.Kn*r,new L(o,"lab").alpha(s.alpha(),!0)},L.prototype.brighten=function(r){return r===void 0&&(r=1),this.darken(-r)},L.prototype.darker=L.prototype.darken,L.prototype.brighter=L.prototype.brighten,L.prototype.get=function(r){var s=r.split("."),o=s[0],g=s[1],b=this[o]();if(g){var y=o.indexOf(g);if(y>-1)return b[y];throw new Error("unknown channel "+g+" in mode "+o)}else return b};var lo=S.type,co=Math.pow,uo=1e-7,fo=20;L.prototype.luminance=function(r){if(r!==void 0&&lo(r)==="number"){if(r===0)return new L([0,0,0,this._rgb[3]],"rgb");if(r===1)return new L([255,255,255,this._rgb[3]],"rgb");var s=this.luminance(),o="rgb",g=fo,b=function(d,A){var k=d.interpolate(A,.5,o),N=k.luminance();return Math.abs(r-N)r?b(d,k):b(k,A)},y=(s>r?b(new L([0,0,0]),this):b(this,new L([255,255,255]))).rgb();return new L(y.concat([this._rgb[3]]))}return go.apply(void 0,this._rgb.slice(0,3))};var go=function(r,s,o){return r=Pr(r),s=Pr(s),o=Pr(o),.2126*r+.7152*s+.0722*o},Pr=function(r){return r/=255,r<=.03928?r/12.92:co((r+.055)/1.055,2.4)},He={},Pn=S.type,Vn=function(r,s,o){o===void 0&&(o=.5);for(var g=[],b=arguments.length-3;b-- >0;)g[b]=arguments[b+3];var y=g[0]||"lrgb";if(!He[y]&&!g.length&&(y=Object.keys(He)[0]),!He[y])throw new Error("interpolation mode "+y+" is not defined");return Pn(r)!=="object"&&(r=new L(r)),Pn(s)!=="object"&&(s=new L(s)),He[y](r,s,o).alpha(r.alpha()+o*(s.alpha()-r.alpha()))};L.prototype.mix=L.prototype.interpolate=function(r,s){s===void 0&&(s=.5);for(var o=[],g=arguments.length-2;g-- >0;)o[g]=arguments[g+2];return Vn.apply(void 0,[this,r,s].concat(o))},L.prototype.premultiply=function(r){r===void 0&&(r=!1);var s=this._rgb,o=s[3];return r?(this._rgb=[s[0]*o,s[1]*o,s[2]*o,o],this):new L([s[0]*o,s[1]*o,s[2]*o,o],"rgb")},L.prototype.saturate=function(r){r===void 0&&(r=1);var s=this,o=s.lch();return o[1]+=Be.Kn*r,o[1]<0&&(o[1]=0),new L(o,"lch").alpha(s.alpha(),!0)},L.prototype.desaturate=function(r){return r===void 0&&(r=1),this.saturate(-r)};var Bn=S.type;L.prototype.set=function(r,s,o){o===void 0&&(o=!1);var g=r.split("."),b=g[0],y=g[1],d=this[b]();if(y){var A=b.indexOf(y);if(A>-1){if(Bn(s)=="string")switch(s.charAt(0)){case"+":d[A]+=+s;break;case"-":d[A]+=+s;break;case"*":d[A]*=+s.substr(1);break;case"/":d[A]/=+s.substr(1);break;default:d[A]=+s}else if(Bn(s)==="number")d[A]=s;else throw new Error("unsupported value for Color.set");var k=new L(d,b);return o?(this._rgb=k._rgb,this):k}throw new Error("unknown channel "+y+" in mode "+b)}else return d};var po=function(r,s,o){var g=r._rgb,b=s._rgb;return new L(g[0]+o*(b[0]-g[0]),g[1]+o*(b[1]-g[1]),g[2]+o*(b[2]-g[2]),"rgb")};He.rgb=po;var Vr=Math.sqrt,vt=Math.pow,ho=function(r,s,o){var g=r._rgb,b=g[0],y=g[1],d=g[2],A=s._rgb,k=A[0],N=A[1],R=A[2];return new L(Vr(vt(b,2)*(1-o)+vt(k,2)*o),Vr(vt(y,2)*(1-o)+vt(N,2)*o),Vr(vt(d,2)*(1-o)+vt(R,2)*o),"rgb")};He.lrgb=ho;var vo=function(r,s,o){var g=r.lab(),b=s.lab();return new L(g[0]+o*(b[0]-g[0]),g[1]+o*(b[1]-g[1]),g[2]+o*(b[2]-g[2]),"lab")};He.lab=vo;var Mt=function(r,s,o,g){var b,y,d,A;g==="hsl"?(d=r.hsl(),A=s.hsl()):g==="hsv"?(d=r.hsv(),A=s.hsv()):g==="hcg"?(d=r.hcg(),A=s.hcg()):g==="hsi"?(d=r.hsi(),A=s.hsi()):(g==="lch"||g==="hcl")&&(g="hcl",d=r.hcl(),A=s.hcl());var k,N,R,O,j,H;g.substr(0,1)==="h"&&(b=d,k=b[0],R=b[1],j=b[2],y=A,N=y[0],O=y[1],H=y[2]);var X,ee,Z,se;return!isNaN(k)&&!isNaN(N)?(N>k&&N-k>180?se=N-(k+360):N180?se=N+360-k:se=N-k,ee=k+o*se):isNaN(k)?isNaN(N)?ee=Number.NaN:(ee=N,(j==1||j==0)&&g!="hsv"&&(X=O)):(ee=k,(H==1||H==0)&&g!="hsv"&&(X=R)),X===void 0&&(X=R+o*(O-R)),Z=j+o*(H-j),new L([ee,X,Z],g)},Hn=function(r,s,o){return Mt(r,s,o,"lch")};He.lch=Hn,He.hcl=Hn;var mo=function(r,s,o){var g=r.num(),b=s.num();return new L(g+o*(b-g),"num")};He.num=mo;var bo=function(r,s,o){return Mt(r,s,o,"hcg")};He.hcg=bo;var yo=function(r,s,o){return Mt(r,s,o,"hsi")};He.hsi=yo;var So=function(r,s,o){return Mt(r,s,o,"hsl")};He.hsl=So;var Co=function(r,s,o){return Mt(r,s,o,"hsv")};He.hsv=Co;var xo=S.clip_rgb,Br=Math.pow,Hr=Math.sqrt,jr=Math.PI,jn=Math.cos,Gn=Math.sin,wo=Math.atan2,Eo=function(r,s,o){s===void 0&&(s="lrgb"),o===void 0&&(o=null);var g=r.length;o||(o=Array.from(new Array(g)).map(function(){return 1}));var b=g/o.reduce(function(ee,Z){return ee+Z});if(o.forEach(function(ee,Z){o[Z]*=b}),r=r.map(function(ee){return new L(ee)}),s==="lrgb")return _o(r,o);for(var y=r.shift(),d=y.get(s),A=[],k=0,N=0,R=0;R=360;)X-=360;d[H]=X}else d[H]=d[H]/A[H];return j/=g,new L(d,s).alpha(j>.99999?1:j,!0)},_o=function(r,s){for(var o=r.length,g=[0,0,0,0],b=0;b.9999999&&(g[3]=1),new L(xo(g))},mt=S.type,Ao=Math.pow,Ut=function(r){var s="rgb",o=F("#ccc"),g=0,b=[0,1],y=[],d=[0,0],A=!1,k=[],N=!1,R=0,O=1,j=!1,H={},X=!0,ee=1,Z=function($){if($=$||["#fff","#000"],$&&mt($)==="string"&&F.brewer&&F.brewer[$.toLowerCase()]&&($=F.brewer[$.toLowerCase()]),mt($)==="array"){$.length===1&&($=[$[0],$[0]]),$=$.slice(0);for(var z=0;z<$.length;z++)$[z]=F($[z]);y.length=0;for(var te=0;te<$.length;te++)y.push(te/($.length-1))}return Ue(),k=$},se=function($){if(A!=null){for(var z=A.length-1,te=0;te=A[te];)te++;return te-1}return 0},ge=function($){return $},Me=function($){return $},Ie=function($,z){var te,J;if(z==null&&(z=!1),isNaN($)||$===null)return o;if(z)J=$;else if(A&&A.length>2){var je=se($);J=je/(A.length-2)}else O!==R?J=($-R)/(O-R):J=1;J=Me(J),z||(J=ge(J)),ee!==1&&(J=Ao(J,ee)),J=d[0]+J*(1-d[0]-d[1]),J=Math.min(1,Math.max(0,J));var be=Math.floor(J*1e4);if(X&&H[be])te=H[be];else{if(mt(k)==="array")for(var ce=0;ce=ue&&ce===y.length-1){te=k[ce];break}if(J>ue&&J2){var ce=$.map(function(we,pe){return pe/($.length-1)}),ue=$.map(function(we){return(we-R)/(O-R)});ue.every(function(we,pe){return ce[pe]===we})||(Me=function(we){if(we<=0||we>=1)return we;for(var pe=0;we>=ue[pe+1];)pe++;var it=(we-ue[pe])/(ue[pe+1]-ue[pe]),bt=ce[pe]+it*(ce[pe+1]-ce[pe]);return bt})}}return b=[R,O],ne},ne.mode=function($){return arguments.length?(s=$,Ue(),ne):s},ne.range=function($,z){return Z($,z),ne},ne.out=function($){return N=$,ne},ne.spread=function($){return arguments.length?(g=$,ne):g},ne.correctLightness=function($){return $==null&&($=!0),j=$,Ue(),j?ge=function(z){for(var te=Ie(0,!0).lab()[0],J=Ie(1,!0).lab()[0],je=te>J,be=Ie(z,!0).lab()[0],ce=te+(J-te)*z,ue=be-ce,we=0,pe=1,it=20;Math.abs(ue)>.01&&it-- >0;)(function(){return je&&(ue*=-1),ue<0?(we=z,z+=(pe-z)*.5):(pe=z,z+=(we-z)*.5),be=Ie(z,!0).lab()[0],ue=be-ce})();return z}:ge=function(z){return z},ne},ne.padding=function($){return $!=null?(mt($)==="number"&&($=[$,$]),d=$,ne):d},ne.colors=function($,z){arguments.length<2&&(z="hex");var te=[];if(arguments.length===0)te=k.slice(0);else if($===1)te=[ne(.5)];else if($>1){var J=b[0],je=b[1]-J;te=ko(0,$,!1).map(function(pe){return ne(J+pe/($-1)*je)})}else{r=[];var be=[];if(A&&A.length>2)for(var ce=1,ue=A.length,we=1<=ue;we?ceue;we?ce++:ce--)be.push((A[ce-1]+A[ce])*.5);else be=b;te=be.map(function(pe){return ne(pe)})}return F[z]&&(te=te.map(function(pe){return pe[z]()})),te},ne.cache=function($){return $!=null?(X=$,ne):X},ne.gamma=function($){return $!=null?(ee=$,ne):ee},ne.nodata=function($){return $!=null?(o=F($),ne):o},ne};function ko(r,s,o){for(var g=[],b=ry;b?d++:d--)g.push(d);return g}var Gr=function(r){var s,o,g,b,y,d,A;if(r=r.map(function(O){return new L(O)}),r.length===2)s=r.map(function(O){return O.lab()}),y=s[0],d=s[1],b=function(O){var j=[0,1,2].map(function(H){return y[H]+O*(d[H]-y[H])});return new L(j,"lab")};else if(r.length===3)o=r.map(function(O){return O.lab()}),y=o[0],d=o[1],A=o[2],b=function(O){var j=[0,1,2].map(function(H){return(1-O)*(1-O)*y[H]+2*(1-O)*O*d[H]+O*O*A[H]});return new L(j,"lab")};else if(r.length===4){var k;g=r.map(function(O){return O.lab()}),y=g[0],d=g[1],A=g[2],k=g[3],b=function(O){var j=[0,1,2].map(function(H){return(1-O)*(1-O)*(1-O)*y[H]+3*(1-O)*(1-O)*O*d[H]+3*(1-O)*O*O*A[H]+O*O*O*k[H]});return new L(j,"lab")}}else if(r.length===5){var N=Gr(r.slice(0,3)),R=Gr(r.slice(2,5));b=function(O){return O<.5?N(O*2):R((O-.5)*2)}}return b},To=function(r){var s=Gr(r);return s.scale=function(){return Ut(s)},s},ze=function(r,s,o){if(!ze[o])throw new Error("unknown blend mode "+o);return ze[o](r,s)},rt=function(r){return function(s,o){var g=F(o).rgb(),b=F(s).rgb();return F.rgb(r(g,b))}},nt=function(r){return function(s,o){var g=[];return g[0]=r(s[0],o[0]),g[1]=r(s[1],o[1]),g[2]=r(s[2],o[2]),g}},Lo=function(r){return r},Mo=function(r,s){return r*s/255},Io=function(r,s){return r>s?s:r},Fo=function(r,s){return r>s?r:s},No=function(r,s){return 255*(1-(1-r/255)*(1-s/255))},Oo=function(r,s){return s<128?2*r*s/255:255*(1-2*(1-r/255)*(1-s/255))},Do=function(r,s){return 255*(1-(1-s/255)/(r/255))},Ro=function(r,s){return r===255?255:(r=255*(s/255)/(1-r/255),r>255?255:r)};ze.normal=rt(nt(Lo)),ze.multiply=rt(nt(Mo)),ze.screen=rt(nt(No)),ze.overlay=rt(nt(Oo)),ze.darken=rt(nt(Io)),ze.lighten=rt(nt(Fo)),ze.dodge=rt(nt(Ro)),ze.burn=rt(nt(Do));for(var $o=ze,Yr=S.type,Po=S.clip_rgb,Vo=S.TWOPI,Bo=Math.pow,Ho=Math.sin,jo=Math.cos,Go=function(r,s,o,g,b){r===void 0&&(r=300),s===void 0&&(s=-1.5),o===void 0&&(o=1),g===void 0&&(g=1),b===void 0&&(b=[0,1]);var y=0,d;Yr(b)==="array"?d=b[1]-b[0]:(d=0,b=[b,b]);var A=function(k){var N=Vo*((r+120)/360+s*k),R=Bo(b[0]+d*k,g),O=y!==0?o[0]+k*y:o,j=O*R*(1-R)/2,H=jo(N),X=Ho(N),ee=R+j*(-.14861*H+1.78277*X),Z=R+j*(-.29227*H-.90649*X),se=R+j*(1.97294*H);return F(Po([ee*255,Z*255,se*255,1]))};return A.start=function(k){return k==null?r:(r=k,A)},A.rotations=function(k){return k==null?s:(s=k,A)},A.gamma=function(k){return k==null?g:(g=k,A)},A.hue=function(k){return k==null?o:(o=k,Yr(o)==="array"?(y=o[1]-o[0],y===0&&(o=o[1])):y=0,A)},A.lightness=function(k){return k==null?b:(Yr(k)==="array"?(b=k,d=k[1]-k[0]):(b=[k,k],d=0),A)},A.scale=function(){return F.scale(A)},A.hue(o),A},Yo="0123456789abcdef",Uo=Math.floor,Wo=Math.random,qo=function(){for(var r="#",s=0;s<6;s++)r+=Yo.charAt(Uo(Wo()*16));return new L(r,"hex")},Yn=Math.log,zo=Math.pow,Ko=Math.floor,Xo=Math.abs,Un=function(r,s){s===void 0&&(s=null);var o={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return c(r)==="object"&&(r=Object.values(r)),r.forEach(function(g){s&&c(g)==="object"&&(g=g[s]),g!=null&&!isNaN(g)&&(o.values.push(g),o.sum+=g,go.max&&(o.max=g),o.count+=1)}),o.domain=[o.min,o.max],o.limits=function(g,b){return Wn(o,g,b)},o},Wn=function(r,s,o){s===void 0&&(s="equal"),o===void 0&&(o=7),c(r)=="array"&&(r=Un(r));var g=r.min,b=r.max,y=r.values.sort(function(Xr,Qr){return Xr-Qr});if(o===1)return[g,b];var d=[];if(s.substr(0,1)==="c"&&(d.push(g),d.push(b)),s.substr(0,1)==="e"){d.push(g);for(var A=1;A 0");var k=Math.LOG10E*Yn(g),N=Math.LOG10E*Yn(b);d.push(g);for(var R=1;R200&&(Me=!1)}for(var It={},qr=0;qrg?(o+.05)/(g+.05):(g+.05)/(o+.05)},Wt=Math.sqrt,Zo=Math.atan2,zn=Math.abs,Kn=Math.cos,Ur=Math.PI,Jo=function(r,s,o,g){o===void 0&&(o=1),g===void 0&&(g=1),r=new L(r),s=new L(s);for(var b=Array.from(r.lab()),y=b[0],d=b[1],A=b[2],k=Array.from(s.lab()),N=k[0],R=k[1],O=k[2],j=Wt(d*d+A*A),H=Wt(R*R+O*O),X=y<16?.511:.040975*y/(1+.01765*y),ee=.0638*j/(1+.0131*j)+.638,Z=j<1e-6?0:Zo(A,d)*180/Ur;Z<0;)Z+=360;for(;Z>=360;)Z-=360;var se=Z>=164&&Z<=345?.56+zn(.2*Kn(Ur*(Z+168)/180)):.36+zn(.4*Kn(Ur*(Z+35)/180)),ge=j*j*j*j,Me=Wt(ge/(ge+1900)),Ie=ee*(Me*se+1-Me),Ue=y-N,ne=j-H,$=d-R,z=A-O,te=$*$+z*z-ne*ne,J=Ue/(o*X),je=ne/(g*ee),be=Ie;return Wt(J*J+je*je+te/(be*be))},el=function(r,s,o){o===void 0&&(o="lab"),r=new L(r),s=new L(s);var g=r.get(o),b=s.get(o),y=0;for(var d in g){var A=(g[d]||0)-(b[d]||0);y+=A*A}return Math.sqrt(y)},tl=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];try{return new(Function.prototype.bind.apply(L,[null].concat(r))),!0}catch(o){return!1}},rl={cool:function(){return Ut([F.hsl(180,1,.9),F.hsl(250,.7,.4)])},hot:function(){return Ut(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}},qt={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Wr=0,Xn=Object.keys(qt);Wr{((e,n)=>{typeof define=="function"&&define.amd?define([],n):typeof er=="object"&&er.exports?er.exports=n():e.fuzzysort=n()})(_i,e=>{"use strict";var n=(V,M)=>{if(V=="farzher")return{target:"farzher was here (^-^*)/",score:0,_indexes:[0]};if(!V||!M)return ie;var _=w(V);Te(M)||(M=p(M));var u=_.bitflags;return(u&M._bitflags)!==u?ie:E(_,M)},t=(V,M,_)=>{if(V=="farzher")return[{target:"farzher was here (^-^*)/",score:0,_indexes:[0],obj:M?M[0]:ie}];if(!V)return _&&_.all?S(V,M,_):Qe;var u=w(V),h=u.bitflags,m=u.containsSpace,C=_&&_.threshold||Pe,v=_&&_.limit||xe,x=0,T=0,I=M.length;if(_&&_.key)for(var D=_.key,P=0;PVe.peek().score&&Ve.replaceTop(U))))}}else if(_&&_.keys)for(var fe=_.scoreFn||Ye,le=_.keys,Oe=le.length,P=0;PVe.peek().score&&Ve.replaceTop(ye))))}else for(var P=0;PVe.peek().score&&Ve.replaceTop(U))))}}if(x===0)return Qe;for(var Re=new Array(x),P=x-1;P>=0;--P)Re[P]=Ve.poll();return Re.total=x+T,Re},a=(V,M,_)=>{if(typeof M=="function")return i(V,M);if(V===ie)return ie;M===void 0&&(M=""),_===void 0&&(_="");var u="",h=0,m=!1,C=V.target,v=C.length,x=V._indexes;x=x.slice(0,x.len).sort((D,P)=>D-P);for(var T=0;T{if(T===ie)return ie;var _=T.target,u=_.length,h=T._indexes;h=h.slice(0,h.len).sort((P,G)=>P-G);for(var m="",C=0,v=0,x=!1,T=[],I=0;IV._indexes.slice(0,V._indexes.len).sort((M,_)=>M-_),c=V=>{typeof V!="string"&&(V="");var M=Y(V);return{target:V,_targetLower:M._lower,_targetLowerCodes:M.lowerCodes,_nextBeginningIndexes:ie,_bitflags:M.bitflags,score:ie,_indexes:[0],obj:ie}},f=V=>{typeof V!="string"&&(V=""),V=V.trim();var M=Y(V),_=[];if(M.containsSpace){var u=V.split(/\s+/);u=[...new Set(u)];for(var h=0;h{if(V.length>999)return c(V);var M=re.get(V);return M!==void 0||(M=c(V),re.set(V,M)),M},w=V=>{if(V.length>999)return f(V);var M=F.get(V);return M!==void 0||(M=f(V),F.set(V,M)),M},S=(V,M,_)=>{var u=[];u.total=M.length;var h=_&&_.limit||xe;if(_&&_.key)for(var m=0;m=h)return u}}else if(_&&_.keys)for(var m=0;m=0;--I){var v=qe(C,_.keys[I]);if(!v){T[I]=ie;continue}Te(v)||(v=p(v)),v.score=Pe,v._indexes.len=0,T[I]=v}if(T.obj=C,T.score=Pe,u.push(T),u.length>=h)return u}else for(var m=0;m=h))return u}return u},E=(V,M,_=!1)=>{if(_===!1&&V.containsSpace)return B(V,M);for(var u=V._lower,h=V.lowerCodes,m=h[0],C=M._targetLowerCodes,v=h.length,x=C.length,P=0,T=0,I=0;;){var D=m===C[T];if(D){if(oe[I++]=T,++P,P===v)break;m=h[P]}if(++T,T>=x)return ie}var P=0,G=!1,q=0,U=M._nextBeginningIndexes;U===ie&&(U=M._nextBeginningIndexes=Q(M.target));var fe=T=oe[0]===0?0:U[oe[0]-1],le=0;if(T!==x)for(;;)if(T>=x){if(P<=0||(++le,le>200))break;--P;var Oe=ke[--q];T=U[Oe]}else{var D=h[P]===C[T];if(D){if(ke[q++]=T,++P,P===v){G=!0;break}++T}else T=U[T]}var ye=M._targetLower.indexOf(u,oe[0]),Se=~ye;if(Se&&!G)for(var ae=0;ae24&&(Le*=(tt-24)*10)}Se&&(Le/=1+v*v*1),Re&&(Le/=1+v*v*1),Le-=x-v,M.score=Le;for(var ae=0;ae{for(var _=new Set,u=0,h=ie,m=0,C=V.spaceSearches,I=0;Iu)return T;h.score=u;var I=0;for(let D of _)h._indexes[I++]=D;return h._indexes.len=I,h},Y=V=>{for(var M=V.length,_=V.toLowerCase(),u=[],h=0,m=!1,C=0;C=97&&v<=122?v-97:v>=48&&v<=57?26:v<=127?30:31;h|=1<{for(var M=V.length,_=[],u=0,h=!1,m=!1,C=0;C=65&&v<=90,T=x||v>=97&&v<=122||v>=48&&v<=57,I=x&&!h||!m||!T;h=x,m=T,I&&(_[u++]=C)}return _},Q=V=>{for(var M=V.length,_=K(V),u=[],h=_[0],m=0,C=0;CC?u[C]=h:(h=_[++m],u[C]=h===void 0?M:h);return u},L=()=>{re.clear(),F.clear(),oe=[],ke=[]},re=new Map,F=new Map,oe=[],ke=[],Ye=V=>{for(var M=Pe,_=V.length,u=0;u<_;++u){var h=V[u];if(h!==ie){var m=h.score;m>M&&(M=m)}}return M===Pe?ie:M},qe=(V,M)=>{var _=V[M];if(_!==void 0)return _;var u=M;Array.isArray(M)||(u=M.split("."));for(var h=u.length,m=-1;V&&++mtypeof V=="object",xe=1/0,Pe=-xe,Qe=[];Qe.total=0;var ie=null,Tt=V=>{var M=[],_=0,u={},h=m=>{for(var C=0,v=M[C],x=1;x<_;){var T=x+1;C=x,T<_&&M[T].score>1]=M[C],x=1+(C<<1)}for(var I=C-1>>1;C>0&&v.score>1)M[C]=M[I];M[C]=v};return u.add=m=>{var C=_;M[_++]=m;for(var v=C-1>>1;C>0&&m.score>1)M[C]=M[v];M[C]=m},u.poll=m=>{if(_!==0){var C=M[0];return M[0]=M[--_],h(),C}},u.peek=m=>{if(_!==0)return M[0]},u.replaceTop=m=>{M[0]=m,h()},u},Ve=Tt();return{single:n,go:t,highlight:a,prepare:c,indexes:l,cleanup:L}})});var cn=Zr((ar,ln)=>{(function(e,n){typeof ar=="object"&&typeof ln=="object"?ln.exports=n():typeof define=="function"&&define.amd?define([],n):typeof ar=="object"?ar.Pickr=n():e.Pickr=n()})(self,function(){return(()=>{"use strict";var e={d:(_,u)=>{for(var h in u)e.o(u,h)&&!e.o(_,h)&&Object.defineProperty(_,h,{enumerable:!0,get:u[h]})},o:(_,u)=>Object.prototype.hasOwnProperty.call(_,u),r:_=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})}},n={};e.d(n,{default:()=>M});var t={};function a(_,u,h,m){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};u instanceof HTMLCollection||u instanceof NodeList?u=Array.from(u):Array.isArray(u)||(u=[u]),Array.isArray(h)||(h=[h]);for(let v of u)for(let x of h)v[_](x,m,{capture:!1,...C});return Array.prototype.slice.call(arguments,1)}e.r(t),e.d(t,{adjustableInputNumbers:()=>S,createElementFromString:()=>c,createFromTemplate:()=>f,eventPath:()=>p,off:()=>l,on:()=>i,resolveElement:()=>w});let i=a.bind(null,"addEventListener"),l=a.bind(null,"removeEventListener");function c(_){let u=document.createElement("div");return u.innerHTML=_.trim(),u.firstElementChild}function f(_){let u=(m,C)=>{let v=m.getAttribute(C);return m.removeAttribute(C),v},h=function(m){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=u(m,":obj"),x=u(m,":ref"),T=v?C[v]={}:C;x&&(C[x]=m);for(let I of Array.from(m.children)){let D=u(I,":arr"),P=h(I,D?{}:T);D&&(T[D]||(T[D]=[])).push(Object.keys(P).length?P:I)}return C};return h(c(_))}function p(_){let u=_.path||_.composedPath&&_.composedPath();if(u)return u;let h=_.target.parentElement;for(u=[_.target,h];h=h.parentElement;)u.push(h);return u.push(document,window),u}function w(_){return _ instanceof Element?_:typeof _=="string"?_.split(/>>/g).reduce((u,h,m,C)=>(u=u.querySelector(h),m1&&arguments[1]!==void 0?arguments[1]:m=>m;function h(m){let C=[.001,.01,.1][Number(m.shiftKey||2*m.ctrlKey)]*(m.deltaY<0?1:-1),v=0,x=_.selectionStart;_.value=_.value.replace(/[\d.]+/g,(T,I)=>I<=x&&I+T.length>=x?(x=I,u(Number(T),C,v)):(v++,T)),_.focus(),_.setSelectionRange(x,x),m.preventDefault(),_.dispatchEvent(new Event("input"))}i(_,"focus",()=>i(window,"wheel",h,{passive:!1})),i(_,"blur",()=>l(window,"wheel",h))}let{min:E,max:B,floor:Y,round:K}=Math;function Q(_,u,h){u/=100,h/=100;let m=Y(_=_/360*6),C=_-m,v=h*(1-u),x=h*(1-C*u),T=h*(1-(1-C)*u),I=m%6;return[255*[h,x,v,v,T,h][I],255*[T,h,h,x,v,v][I],255*[v,v,T,h,h,x][I]]}function L(_,u,h){return Q(_,u,h).map(m=>K(m).toString(16).padStart(2,"0"))}function re(_,u,h){let m=Q(_,u,h),C=m[0]/255,v=m[1]/255,x=m[2]/255,T=E(1-C,1-v,1-x);return[100*(T===1?0:(1-C-T)/(1-T)),100*(T===1?0:(1-v-T)/(1-T)),100*(T===1?0:(1-x-T)/(1-T)),100*T]}function F(_,u,h){let m=(2-(u/=100))*(h/=100)/2;return m!==0&&(u=m===1?0:m<.5?u*h/(2*m):u*h/(2-2*m)),[_,100*u,100*m]}function oe(_,u,h){let m=E(_/=255,u/=255,h/=255),C=B(_,u,h),v=C-m,x,T;if(v===0)x=T=0;else{T=v/C;let I=((C-_)/6+v/2)/v,D=((C-u)/6+v/2)/v,P=((C-h)/6+v/2)/v;_===C?x=P-D:u===C?x=1/3+I-P:h===C&&(x=2/3+D-I),x<0?x+=1:x>1&&(x-=1)}return[360*x,100*T,100*C]}function ke(_,u,h,m){return u/=100,h/=100,[...oe(255*(1-E(1,(_/=100)*(1-(m/=100))+m)),255*(1-E(1,u*(1-m)+m)),255*(1-E(1,h*(1-m)+m)))]}function Ye(_,u,h){u/=100;let m=2*(u*=(h/=100)<.5?h:1-h)/(h+u)*100,C=100*(h+u);return[_,isNaN(m)?0:m,C]}function qe(_){return oe(..._.match(/.{2}/g).map(u=>parseInt(u,16)))}function Te(_){_=_.match(/^[a-zA-Z]+$/)?function(C){if(C.toLowerCase()==="black")return"#000";let v=document.createElement("canvas").getContext("2d");return v.fillStyle=C,v.fillStyle==="#000"?null:v.fillStyle}(_):_;let u={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},h=C=>C.map(v=>/^(|\d+)\.\d+|\d+$/.test(v)?Number(v):void 0),m;e:for(let C in u){if(!(m=u[C].exec(_)))continue;let v=x=>!!m[2]==(typeof x=="number");switch(C){case"cmyk":{let[,x,T,I,D]=h(m);if(x>100||T>100||I>100||D>100)break e;return{values:ke(x,T,I,D),type:C}}case"rgba":{let[,,,x,T,I,D]=h(m);if(x>255||T>255||I>255||D<0||D>1||!v(D))break e;return{values:[...oe(x,T,I),D],a:D,type:C}}case"hexa":{let[,x]=m;x.length!==4&&x.length!==3||(x=x.split("").map(D=>D+D).join(""));let T=x.substring(0,6),I=x.substring(6);return I=I?parseInt(I,16)/255:void 0,{values:[...qe(T),I],a:I,type:C}}case"hsla":{let[,,,x,T,I,D]=h(m);if(x>360||T>100||I>100||D<0||D>1||!v(D))break e;return{values:[...Ye(x,T,I),D],a:D,type:C}}case"hsva":{let[,,,x,T,I,D]=h(m);if(x>360||T>100||I>100||D<0||D>1||!v(D))break e;return{values:[x,T,I,D],a:D,type:C}}}}return{values:null,type:null}}function xe(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,C=(x,T)=>function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;return T(~I?x.map(D=>Number(D.toFixed(I))):x)},v={h:_,s:u,v:h,a:m,toHSVA(){let x=[v.h,v.s,v.v,v.a];return x.toString=C(x,T=>`hsva(${T[0]}, ${T[1]}%, ${T[2]}%, ${v.a})`),x},toHSLA(){let x=[...F(v.h,v.s,v.v),v.a];return x.toString=C(x,T=>`hsla(${T[0]}, ${T[1]}%, ${T[2]}%, ${v.a})`),x},toRGBA(){let x=[...Q(v.h,v.s,v.v),v.a];return x.toString=C(x,T=>`rgba(${T[0]}, ${T[1]}, ${T[2]}, ${v.a})`),x},toCMYK(){let x=re(v.h,v.s,v.v);return x.toString=C(x,T=>`cmyk(${T[0]}%, ${T[1]}%, ${T[2]}%, ${T[3]}%)`),x},toHEXA(){let x=L(v.h,v.s,v.v),T=v.a>=1?"":Number((255*v.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return T&&x.push(T),x.toString=()=>`#${x.join("").toUpperCase()}`,x},clone:()=>xe(v.h,v.s,v.v,v.a)};return v}let Pe=_=>Math.max(Math.min(_,1),0);function Qe(_){let u={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},_),_keyboard(v){let{options:x}=u,{type:T,key:I}=v;if(document.activeElement===x.wrapper){let{lock:D}=u.options,P=I==="ArrowUp",G=I==="ArrowRight",q=I==="ArrowDown",U=I==="ArrowLeft";if(T==="keydown"&&(P||G||q||U)){let fe=0,le=0;D==="v"?fe=P||G?1:-1:D==="h"?fe=P||G?-1:1:(le=P?-1:q?1:0,fe=U?-1:G?1:0),u.update(Pe(u.cache.x+.01*fe),Pe(u.cache.y+.01*le)),v.preventDefault()}else I.startsWith("Arrow")&&(u.options.onstop(),v.preventDefault())}},_tapstart(v){i(document,["mouseup","touchend","touchcancel"],u._tapstop),i(document,["mousemove","touchmove"],u._tapmove),v.cancelable&&v.preventDefault(),u._tapmove(v)},_tapmove(v){let{options:x,cache:T}=u,{lock:I,element:D,wrapper:P}=x,G=P.getBoundingClientRect(),q=0,U=0;if(v){let Oe=v&&v.touches&&v.touches[0];q=v?(Oe||v).clientX:0,U=v?(Oe||v).clientY:0,qG.left+G.width&&(q=G.left+G.width),UG.top+G.height&&(U=G.top+G.height),q-=G.left,U-=G.top}else T&&(q=T.x*G.width,U=T.y*G.height);I!=="h"&&(D.style.left=`calc(${q/G.width*100}% - ${D.offsetWidth/2}px)`),I!=="v"&&(D.style.top=`calc(${U/G.height*100}% - ${D.offsetHeight/2}px)`),u.cache={x:q/G.width,y:U/G.height};let fe=Pe(q/G.width),le=Pe(U/G.height);switch(I){case"v":return x.onchange(fe);case"h":return x.onchange(le);default:return x.onchange(fe,le)}},_tapstop(){u.options.onstop(),l(document,["mouseup","touchend","touchcancel"],u._tapstop),l(document,["mousemove","touchmove"],u._tapmove)},trigger(){u._tapmove()},update(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,{left:T,top:I,width:D,height:P}=u.options.wrapper.getBoundingClientRect();u.options.lock==="h"&&(x=v),u._tapmove({clientX:T+D*v,clientY:I+P*x})},destroy(){let{options:v,_tapstart:x,_keyboard:T}=u;l(document,["keydown","keyup"],T),l([v.wrapper,v.element],"mousedown",x),l([v.wrapper,v.element],"touchstart",x,{passive:!1})}},{options:h,_tapstart:m,_keyboard:C}=u;return i([h.wrapper,h.element],"mousedown",m),i([h.wrapper,h.element],"touchstart",m,{passive:!1}),i(document,["keydown","keyup"],C),u}function ie(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_=Object.assign({onchange:()=>0,className:"",elements:[]},_);let u=i(_.elements,"click",h=>{_.elements.forEach(m=>m.classList[h.target===m?"add":"remove"](_.className)),_.onchange(h),h.stopPropagation()});return{destroy:()=>l(...u)}}let Tt={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8},Ve=(_,u,h)=>{let{container:m,margin:C,position:v,variantFlipOrder:x,positionFlipOrder:T}={container:document.documentElement.getBoundingClientRect(),...Tt,...h},{left:I,top:D}=u.style;u.style.left="0",u.style.top="0";let P=_.getBoundingClientRect(),G=u.getBoundingClientRect(),q={t:P.top-G.height-C,b:P.bottom+C,r:P.right+C,l:P.left-G.width-C},U={vs:P.left,vm:P.left+P.width/2+-G.width/2,ve:P.left+P.width-G.width,hs:P.top,hm:P.bottom-P.height/2-G.height/2,he:P.bottom-G.height},[fe,le="middle"]=v.split("-"),Oe=T[fe],ye=x[le],{top:Se,left:ae,bottom:Re,right:_e}=m;for(let Ke of Oe){let Le=Ke==="t"||Ke==="b",et=q[Ke],[gt,tt]=Le?["top","left"]:["left","top"],[Ar,kr]=Le?[G.height,G.width]:[G.width,G.height],[Tr,Lr]=Le?[Re,_e]:[_e,Re],[Mr,Ir]=Le?[Se,ae]:[ae,Se];if(!(etTr))for(let jt of ye){let Lt=U[(Le?"v":"h")+jt];if(!(LtLr))return u.style[tt]=Lt-G[tt]+"px",u.style[gt]=et-G[gt]+"px",Ke+jt}}return u.style.left=I,u.style.top=D,null};function V(_,u,h){return u in _?Object.defineProperty(_,u,{value:h,enumerable:!0,configurable:!0,writable:!0}):_[u]=h,_}class M{constructor(u){V(this,"_initializingActive",!0),V(this,"_recalc",!0),V(this,"_nanopop",null),V(this,"_root",null),V(this,"_color",xe()),V(this,"_lastColor",xe()),V(this,"_swatchColors",[]),V(this,"_setupAnimationFrame",null),V(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=u=Object.assign({...M.DEFAULT_OPTIONS},u);let{swatches:h,components:m,theme:C,sliders:v,lockOpacity:x,padding:T}=u;["nano","monolith"].includes(C)&&!v&&(u.sliders="h"),m.interaction||(m.interaction={});let{preview:I,opacity:D,hue:P,palette:G}=m;m.opacity=!x&&D,m.palette=G||I||D||P,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),h&&h.length&&h.forEach(le=>this.addSwatch(le));let{button:q,app:U}=this._root;this._nanopop=((le,Oe,ye)=>{let Se=typeof le!="object"||le instanceof HTMLElement?{reference:le,popper:Oe,...ye}:le;return{update(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Se,{reference:Re,popper:_e}=Object.assign(Se,ae);if(!_e||!Re)throw new Error("Popper- or reference-element missing.");return Ve(Re,_e,Se)}}})(q,U,{margin:T}),q.setAttribute("role","button"),q.setAttribute("aria-label",this._t("btn:toggle"));let fe=this;this._setupAnimationFrame=requestAnimationFrame(function le(){if(!U.offsetWidth)return fe._setupAnimationFrame=requestAnimationFrame(le);fe.setColor(u.default),fe._rePositioningPicker(),u.defaultRepresentation&&(fe._representation=u.defaultRepresentation,fe.setColorRepresentation(fe._representation)),u.showAlways&&fe.show(),fe._initializingActive=!1,fe._emit("init")})}_preBuild(){let{options:u}=this;for(let h of["el","container"])u[h]=w(u[h]);this._root=(h=>{let{components:m,useAsButton:C,inline:v,appClass:x,theme:T,lockOpacity:I}=h.options,D=U=>U?"":'style="display:none" hidden',P=U=>h._t(U),G=f(`
+