ipsumify 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,386 @@
1
1
 
2
- // node_modules/marked/lib/marked.esm.js
3
- function M() {
4
- return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
2
+ // data/themes.ts
3
+ var themes = [
4
+ {
5
+ id: "lorem",
6
+ label: "Lorem Ipsum",
7
+ icon: "i-lucide-scroll-text",
8
+ paragraphs: [
9
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.",
10
+ "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.",
11
+ "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis.",
12
+ "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.",
13
+ "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt.",
14
+ "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias.",
15
+ "Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est.",
16
+ "Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.",
17
+ "Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.",
18
+ "Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur."
19
+ ],
20
+ headings: [
21
+ "Overview",
22
+ "Introduction",
23
+ "Summary",
24
+ "Details",
25
+ "Features",
26
+ "Usage",
27
+ "Examples",
28
+ "Notes",
29
+ "Lorem Ipsum",
30
+ "Dolor Sit Amet",
31
+ "Getting Started",
32
+ "Key Concepts",
33
+ "Best Practices",
34
+ "Common Patterns",
35
+ "Quick Reference",
36
+ "Consectetur Adipiscing Elit",
37
+ "Sed Do Eiusmod Tempor",
38
+ "Understanding the Basics",
39
+ "Advanced Configuration Options",
40
+ "Working with Components",
41
+ "Implementation Guidelines",
42
+ "Troubleshooting Common Issues",
43
+ "Performance Optimization Tips"
44
+ ],
45
+ listItems: ["Item one", "Item two", "Item three"]
46
+ },
47
+ {
48
+ id: "dog",
49
+ label: "Dog-em Ipsum",
50
+ icon: "i-lucide-dog",
51
+ paragraphs: [
52
+ "Canis familiaris borkus maximus, Labrador retrievus golden floofen. Corgi pembrokius welshii adorabilis, Shiba inu doge originalis. Vizsla hungaricus pointer nobilum, Weimaraner grayus ghosticus elegantum.",
53
+ "Pomeranian spitzus flooficus, Papillon butterflii earus magnificus. Basenji barklessum africanum, Akita inuus loyalis protectum. Samoyed cloudus whiteum smilius, Malamute alaskanus pullum sledicus.",
54
+ "Beagle snoopicus howlii detectivum, Basset houndus droopii earus longum. Dachshund wienerii tunnelus shortlegum, Bloodhound trackerii scentus supremum. Borzoi russianus speedii elegantus.",
55
+ "Schnauzer beardicus germanium miniatus, Affenpinscher monkii terrius scruffum. Keeshond dutchii floofium grayus, Schipperke belgicus blackus smallum. Leonberger giantus goldenii gentleum.",
56
+ "Cavalier kingus spanielii heartum, Havanese cubanensis silkii lapus. Maltese whiteus ancienti nobleum, Bichon friseum powderii puffus. Shih tzu lionus chrysanthemum flowen.",
57
+ "Doberman pinscherii guardus athleticus, Rottweiler romanum driverii strongum. Boxer playfulis musculus goofium, German shepherdii loyalis intelligentum. Mastiff enormicus gentleum giantus.",
58
+ "Husky sibericus blueeyes pullum, Bernese mountainus tricolorus sweetum. Newfoundland waterus rescuii giantum, Saint Bernard alpinus rescuii barrelum. Great Dane apollous tallestum dogicus.",
59
+ "Poodle standardus curlius smarticum, Goldendoodle hybridicus floofium allergii. Labradoodle crossii friendlius serviceum, Cockapoo mixus adorablis cuddleum. Maltipoo tinicus fluffium lapsum.",
60
+ "Bulldog englishum wrinklii stockium, Frenchie batears snortius compactum. Pug wrinklorum snorticus curlytailus, Boston terrier tuxedous gentlemanicum. Boxer wiggleum excitus playfulium.",
61
+ "Terrier spiritus feistii braveum, Yorkshire tinicus silkii bluetan. Jack Russell energius boundlessum zoomii, Westie whiteum scottius cheerfulem. Airedale kingus terrierii largestum."
62
+ ],
63
+ headings: [
64
+ "Woof",
65
+ "Good Boy",
66
+ "Fetch Time",
67
+ "Treats",
68
+ "Walkies",
69
+ "Zoomies",
70
+ "Snoot Boops",
71
+ "Belly Rubs",
72
+ "The Pack Life",
73
+ "Puppy Love",
74
+ "Tail Wagging Tales",
75
+ "Bark Park Adventures",
76
+ "Loyal Companions",
77
+ "Paw Patrol",
78
+ "Furry Friends Forever",
79
+ "The Art of the Fetch",
80
+ "Mastering Puppy Eyes",
81
+ "Advanced Treat Negotiations",
82
+ "Squirrel Watching 101",
83
+ "Nap Time Strategies",
84
+ "The Perfect Belly Rub",
85
+ "Mailman Alertness Training",
86
+ "Ultimate Zoomie Techniques"
87
+ ],
88
+ listItems: ["Woof woof", "Bark bark", "Good boy"]
89
+ },
90
+ {
91
+ id: "cat",
92
+ label: "Cat-em Ipsum",
93
+ icon: "i-lucide-cat",
94
+ paragraphs: [
95
+ "Felis catus purrensis maximus, Siamese vocalius blueeyes pointum. Abyssinian tickedus wildii ancienti, Persian flooficum flatfaceus luxurium. Maine Coon giantus gentleus tuftedum earus.",
96
+ "Ragdoll floppicus docilum blueum, Birman sacredus burmanis mittenii. Tonkinese aquaeus mixicum sociablis, Burmese musculus sableum voicium. Balinese longhairus siamicum gracilum.",
97
+ "Russian Blue grayus plushicum shyus, Chartreux frenchii smileum quietum. Korat silverii thailandus luckium, British Shorthair chonkus roundii calmicum. Scottish Fold earfoldus sweetium.",
98
+ "Sphynx hairlessum warmicus wrinkleum, Peterbald elegantus russianum baldicum. Devon Rex elficus curlium pixius, Cornish Rex wavycoatum slenderum playfulem. Oriental sleekus largeearus vocalem.",
99
+ "Bengal leopardicus wildii glitterum, Savannah tallestus africanicum servalum. Ocicat spotticum domesticus wildlookum, Egyptian Mau ancienti spottium fastestum. Toyger stripedus tigerium miniatum.",
100
+ "Norwegian Forest flufficus vikingii waterproofum, Siberian hypoallergicus russianum forestii. Nebelung longhairum grayplushum rareum, Turkish Van swimmicus vanum patternum. Somali foxii longhairus tickedum.",
101
+ "Himalayan persicum pointus fluffium, Exotic Shorthair teddybearum calmicus. Ragamuffin largeum sweeticus docilum, Selkirk Rex curlycoatum sheepii patientum. LaPerm curlicus wavium uniqueum.",
102
+ "Manx taillessum islandicus roundum, Japanese Bobtail pompomii luckyus ancienti. Cymric longhairus manxicum floofem, American Bobtail wildlookum bobbium friendlius. Pixie-Bob polydactylum largeus.",
103
+ "Singapura smallestum draincat sepiatum, Havana Brown chocolatum greeneyeum sleekus. Bombay pantherii blackus coppereyeum, Burmilla shimmeryum silverii gentleum. Chausie jungleum hybridicus athletum.",
104
+ "Turkish Angora ancienti elegantum silkium, Javanese colorpointum longhairum vocalem. Snowshoe pointicum mittenus blueeyes, Khao Manee diamondeyeum whiteum raricum. Lykoi werewolfii partialum hairlessum."
105
+ ],
106
+ headings: [
107
+ "Meow",
108
+ "Purr Life",
109
+ "Nap Time",
110
+ "Judgment",
111
+ "Treats Now",
112
+ "Box Fort",
113
+ "Zoomies",
114
+ "Worship",
115
+ "Feline Royalty",
116
+ "The Art of Napping",
117
+ "Sunbeam Seeking",
118
+ "Human Training",
119
+ "Cardboard Castles",
120
+ "Mysterious Ways",
121
+ "Graceful Hunters",
122
+ "Mastering the Slow Blink",
123
+ "Advanced Ankle Weaving",
124
+ "Strategic Hairball Placement",
125
+ "Window Bird Theater",
126
+ "Midnight Zoomie Protocol",
127
+ "Perfecting the Judgmental Stare",
128
+ "Keyboard Sitting Techniques",
129
+ "The Unwritten Laws of If It Fits"
130
+ ],
131
+ listItems: ["Meow meow", "Purr purr", "Feed me now"]
132
+ },
133
+ {
134
+ id: "baked",
135
+ label: "Baked-em Ipsum",
136
+ icon: "i-lucide-croissant",
137
+ paragraphs: [
138
+ "Brioche enrichum butteratum, p\xE2te feuillet\xE9e laminatum croissantus. G\xE9noise spongicum lightus, mille-feuille layerus crispatum. Baguette croustillant scoreum, pain de campagne rusticorum artisanum.",
139
+ "Kouign-amann caramelus buttericum bretonnium, canel\xE9 bordelais crustatum custardum. Financier almondium brownbutterum, madeleine shellicus proustium. P\xE2te \xE0 choux profiterolum \xE9clairum.",
140
+ "Challah braidicum enrichum eggyatum, babka swirlius chocolatum cinnamonum. Panettone milanensis fruiticum domeus, stollen germanicum marzipanum powderus. Pandoro starshapum goldenum veronensis.",
141
+ "Fougasse proven\xE7alum olivatum herbus, focaccia italicum dimpledus rosmarinum. Ciabatta slipperum holeum crustycrumbum, grissini stickum thinicum crispus. Pane pugliese durumwheaticum semolinum.",
142
+ "Tarte tatin caramelum inversus appleum, galette rusticorum freeformum buttercrust. Clafoutis cherrium custardum limousinum, far breton pruneatum densium. G\xE2teau basque creamfilledus almondcrust.",
143
+ "Viennoiserie butteratum laminum, pain au chocolat croissantdoughum. Chausson aux pommes appleturnoverum, palmier elephantearus sugarcrispum. Brioche feuillet\xE9e hybridium richum.",
144
+ "Sachertorte viennensis chocolatum apricotglazeum, schwarzw\xE4lder kirschtorte cherryum creamum. Dobos torta hungaricum carameltopum layerus, esterh\xE1zy walnuttum buttercreamus. Linzer torte latticum raspberryjam.",
145
+ "Sfogliatella napoletanum shellicum ricottafillum, cassata siciliana marzipanum candiedfruitum. Cannoli tubicum crispum sweetricottum, zeppole choux friedum creamtoppum. Baba au rhum yeastcakem syrupsoakum.",
146
+ "Cr\xE8me p\xE2tissi\xE8re vanillum custardum pipeum, frangipane almondcreamum tartfillingus. Cr\xE9meux smoothum richicum glossyum, ganache chocolatum creaminfusum. Buttercream swissum italicum frenchum.",
147
+ "Levain naturalum yeastium starterus, poolish prefermentum frenchium hydrateum. Biga italicum stiffum flavordevlopum, tangzhong asianicum waterroux softicum. Autolyse restum hydrateum glutenum."
148
+ ],
149
+ headings: [
150
+ "Fresh",
151
+ "Golden",
152
+ "Flaky",
153
+ "Sweet",
154
+ "Crusty",
155
+ "Doughy",
156
+ "Baked",
157
+ "Yummy",
158
+ "From the Oven",
159
+ "Rise and Shine",
160
+ "Butter Makes Better",
161
+ "Sugar and Spice",
162
+ "Crust Perfection",
163
+ "The Proof is Rising",
164
+ "Flour Power",
165
+ "The Art of Lamination",
166
+ "Mastering Sourdough Starters",
167
+ "Perfect Pie Crust Techniques",
168
+ "Croissant Folding Guide",
169
+ "Cookie Science Explained",
170
+ "Bread Scoring Patterns",
171
+ "Frosting and Decorating Tips",
172
+ "The Magic of Fermentation"
173
+ ],
174
+ listItems: ["Yum yum", "So tasty", "Freshly baked"]
175
+ },
176
+ {
177
+ id: "bbq",
178
+ label: "BBQ-em Ipsum",
179
+ icon: "i-lucide-flame",
180
+ paragraphs: [
181
+ "Brisketum pectoralis slowcookum, puntum deckle fattium marbleum. Hickorium quercus mesquitum pecanwood, fumum aromatus carbonis ignum. Pitmasterus tendum focum, temperaturum constantus duecentum.",
182
+ "Costae spareum backribus, sancti ludovici trimatum neaticus. Fricatum paprikum sugarbrownum, allium cuminatum piperum salum. Involvum chartapaper foilum, requiem sliceum servum.",
183
+ "Porcus pullum shoulderum, forkum tenderum shredicus altum. Carolina acetum mustardus, Kansas Civitas dulcis crassum. Coleslavium pickledus panisalbus, proprium plateum completum.",
184
+ "Brisketum planum puntum totum, pinguem capsum updownum debatum. Fumus annulus roseum halum, probatum technicum igneum. Sectum contra granum semper, humidus macer finibus ustum.",
185
+ "Finibus ustum dulcis carneum, caramelum cubum iactum salsamentum. Puntum separatum cubum, revertum fumatorium horam plus. Crispum marginibus tenerum centrum, pitmasterus praemium meritum.",
186
+ "Farciminis nexum calidus intestinum, crepitus tegumen sucus eruptum. Bubulum porcinum mixtum conditum, fumum iuxta praecipuum sectum. Obliquum servum superbus, sinapis optionalum acceptum.",
187
+ "Pullum femur quartum totum, pellis crispum carnem sucum. Alabama salsamentum album, acetum Carolina moppum stylum. Tractum fumatum grillum optiones, gallinaceum rectum bonum.",
188
+ "Fricatum siccum pasta humidum, pernoctem frigidarium marinatum requiem. Sal piper simplex Texanum, complexum Memphis mixtum secretum. Applicare generosum aequum tegmen, cortex formatur pulchre.",
189
+ "Lateribus fabae coleslavium paniscornum, caseum macaroni salatum tuberosum. Pickledus cepae jalape\xF1us, panisalbus butyrum sectum. Completum plateum aequilibratum prandium, carneum stella lateribus sustentum.",
190
+ "Fumus surgit caminus ascendit, linea formatur mane fidelis. Venditum signum timendum, mane avis obtinet carneum. Dignum omnis expectatio minutum, pitmasterus ars respectum."
191
+ ],
192
+ headings: [
193
+ "Smoked",
194
+ "Low and Slow",
195
+ "The Pit",
196
+ "Fire",
197
+ "Bark",
198
+ "Rub",
199
+ "Sauce",
200
+ "Tender",
201
+ "Pitmaster Wisdom",
202
+ "Smoke Ring Secrets",
203
+ "Brisket Basics",
204
+ "Rib Techniques",
205
+ "Regional Styles",
206
+ "Wood Selection",
207
+ "Temperature Control",
208
+ "The Art of the Smoke",
209
+ "Building the Perfect Fire",
210
+ "Mastering the Meat Sweats",
211
+ "Competition BBQ Secrets",
212
+ "Sauce Versus Dry Rub",
213
+ "Choosing Your Wood",
214
+ "The Overnight Cook",
215
+ "From Pit to Plate"
216
+ ],
217
+ listItems: ["Smoky goodness", "Fall off the bone", "Worth the wait"]
218
+ }
219
+ ];
220
+
221
+ // utils/random.ts
222
+ var LCPRNG_MULTIPLIER = 9301;
223
+ var LCPRNG_INCREMENT = 49297;
224
+ var LCPRNG_MODULUS = 233280;
225
+ var MAX_SEED = 2147483647;
226
+ function normalizeSeed(seedValue) {
227
+ if (!Number.isFinite(seedValue)) return 0;
228
+ const whole = Math.trunc(seedValue);
229
+ return (whole % LCPRNG_MODULUS + LCPRNG_MODULUS) % LCPRNG_MODULUS;
5
230
  }
6
- var O = M();
7
- function G(u3) {
8
- O = u3;
231
+ var SEED_PERIOD = LCPRNG_MODULUS;
232
+ var SEED_OFFSETS = {
233
+ HEADINGS: 500,
234
+ BLOCK_SIZES: 1e3
235
+ };
236
+ function seededRandom(seedValue) {
237
+ let currentSeed = normalizeSeed(seedValue);
238
+ return {
239
+ next: () => {
240
+ currentSeed = (currentSeed * LCPRNG_MULTIPLIER + LCPRNG_INCREMENT) % LCPRNG_MODULUS;
241
+ return currentSeed / LCPRNG_MODULUS;
242
+ },
243
+ nextInt: (min, max) => {
244
+ currentSeed = (currentSeed * LCPRNG_MULTIPLIER + LCPRNG_INCREMENT) % LCPRNG_MODULUS;
245
+ return Math.floor(currentSeed / LCPRNG_MODULUS * (max - min + 1)) + min;
246
+ }
247
+ };
9
248
  }
10
- var _ = { exec: () => null };
11
- function k(u3, e = "") {
12
- let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
13
- let s = typeof i == "string" ? i : i.source;
14
- return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
249
+ function shuffleWithSeed(array, seedValue) {
250
+ const shuffled = [...array];
251
+ const rng = seededRandom(seedValue);
252
+ for (let i = shuffled.length - 1; i > 0; i--) {
253
+ const j2 = Math.floor(rng.next() * (i + 1));
254
+ const temp = shuffled[i];
255
+ shuffled[i] = shuffled[j2];
256
+ shuffled[j2] = temp;
257
+ }
258
+ return shuffled;
259
+ }
260
+
261
+ // utils/generate.ts
262
+ function generate(params) {
263
+ const { theme, blocks, seed, options } = params;
264
+ const paragraphs2 = shuffleWithSeed(theme.paragraphs, seed);
265
+ const headings = shuffleWithSeed(theme.headings, seed + SEED_OFFSETS.HEADINGS);
266
+ const listItems = theme.listItems;
267
+ const rng = seededRandom(seed + SEED_OFFSETS.BLOCK_SIZES);
268
+ const blockSeparator = options.noWrap ? " " : "\n\n";
269
+ const bodyBlocks = [];
270
+ let output = "";
271
+ let paragraphIndex = 0;
272
+ let headingIndex = 0;
273
+ let currentHeadingLevel = 1;
274
+ let blocksUntilNextHeading = 0;
275
+ const getNextHeading = () => {
276
+ const text = headings[headingIndex % headings.length] ?? "Section";
277
+ headingIndex++;
278
+ return options.capitalize ? text : text.toLowerCase();
279
+ };
280
+ const makeHeading = (level, text) => {
281
+ const hashes = "#".repeat(level);
282
+ if (options.noWrap) {
283
+ return `${hashes} ${text} `;
284
+ }
285
+ return `${hashes} ${text}
286
+
287
+ `;
288
+ };
289
+ for (let i = 0; i < blocks; i++) {
290
+ const blockSize = rng.nextInt(1, 3);
291
+ let blockContent = "";
292
+ for (let j2 = 0; j2 < blockSize; j2++) {
293
+ const rawSentence = paragraphs2[paragraphIndex % paragraphs2.length] ?? "";
294
+ paragraphIndex++;
295
+ const sentence = options.capitalize ? rawSentence : rawSentence.toLowerCase();
296
+ blockContent += sentence + " ";
297
+ }
298
+ blockContent = blockContent.trim();
299
+ bodyBlocks.push(blockContent);
300
+ if (options.headers) {
301
+ if (i === 0) {
302
+ output += makeHeading(1, getNextHeading());
303
+ currentHeadingLevel = 2;
304
+ blocksUntilNextHeading = rng.nextInt(1, 3);
305
+ } else if (blocksUntilNextHeading <= 0) {
306
+ const decision = rng.nextInt(1, 10);
307
+ if (decision <= 3 && currentHeadingLevel < 4) {
308
+ currentHeadingLevel++;
309
+ } else if (decision <= 5 && currentHeadingLevel > 2) {
310
+ currentHeadingLevel--;
311
+ } else if (decision <= 7 && currentHeadingLevel > 2) {
312
+ currentHeadingLevel = 2;
313
+ }
314
+ output += makeHeading(currentHeadingLevel, getNextHeading());
315
+ blocksUntilNextHeading = rng.nextInt(1, 4);
316
+ } else {
317
+ blocksUntilNextHeading--;
318
+ }
319
+ }
320
+ if (options.codeSnippets && i % 3 === 0) {
321
+ if (options.noWrap) {
322
+ output += "`const example = 'code';` ";
323
+ } else {
324
+ output += "```javascript\nconst example = 'code';\n```\n\n";
325
+ }
326
+ }
327
+ if (options.blockquotes && i % 2 === 1) {
328
+ if (options.noWrap) {
329
+ output += `> ${blockContent.slice(0, 100)}... `;
330
+ } else {
331
+ output += `> ${blockContent.slice(0, 100)}...
332
+
333
+ `;
334
+ }
335
+ }
336
+ if (options.lists && i % 3 === 2) {
337
+ if (options.noWrap) {
338
+ const items = listItems.map((item) => `\u2022 ${options.capitalize ? item : item.toLowerCase()}`).join(" ");
339
+ output += items + " ";
340
+ } else {
341
+ const items = listItems.map((item) => `- ${options.capitalize ? item : item.toLowerCase()}`).join("\n");
342
+ output += items + "\n\n";
343
+ }
344
+ }
345
+ if (options.links && i % 4 === 0) {
346
+ const linkText = options.capitalize ? "Learn more" : "learn more";
347
+ output += `[${linkText}](https://example.com) `;
348
+ }
349
+ output += blockContent + blockSeparator;
350
+ }
351
+ if (options.noWrap) {
352
+ output = output.replace(/<br\s*\/?>/gi, " ");
353
+ output = output.replace(/\n+/g, " ");
354
+ output = output.replace(/\s+/g, " ");
355
+ output = output.trim();
356
+ } else if (output.endsWith("\n\n")) {
357
+ output = output.slice(0, -2);
358
+ }
359
+ return { text: output, blocks: bodyBlocks };
360
+ }
361
+ function generateText(params) {
362
+ return generate(params).text;
363
+ }
364
+ function generateBlocks(params) {
365
+ return generate(params).blocks;
366
+ }
367
+ function markdownToPlainText(markdown) {
368
+ return markdown.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, "").replace(/(^|\s)#{1,6}[ \t]+/g, "$1").replace(/(^|\s)>[ \t]+/g, "$1").replace(/(^|\s)[-*•][ \t]+/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/[ \t]{2,}/g, " ").replace(/\n{3,}/g, "\n\n").trim();
369
+ }
370
+
371
+ // node_modules/marked/lib/marked.esm.js
372
+ function M() {
373
+ return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
374
+ }
375
+ var O = M();
376
+ function G(u3) {
377
+ O = u3;
378
+ }
379
+ var _ = { exec: () => null };
380
+ function k(u3, e = "") {
381
+ let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
382
+ let s = typeof i == "string" ? i : i.source;
383
+ return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
15
384
  }, getRegex: () => new RegExp(t, e) };
16
385
  return n;
17
386
  }
@@ -821,759 +1190,397 @@ var $ = class {
821
1190
  text({ text: e }) {
822
1191
  return e;
823
1192
  }
824
- link({ text: e }) {
825
- return "" + e;
826
- }
827
- image({ text: e }) {
828
- return "" + e;
829
- }
830
- br() {
831
- return "";
832
- }
833
- checkbox({ raw: e }) {
834
- return e;
835
- }
836
- };
837
- var b = class u2 {
838
- options;
839
- renderer;
840
- textRenderer;
841
- constructor(e) {
842
- this.options = e || O, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
843
- }
844
- static parse(e, t) {
845
- return new u2(t).parse(e);
846
- }
847
- static parseInline(e, t) {
848
- return new u2(t).parseInline(e);
849
- }
850
- parse(e) {
851
- this.renderer.parser = this;
852
- let t = "";
853
- for (let n = 0; n < e.length; n++) {
854
- let r = e[n];
855
- if (this.options.extensions?.renderers?.[r.type]) {
856
- let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
857
- if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
858
- t += a || "";
859
- continue;
860
- }
861
- }
862
- let i = r;
863
- switch (i.type) {
864
- case "space": {
865
- t += this.renderer.space(i);
866
- break;
867
- }
868
- case "hr": {
869
- t += this.renderer.hr(i);
870
- break;
871
- }
872
- case "heading": {
873
- t += this.renderer.heading(i);
874
- break;
875
- }
876
- case "code": {
877
- t += this.renderer.code(i);
878
- break;
879
- }
880
- case "table": {
881
- t += this.renderer.table(i);
882
- break;
883
- }
884
- case "blockquote": {
885
- t += this.renderer.blockquote(i);
886
- break;
887
- }
888
- case "list": {
889
- t += this.renderer.list(i);
890
- break;
891
- }
892
- case "checkbox": {
893
- t += this.renderer.checkbox(i);
894
- break;
895
- }
896
- case "html": {
897
- t += this.renderer.html(i);
898
- break;
899
- }
900
- case "def": {
901
- t += this.renderer.def(i);
902
- break;
903
- }
904
- case "paragraph": {
905
- t += this.renderer.paragraph(i);
906
- break;
907
- }
908
- case "text": {
909
- t += this.renderer.text(i);
910
- break;
911
- }
912
- default: {
913
- let s = 'Token with "' + i.type + '" type was not found.';
914
- if (this.options.silent) return console.error(s), "";
915
- throw new Error(s);
916
- }
917
- }
918
- }
919
- return t;
920
- }
921
- parseInline(e, t = this.renderer) {
922
- this.renderer.parser = this;
923
- let n = "";
924
- for (let r = 0; r < e.length; r++) {
925
- let i = e[r];
926
- if (this.options.extensions?.renderers?.[i.type]) {
927
- let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
928
- if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
929
- n += a || "";
930
- continue;
931
- }
932
- }
933
- let s = i;
934
- switch (s.type) {
935
- case "escape": {
936
- n += t.text(s);
937
- break;
938
- }
939
- case "html": {
940
- n += t.html(s);
941
- break;
942
- }
943
- case "link": {
944
- n += t.link(s);
945
- break;
946
- }
947
- case "image": {
948
- n += t.image(s);
949
- break;
950
- }
951
- case "checkbox": {
952
- n += t.checkbox(s);
953
- break;
954
- }
955
- case "strong": {
956
- n += t.strong(s);
957
- break;
958
- }
959
- case "em": {
960
- n += t.em(s);
961
- break;
962
- }
963
- case "codespan": {
964
- n += t.codespan(s);
965
- break;
966
- }
967
- case "br": {
968
- n += t.br(s);
969
- break;
970
- }
971
- case "del": {
972
- n += t.del(s);
973
- break;
974
- }
975
- case "text": {
976
- n += t.text(s);
977
- break;
978
- }
979
- default: {
980
- let a = 'Token with "' + s.type + '" type was not found.';
981
- if (this.options.silent) return console.error(a), "";
982
- throw new Error(a);
983
- }
984
- }
985
- }
986
- return n;
987
- }
988
- };
989
- var P = class {
990
- options;
991
- block;
992
- constructor(e) {
993
- this.options = e || O;
994
- }
995
- static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
996
- static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
997
- preprocess(e) {
998
- return e;
999
- }
1000
- postprocess(e) {
1001
- return e;
1002
- }
1003
- processAllTokens(e) {
1004
- return e;
1005
- }
1006
- emStrongMask(e) {
1007
- return e;
1008
- }
1009
- provideLexer(e = this.block) {
1010
- return e ? x.lex : x.lexInline;
1011
- }
1012
- provideParser(e = this.block) {
1013
- return e ? b.parse : b.parseInline;
1014
- }
1015
- };
1016
- var D = class {
1017
- defaults = M();
1018
- options = this.setOptions;
1019
- parse = this.parseMarkdown(true);
1020
- parseInline = this.parseMarkdown(false);
1021
- Parser = b;
1022
- Renderer = y;
1023
- TextRenderer = $;
1024
- Lexer = x;
1025
- Tokenizer = w;
1026
- Hooks = P;
1027
- constructor(...e) {
1028
- this.use(...e);
1029
- }
1030
- walkTokens(e, t) {
1031
- let n = [];
1032
- for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1033
- case "table": {
1034
- let i = r;
1035
- for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
1036
- for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
1037
- break;
1038
- }
1039
- case "list": {
1040
- let i = r;
1041
- n = n.concat(this.walkTokens(i.items, t));
1042
- break;
1043
- }
1044
- default: {
1045
- let i = r;
1046
- this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1047
- let a = i[s].flat(1 / 0);
1048
- n = n.concat(this.walkTokens(a, t));
1049
- }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
1050
- }
1051
- }
1052
- return n;
1053
- }
1054
- use(...e) {
1055
- let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
1056
- return e.forEach((n) => {
1057
- let r = { ...n };
1058
- if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
1059
- if (!i.name) throw new Error("extension name required");
1060
- if ("renderer" in i) {
1061
- let s = t.renderers[i.name];
1062
- s ? t.renderers[i.name] = function(...a) {
1063
- let o = i.renderer.apply(this, a);
1064
- return o === false && (o = s.apply(this, a)), o;
1065
- } : t.renderers[i.name] = i.renderer;
1066
- }
1067
- if ("tokenizer" in i) {
1068
- if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1069
- let s = t[i.level];
1070
- s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1071
- }
1072
- "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1073
- }), r.extensions = t), n.renderer) {
1074
- let i = this.defaults.renderer || new y(this.defaults);
1075
- for (let s in n.renderer) {
1076
- if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1077
- if (["options", "parser"].includes(s)) continue;
1078
- let a = s, o = n.renderer[a], l = i[a];
1079
- i[a] = (...p) => {
1080
- let c = o.apply(i, p);
1081
- return c === false && (c = l.apply(i, p)), c || "";
1082
- };
1083
- }
1084
- r.renderer = i;
1085
- }
1086
- if (n.tokenizer) {
1087
- let i = this.defaults.tokenizer || new w(this.defaults);
1088
- for (let s in n.tokenizer) {
1089
- if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1090
- if (["options", "rules", "lexer"].includes(s)) continue;
1091
- let a = s, o = n.tokenizer[a], l = i[a];
1092
- i[a] = (...p) => {
1093
- let c = o.apply(i, p);
1094
- return c === false && (c = l.apply(i, p)), c;
1095
- };
1096
- }
1097
- r.tokenizer = i;
1098
- }
1099
- if (n.hooks) {
1100
- let i = this.defaults.hooks || new P();
1101
- for (let s in n.hooks) {
1102
- if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1103
- if (["options", "block"].includes(s)) continue;
1104
- let a = s, o = n.hooks[a], l = i[a];
1105
- P.passThroughHooks.has(s) ? i[a] = (p) => {
1106
- if (this.defaults.async && P.passThroughHooksRespectAsync.has(s)) return (async () => {
1107
- let d = await o.call(i, p);
1108
- return l.call(i, d);
1109
- })();
1110
- let c = o.call(i, p);
1111
- return l.call(i, c);
1112
- } : i[a] = (...p) => {
1113
- if (this.defaults.async) return (async () => {
1114
- let d = await o.apply(i, p);
1115
- return d === false && (d = await l.apply(i, p)), d;
1116
- })();
1117
- let c = o.apply(i, p);
1118
- return c === false && (c = l.apply(i, p)), c;
1119
- };
1120
- }
1121
- r.hooks = i;
1122
- }
1123
- if (n.walkTokens) {
1124
- let i = this.defaults.walkTokens, s = n.walkTokens;
1125
- r.walkTokens = function(a) {
1126
- let o = [];
1127
- return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1128
- };
1129
- }
1130
- this.defaults = { ...this.defaults, ...r };
1131
- }), this;
1132
- }
1133
- setOptions(e) {
1134
- return this.defaults = { ...this.defaults, ...e }, this;
1135
- }
1136
- lexer(e, t) {
1137
- return x.lex(e, t ?? this.defaults);
1138
- }
1139
- parser(e, t) {
1140
- return b.parse(e, t ?? this.defaults);
1141
- }
1142
- parseMarkdown(e) {
1143
- return (n, r) => {
1144
- let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
1145
- if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1146
- if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1147
- if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1148
- if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1149
- let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1150
- s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1151
- let h = await (s.hooks ? await s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, s);
1152
- return s.hooks ? await s.hooks.postprocess(h) : h;
1153
- })().catch(a);
1154
- try {
1155
- s.hooks && (n = s.hooks.preprocess(n));
1156
- let l = (s.hooks ? s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, s);
1157
- s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1158
- let c = (s.hooks ? s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(l, s);
1159
- return s.hooks && (c = s.hooks.postprocess(c)), c;
1160
- } catch (o) {
1161
- return a(o);
1162
- }
1163
- };
1164
- }
1165
- onError(e, t) {
1166
- return (n) => {
1167
- if (n.message += `
1168
- Please report this to https://github.com/markedjs/marked.`, e) {
1169
- let r = "<p>An error occurred:</p><pre>" + T(n.message + "", true) + "</pre>";
1170
- return t ? Promise.resolve(r) : r;
1171
- }
1172
- if (t) return Promise.reject(n);
1173
- throw n;
1174
- };
1175
- }
1176
- };
1177
- var L = new D();
1178
- function g(u3, e) {
1179
- return L.parse(u3, e);
1180
- }
1181
- g.options = g.setOptions = function(u3) {
1182
- return L.setOptions(u3), g.defaults = L.defaults, G(g.defaults), g;
1183
- };
1184
- g.getDefaults = M;
1185
- g.defaults = O;
1186
- g.use = function(...u3) {
1187
- return L.use(...u3), g.defaults = L.defaults, G(g.defaults), g;
1188
- };
1189
- g.walkTokens = function(u3, e) {
1190
- return L.walkTokens(u3, e);
1191
- };
1192
- g.parseInline = L.parseInline;
1193
- g.Parser = b;
1194
- g.parser = b.parse;
1195
- g.Renderer = y;
1196
- g.TextRenderer = $;
1197
- g.Lexer = x;
1198
- g.lexer = x.lex;
1199
- g.Tokenizer = w;
1200
- g.Hooks = P;
1201
- g.parse = g;
1202
- var Qt = g.options;
1203
- var jt = g.setOptions;
1204
- var Ft = g.use;
1205
- var Ut = g.walkTokens;
1206
- var Kt = g.parseInline;
1207
- var Xt = b.parse;
1208
- var Jt = x.lex;
1209
-
1210
- // data/themes.ts
1211
- var themes = [
1212
- {
1213
- id: "lorem",
1214
- label: "Lorem Ipsum",
1215
- icon: "i-lucide-scroll-text",
1216
- paragraphs: [
1217
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.",
1218
- "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.",
1219
- "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis.",
1220
- "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.",
1221
- "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt.",
1222
- "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias.",
1223
- "Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est.",
1224
- "Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.",
1225
- "Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.",
1226
- "Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur."
1227
- ],
1228
- headings: [
1229
- "Overview",
1230
- "Introduction",
1231
- "Summary",
1232
- "Details",
1233
- "Features",
1234
- "Usage",
1235
- "Examples",
1236
- "Notes",
1237
- "Lorem Ipsum",
1238
- "Dolor Sit Amet",
1239
- "Getting Started",
1240
- "Key Concepts",
1241
- "Best Practices",
1242
- "Common Patterns",
1243
- "Quick Reference",
1244
- "Consectetur Adipiscing Elit",
1245
- "Sed Do Eiusmod Tempor",
1246
- "Understanding the Basics",
1247
- "Advanced Configuration Options",
1248
- "Working with Components",
1249
- "Implementation Guidelines",
1250
- "Troubleshooting Common Issues",
1251
- "Performance Optimization Tips"
1252
- ],
1253
- listItems: ["Item one", "Item two", "Item three"]
1254
- },
1255
- {
1256
- id: "dog",
1257
- label: "Dog-em Ipsum",
1258
- icon: "i-lucide-dog",
1259
- paragraphs: [
1260
- "Canis familiaris borkus maximus, Labrador retrievus golden floofen. Corgi pembrokius welshii adorabilis, Shiba inu doge originalis. Vizsla hungaricus pointer nobilum, Weimaraner grayus ghosticus elegantum.",
1261
- "Pomeranian spitzus flooficus, Papillon butterflii earus magnificus. Basenji barklessum africanum, Akita inuus loyalis protectum. Samoyed cloudus whiteum smilius, Malamute alaskanus pullum sledicus.",
1262
- "Beagle snoopicus howlii detectivum, Basset houndus droopii earus longum. Dachshund wienerii tunnelus shortlegum, Bloodhound trackerii scentus supremum. Borzoi russianus speedii elegantus.",
1263
- "Schnauzer beardicus germanium miniatus, Affenpinscher monkii terrius scruffum. Keeshond dutchii floofium grayus, Schipperke belgicus blackus smallum. Leonberger giantus goldenii gentleum.",
1264
- "Cavalier kingus spanielii heartum, Havanese cubanensis silkii lapus. Maltese whiteus ancienti nobleum, Bichon friseum powderii puffus. Shih tzu lionus chrysanthemum flowen.",
1265
- "Doberman pinscherii guardus athleticus, Rottweiler romanum driverii strongum. Boxer playfulis musculus goofium, German shepherdii loyalis intelligentum. Mastiff enormicus gentleum giantus.",
1266
- "Husky sibericus blueeyes pullum, Bernese mountainus tricolorus sweetum. Newfoundland waterus rescuii giantum, Saint Bernard alpinus rescuii barrelum. Great Dane apollous tallestum dogicus.",
1267
- "Poodle standardus curlius smarticum, Goldendoodle hybridicus floofium allergii. Labradoodle crossii friendlius serviceum, Cockapoo mixus adorablis cuddleum. Maltipoo tinicus fluffium lapsum.",
1268
- "Bulldog englishum wrinklii stockium, Frenchie batears snortius compactum. Pug wrinklorum snorticus curlytailus, Boston terrier tuxedous gentlemanicum. Boxer wiggleum excitus playfulium.",
1269
- "Terrier spiritus feistii braveum, Yorkshire tinicus silkii bluetan. Jack Russell energius boundlessum zoomii, Westie whiteum scottius cheerfulem. Airedale kingus terrierii largestum."
1270
- ],
1271
- headings: [
1272
- "Woof",
1273
- "Good Boy",
1274
- "Fetch Time",
1275
- "Treats",
1276
- "Walkies",
1277
- "Zoomies",
1278
- "Snoot Boops",
1279
- "Belly Rubs",
1280
- "The Pack Life",
1281
- "Puppy Love",
1282
- "Tail Wagging Tales",
1283
- "Bark Park Adventures",
1284
- "Loyal Companions",
1285
- "Paw Patrol",
1286
- "Furry Friends Forever",
1287
- "The Art of the Fetch",
1288
- "Mastering Puppy Eyes",
1289
- "Advanced Treat Negotiations",
1290
- "Squirrel Watching 101",
1291
- "Nap Time Strategies",
1292
- "The Perfect Belly Rub",
1293
- "Mailman Alertness Training",
1294
- "Ultimate Zoomie Techniques"
1295
- ],
1296
- listItems: ["Woof woof", "Bark bark", "Good boy"]
1297
- },
1298
- {
1299
- id: "cat",
1300
- label: "Cat-em Ipsum",
1301
- icon: "i-lucide-cat",
1302
- paragraphs: [
1303
- "Felis catus purrensis maximus, Siamese vocalius blueeyes pointum. Abyssinian tickedus wildii ancienti, Persian flooficum flatfaceus luxurium. Maine Coon giantus gentleus tuftedum earus.",
1304
- "Ragdoll floppicus docilum blueum, Birman sacredus burmanis mittenii. Tonkinese aquaeus mixicum sociablis, Burmese musculus sableum voicium. Balinese longhairus siamicum gracilum.",
1305
- "Russian Blue grayus plushicum shyus, Chartreux frenchii smileum quietum. Korat silverii thailandus luckium, British Shorthair chonkus roundii calmicum. Scottish Fold earfoldus sweetium.",
1306
- "Sphynx hairlessum warmicus wrinkleum, Peterbald elegantus russianum baldicum. Devon Rex elficus curlium pixius, Cornish Rex wavycoatum slenderum playfulem. Oriental sleekus largeearus vocalem.",
1307
- "Bengal leopardicus wildii glitterum, Savannah tallestus africanicum servalum. Ocicat spotticum domesticus wildlookum, Egyptian Mau ancienti spottium fastestum. Toyger stripedus tigerium miniatum.",
1308
- "Norwegian Forest flufficus vikingii waterproofum, Siberian hypoallergicus russianum forestii. Nebelung longhairum grayplushum rareum, Turkish Van swimmicus vanum patternum. Somali foxii longhairus tickedum.",
1309
- "Himalayan persicum pointus fluffium, Exotic Shorthair teddybearum calmicus. Ragamuffin largeum sweeticus docilum, Selkirk Rex curlycoatum sheepii patientum. LaPerm curlicus wavium uniqueum.",
1310
- "Manx taillessum islandicus roundum, Japanese Bobtail pompomii luckyus ancienti. Cymric longhairus manxicum floofem, American Bobtail wildlookum bobbium friendlius. Pixie-Bob polydactylum largeus.",
1311
- "Singapura smallestum draincat sepiatum, Havana Brown chocolatum greeneyeum sleekus. Bombay pantherii blackus coppereyeum, Burmilla shimmeryum silverii gentleum. Chausie jungleum hybridicus athletum.",
1312
- "Turkish Angora ancienti elegantum silkium, Javanese colorpointum longhairum vocalem. Snowshoe pointicum mittenus blueeyes, Khao Manee diamondeyeum whiteum raricum. Lykoi werewolfii partialum hairlessum."
1313
- ],
1314
- headings: [
1315
- "Meow",
1316
- "Purr Life",
1317
- "Nap Time",
1318
- "Judgment",
1319
- "Treats Now",
1320
- "Box Fort",
1321
- "Zoomies",
1322
- "Worship",
1323
- "Feline Royalty",
1324
- "The Art of Napping",
1325
- "Sunbeam Seeking",
1326
- "Human Training",
1327
- "Cardboard Castles",
1328
- "Mysterious Ways",
1329
- "Graceful Hunters",
1330
- "Mastering the Slow Blink",
1331
- "Advanced Ankle Weaving",
1332
- "Strategic Hairball Placement",
1333
- "Window Bird Theater",
1334
- "Midnight Zoomie Protocol",
1335
- "Perfecting the Judgmental Stare",
1336
- "Keyboard Sitting Techniques",
1337
- "The Unwritten Laws of If It Fits"
1338
- ],
1339
- listItems: ["Meow meow", "Purr purr", "Feed me now"]
1340
- },
1341
- {
1342
- id: "baked",
1343
- label: "Baked-em Ipsum",
1344
- icon: "i-lucide-croissant",
1345
- paragraphs: [
1346
- "Brioche enrichum butteratum, p\xE2te feuillet\xE9e laminatum croissantus. G\xE9noise spongicum lightus, mille-feuille layerus crispatum. Baguette croustillant scoreum, pain de campagne rusticorum artisanum.",
1347
- "Kouign-amann caramelus buttericum bretonnium, canel\xE9 bordelais crustatum custardum. Financier almondium brownbutterum, madeleine shellicus proustium. P\xE2te \xE0 choux profiterolum \xE9clairum.",
1348
- "Challah braidicum enrichum eggyatum, babka swirlius chocolatum cinnamonum. Panettone milanensis fruiticum domeus, stollen germanicum marzipanum powderus. Pandoro starshapum goldenum veronensis.",
1349
- "Fougasse proven\xE7alum olivatum herbus, focaccia italicum dimpledus rosmarinum. Ciabatta slipperum holeum crustycrumbum, grissini stickum thinicum crispus. Pane pugliese durumwheaticum semolinum.",
1350
- "Tarte tatin caramelum inversus appleum, galette rusticorum freeformum buttercrust. Clafoutis cherrium custardum limousinum, far breton pruneatum densium. G\xE2teau basque creamfilledus almondcrust.",
1351
- "Viennoiserie butteratum laminum, pain au chocolat croissantdoughum. Chausson aux pommes appleturnoverum, palmier elephantearus sugarcrispum. Brioche feuillet\xE9e hybridium richum.",
1352
- "Sachertorte viennensis chocolatum apricotglazeum, schwarzw\xE4lder kirschtorte cherryum creamum. Dobos torta hungaricum carameltopum layerus, esterh\xE1zy walnuttum buttercreamus. Linzer torte latticum raspberryjam.",
1353
- "Sfogliatella napoletanum shellicum ricottafillum, cassata siciliana marzipanum candiedfruitum. Cannoli tubicum crispum sweetricottum, zeppole choux friedum creamtoppum. Baba au rhum yeastcakem syrupsoakum.",
1354
- "Cr\xE8me p\xE2tissi\xE8re vanillum custardum pipeum, frangipane almondcreamum tartfillingus. Cr\xE9meux smoothum richicum glossyum, ganache chocolatum creaminfusum. Buttercream swissum italicum frenchum.",
1355
- "Levain naturalum yeastium starterus, poolish prefermentum frenchium hydrateum. Biga italicum stiffum flavordevlopum, tangzhong asianicum waterroux softicum. Autolyse restum hydrateum glutenum."
1356
- ],
1357
- headings: [
1358
- "Fresh",
1359
- "Golden",
1360
- "Flaky",
1361
- "Sweet",
1362
- "Crusty",
1363
- "Doughy",
1364
- "Baked",
1365
- "Yummy",
1366
- "From the Oven",
1367
- "Rise and Shine",
1368
- "Butter Makes Better",
1369
- "Sugar and Spice",
1370
- "Crust Perfection",
1371
- "The Proof is Rising",
1372
- "Flour Power",
1373
- "The Art of Lamination",
1374
- "Mastering Sourdough Starters",
1375
- "Perfect Pie Crust Techniques",
1376
- "Croissant Folding Guide",
1377
- "Cookie Science Explained",
1378
- "Bread Scoring Patterns",
1379
- "Frosting and Decorating Tips",
1380
- "The Magic of Fermentation"
1381
- ],
1382
- listItems: ["Yum yum", "So tasty", "Freshly baked"]
1383
- },
1384
- {
1385
- id: "bbq",
1386
- label: "BBQ-em Ipsum",
1387
- icon: "i-lucide-flame",
1388
- paragraphs: [
1389
- "Brisketum pectoralis slowcookum, puntum deckle fattium marbleum. Hickorium quercus mesquitum pecanwood, fumum aromatus carbonis ignum. Pitmasterus tendum focum, temperaturum constantus duecentum.",
1390
- "Costae spareum backribus, sancti ludovici trimatum neaticus. Fricatum paprikum sugarbrownum, allium cuminatum piperum salum. Involvum chartapaper foilum, requiem sliceum servum.",
1391
- "Porcus pullum shoulderum, forkum tenderum shredicus altum. Carolina acetum mustardus, Kansas Civitas dulcis crassum. Coleslavium pickledus panisalbus, proprium plateum completum.",
1392
- "Brisketum planum puntum totum, pinguem capsum updownum debatum. Fumus annulus roseum halum, probatum technicum igneum. Sectum contra granum semper, humidus macer finibus ustum.",
1393
- "Finibus ustum dulcis carneum, caramelum cubum iactum salsamentum. Puntum separatum cubum, revertum fumatorium horam plus. Crispum marginibus tenerum centrum, pitmasterus praemium meritum.",
1394
- "Farciminis nexum calidus intestinum, crepitus tegumen sucus eruptum. Bubulum porcinum mixtum conditum, fumum iuxta praecipuum sectum. Obliquum servum superbus, sinapis optionalum acceptum.",
1395
- "Pullum femur quartum totum, pellis crispum carnem sucum. Alabama salsamentum album, acetum Carolina moppum stylum. Tractum fumatum grillum optiones, gallinaceum rectum bonum.",
1396
- "Fricatum siccum pasta humidum, pernoctem frigidarium marinatum requiem. Sal piper simplex Texanum, complexum Memphis mixtum secretum. Applicare generosum aequum tegmen, cortex formatur pulchre.",
1397
- "Lateribus fabae coleslavium paniscornum, caseum macaroni salatum tuberosum. Pickledus cepae jalape\xF1us, panisalbus butyrum sectum. Completum plateum aequilibratum prandium, carneum stella lateribus sustentum.",
1398
- "Fumus surgit caminus ascendit, linea formatur mane fidelis. Venditum signum timendum, mane avis obtinet carneum. Dignum omnis expectatio minutum, pitmasterus ars respectum."
1399
- ],
1400
- headings: [
1401
- "Smoked",
1402
- "Low and Slow",
1403
- "The Pit",
1404
- "Fire",
1405
- "Bark",
1406
- "Rub",
1407
- "Sauce",
1408
- "Tender",
1409
- "Pitmaster Wisdom",
1410
- "Smoke Ring Secrets",
1411
- "Brisket Basics",
1412
- "Rib Techniques",
1413
- "Regional Styles",
1414
- "Wood Selection",
1415
- "Temperature Control",
1416
- "The Art of the Smoke",
1417
- "Building the Perfect Fire",
1418
- "Mastering the Meat Sweats",
1419
- "Competition BBQ Secrets",
1420
- "Sauce Versus Dry Rub",
1421
- "Choosing Your Wood",
1422
- "The Overnight Cook",
1423
- "From Pit to Plate"
1424
- ],
1425
- listItems: ["Smoky goodness", "Fall off the bone", "Worth the wait"]
1426
- }
1427
- ];
1428
-
1429
- // utils/random.ts
1430
- var LCPRNG_MULTIPLIER = 9301;
1431
- var LCPRNG_INCREMENT = 49297;
1432
- var LCPRNG_MODULUS = 233280;
1433
- var MAX_SEED = 2147483647;
1434
- function normalizeSeed(seedValue) {
1435
- if (!Number.isFinite(seedValue)) return 0;
1436
- const whole = Math.trunc(seedValue);
1437
- return (whole % LCPRNG_MODULUS + LCPRNG_MODULUS) % LCPRNG_MODULUS;
1438
- }
1439
- var SEED_PERIOD = LCPRNG_MODULUS;
1440
- var SEED_OFFSETS = {
1441
- HEADINGS: 500,
1442
- BLOCK_SIZES: 1e3
1193
+ link({ text: e }) {
1194
+ return "" + e;
1195
+ }
1196
+ image({ text: e }) {
1197
+ return "" + e;
1198
+ }
1199
+ br() {
1200
+ return "";
1201
+ }
1202
+ checkbox({ raw: e }) {
1203
+ return e;
1204
+ }
1443
1205
  };
1444
- function seededRandom(seedValue) {
1445
- let currentSeed = normalizeSeed(seedValue);
1446
- return {
1447
- next: () => {
1448
- currentSeed = (currentSeed * LCPRNG_MULTIPLIER + LCPRNG_INCREMENT) % LCPRNG_MODULUS;
1449
- return currentSeed / LCPRNG_MODULUS;
1450
- },
1451
- nextInt: (min, max) => {
1452
- currentSeed = (currentSeed * LCPRNG_MULTIPLIER + LCPRNG_INCREMENT) % LCPRNG_MODULUS;
1453
- return Math.floor(currentSeed / LCPRNG_MODULUS * (max - min + 1)) + min;
1206
+ var b = class u2 {
1207
+ options;
1208
+ renderer;
1209
+ textRenderer;
1210
+ constructor(e) {
1211
+ this.options = e || O, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
1212
+ }
1213
+ static parse(e, t) {
1214
+ return new u2(t).parse(e);
1215
+ }
1216
+ static parseInline(e, t) {
1217
+ return new u2(t).parseInline(e);
1218
+ }
1219
+ parse(e) {
1220
+ this.renderer.parser = this;
1221
+ let t = "";
1222
+ for (let n = 0; n < e.length; n++) {
1223
+ let r = e[n];
1224
+ if (this.options.extensions?.renderers?.[r.type]) {
1225
+ let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
1226
+ if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
1227
+ t += a || "";
1228
+ continue;
1229
+ }
1230
+ }
1231
+ let i = r;
1232
+ switch (i.type) {
1233
+ case "space": {
1234
+ t += this.renderer.space(i);
1235
+ break;
1236
+ }
1237
+ case "hr": {
1238
+ t += this.renderer.hr(i);
1239
+ break;
1240
+ }
1241
+ case "heading": {
1242
+ t += this.renderer.heading(i);
1243
+ break;
1244
+ }
1245
+ case "code": {
1246
+ t += this.renderer.code(i);
1247
+ break;
1248
+ }
1249
+ case "table": {
1250
+ t += this.renderer.table(i);
1251
+ break;
1252
+ }
1253
+ case "blockquote": {
1254
+ t += this.renderer.blockquote(i);
1255
+ break;
1256
+ }
1257
+ case "list": {
1258
+ t += this.renderer.list(i);
1259
+ break;
1260
+ }
1261
+ case "checkbox": {
1262
+ t += this.renderer.checkbox(i);
1263
+ break;
1264
+ }
1265
+ case "html": {
1266
+ t += this.renderer.html(i);
1267
+ break;
1268
+ }
1269
+ case "def": {
1270
+ t += this.renderer.def(i);
1271
+ break;
1272
+ }
1273
+ case "paragraph": {
1274
+ t += this.renderer.paragraph(i);
1275
+ break;
1276
+ }
1277
+ case "text": {
1278
+ t += this.renderer.text(i);
1279
+ break;
1280
+ }
1281
+ default: {
1282
+ let s = 'Token with "' + i.type + '" type was not found.';
1283
+ if (this.options.silent) return console.error(s), "";
1284
+ throw new Error(s);
1285
+ }
1286
+ }
1454
1287
  }
1455
- };
1456
- }
1457
- function shuffleWithSeed(array, seedValue) {
1458
- const shuffled = [...array];
1459
- const rng = seededRandom(seedValue);
1460
- for (let i = shuffled.length - 1; i > 0; i--) {
1461
- const j2 = Math.floor(rng.next() * (i + 1));
1462
- const temp = shuffled[i];
1463
- shuffled[i] = shuffled[j2];
1464
- shuffled[j2] = temp;
1288
+ return t;
1465
1289
  }
1466
- return shuffled;
1467
- }
1468
-
1469
- // utils/generate.ts
1470
- function generate(params) {
1471
- const { theme, blocks, seed, options } = params;
1472
- const paragraphs2 = shuffleWithSeed(theme.paragraphs, seed);
1473
- const headings = shuffleWithSeed(theme.headings, seed + SEED_OFFSETS.HEADINGS);
1474
- const listItems = theme.listItems;
1475
- const rng = seededRandom(seed + SEED_OFFSETS.BLOCK_SIZES);
1476
- const blockSeparator = options.noWrap ? " " : "\n\n";
1477
- const bodyBlocks = [];
1478
- let output = "";
1479
- let paragraphIndex = 0;
1480
- let headingIndex = 0;
1481
- let currentHeadingLevel = 1;
1482
- let blocksUntilNextHeading = 0;
1483
- const getNextHeading = () => {
1484
- const text = headings[headingIndex % headings.length] ?? "Section";
1485
- headingIndex++;
1486
- return options.capitalize ? text : text.toLowerCase();
1487
- };
1488
- const makeHeading = (level, text) => {
1489
- const hashes = "#".repeat(level);
1490
- if (options.noWrap) {
1491
- return `${hashes} ${text} `;
1290
+ parseInline(e, t = this.renderer) {
1291
+ this.renderer.parser = this;
1292
+ let n = "";
1293
+ for (let r = 0; r < e.length; r++) {
1294
+ let i = e[r];
1295
+ if (this.options.extensions?.renderers?.[i.type]) {
1296
+ let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1297
+ if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
1298
+ n += a || "";
1299
+ continue;
1300
+ }
1301
+ }
1302
+ let s = i;
1303
+ switch (s.type) {
1304
+ case "escape": {
1305
+ n += t.text(s);
1306
+ break;
1307
+ }
1308
+ case "html": {
1309
+ n += t.html(s);
1310
+ break;
1311
+ }
1312
+ case "link": {
1313
+ n += t.link(s);
1314
+ break;
1315
+ }
1316
+ case "image": {
1317
+ n += t.image(s);
1318
+ break;
1319
+ }
1320
+ case "checkbox": {
1321
+ n += t.checkbox(s);
1322
+ break;
1323
+ }
1324
+ case "strong": {
1325
+ n += t.strong(s);
1326
+ break;
1327
+ }
1328
+ case "em": {
1329
+ n += t.em(s);
1330
+ break;
1331
+ }
1332
+ case "codespan": {
1333
+ n += t.codespan(s);
1334
+ break;
1335
+ }
1336
+ case "br": {
1337
+ n += t.br(s);
1338
+ break;
1339
+ }
1340
+ case "del": {
1341
+ n += t.del(s);
1342
+ break;
1343
+ }
1344
+ case "text": {
1345
+ n += t.text(s);
1346
+ break;
1347
+ }
1348
+ default: {
1349
+ let a = 'Token with "' + s.type + '" type was not found.';
1350
+ if (this.options.silent) return console.error(a), "";
1351
+ throw new Error(a);
1352
+ }
1353
+ }
1492
1354
  }
1493
- return `${hashes} ${text}
1494
-
1495
- `;
1496
- };
1497
- for (let i = 0; i < blocks; i++) {
1498
- const blockSize = rng.nextInt(1, 3);
1499
- let blockContent = "";
1500
- for (let j2 = 0; j2 < blockSize; j2++) {
1501
- const rawSentence = paragraphs2[paragraphIndex % paragraphs2.length] ?? "";
1502
- paragraphIndex++;
1503
- const sentence = options.capitalize ? rawSentence : rawSentence.toLowerCase();
1504
- blockContent += sentence + " ";
1355
+ return n;
1356
+ }
1357
+ };
1358
+ var P = class {
1359
+ options;
1360
+ block;
1361
+ constructor(e) {
1362
+ this.options = e || O;
1363
+ }
1364
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
1365
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
1366
+ preprocess(e) {
1367
+ return e;
1368
+ }
1369
+ postprocess(e) {
1370
+ return e;
1371
+ }
1372
+ processAllTokens(e) {
1373
+ return e;
1374
+ }
1375
+ emStrongMask(e) {
1376
+ return e;
1377
+ }
1378
+ provideLexer(e = this.block) {
1379
+ return e ? x.lex : x.lexInline;
1380
+ }
1381
+ provideParser(e = this.block) {
1382
+ return e ? b.parse : b.parseInline;
1383
+ }
1384
+ };
1385
+ var D = class {
1386
+ defaults = M();
1387
+ options = this.setOptions;
1388
+ parse = this.parseMarkdown(true);
1389
+ parseInline = this.parseMarkdown(false);
1390
+ Parser = b;
1391
+ Renderer = y;
1392
+ TextRenderer = $;
1393
+ Lexer = x;
1394
+ Tokenizer = w;
1395
+ Hooks = P;
1396
+ constructor(...e) {
1397
+ this.use(...e);
1398
+ }
1399
+ walkTokens(e, t) {
1400
+ let n = [];
1401
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1402
+ case "table": {
1403
+ let i = r;
1404
+ for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
1405
+ for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
1406
+ break;
1407
+ }
1408
+ case "list": {
1409
+ let i = r;
1410
+ n = n.concat(this.walkTokens(i.items, t));
1411
+ break;
1412
+ }
1413
+ default: {
1414
+ let i = r;
1415
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1416
+ let a = i[s].flat(1 / 0);
1417
+ n = n.concat(this.walkTokens(a, t));
1418
+ }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
1419
+ }
1505
1420
  }
1506
- blockContent = blockContent.trim();
1507
- bodyBlocks.push(blockContent);
1508
- if (options.headers) {
1509
- if (i === 0) {
1510
- output += makeHeading(1, getNextHeading());
1511
- currentHeadingLevel = 2;
1512
- blocksUntilNextHeading = rng.nextInt(1, 3);
1513
- } else if (blocksUntilNextHeading <= 0) {
1514
- const decision = rng.nextInt(1, 10);
1515
- if (decision <= 3 && currentHeadingLevel < 4) {
1516
- currentHeadingLevel++;
1517
- } else if (decision <= 5 && currentHeadingLevel > 2) {
1518
- currentHeadingLevel--;
1519
- } else if (decision <= 7 && currentHeadingLevel > 2) {
1520
- currentHeadingLevel = 2;
1421
+ return n;
1422
+ }
1423
+ use(...e) {
1424
+ let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
1425
+ return e.forEach((n) => {
1426
+ let r = { ...n };
1427
+ if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
1428
+ if (!i.name) throw new Error("extension name required");
1429
+ if ("renderer" in i) {
1430
+ let s = t.renderers[i.name];
1431
+ s ? t.renderers[i.name] = function(...a) {
1432
+ let o = i.renderer.apply(this, a);
1433
+ return o === false && (o = s.apply(this, a)), o;
1434
+ } : t.renderers[i.name] = i.renderer;
1521
1435
  }
1522
- output += makeHeading(currentHeadingLevel, getNextHeading());
1523
- blocksUntilNextHeading = rng.nextInt(1, 4);
1524
- } else {
1525
- blocksUntilNextHeading--;
1436
+ if ("tokenizer" in i) {
1437
+ if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1438
+ let s = t[i.level];
1439
+ s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1440
+ }
1441
+ "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1442
+ }), r.extensions = t), n.renderer) {
1443
+ let i = this.defaults.renderer || new y(this.defaults);
1444
+ for (let s in n.renderer) {
1445
+ if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1446
+ if (["options", "parser"].includes(s)) continue;
1447
+ let a = s, o = n.renderer[a], l = i[a];
1448
+ i[a] = (...p) => {
1449
+ let c = o.apply(i, p);
1450
+ return c === false && (c = l.apply(i, p)), c || "";
1451
+ };
1452
+ }
1453
+ r.renderer = i;
1526
1454
  }
1527
- }
1528
- if (options.codeSnippets && i % 3 === 0) {
1529
- if (options.noWrap) {
1530
- output += "`const example = 'code';` ";
1531
- } else {
1532
- output += "```javascript\nconst example = 'code';\n```\n\n";
1455
+ if (n.tokenizer) {
1456
+ let i = this.defaults.tokenizer || new w(this.defaults);
1457
+ for (let s in n.tokenizer) {
1458
+ if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1459
+ if (["options", "rules", "lexer"].includes(s)) continue;
1460
+ let a = s, o = n.tokenizer[a], l = i[a];
1461
+ i[a] = (...p) => {
1462
+ let c = o.apply(i, p);
1463
+ return c === false && (c = l.apply(i, p)), c;
1464
+ };
1465
+ }
1466
+ r.tokenizer = i;
1533
1467
  }
1534
- }
1535
- if (options.blockquotes && i % 2 === 1) {
1536
- if (options.noWrap) {
1537
- output += `> ${blockContent.slice(0, 100)}... `;
1538
- } else {
1539
- output += `> ${blockContent.slice(0, 100)}...
1540
-
1541
- `;
1468
+ if (n.hooks) {
1469
+ let i = this.defaults.hooks || new P();
1470
+ for (let s in n.hooks) {
1471
+ if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1472
+ if (["options", "block"].includes(s)) continue;
1473
+ let a = s, o = n.hooks[a], l = i[a];
1474
+ P.passThroughHooks.has(s) ? i[a] = (p) => {
1475
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(s)) return (async () => {
1476
+ let d = await o.call(i, p);
1477
+ return l.call(i, d);
1478
+ })();
1479
+ let c = o.call(i, p);
1480
+ return l.call(i, c);
1481
+ } : i[a] = (...p) => {
1482
+ if (this.defaults.async) return (async () => {
1483
+ let d = await o.apply(i, p);
1484
+ return d === false && (d = await l.apply(i, p)), d;
1485
+ })();
1486
+ let c = o.apply(i, p);
1487
+ return c === false && (c = l.apply(i, p)), c;
1488
+ };
1489
+ }
1490
+ r.hooks = i;
1542
1491
  }
1543
- }
1544
- if (options.lists && i % 3 === 2) {
1545
- if (options.noWrap) {
1546
- const items = listItems.map((item) => `\u2022 ${options.capitalize ? item : item.toLowerCase()}`).join(" ");
1547
- output += items + " ";
1548
- } else {
1549
- const items = listItems.map((item) => `- ${options.capitalize ? item : item.toLowerCase()}`).join("\n");
1550
- output += items + "\n\n";
1492
+ if (n.walkTokens) {
1493
+ let i = this.defaults.walkTokens, s = n.walkTokens;
1494
+ r.walkTokens = function(a) {
1495
+ let o = [];
1496
+ return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1497
+ };
1551
1498
  }
1552
- }
1553
- if (options.links && i % 4 === 0) {
1554
- const linkText = options.capitalize ? "Learn more" : "learn more";
1555
- output += `[${linkText}](https://example.com) `;
1556
- }
1557
- output += blockContent + blockSeparator;
1499
+ this.defaults = { ...this.defaults, ...r };
1500
+ }), this;
1558
1501
  }
1559
- if (options.noWrap) {
1560
- output = output.replace(/<br\s*\/?>/gi, " ");
1561
- output = output.replace(/\n+/g, " ");
1562
- output = output.replace(/\s+/g, " ");
1563
- output = output.trim();
1564
- } else if (output.endsWith("\n\n")) {
1565
- output = output.slice(0, -2);
1502
+ setOptions(e) {
1503
+ return this.defaults = { ...this.defaults, ...e }, this;
1566
1504
  }
1567
- return { text: output, blocks: bodyBlocks };
1568
- }
1569
- function generateText(params) {
1570
- return generate(params).text;
1571
- }
1572
- function generateBlocks(params) {
1573
- return generate(params).blocks;
1505
+ lexer(e, t) {
1506
+ return x.lex(e, t ?? this.defaults);
1507
+ }
1508
+ parser(e, t) {
1509
+ return b.parse(e, t ?? this.defaults);
1510
+ }
1511
+ parseMarkdown(e) {
1512
+ return (n, r) => {
1513
+ let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
1514
+ if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1515
+ if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1516
+ if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1517
+ if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1518
+ let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1519
+ s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1520
+ let h = await (s.hooks ? await s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, s);
1521
+ return s.hooks ? await s.hooks.postprocess(h) : h;
1522
+ })().catch(a);
1523
+ try {
1524
+ s.hooks && (n = s.hooks.preprocess(n));
1525
+ let l = (s.hooks ? s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, s);
1526
+ s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1527
+ let c = (s.hooks ? s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(l, s);
1528
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
1529
+ } catch (o) {
1530
+ return a(o);
1531
+ }
1532
+ };
1533
+ }
1534
+ onError(e, t) {
1535
+ return (n) => {
1536
+ if (n.message += `
1537
+ Please report this to https://github.com/markedjs/marked.`, e) {
1538
+ let r = "<p>An error occurred:</p><pre>" + T(n.message + "", true) + "</pre>";
1539
+ return t ? Promise.resolve(r) : r;
1540
+ }
1541
+ if (t) return Promise.reject(n);
1542
+ throw n;
1543
+ };
1544
+ }
1545
+ };
1546
+ var L = new D();
1547
+ function g(u3, e) {
1548
+ return L.parse(u3, e);
1574
1549
  }
1575
- function markdownToPlainText(markdown) {
1576
- return markdown.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, "").replace(/(^|\s)#{1,6}[ \t]+/g, "$1").replace(/(^|\s)>[ \t]+/g, "$1").replace(/(^|\s)[-*•][ \t]+/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/[ \t]{2,}/g, " ").replace(/\n{3,}/g, "\n\n").trim();
1550
+ g.options = g.setOptions = function(u3) {
1551
+ return L.setOptions(u3), g.defaults = L.defaults, G(g.defaults), g;
1552
+ };
1553
+ g.getDefaults = M;
1554
+ g.defaults = O;
1555
+ g.use = function(...u3) {
1556
+ return L.use(...u3), g.defaults = L.defaults, G(g.defaults), g;
1557
+ };
1558
+ g.walkTokens = function(u3, e) {
1559
+ return L.walkTokens(u3, e);
1560
+ };
1561
+ g.parseInline = L.parseInline;
1562
+ g.Parser = b;
1563
+ g.parser = b.parse;
1564
+ g.Renderer = y;
1565
+ g.TextRenderer = $;
1566
+ g.Lexer = x;
1567
+ g.lexer = x.lex;
1568
+ g.Tokenizer = w;
1569
+ g.Hooks = P;
1570
+ g.parse = g;
1571
+ var Qt = g.options;
1572
+ var jt = g.setOptions;
1573
+ var Ft = g.use;
1574
+ var Ut = g.walkTokens;
1575
+ var Kt = g.parseInline;
1576
+ var Xt = b.parse;
1577
+ var Jt = x.lex;
1578
+
1579
+ // utils/html.ts
1580
+ function renderHtml(params) {
1581
+ const wrapped = generateText({ ...params, options: { ...params.options, noWrap: false } });
1582
+ const html = g.parse(wrapped, { async: false }).trimEnd();
1583
+ return params.options.noWrap ? html.replace(/\n/g, "") : html;
1577
1584
  }
1578
1585
 
1579
1586
  // packages/ipsumify/src/index.ts
@@ -1581,12 +1588,23 @@ var MIN_BLOCKS = 1;
1581
1588
  var MAX_BLOCKS = 20;
1582
1589
  var DEFAULT_BLOCKS = 5;
1583
1590
  var DEFAULT_THEME = "lorem";
1584
- var FORMATS = ["markdown", "text", "html"];
1585
- var themes2 = themes.map((t) => ({ id: t.id, label: t.label }));
1591
+ var FORMATS = Object.freeze(["markdown", "text", "html"]);
1592
+ var themes2 = Object.freeze(
1593
+ themes.map((t) => Object.freeze({ id: t.id, label: t.label }))
1594
+ );
1586
1595
  function randomSeed() {
1587
1596
  return Math.floor(Math.random() * SEED_PERIOD);
1588
1597
  }
1589
- function resolve(options) {
1598
+ var SWITCHES = ["headers", "code", "quotes", "lists", "links", "lowercase", "noWrap"];
1599
+ function resolve(options, { checkFormat = true } = {}) {
1600
+ if (typeof options !== "object" || options === null || Array.isArray(options)) {
1601
+ throw new TypeError("ipsumify: options must be an object, for example { blocks: 3 }.");
1602
+ }
1603
+ for (const name of SWITCHES) {
1604
+ if (options[name] !== void 0 && typeof options[name] !== "boolean") {
1605
+ throw new TypeError(`ipsumify: "${name}" must be true or false.`);
1606
+ }
1607
+ }
1590
1608
  const themeId = options.theme ?? DEFAULT_THEME;
1591
1609
  const theme = themes.find((t) => t.id === themeId);
1592
1610
  if (!theme) {
@@ -1601,7 +1619,7 @@ function resolve(options) {
1601
1619
  throw new RangeError(`Invalid seed "${seed}". Must be a whole number between 0 and ${MAX_SEED}.`);
1602
1620
  }
1603
1621
  const format = options.format ?? "markdown";
1604
- if (!FORMATS.includes(format)) {
1622
+ if (checkFormat && !FORMATS.includes(format)) {
1605
1623
  throw new RangeError(`Invalid format "${format}". Valid formats: ${FORMATS.join(", ")}`);
1606
1624
  }
1607
1625
  return {
@@ -1624,13 +1642,12 @@ function resolve(options) {
1624
1642
  }
1625
1643
  function ipsumify(options = {}) {
1626
1644
  const { format, params } = resolve(options);
1645
+ if (format === "html") return renderHtml(params);
1627
1646
  const markdown = generateText(params);
1628
- if (format === "text") return markdownToPlainText(markdown);
1629
- if (format === "html") return g.parse(markdown, { async: false }).trimEnd();
1630
- return markdown;
1647
+ return format === "text" ? markdownToPlainText(markdown) : markdown;
1631
1648
  }
1632
1649
  function paragraphs(options = {}) {
1633
- return generateBlocks(resolve(options).params);
1650
+ return generateBlocks(resolve(options, { checkFormat: false }).params);
1634
1651
  }
1635
1652
  var src_default = ipsumify;
1636
1653